--- /dev/null
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# 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.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT("gallery-tv-ref" CXX C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(PKGS REQUIRED
+ elementary
+ capi-appfw-application
+ dlog
+ ecore-x
+ edje
+ evas
+ x11
+ aul
+ appsvc
+ application-common
+ capi-content-media-content)
+
+IF(NOT DEFINED PACKAGE_NAME)
+ SET(PACKAGE_NAME "org.tizen.gallery-tv-ref")
+ENDIF(NOT DEFINED PACKAGE_NAME)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+IF(NOT DEFINED BINDIR)
+ SET(BINDIR "${PREFIX}/bin")
+ENDIF(NOT DEFINED BINDIR)
+IF(NOT DEFINED RESDIR)
+ SET(RESDIR "${PREFIX}/res")
+ENDIF(NOT DEFINED RESDIR)
+IF(NOT DEFINED EDJEDIR)
+ SET(EDJEDIR "${PREFIX}/res/edje")
+ENDIF(NOT DEFINED EDJEDIR)
+IF(NOT DEFINED LOCALEDIR)
+ SET(LOCALEDIR "${PREFIX}/res/locale")
+ENDIF(NOT DEFINED LOCALEDIR)
+IF(NOT DEFINED IMAGEDIR)
+ SET(IMAGEDIR "${PREFIX}/res/images")
+ENDIF(NOT DEFINED IMAGEDIR)
+IF(NOT DEFINED MANIFESTDIR)
+ SET(MANIFESTDIR "/usr/share/packages")
+ENDIF(NOT DEFINED MANIFESTDIR)
+IF(NOT DEFINED DESKTOP_ICONDIR)
+ SET(DESKTOP_ICONDIR "/usr/share/icons/default/small")
+ENDIF(NOT DEFINED DESKTOP_ICONDIR)
+IF(NOT DEFINED DESKTOP_ICON)
+ SET(DESKTOP_ICON ${PACKAGE_NAME}.png)
+ENDIF(NOT DEFINED DESKTOP_ICON)
+
+SET(SRCS
+src/main.cpp
+src/view/gallery-view/gallery_view.cpp
+src/view/gallery-view/layout_all.cpp
+src/view/gallery-view/layout_events.cpp
+src/view/gallery-view/layout_folder.cpp
+src/view/ctxtmenu-view/ctxtmenu_view.cpp
+src/view/photo-viewer/photoviewer_view.cpp
+src/view/photo-viewer/zoom_view.cpp
+src/view/video-player/video_player.cpp
+src/data/mediadata.cpp
+src/data/imagedata.cpp
+src/data/videodata.cpp
+src/data/eventdata.cpp
+src/util/util.cpp
+src/util/timeout_handler.cpp
+src/common/menudef.cpp
+)
+
+SET(TARGET_EDJ "${PROJECT_NAME}.edj")
+SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
+
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
+ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view/gallery-view)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view/ctxtmenu-view)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view/photo-viewer)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view/video-player)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view/)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/data)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/util)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/common)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+FOREACH(flag ${PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O2 -Wall -Werror -Wextra -Wno-unused-parameter -Wshadow -Wwrite-strings -fno-common -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fsigned-char -fstrict-overflow -Wno-ignored-qualifiers -Wno-array-bounds -Wno-empty-body")
+SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O2 -Wall -Werror -Wextra -Wno-unused-parameter -Wshadow -Wwrite-strings -fno-common -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fsigned-char -fstrict-overflow -Wno-ignored-qualifiers -Wno-array-bounds -Wno-empty-body")
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
+CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
+INSTALL(FILES ${PACKAGE_NAME}.manifest DESTINATION ${MANIFESTDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON_4X2} DESTINATION ${DESKTOP_ICONDIR})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
+ADD_SUBDIRECTORY(res/edc)
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DBG_H__
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "org.tizen.gallery"
+
+#ifndef _ERR
+#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+#ifndef _DBG
+#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+#ifndef _INFO
+#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+
+#endif /* __DBG_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 LAYOUT_ALL "LAYOUT_ALL"
+#define LAYOUT_FOLDER "LAYOUT_FOLDER"
+#define LAYOUT_EVENT "LAYOUT_EVENT"
+
+#define VIEW_GALLERY "GALLERY"
+#define VIEW_PHOTO_VIEWER "PHOTO_VIEWER"
+#define VIEW_PHOTO_ZOOM "PHOTO_ZOOM"
+#define VIEW_CTXT_MENU "CTXT_MENU"
+
+#define PRIV_DATA "PRIV_DATA"
+#define LAYOUT_ALL_DATA "LAYOUT_ALL_DATA"
+#define LAYOUT_EVENT_DATA "LAYOUT_EVENT_DATA"
+#define LAYOUT_FOLDER_DATA "LAYOUT_FOLDER_DATA"
+
+#define KEY_ENTER "Return"
+#define KEY_BACK "Escape"
+#define KEY_RIGHT "Right"
+#define KEY_LEFT "Left"
+#define KEY_MENU "Super_L"
+
+/* Part name definitions */
+#define PART_CONTENTAREA "content.area"
+#define PART_SWALLOWAREA "swallow.area"
+#define PART_TITLETEXT "title.text"
+#define PART_RESOLUTIONTEXT "resolution.text"
+#define PART_SOURCETEXT "source.text"
+#define PART_DATETEXT "date.text"
+#define PART_COUNTTEXT "count.text"
+#define PART_CURRENTTEXT "current.text"
+#define PART_LEFTSWALLOW "left_swallow"
+#define PART_HOVERSELAREA1 "hoversel_area1"
+#define PART_HOVERSELAREA2 "hoversel_area2"
+#define PART_ELM_SWALLOWICON "elm.swallow.icon"
+#define PART_ELM_SWALLOWICON2 "elm.swallow.icon2"
+#define PART_PHOTOCOUNT "photocount"
+#define PART_VIDEOCOUNT "videocount"
+#define PART_FILECOUNT "elm.text.count"
+#define PART_PLAYTIME "elm.text.playtime"
+#define PART_CATEGORY_TITLE "category.title"
+#define PART_NOCONTENTAREA1 "nocontent.area1"
+#define PART_NOCONTENTAREA2 "nocontent.area2"
+#define PART_CONTENT_THUMBNAIL "content.thumbnail"
+#define PART_CONTENT_TITLE "content.title"
+#define PART_CONTENT_INFO "content.info"
+#define PART_CONTENT_INFO_TXT "content.info.txt"
+#define PART_BTN_ICON "button.icon"
+#define PART_BTN_TITLE "button.title"
+#define PART_FUNC_BTN "function.button"
+#define PART_RELCONT_TXT "related_content.text"
+#define PART_RELCONT "related_content"
+#define PART_UPARROW "uparrow"
+#define PART_DOWNARROW "downarrow"
+#define PART_LEFTARROW "leftarrow"
+#define PART_RIGHTARROW "rightarrow"
+#define PART_ZOOM_NAVI "zoom_navi"
+#define PART_ZOOM_NAVI_IMG "zoom_navi.img"
+#define PART_ZOOM_NAVI_IMG_BORDER "zoom_navi.img.border"
+#define PART_ZOOM_NAVI_RECT "zoom_navi.rect"
+
+/* Group name definitions */
+#define GRP_PHOTO_VIEWER "photo_viewer"
+#define GRP_VIDEO_PLAYER "video_player"
+#define GRP_GALLERY_VIEW "gallery_view"
+#define GRP_CTXT_MENU "contextual_menu"
+#define GRP_CTXT_MENU_CONTENT_INFO "contextual_menu_content_info"
+#define GRP_CTXT_MENU_BTN "contextual_menu_button"
+#define GRP_LAYOUT_ALL "layout_all"
+#define GRP_LAYOUT_EVENTS "layout_events"
+#define GRP_ZOOM_VIEW "zoom_view"
+#define GRP_ZOOM_NAVI "zoom_navi"
+
+/* Signal definitions */
+#define SIG_SELECTED "selected"
+#define SIG_CLICKED "clicked"
+#define SIG_SCROLL "scroll"
+#define SIG_FOCUSED "focused"
+#define SIG_UNFOCUSED "unfocused"
+#define SIG_RELEASED "released"
+#define SIG_ACTIVATED "activated"
+#define SIG_REALIZED "realized"
+#define SIG_UNREALIZED "unrealized"
+#define SIG_HIDE "hide"
+#define SIG_SHOW "show"
+#define SIG_SHOW_FINISH "show,finish"
+#define SIG_UPARROW_SHOW "uparrow,show"
+#define SIG_UPARROW_HIDE "uparrow,hide"
+#define SIG_DOWNARROW_SHOW "downarrow,show"
+#define SIG_DOWNARROW_HIDE "downarrow,hide"
+#define SIG_LEFTARROW_SHOW "leftarrow,show"
+#define SIG_LEFTARROW_HIDE "leftarrow,hide"
+#define SIG_RIGHTARROW_SHOW "rightarrow,show"
+#define SIG_RIGHTARROW_HIDE "rightarrow,hide"
+
+/* Style definitions */
+#define STYLE_DEFAULT "default"
+#define STYLE_SORT "sort"
+#define STYLE_SOURCE "source"
+#define STYLE_MENUBTN "category_menu"
+#define STYLE_TOOLTIP "photobtn_tooltip"
+#define STYLE_PHOTOITEM "photoitem"
+#define STYLE_VIDEOITEM "videoitem"
+#define STYLE_FOLDERITEM "folderitem"
+#define STYLE_EVENTITEM "eventitem"
+#define STYLE_INVISIBLE "invisible"
+#define STYLE_CTXPOPUP_VIEWER "viewer_popup"
+#define STYLE_CTXPOPUP_HOVER "hover_popup"
+#define STYLE_BTN_SHORTTEXT "shorttext"
+#define STYLE_BTN_LONGTEXT "longtext"
+#define STYLE_BTN_HOVERTEXT "hovertext"
+#define STYLE_CTXT_MENU_PHOTOITEM "photoitem_ctxtmenu"
+#define STYLE_CTXT_MENU_VIDEOITEM "videoitem_ctxtmenu"
+
+/* images */
+#define IMAGE_PHOTO_VIDEO_ICON "ico_photo_video.png"
+#define IMAGE_MENU_BTN_BG "allbrowser_menu_bg.png"
+#define IMAGE_ROUND_RECTANGLE "round_rectangle_4X4.png"
+#define IMAGE_ROUND_RECTANGLE_2 "round_rectangle_4X4_2.png"
+#define IMAGE_ITEM_PHOTOCOUNT_ICON "ico_default_photo_40.png"
+#define IMAGE_ITEM_VIDEOCOUNT_ICON "ico_default_video_40.png"
+#define IMAGE_INNER_SHADOW "content_innershadow.png"
+#define IMAGE_FOLDER_ICON "ico_folder.png"
+
+#define IMAGE_VIDEO_THUMBNAIL_SHADOW "content_video_thumbnail_shadow.png"
+
+#define IMAGE_BTN_PLAY_VIDEO_NORMAL "ico_default_video_126_w.png"
+
+#define IMAGE_PHOTO_BTN_PREV_NORMAL "btn_previous_nor.png"
+#define IMAGE_PHOTO_BTN_PREV_FOCUS "btn_previous_foc.png"
+#define IMAGE_PHOTO_BTN_NEXT_NORMAL "btn_next_nor.png"
+#define IMAGE_PHOTO_BTN_NEXT_FOCUS "btn_next_foc.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_NORMAL "btn_slideshow_pause_nor.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_FOCUS "btn_slideshow_pause_foc.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_NORMAL "btn_slideshow_play_nor.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_FOCUS "btn_slideshow_play_foc.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_NORMAL "btn_slideshow_setting_nor.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_FOCUS "btn_slideshow_setting_foc.png"
+#define IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_HIGH "btn_slideshow_setting_high.png"
+#define IMAGE_PHOTO_BTN_ZOOM_NORMAL "btn_zoom_nor.png"
+#define IMAGE_PHOTO_BTN_ZOOM_FOCUS "btn_zoom_foc.png"
+#define IMAGE_PHOTO_BTN_ZOOM_HIGH "btn_zoom_high.png"
+#define IMAGE_PHOTO_BTN_ROTATE_NORMAL "btn_rotate_nor.png"
+#define IMAGE_PHOTO_BTN_ROTATE_FOCUS "btn_rotate_foc.png"
+
+#define IMAGE_CTXT_MENU_BG "contextual_menu_bg.png"
+#define IMAGE_CTXT_MENU_BTN_BG_NORMAL "function_button_nor.png"
+#define IMAGE_CTXT_MENU_BTN_BG_FOCUS "function_button_foc.png"
+
+#define IMAGE_EVENT_FOLDER_FRAME "folder_frame.png"
+#define IMAGE_EVENT_PHOTO_NUM_BG "photo_number_bg.png"
+
+#define IMAGE_TOOLTIP_RIGHT "tooltip_right.png"
+#define IMAGE_TOOLTIP_LEFT "tooltip_left.png"
+#define IMAGE_TOOLTIP_CENTER "tooltip_center.png"
+#define IMAGE_TOOLTIP_ARROW "tooltip_arrow.png"
+
+#define IMAGE_ICON_CHECK_HIGH "ico_check_high.png"
+#define IMAGE_ICON_CHECK_FOC "ico_check_foc.png"
+
+#define IMAGE_ICON_PULL_DOWN_NOR "ico_pulldown_nor.png"
+
+#define IMAGE_PHOTO_DEFAULT "ico_default_photo_126.png"
+#define IMAGE_VIDEO_DEFAULT "ico_default_video_126.png"
+
+/* sizes */
+#define GENGRID_ITEM_SIZE_W (263+20)
+#define GENGRID_ITEM_SIZE_H (328+20)
+#define PADDING_BOX 50
+
+#define POSITION_ZOOM_POPUP_X 1045
+#define POSITION_ZOOM_POPUP_Y 650
+
+#define POSITION_SETTING_POPUP_X 885
+#define POSITION_SETTING_POPUP_Y 650
+
+#define POSITION_SORT_POPUP_X 1135
+#define POSITION_SORT_POPUP_Y 155
+
+#define POSITION_SOURCE_POPUP_X 1478
+#define POSITION_SOURCE_POPUP_Y 155
+
+#define SIZE_BOX_PAD_W 26
+#define SIZE_BOX_PAD_H 0
+#define SIZE_BTN_LABEL_WIDTH 103
+#define SIZE_CONTENT_LABEL_WIDTH 550
+
+#define CTXT_MENU_GENGRID_ITEM_SIZE_W (238+14)
+#define CTXT_MENU_GENGRID_ITEM_SIZE_H (293+14)
+
+/* media types */
+#define MEDIA_IMAGE 0
+#define MEDIA_VIDEO 1
+#define MEDIA_EVENT 2
+
+/* General */
+#define RGB_GALLERY 147 170 0
+#define RGBA_BLACK_BG 0 0 0 (255*0.9)
+#define RGBA_COLOR_BG RGB_GALLERY (255*0.25)
+
+/* others */
+#define TIMEOUT_TOOLTIP 3.0
+/* TODO: Need to set timers as per specs */
+#define TIMEOUT_PHOTOVIEWER 3.0
+#define TIMEOUT_PHOTOZOOM 3.0
+#define TIMEOUT_CTXT_MENU 60.0
+#define TIMEOUT_SLIDESHOW_FAST 2.0
+#define TIMEOUT_SLIDESHOW_NORMAL 4.0
+#define TIMEOUT_SLIDESHOW_SLOW 7.0
+
+#define VIDEO_PLAYER_APP "org.tizen.video-player-tv-ref"
+#define ARG_URI "uri"
+#define ARG_PLAYLIST_ID "playlist_id"
--- /dev/null
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __I18N_H__
+#define __I18N_H__
+
+#include <libintl.h>
+
+#define i18n_init() bindtextdomain(DOMAIN_NAME, LOCALEDIR)
+
+#define dgettext_noop(s) (s)
+
+#ifdef _
+#undef _
+#endif
+
+#define _(s) gettext(s)
+
+#ifdef N_
+#undef N_
+#endif
+
+#define N_(s) dgettext_noop(s)
+
+#endif /* __I18N_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __MENUDEF_H__
+#define __MENUDEF_H__
+
+#include "i18n.h"
+
+#define SOURCE_TEXT_SIZE 3
+#define SORT_TEXT_SIZE 4
+#define MENUITEM_SIZE 3
+#define MAX_PHOTO_ICONS 6
+#define MAX_ZOOM_BTNS 3
+#define MAX_SETTING_BTNS 2
+#define MAX_SPEED_BTNS 3
+#define MAX_EFFECT_BTNS 3
+#define MAX_LAYOUT 3
+
+#define TEXT_GALLERY N_("GALLERY")
+#define TEXT_RETURN N_("Return")
+#define TEXT_NORES N_("---- x ----")
+#define TEXT_NODATE N_("----.--.--")
+#define TEXT_NOCONTENTAREA1 N_("No Photo & Video.")
+#define TEXT_NOCONTENTAREA2 N_("There is no photo & video in the selected source.")
+#define TEXT_LOADING_MEDIA N_("Updating...")
+
+enum zoom_level {
+ E_ZOOM_ORIGINAL = 0,
+ E_ZOOM_X2,
+ E_ZOOM_X4
+};
+
+extern const char *sourcetext[SOURCE_TEXT_SIZE];
+
+extern const char *sorttext[SORT_TEXT_SIZE];
+
+extern const char *menutext[MENUITEM_SIZE];
+
+extern const char *menuicons[MENUITEM_SIZE];
+
+extern const char *photo_icon_style[MAX_PHOTO_ICONS];
+
+extern const char *tooltip_text[MAX_PHOTO_ICONS];
+
+extern const char *zoom_text[MAX_ZOOM_BTNS];
+
+extern const char *speed_text[MAX_SPEED_BTNS];
+
+extern const char *hover_btn_id[SOURCE_TEXT_SIZE + SORT_TEXT_SIZE];
+
+extern const char *layout_type[MAX_LAYOUT];
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __EVENTDATA_H__
+#define __EVENTDATA_H__
+
+#include "mediadata.h"
+#include "imagedata.h"
+#include "videodata.h"
+
+enum event_type {
+ E_TYPE_EVENT_NO_INFO = 0,
+ E_TYPE_EVENT_INFO
+};
+
+struct eventdata;
+
+void eventdata_destroy_list(Eina_List *events_list);
+Eina_List *eventdata_create_list(
+ Eina_List *mediafiles_list, int sort);
+
+int eventdata_get_type(struct eventdata *ed);
+Eina_List *eventdata_get_listinfo(struct eventdata *ed);
+struct mediadata *eventdata_get_mediadata(struct eventdata *ed);
+const char *eventdata_get_eventname(struct eventdata *ed);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __IMAGEDATA_H__
+#define __IMAGEDATA_H__
+
+#include <media_content.h>
+
+struct imagedata;
+
+struct imagedata *imagedata_create(media_info_h media_h);
+
+void imagedata_destroy(struct imagedata *image_info);
+
+image_meta_h imagedata_get_handle(const struct imagedata *image_info);
+int imagedata_get_width(const struct imagedata *image_info);
+int imagedata_get_height(const struct imagedata *image_info);
+int imagedata_get_orientation(const struct imagedata *image_info);
+int imagedata_get_iso(const struct imagedata *image_info);
+const char *imagedata_get_model(const struct imagedata *image_info);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __MEDIADATA_H__
+#define __MEDIADATA_H__
+
+#include <media_content.h>
+//#include <usb-device.h>
+#include "imagedata.h"
+#include "videodata.h"
+
+struct mediadata;
+struct folderdata;
+
+enum e_sorting_files {
+ E_SORT_DATE_DESC = 0,
+ E_SORT_DATE_ASC,
+ E_SORT_A_Z,
+ E_SORT_Z_A,
+ E_SORT_MAX
+};
+
+enum e_source_type {
+ E_SOURCE_ALL = 0,
+ E_SOURCE_TV,
+ E_SOURCE_USB
+};
+
+enum e_media_type {
+ E_MEDIA_IMAGE_VIDEO = 0,
+ E_MEDIA_IMAGE,
+ E_MEDIA_VIDEO
+};
+
+int mediadata_init();
+int mediadata_fini();
+
+Eina_List *mediadata_create_mediafiles_list(
+ int source_type, int media);
+void mediadata_destroy_mediafiles_list(Eina_List *list);
+
+Eina_List *mediadata_get_filelist(Eina_List *list);
+
+const char *mediadata_get_displayname(struct mediadata *md);
+const char *mediadata_get_mediaid(struct mediadata *md);
+unsigned long long mediadata_get_size(struct mediadata *md);
+const char *mediadata_get_thumbnailpath(struct mediadata *md);
+const char *mediadata_get_filepath(struct mediadata *md);
+const char *mediadata_get_locationtag(struct mediadata *md);
+int mediadata_get_type(struct mediadata *md);
+int mediadata_get_source(struct mediadata *md);
+time_t mediadata_get_modifiedtime(struct mediadata *md);
+time_t mediadata_get_createdtime(struct mediadata *md);
+
+void mediadata_set_updated_cb(media_content_db_update_cb cb, void *data);
+void mediadata_unset_updated_cb();
+
+/*
+void mediadata_usb_set_connected_cb(usb_connected_cb cb, void *data);
+void mediadata_usb_unset_connected_cb();
+int mediadata_connected_usb();
+*/
+const struct imagedata *mediadata_get_image_info(struct mediadata *md);
+const struct videodata *mediadata_get_video_info(struct mediadata *md);
+
+const char *folderdata_get_name(struct folderdata *fd);
+time_t folderdata_get_modifiedtime(struct folderdata *fd);
+Eina_List *folderdata_get_listinfo(struct folderdata *fd);
+
+int mediadata_update_to_db(struct mediadata *md);
+
+time_t mediadata_get_time_t(struct mediadata *md);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIDEODATA_H__
+#define __VIDEODATA_H__
+
+#include <media_content.h>
+
+struct videodata;
+
+struct videodata *videodata_create(media_info_h media_h);
+
+void videodata_destroy(struct videodata *video_info);
+
+int videodata_get_duration(const struct videodata *video_info);
+int videodata_get_played_position(const struct videodata *video_info);
+const char *videodata_get_date_taken(const struct videodata *video_info);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __TIMEOUT_HANDLER_H__
+#define __TIMEOUT_HANDLER_H__
+
+
+class ITimeoutListener {
+public:
+ //!
+ virtual void OnTimeout(void) = 0;
+ //!
+ virtual Eina_Bool OnEvent(int type, void *event_info) = 0;
+};
+
+
+class CTimeoutHandler {
+private:
+ struct STimeoutHandler *m;
+
+private:
+ static Eina_Bool sm_CbTimer(void *data);
+ Eina_Bool m_OnTimer(void);
+
+ static Eina_Bool sm_CbEvent(void *data, int type, void *event);
+ Eina_Bool m_OnEvent(int type, void *event);
+
+public:
+ CTimeoutHandler() : m(0) {}
+ virtual ~CTimeoutHandler() {}
+
+ bool Create(double timeout, ITimeoutListener *listener);
+ virtual void Destroy(void);
+
+ void Reset(void);
+ void Pause(void);
+ void Resume(void);
+
+};
+
+
+#endif /* __TIMEROUT_HANDLER_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+
+#include <dbg.h>
+#include <define.h>
+#include <stdbool.h>
+#include <Elementary.h>
+
+
+Evas_Object *util_ui_add_box(Evas_Object *base);
+Evas_Object *util_ui_add_button(Evas_Object *base);
+void util_ui_set_focus_directions(Evas_Object **btn, int itemcount, bool is_horizontal);
+bool util_is_image_valid(Evas_Object *win, char *filepath);
+int util_get_media_count(Eina_List *list, int type);
+int util_eina_list_get_index(Eina_List *list, void *data);
+char *util_get_time_string(int ms);
+Eina_List *util_create_media_list(Eina_List *media_list, int type);
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __CTXT_MENU_VIEW_H__
+#define __CTXT_MENU_VIEW_H__
+
+
+class CCtxtMenuView : public CBaseView, CListenerMgr, ITimeoutListener, IKeyDownListener {
+private:
+ struct SCtxtMenuView *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+ virtual void t_OnPause(void);
+ virtual void t_OnResume(void);
+
+private:
+ static char *sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part);
+ static Evas_Object *sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part);
+ static Eina_Bool sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part);
+
+ static void _free_itemclass(Elm_Gengrid_Item_Class *ic);
+ static Elm_Gengrid_Item_Class *_get_itemclass(int type);
+ static char *_get_mediadata_date(struct mediadata *md);
+
+ bool m_DrawGengrid(void);
+
+ bool m_LoadContentThumbnail(void);
+
+ bool m_LoadContentInfo(void);
+ bool m_DrawSelectedContent(void);
+
+ bool m_DrawRelatedContent(void);
+ struct _btn_info *m_GetBtnInfo(int *size);
+ bool m_DrawFuncBtn(void);
+
+public:
+ CCtxtMenuView(const char *szViewId) : CBaseView(szViewId), IKeyDownListener(this), m(0) {}
+ virtual ~CCtxtMenuView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+
+ virtual Evas_Object* Base(void);
+
+ //!
+ virtual void OnTimeout(void);
+ //!
+ virtual Eina_Bool OnEvent(int type, void *event_info);
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+};
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __GALLERY_VIEW_H__
+#define __GALLERY_VIEW_H__
+
+
+struct arg_list {
+ int view;
+ char *id;
+
+ int source;
+ int sort;
+ int media_type;
+
+ service_h service;
+};
+
+enum user_signals {
+ E_HIGHLIGHT = 0,
+ E_RETURN
+};
+
+enum layout {
+ E_LAYOUT_NONE = -1,
+ E_LAYOUT_ALL = 0,
+ E_LAYOUT_EVENTS,
+ E_LAYOUT_FOLDER,
+ E_LAYOUT_MAX
+};
+
+enum focus_area {
+ FOCUS_MENU_BTN = 0,
+ FOCUS_HOVER_BTN,
+ FOCUS_CONTENT_AREA
+};
+
+struct layout_data {
+ Eina_List *media_list;
+
+ struct arg_list *arglist;
+
+ char *path;
+ int sort;
+
+ int prev_layout;
+
+ Eina_Bool modified;
+};
+
+
+class CGalleryView : public CBaseView {
+private:
+ struct SGalleryView *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+ virtual void t_OnPause(void);
+ virtual void t_OnResume(void);
+
+private:
+ //static void sm_CbUsbConnected(usb_device_h usb_device, char *action, void *dt);
+ static void sm_CbMediaUpdate(media_content_error_e error, int pid,
+ media_content_db_update_item_type_e update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type,
+ char *uuid, char *path, char *mime_type, void *dt);
+
+ static void sm_CbLayoutShown(void *cookie, CBaseLayout *pBaseLayout);
+ static void sm_CbAllLayoutFocus(void *cookie);
+ static void sm_CbAllLayoutSort(void *cookie, int sort);
+ static void sm_CbAllLayoutHide(void *cookie);
+ static void sm_CbGetSignalFromLayout(void *cookie, int sig);
+
+ //void m_UsbConnected(char *action);
+ void m_MediaUpdate(void);
+
+ void m_DrawNotifyPopup(const char *text);
+ void m_DestroyNotifyPopup(void);
+
+ void m_AddUpdownIcon(Evas_Object *btn, const char *icon_file);
+
+ Evas_Object *m_GetHoverselObject(const char **text_arr, int size_arr, const char *style);
+
+ bool m_DrawTopArea(void);
+ bool m_DrawLeftArea(void);
+ bool m_DrawItems(void);
+
+public:
+ CGalleryView(const char *szViewId) : CBaseView(szViewId), m(0) {}
+ virtual ~CGalleryView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+
+ virtual Evas_Object* Base(void);
+
+ void DrawContentArea(int ltype);
+
+ void DrawCtxpopup(const char **text_arr, int size_arr,
+ const char *style, int selected_index, int position_x, int position_y);
+ void DestroyCtxpopup(void);
+
+ void FocusLayout(void);
+};
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LAYOUT_ALL_H__
+#define __LAYOUT_ALL_H__
+
+
+class CAllLayout : public CBaseLayout {
+private:
+ struct SAllLayout *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+
+private:
+ static char *sm_CbGridTextGet(void *data, Evas_Object *ob, const char *part);
+ static Evas_Object *sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part);
+ static Eina_Bool sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part);
+
+ static int sm_CompareDesc(const void *data1, const void *data2);
+ static int sm_CompareAsc(const void *data1, const void *data2);
+ static int sm_CompareAZ(const void *data1, const void *data2);
+ static int sm_CompareZA(const void *data1, const void *data2);
+
+ void m_FreeItemclass(Elm_Gengrid_Item_Class *ic);
+ Elm_Gengrid_Item_Class *m_GetItemclass(int type);
+
+ Eina_List *m_SortList(Eina_List *list, int sort);
+
+ Evas_Object *m_DrawGengrid(Evas_Object *layout);
+ bool m_DrawGengridItems(void);
+
+public:
+ CAllLayout(const char *pLayoutId) : CBaseLayout(pLayoutId), m(0) {}
+ virtual ~CAllLayout() {}
+
+ bool Create(CLayoutMgr *mgr, void *data);
+ virtual void Destroy(void);
+
+ void SetHideCallback(void(*cb)(void *cookie), void *cookie);
+ void SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie);
+
+ void DirectLaunch(const char *id);
+ void Focus(void);
+ void Sort(int sort);
+ void Update(struct layout_data *ld);
+};
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LAYOUT_EVENTS_H__
+#define __LAYOUT_EVENTS_H__
+
+class CEventLayout : public CBaseLayout {
+private:
+ struct SEventLayout *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+
+private:
+ static char *sm_CbGridTextGet(void *data, Evas_Object *ob, const char *part);
+ static Evas_Object *sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part);
+ static Eina_Bool sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part);
+
+ void m_FreeItemclass(Elm_Gengrid_Item_Class *ic_photo, Elm_Gengrid_Item_Class *ic_video, Elm_Gengrid_Item_Class *ic_event);
+ Elm_Gengrid_Item_Class *m_GetItemclass(int type);
+
+ int m_GetEventCount(Eina_List *event_list);
+ int m_GetMediaCount(Eina_List *media_list, int type);
+
+ Evas_Object *m_DrawGengrid(Evas_Object *layout);
+ bool m_DrawGengridItems(void);
+
+public:
+ CEventLayout(const char *pLayoutId) : CBaseLayout(pLayoutId), m(0) {}
+ virtual ~CEventLayout() {}
+
+ bool Create(CLayoutMgr *mgr, void *data);
+ virtual void Destroy(void);
+
+ void SetFocusCallback(void (*cb)(void *cookie), void *cookie);
+ void SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie);
+ void SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie);
+
+ void DirectLaunch(const char *id);
+ void Focus(void);
+ void Sort(int sort);
+ void Update(struct layout_data *ld);
+};
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LAYOUT_FOLDER_H__
+#define __LAYOUT_FOLDER_H__
+
+class CFolderLayout : public CBaseLayout {
+private:
+ struct SFolderLayout *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+
+private:
+ static char *sm_CbGridTextGet(void *data, Evas_Object *ob, const char *part);
+ static Evas_Object *sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part);
+ static Eina_Bool sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part);
+
+ void m_FreeItemclass(Elm_Gengrid_Item_Class *ic);
+ Elm_Gengrid_Item_Class *m_GetItemclass(void);
+
+ int m_GetMediaCount(Eina_List *list, int type);
+
+ Evas_Object *m_DrawGengrid(Evas_Object *layout);
+ bool m_DrawGengridItems(void);
+
+public:
+ CFolderLayout(const char *pLayoutId) : CBaseLayout(pLayoutId), m(0) {}
+ virtual ~CFolderLayout() {}
+
+ bool Create(CLayoutMgr *mgr, void *data);
+ virtual void Destroy(void);
+
+ void SetFocusCallback(void (*cb)(void *cookie), void *cookie);
+ void SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie);
+ void SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie);
+
+ void DirectLaunch(const char *id);
+ void Focus(void);
+ void Sort(int sort);
+ void Update(struct layout_data *ld);
+};
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __PHOTOVIEWER_VIEW_H__
+#define __PHOTOVIEWER_VIEW_H__
+
+
+class CPhotoViewerView : public CBaseView, ITimeoutListener {
+private:
+ struct SPhotoViewerView *m;
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+ virtual void t_OnPause(void);
+ virtual void t_OnResume(void);
+
+private:
+ Evas_Object *m_AddTooltipBtn(Evas_Object *parent, const char *style_text, const char *tt_text);
+
+private:
+ static void sm_CbPrevBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnPrevBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static void sm_CbNextBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnNextBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static void sm_CbSlideshowBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnSlideshowBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static void sm_CbSettingBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnSettingBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static void sm_CbZoomBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnZoomBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static void sm_CbRotateBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnRotateBtnClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ static Eina_Bool sm_CbFocus(void *dt);
+ Eina_Bool OnFocus(void);
+
+ static void sm_CbShowViewFinish(void *dt, Evas_Object *obj, const char *emission, const char *source);
+ void m_OnShowViewFinish(Evas_Object *obj, const char *emission, const char *source);
+
+ static Eina_Bool sm_CbTimerSlideshow(void *dt);
+
+private:
+ void m_DrawCtxpopup(const char **text_arr, int size_arr, const char *style, int selected_index, int position_x, int position_y);
+ bool m_DrawContentArea(struct mediadata *md);
+ bool m_DrawTopArea(struct mediadata *md);
+ bool m_DrawBottomArea(void);
+ bool m_DrawItems(void);
+
+public:
+ CPhotoViewerView(const char *szViewId) : CBaseView(szViewId), m(0) {}
+ virtual ~CPhotoViewerView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+
+ virtual Evas_Object* Base(void);
+
+ //!
+ virtual void OnTimeout(void);
+ //!
+ virtual Eina_Bool OnEvent(int type, void *event_info);
+};
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __ZOOM_VIEW_H__
+#define __ZOOM_VIEW_H__
+
+struct zoom_data {
+ struct mediadata *md;
+ int zoom_level;
+};
+
+
+#include <InputHandler.h>
+
+
+class CPhotoZoomView : public CBaseView, CListenerMgr, IKeyDownListener, IKeyUpListener, ITimeoutListener {
+private:
+ struct SPhotoZoomView *m;
+
+private:
+ static Eina_Bool sm_CbIdler(void *data);
+ Eina_Bool m_OnIdler(void);
+
+ static void sm_CbContentMoved(void *dt, Evas_Object *obj, void *event_info);
+ void m_OnContentMoved(Evas_Object *obj);
+
+ void m_UpdateArrow(void);
+ void m_UpdateZoomNavi(void);
+
+ void t_GetZoomNaviRatio(void);
+ bool m_MoveZoomNaviImg(void);
+ bool m_DrawArrow(void);
+ bool m_DrawContent(void);
+ void m_AddMouseEventCallback(void);
+ bool m_DrawZoomNavi(void);
+
+ static void sm_CbTimeout(void *data);
+ static Eina_Bool sm_CbEvent(void *data, int type, void *event_info);
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+ virtual void t_OnPause(void);
+ virtual void t_OnResume(void);
+
+public:
+ CPhotoZoomView(const char *szViewId) : CBaseView(szViewId), IKeyDownListener(this), IKeyUpListener(this), m(0) {}
+ virtual ~CPhotoZoomView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+
+ virtual Evas_Object* Base(void);
+
+ //!
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+ //!
+ virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
+
+ //!
+ virtual void OnTimeout(void);
+ //!
+ virtual Eina_Bool OnEvent(int type, void *event_info);
+
+};
+
+
+#endif /* __ZOOM_VIEW_H__ */
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIDEOPLAYER_VIEW_H__
+#define __VIDEOPLAYER_VIEW_H__
+
+Eina_Bool video_player_play(void *data);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIDEOPLAYER_VIEW_H__
+#define __VIDEOPLAYER_VIEW_H__
+
+struct view_class *videoplayer_view_get_vclass(void);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIEW_H__
+#define __VIEW_H__
+
+struct view_data {
+ Eina_List *media_list;
+ struct mediadata *md;
+};
+
+#endif
--- /dev/null
+<manifest>
+ <define>
+ <domain name="dtv-org.tizen.gallery-tv-ref"/>
+ <request>
+ <smack request="device::app_logging" type="rw"/>
+ <smack request="system::vconf" type="rxl"/>
+ <smack request="system::homedir" type="rx"/>
+ <smack request="system::use_internet" type="r"/>
+ <smack request="xorg" type="rwx"/>
+ <smack request="isf" type="rx"/>
+ <smack request="e17" type="rxl"/>
+ <smack request="dtv-org.tizen.btapp" type="rx"/>
+ <smack request="ail::db" type="rxl"/>
+ <smack request="system::media" type="rx"/>
+ <smack request="media-data::db" type="rw"/>
+ <smack request="media-server" type="rw"/>
+ </request>
+ </define>
+ <request>
+ <domain name="dtv-org.tizen.gallery-tv-ref"/>
+ </request>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="@VERSION@" install-location="internal-only">\r
+ <label>Gallery</label>\r
+ <author email="r.yeshwanth@samsung.com" href="www.samsung.com">Yeshwanth Reddivari</author>\r
+ <description>Gallery</description>\r
+ <ui-application appid="@PACKAGE_NAME@" exec="@BINDIR@/@PROJECT_NAME@" nodisplay="false" multiple="false" type="capp" taskmanage="true" landscape-effectimage="@DESKTOP_ICONDIR@/@PACKAGE_NAME@_4x2.png">\r
+ <label>Gallery</label>\r
+ <icon>@DESKTOP_ICON@</icon>\r
+ <application-service>\r
+ <operation name="http://tizen.org/appcontrol/operation/pick"/>\r
+ <mime name="image/*"/>\r
+ <mime name="video/*"/>\r
+ </application-service>\r
+ </ui-application>\r
+</manifest>\r
--- /dev/null
+Name: org.tizen.gallery-tv-ref
+Summary: Gallery application
+Version: 0.2
+Release: 1
+Group: Applications/Core Applications
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(capi-content-media-content)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(application-common)
+BuildRequires: gettext-devel
+BuildRequires: edje-bin
+
+%define _pkgdir /usr/apps/%{name}
+%define _bindir %{_pkgdir}/bin
+%define _resdir %{_pkgdir}/res
+%define _datadir %{_pkgdir}/data
+%define _localedir %{_resdir}/locale
+%define _manifestdir /usr/share/packages
+%define _desktop_icondir /usr/share/icons/default/small
+
+%description
+Gallery Application
+
+%prep
+%setup -q
+
+%build
+cmake \
+ -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \
+ -DPACKAGE_NAME=%{name} \
+ -DBINDIR=%{_bindir} \
+ -DLOCALEDIR=%{_localedir} \
+ -DMANIFESTDIR=%{_manifestdir} \
+ -DDESKTOP_ICONDIR=%{_desktop_icondir} \
+ -DDESKTOP_ICON=%{name}.png \
+ -DDESKTOP_ICON_4X2=%{name}_4x2.png \
+ -DVERSION=%{version}
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+install --directory %{buildroot}/%{_datadir}
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%manifest %{_manifestdir}/%{name}.manifest
+%{_bindir}/*
+%{_resdir}/*
+%{_datadir}
+%{_manifestdir}/%{name}.xml
+%{_desktop_icondir}/%{name}.png
+%{_desktop_icondir}/%{name}_4x2.png
+%defattr(-,app,app,-)
--- /dev/null
+ADD_CUSTOM_TARGET(${TARGET_EDJ}
+ COMMAND edje_cc -id images
+ ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${TARGET_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ} DESTINATION ${EDJEDIR})
+
+ADD_CUSTOM_TARGET(${THEME_EDJ}
+ COMMAND edje_cc -id images
+ ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+ ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${THEME_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ} DESTINATION ${EDJEDIR})
--- /dev/null
+#include "../../include/common/define.h"
+
+collections {
+ #include "widgets/style.edc"
+ #include "widgets/button.edc"
+ #include "widgets/gengrid.edc"
+ #include "widgets/tooltip.edc"
+ #include "widgets/ctxpopup.edc"
+ #include "widgets/photocam.edc"
+}
--- /dev/null
+#include "../../include/common/define.h"
+
+collections {
+ #include "widgets/style.edc"
+ #include "views/gallery_view.edc"
+ #include "views/layout_all.edc"
+ #include "views/layout_events.edc"
+ #include "views/ctxtmenu_view.edc"
+ #include "views/videoplayer_view.edc"
+ #include "views/photoviewer_view.edc"
+ #include "views/zoom_view.edc"
+}
--- /dev/null
+group {
+ name, GRP_CTXT_MENU;
+ images {
+ image, IMAGE_CTXT_MENU_BG COMP;
+ image, FOCUSED_APP_BG_PNG COMP;
+ }
+ parts {
+ part {
+ name, "bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ color, 0 0 0 240;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "bg.image";
+ type, IMAGE;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ image.normal, IMAGE_CTXT_MENU_BG;
+ color, 147 170 0 255;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.content";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel2.relative, 0.0 0.0;
+ min, 392 178;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, "bg.thumbnail";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 1.0 1.0;
+ to, "padding.content";
+ }
+ rel2.to, "padding.content";
+ min, 550 550;
+ align, 0.0 0.0;
+ color, 0 0 0 255;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, PART_CONTENT_THUMBNAIL;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.to, "bg.thumbnail";
+ rel2 {
+ relative, 0.0 0.0;
+ to, "bg.thumbnail";
+ }
+ min, 550 550;
+ align, 0.0 0.0;
+ color, 255 255 255 255;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.content.title";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, PART_CONTENT_THUMBNAIL;
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, PART_CONTENT_THUMBNAIL;
+ }
+ min, 0 20;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_CONTENT_TITLE;
+ type, TEXT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding.content.title";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding.content.title";
+ }
+ text {
+ font, FONT_STYLE_SANS_BOLD;
+ size, 36;
+ align, 0.0 0.5;
+ }
+ min, 550 42;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.content.info";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, PART_CONTENT_TITLE;
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, PART_CONTENT_TITLE;
+ }
+ min, 0 7;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_CONTENT_INFO;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding.content.info";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding.content.info";
+ }
+ min, 550 0;
+ align, 0.0 0.0;
+ fixed, 1 0;
+ }
+ }
+ part {
+ name, "padding.func_btn";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel2.relative, 0.0 0.0;
+ min, 1334 75;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_FUNC_BTN;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 1.0 1.0;
+ to, "padding.func_btn";
+ }
+ rel2.to, "padding.func_btn";
+ min, 490 115;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.separator";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, PART_FUNC_BTN;
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, PART_FUNC_BTN;
+ }
+ min, 0 20;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, "part.separator";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding.separator";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding.separator";
+ }
+ min, 490 2;
+ color, 255 255 255 51;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.relcont.txt";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "part.separator";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "part.separator";
+ }
+ min, 16 37;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_RELCONT_TXT;
+ type, TEXT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 1.0 1.0;
+ to, "padding.relcont.txt";
+ }
+ rel2.to, "padding.relcont.txt";
+ text {
+ font, "Tizen Sans";
+ size, 27;
+ align, 0.0 0.5;
+ }
+ min, 458 38;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.relcont";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.5 1.0;
+ to, PART_RELCONT_TXT;
+ }
+ rel2 {
+ relative, 0.5 1.0;
+ to, PART_RELCONT_TXT;
+ }
+ min, 0 8;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_RELCONT;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding.relcont";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding.relcont";
+ }
+ min, 504 785;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ }
+ }
+ }
+}
+
+group {
+ name, GRP_CTXT_MENU_CONTENT_INFO;
+ parts {
+ part {
+ name, "area";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 550 28;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_CONTENT_INFO_TXT;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 550 28;
+ }
+ }
+ }
+}
+
+group {
+ name, GRP_CTXT_MENU_BTN;
+ images {
+ image, IMAGE_CTXT_MENU_BTN_BG_NORMAL COMP;
+ image, IMAGE_CTXT_MENU_BTN_BG_FOCUS COMP;
+ }
+ parts {
+ part {
+ name, "area";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 103 115;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_BTN_BG;
+ type, IMAGE;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 0.5 0.0;
+ rel2.relative, 0.5 0.0;
+ min, 64 64;
+ align, 0.5 0.0;
+ color, 100 109 124 255;
+ fixed, 1 1;
+ image.normal, IMAGE_CTXT_MENU_BTN_BG_NORMAL;
+ }
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ color, 69 143 255 255;
+ image.normal, IMAGE_CTXT_MENU_BTN_BG_FOCUS;
+ }
+ }
+ part {
+ name, PART_BTN_ICON;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 0.5 0.0;
+ rel2.relative, 0.5 0.0;
+ min, 64 64;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "padding.btn_title";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 0 72;
+ rel2.relative, 0.0 0.0;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_BTN_TITLE;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding.btn_title";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding.btn_title";
+ }
+ min, 103 43;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name, "focus";
+ signal, SIG_FOCUSED;
+ source, "";
+ action, STATE_SET "focused" 0.0;
+ target, PART_BTN_BG;
+ }
+ program {
+ name, "unfocus";
+ signal, SIG_UNFOCUSED;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, PART_BTN_BG;
+ }
+ }
+}
--- /dev/null
+group {
+ name: GRP_GALLERY_VIEW;
+ images {
+ image: IMAGE_PHOTO_VIDEO_ICON COMP;
+ }
+ parts {
+ part{
+ name: "black_bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: RGBA_BLACK_BG;;
+ }
+ }
+ part{
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: RGBA_COLOR_BG;
+ }
+ }
+/* top part area */
+ part{
+ name: "toppart";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 1801 172;
+ rel2.relative: 0.0 0.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "padding_icon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 63 78;
+ rel1 {
+ to: "toppart";
+ }
+ rel2 {
+ to: "toppart";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "iconpart";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 84 84;
+ rel1 {
+ to: "padding_icon";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_icon";
+ }
+ image {
+ normal: IMAGE_PHOTO_VIDEO_ICON;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 147 170 0 255;
+ }
+ }
+ part {
+ name: "padding_titletext";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 22 0;
+ rel1 {
+ to: "iconpart";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "iconpart";
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_TITLETEXT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 870 84;
+ rel1 {
+ to: "padding_titletext";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_titletext";
+ }
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ size: 70;
+ align: 0.0 0.5;
+ }
+ color: 255 255 255 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+/* hoversel part area */
+ part {
+ name: "padding_hoversel";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 96 83;
+ rel1 {
+ to_x: PART_TITLETEXT;
+ to_y: toppart;
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to_x: PART_TITLETEXT;
+ to_y: toppart;
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part{
+ name: "hoverselpart";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 666 72;
+ rel1 {
+ to: "padding_hoversel";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_hoversel";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: PART_HOVERSELAREA2;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 72;
+ rel1 {
+ to: "hoverselpart";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "hoverselpart";
+ }
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "padding_hoversel_between";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 0;
+ rel1 {
+ to: PART_HOVERSELAREA2;
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: PART_HOVERSELAREA2;
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: PART_HOVERSELAREA1;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 72;
+ rel1 {
+ to: "padding_hoversel_between";
+ }
+ rel2 {
+ to: "padding_hoversel_between";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ align: 1.0 0.0;
+ }
+ }
+/* left part area */
+ part {
+ name: "padding_leftswallow";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 232;
+ rel1 {
+ to: "toppart";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "toppart";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part{
+ name: PART_LEFTSWALLOW;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 406 87*3;
+ rel1 {
+ to: "padding_leftswallow";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "padding_leftswallow";
+ relative: 0.0 1.0;
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ }
+ }
+/* content area */
+ part {
+ /* for increasing space for gengrid last item */
+ name: "rightpart_dummy";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 119-20 1080;
+ rel1.relative: 1.0 1.0;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: PART_CONTENTAREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1 {
+ to_x: PART_LEFTSWALLOW;
+ to_y: "toppart";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "rightpart_dummy";
+ relative: 0.0 1.0;
+ }
+ }
+ }
+/* right part area */
+ part {
+ name: "rightpart";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 119 1080;
+ rel1.relative: 1.0 1.0;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ }
+}
--- /dev/null
+group {
+ name: GRP_LAYOUT_ALL;
+ images {
+ image: IMAGE_ITEM_PHOTOCOUNT_ICON COMP;
+ image: IMAGE_ITEM_VIDEOCOUNT_ICON COMP;
+ }
+ parts {
+/* no content area */
+ part {
+ name: "padding_nocontent";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 550 240;
+ rel1 {
+ to: PART_CONTENTAREA;
+ }
+ rel2 {
+ to: PART_CONTENTAREA;
+ relative: 0 0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_NOCONTENTAREA1;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 50;
+ rel1 {
+ to: "padding_nocontent";
+ relative: 1 1;
+ }
+ rel2 {
+ to: "padding_nocontent";
+ }
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ size: 35;
+ min: 1 0;
+ }
+ color: 255 255 255 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_NOCONTENTAREA2;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 30;
+ rel1 {
+ to: PART_NOCONTENTAREA1;
+ relative: 0.5 1.0;
+ }
+ rel2 {
+ to: PART_NOCONTENTAREA1;
+ relative: 0.5 1.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ size: 24;
+ min: 1 0;
+ }
+ color: 255 255 255 102;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ }
+ part{
+ name: PART_CONTENTAREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "count_area_part";
+ relative: 0.0 1.0;
+ }
+ }
+ }
+/* count part area */
+ part {
+ name: "count_area_part";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 1395 60;
+ rel2 {
+ relative: 0.0 0.0;
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: PART_CATEGORY_TITLE;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 800 60;
+ rel1 {
+ to: "count_area_part";
+ }
+ rel2 {
+ to: "count_area_part";
+ relative: 0.0 0.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 28;
+ align: 0.0 0.5;
+ }
+ color: 255 255 255 217;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+
+ }
+ part {
+ name: "padding_videocount";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 0;
+ rel1 {
+ to: "count_area_part";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "count_area_part";
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 1.0;
+ }
+ }
+ part {
+ name: PART_VIDEOCOUNT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 60;
+ rel1 {
+ to: "padding_videocount";
+ }
+ rel2 {
+ to: "padding_videocount";
+ relative: 0.0 0.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 28;
+ align: 1.0 0.5;
+ min: 1 0;
+ }
+ color: 255 255 255 178;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "padding_video_icon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 10 0;
+ rel1 {
+ to: PART_VIDEOCOUNT;
+ }
+ rel2 {
+ to: PART_VIDEOCOUNT;
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: "videoicon";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 40 40;
+ max: 40 40;
+ rel1 {
+ to: "padding_video_icon";
+ }
+ rel2 {
+ to: "padding_video_icon";
+ relative: 0.0 1.0;
+ }
+ image {
+ normal: IMAGE_ITEM_VIDEOCOUNT_ICON;
+ }
+ fixed: 1 1;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name: "padding_photocount";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 34 0;
+ rel1 {
+ to: "videoicon";
+ }
+ rel2 {
+ to: "videoicon";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name: PART_PHOTOCOUNT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 60;
+ rel1 {
+ to: "padding_photocount";
+ }
+ rel2 {
+ to: "padding_photocount";
+ relative: 0.0 1.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 28;
+ align: 0.0 0.5;
+ min: 1 0;
+ }
+ color: 255 255 255 178;
+ fixed: 1 1;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name: "padding_photoicon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 10 0;
+ rel1 {
+ to: PART_PHOTOCOUNT;
+ }
+ rel2 {
+ to: PART_PHOTOCOUNT;
+ relative: 0.0 1.0;
+ }
+ fixed: 1 0;
+ visible: 0;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name: "photoicon";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 40 40;
+ max: 40 40;
+ rel1 {
+ to: "padding_photoicon";
+ }
+ rel2 {
+ to: "padding_photoicon";
+ relative: 0.0 1.0;
+ }
+ image {
+ normal: IMAGE_ITEM_PHOTOCOUNT_ICON;
+ }
+ fixed: 1 1;
+ align: 1.0 0.5;
+ }
+ }
+ }
+}
--- /dev/null
+group {
+ name: GRP_LAYOUT_EVENTS;
+ inherit: GRP_LAYOUT_ALL;
+}
--- /dev/null
+group {
+ name: GRP_PHOTO_VIEWER;
+ parts {
+ part{
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 255;
+ }
+ }
+ part{
+ name: PART_CONTENTAREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ }
+ }
+ part {
+ name: "toparea";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 150;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ align: 0.5 1.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "toparea_bg";
+ type: RECT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ color: 18 22 34 204;
+ rel1.to: "toparea";
+ rel2.to: "toparea";
+ }
+ }
+ part {
+ name: "padding_title";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 71 31;
+ rel1 {
+ to: "toparea";
+ }
+ rel2 {
+ to: "toparea";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_TITLETEXT;
+ type: TEXT;
+ clip_to: "toparea";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 807 52;
+ rel1 {
+ to: "padding_title";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_title";
+ }
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 40;
+ align: 0.0 0.5;
+ }
+ color: 255 255 255 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_RESOLUTIONTEXT;
+ type: TEXT;
+ clip_to: "toparea";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 32;
+ rel1 {
+ to: PART_TITLETEXT;
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: PART_TITLETEXT;
+ relative: 0.0 1.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 26;
+ min: 1 0;
+ }
+ color: 188 188 188 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "separator_area1";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 38 32;
+ rel1 {
+ to: PART_RESOLUTIONTEXT;
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: PART_RESOLUTIONTEXT;
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "separator1";
+ type: RECT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ min: 2 20;
+ max: 2 20;
+ rel1 {
+ to: "separator_area1";
+ }
+ rel2 {
+ to: "separator_area1";
+ }
+ }
+ }
+ part {
+ name: PART_SOURCETEXT;
+ type: TEXT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ min: 0 32;
+ rel1 {
+ to: "separator_area1";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "separator_area1";
+ relative: 1.0 0.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 26;
+ min: 1 0;
+ }
+ color: 188 188 188 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "separator_area2";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 38 32;
+ rel1 {
+ to: PART_SOURCETEXT;
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: PART_SOURCETEXT;
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "separator2";
+ type: RECT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ min: 2 20;
+ max: 2 20;
+ rel1 {
+ to: "separator_area2";
+ }
+ rel2 {
+ to: "separator_area2";
+ }
+ }
+ }
+ part {
+ name: PART_DATETEXT;
+ type: TEXT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ min: 0 32;
+ rel1 {
+ to: "separator_area2";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "separator_area2";
+ relative: 1.0 0.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 26;
+ min: 1 0;
+ }
+ color: 188 188 188 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "padding_counttext";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 71 31;
+ rel1 {
+ to: "toparea";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "toparea";
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: PART_COUNTTEXT;
+ type: TEXT;
+ clip_to: "toparea";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 50;
+ rel1 {
+ to: "padding_counttext";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "padding_counttext";
+ relative: 0.0 1.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 40;
+ align: 1.0 0.5;
+ min: 1 0;
+ }
+ color: 169 169 169 255;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: PART_CURRENTTEXT;
+ type: TEXT;
+ scale: 1;
+ clip_to: "toparea";
+ description {
+ state: "default" 0.0;
+ min: 0 50;
+ rel1 {
+ to: PART_COUNTTEXT;
+ }
+ rel2 {
+ to: PART_COUNTTEXT;
+ relative: 0.0 0.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 40;
+ align: 1.0 0.5;
+ min: 1 0;
+ }
+ color: 255 255 255 255;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ }
+ }
+/* bottom area drawing */
+ part {
+ name: "bottomarea";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 214;
+ rel1.relative: 0.0 1.0;
+ align: 0.5 1.0;
+ fixed: 0 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ align: 0.5 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "bottomarea_bg";
+ type: RECT;
+ scale: 1;
+ clip_to: "bottomarea";
+ description {
+ state: "default" 0.0;
+ color: 18 22 34 204;
+ rel1.to: "bottomarea";
+ rel2.to: "bottomarea";
+ }
+ }
+ part {
+ name: "padding_btn0";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 505 52;
+ rel1 {
+ to: "bottomarea";
+ }
+ rel2 {
+ to: "bottomarea";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "part_btn0";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "bottomarea";
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ rel1 {
+ to: "padding_btn0";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_btn0";
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+
+#define PART_BTN(nameno, padno) \
+ part { \
+ name: "padding_btn"nameno; \
+ type: SPACER; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: 50 0; \
+ rel1 { \
+ to: "part_btn"padno; \
+ relative: 1.0 0.0; \
+ } \
+ rel2 { \
+ to: "part_btn"padno; \
+ } \
+ fixed: 1 1; \
+ align: 0.0 0.0; \
+ } \
+ } \
+ part { \
+ name: "part_btn"nameno; \
+ type: SWALLOW; \
+ scale: 1; \
+ clip_to: "bottomarea"; \
+ description { \
+ state: "default" 0.0; \
+ min: 110 110; \
+ rel1 { \
+ to: "padding_btn"nameno; \
+ relative: 1.0 0.0; \
+ } \
+ rel2 { \
+ to: "padding_btn"nameno; \
+ } \
+ fixed: 1 1; \
+ align: 0.0 0.0; \
+ } \
+ }
+
+ PART_BTN(1, 0)
+ PART_BTN(2, 1)
+ PART_BTN(3, 2)
+ PART_BTN(4, 3)
+ PART_BTN(5, 4)
+ }
+
+ programs {
+ program {
+ name : "hide";
+ signal: SIG_HIDE;
+ source: "";
+ action: STATE_SET "hide" 0.0;
+ target: "toparea";
+ target: "bottomarea";
+ transition: LINEAR 0.2;
+ }
+ program {
+ name : "show";
+ signal: SIG_SHOW;
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "toparea";
+ target: "bottomarea";
+ transition: LINEAR 0.2;
+ after: "emit,signal";
+ }
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT SIG_SHOW_FINISH "";
+ }
+ }
+}
--- /dev/null
+group {
+ name: GRP_VIDEO_PLAYER;
+ parts {
+ part{
+ name: PART_CONTENTAREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ }
+ }
+
+ }
+}
--- /dev/null
+group {
+ name: GRP_ZOOM_VIEW;
+ images {
+ image: "ico_photozoom_arrow_right.png" COMP;
+ image: "ico_photozoom_arrow_left.png" COMP;
+ image: "ico_photozoom_arrow_down.png" COMP;
+ image: "ico_photozoom_arrow_up.png" COMP;
+ image: "round_rectangle_9X9.png" COMP;
+ }
+ script {
+ public uparrow = 1;
+ public downarrow = 1;
+ public leftarrow = 1;
+ public rightarrow = 1;
+ }
+ parts {
+ part{
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 255;
+ }
+ }
+ part{
+ name: PART_CONTENTAREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ }
+ }
+ part {
+ name, "clip.rect";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel2.relative, 0.0 0.0;
+ min, 170 128;
+ align, 0.0 0.0;
+ color, 255 255 255 255;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ color, 255 255 255 76;
+ }
+ }
+ part {
+ name: "padding_rect";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 40 40;
+ rel1 {
+ to: "clip.rect";
+ }
+ rel2 {
+ to: "clip.rect";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "round_rectangle";
+ type, IMAGE;
+ clip_to, "clip.rect";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 130 87;
+ rel1 {
+ to: "padding_rect";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_rect";
+ }
+ image {
+ normal: "round_rectangle_9X9.png";
+ border: 9 9 9 9;
+ border_scale: 1;
+ }
+ color: 37 45 62 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "part_text";
+ type: TEXT;
+ clip_to, "clip.rect";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "round_rectangle";
+ }
+ rel2 {
+ to: "round_rectangle";
+ }
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 40;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name, "clip.uparrow";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel2.relative, 1.0 0.0;
+ min, 0 94;
+ align, 0.5 0.0;
+ fixed, 0 1;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ align, 0.5 1.0;
+ visible, 0;
+ }
+ }
+ part {
+ name: "padding_uparrow";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 19;
+ rel1 {
+ to: "clip.uparrow";
+ }
+ rel2 {
+ to: "clip.uparrow";
+ relative: 1.0 0.0;
+ }
+ fixed: 0 1;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: PART_UPARROW;
+ scale: 1;
+ type, SWALLOW;
+ clip_to, "clip.uparrow";
+ description {
+ state: "default" 0.0;
+ min: 75 75;
+ rel1 {
+ to: "padding_uparrow";
+ relative: 0.5 1.0;
+ }
+ rel2 {
+ to: "padding_uparrow";
+ relative: 0.5 1.0;
+ }
+ fixed: 1 1;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name, "clip.downarrow";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 0.0 1.0;
+ min, 0 94;
+ align, 0.5 1.0;
+ fixed, 0 1;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ align, 0.5 0.0;
+ visible, 0;
+ }
+ }
+ part {
+ name: "padding_downarrow";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 19;
+ rel1 {
+ to: "clip.downarrow";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "clip.downarrow";
+ }
+ fixed: 0 1;
+ align: 0.5 1.0;
+ }
+ }
+ part {
+ name: PART_DOWNARROW;
+ scale: 1;
+ type, SWALLOW;
+ clip_to, "clip.downarrow";
+ description {
+ state: "default" 0.0;
+ min: 75 75;
+ rel1 {
+ to: "padding_downarrow";
+ relative: 0.5 0.0;
+ }
+ rel2 {
+ to: "padding_downarrow";
+ relative: 0.5 0.0;
+ }
+ fixed: 1 1;
+ align: 0.5 1.0;
+ }
+ }
+ part {
+ name, "clip.leftarrow";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel2.relative, 0.0 1.0;
+ min, 94 0;
+ align, 0.0 0.5;
+ fixed, 1 0;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ align, 1.0 0.5;
+ visible, 0;
+ }
+ }
+ part {
+ name: "padding_leftarrow";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 19 0;
+ rel1 {
+ to: "clip.leftarrow";
+ }
+ rel2 {
+ to: "clip.leftarrow";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 0;
+ align: 0.0 0.5;
+ }
+ }
+ part {
+ name: PART_LEFTARROW;
+ scale: 1;
+ type, SWALLOW;
+ clip_to, "clip.leftarrow";
+ description {
+ state: "default" 0.0;
+ min: 75 75;
+ rel1 {
+ to: "padding_leftarrow";
+ relative: 1.0 0.5;
+ }
+ rel2 {
+ to: "padding_leftarrow";
+ relative: 1.0 0.5;
+ }
+ fixed: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ part {
+ name, "clip.rightarrow";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 1.0 0.0;
+ min, 94 0;
+ align, 1.0 0.5;
+ fixed, 1 0;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ align, 0.0 0.5;
+ visible, 0;
+ }
+ }
+ part {
+ name: "padding_rightarrow";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 19 0;
+ rel1 {
+ to: "clip.rightarrow";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "clip.rightarrow";
+ }
+ fixed: 1 0;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name: PART_RIGHTARROW;
+ scale: 1;
+ type, SWALLOW;
+ clip_to, "clip.rightarrow";
+ description {
+ state: "default" 0.0;
+ min: 75 75;
+ rel1 {
+ to: "padding_rightarrow";
+ relative: 0.0 0.5;
+ }
+ rel2 {
+ to: "padding_rightarrow";
+ relative: 0.0 0.5;
+ }
+ fixed: 1 1;
+ align: 1.0 0.5;
+ }
+ }
+ part {
+ name, "clip.zoom_navi";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 1.0 1.0;
+ min, 450 350;
+ align, 1.0 1.0;
+ color, 255 255 255 255;
+ }
+ description {
+ state, "hide" 0.0;
+ inherit, "default" 0.0;
+ color, 0 0 0 0;
+ }
+ }
+ part {
+ name, "padding.zoom_navi";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, "clip.zoom_navi";
+ relative, 1.0 1.0;
+ }
+ rel2 {
+ to, "clip.zoom_navi";
+ relative, 1.0 1.0;
+ }
+ min, 50 50;
+ align, 1.0 1.0;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_ZOOM_NAVI;
+ type, SWALLOW;
+ clip_to, "clip.zoom_navi";
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, "padding.zoom_navi";
+ relative, 0.0 0.0;
+ }
+ rel2 {
+ to, "padding.zoom_navi";
+ relative, 0.0 0.0;
+ }
+ min, 400 300;
+ align, 1.0 1.0;
+ visible, 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name, "hide";
+ signal, SIG_HIDE;
+ source, "";
+ action, STATE_SET "hide" 0.0;
+ target, "clip.rect";
+ target, "clip.uparrow";
+ target, "clip.downarrow";
+ target, "clip.leftarrow";
+ target, "clip.rightarrow";
+ target, "clip.zoom_navi";
+ transition, LINEAR 0.15;
+ }
+ program {
+ name, "show";
+ signal, SIG_SHOW;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, "clip.rect";
+ target, "clip.zoom_navi";
+ transition, LINEAR 0.15;
+ after, "show,done";
+ }
+ program {
+ name, "show,done";
+ script {
+ if (get_int(uparrow) == 1)
+ run_program(PROGRAM:"uparrow_show");
+ if (get_int(downarrow) == 1)
+ run_program(PROGRAM:"downarrow_show");
+ if (get_int(leftarrow) == 1)
+ run_program(PROGRAM:"leftarrow_show");
+ if (get_int(rightarrow) == 1)
+ run_program(PROGRAM:"rightarrow_show");
+ }
+ }
+ program {
+ name, "uparrow_show";
+ signal, SIG_UPARROW_SHOW;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, "clip.uparrow";
+ transition, LINEAR 0.15;
+ after, "uparrow_show,done";
+ }
+ program {
+ name, "uparrow_show,done";
+ script {
+ set_int(uparrow, 1);
+ }
+ }
+ program {
+ name, "uparrow_hide";
+ signal, SIG_UPARROW_HIDE;
+ source, "";
+ action, STATE_SET "hide" 0.0;
+ target, "clip.uparrow";
+ transition, LINEAR 0.15;
+ after, "uparrow_hide,done";
+ }
+ program {
+ name, "uparrow_hide,done";
+ script {
+ set_int(uparrow, 0);
+ }
+ }
+ program {
+ name, "downarrow_show";
+ signal, SIG_DOWNARROW_SHOW;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, "clip.downarrow";
+ transition, LINEAR 0.15;
+ after, "downarrow_show,done";
+ }
+ program {
+ name, "downarrow_show,done";
+ script {
+ set_int(downarrow, 1);
+ }
+ }
+ program {
+ name, "downarrow_hide";
+ signal, SIG_DOWNARROW_HIDE;
+ source, "";
+ action, STATE_SET "hide" 0.0;
+ target, "clip.downarrow";
+ transition, LINEAR 0.15;
+ after, "downarrow_hide,done";
+ }
+ program {
+ name, "downarrow_hide,done";
+ script {
+ set_int(downarrow, 0);
+ }
+ }
+ program {
+ name, "leftarrow_show";
+ signal, SIG_LEFTARROW_SHOW;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, "clip.leftarrow";
+ transition, LINEAR 0.15;
+ after, "leftarrow_show,done";
+ }
+ program {
+ name, "leftarrow_show,done";
+ script {
+ set_int(leftarrow, 1);
+ }
+ }
+ program {
+ name, "leftarrow_hide";
+ signal, SIG_LEFTARROW_HIDE;
+ source, "";
+ action, STATE_SET "hide" 0.0;
+ target, "clip.leftarrow";
+ transition, LINEAR 0.15;
+ after, "leftarrow_hide,done";
+ }
+ program {
+ name, "leftarrow_hide,done";
+ script {
+ set_int(leftarrow, 0);
+ }
+ }
+ program {
+ name, "rightarrow_show";
+ signal, SIG_RIGHTARROW_SHOW;
+ source, "";
+ action, STATE_SET "default" 0.0;
+ target, "clip.rightarrow";
+ transition, LINEAR 0.15;
+ after, "rightarrow_show,done";
+ }
+ program {
+ name, "rightarrow_show,done";
+ script {
+ set_int(rightarrow, 1);
+ }
+ }
+ program {
+ name, "rightarrow_hide";
+ signal, SIG_RIGHTARROW_HIDE;
+ source, "";
+ action, STATE_SET "hide" 0.0;
+ target, "clip.rightarrow";
+ transition, LINEAR 0.15;
+ after, "rightarrow_hide,done";
+ }
+ program {
+ name, "rightarrow_hide,done";
+ script {
+ set_int(rightarrow, 0);
+ }
+ }
+ }
+}
+
+group {
+ name, GRP_ZOOM_NAVI;
+ images {
+ image, IMAGE_PHOTO_ZOOM_NAVI_RECT COMP;
+ }
+ parts {
+ part {
+ name, "area";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 400 300;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_ZOOM_NAVI_IMG_BORDER;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 400 300;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, PART_ZOOM_NAVI_IMG;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 400 300;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, PART_ZOOM_NAVI_RECT;
+ type, SWALLOW;
+ description {
+ state, "default" 0.0;
+ min, 100 200;
+ fixed, 1 1;
+ }
+ }
+ }
+}
--- /dev/null
+#define STATE_NORMAL 0
+#define STATE_HIGHLIGHT 1
+
+group {
+ name: "elm/button/base/category_menu";
+ images {
+ image: IMAGE_MENU_BTN_BG COMP;
+ }
+ script {
+ public cur_state;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 406 87;
+ image.normal: IMAGE_MENU_BTN_BG;
+ color: 0 0 0 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ color: 147 170 0 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 51;
+ }
+ description {
+ state: "highlight_0" 0.0;
+ inherit: "selected_0" 0.0;
+ }
+ }
+ part {
+ name: "padding_icon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 85 0;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ type: SWALLOW;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 40 40;
+ rel1 {
+ to: "padding_icon";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "padding_icon";
+ }
+ color: 255 255 255 153;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "padding_text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 30 0;
+ rel1 {
+ to: PART_ELM_SWALLOWICON;
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: PART_ELM_SWALLOWICON;
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 221 87;
+ rel1 {
+ to_x: "padding_text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to_x: "padding_text";
+ relative: 1.0 1.0;
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ }
+ color: 255 255 255 153;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ text.font: FONT_STYLE_SANS_MEDIUM;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ text.font: FONT_STYLE_SANS_MEDIUM;
+ color: 255 255 255 255;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ }
+ }
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_state(PART:"bg", "selected_0", 0.0);
+ run_program(PROGRAM:"focus,anim");
+ }
+ }
+ program {
+ name: "focus,anim,2";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "focus,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "elm.text";
+ target: PART_ELM_SWALLOWICON;
+ after: "focus,anim,2";
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+ if (state == STATE_HIGHLIGHT) {
+ set_state(PART:"bg", "highlight_0", 0.0);
+ set_state(PART:"elm.text", "highlight", 0.0);
+ set_state(PART:PART_ELM_SWALLOWICON, "highlight", 0.0);
+ run_program(PROGRAM:"unfocus,high,anim");
+ } else {
+ run_program(PROGRAM:"unfocus,default,anim");
+ }
+ }
+ }
+ program {
+ name: "unfocus,high,anim";
+ action: STATE_SET "highlight" 0.0;
+ target: "bg";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "unfocus,default,anim";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.text";
+ target: PART_ELM_SWALLOWICON;
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "highlight";
+ signal: "highlight";
+ source: "";
+ script {
+ set_int(cur_state, STATE_HIGHLIGHT);
+ set_state(PART:"bg", "highlight", 0.0);
+ set_state(PART:"elm.text", "highlight", 0.0);
+ set_state(PART:PART_ELM_SWALLOWICON, "highlight", 0.0);
+ }
+ }
+ program {
+ name: "unhighlight";
+ signal: "unhighlight";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ set_state(PART:PART_ELM_SWALLOWICON, "default", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/photo_btn_prev";
+ images {
+ image: IMAGE_PHOTO_BTN_PREV_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_PREV_FOCUS COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_PREV_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_PREV_FOCUS;
+ }
+ description {
+ state: "selected_in" 0.0;
+ min: 60 60;
+ max: 60 60;
+ image.normal: IMAGE_PHOTO_BTN_PREV_FOCUS;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "mouse,anim,start";
+ signal: "mouse,anim,start";
+ source: "";
+ action: STATE_SET "selected_in" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "mouse,anim,end";
+ }
+ program {
+ name: "mouse,anim,end";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "emit,signal";
+ }
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "prev";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/photo_btn_next";
+ inherit: "elm/button/base/photo_btn_prev";
+ images {
+ image: IMAGE_PHOTO_BTN_NEXT_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_NEXT_FOCUS COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_NEXT_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_NEXT_FOCUS;
+ }
+ description {
+ state: "selected_in" 0.0;
+ min: 60 60;
+ max: 60 60;
+ image.normal: IMAGE_PHOTO_BTN_NEXT_FOCUS;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "next";
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/photo_btn_rotate";
+ inherit: "elm/button/base/photo_btn_prev";
+ images {
+ image: IMAGE_PHOTO_BTN_ROTATE_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_ROTATE_FOCUS COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_ROTATE_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_ROTATE_FOCUS;
+ }
+ description {
+ state: "selected_in" 0.0;
+ min: 60 60;
+ max: 60 60;
+ image.normal: IMAGE_PHOTO_BTN_ROTATE_FOCUS;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "rotate";
+ }
+ }
+}
+
+#define STATE_PAUSE 0
+#define STATE_PLAY 1
+group {
+ name: "elm/button/base/photo_btn_slideshow";
+ images {
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_FOCUS COMP;
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_FOCUS COMP;
+ }
+ script {
+ public cur_state;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_PAUSE_FOCUS;
+ }
+ description {
+ state: "selected_in" 0.0;
+ inherit: "selected" 0.0;
+ min: 60 60;
+ max: 60 60;
+ }
+ description {
+ state: "default_play" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_NORMAL;
+ }
+ description {
+ state: "selected_play" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_PLAY_FOCUS;
+ }
+ description {
+ state: "selected_play_in" 0.0;
+ inherit: "selected_play" 0.0;
+ min: 60 60;
+ max: 60 60;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ script {
+ set_int(cur_state, STATE_PAUSE);
+ }
+ }
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "mouse,anim,start";
+ signal: "mouse,anim,start";
+ source: "";
+ script {
+ new state;
+ state = get_int(cur_state);
+
+ if (state == STATE_PAUSE) {
+ run_program(PROGRAM:"pause_to_play_anim_start");
+ set_int(cur_state, STATE_PLAY);
+ } else {
+ run_program(PROGRAM:"play_to_pause_anim_start");
+ set_int(cur_state, STATE_PAUSE);
+ }
+ }
+ }
+ program {
+ name: "pause_to_play_anim_start";
+ action: STATE_SET "selected_in" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "pause_to_play_anim_end";
+ }
+ program {
+ name: "pause_to_play_anim_end";
+ action: STATE_SET "selected_play" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "emit,signal";
+ }
+ program {
+ name: "play_to_pause_anim_start";
+ action: STATE_SET "selected_play_in" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "play_to_pause_anim_end";
+ }
+ program {
+ name: "play_to_pause_anim_end";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "emit,signal";
+ }
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "slideshow";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+
+ if (state == STATE_PAUSE)
+ set_state(PART:"bg", "selected", 0.0);
+ else
+ set_state(PART:"bg", "selected_play", 0.0);
+ }
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+
+ if (state == STATE_PAUSE)
+ set_state(PART:"bg", "default", 0.0);
+ else
+ set_state(PART:"bg", "default_play", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/photo_btn_setting";
+ images {
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_FOCUS COMP;
+ image: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_HIGH COMP;
+ }
+ script {
+ public cur_state;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_FOCUS;
+ }
+ description {
+ state: "selected_in" 0.0;
+ inherit: "selected" 0.0;
+ min: 60 60;
+ max: 60 60;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_SLIDESHOW_SETTING_HIGH;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ }
+ }
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_state(PART:"bg", "selected", 0.0);
+ }
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+ if (state == STATE_HIGHLIGHT)
+ set_state(PART:"bg", "highlight", 0.0);
+ else
+ set_state(PART:"bg", "default", 0.0);
+ }
+ }
+ program {
+ name: "mouse,anim,start";
+ signal: "mouse,anim,start";
+ source: "";
+ action: STATE_SET "selected_in" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "mouse,anim,end";
+ }
+ program {
+ name: "mouse,anim,end";
+ action: STATE_SET "highlight" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ after: "emit,signal";
+ }
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "setting";
+ }
+ program {
+ name: "highlight";
+ signal: "elm,action,highlight";
+ source: "elm";
+ script {
+ set_int(cur_state, STATE_HIGHLIGHT);
+ set_state(PART:"bg", "highlight", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/photo_btn_zoom";
+ inherit: "elm/button/base/photo_btn_setting";
+ images {
+ image: IMAGE_PHOTO_BTN_ZOOM_NORMAL COMP;
+ image: IMAGE_PHOTO_BTN_ZOOM_FOCUS COMP;
+ image: IMAGE_PHOTO_BTN_ZOOM_HIGH COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 110 110;
+ image.normal: IMAGE_PHOTO_BTN_ZOOM_NORMAL;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_ZOOM_FOCUS;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_PHOTO_BTN_ZOOM_HIGH;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "emit,signal";
+ action: SIGNAL_EMIT "btn,anim,finish" "zoom";
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/shorttext";
+ images {
+ image: IMAGE_ICON_CHECK_HIGH COMP;
+ image: IMAGE_ICON_CHECK_FOC COMP;
+ }
+ script {
+ public cur_state;
+ public hide_line;
+ }
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 310 82;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "division_line";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 310 2;
+ color: 89 89 89 51;
+ rel1 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "bg";
+ }
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "padding_text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 40 0;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 190 80;
+ rel1 {
+ to: "padding_text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "padding_text";
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ }
+ color: 89 89 89 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 147 170 0 255;
+ }
+ }
+ part {
+ name: "padding_icon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 30;
+ rel1 {
+ to: "elm.text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "elm.text";
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 20;
+ rel1 {
+ to: "padding_icon";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_icon";
+ }
+ image.normal: IMAGE_ICON_CHECK_FOC;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ visible: 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_ICON_CHECK_HIGH;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_int(hide_line, 0);
+ }
+ }
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+
+ if (state == STATE_HIGHLIGHT)
+ set_state(PART:PART_ELM_SWALLOWICON, "selected", 0.0);
+
+ set_state(PART:"bg", "selected", 0.0);
+ set_state(PART:"division_line", "selected", 0.0);
+ set_state(PART:"elm.text", "selected", 0.0);
+ }
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ new state;
+ new var;
+ new buf[100];
+ state = get_int(cur_state);
+
+ if (state == STATE_HIGHLIGHT)
+ snprintf(buf, sizeof(buf), "highlight");
+ else
+ snprintf(buf, sizeof(buf), "default");
+
+ var = get_int(hide_line);
+ set_state(PART:"bg", buf, 0.0);
+ if (!var)
+ set_state(PART:"division_line", buf, 0.0);
+ set_state(PART:"elm.text", buf, 0.0);
+ set_state(PART:PART_ELM_SWALLOWICON, buf, 0.0);
+ }
+ }
+ program {
+ name: "highlight";
+ signal: "elm,action,highlight";
+ source: "elm";
+ script {
+ set_int(cur_state, STATE_HIGHLIGHT);
+ }
+ after: "highlight1";
+ }
+ program {
+ name: "highlight1";
+ action: STATE_SET "highlight" 0.0;
+ target: "bg";
+ target: "elm.text";
+ target: PART_ELM_SWALLOWICON;
+ target: "division_line";
+ }
+ program {
+ name: "hide_line";
+ signal: "elm,action,hideline";
+ source: "elm";
+ script {
+ set_int(hide_line, 1);
+ set_state(PART:"division_line", "selected", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/longtext";
+ inherit: "elm/button/base/shorttext";
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 360 82;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "division_line";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 360 2;
+ color: 89 89 89 51;
+ rel1 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "bg";
+ }
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 240 80;
+ rel1 {
+ to: "padding_text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "padding_text";
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ }
+ color: 89 89 89 255;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 147 170 0 255;
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/hovertext";
+ inherit: "elm/button/base/shorttext";
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 72;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "division_line";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 2;
+ color: 89 89 89 51;
+ rel1 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "bg";
+ }
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "padding_text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 32 0;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 0 72;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_text";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "padding_text";
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ min: 1 0;
+ }
+ align: 0.0 0.0;
+ color: 89 89 89 255;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ color: 147 170 0 255;
+ }
+ }
+ part {
+ name: "padding_updown";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 10 0;
+ rel1 {
+ to: "elm.text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "elm.text";
+ }
+ align: 0.0 0.5;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON2;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ max: 24 24;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_updown";
+ }
+ rel2 {
+ to: "padding_updown";
+ }
+ align: 0.0 0.5;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_icon";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 26 26;
+ rel1 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 20;
+ rel1 {
+ to: "padding_icon";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "padding_icon";
+ relative: 0.0 1.0;
+ }
+ image.normal: IMAGE_ICON_CHECK_FOC;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ visible: 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ image.normal: IMAGE_ICON_CHECK_HIGH;
+ visible: 1;
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/sort";
+ images {
+ image: IMAGE_ICON_PULL_DOWN_NOR COMP;
+ image: IMAGE_ROUND_RECTANGLE COMP;
+ }
+ script {
+ public cur_state;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 72;
+ rel2.relative: 0.0 0.0;
+ image {
+ normal: IMAGE_ROUND_RECTANGLE;
+ border: 4 4 4 4;
+ border_scale: 1;
+ }
+ align: 0.0 0.0;
+ color: 0 0 0 76;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ color: 147 170 0 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight_0" 0.0;
+ inherit: "highlight" 0.0;
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "padding_txt";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 32 0;
+ rel2.relative: 0.0 0.0;
+ align: 0.0 0.5;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 0 72;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_txt";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to: "padding_txt";
+ }
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ min: 1 0;
+ }
+ align: 0.0 0.0;
+ color: 175 175 175 255;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ }
+ part {
+ name: "padding_updown";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 10 0;
+ rel1 {
+ to: "elm.text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "elm.text";
+ }
+ align: 0.0 0.5;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ max: 24 24;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "padding_updown";
+ }
+ rel2 {
+ to: "padding_updown";
+ }
+ align: 0.0 0.5;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_arrow";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 24 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ }
+ align: 1.0 0.5;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "arrow_img";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ max: 24 24;
+ rel1 {
+ relative: 0.0 0.0;
+ to: "padding_arrow";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to: "padding_arrow";
+ }
+ image.normal: IMAGE_ICON_PULL_DOWN_NOR;
+ align: 1.0 0.5;
+ fixed: 1 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ }
+ }
+ program {
+ name: "button_down";
+ signal: "mouse,down,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ }
+ program {
+ name: "button_mouseup";
+ signal: "mouse,up,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_state(PART:"bg", "selected_0", 0.0);
+ run_program(PROGRAM:"focus,anim");
+ }
+ }
+ program {
+ name: "focus,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ target: "elm.text";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ new state;
+ state = get_int(cur_state);
+ if (state == STATE_HIGHLIGHT) {
+ set_state(PART:"bg", "highlight_0", 0.0);
+ set_state(PART:"elm.text", "highlight", 0.0);
+ run_program(PROGRAM:"unfocus,high,anim");
+ } else {
+ run_program(PROGRAM:"unfocus,default,anim");
+ }
+ }
+ }
+ program {
+ name: "unfocus,high,anim";
+ action: STATE_SET "highlight" 0.0;
+ target: "bg";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "unfocus,default,anim";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.text";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "unfocus";
+ signal: "unfocused";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.text";
+ }
+ program {
+ name: "highlight";
+ signal: "highlight";
+ source: "";
+ script {
+ set_int(cur_state, STATE_HIGHLIGHT);
+ set_state(PART:"bg", "highlight", 0.0);
+ set_state(PART:"elm.text", "highlight", 0.0);
+ }
+ }
+ program {
+ name: "unhighlight";
+ signal: "unhighlight";
+ source: "";
+ script {
+ set_int(cur_state, STATE_NORMAL);
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/source";
+ inherit: "elm/button/base/sort";
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 323 72;
+ rel2.relative: 0.0 0.0;
+ image {
+ normal: IMAGE_ROUND_RECTANGLE;
+ border: 4 4 4 4;
+ border_scale: 1;
+ }
+ align: 0.0 0.0;
+ color: 255 255 255 13;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ color: 147 170 0 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight_0" 0.0;
+ inherit: "highlight" 0.0;
+ color: 255 255 255 0;
+ }
+ }
+ }
+}
--- /dev/null
+group {
+ name: "elm/ctxpopup/base/viewer_popup";
+ images {
+ image: IMAGE_TOOLTIP_ARROW COMP;
+ }
+ parts {
+ part {
+ name: "elm.swallow.content";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ }
+ }
+ part {
+ name: "ctxpopup_arrow";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 14 9;
+ fixed: 1 1;
+ rel1 {
+ to: "elm.swallow.content";
+ relative: 0.5 1;
+ }
+ rel2 {
+ to: "elm.swallow.content";
+ relative: 0.5 1;
+ }
+ align: 0.5 0.0;
+ image.normal: IMAGE_TOOLTIP_ARROW;
+ color: 255 255 255 255;
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/ctxpopup/base/hover_popup";
+ parts {
+ part {
+ name: "elm.swallow.content";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ }
+ }
+ }
+}
+
+group { name: "elm/ctxpopup/arrow/default";
+ parts {
+ part {
+ name: "ctxpopup_arrow";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ }
+ }
+ }
+}
--- /dev/null
+group {
+ name: "elm/gengrid/item/photoitem/default";
+ data.item: "selectraise" "on";
+ data.item: "texts" "elm.text";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image: IMAGE_INNER_SHADOW COMP;
+ image: IMAGE_PHOTO_DEFAULT COMP;
+ }
+ parts {
+ part {
+ name: "elm.padding.bottom_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ min: 20 20;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "elm.padding.top_left_anim";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 0.0 0.0;
+ min: 31 39;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.bottom_right_anim";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "elm.padding.bottom_right";
+ }
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ min: 31 39;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "map";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ perspective {
+ zplane: 0;
+ focal: 1000;
+ }
+ visible: 0;
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ perspective.zplane: -100;
+ }
+ }
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "elm.padding.bottom_left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ min: 0 65;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "defaultbg";
+ scale: 1;
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "elm.bg.text";
+ relative: 1.0 0.0;
+ }
+ color: 0 0 0 115;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "default_image";
+ scale: 1;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ min: 126 126;
+ max: 126 126;
+ rel1 {
+ to: "defaultbg";
+ }
+ rel2 {
+ to: "defaultbg";
+ }
+ image.normal: IMAGE_PHOTO_DEFAULT;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ scale: 1;
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ rel1 {
+ to: "defaultbg";
+ }
+ rel2 {
+ to: "defaultbg";
+ }
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "part_focus1";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 8;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ color: 147 170 0 255;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "part_focus2";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 0.0 0.0;
+ }
+ color: 147 170 0 255;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "part_focus3";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 1.0 0.0;
+ }
+ color: 147 170 0 255;
+ fixed: 1 0;
+ align: 1.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "elm.bg.text";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "elm.padding.bottom_left";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ color: 27 31 8 230;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ map.on: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "inner_shadow";
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image {
+ normal: IMAGE_INNER_SHADOW;
+ border: 5 5 5 5;
+ border_scale: 1;
+ }
+ rel1 {
+ to_x: "part_focus2";
+ to_y: "part_focus1";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to_x: "part_focus3";
+ to_y: "elm.bg.text";
+ relative: 0.0 0.0;
+ }
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ visible: 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.text.left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 0;
+ fixed: 1 1;
+ rel1 {
+ to: "elm.padding.bottom_left";
+ }
+ rel2 {
+ to: "elm.padding.bottom_left";
+ relative: 0.0 0.0;
+ }
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.text.right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 0;
+ fixed: 1 1;
+ rel1 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "bg";
+ }
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 26;
+ }
+ rel1 {
+ to: "elm.padding.text.left";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "elm.padding.text.right";
+ relative: 0.0 0.0;
+ }
+ color: 211 211 211 255;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ }
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active";
+ signal: "elm,state,focused";
+ source: "elm";
+ action: STATE_SET "selected_0" 0.0;
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "elm.bg.text";
+ target: "elm.text";
+ after: "focus,in,anim";
+ }
+ program {
+ name: "focus,in,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "defaultbg";
+ target: "default_image";
+ target: PART_ELM_SWALLOWICON;
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "elm.bg.text";
+ target: "inner_shadow";
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ after, "item_focused";
+ }
+ program {
+ name, "item_focused";
+ action: SIGNAL_EMIT "item_focused" "edc";
+ }
+ program {
+ name: "go_passive";
+ signal: "elm,state,unfocused";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text";
+ after: "focus,out,anim,2";
+ }
+ program {
+ name: "focus,out,anim,2";
+ action: STATE_SET "selected_0" 0.0;
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "elm.bg.text";
+ target: "inner_shadow";
+ transition: LINEAR 0.17;
+ after: "focus,out,anim,3";
+ }
+ program {
+ name: "focus,out,anim,3";
+ action: STATE_SET "default" 0.0;
+ target: "default_image";
+ target: PART_ELM_SWALLOWICON;
+ target: "defaultbg";
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "elm.bg.text";
+ }
+ program {
+ name: "button_activated";
+ signal: "elm,state,activated";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "button_clicked";
+ signal: "elm,state,selected";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "after_clicked";
+ action: STATE_SET "default" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "item_select";
+ }
+ program {
+ name: "item_select";
+ action: SIGNAL_EMIT "item_clicked" "edc";
+ }
+ }
+}
+
+group {
+ name: "elm/gengrid/item/videoitem/default";
+ inherit: "elm/gengrid/item/photoitem/default";
+ data.item: "selectraise" "on";
+ data.item: "texts" "elm.text elm.text.playtime";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image: IMAGE_VIDEO_THUMBNAIL_SHADOW COMP;
+ image: IMAGE_BTN_PLAY_VIDEO_NORMAL COMP;
+ image: IMAGE_ROUND_RECTANGLE_2 COMP;
+ }
+ parts {
+ part {
+ name: "thumbnail_shadow";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 263 54;
+ image.normal: IMAGE_VIDEO_THUMBNAIL_SHADOW;
+ fill.smooth: 1;
+ rel2.relative: 0.0 0.0;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 0 0 0 128;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "default_image";
+ scale: 1;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ min: 126 126;
+ max: 126 126;
+ rel1 {
+ to: "defaultbg";
+ }
+ rel2 {
+ to: "defaultbg";
+ }
+ visible: 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "btn_play_bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 126 126;
+
+ rel1 {
+ to: PART_ELM_SWALLOWICON;
+ relative: 0.5 0.5;
+ }
+ rel2 {
+ to: PART_ELM_SWALLOWICON;
+ relative: 0.5 0.5;
+ }
+ color: 0 0 0 76;
+ fixed: 1 1;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ image {
+ normal: IMAGE_ROUND_RECTANGLE_2;
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "btn_play";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ image.normal: IMAGE_BTN_PLAY_VIDEO_NORMAL;
+ rel1 {
+ to: "btn_play_bg";
+ }
+ rel2 {
+ to: "btn_play_bg";
+ }
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "elm.padding.playtime";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 21 8;
+ fixed: 1 1;
+ rel1 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: "elm.text.playtime";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 221 38;
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 22;
+ align: 1 0.5;
+ }
+ rel1 {
+ to: "elm.padding.playtime";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "elm.padding.playtime";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ align: 1.0 0.0;
+ color: 255 255 255 255;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "focus,in,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "inner_shadow";
+ target: PART_ELM_SWALLOWICON;
+ target: "defaultbg";
+ target: "elm.text.playtime";
+ target: "btn_play_bg";
+ target: "btn_play";
+ target: "thumbnail_shadow";
+ target: "elm.bg.text";
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "focus,out,anim,3";
+ action: STATE_SET "default" 0.0;
+ target: "elm.bg.text";
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: PART_ELM_SWALLOWICON;
+ target: "elm.text.playtime";
+ target: "btn_play_bg";
+ target: "btn_play";
+ target: "defaultbg";
+ target: "thumbnail_shadow";
+ }
+ }
+}
+
+group {
+ name: "elm/gengrid/item/eventitem/default";
+ data.item: "selectraise" "on";
+ data.item: "texts" "elm.text elm.text.count";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image: IMAGE_EVENT_FOLDER_FRAME COMP;
+ image: IMAGE_FOLDER_ICON COMP;
+ image: IMAGE_INNER_SHADOW COMP;
+ }
+ parts {
+ part {
+ name: "elm.padding.bottom_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ min: 20 20;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "map";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ perspective {
+ zplane: 0;
+ focal: 1000;
+ }
+ visible: 0;
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ perspective.zplane: -100;
+ }
+ }
+ part {
+ name: "elm.bg";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ color: 0 0 0 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 255;
+ visible: 1;
+ map.on: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ color: 147 170 0 0;
+ visible: 1;
+ }
+ }
+ part {
+ name: "padding_image";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 0.0 0.0;
+ min: 14 15;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "image_folder";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 235 215;
+ image.normal: IMAGE_EVENT_FOLDER_FRAME;
+ rel1 {
+ to: "padding_image";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_image";
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 255 255 255 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ color: 255 255 255 153;
+ }
+ }
+ part {
+ name: "padding_swallow";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 4 3;
+ rel1 {
+ to: "image_folder";
+ }
+ rel2 {
+ to: "image_folder";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "defaultbg";
+ scale: 1;
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ rel1 {
+ to: PART_ELM_SWALLOWICON;
+ }
+ rel2 {
+ to: PART_ELM_SWALLOWICON;
+ }
+ color: 0 0 0 115;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "folder";
+ scale: 1;
+ mouse_events: 1;
+ description {
+ state : "default" 0.0;
+ min: 126 126;
+ max: 126 126;
+ rel1 {
+ to: "defaultbg";
+ }
+ rel2 {
+ to: "defaultbg";
+ }
+ image.normal: IMAGE_PHOTO_DEFAULT;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: PART_ELM_SWALLOWICON;
+ scale: 1;
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ min: 211 191;
+ rel1 {
+ to: "padding_swallow";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_swallow";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 0 0 0 128;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "padding_count";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 10;
+ rel1 {
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_FILECOUNT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 27;
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 22;
+ }
+ rel1 {
+ to: "elm.text";
+ relative: 0 1;
+ }
+ rel2 {
+ to: "elm.text";
+ relative: 0 1;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 128 128 128 255;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.text";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 45;
+ rel1 {
+ to: "elm.padding.bottom_right";
+ }
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 36;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 26;
+ }
+ rel1 {
+ to: "elm.padding.text";
+ }
+ rel2 {
+ to: "elm.padding.text";
+ relative: 0.0 0.0;
+ }
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ fixed: 1 1;
+ align: 1.0 1.0;
+ color: 211 211 211 255;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ }
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active";
+ signal: "elm,state,focused";
+ source: "elm";
+ action: STATE_SET "selected_0" 0.0;
+ target: "elm.text";
+ target: PART_FILECOUNT;
+ target: "elm.bg";
+ after: "focus,in,anim";
+ }
+ program {
+ name: "focus,in,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "elm.bg";
+ target: "image_folder";
+ target: "defaultbg";
+ target: "folder";
+ target: PART_ELM_SWALLOWICON;
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "go_passive";
+ signal: "elm,state,unfocused";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: PART_FILECOUNT;
+ target: "elm.text";
+ after: "focus,out,anim,2";
+ }
+ program {
+ name: "focus,out,anim,2";
+ action: STATE_SET "selected_0" 0.0;
+ target: "elm.bg";
+ transition: LINEAR 0.17;
+ after: "focus,out,anim,3";
+ }
+ program {
+ name: "focus,out,anim,3";
+ action: STATE_SET "default" 0.0;
+ target: "elm.bg";
+ target: "image_folder";
+ target: "defaultbg";
+ target: "folder";
+ target: PART_ELM_SWALLOWICON;
+ }
+ program {
+ name: "button_activated";
+ signal: "elm,state,activated";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "button_clicked";
+ signal: "elm,state,selected";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "after_clicked";
+ action: STATE_SET "default" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "item_select";
+ }
+ program {
+ name: "item_select";
+ action: SIGNAL_EMIT "item_clicked" "edc";
+ }
+ }
+}
+
+group {
+ name: "elm/gengrid/item/folderitem/default";
+ data.item: "selectraise" "on";
+ data.item: "texts" "elm.text elm.text.count";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image: IMAGE_FOLDER_ICON COMP;
+ image: IMAGE_INNER_SHADOW COMP;
+ }
+ parts {
+ part {
+ name: "elm.padding.bottom_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ min: 20 20;
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "map";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ perspective {
+ zplane: 0;
+ focal: 1000;
+ }
+ visible: 0;
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ perspective.zplane: -100;
+ }
+ }
+ part {
+ name: "elm.bg";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ color: 0 0 0 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "padding_image";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 0.0 0.0;
+ min: 8 8;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "image_folder";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 247 239;
+ rel1 {
+ to: "padding_image";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to: "padding_image";
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 0 0 0 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ color: 0 0 0 102;
+ }
+ }
+ part {
+ name: "folder";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ max: 200 200;
+ image.normal: IMAGE_FOLDER_ICON;
+ rel1 {
+ to: "image_folder";
+ }
+ rel2 {
+ to: "image_folder";
+ }
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "inner_shadow";
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image {
+ normal: IMAGE_INNER_SHADOW;
+ border: 5 5 5 5;
+ border_scale: 1;
+ }
+ rel1 {
+ to: "image_folder";
+ }
+ rel2 {
+ to: "image_folder";
+ }
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ }
+ part {
+ name: "part_focus1";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 8;
+ rel1 {
+ to: "elm.bg";
+ }
+ rel2 {
+ to: "elm.bg";
+ relative: 1.0 0.0;
+ }
+ color: 147 170 0 255;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ map.on: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "part_focus2";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_x: "elm.bg";
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ color: 147 170 0 255;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "part_focus3";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to_x: "elm.bg";
+ to_y: "image_folder";
+ }
+ color: 147 170 0 255;
+ fixed: 1 0;
+ align: 1.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "part_focus4";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to_x: "elm.bg";
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "elm.bg";
+ }
+ color: 147 170 0 255;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 147 170 0 0;
+ }
+ }
+ part {
+ name: "padding_count";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 10;
+ rel1 {
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_y: "image_folder";
+ relative: 0.0 1.0;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: PART_FILECOUNT;
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 27;
+ text {
+ font: FONT_STYLE_SANS_REGULAR;
+ size: 22;
+ }
+ rel1 {
+ to: "elm.text";
+ relative: 0 1;
+ }
+ rel2 {
+ to: "elm.text";
+ relative: 0 1;
+ }
+ fixed: 1 1;
+ align: 0.0 0.0;
+ color: 128 128 128 255;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ }
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.text";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 45;
+ rel1 {
+ to: "elm.padding.bottom_right";
+ }
+ rel2 {
+ to: "elm.padding.bottom_right";
+ relative: 0.0 0.0;
+ }
+ align: 1.0 1.0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 36;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 26;
+ }
+ rel1 {
+ to: "elm.padding.text";
+ }
+ rel2 {
+ to: "elm.padding.text";
+ relative: 0.0 0.0;
+ }
+ fixed: 1 1;
+ align: 1.0 1.0;
+ color: 211 211 211 255;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ text {
+ font: FONT_STYLE_SANS_BOLD;
+ }
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active";
+ signal: "elm,state,focused";
+ source: "elm";
+ action: STATE_SET "selected_0" 0.0;
+ target: "elm.text";
+ target: PART_FILECOUNT;
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "part_focus4";
+ after: "focus,in,anim";
+ }
+ program {
+ name: "focus,in,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "image_folder";
+ target: "inner_shadow";
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "part_focus4";
+ target: "elm.bg";
+ target: "folder";
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "go_passive";
+ signal: "elm,state,unfocused";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: PART_FILECOUNT;
+ target: "elm.text";
+ after: "focus,out,anim,2";
+ }
+ program {
+ name: "focus,out,anim,2";
+ action: STATE_SET "selected_0" 0.0;
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "part_focus4";
+ transition: LINEAR 0.17;
+ after: "focus,out,anim,3";
+ }
+ program {
+ name: "focus,out,anim,3";
+ action: STATE_SET "default" 0.0;
+ target: "image_folder";
+ target: "inner_shadow";
+ target: "part_focus1";
+ target: "part_focus2";
+ target: "part_focus3";
+ target: "part_focus4";
+ target: "elm.bg";
+ target: "folder";
+ }
+ program {
+ name: "button_activated";
+ signal: "elm,state,activated";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "button_clicked";
+ signal: "elm,state,selected";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "after_clicked";
+ }
+ program {
+ name: "after_clicked";
+ action: STATE_SET "default" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "item_select";
+ }
+ program {
+ name: "item_select";
+ action: SIGNAL_EMIT "item_clicked" "edc";
+ }
+ }
+}
+
+group {
+ name: "elm/gengrid/item/photoitem_ctxtmenu/default";
+ inherit: "elm/gengrid/item/photoitem/default";
+ parts {
+ part {
+ name: "part_focus1";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 8;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "part_focus2";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 0.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "part_focus3";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 1.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 1 0;
+ align: 1.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "elm.bg.text";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "elm.padding.bottom_left";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ color: 0 0 0 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 69 143 255 255;
+ map.on: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ color: 69 143 255 0;
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/gengrid/item/videoitem_ctxtmenu/default";
+ inherit: "elm/gengrid/item/videoitem/default";
+ parts {
+ part {
+ name: "part_focus1";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 8;
+ rel1 {
+ to: "bg";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "part_focus2";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 0.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "part_focus3";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 0;
+ rel1 {
+ to: "part_focus1";
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ to_x: "bg";
+ to_y: "elm.bg.text";
+ relative: 1.0 0.0;
+ }
+ color: 69 143 255 255;
+ fixed: 1 0;
+ align: 1.0 0.5;
+ visible: 0;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ visible: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 69 143 255 0;
+ }
+ }
+ part {
+ name: "elm.bg.text";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "elm.padding.bottom_left";
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ color: 0 0 0 76;
+ map {
+ perspective_on: 1;
+ perspective: "map";
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 69 143 255 255;
+ map.on: 1;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "default" 0.0;
+ color: 69 143 255 0;
+ }
+ }
+ }
+}
--- /dev/null
+group { name: "elm/photocam/base/default";
+ parts {
+ part { name: "bg";
+ type: RECT;
+ description { state: "default" 0.0;
+ rel1.offset: 1 1;
+ rel2.offset: -2 -2;
+ color: 255 255 255 0;
+ }
+ }
+ part { name: "clipper";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ }
+ }
+ part { name: "elm.swallow.content";
+ clip_to: "clipper";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ rel1.offset: 1 1;
+ rel2.offset: -2 -2;
+ }
+ }
+ 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;
+ visible: 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: 1.0 0.0;
+ offset: -2 0;
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -2 -1;
+ to_y: "sb_hbar";
+ }
+ }
+ }
+ 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;
+ offset: 0 -2;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -2;
+ to_x: "sb_vbar";
+ }
+ }
+ }
+ }
+ 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);
+ }
+ }
+ }
+}
--- /dev/null
+
+#define FONT_STYLE_SANS_BOLD "TizenSans:style=Bold"
+#define FONT_STYLE_SANS_REGULAR "TizenSans"
+#define FONT_STYLE_SANS_MEDIUM "TizenSans:style=Medium"
--- /dev/null
+group {
+ name: "elm/label/base/tooltip";
+ parts {
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ text {
+ font: FONT_STYLE_SANS_MEDIUM;
+ size: 22;
+ min: 1 1;
+ }
+ color: 29 29 29 255;
+ }
+ }
+ }
+}
+group {
+ name: "elm/tooltip/base/photobtn_tooltip";
+ images {
+ image: IMAGE_TOOLTIP_CENTER COMP;
+ image: IMAGE_TOOLTIP_LEFT COMP;
+ image: IMAGE_TOOLTIP_RIGHT COMP;
+ image: IMAGE_TOOLTIP_ARROW COMP;
+ }
+ parts {
+ part {
+ name: "padding_top";
+ type: SPACER;
+ description {
+ state: "default" 0.0;
+ min: 0 24;
+ rel1 {
+ relative: 1.0 1.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ fixed: 1 1;
+ align: 1.0 1.0;
+ }
+ }
+ part {
+ name: "clipper";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ rel1.to: "pop_left";
+ rel2 {
+ to_x: "pop_right";
+ to_y: "pop_arrow";
+ }
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "pop";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description {
+ state: "default" 0.0;
+ min: 0 57;
+ rel1 {
+ to: "elm.swallow.content";
+ }
+ rel2 {
+ to: "elm.swallow.content";
+ }
+ image {
+ normal: IMAGE_TOOLTIP_CENTER;
+ }
+ color: 255 255 255 229;
+ }
+ }
+ part {
+ name: "pop_left";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description {
+ state: "default" 0.0;
+ min: 20 57;
+ rel1 {
+ to: "pop";
+ }
+ rel2 {
+ to: "pop";
+ relative: 0.0 0.0;
+ }
+ image {
+ normal: IMAGE_TOOLTIP_LEFT;
+ }
+ color: 255 255 255 229;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ }
+ }
+ part {
+ name: "pop_right";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description {
+ state: "default" 0.0;
+ min: 20 57;
+ rel1 {
+ to: "pop";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "pop";
+ relative: 1.0 0.0;
+ }
+ image {
+ normal: IMAGE_TOOLTIP_RIGHT;
+ }
+ color: 255 255 255 229;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "pop_arrow";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description {
+ state: "default" 0.0;
+ min: 14 9;
+ rel1 {
+ to: "pop";
+ relative: 0.5 1.0;
+ }
+ rel2 {
+ to: "pop";
+ relative: 0.5 1.0;
+ }
+ image {
+ normal: IMAGE_TOOLTIP_ARROW;
+ }
+ color: 255 255 255 229;
+ fixed: 1 1;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: "clipper_content";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ rel1.to: "elm.swallow.content";
+ rel2.to: "elm.swallow.content";
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "elm.swallow.content";
+ type: SWALLOW;
+ clip_to: "clipper_content";
+ description {
+ state: "default" 0.0;
+ rel2 {
+ relative: 0 0;
+ to: "padding_top";
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "show0";
+ signal: "elm,action,show";
+ source: "elm";
+ action: ACTION_STOP;
+ target: "hide0";
+ target: "hide2";
+ target: "hide3";
+ after: "show1";
+ after: "show2";
+ }
+ program {
+ name: "show1";
+ action: STATE_SET "visible" 0.0;
+ transition: LINEAR 0.15;
+ target: "clipper";
+ }
+ program {
+ name: "show2";
+ in: 0.1 0.0;
+ action: STATE_SET "visible" 0.0;
+ transition: LINEAR 0.15;
+ target: "clipper_content";
+ }
+ program {
+ name: "hide0";
+ signal: "elm,action,hide";
+ source: "elm";
+ action: ACTION_STOP;
+ target: "show0";
+ target: "show1";
+ target: "show2";
+ after: "hide2";
+ after: "hide3";
+ }
+ program {
+ name: "hide2";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "clipper_content";
+ }
+ program {
+ name: "hide3";
+ in: 0.1 0.0;
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "clipper";
+ }
+ }
+}
--- /dev/null
+#include "menudef.h"
+
+const char *sourcetext[SOURCE_TEXT_SIZE] = {
+ N_("All Source"),
+ N_("TV"),
+ N_("USB")
+};
+
+const char *sorttext[SORT_TEXT_SIZE] = {
+ N_("Date"),
+ N_("Date"),
+ N_("A-Z"),
+ N_("Z-A")
+};
+
+const char *menutext[MENUITEM_SIZE] = {
+ N_("ALL"),
+ N_("EVENTS"),
+ N_("FOLDER")
+};
+
+const char *hover_btn_id[] = {
+ "date_desc",
+ "date_asc",
+ "az",
+ "za",
+ "all",
+ "tv",
+ "usb"
+};
+
+const char *menuicons[MENUITEM_SIZE] = {
+ IMAGEDIR"/ico_fullview_all.png",
+ IMAGEDIR"/ico_fullview_event.png",
+ IMAGEDIR"/ico_fullview_folder.png"
+};
+
+const char *photo_icon_style[MAX_PHOTO_ICONS] = {
+ "photo_btn_prev",
+ "photo_btn_next",
+ "photo_btn_slideshow",
+ "photo_btn_setting",
+ "photo_btn_zoom",
+ "photo_btn_rotate"
+};
+
+const char *tooltip_text[MAX_PHOTO_ICONS] = {
+ N_("Prev"),
+ N_("Next"),
+ N_("Play/Pause"),
+ N_("Slideshow Speed"),
+ N_("Zoom"),
+ N_("Rotate"),
+};
+
+const char *zoom_text[MAX_ZOOM_BTNS] = {
+ N_("Original"),
+ N_("x 2"),
+ N_("x 4")
+};
+
+const char *speed_text[MAX_SPEED_BTNS] = {
+ N_("Normal"),
+ N_("Slow"),
+ N_("Fast")
+};
+
+const char *layout_type[MAX_LAYOUT] = {
+ "LAYOUT_ALL",
+ "LAYOUT_EVENT",
+ "LAYOUT_FOLDER"
+};
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include "eventdata.h"
+#include "util.h"
+
+struct eventdata {
+ int type;
+ union {
+ struct {
+ char *event_name;
+ time_t event_time;
+ Eina_List *media_list;
+ };
+ struct mediadata *md;
+ };
+};
+
+void eventdata_destroy_list(Eina_List *events_list)
+{
+ struct eventdata *event_info;
+ void *obj;
+
+ if (!events_list)
+ return;
+
+ EINA_LIST_FREE(events_list, obj) {
+ event_info = (struct eventdata *)obj;
+
+ if (event_info->type == E_TYPE_EVENT_INFO)
+ free(event_info->event_name);
+ free(event_info);
+ }
+}
+
+static int _compare_cb_asc(const void *data1,
+ const void *data2)
+{
+ const struct eventdata *e1;
+ const struct eventdata *e2;
+
+ if (!data1 || !data2)
+ return -1;
+
+ e1 = (struct eventdata *)data1;
+ e2 = (struct eventdata *)data2;
+
+ if (e2->event_time < e1->event_time)
+ return 1;
+
+ return -1;
+}
+
+static int _compare_cb_desc(const void *data1,
+ const void *data2)
+{
+ const struct eventdata *e1;
+ const struct eventdata *e2;
+
+ if (!data1 || !data2)
+ return -1;
+
+ e1 = (struct eventdata *)data1;
+ e2 = (struct eventdata *)data2;
+
+ if (e2->event_time > e1->event_time)
+ return 1;
+
+ return -1;
+}
+
+static int _compare_cb_a_z(const void *data1,
+ const void *data2)
+{
+ const struct eventdata *e1;
+ const struct eventdata *e2;
+
+ if (!data1 || !data2)
+ return -1;
+
+ e1 = (struct eventdata *)data1;
+ e2 = (struct eventdata *)data2;
+
+ if (!e1->event_name || !e2->event_name)
+ return -1;
+
+ return strcasecmp(e1->event_name, e2->event_name);
+}
+
+static int _compare_cb_z_a(const void *data1,
+ const void *data2)
+{
+ const struct eventdata *e1;
+ const struct eventdata *e2;
+
+ if (!data1 || !data2)
+ return -1;
+
+ e1 = (struct eventdata *)data1;
+ e2 = (struct eventdata *)data2;
+
+ if (!e1->event_name || !e2->event_name)
+ return -1;
+
+ return strcasecmp(e2->event_name, e1->event_name);
+}
+
+Eina_List *eventdata_create_list(Eina_List *mediafiles_list, int sort)
+{
+ struct mediadata *md;
+ Eina_List *l1, *l2;
+ Eina_List *events_list = NULL;
+ Eina_List *events_list1 = NULL;
+ Eina_List *events_list2 = NULL;
+ char *date_taken;
+ struct eventdata *event_info;
+ bool bevent_found;
+ time_t timeval;
+ struct tm tm;
+ char buf[32];
+ void *obj, *obj2;
+ Eina_Compare_Cb _compare_cb_func[] = {
+ _compare_cb_desc,
+ _compare_cb_asc,
+ _compare_cb_a_z,
+ _compare_cb_z_a
+ };
+
+ if (!mediafiles_list)
+ return NULL;
+
+ EINA_LIST_FOREACH(mediafiles_list, l1, obj) {
+ md = (struct mediadata *)obj;
+
+ date_taken = NULL;
+ timeval = mediadata_get_createdtime(md);
+ if (timeval > 0) {
+ localtime_r(&timeval, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ date_taken = strdup(buf);
+ } else {
+ timeval = mediadata_get_modifiedtime(md);
+ if (timeval > 0) {
+ localtime_r(&timeval, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ date_taken = strdup(buf);
+ }
+ }
+
+ if (!date_taken) {
+
+ event_info = (struct eventdata *)calloc(
+ 1, sizeof(*event_info));
+ if (!event_info)
+ goto error;
+
+ event_info->type = E_TYPE_EVENT_NO_INFO;
+ event_info->md = md;
+ events_list1 = eina_list_append(
+ events_list1, event_info);
+
+ } else {
+
+ bevent_found = false;
+ EINA_LIST_FOREACH(events_list2, l2, obj2) {
+ event_info = (struct eventdata *)obj2;
+
+ if (!strcmp(event_info->event_name,
+ date_taken)) {
+ event_info->media_list =
+ eina_list_append(
+ event_info->media_list,
+ md);
+ bevent_found = true;
+ break;
+ }
+ }
+
+ if (!bevent_found) {
+ event_info = (struct eventdata *)calloc(
+ 1, sizeof(*event_info));
+ if (!event_info)
+ goto error;
+
+ event_info->type = E_TYPE_EVENT_INFO;
+ event_info->event_name = strdup(date_taken);
+ event_info->event_time = timeval;
+ event_info->media_list = eina_list_append(
+ event_info->media_list, md);
+ events_list2 = eina_list_append(
+ events_list2, event_info);
+ }
+ free(date_taken);
+ }
+ }
+
+ if (events_list2 && sort < E_SORT_MAX)
+ events_list2 = eina_list_sort(events_list2,
+ 0, _compare_cb_func[sort]);
+
+ if (!events_list1)
+ events_list = events_list2;
+ else if (!events_list2)
+ events_list = events_list1;
+ else
+ events_list = eina_list_merge(events_list2, events_list1);
+
+ return events_list;
+
+error:
+ free(date_taken);
+ eventdata_destroy_list(events_list1);
+ eventdata_destroy_list(events_list2);
+
+ return NULL;
+}
+
+
+int eventdata_get_type(struct eventdata *ed)
+{
+ if (!ed)
+ return -1;
+
+ return ed->type;
+}
+
+struct mediadata *eventdata_get_mediadata(struct eventdata *ed)
+{
+ if (!ed)
+ return NULL;
+
+ return ed->md;
+}
+
+Eina_List *eventdata_get_listinfo(struct eventdata *ed)
+{
+ if (!ed)
+ return NULL;
+
+ return ed->media_list;
+}
+
+const char *eventdata_get_eventname(struct eventdata *ed)
+{
+ if (!ed)
+ return NULL;
+
+ return ed->event_name;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include "imagedata.h"
+#include "util.h"
+
+struct imagedata {
+ int width;
+ int height;
+ int orientation;
+ int iso;
+ char *model;
+};
+
+void imagedata_destroy(struct imagedata *image_info)
+{
+ if (!image_info)
+ return;
+
+ free(image_info);
+}
+
+struct imagedata *imagedata_create(media_info_h media_h)
+{
+ int ret;
+ struct imagedata *image_info;
+ image_meta_h image_h = NULL;
+
+ if (!media_h)
+ return false;
+
+ image_info = (struct imagedata *)calloc(1, sizeof(*image_info));
+ if (!image_info)
+ return NULL;
+
+ ret = media_info_get_image(media_h, &image_h);
+ if (ret != MEDIA_CONTENT_ERROR_NONE || !image_h) {
+ _ERR("Media image handle fetch error");
+ goto error;
+ }
+
+ if (image_meta_get_orientation(image_h,
+ (media_content_orientation_e *)&(
+ image_info->orientation)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta get orientation error");
+ goto error;
+ }
+
+ if (image_meta_get_width(image_h, &(image_info->width)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta get width error");
+ goto error;
+ }
+
+ if (image_meta_get_height(image_h, &(image_info->height)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta get height error");
+ goto error;
+ }
+
+#if 0
+ if (image_meta_get_iso(image_h, &(image_info->iso)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta get iso error");
+ goto error;
+ }
+
+ if (image_meta_get_model(image_h, &(image_info->model)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta get model error");
+ goto error;
+ }
+#endif
+
+ if (image_meta_destroy(image_h) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Image meta destroy error");
+ goto error;
+ }
+
+ return image_info;
+
+error:
+ image_meta_destroy(image_h);
+ imagedata_destroy(image_info);
+
+ return NULL;
+}
+
+int imagedata_get_width(const struct imagedata *image_info)
+{
+ if (!image_info)
+ return -1;
+
+ return image_info->width;
+}
+
+int imagedata_get_height(const struct imagedata *image_info)
+{
+ if (!image_info)
+ return -1;
+
+ return image_info->height;
+}
+
+int imagedata_get_orientation(const struct imagedata *image_info)
+{
+ if (!image_info)
+ return -1;
+
+ return image_info->orientation;
+}
+
+int imagedata_get_iso(const struct imagedata *image_info)
+{
+ if (!image_info)
+ return -1;
+
+ return image_info->iso;
+}
+
+const char *imagedata_get_model(const struct imagedata *image_info)
+{
+ if (!image_info)
+ return NULL;
+
+ return image_info->model;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <mediadata.h>
+#include "util.h"
+
+#define MEDIA_CONDITION_IMAGE_VIDEO "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)"
+#define MEDIA_CONDITION_IMAGE "(MEDIA_TYPE=0)"
+#define MEDIA_CONDITION_VIDEO "(MEDIA_TYPE=1)"
+
+struct mediadata {
+ media_info_h media_h;
+
+ char *display_name;
+ char *media_id;
+ int type;
+ unsigned long long size;
+ char *thumbnail_path;
+ char *file_path;
+ char *location_tag;
+ time_t last_modified_time;
+ time_t created_time;
+ int source;
+
+ char *folder_uuid;
+ union {
+ struct imagedata *image_info;
+ struct videodata *video_info;
+ };
+};
+
+struct folderdata {
+ char *folder_name;
+ time_t folder_modified_time;
+ Eina_List *list;
+};
+
+struct _data {
+ filter_h filter;
+ Eina_List *item_list;
+ Eina_List *folder_list;
+ int media;
+ int source_type;
+};
+
+static int g_ref_count;
+
+enum {
+ E_FILTER_TYPE_FOLDER = 0,
+ E_FILTER_TYPE_NONE
+};
+
+int mediadata_init(void)
+{
+ int ret = -1;
+
+ if (g_ref_count > 0) {
+ g_ref_count++;
+ return -1;
+ }
+
+#if 0
+ usb_device_init();
+#endif
+ ret = media_content_connect();
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media Content Connect Failed");
+ return -1;
+ }
+
+ g_ref_count++;
+
+ return 0;
+}
+
+int mediadata_fini(void)
+{
+ int ret = -1;
+
+ if (g_ref_count <= 0)
+ return -1;
+
+ g_ref_count--;
+
+ if (g_ref_count == 0) {
+#if 0
+ usb_device_fini();
+#endif
+ ret = media_content_disconnect();
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media Content Connect Failed");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int _create_filter(filter_h *filter,
+ int source_type, int type, int media)
+{
+ filter_h tmp_filter;
+ media_content_order_e order;
+ const char *keyword;
+ char buf[1024];
+ const char *mediatype;
+
+ int ret = media_filter_create(&tmp_filter);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media Filter Creation Failed");
+ return -1;
+ }
+
+ if (media == E_MEDIA_IMAGE)
+ mediatype = MEDIA_CONDITION_IMAGE;
+ else if (media == E_MEDIA_VIDEO)
+ mediatype = MEDIA_CONDITION_VIDEO;
+ else
+ mediatype = MEDIA_CONDITION_IMAGE_VIDEO;
+
+ switch (source_type) {
+
+ case E_SOURCE_TV:
+ snprintf(buf, sizeof(buf), "%s AND (MEDIA_STORAGE_TYPE=0)",
+ mediatype);
+ break;
+
+ case E_SOURCE_USB:
+ snprintf(buf, sizeof(buf), "%s AND (MEDIA_STORAGE_TYPE=1)",
+ mediatype);
+ break;
+
+ case E_SOURCE_ALL:
+ default:
+ snprintf(buf, sizeof(buf), "%s", mediatype);
+ break;
+
+ }
+
+ if (type == E_FILTER_TYPE_FOLDER) {
+ media_filter_set_condition(tmp_filter, buf,
+ MEDIA_CONTENT_COLLATE_DEFAULT);
+ } else {
+ media_filter_set_condition(tmp_filter,
+ mediatype,
+ MEDIA_CONTENT_COLLATE_DEFAULT);
+ }
+
+ order = MEDIA_CONTENT_ORDER_DESC;
+ keyword = MEDIA_MODIFIED_TIME;
+
+ media_filter_set_order(tmp_filter, order,
+ keyword, MEDIA_CONTENT_COLLATE_NOCASE);
+ *filter = tmp_filter;
+
+ return 0;
+}
+
+static int _destroy_filter(filter_h filter)
+{
+ if (!filter)
+ return -1;
+
+ if (media_filter_destroy(filter) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Filter destroy failed");
+ return -1;
+ }
+
+ return 0;
+}
+
+static void _free_mediadata_item(struct mediadata *md)
+{
+ if (!md)
+ return;
+
+ if (md->media_h)
+ media_info_destroy(md->media_h);
+
+ free(md->display_name);
+ free(md->media_id);
+ free(md->thumbnail_path);
+ free(md->file_path);
+ free(md->location_tag);
+
+ if (md->type == MEDIA_CONTENT_TYPE_IMAGE)
+ imagedata_destroy(md->image_info);
+ else if (md->type == MEDIA_CONTENT_TYPE_VIDEO)
+ videodata_destroy(md->video_info);
+
+ free(md);
+}
+
+static inline void _free_mediadata_list(Eina_List *list)
+{
+ void *obj;
+ struct mediadata *md;
+ EINA_LIST_FREE(list, obj) {
+ md = (struct mediadata *)obj;
+ _free_mediadata_item(md);
+ }
+}
+
+static bool _get_each_media_info(media_info_h media_h, void *dt)
+{
+ struct _data *data;
+ struct mediadata *md;
+
+ if (!dt)
+ return false;;
+
+ data = (struct _data *)dt;
+
+ md = (struct mediadata *)calloc(1, sizeof(*md));
+ if (!md)
+ return false;
+
+ if (media_info_clone(&(md->media_h), media_h) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media Clone error");
+ goto error;
+ }
+
+ if (media_info_get_media_id(media_h, &(md->media_id)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media ID Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_display_name(media_h, &(md->display_name)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media display name Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_size(media_h, &(md->size)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media size Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_file_path(media_h, &(md->file_path))
+ != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media file path Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_media_type(media_h,
+ (media_content_type_e *)&(md->type)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media type Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_thumbnail_path(media_h, &(md->thumbnail_path)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media thumbnail path Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_modified_time(media_h, &(md->last_modified_time)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media modified time Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_modified_time(media_h, &(md->created_time)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media created time Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_location_tag(media_h, &(md->location_tag)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media location tag Fetch error");
+ goto error;
+ }
+
+ if (media_info_get_storage_type(media_h,
+ (media_content_storage_e *)&(md->source)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media location tag Fetch error");
+ goto error;
+ }
+
+ /* Get Image and video specific information */
+ if (md->type == MEDIA_CONTENT_TYPE_IMAGE) {
+
+ md->image_info = imagedata_create(media_h);
+ if (!md->image_info)
+ goto error;
+
+ } else if (md->type == MEDIA_CONTENT_TYPE_VIDEO) {
+
+ md->video_info = videodata_create(media_h);
+ if (!md->video_info)
+ goto error;
+ }
+
+ data->item_list = eina_list_append(data->item_list, md);
+
+ return true;
+
+error:
+ _ERR("Erroring in reading mediadata");
+ _free_mediadata_item(md);
+
+ return false;
+}
+
+static bool _get_each_folder_info(media_folder_h folder, void *dt)
+{
+ char *uuid;
+ int ret = -1;
+ struct _data *data;
+ filter_h filter;
+ struct folderdata *fd;
+
+ if (!dt)
+ return false;
+
+ data = (struct _data *)dt;
+
+ fd = (struct folderdata *)calloc(1, sizeof(*fd));
+ if (!fd)
+ return false;
+
+ uuid = NULL;
+
+ _create_filter(&filter, data->source_type,
+ E_FILTER_TYPE_NONE, data->media);
+
+ if (media_folder_get_name(folder, &(fd->folder_name)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder id Fetch error");
+ goto error;
+ }
+
+ if (media_folder_get_modified_time(folder, &(fd->folder_modified_time))
+ != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder modified time Fetch error");
+ goto error;
+ }
+
+ if (media_folder_get_folder_id(folder, &uuid)
+ != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder id Fetch error");
+ goto error;
+ }
+
+ ret = media_folder_foreach_media_from_db(uuid, filter,
+ _get_each_media_info, data);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret == MEDIA_CONTENT_ERROR_DB_FAILED)
+ _ERR("MEDIA CONTENT ERROR DB FAILED");
+ else if (ret == MEDIA_CONTENT_ERROR_DB_BUSY)
+ _ERR("MEDIA CONTENT ERROR DB BUSY");
+ else
+ _ERR("MEDIA CONTENT ERROR GENERAL");
+ goto error;
+ }
+
+ fd->list = eina_list_clone(data->item_list);
+ eina_list_free(data->item_list);
+ data->item_list = NULL;
+ data->folder_list = eina_list_append(data->folder_list, fd);
+
+ _destroy_filter(filter);
+ free(uuid);
+
+ return true;
+
+error:
+ _ERR("Error in creating Media list");
+ _destroy_filter(filter);
+ free(fd);
+ free(uuid);
+ mediadata_destroy_mediafiles_list(data->folder_list);
+
+ return false;
+}
+
+Eina_List *mediadata_create_mediafiles_list(
+ int source_type, int media)
+{
+ int ret = -1;
+ struct _data *data;
+ Eina_List *folder_list;
+
+ data = (struct _data *)calloc(1, sizeof(*data));
+ if (!data)
+ return NULL;
+
+ data->source_type = source_type;
+ data->media = media;
+
+ _create_filter(&data->filter,
+ source_type, E_FILTER_TYPE_FOLDER, media);
+
+ ret = media_folder_foreach_folder_from_db(data->filter,
+ _get_each_folder_info, data);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Failed to read from folders");
+ _destroy_filter(data->filter);
+ free(data);
+ return NULL;
+ }
+
+ _destroy_filter(data->filter);
+ folder_list = eina_list_clone(data->folder_list);
+
+ eina_list_free(data->folder_list);
+ free(data);
+
+ return folder_list;
+}
+
+void mediadata_destroy_mediafiles_list(Eina_List *list)
+{
+ struct folderdata *fd;
+ void *obj;
+
+ if (!list)
+ return;
+
+ EINA_LIST_FREE(list, obj) {
+ fd = (struct folderdata *)obj;
+ free(fd->folder_name);
+
+ _free_mediadata_list(fd->list);
+ fd->list = NULL;
+ }
+}
+
+#if 0
+void mediadata_usb_set_connected_cb(usb_connected_cb cb, void *data)
+{
+ if (!cb)
+ return;
+
+ usb_set_connected_cb(cb, data);
+}
+
+void mediadata_usb_unset_connected_cb(void)
+{
+ usb_unset_connected_cb();
+}
+
+int mediadata_connected_usb(void)
+{
+ return usb_get_connected_device_number(USB_MASS_STORAGE);
+}
+#endif
+
+void mediadata_set_updated_cb(media_content_db_update_cb cb, void *data)
+{
+ if (!cb)
+ return;
+
+ media_content_set_db_updated_cb(cb, data);
+}
+
+void mediadata_unset_updated_cb(void)
+{
+ media_content_unset_db_updated_cb();
+}
+
+Eina_List *mediadata_get_filelist(Eina_List *list)
+{
+ Eina_List *filelist = NULL;
+ Eina_List *l1, *l2;
+ struct folderdata *fd;
+ struct mediadata *md;
+ void *obj, *obj2;
+
+ if (!list)
+ return NULL;
+
+ EINA_LIST_FOREACH(list, l1, obj) {
+ fd = (struct folderdata *)obj;
+ EINA_LIST_FOREACH(fd->list, l2, obj2) {
+ md = (struct mediadata *)obj2;
+ filelist = eina_list_append(filelist, md);
+ }
+ }
+
+ return filelist;
+
+}
+
+const char *folderdata_get_name(struct folderdata *fd)
+{
+ if (!fd)
+ return NULL;
+
+ return fd->folder_name;
+}
+
+time_t folderdata_get_modifiedtime(struct folderdata *fd)
+{
+ if (!fd)
+ return -1;
+
+ return fd->folder_modified_time;
+}
+
+Eina_List *folderdata_get_listinfo(struct folderdata *fd)
+{
+ if (!fd)
+ return NULL;
+
+ return fd->list;
+}
+
+const char *mediadata_get_displayname(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->display_name;
+}
+
+const char *mediadata_get_mediaid(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->media_id;
+}
+
+unsigned long long mediadata_get_size(struct mediadata *md)
+{
+ if (!md)
+ return -1;
+
+ return md->size;
+}
+
+const char *mediadata_get_thumbnailpath(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->thumbnail_path;
+}
+
+const char *mediadata_get_filepath(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->file_path;
+}
+
+const char *mediadata_get_locationtag(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->location_tag;
+}
+
+int mediadata_get_type(struct mediadata *md)
+{
+ if (!md)
+ return -1;
+
+ return md->type;
+}
+
+int mediadata_get_source(struct mediadata *md)
+{
+ int source = E_SOURCE_TV;
+
+ if (!md)
+ return -1;
+
+ if (md->source == MEDIA_CONTENT_STORAGE_INTERNAL)
+ source = E_SOURCE_TV;
+ else if (md->source == MEDIA_CONTENT_STORAGE_EXTERNAL)
+ source = E_SOURCE_USB;
+
+ return source;
+}
+
+time_t mediadata_get_modifiedtime(struct mediadata *md)
+{
+ if (!md)
+ return -1;
+
+ return md->last_modified_time;
+}
+
+time_t mediadata_get_createdtime(struct mediadata *md)
+{
+ if (!md)
+ return -1;
+
+ return md->created_time;
+}
+
+const struct imagedata *mediadata_get_image_info(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->image_info;
+}
+
+const struct videodata *mediadata_get_video_info(struct mediadata *md)
+{
+ if (!md)
+ return NULL;
+
+ return md->video_info;
+}
+
+int mediadata_update_to_db(struct mediadata *md)
+{
+ if (!md)
+ return -1;
+
+ return media_info_update_to_db(md->media_h);
+}
+
+time_t mediadata_get_time_t(struct mediadata *md)
+{
+ time_t timeval;
+
+ if (!md)
+ return -1;
+
+ timeval = mediadata_get_createdtime(md);
+ if (timeval < 0)
+ timeval = mediadata_get_modifiedtime(md);
+
+ return timeval;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include "videodata.h"
+#include "util.h"
+
+struct videodata {
+ int duration;
+ int played_position;
+};
+
+void videodata_destroy(struct videodata *video_info)
+{
+ free(video_info);
+}
+
+struct videodata *videodata_create(media_info_h media_h)
+{
+ int ret;
+ struct videodata *video_info = NULL;
+ video_meta_h video_h = NULL;
+
+ if (!media_h)
+ return NULL;
+
+ ret = media_info_get_video(media_h, &video_h);
+ if (ret != MEDIA_CONTENT_ERROR_NONE || !video_h) {
+ _ERR("Media video handle fetch error");
+ goto error;
+ }
+
+ video_info = (struct videodata *)calloc(1, sizeof(*video_info));
+ if (!video_info)
+ goto error;
+
+ if (video_meta_get_duration(video_h, &(video_info->duration)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("video meta get duration error");
+ goto error;
+ }
+
+ if (video_meta_get_played_position(video_h,
+ &(video_info->played_position)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("video meta get played position error");
+ goto error;
+ }
+
+ if (video_meta_destroy(video_h) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("video meta destroy error");
+ goto error;
+ }
+
+ return video_info;
+
+error:
+ video_meta_destroy(video_h);
+ videodata_destroy(video_info);
+
+ return NULL;
+}
+
+int videodata_get_duration(const struct videodata *video_info)
+{
+ if (!video_info)
+ return -1;
+
+ return video_info->duration;
+}
+
+int videodata_get_played_position(const struct videodata *video_info)
+{
+ if (!video_info)
+ return -1;
+
+ return video_info->played_position;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <appsvc.h>
+#include <app.h>
+#include "mediadata.h"
+#include "util.h"
+#include "i18n.h"
+#include "BaseApp.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "BaseLayout.h"
+#include "timeout_handler.h"
+#include "gallery_view.h"
+#include "photoviewer_view.h"
+#include "zoom_view.h"
+#include "viewdata.h"
+#include "ctxtmenu_view.h"
+
+#define GALLERY_WIN_TITLE "Gallery"
+
+#define PARAM_VIEW "view"
+#define PARAM_ID "id"
+#define PARAM_URI "uri"
+#define PARAM_SOURCE "source"
+#define PARAM_SORT "sort"
+
+#define MIME_IMAGE "image/*"
+#define MIME_VIDEO "video/*"
+
+class CApp : public CBaseApp {
+private:
+
+ struct _appdata {
+ const char *name;
+ Evas_Object *win;
+ Evas_Object *lbl;
+
+ bool is_service;
+
+ struct arg_list *arglist;
+ } ad;
+
+ CGalleryView *pGalleryView;
+ CPhotoViewerView *pPhotoViewerView;
+ CPhotoZoomView *pPhotoZoomView;
+ CCtxtMenuView *pCtxtMenuView;
+
+protected:
+
+ void t_RemoveArglist(void)
+ {
+ if (ad.arglist) {
+ free(ad.arglist->id);
+ service_destroy(ad.arglist->service);
+ free(ad.arglist);
+ ad.arglist = NULL;
+ }
+ }
+
+ Evas_Object *t_AddWin(const char *name)
+ {
+ Evas_Object *win;
+
+ win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (!win) {
+ _ERR("elm_win_add failed");
+ return NULL;
+ }
+
+ elm_win_title_set(win, GALLERY_WIN_TITLE);
+
+ evas_object_show(win);
+
+ return win;
+ }
+
+public:
+
+ virtual bool OnCreate(void)
+ {
+ elm_theme_overlay_add(NULL, THEMEFILE);
+ elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
+
+ ad.win = t_AddWin(ad.name);
+ if (!ad.win)
+ return false;
+
+ elm_win_focus_highlight_enabled_set(ad.win, EINA_TRUE);
+ elm_win_focus_highlight_style_set(ad.win, STYLE_INVISIBLE);
+
+ elm_need_ethumb();
+
+ return true;
+ }
+
+ virtual void OnTerminate(void)
+ {
+ CViewMgr::Finalize();
+
+ t_RemoveArglist();
+
+ if (ad.win)
+ evas_object_del(ad.win);
+ }
+
+ virtual void OnPause(void)
+ {
+ _INFO("Gallery app is paused");
+
+ CViewMgr::GetInstance()->Pause();
+ }
+
+ virtual void OnResume(void)
+ {
+ _INFO("Gallery app is Resumed");
+
+ CViewMgr::GetInstance()->Resume();
+ }
+
+ virtual void OnService(service_h service)
+ {
+ char *val;
+ char *id = NULL;
+ char *view = NULL;
+ char *operation = NULL;
+ char *mime = NULL;
+ int r;
+ int view_val = 0, source = 0, sort = 0;
+ int media_type = E_MEDIA_IMAGE_VIDEO;
+ CViewMgr *vmgr;
+
+ if (ad.is_service) {
+ elm_win_activate(ad.win);
+ CViewMgr::Finalize();
+ }
+
+ if (ad.arglist && ad.arglist->service) {
+ service_destroy(ad.arglist->service);
+ ad.arglist->service = NULL;
+ }
+
+ r = service_get_extra_data(service, PARAM_VIEW, &view);
+ if (r == SERVICE_ERROR_NONE && view) {
+ if (!strcmp(view, "folder"))
+ view_val = 2;
+ else if (!strcmp(view, "events"))
+ view_val = 1;
+ else
+ view_val = 0;
+
+ free(view);
+ }
+
+ r = service_get_extra_data(service, PARAM_SOURCE, &val);
+ if (r == SERVICE_ERROR_NONE && val) {
+ if (!strcmp(val, "usb"))
+ source = 1;
+ else
+ source = 0;
+
+ free(val);
+ }
+
+ r = service_get_extra_data(service, PARAM_SORT, &val);
+ if (r == SERVICE_ERROR_NONE && val) {
+ if (!strcmp(val, "z_a"))
+ sort = 3;
+ else if (!strcmp(val, "a_z"))
+ sort = 2;
+ else if (!strcmp(val, "date_asc"))
+ sort = 1;
+ else
+ sort = 0;
+
+ free(val);
+ }
+
+ r = service_get_extra_data(service, PARAM_ID, &id);
+ if (r != SERVICE_ERROR_NONE || !id)
+ service_get_extra_data(service, PARAM_URI, &id);
+
+ service_get_operation(service, &operation);
+
+ if (operation && !strcasecmp(
+ operation, SERVICE_OPERATION_PICK)) {
+ service_get_mime(service, &mime);
+
+ if (mime) {
+ if (!strcmp(mime, MIME_IMAGE))
+ media_type = E_MEDIA_IMAGE;
+ else if (!strcmp(mime, MIME_VIDEO))
+ media_type = E_MEDIA_VIDEO;
+ free(mime);
+ }
+ free(operation);
+ }
+
+ ad.arglist = (struct arg_list *)calloc(
+ 1, sizeof(struct arg_list));
+ if (!ad.arglist) {
+ _ERR("arglist create failed");
+ elm_exit();
+ }
+
+ if (service_clone(&ad.arglist->service, service)
+ != SERVICE_ERROR_NONE) {
+ _ERR("Service clone error");
+ elm_exit();
+ }
+
+ ad.arglist->view = view_val;
+ ad.arglist->id = id;
+ ad.arglist->source= source;
+ ad.arglist->sort = sort;
+ ad.arglist->media_type = media_type;
+
+ CViewMgr::Initialize(ad.win, NULL);
+ vmgr = CViewMgr::GetInstance();
+ if (!vmgr) {
+ _ERR("ViewMgr initialization failed");
+ goto error;
+ }
+
+ pGalleryView = new CGalleryView(VIEW_GALLERY);
+ pPhotoViewerView = new CPhotoViewerView(VIEW_PHOTO_VIEWER);
+ pPhotoZoomView = new CPhotoZoomView(VIEW_PHOTO_ZOOM);
+ pCtxtMenuView = new CCtxtMenuView(VIEW_CTXT_MENU);
+
+ vmgr->AddView(pGalleryView);
+ vmgr->AddView(pPhotoViewerView);
+ vmgr->AddView(pPhotoZoomView);
+ vmgr->AddView(pCtxtMenuView);
+
+ if (!vmgr->PushView(VIEW_GALLERY, ad.arglist)) {
+ _ERR("ViewMgr push failed");
+ CViewMgr::Finalize();
+ goto error;
+ }
+
+ ad.is_service = 1;
+
+ return;
+
+ error:
+ free(ad.arglist->id);
+ free(ad.arglist);
+ elm_exit();
+ }
+
+public:
+
+ virtual int Run(int argc, char **argv) {
+ memset(&ad, 0x00, sizeof(_appdata));
+ ad.name = PACKAGE;
+
+ return CBaseApp::Run(argc, argv);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ CApp app;
+ app.Run(argc, argv);
+
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+
+#include <AppCommon.h>
+#include "timeout_handler.h"
+#include "dbg.h"
+
+
+#define NUM_EVENT_HANDLERS 7
+
+
+struct STimeoutHandler {
+ Eina_List *eventhandler_list;
+ Ecore_Timer *timer;
+
+ ITimeoutListener *listener;
+ Eina_Bool pause;
+
+ double timeout;
+
+ STimeoutHandler() {
+ memset(this, 0, sizeof(STimeoutHandler));
+ }
+};
+
+
+Eina_Bool CTimeoutHandler::sm_CbTimer(void *data)
+{
+ CTimeoutHandler *root = (CTimeoutHandler*)data;
+
+ Eina_Bool ret = EINA_FALSE;
+
+ if (root)
+ ret = root->m_OnTimer();
+
+ return ret;
+}
+
+
+Eina_Bool CTimeoutHandler::m_OnTimer(void)
+{
+ m->timer = NULL;
+ m->listener->OnTimeout();
+
+ return EINA_FALSE;
+}
+
+
+Eina_Bool CTimeoutHandler::sm_CbEvent(void *data, int type, void *event)
+{
+ /* reset timer */
+ CTimeoutHandler* root = (CTimeoutHandler*)data;
+
+ Eina_Bool ret = EINA_FALSE;
+ if (root)
+ ret = root->m_OnEvent(type, event);
+ return ret;
+}
+
+
+Eina_Bool CTimeoutHandler::m_OnEvent(int type, void *event)
+{
+ if (m->pause)
+ return ECORE_CALLBACK_PASS_ON;
+
+ if (m->timer)
+ ecore_timer_reset(m->timer);
+ else {
+ if (!m->listener->OnEvent(type, event))
+ return ECORE_CALLBACK_PASS_ON;
+
+ m->timer = ecore_timer_add(m->timeout, sm_CbTimer, this);
+ if (!m->timer)
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+bool CTimeoutHandler::Create(double timeout, ITimeoutListener *listener)
+{
+ ASSERT(!m);
+
+ m = new STimeoutHandler;
+ if (!m)
+ return false;
+
+ m->listener = listener;
+
+ Ecore_Event_Handler *event_handler;
+ int i;
+ int event_type[NUM_EVENT_HANDLERS] = {
+ ECORE_EVENT_KEY_UP,
+ ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ ECORE_EVENT_MOUSE_BUTTON_UP,
+ ECORE_EVENT_MOUSE_MOVE,
+ ECORE_EVENT_MOUSE_WHEEL,
+ ECORE_EVENT_MOUSE_IN,
+ ECORE_EVENT_MOUSE_OUT
+ };
+
+ for (i = 0; i < NUM_EVENT_HANDLERS; i++) {
+ event_handler = ecore_event_handler_add(event_type[i], sm_CbEvent, this);
+ if (!event_handler)
+ goto error;
+
+ m->eventhandler_list = eina_list_append(m->eventhandler_list, event_handler);
+ }
+
+ m->timer = ecore_timer_add(timeout, sm_CbTimer, this);
+ if (!m->timer)
+ goto error;
+
+ m->timeout = timeout;
+
+ return true;
+
+error:
+ void *obj;
+ EINA_LIST_FREE(m->eventhandler_list, obj) {
+ event_handler = (Ecore_Event_Handler *)obj;
+ ecore_event_handler_del(event_handler);
+ }
+
+ if (m->timer)
+ ecore_timer_del(m->timer);
+ delete m;
+ m = NULL;
+
+ return NULL;
+}
+
+
+void CTimeoutHandler::Reset(void)
+{
+ ASSERT(m);
+
+ sm_CbEvent(m, 0, NULL);
+}
+
+
+void CTimeoutHandler::Pause(void)
+{
+ ASSERT(m);
+
+ ecore_timer_freeze(m->timer);
+ m->pause = EINA_TRUE;
+}
+
+
+void CTimeoutHandler::Resume(void)
+{
+ ASSERT(m);
+
+ ecore_timer_thaw(m->timer);
+ m->pause = EINA_FALSE;
+}
+
+
+void CTimeoutHandler::Destroy(void)
+{
+ ASSERT(m);
+
+ Ecore_Event_Handler *event_handler;
+ void *obj;
+
+ EINA_LIST_FREE(m->eventhandler_list, obj) {
+ event_handler = (Ecore_Event_Handler *)obj;
+ ecore_event_handler_del(event_handler);
+ }
+
+ if (m->timer)
+ ecore_timer_del(m->timer);
+ delete m;
+ m = NULL;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <util.h>
+#include "mediadata.h"
+
+Evas_Object *util_ui_add_box(Evas_Object *base)
+{
+ Evas_Object *box;
+
+ /* add box object */
+ box = elm_box_add(base);
+ if (!box)
+ return NULL;
+
+ evas_object_size_hint_weight_set(box,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box,
+ EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ return box;
+}
+
+Evas_Object *util_ui_add_button(Evas_Object *base)
+{
+ Evas_Object *btn;
+
+ btn = elm_button_add(base);
+ if (!btn)
+ return NULL;
+
+ evas_object_show(btn);
+
+ return btn;
+}
+
+void util_ui_set_focus_directions(Evas_Object **btn,
+ int itemcount, bool is_horizontal)
+{
+ int i;
+ int prev, next;
+
+ if (!btn || itemcount == 0)
+ return;
+
+ if (is_horizontal == 0) {
+ prev = ELM_FOCUS_UP;
+ next = ELM_FOCUS_DOWN;
+ } else {
+ prev = ELM_FOCUS_LEFT;
+ next = ELM_FOCUS_RIGHT;
+ }
+
+ if (itemcount == 1) {
+
+ elm_object_focus_next_object_set(btn[0],
+ btn[0], (Elm_Focus_Direction)prev);
+ elm_object_focus_next_object_set(btn[0],
+ btn[0], (Elm_Focus_Direction)next);
+
+ } else {
+
+ for (i = 0; i < itemcount; i++) {
+
+ if (i == itemcount-1)
+ elm_object_focus_next_object_set(btn[i],
+ btn[0], (Elm_Focus_Direction)next);
+ else
+ elm_object_focus_next_object_set(btn[i],
+ btn[i+1], (Elm_Focus_Direction)next);
+
+ if (i == 0)
+ elm_object_focus_next_object_set(btn[i],
+ btn[itemcount-1],
+ (Elm_Focus_Direction)prev);
+ else
+ elm_object_focus_next_object_set(btn[i],
+ btn[i-1],
+ (Elm_Focus_Direction)prev);
+
+ }
+ }
+}
+
+bool util_is_image_valid(Evas_Object *win, char *filepath)
+{
+ if (!filepath)
+ return false;
+
+ Evas_Object *image;
+ int width, height;
+
+ image = elm_image_add(win);
+ if (!image)
+ return false;
+
+ elm_image_fill_outside_set(image, EINA_FALSE);
+ elm_image_file_set(image, filepath, NULL);
+ elm_image_object_size_get(image, &width, &height);
+ if (image) {
+ evas_object_del(image);
+ image = NULL;
+ }
+
+ if (width <= 0 || height <= 0) {
+ _ERR("Cannot load file : %s", filepath);
+ return false;
+ }
+
+ return true;
+}
+
+int util_get_media_count(Eina_List *list, int type)
+{
+ Eina_List *l;
+ struct mediadata *md;
+ int count;
+ void *obj;
+
+ if (!list)
+ return 0;
+
+ count = 0;
+ EINA_LIST_FOREACH(list, l, obj) {
+ md = (struct mediadata *)obj;
+
+ if (mediadata_get_type(md) == type)
+ count++;
+ }
+
+ return count;
+}
+
+int util_eina_list_get_index(Eina_List *list, void *data)
+{
+ void *cur_data;
+ Eina_List *l;
+ int i;
+
+ if (!data)
+ return -1;
+
+ i = 0;
+ EINA_LIST_FOREACH(list, l, cur_data) {
+ if (cur_data == data)
+ break;
+ i++;
+ }
+
+ return i;
+}
+
+char *util_get_time_string(int ms)
+{
+ int sec;
+ char buf[32];
+
+ sec = ms / 1000;
+
+ snprintf(buf, sizeof(buf), "%02d:%02d:%02d",
+ sec / 3600, (sec % 3600) / 60, sec % 60);
+
+ return strdup(buf);
+}
+
+Eina_List *util_create_media_list(Eina_List *media_list, int type)
+{
+ Eina_List *l, *new_list;
+ struct mediadata *md;
+ void *obj;
+
+ if (!media_list)
+ return NULL;
+
+ new_list = NULL;
+ EINA_LIST_FOREACH(media_list, l, obj) {
+ md = (struct mediadata *)obj;
+
+ if (type == mediadata_get_type(md))
+ new_list = eina_list_append(new_list, md);
+ }
+
+ return new_list;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include <InputHandler.h>
+#include "menudef.h"
+#include "timeout_handler.h"
+#include "mediadata.h"
+#include "viewdata.h"
+#include "AppCommon.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "ctxtmenu_view.h"
+#include "video_player.h"
+
+#define IMAGE_BTN_SLIDESHOW IMAGEDIR"/ico_vod_nor.png"
+#define IMAGE_BTN_PLAY IMAGEDIR"/ico_controller_play.png"
+#define IMAGE_BTN_DEL IMAGEDIR"/ico_del_nor.png"
+#define IMAGE_DEFAULT_PHOTO IMAGEDIR"/ico_default_photo_126.png"
+#define IMAGE_DEFAULT_VIDEO IMAGEDIR"/ico_default_video_126.png"
+
+#define TEXT_CONTENT_SIZE N_("File size")
+#define TEXT_CONTENT_DATE N_("Created date")
+#define TEXT_CONTENT_LOCATION N_("File location")
+#define TEXT_CONTENT_CAMERA N_("Camera")
+#define TEXT_CONTENT_ISO N_("ISO")
+
+#define TEXT_NONAME N_("Unknown Name")
+#define TEXT_DEFAULT_SIZE N_("000 MB")
+
+#define TEXT_RELATED_CONTENT N_("Related Content")
+#define MAX_FUNC_BTN 1
+#define ARRAY_SIZE(arr) (sizeof((arr)) / sizeof((arr)[0]))
+
+struct SCtxtMenuView {
+ Evas_Object *win; // Not NULL
+ Evas_Object *base; // Not NULL
+
+ Evas_Object *grid;
+ Evas_Object *func_btn[MAX_FUNC_BTN];
+
+ CTimeoutHandler cTimeout;
+
+ struct view_data *vd;
+
+ SCtxtMenuView() {
+ win = NULL;
+ base = NULL;
+ grid = NULL;
+
+ for (int a = 0; a < MAX_FUNC_BTN; a++)
+ func_btn[a] = NULL;
+ vd = NULL;
+
+ pHandlerGrid = new CHandlerGrid(this);
+ pHandlerSlideshow = new CHandlerBtnSlideshow(this);
+ pHandlerPlayer = new CHandlerBtnPlay(this);
+
+ }
+ ~SCtxtMenuView() {
+ delete pHandlerGrid;
+ delete pHandlerSlideshow;
+ delete pHandlerPlayer;
+ }
+
+ class CHandlerGrid : public CListenerMgr, IMouseMoveListener, IRealizedListener, IUnrealizedListener {
+ private:
+ SCtxtMenuView *m;
+
+ private:
+ static void sm_CbGridActivated(void *cookie, Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ CHandlerGrid *root = (CHandlerGrid*)cookie;
+ if (root)
+ root->OnGridActivated(it, emission, source);
+ }
+
+ void OnGridActivated(Elm_Object_Item *it, const char *emission, const char *source) {
+ struct mediadata *md;
+ int type;
+ struct view_data *vd;
+
+ if (!it)
+ return;
+
+ md = (struct mediadata*)elm_object_item_data_get(it);
+ if (!md)
+ return;
+
+ type = mediadata_get_type(md);
+
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = util_create_media_list(m->vd->media_list, type);
+ vd->md = md;
+
+ if (type == MEDIA_VIDEO)
+ video_player_play(vd);
+ else if (type == MEDIA_IMAGE)
+ CViewMgr::GetInstance()->PushView(VIEW_PHOTO_VIEWER, vd);
+ else {
+ _ERR("wrong media type");
+ free(vd);
+ return;
+ }
+
+ elm_gengrid_item_selected_set(it, EINA_FALSE);
+ }
+
+ public:
+ CHandlerGrid(SCtxtMenuView *ins) : IMouseMoveListener(this), IRealizedListener(this), IUnrealizedListener(this) { m = ins; }
+
+ virtual void OnMouseMove(int id,Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ Elm_Object_Item *it;
+
+ it = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x, ev->cur.canvas.y, NULL, NULL);
+ if (!it)
+ return;
+
+ if (elm_object_item_focus_get(it))
+ return;
+
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
+ virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item) {
+ elm_object_item_signal_callback_add(item, "item_clicked", "edc", sm_CbGridActivated, this);
+ }
+ virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item) {
+ elm_object_item_signal_callback_del(item, "item_clicked", "edc", sm_CbGridActivated);
+ }
+ } *pHandlerGrid;
+
+
+
+ class IHandlerBtn : public CListenerMgr, IMouseMoveListener, IMouseDownListener, IKeyDownListener, IFocusedListener, IUnfocusedListener {
+ public:
+ IHandlerBtn(Evas_Object *obj) : IMouseMoveListener(this), IMouseDownListener(this), IKeyDownListener(this), IFocusedListener(this), IUnfocusedListener(this) {}
+
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item) {
+ elm_object_signal_emit(obj, SIG_FOCUSED, "");
+ }
+ virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item) {
+ elm_object_signal_emit(obj, SIG_UNFOCUSED, "");
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ };
+
+ class CHandlerBtnSlideshow : public IHandlerBtn {
+ private:
+ struct SCtxtMenuView* m;
+
+ private:
+
+ void m_SlideshowBtnSelected(void)
+ {
+ struct mediadata *md;
+ struct view_data *vd;
+
+ md = m->vd->md;
+ if (!md)
+ return;
+
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = util_create_media_list(m->vd->media_list, MEDIA_IMAGE);
+ vd->md = md;
+
+ CViewMgr::GetInstance()->PushView(VIEW_PHOTO_VIEWER, vd);
+ }
+
+ public:
+ CHandlerBtnSlideshow(SCtxtMenuView *ins) : IHandlerBtn(NULL) { m = ins; }
+
+ virtual void OnMouseDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Down *ev) {
+ m_SlideshowBtnSelected();
+ }
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_ENTER))
+ m_SlideshowBtnSelected();
+ }
+ } *pHandlerSlideshow;
+
+ class CHandlerBtnPlay : public IHandlerBtn {
+ private:
+ struct SCtxtMenuView* m;
+
+ private:
+ void m_PlayBtnSelected(void)
+ {
+ struct mediadata *md;
+ struct view_data *vd;
+
+ md = m->vd->md;
+ if (!md)
+ return;
+
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = util_create_media_list(
+ m->vd->media_list, MEDIA_VIDEO);
+ vd->md = md;
+
+ video_player_play(vd);
+ }
+
+ public:
+ CHandlerBtnPlay(SCtxtMenuView *ins) : IHandlerBtn(NULL) { m = ins; }
+
+ virtual void OnMouseDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Down *ev) {
+ m_PlayBtnSelected();
+ }
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_ENTER))
+ m_PlayBtnSelected();
+ }
+ }* pHandlerPlayer;
+
+
+};
+
+
+
+
+struct _btn_info {
+ const char *btn_img;
+ const char *btn_title;
+
+ SCtxtMenuView::IHandlerBtn *handler;
+};
+
+struct _btn_info browse_photo_btn[] = {
+ {
+ IMAGE_BTN_SLIDESHOW,
+ N_("PLAY SHOW"),
+ NULL// &pHandlerSlideshow
+ },
+};
+
+struct _btn_info browse_video_btn[] = {
+ {
+ IMAGE_BTN_PLAY,
+ N_("PLAY"),
+ NULL//&pHandlerPlayer
+ },
+};
+
+
+bool s_PackContentInfo(Evas_Object *box, char *info)
+{
+ Evas_Object *ly, *lbl;
+ char buf[256];
+
+ ly = elm_layout_add(box);
+ if (!ly) {
+ _ERR("elm_layout_add failed");
+ return false;
+ }
+ elm_layout_file_set(ly, EDJEFILE, GRP_CTXT_MENU_CONTENT_INFO);
+
+ lbl = elm_label_add(ly);
+ if (!lbl) {
+ _ERR("elm_label_add failed");
+ return false;
+ }
+
+ snprintf(buf, sizeof(buf), "<color=#9D9D9D><font_size=24>%s"
+ "</font_size></color>", _(info));
+
+ elm_object_text_set(lbl, buf);
+ evas_object_size_hint_min_set(lbl, SIZE_CONTENT_LABEL_WIDTH, 0);
+ elm_object_part_content_set(ly, PART_CONTENT_INFO_TXT, lbl);
+
+ elm_box_pack_end(box, ly);
+ evas_object_show(ly);
+
+ return true;
+}
+
+
+int s_GetMediaIndex(Eina_List *list, int type, const char *name)
+{
+ Eina_List *l;
+ struct mediadata *md;
+ int idx;
+ void *obj;
+
+ if (!list || !name)
+ return 0;
+
+ idx = 0;
+ EINA_LIST_FOREACH(list, l, obj) {
+ md = (struct mediadata *)obj;
+
+ if (mediadata_get_type(md) == type)
+ idx++;
+
+ if (!strcmp(name, mediadata_get_displayname(md)))
+ break;
+ }
+
+ return idx;
+}
+
+char *CCtxtMenuView::sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part)
+{
+ const char *display_name;
+ struct mediadata *md;
+ const struct videodata *video_info;
+ int duration;
+
+ if (!data || !part)
+ return NULL;
+
+ md = (struct mediadata*)data;
+
+ if (!strcmp(part, "elm.text")) {
+ display_name = mediadata_get_displayname(md);
+ if (!display_name)
+ return NULL;
+
+ return strdup(display_name);
+ } else if (!strcmp(part, "elm.text.playtime")) {
+ video_info = mediadata_get_video_info(md);
+ if (!video_info)
+ return NULL;
+
+ duration = videodata_get_duration(video_info);
+
+ return util_get_time_string(duration);
+ }
+
+ return NULL;
+}
+
+Evas_Object *CCtxtMenuView::sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part)
+{
+ struct mediadata *md;
+ const char *thumbpath;
+ Evas_Object *image, *ic;
+
+ if (!data || !obj || !part)
+ return NULL;
+
+ md = (struct mediadata*)data;
+
+ if (!strcmp(part, PART_ELM_SWALLOWICON)) {
+ thumbpath = mediadata_get_thumbnailpath(md);
+ if (!thumbpath) {
+ ic = elm_icon_add(obj);
+ if (!ic)
+ return NULL;
+
+ elm_icon_thumb_set(ic,
+ mediadata_get_filepath(md), NULL);
+ elm_image_aspect_fixed_set(ic, EINA_FALSE);
+
+ return ic;
+ }
+
+ image = elm_image_add(obj);
+ if (!image)
+ return NULL;
+
+ elm_image_file_set(image, thumbpath, NULL);
+ elm_image_aspect_fixed_set(image, EINA_FALSE);
+ evas_object_show(image);
+
+ return image;
+ }
+
+ return NULL;
+}
+
+Eina_Bool CCtxtMenuView::sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part)
+{
+ return EINA_FALSE;
+}
+
+void CCtxtMenuView::_free_itemclass(Elm_Gengrid_Item_Class *ic)
+{
+ elm_gengrid_item_class_free(ic);
+}
+
+Elm_Gengrid_Item_Class *CCtxtMenuView::_get_itemclass(int type)
+{
+ Elm_Gengrid_Item_Class *ic;
+
+ ic = elm_gengrid_item_class_new();
+ if (!ic)
+ return NULL;
+
+ ic->func.text_get = sm_CbGridTextGet;
+ ic->func.content_get = sm_CbGridContentGet;
+ ic->func.state_get = sm_CbGridStateGet;
+ ic->func.del = NULL;
+
+ if (type == MEDIA_IMAGE)
+ ic->item_style = STYLE_CTXT_MENU_PHOTOITEM;
+ else if (type == MEDIA_VIDEO)
+ ic->item_style = STYLE_CTXT_MENU_VIDEOITEM;
+ else {
+ _free_itemclass(ic);
+ return NULL;
+ }
+
+ return ic;
+}
+
+char *CCtxtMenuView::_get_mediadata_date(struct mediadata *md)
+{
+ char buf[20];
+ time_t timeval;
+ struct tm tm;
+
+ if (!md)
+ return NULL;
+
+ timeval = mediadata_get_createdtime(md);
+ if (timeval > 0) {
+ localtime_r(&timeval, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ } else {
+ timeval = mediadata_get_modifiedtime(md);
+ if (timeval > 0) {
+ localtime_r(&timeval, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ } else
+ return NULL;
+ }
+
+ return strdup(buf);
+}
+
+bool CCtxtMenuView::m_DrawGengrid(void)
+{
+ Elm_Gengrid_Item_Class *ic_photo, *ic_video;
+ Eina_List *l;
+ Evas_Object *grid;
+ Elm_Object_Item *it = NULL;
+ struct mediadata *md;
+ const char *sel_name, *name;
+ char *sel_date, *date;
+ void *obj;
+
+ grid = m->grid;
+ if (!grid)
+ return false;
+
+ md = m->vd->md;
+ if (!md)
+ return false;
+
+ elm_gengrid_clear(grid);
+
+ ic_photo = _get_itemclass(MEDIA_IMAGE);
+ if (!ic_photo)
+ return false;
+
+ ic_video = _get_itemclass(MEDIA_VIDEO);
+ if (!ic_video)
+ return false;
+
+ sel_name = mediadata_get_displayname(md);
+ if (!sel_name)
+ goto err;
+
+ sel_date = _get_mediadata_date(md);
+ if (!sel_date)
+ goto err;
+
+ EINA_LIST_FOREACH(m->vd->media_list, l, obj) {
+ md = (struct mediadata*)obj;
+
+ name = mediadata_get_displayname(md);
+ if (!name || !strcmp(sel_name, name))
+ continue;
+
+ date = _get_mediadata_date(md);
+ if (!date)
+ continue;
+
+ if (strcmp(sel_date, date)) {
+ free(date);
+ continue;
+ }
+
+ if (mediadata_get_type(md) == MEDIA_IMAGE) {
+ it = elm_gengrid_item_append(grid, ic_photo,
+ md, NULL, NULL);
+ } else if (mediadata_get_type(md) == MEDIA_VIDEO) {
+ it = elm_gengrid_item_append(grid, ic_video,
+ md, NULL, NULL);
+ }
+ elm_object_item_data_set(it, md);
+
+ free(date);
+ }
+
+ _free_itemclass(ic_photo);
+ _free_itemclass(ic_video);
+
+ free(sel_date);
+
+ return true;
+
+err:
+ _free_itemclass(ic_photo);
+ _free_itemclass(ic_video);
+
+ return false;
+}
+
+bool CCtxtMenuView::m_LoadContentThumbnail(void)
+{
+ Evas_Object *photocam;
+ int type;
+ const char *thumbpath;
+ struct mediadata *md;
+
+ photocam = elm_photocam_add(m->base);
+ if (!photocam) {
+ _ERR("elm_photocam_add failed");
+ return false;
+ }
+
+ md = m->vd->md;
+ if (!md)
+ return false;
+
+ type = mediadata_get_type(md);
+
+ switch (type) {
+ case MEDIA_VIDEO:
+ thumbpath = mediadata_get_thumbnailpath(md);
+
+ if (thumbpath)
+ elm_photocam_file_set(photocam, thumbpath);
+ else
+ elm_photocam_file_set(photocam, IMAGE_DEFAULT_VIDEO);
+
+ break;
+ case MEDIA_IMAGE:
+ thumbpath = mediadata_get_filepath(md);
+
+ if (thumbpath)
+ elm_photocam_file_set(photocam, thumbpath);
+ else
+ elm_photocam_file_set(photocam, IMAGE_DEFAULT_PHOTO);
+
+ break;
+ default:
+ break;
+ }
+
+ elm_photocam_paused_set(photocam, EINA_TRUE);
+ elm_photocam_zoom_mode_set(photocam, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
+
+ elm_object_part_content_set(m->base, PART_CONTENT_THUMBNAIL, photocam);
+
+ return true;
+}
+
+bool CCtxtMenuView::m_LoadContentInfo(void)
+{
+ Evas_Object *box;
+ int type, source;
+ unsigned long long size;
+ const char *name;
+ char buf[256], tbuf[20];
+ time_t created_time;
+ struct tm tm;
+ struct mediadata *md;
+
+ md = m->vd->md;
+ if (!md)
+ return false;
+
+ box = elm_box_add(m->base);
+ if (!box) {
+ _ERR("elm_box_add failed");
+ return false;
+ }
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_horizontal_set(box, EINA_FALSE);
+
+ elm_object_part_content_set(m->base, PART_CONTENT_INFO, box);
+
+ name = mediadata_get_displayname(md);
+ if (name) {
+ elm_object_part_text_set(m->base, PART_CONTENT_TITLE, name);
+ } else {
+ elm_object_part_text_set(m->base, PART_CONTENT_TITLE, _(TEXT_NONAME));
+ }
+
+ type = mediadata_get_type(md);
+ snprintf(buf, sizeof(buf), "%d / %d",
+ s_GetMediaIndex(m->vd->media_list, type, name),
+ util_get_media_count(m->vd->media_list, type));
+ if (!s_PackContentInfo(box, buf))
+ return false;
+
+ size = mediadata_get_size(md);
+ if (size > 0) {
+ snprintf(buf, sizeof(buf), "%s : %.2f MB",
+ _(TEXT_CONTENT_SIZE), ((size / 1024.0) / 1024.0));
+ } else {
+ snprintf(buf, sizeof(buf), "%s : %s",
+ _(TEXT_CONTENT_SIZE), _(TEXT_DEFAULT_SIZE));
+ }
+ if (!s_PackContentInfo(box, buf))
+ return false;
+
+ created_time = mediadata_get_createdtime(md);
+ if (created_time > 0) {
+ localtime_r(&created_time, &tm);
+ strftime(tbuf, sizeof(tbuf), "%Y.%m.%d", &tm);
+ snprintf(buf, sizeof(buf), "%s : %s",
+ _(TEXT_CONTENT_DATE), _(tbuf));
+ } else {
+ snprintf(buf, sizeof(buf), "%s : %s",
+ _(TEXT_CONTENT_DATE), _(TEXT_NODATE));
+ }
+ if (!s_PackContentInfo(box, buf))
+ return false;
+
+ source = mediadata_get_source(md);
+ snprintf(buf, sizeof(buf), "%s : %s", _(TEXT_CONTENT_LOCATION),
+ source == E_SOURCE_TV ? _("TV") : _("USB"));
+ if (!s_PackContentInfo(box, buf))
+ return false;
+
+#if 0
+ image_info = mediadata_get_image_info(md);
+ if (!image_info)
+ return false;
+
+ model = imagedata_get_model(image_info);
+ if (model) {
+ snprintf(buf, sizeof(buf), "%s : %s",
+ _(TEXT_CONTENT_CAMERA), _(model));
+ if (!s_PackContentInfo(box, buf))
+ return false;
+ }
+
+ iso = imagedata_get_iso(image_info);
+ if (iso > 0) {
+ snprintf(buf, sizeof(buf), "%s : %d", _(TEXT_CONTENT_ISO), iso);
+ if (!s_PackContentInfo(box, buf))
+ return false;
+ }
+#endif
+
+ evas_object_show(box);
+
+ return true;
+}
+
+
+bool CCtxtMenuView::m_DrawSelectedContent(void)
+{
+ if (!m_LoadContentThumbnail())
+ return false;
+
+ if (!m_LoadContentInfo())
+ return false;
+
+ return true;
+}
+
+
+bool CCtxtMenuView::m_DrawRelatedContent(void)
+{
+ Evas_Object *grid;
+ struct mediadata *md;
+
+ md = m->vd->md;
+ if (!md)
+ return false;
+
+ grid = elm_gengrid_add(m->base);
+ if (!grid) {
+ _ERR("elm_gengrid_add failed");
+ return false;
+ }
+
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * CTXT_MENU_GENGRID_ITEM_SIZE_W,
+ elm_config_scale_get() * CTXT_MENU_GENGRID_ITEM_SIZE_H);
+
+ m->grid = grid;
+
+ if (!m_DrawGengrid()) {
+ evas_object_del(grid);
+ return false;
+ }
+
+ m->pHandlerGrid->Connect(grid);
+ //((IMouseMoveListener*)m->pHandlerGrid)->Connect(grid); //evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_MOVE, _grid_mouse_move, m);
+ //((IReleasedListener*)m->pHandlerGrid)->Connect(grid); //evas_object_smart_callback_add(grid, SIG_REALIZED, _grid_realized, m);
+ //((IUnreleasedListener*)m->pHandlerGrid)->Connect(grid); // evas_object_smart_callback_add(grid, SIG_UNREALIZED, _grid_unrealized, m);
+
+ evas_object_show(grid);
+
+ elm_object_part_text_set(m->base,
+ PART_RELCONT_TXT, _(TEXT_RELATED_CONTENT));
+ elm_object_part_content_set(m->base, PART_RELCONT, grid);
+
+ elm_object_focus_next_object_set(grid, grid, ELM_FOCUS_LEFT);
+
+ return true;
+}
+
+struct _btn_info *CCtxtMenuView::m_GetBtnInfo(int *size)
+{
+ struct mediadata *md;
+ struct _btn_info *btn_info = NULL;
+ int type;
+
+ md = m->vd->md;
+ if (!md)
+ return NULL;
+
+ *size = 0;
+
+ if (CViewMgr::GetInstance()->CheckTop(VIEW_GALLERY)) {
+ type = mediadata_get_type(md);
+
+ if (type == MEDIA_IMAGE) {
+ btn_info = browse_photo_btn;
+ btn_info->handler = m->pHandlerSlideshow;
+ *size = ARRAY_SIZE(browse_photo_btn);
+ } else if (type == MEDIA_VIDEO) {
+ btn_info = browse_video_btn;
+ btn_info->handler = m->pHandlerPlayer;
+ *size = ARRAY_SIZE(browse_video_btn);
+ }
+ }
+
+ return btn_info;
+}
+
+bool CCtxtMenuView::m_DrawFuncBtn(void)
+{
+ Evas_Object *box, *ly, *img, *lbl;
+ struct _btn_info *btn_info;
+ struct mediadata *md;
+ int i, size;
+ char btn_title[256];
+
+
+ md = m->vd->md;
+ if (!md)
+ return false;
+
+ box = elm_box_add(m->base);
+ if (!box) {
+ _ERR("elm_box_add failed");
+ return false;
+ }
+
+ elm_box_horizontal_set(box, EINA_TRUE);
+ elm_box_padding_set(box, SIZE_BOX_PAD_W * elm_config_scale_get(),
+ SIZE_BOX_PAD_H * elm_config_scale_get());
+
+ btn_info = m_GetBtnInfo(&size);
+ ly = NULL;
+ for (i = 0; i < size; i++) {
+ ly = elm_layout_add(box);
+ if (!ly) {
+ _ERR("elm_layout_add failed");
+ goto err;
+ }
+ elm_layout_file_set(ly, EDJEFILE, GRP_CTXT_MENU_BTN);
+
+ img = elm_image_add(ly);
+ if (!img) {
+ _ERR("elm_image_add failed");
+ goto err;
+ }
+ elm_image_file_set(img, btn_info[i].btn_img, NULL);
+ elm_object_part_content_set(ly, PART_BTN_ICON, img);
+
+ lbl = elm_label_add(img);
+ if (!lbl) {
+ _ERR("elm_label_add failed");
+ goto err;
+ }
+
+ snprintf(btn_title, sizeof(btn_title),
+ "<align=center><color=#FFFFFFFF>"
+ "<font_size=21>%s</font_size>"
+ "</color></align>", _(btn_info[i].btn_title));
+ elm_object_text_set(lbl, btn_title);
+ elm_label_line_wrap_set(lbl, ELM_WRAP_WORD);
+ evas_object_size_hint_min_set(lbl, SIZE_BTN_LABEL_WIDTH, 0);
+ elm_object_part_content_set(ly, PART_BTN_TITLE, lbl);
+
+ evas_object_size_hint_align_set(ly, 0.0, 0.5);
+ elm_box_pack_end(box, ly);
+ evas_object_show(ly);
+ elm_object_focus_allow_set(ly, EINA_TRUE);
+
+ btn_info[i].handler->Connect(ly);
+ //((IFocusedListener*)btn_info[i].handler)->Connect(ly); // evas_object_smart_callback_add(ly, "focused", _func_btn_focused, m);
+ //((IUnfocusedListener*)btn_info[i].handler)->Connect(ly); // evas_object_smart_callback_add(ly, "unfocused", _func_btn_unfocused, m);
+ //((IKeyDownListener*)btn_info[i].handler)->Connect(ly); // evas_object_event_callback_add(ly, EVAS_CALLBACK_KEY_DOWN, btn_info[i].pressed_cb, m);
+ //((IMouseMoveListener*)btn_info[i].handler)->Connect(ly); // evas_object_event_callback_add(ly, EVAS_CALLBACK_MOUSE_DOWN, btn_info[i].clicked_cb, m);
+ //((IMouseDownListener*)btn_info[i].handler)->Connect(ly); // evas_object_event_callback_add(ly, EVAS_CALLBACK_MOUSE_MOVE, _func_btn_mouse_move, m);
+
+ elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(ly, m->grid, ELM_FOCUS_DOWN);
+
+ m->func_btn[i] = ly;
+ }
+
+ if (m->func_btn[0]) {
+ evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ elm_object_focus_set(m->func_btn[0], EINA_TRUE);
+ util_ui_set_focus_directions(m->func_btn, size, EINA_TRUE);
+ } else {
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_focus_next_object_set(m->grid, m->grid, ELM_FOCUS_UP);
+ }
+
+ elm_object_part_content_set(m->base, PART_FUNC_BTN, box);
+
+ return true;
+
+err:
+ evas_object_del(box);
+ return false;
+}
+
+
+bool CCtxtMenuView::Create(void* d)
+{
+ view_data *data = (view_data*)d;
+
+ ASSERT(!m);
+ ASSERT(data);
+
+ Evas_Object *win;
+
+ win = CViewMgr::GetInstance()->Window();
+ if (!win)
+ return false;
+
+ m = new SCtxtMenuView;
+ if (!m)
+ return false;
+
+ m->base = elm_layout_add(win);
+ if (!m->base) {
+ _ERR("elm_layout_add failed");
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ elm_layout_file_set(m->base, EDJEFILE, GRP_CTXT_MENU);
+
+ m->win = win;
+ m->vd = data;
+
+ if (!m_DrawSelectedContent())
+ goto err;
+
+ if (!m_DrawRelatedContent())
+ goto err;
+
+ if (!m_DrawFuncBtn())
+ goto err;
+
+ if (!m->cTimeout.Create(TIMEOUT_CTXT_MENU, this)) {
+ goto err;
+ }
+
+ Connect(m->base);// evas_object_event_callback_add(m->base, EVAS_CALLBACK_KEY_DOWN, _base_key_pressed, m);
+
+ CBaseView::Create(NULL);
+
+ return true;
+
+err:
+ _ERR("draw items failed");
+ evas_object_del(m->base);
+ delete m;
+ m = NULL;
+ return false;
+}
+
+void CCtxtMenuView::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+ m->cTimeout.Destroy();
+ evas_object_del(m->base);
+ delete m;
+ m = NULL;
+}
+
+Evas_Object* CCtxtMenuView::Base(void)
+{
+ ASSERT(m);
+
+ return m->base;
+}
+
+void CCtxtMenuView::t_OnShow(void)
+{
+ ASSERT(m);
+
+ evas_object_show(m->base);
+}
+
+void CCtxtMenuView::t_OnHide(void)
+{
+ ASSERT(m);
+
+ evas_object_hide(m->base);
+}
+
+
+void CCtxtMenuView::t_OnPause(void)
+{
+ ASSERT(m);
+
+ m->cTimeout.Pause();
+}
+
+void CCtxtMenuView::t_OnResume(void)
+{
+ ASSERT(m);
+
+ m->cTimeout.Resume();
+}
+
+
+void CCtxtMenuView::OnTimeout(void)
+{
+ CViewMgr::GetInstance()->PopView();
+}
+
+
+Eina_Bool CCtxtMenuView::OnEvent(int type, void *event_info)
+{
+ return EINA_TRUE;
+}
+
+
+void CCtxtMenuView::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+{
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ CViewMgr::GetInstance()->PopView();
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include "menudef.h"
+#include "mediadata.h"
+#include "AppCommon.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "BaseLayout.h"
+#include "LayoutMgr.h"
+#include "InputHandler.h"
+#include "gallery_view.h"
+#include "layout_all.h"
+#include "layout_events.h"
+#include "layout_folder.h"
+
+#define BTN_ID "btn_id"
+#define BTN_ICN "btn_icon"
+
+#define IMAGE_UP_ARR IMAGEDIR"/ico_dropdown_date_arrow_up.png"
+#define IMAGE_DOWN_ARR IMAGEDIR"/ico_dropdown_date_arrow_down.png"
+
+#define LOADING_ICON_X 48
+#define LOADING_ICON_Y 48
+#define MAX_TIME_LIMIT 10.0
+
+struct SGalleryView {
+ Evas_Object *win;
+ Evas_Object *base;
+
+ Evas_Object *btn[MENUITEM_SIZE];
+ Evas_Object *focused_btn;
+
+ Evas_Object *ctxpopup;
+ Evas_Object *hover_btn;
+ Evas_Object *hover_updown;
+ Evas_Object *sortbtn;
+ Evas_Object *sourcebtn;
+
+ Evas_Object *popup;
+ Elm_Transit *transit;
+
+ const char *path;
+ bool bfirsttime_launch;
+
+ Eina_List *layout_info_list;
+ Eina_List *media_list;
+ Eina_List *filelist;
+
+ int current_layout;
+ int sort_type;
+ int source_type;
+ int focus_area;
+
+ struct arg_list *arglist;
+
+ CLayoutMgr *pLayoutMgr;
+
+ CGalleryView *parent;
+
+ CAllLayout *pAllLayout;
+ CEventLayout *pEventLayout;
+ CFolderLayout *pFolderLayout;
+
+ struct layout_data *ld;
+
+ SGalleryView() {
+ win = NULL;
+ base = NULL;
+
+ ctxpopup = NULL;
+ hover_btn = NULL;
+ hover_updown = NULL;
+ sortbtn = NULL;
+ sourcebtn = NULL;
+
+ popup = NULL;
+ transit = NULL;
+
+ layout_info_list = NULL;
+ media_list = NULL;
+ filelist = NULL;
+
+ arglist = NULL;
+
+ pLayoutMgr = NULL;
+ parent = NULL;
+
+ ld = NULL;
+
+ pHandlerMenuBtn = new CHandlerMenuBtn(this);
+ pHandlerSortBtn = new CHandlerHoversel(this);
+ pHandlerSourceBtn = new CHandlerHoversel(this);
+ pHandlerCtxPopup = new CHandlerCtxPopup(this);
+ }
+
+ ~SGalleryView() {
+ delete pHandlerMenuBtn;
+ delete pHandlerSortBtn;
+ delete pHandlerSourceBtn;
+ delete pHandlerCtxPopup;
+ }
+
+ class CHandlerMenuBtn : public CListenerMgr, IKeyDownListener, IMouseMoveListener, IFocusedListener {
+ private:
+ SGalleryView *m;
+
+ public:
+ CHandlerMenuBtn(SGalleryView *ins) : IKeyDownListener(this), IMouseMoveListener(this), IFocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ if (strcmp(ev->keyname, KEY_RIGHT) == 0 ||
+ strcmp(ev->keyname, KEY_ENTER) == 0) {
+ m->parent->FocusLayout();
+
+ elm_object_signal_emit(obj, "highlight", "");
+
+ m->focused_btn = obj;
+ m->focus_area = FOCUS_CONTENT_AREA;
+
+ } else if (strcmp(ev->keyname, KEY_BACK) == 0) {
+ elm_exit();
+ }
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ int i = 0;
+
+ m->focus_area = FOCUS_MENU_BTN;
+
+ if (m->focused_btn == obj)
+ return;
+
+ if (m->focused_btn)
+ elm_object_signal_emit(m->focused_btn, "unhighlight", "");
+
+ for (i = E_LAYOUT_ALL; i < E_LAYOUT_MAX; i++) {
+ if (m->btn[i] == obj)
+ break;
+ }
+
+ m->focused_btn = obj;
+
+ m->parent->DrawContentArea(i);
+ }
+ } *pHandlerMenuBtn;
+
+ class CHandlerHoversel : public CListenerMgr, IKeyDownListener, IMouseClickedListener, IMouseMoveListener, IFocusedListener, IUnfocusedListener {
+ private:
+ SGalleryView *m;
+
+ private:
+ void m_FocusUpdownArrow(void)
+ {
+ if (!m->hover_updown)
+ return;
+
+ if (m->sort_type == E_SORT_DATE_DESC) {
+ /* date desc */
+ elm_image_file_set(m->hover_updown, IMAGE_DOWN_ARR, NULL);
+ evas_object_color_set(m->hover_updown, 255, 255, 255, 255);
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+
+ evas_object_show(m->hover_updown);
+ elm_object_part_content_set(m->sortbtn,
+ PART_ELM_SWALLOWICON, m->hover_updown);
+ } else if (m->sort_type == E_SORT_DATE_ASC) {
+ /* date asc */
+ elm_image_file_set(m->hover_updown, IMAGE_UP_ARR, NULL);
+ evas_object_color_set(m->hover_updown, 255, 255, 255, 255);
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+
+ evas_object_show(m->hover_updown);
+ elm_object_part_content_set(m->sortbtn,
+ PART_ELM_SWALLOWICON, m->hover_updown);
+ } else {
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+ evas_object_hide(m->hover_updown);
+ }
+ }
+ void m_UnfocusUpdownArrow(void)
+ {
+ if (!m->hover_updown)
+ return;
+
+ if (m->sort_type == E_SORT_DATE_DESC) {
+ /* date desc */
+ elm_image_file_set(m->hover_updown, IMAGE_DOWN_ARR, NULL);
+ evas_object_color_set(m->hover_updown, 175, 175, 175, 255);
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+
+ evas_object_show(m->hover_updown);
+ elm_object_part_content_set(m->sortbtn,
+ PART_ELM_SWALLOWICON, m->hover_updown);
+
+ } else if (m->sort_type == E_SORT_DATE_ASC) {
+ /* date asc */
+ elm_image_file_set(m->hover_updown, IMAGE_UP_ARR, NULL);
+ evas_object_color_set(m->hover_updown, 175, 175, 175, 255);
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+
+ evas_object_show(m->hover_updown);
+ elm_object_part_content_set(m->sortbtn, PART_ELM_SWALLOWICON, m->hover_updown);
+ } else {
+ elm_object_part_content_unset(m->sortbtn, PART_ELM_SWALLOWICON);
+ evas_object_hide(m->hover_updown);
+ }
+ }
+
+ public:
+ CHandlerHoversel(SGalleryView *ins) : IKeyDownListener(this), IMouseClickedListener(this), IMouseMoveListener(this), IFocusedListener(this), IUnfocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ elm_object_focus_set(m->focused_btn, EINA_TRUE);
+ }
+ virtual void OnMouseClicked(int id, Evas_Object *obj)
+ {
+ if (m->sortbtn == obj) {
+ m->parent->DrawCtxpopup(sorttext, SORT_TEXT_SIZE,
+ STYLE_BTN_HOVERTEXT, m->sort_type,
+ POSITION_SORT_POPUP_X, POSITION_SORT_POPUP_Y);
+ } else if (m->sourcebtn == obj) {
+ m->parent->DrawCtxpopup(sourcetext, SOURCE_TEXT_SIZE,
+ STYLE_BTN_HOVERTEXT, m->source_type,
+ POSITION_SOURCE_POPUP_X, POSITION_SOURCE_POPUP_Y);
+ } else {
+ _ERR("No button info");
+ return;
+ }
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_signal_emit(m->focused_btn, "highlight", "");
+
+ if (m->sortbtn == obj)
+ m_FocusUpdownArrow();
+
+ m->hover_btn = obj;
+ m->focus_area = FOCUS_HOVER_BTN;
+ }
+ virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ if (m->sortbtn == obj)
+ m_UnfocusUpdownArrow();
+ }
+ } *pHandlerSortBtn, *pHandlerSourceBtn;
+
+ class CHandlerCtxPopup : public CListenerMgr, IKeyDownListener, IMouseClickedListener, IMouseMoveListener, IFocusedListener, IUnfocusedListener {
+ private:
+ SGalleryView *m;
+
+ private:
+ static void sm_SortDateDescClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SortLayout(E_SORT_DATE_DESC);
+ }
+
+ static void sm_SortDateAscClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SortLayout(E_SORT_DATE_ASC);
+ }
+
+ static void sm_SortAZClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SortLayout(E_SORT_A_Z);
+ }
+
+ static void sm_SortZAClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SortLayout(E_SORT_Z_A);
+ }
+
+ static void sm_SourceAllClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SourceChange(E_SOURCE_ALL);
+ }
+
+ static void sm_SourceTVClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SourceChange(E_SOURCE_TV);
+ }
+
+ static void sm_SourceUSBClicked(void *cookie)
+ {
+ CHandlerCtxPopup *root = (CHandlerCtxPopup *)cookie;
+
+ if (root)
+ root->m_SourceChange(E_SOURCE_USB);
+ }
+
+ void m_SortLayout(int sort_type)
+ {
+ if (m->sort_type == sort_type)
+ return;
+
+ m->sort_type = sort_type;
+
+ switch (m->current_layout) {
+ case E_LAYOUT_ALL:
+ m->pAllLayout->Sort(m->sort_type);
+ break;
+ case E_LAYOUT_EVENTS:
+ m->pEventLayout->Sort(m->sort_type);
+ break;
+ case E_LAYOUT_FOLDER:
+ m->pFolderLayout->Sort(m->sort_type);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void m_SourceChange(int source_type)
+ {
+ if (m->source_type == source_type)
+ return;
+
+ m->source_type = E_SOURCE_ALL;
+
+ mediadata_destroy_mediafiles_list(m->media_list);
+
+ m->media_list = mediadata_create_mediafiles_list(
+ m->source_type, m->arglist->media_type);
+ if (!m->media_list)
+ return;
+
+ m->parent->DrawContentArea(m->current_layout);
+ }
+
+ public:
+ CHandlerCtxPopup(SGalleryView *ins) : IKeyDownListener(this), IMouseClickedListener(this), IMouseMoveListener(this), IFocusedListener(this), IUnfocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ m->parent->DestroyCtxpopup();
+ }
+ virtual void OnMouseClicked(int id, Evas_Object *obj)
+ {
+ int i;
+ const char *current_id;
+ void(*func[])(void *) = {
+ sm_SortDateDescClicked,
+ sm_SortDateAscClicked,
+ sm_SortAZClicked,
+ sm_SortZAClicked,
+ sm_SourceAllClicked,
+ sm_SourceTVClicked,
+ sm_SourceUSBClicked
+ };
+
+ current_id = (const char *)evas_object_data_get(obj, BTN_ID);
+ if (!current_id)
+ return;
+
+ for (i = 0; i < (SORT_TEXT_SIZE + SOURCE_TEXT_SIZE); i++) {
+ if (!strcmp(hover_btn_id[i], current_id)) {
+ func[i](this);
+ break;
+ }
+ }
+
+ elm_object_text_set(m->hover_btn, elm_object_text_get(obj));
+
+ m->parent->DestroyCtxpopup();
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ Evas_Object *ic;
+
+ ic = (Evas_Object *)evas_object_data_get(obj, BTN_ICN);
+ if (!ic)
+ return;
+
+ evas_object_color_set(ic, 255, 255, 255, 255);
+ }
+ virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ const char *current_id;
+ Evas_Object *ic;
+
+ current_id = (const char *)evas_object_data_get(obj, BTN_ID);
+ if (!current_id)
+ return;
+
+ ic = (Evas_Object *)evas_object_data_get(obj, BTN_ICN);
+ if (!ic)
+ return;
+
+ if (!strcmp(current_id, hover_btn_id[0])) {
+ /* date desc */
+ if (m->sort_type == E_SORT_DATE_DESC)
+ evas_object_color_set(ic, 147, 170, 0, 255);
+ else
+ evas_object_color_set(ic, 89, 89, 89, 255);
+ } else if (!strcmp(current_id, hover_btn_id[1])) {
+ /* date asc */
+ if (m->sort_type == E_SORT_DATE_ASC)
+ evas_object_color_set(ic, 147, 170, 0, 255);
+ else
+ evas_object_color_set(ic, 89, 89, 89, 255);
+ }
+ }
+ } *pHandlerCtxPopup;
+};
+
+#if 0
+void CGalleryView::sm_CbUsbConnected(usb_device_h usb_device, char *action, void *dt)
+{
+ CGalleryView *root = (CGalleryView *)dt;
+
+ root->m_UsbConnected(action);
+}
+
+void CGalleryView::m_UsbConnected(char *action)
+{
+ if (m->source_type == E_SOURCE_TV)
+ return;
+
+ if (!strcmp(action, "added") || !strcmp(action, "removed"))
+ m_DrawNotifyPopup(_(TEXT_LOADING_MEDIA));
+}
+
+void CGalleryView::sm_CbMediaUpdate(media_content_error_e error,
+ int pid, media_content_db_update_item_type_e update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type,
+ char *uuid, char *path, char *mime_type, void *dt)
+{
+ CGalleryView *root = (CGalleryView *)dt;
+
+ root->m_MediaUpdate();
+}
+
+void CGalleryView::m_MediaUpdate(void)
+{
+ CViewMgr *vmgr;
+
+ _INFO("Media Files Updated, Source - %d Connected usb - %d",
+ m->source_type, mediadata_connected_usb());
+
+ if (m->source_type == E_SOURCE_TV)
+ return;
+
+ if (m->source_type == E_SOURCE_ALL) {
+ if (mediadata_connected_usb() > 0)
+ m->source_type = E_SOURCE_USB;
+ else
+ return;
+ } else if (m->source_type == E_SOURCE_USB) {
+ if (mediadata_connected_usb() == 0)
+ m->source_type = E_SOURCE_ALL;
+ else
+ return;
+ }
+
+ vmgr = CViewMgr::GetInstance();
+ if (!vmgr)
+ return;
+
+ if (vmgr->CheckTop(VIEW_PHOTO_VIEWER))
+ vmgr->PopView();
+ else if (vmgr->CheckTop(VIEW_PHOTO_ZOOM)) {
+ vmgr->PopView();
+ vmgr->PopView();
+ }
+
+ DestroyCtxpopup();
+
+ mediadata_destroy_mediafiles_list(m->media_list);
+
+ m->media_list = mediadata_create_mediafiles_list(
+ m->source_type, m->arglist->media_type);
+
+ DrawContentArea(m->current_layout);
+
+ if (m->source_type == E_SOURCE_ALL)
+ elm_object_text_set(m->sourcebtn, _(sourcetext[0]));
+ else if (m->source_type == E_SOURCE_USB)
+ elm_object_text_set(m->sourcebtn, _(sourcetext[2]));
+
+ m_DestroyNotifyPopup();
+}
+#endif
+
+void CGalleryView::m_DestroyNotifyPopup(void)
+{
+ if (m->transit) {
+ elm_transit_del(m->transit);
+ m->transit = NULL;
+ }
+
+ evas_object_del(m->popup);
+}
+
+void CGalleryView::m_DrawNotifyPopup(const char *text)
+{
+ Evas_Object *popup, *label, *icon;
+ Elm_Transit *transit;
+
+ popup = elm_popup_add(m->win);
+ if (!popup)
+ return;
+
+ m->popup = popup;
+
+ elm_object_style_set(popup, "loading");
+ elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP_RIGHT);
+
+ label = elm_label_add(popup);
+ if (!label)
+ return;
+
+ elm_object_style_set(label, "popup/loading");
+ elm_object_text_set(label, text);
+
+ elm_object_content_set(popup, label);
+
+ icon = elm_icon_add(popup);
+ if (!icon)
+ return;
+
+ elm_image_file_set(icon, IMAGEDIR"/loading_48_01.png", NULL);
+ evas_object_size_hint_min_set(icon,
+ LOADING_ICON_X * elm_config_scale_get(),
+ LOADING_ICON_Y * elm_config_scale_get());
+
+ elm_object_part_content_set(popup, "elm.swallow.icon", icon);
+
+ evas_object_show(popup);
+
+ /* Max. time limit for reading 10 secs */
+ elm_popup_timeout_set(popup, MAX_TIME_LIMIT);
+
+ transit = elm_transit_add();
+ if (!transit)
+ return;
+
+ elm_transit_object_add(transit, icon);
+ elm_transit_effect_rotation_add(transit, 0, 360);
+ elm_transit_duration_set(transit, 1);
+ elm_transit_repeat_times_set(transit, 10);
+ elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
+
+ elm_transit_go(transit);
+
+ m->transit = transit;
+}
+
+void CGalleryView::m_AddUpdownIcon(Evas_Object *btn, const char *icon_file)
+{
+ Evas_Object *ic;
+
+ if (!btn)
+ return;
+
+ ic = elm_image_add(btn);
+ if (!ic)
+ return;
+
+ elm_image_file_set(ic, icon_file, NULL);
+ elm_object_part_content_set(btn, PART_ELM_SWALLOWICON2, ic);
+ evas_object_data_set(btn, BTN_ICN, ic);
+}
+
+Evas_Object *CGalleryView::m_GetHoverselObject(const char **text_arr,
+ int size_arr, const char *style)
+{
+ Evas_Object *hoversel;
+
+ hoversel = elm_button_add(m->base);
+ if (!hoversel)
+ return NULL;
+
+ elm_object_style_set(hoversel, style);
+
+ if (!strcmp(style, STYLE_SORT)) {
+ elm_object_text_set(hoversel, _(text_arr[m->sort_type]));
+
+ m->hover_updown = elm_image_add(hoversel);
+ if (!m->hover_updown)
+ return NULL;
+
+ m->pHandlerSortBtn->Connect(hoversel);
+
+ /* Calling first time to show icon */
+ m->pHandlerSortBtn->OnUnfocused(0, hoversel, NULL);
+ } else {
+ elm_object_text_set(hoversel, _(text_arr[m->source_type]));
+
+ m->pHandlerSourceBtn->Connect(hoversel);
+ }
+
+ evas_object_show(hoversel);
+
+ return hoversel;
+}
+
+bool CGalleryView::m_DrawTopArea(void)
+{
+ Evas_Object *hoversel;
+
+ elm_object_part_text_set(m->base, PART_TITLETEXT, _(TEXT_GALLERY));
+
+ hoversel = m_GetHoverselObject(sorttext, SORT_TEXT_SIZE, STYLE_SORT);
+ if (!hoversel)
+ return false;
+ elm_object_part_content_set(m->base, PART_HOVERSELAREA1, hoversel);
+ m->sortbtn = hoversel;
+
+ hoversel = m_GetHoverselObject(sourcetext, SOURCE_TEXT_SIZE, STYLE_SOURCE);
+ if (!hoversel)
+ return false;
+ elm_object_part_content_set(m->base, PART_HOVERSELAREA2, hoversel);
+ m->sourcebtn = hoversel;
+
+ return true;
+}
+
+bool CGalleryView::m_DrawLeftArea(void)
+{
+ Evas_Object *box, *ic;
+ int i;
+
+ box = util_ui_add_box(m->base);
+ if (!box)
+ return false;
+
+ for (i = 0; i < MENUITEM_SIZE; i++) {
+ m->btn[i] = util_ui_add_button(box);
+ if (!m->btn[i]) {
+ evas_object_del(box);
+ return false;
+ }
+
+ elm_object_style_set(m->btn[i], STYLE_MENUBTN);
+
+ ic = elm_image_add(m->btn[i]);
+ if (ic) {
+ elm_image_file_set(ic, menuicons[i], NULL);
+ elm_object_part_content_set(m->btn[i], PART_ELM_SWALLOWICON, ic);
+ }
+
+ elm_object_text_set(m->btn[i], _(menutext[i]));
+
+ elm_box_pack_end(box, m->btn[i]);
+
+ m->pHandlerMenuBtn->Connect(m->btn[i]);
+
+ evas_object_show(m->btn[i]);
+
+ elm_object_focus_next_object_set(m->btn[i], m->btn[i], ELM_FOCUS_LEFT);
+ }
+
+ evas_object_show(box);
+
+ elm_object_part_content_set(m->base, PART_LEFTSWALLOW, box);
+
+ m->media_list = mediadata_create_mediafiles_list(
+ m->source_type, m->arglist->media_type);
+ if (!m->media_list)
+ _ERR("MEDIA LIST CREATE ERROR");
+
+ m->filelist = NULL;
+
+ /* Set focus directions and initial focus */
+ elm_object_focus_next_object_set(m->btn[MENUITEM_SIZE - 1],
+ m->btn[0], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->btn[0], m->sortbtn, ELM_FOCUS_UP);
+
+ elm_object_focus_set(m->btn[m->current_layout], EINA_TRUE);
+
+ return true;
+}
+
+bool CGalleryView::m_DrawItems(void)
+{
+ if (!m_DrawTopArea())
+ return false;
+
+ if (!m_DrawLeftArea())
+ return false;
+
+ return true;
+}
+
+void CGalleryView::DrawContentArea(int ltype)
+{
+ Eina_List *arg;
+
+ if (ltype == E_LAYOUT_FOLDER)
+ arg = m->media_list;
+ else {
+ if (m->filelist)
+ eina_list_free(m->filelist);
+ m->filelist = mediadata_get_filelist(m->media_list);
+ arg = m->filelist;
+ }
+
+ m->ld->media_list = arg;
+ m->ld->arglist = m->arglist;
+ m->ld->path = NULL;
+ m->ld->sort = m->sort_type;
+ m->ld->prev_layout = E_LAYOUT_NONE;
+ m->ld->modified = EINA_TRUE;
+
+ m->pLayoutMgr->Show(layout_type[ltype]);
+ m->current_layout = ltype;
+
+ if (m->bfirsttime_launch) {
+ if (m->arglist->id) {
+ switch (m->current_layout) {
+ case E_LAYOUT_ALL:
+ m->pAllLayout->DirectLaunch(m->arglist->id);
+ break;
+ case E_LAYOUT_EVENTS:
+ m->pEventLayout->DirectLaunch(m->arglist->id);
+ break;
+ case E_LAYOUT_FOLDER:
+ m->pFolderLayout->DirectLaunch(m->arglist->id);
+ break;
+ default:
+ break;
+ }
+ }
+
+ m->bfirsttime_launch = false;
+ }
+}
+
+void CGalleryView::FocusLayout(void)
+{
+ switch (m->current_layout) {
+ case E_LAYOUT_ALL:
+ m->pAllLayout->Focus();
+ break;
+ case E_LAYOUT_EVENTS:
+ m->pEventLayout->Focus();
+ break;
+ case E_LAYOUT_FOLDER:
+ m->pFolderLayout->Focus();
+ break;
+ default:
+ break;
+ }
+}
+
+void CGalleryView::DestroyCtxpopup(void)
+{
+ if (!m->ctxpopup)
+ return;
+
+ evas_object_hide(m->ctxpopup);
+ evas_object_del(m->ctxpopup);
+ m->ctxpopup = NULL;
+}
+
+void CGalleryView::DrawCtxpopup(const char **text_arr, int size_arr,
+ const char *style, int selected_index, int position_x, int position_y)
+{
+ Evas_Object *ctxpopup, *box, *btn = NULL;
+ Evas_Object *firstbtn = NULL;
+ Elm_Ctxpopup_Direction dir;
+ int i;
+
+ ctxpopup = elm_ctxpopup_add(m->base);
+ if (!ctxpopup)
+ return;
+
+ box = elm_box_add(ctxpopup);
+ if (!box) {
+ evas_object_del(ctxpopup);
+ return;
+ }
+
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
+
+ for (i = 0; i < size_arr; i++) {
+ if (text_arr == sourcetext &&
+ !strcmp(text_arr[i], sourcetext[E_SOURCE_USB])/* &&
+ mediadata_connected_usb() == 0*/)
+ continue;
+
+ btn = elm_button_add(box);
+ if (!btn) {
+ evas_object_del(ctxpopup);
+ return;
+ }
+
+ elm_object_style_set(btn, style);
+ elm_object_text_set(btn, _(text_arr[i]));
+
+ m->pHandlerCtxPopup->Connect(btn);
+
+ if (text_arr == sourcetext)
+ evas_object_data_set(btn, BTN_ID,
+ hover_btn_id[SORT_TEXT_SIZE + i]);
+ else {
+ evas_object_data_set(btn, BTN_ID, hover_btn_id[i]);
+
+ if (i == 0 || i == 1) {
+ if (i == 0)
+ m_AddUpdownIcon(btn, IMAGE_DOWN_ARR);
+ else if (i == 1)
+ m_AddUpdownIcon(btn, IMAGE_UP_ARR);
+
+ /* Calling first time to show icon */
+ m->pHandlerCtxPopup->OnUnfocused(0, btn, NULL);
+ }
+ }
+
+ evas_object_show(btn);
+
+ elm_box_pack_end(box, btn);
+
+ if (i == 0)
+ firstbtn = btn; /* to set focus later */
+
+ if (i == selected_index)
+ elm_object_signal_emit(btn, "elm,action,highlight", "elm");
+
+ if (i == size_arr - 1)
+ elm_object_signal_emit(btn, "elm,action,hideline", "elm");
+ }
+
+ evas_object_show(box);
+
+ elm_object_style_set(ctxpopup, STYLE_CTXPOPUP_HOVER);
+ elm_object_content_set(ctxpopup, box);
+
+ dir = (Elm_Ctxpopup_Direction)0;
+ elm_ctxpopup_direction_priority_set(ctxpopup, dir, dir, dir, dir);
+ evas_object_move(ctxpopup,
+ position_x * elm_config_scale_get(),
+ position_y * elm_config_scale_get());
+ evas_object_show(ctxpopup);
+
+ m->ctxpopup = ctxpopup;
+
+ if (firstbtn && btn) {
+ elm_object_focus_set(firstbtn, EINA_TRUE);
+ elm_object_focus_next_object_set(firstbtn, btn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(btn, firstbtn, ELM_FOCUS_DOWN);
+ }
+}
+
+void CGalleryView::sm_CbGetSignalFromLayout(void *cookie, int sig)
+{
+ SGalleryView *m = (SGalleryView *)cookie;
+
+ if (sig == E_HIGHLIGHT) {
+ elm_object_signal_emit(m->focused_btn, "highlight", "");
+ if (m->hover_btn)
+ elm_object_signal_emit(m->hover_btn, "unfocused", "");
+
+ m->focus_area = FOCUS_CONTENT_AREA;
+ } else if (sig == E_RETURN)
+ elm_object_focus_set(m->focused_btn, EINA_TRUE);
+}
+
+void CGalleryView::sm_CbAllLayoutFocus(void *cookie)
+{
+ SGalleryView *m = (SGalleryView *)cookie;
+
+ m->pAllLayout->Focus();
+}
+
+void CGalleryView::sm_CbAllLayoutSort(void *cookie, int sort)
+{
+ SGalleryView *m = (SGalleryView *)cookie;
+
+ m->pAllLayout->Sort(sort);
+}
+
+void CGalleryView::sm_CbAllLayoutHide(void *cookie)
+{
+ SGalleryView *m = (SGalleryView *)cookie;
+
+ elm_object_focus_set(m->focused_btn, EINA_TRUE);
+}
+
+void CGalleryView::sm_CbLayoutShown(void *cookie, CBaseLayout *pBaseLayout)
+{
+ const char *id;
+ SGalleryView *m;
+
+ m = (SGalleryView *)cookie;
+
+ if (!m->ld->modified)
+ return;
+
+ id = pBaseLayout->LayoutId();
+ if (!strcmp(id, LAYOUT_ALL))
+ m->pAllLayout->Update(m->ld);
+ else if (!strcmp(id, LAYOUT_EVENT))
+ m->pEventLayout->Update(m->ld);
+ else if (!strcmp(id, LAYOUT_FOLDER))
+ m->pFolderLayout->Update(m->ld);
+}
+
+bool CGalleryView::Create(void *data)
+{
+ ASSERT(!m);
+
+ Evas_Object *win;
+
+ win = CViewMgr::GetInstance()->Window();
+ ASSERT(win);
+
+ m = new SGalleryView;
+ if (!m)
+ return false;
+
+ m->base = elm_layout_add(win);
+ if (!m->base) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ m->pLayoutMgr = new CLayoutMgr;
+ if (!m->pLayoutMgr) {
+ _ERR("LayoutMgr creation failed");
+ goto error;
+ }
+
+ if (!m->pLayoutMgr->Create(m->base, NULL)) {
+ _ERR("LayoutMgr init failed");
+ goto error;
+ }
+
+ m->ld = (struct layout_data *)calloc(1, sizeof(*m->ld));
+ if (!m->ld) {
+ _ERR("layout data creation failed");
+ goto error;
+ }
+
+ m->parent = this;
+
+ m->pAllLayout = new CAllLayout(LAYOUT_ALL);
+ m->pAllLayout->Create(m->pLayoutMgr, m->ld);
+ m->pAllLayout->SetHideCallback(sm_CbAllLayoutHide, m);
+ m->pAllLayout->SetSendSigCallback(sm_CbGetSignalFromLayout, m);
+ m->pLayoutMgr->AddLayout(m->pAllLayout);
+
+ m->pEventLayout = new CEventLayout(LAYOUT_EVENT);
+ m->pEventLayout->Create(m->pLayoutMgr, m->ld);
+ m->pEventLayout->SetFocusCallback(sm_CbAllLayoutFocus, m);
+ m->pEventLayout->SetSortCallback(sm_CbAllLayoutSort, m);
+ m->pEventLayout->SetSendSigCallback(sm_CbGetSignalFromLayout, m);
+ m->pLayoutMgr->AddLayout(m->pEventLayout);
+
+ m->pFolderLayout = new CFolderLayout(LAYOUT_FOLDER);
+ m->pFolderLayout->Create(m->pLayoutMgr, m->ld);
+ m->pFolderLayout->SetFocusCallback(sm_CbAllLayoutFocus, m);
+ m->pFolderLayout->SetSortCallback(sm_CbAllLayoutSort, m);
+ m->pFolderLayout->SetSendSigCallback(sm_CbGetSignalFromLayout, m);
+ m->pLayoutMgr->AddLayout(m->pFolderLayout);
+
+ m->pLayoutMgr->RegisterCallback(CLayoutMgr::CONDITION_LAYOUT_SHOW_NOTIFY, sm_CbLayoutShown, m);
+
+ if (mediadata_init() == -1) {
+ evas_object_del(m->base);
+ free(m);
+ return false;
+ }
+
+ if (!elm_layout_file_set(m->base, EDJEFILE, GRP_GALLERY_VIEW)) {
+ mediadata_fini();
+ goto error;
+ }
+
+ m->win = win;
+ m->arglist = (struct arg_list *)data;
+ m->sort_type = m->arglist->sort;
+ m->source_type = m->arglist->source;
+ m->current_layout = m->arglist->view;
+ m->bfirsttime_launch = true;
+
+ evas_object_data_set(m->base, PRIV_DATA, m);
+
+#if 0
+ mediadata_set_updated_cb(sm_CbMediaUpdate, this);
+ mediadata_usb_set_connected_cb(sm_CbUsbConnected, this);
+#endif
+
+ if (!m_DrawItems()) {
+ mediadata_fini();
+ goto error;
+ }
+
+ CBaseView::Create(NULL);
+
+ return true;
+
+error:
+ _ERR("create failed, returning NULL");
+ evas_object_del(m->base);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+void CGalleryView::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+
+ mediadata_unset_updated_cb();
+ //mediadata_usb_unset_connected_cb();
+
+ eina_list_free(m->filelist);
+ mediadata_destroy_mediafiles_list(m->media_list);
+
+ mediadata_fini();
+
+ m->pLayoutMgr->RemoveLayout(m->pAllLayout);
+ m->pLayoutMgr->RemoveLayout(m->pEventLayout);
+ m->pLayoutMgr->RemoveLayout(m->pFolderLayout);
+
+ evas_object_del(m->base);
+
+ free(m);
+ m = NULL;
+}
+
+Evas_Object* CGalleryView::Base(void)
+{
+ ASSERT(m);
+
+ return m->base;
+}
+
+void CGalleryView::t_OnShow(void)
+{
+ ASSERT(m);
+
+ evas_object_show(m->base);
+}
+
+void CGalleryView::t_OnHide(void)
+{
+ ASSERT(m);
+
+ evas_object_hide(m->base);
+}
+
+void CGalleryView::t_OnPause(void)
+{
+ ASSERT(m);
+
+ if (m->ctxpopup)
+ DestroyCtxpopup();
+}
+
+void CGalleryView::t_OnResume(void)
+{
+ ASSERT(m);
+
+ switch (m->focus_area) {
+ case FOCUS_MENU_BTN:
+ elm_object_focus_set(m->focused_btn, EINA_TRUE);
+ break;
+ case FOCUS_HOVER_BTN:
+ elm_object_focus_set(m->hover_btn, EINA_TRUE);
+ break;
+ case FOCUS_CONTENT_AREA:
+ FocusLayout();
+ break;
+ default:
+ break;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include "define.h"
+#include "viewdata.h"
+#include "mediadata.h"
+#include "menudef.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "LayoutMgr.h"
+#include "BaseLayout.h"
+#include "gallery_view.h"
+#include "video_player.h"
+#include "gallery_view.h"
+#include "layout_all.h"
+#include "layout_events.h"
+#include "layout_folder.h"
+#include "AppCommon.h"
+#include "InputHandler.h"
+
+struct SHideCallbackPair {
+ void(*cb)(void *cookie);
+ void *cookie;
+};
+
+struct SSigCallbackPair {
+ void(*cb)(void *cookie, int sig);
+ void *cookie;
+};
+
+struct SAllLayout {
+ Evas_Object *base;
+
+ Evas_Object *grid;
+ Elm_Object_Item *current_item;
+
+ struct arg_list *arglist;
+ Eina_List *media_list;
+ int sort;
+
+ struct layout_data *ld;
+
+ CLayoutMgr *pLayoutMgr;
+
+ SHideCallbackPair *HideCb;
+ SSigCallbackPair *Sigcb;
+
+ SAllLayout() {
+ base = NULL;
+ grid = NULL;
+
+ arglist = NULL;
+ media_list = NULL;
+ sort = 0;
+
+ ld = NULL;
+
+ pLayoutMgr = NULL;
+
+ HideCb = NULL;
+ Sigcb = NULL;
+
+ pHandlerGrid = new CHandlerGrid(this);
+ }
+
+ ~SAllLayout() {
+ delete pHandlerGrid;
+ }
+
+ class CHandlerGrid : public CListenerMgr, IKeyDownListener, IMouseMoveListener, IRealizedListener, IUnrealizedListener, IFocusedListener {
+ private:
+ SAllLayout *m;
+
+ private:
+ void m_SendResultToApp(const char *filepath)
+ {
+ service_h reply = NULL;
+ service_h service;
+ int service_ret = -1;
+
+ if (!filepath)
+ return;
+
+ if (service_create(&reply) != SERVICE_ERROR_NONE) {
+ _ERR("service_create failed");
+ return;
+ }
+
+ service = m->arglist->service;
+
+ service_add_extra_data(reply, SERVICE_DATA_SELECTED, filepath);
+ if (!reply)
+ return;
+
+ service_ret = service_reply_to_launch_request(reply, service,
+ SERVICE_RESULT_SUCCEEDED);
+ if (service_ret != SERVICE_ERROR_NONE) {
+ _ERR("service_reply_to_launch_request failed");
+ service_reply_to_launch_request(reply, service,
+ SERVICE_RESULT_CANCELED);
+ }
+
+ service_destroy(reply);
+ elm_exit();
+ }
+ void m_CreateCtxtMenu(void)
+ {
+ struct mediadata *md;
+ struct view_data *vd;
+ Elm_Object_Item *it;
+
+ it = m->current_item;
+
+ md = (struct mediadata *)elm_object_item_data_get(it);
+ if (!md)
+ return;
+
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = m->media_list;
+ vd->md = md;
+
+ CViewMgr::GetInstance()->PushView(VIEW_CTXT_MENU, vd);
+ }
+ static void sm_CbGridActivated(void *cookie, Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ CHandlerGrid *root = (CHandlerGrid *)cookie;
+ if (root)
+ root->OnGridActivated(it, emission, source);
+ }
+ static void sm_CbGridItemFocused(void *cookie, Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ CHandlerGrid *root = (CHandlerGrid *)cookie;
+ if (root)
+ root->OnGridItemFocused(it, emission, source);
+ }
+ void OnGridItemFocused(Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ if (!it)
+ return;
+
+ m->current_item = (Elm_Object_Item *)it;
+ }
+
+ public:
+ CHandlerGrid(SAllLayout *ins) : IKeyDownListener(this), IMouseMoveListener(this), IRealizedListener(this), IUnrealizedListener(this), IFocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ CEventLayout *pEventLayout;
+ CFolderLayout *pFolderLayout;
+
+ if (strcmp(ev->keyname, KEY_BACK) == 0) {
+ switch (m->ld->prev_layout) {
+ case E_LAYOUT_NONE:
+ m->Sigcb->cb(m->Sigcb->cookie, E_RETURN);
+ break;
+ case E_LAYOUT_EVENTS:
+ m->ld->modified = EINA_FALSE;
+ m->pLayoutMgr->Show(layout_type[E_LAYOUT_EVENTS]);
+
+ pEventLayout = (CEventLayout *)m->pLayoutMgr->Layout();
+ pEventLayout->Focus();
+
+ break;
+ case E_LAYOUT_FOLDER:
+ m->ld->modified = EINA_FALSE;
+ m->pLayoutMgr->Show(layout_type[E_LAYOUT_FOLDER]);
+
+ pFolderLayout = (CFolderLayout *)m->pLayoutMgr->Layout();
+ pFolderLayout->Focus();
+
+ break;
+ default:
+ break;
+ }
+ } else if (strcmp(ev->keyname, KEY_MENU) == 0)
+ m_CreateCtxtMenu();
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ Elm_Object_Item *it;
+
+ it = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL, NULL);
+ if (!it)
+ return;
+
+ if (elm_object_item_focus_get(it))
+ return;
+
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
+ virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_add(item, "item_clicked",
+ "edc", sm_CbGridActivated, this);
+ elm_object_item_signal_callback_add(item, "item_focused",
+ "edc", sm_CbGridItemFocused, this);
+ }
+ virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_del(item, "item_clicked",
+ "edc", sm_CbGridActivated);
+ elm_object_item_signal_callback_del(item, "item_focused",
+ "edc", sm_CbGridItemFocused);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ m->current_item = item;
+
+ m->Sigcb->cb(m->Sigcb->cookie, E_HIGHLIGHT);
+ }
+ void OnGridActivated(Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ struct mediadata *md;
+ struct view_data *vd;
+ int type;
+
+ if (!it)
+ return;
+
+ md = (struct mediadata *)elm_object_item_data_get(it);
+ if (!md)
+ return;
+
+ type = mediadata_get_type(md);
+
+ /* operation is pick */
+ if (m->arglist->media_type != E_MEDIA_IMAGE_VIDEO)
+ m_SendResultToApp(mediadata_get_filepath(md));
+ else {
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = util_create_media_list(m->media_list, type);
+ vd->md = md;
+
+ if (type == MEDIA_VIDEO)
+ video_player_play(vd);
+ else if (type == MEDIA_IMAGE)
+ CViewMgr::GetInstance()->PushView(VIEW_PHOTO_VIEWER, vd);
+ else {
+ _ERR("wrong media type");
+ free(vd);
+ return;
+ }
+ }
+
+ m->current_item = it;
+
+ elm_gengrid_item_selected_set(it, EINA_FALSE);
+ }
+ } *pHandlerGrid;
+};
+
+char *CAllLayout::sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part)
+{
+ const char *display_name;
+ struct mediadata *md;
+ const struct videodata *video_info;
+ int duration;
+
+ if (!data)
+ return NULL;
+
+ md = (struct mediadata *)data;
+
+ if (!strcmp(part, "elm.text")) {
+
+ display_name = mediadata_get_displayname(md);
+ if (!display_name)
+ return NULL;
+
+ return strdup(display_name);
+
+ } else if (!strcmp(part, "elm.text.playtime")) {
+
+ video_info = mediadata_get_video_info(md);
+ if (!video_info)
+ return NULL;
+ duration = videodata_get_duration(video_info);
+ return util_get_time_string(duration);
+ }
+
+ return NULL;
+}
+
+Evas_Object *CAllLayout::sm_CbGridContentGet(void *data,
+ Evas_Object *obj, const char *part)
+{
+ struct mediadata *md;
+ const char *thumbpath;
+ Evas_Object *image, *ic;
+
+ if (!data)
+ return NULL;
+
+ md = (struct mediadata *)data;
+
+ if (!strcmp(part, PART_ELM_SWALLOWICON)) {
+ thumbpath = mediadata_get_thumbnailpath(md);
+ if (!thumbpath) {
+ ic = elm_icon_add(obj);
+ if (!ic)
+ return NULL;
+ elm_icon_thumb_set(ic,
+ mediadata_get_filepath(md), NULL);
+ elm_image_aspect_fixed_set(ic, EINA_FALSE);
+
+ return ic;
+ }
+
+ image = elm_image_add(obj);
+ if (!image)
+ return NULL;
+
+ elm_image_file_set(image, thumbpath, NULL);
+ elm_image_aspect_fixed_set(image, EINA_FALSE);
+ evas_object_show(image);
+
+ return image;
+ }
+
+ return NULL;
+}
+
+Eina_Bool CAllLayout::sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part)
+{
+ return EINA_FALSE;
+}
+
+void CAllLayout::m_FreeItemclass(Elm_Gengrid_Item_Class *ic)
+{
+ elm_gengrid_item_class_free(ic);
+}
+
+Elm_Gengrid_Item_Class *CAllLayout::m_GetItemclass(int type)
+{
+ Elm_Gengrid_Item_Class *ic;
+
+ ic = elm_gengrid_item_class_new();
+ if (!ic)
+ return NULL;
+
+ ic->func.text_get = sm_CbGridTextGet;
+ ic->func.content_get = sm_CbGridContentGet;
+ ic->func.state_get = sm_CbGridStateGet;
+ ic->func.del = NULL;
+
+ if (type == MEDIA_IMAGE)
+ ic->item_style = STYLE_PHOTOITEM;
+ else
+ ic->item_style = STYLE_VIDEOITEM;
+
+ return ic;
+}
+
+Evas_Object *CAllLayout::m_DrawGengrid(Evas_Object *layout)
+{
+ Evas_Object *grid;
+
+ if (!layout)
+ return NULL;
+
+ grid = elm_gengrid_add(layout);
+ if (!grid)
+ return NULL;
+
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
+
+ m->pHandlerGrid->Connect(grid);
+
+ return grid;
+}
+
+bool CAllLayout::m_DrawGengridItems(void)
+{
+ Elm_Gengrid_Item_Class *ic_photo, *ic_video;
+ Eina_List *l;
+ Evas_Object *grid;
+ Elm_Object_Item *it;
+ struct mediadata *md;
+ char buf[16];
+ void *obj;
+
+ grid = m->grid;
+ if (!grid)
+ return false;
+
+ elm_gengrid_clear(grid);
+
+ ic_photo = m_GetItemclass(MEDIA_IMAGE);
+ if (!ic_photo)
+ return false;
+
+ ic_video = m_GetItemclass(MEDIA_VIDEO);
+ if (!ic_video) {
+ m_FreeItemclass(ic_photo);
+ return false;
+ }
+
+ EINA_LIST_FOREACH(m->media_list, l, obj) {
+ md = (struct mediadata *)obj;
+
+ it = NULL;
+ if (mediadata_get_type(md) == MEDIA_IMAGE)
+ it = elm_gengrid_item_append(grid, ic_photo, md, NULL, NULL);
+ else if (mediadata_get_type(md) == MEDIA_VIDEO)
+ it = elm_gengrid_item_append(grid, ic_video, md, NULL, NULL);
+
+ elm_object_item_data_set(it, md);
+ }
+
+ m_FreeItemclass(ic_photo);
+ m_FreeItemclass(ic_video);
+
+ /* update photo and video count */
+ snprintf(buf, sizeof(buf), "%d",
+ util_get_media_count(m->media_list, MEDIA_CONTENT_TYPE_IMAGE));
+ elm_object_part_text_set(Layout(), PART_PHOTOCOUNT, buf);
+
+ snprintf(buf, sizeof(buf), "%d",
+ util_get_media_count(m->media_list, MEDIA_CONTENT_TYPE_VIDEO));
+ elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+
+ return true;
+}
+
+int CAllLayout::sm_CompareDesc(const void *data1, const void *data2)
+{
+ struct mediadata *m1 = (struct mediadata *)data1;
+ struct mediadata *m2 = (struct mediadata *)data2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ if (mediadata_get_time_t(m2) >
+ mediadata_get_time_t(m1))
+ return 1;
+
+ return -1;
+}
+
+int CAllLayout::sm_CompareAsc(const void *data1, const void *data2)
+{
+ struct mediadata *m1 = (struct mediadata *)data1;
+ struct mediadata *m2 = (struct mediadata *)data2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ if (mediadata_get_time_t(m2) <
+ mediadata_get_time_t(m1))
+ return 1;
+
+ return -1;
+}
+
+int CAllLayout::sm_CompareAZ(const void *data1, const void *data2)
+{
+ struct mediadata *m1 = (struct mediadata *)data1;
+ struct mediadata *m2 = (struct mediadata *)data2;
+ const char *file1, *file2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ file1 = mediadata_get_displayname(m1);
+ file2 = mediadata_get_displayname(m2);
+ if (!file1 || !file2)
+ return -1;
+
+ return strcasecmp(file1, file2);
+}
+
+int CAllLayout::sm_CompareZA(const void *data1, const void *data2)
+{
+ struct mediadata *m1 = (struct mediadata *)data1;
+ struct mediadata *m2 = (struct mediadata *)data2;
+ const char *file1, *file2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ file1 = mediadata_get_displayname(m1);
+ file2 = mediadata_get_displayname(m2);
+ if (!file1 || !file2)
+ return -1;
+
+ return strcasecmp(file2, file1);
+}
+
+Eina_List *CAllLayout::m_SortList(Eina_List *list, int sort)
+{
+ Eina_List *result = NULL;
+
+ Eina_Compare_Cb _compare_cb_func[] = {
+ sm_CompareDesc,
+ sm_CompareAsc,
+ sm_CompareAZ,
+ sm_CompareZA,
+ };
+
+ if (sort < E_SORT_MAX)
+ result = eina_list_sort(list, 0, _compare_cb_func[sort]);
+
+ return result;
+}
+
+void CAllLayout::DirectLaunch(const char *id)
+{
+ ASSERT(m);
+
+ Elm_Object_Item *it;
+ struct mediadata *md;
+ const char *file_path;
+
+ if (!id)
+ return;
+
+ for (it = elm_gengrid_first_item_get(m->grid);
+ it != NULL; it = elm_gengrid_item_next_get(it)) {
+
+ md = (struct mediadata *)elm_object_item_data_get(it);
+ if (!md)
+ break;
+
+ file_path = mediadata_get_filepath(md);
+
+ if (file_path &&
+ !strcmp(file_path, id))
+ break;
+ }
+
+ if (it) {
+ elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_item_focus_set(it, EINA_TRUE);
+ m->Sigcb->cb(m->Sigcb->cookie, E_HIGHLIGHT);
+ m->pHandlerGrid->OnGridActivated(it, NULL, NULL);
+ }
+
+}
+
+void CAllLayout::Focus(void)
+{
+ ASSERT(m);
+
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_item_focus_set(m->current_item, EINA_TRUE);
+}
+
+void CAllLayout::Sort(int sort)
+{
+ ASSERT(m);
+ m->media_list = m_SortList(m->media_list, sort);
+
+ m->sort = sort;
+
+ m_DrawGengridItems();
+}
+
+
+void CAllLayout::Update(struct layout_data *ld)
+{
+ ASSERT(m);
+
+ char *buf;
+
+ m->arglist = ld->arglist;
+ m->sort = ld->sort;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->media_list = m_SortList(m->media_list, m->sort);
+
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1,
+ _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2,
+ _(TEXT_NOCONTENTAREA2));
+
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
+
+ if (!m_DrawGengridItems())
+ return;
+
+ if (ld->path) {
+ buf = ld->path;
+ elm_object_part_text_set(Layout(),
+ PART_CATEGORY_TITLE, buf);
+ free(buf);
+ }
+
+ m->current_item = elm_gengrid_first_item_get(m->grid);
+}
+
+void CAllLayout::SetHideCallback(void(*cb)(void *cookie), void *cookie)
+{
+ ASSERT(m);
+
+ SHideCallbackPair *hcb = new SHideCallbackPair;
+ if (!hcb)
+ return;
+
+ hcb->cb = cb;
+ hcb->cookie = cookie;
+
+ m->HideCb = hcb;
+}
+
+void CAllLayout::SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie)
+{
+ ASSERT(m);
+
+ SSigCallbackPair *rcb = new SSigCallbackPair;
+ if (!rcb)
+ return;
+
+ rcb->cb = cb;
+ rcb->cookie = cookie;
+
+ m->Sigcb = rcb;
+}
+
+bool CAllLayout::Create(CLayoutMgr *lmgr, void *data)
+{
+ ASSERT(!m);
+
+ struct layout_data *ld;
+ char *buf;
+
+ if (!lmgr || !data)
+ return false;
+
+ m = new SAllLayout;
+ if (!m)
+ return false;
+
+ m->base = lmgr->Base();
+ if (!m->base) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ Evas_Object *layout = elm_layout_add(m->base);
+ if (!layout) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_LAYOUT_ALL))
+ goto error;
+
+ ld = (struct layout_data *)data;
+
+ m->pLayoutMgr = lmgr;
+ m->arglist = ld->arglist;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->media_list = m_SortList(m->media_list, m->sort);
+ m->ld = ld;
+
+ m->grid = m_DrawGengrid(layout);
+ if (!m->grid)
+ goto error;
+
+ evas_object_data_set(m->base, LAYOUT_ALL_DATA, m);
+
+ elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
+
+ if (ld->path) {
+ buf = ld->path;
+ elm_object_part_text_set(layout,
+ PART_CATEGORY_TITLE, buf);
+ free(buf);
+ }
+
+ CBaseLayout::Create(layout);
+
+ return true;
+
+error:
+ _ERR("create failed, returning NULL");
+ evas_object_del(layout);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+void CAllLayout::t_OnShow(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnShow();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_TRUE);
+ elm_object_part_content_set(m->base, PART_CONTENTAREA, Layout());
+}
+
+void CAllLayout::t_OnHide(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnHide();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_FALSE);
+ elm_object_focus_set(m->grid, EINA_FALSE);
+
+ m->HideCb->cb(m->HideCb->cookie);
+
+ elm_object_part_content_unset(m->base, PART_CONTENTAREA);
+}
+
+void CAllLayout::Destroy(void)
+{
+ ASSERT(m);
+
+ if (m->media_list)
+ eina_list_free(m->media_list);
+
+ evas_object_del(Layout());
+
+ CBaseLayout::Destroy();
+
+ free(m);
+ m = NULL;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include "define.h"
+#include "viewdata.h"
+#include "mediadata.h"
+#include "eventdata.h"
+#include "menudef.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "video_player.h"
+#include "BaseLayout.h"
+#include "LayoutMgr.h"
+#include "gallery_view.h"
+#include "layout_all.h"
+#include "layout_events.h"
+#include "AppCommon.h"
+#include "InputHandler.h"
+
+struct SFocusCallbackPair {
+ void (*cb)(void *cookie);
+ void *cookie;
+};
+
+struct SSortCallbackPair {
+ void (*cb)(void *cookie, int sort);
+ void *cookie;
+};
+
+struct SSigCallbackPair {
+ void(*cb)(void *cookie, int sig);
+ void *cookie;
+};
+
+struct SEventLayout {
+ Evas_Object *base;
+
+ Evas_Object *grid;
+ Elm_Object_Item *current_item;
+
+ struct arg_list *arglist;
+ Eina_List *media_list;
+ Eina_List *event_list;
+ int sort;
+
+ Eina_Bool layout_2ndview;
+
+ struct layout_data *ld;
+
+ CLayoutMgr *pLayoutMgr;
+
+ SFocusCallbackPair *FocusCb;
+ SSortCallbackPair *SortCb;
+ SSigCallbackPair *Sigcb;
+
+ SEventLayout() {
+ base = NULL;
+ grid = NULL;
+ current_item = NULL;
+
+ arglist = NULL;
+ media_list = NULL;
+ event_list = NULL;
+ sort = 0;
+
+ layout_2ndview = EINA_FALSE;
+
+ ld = NULL;
+
+ pLayoutMgr = NULL;
+
+ FocusCb = NULL;
+ SortCb = NULL;
+ Sigcb = NULL;
+
+ pHandlerGrid = new CHandlerGrid(this);
+ }
+
+ ~SEventLayout() {
+ delete pHandlerGrid;
+ }
+
+ class CHandlerGrid : public CListenerMgr, IKeyDownListener, IMouseMoveListener, IRealizedListener, IUnrealizedListener, IFocusedListener {
+ private:
+ SEventLayout *m;
+
+ private:
+ static void sm_CbGridActivated(void *cookie, Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ CHandlerGrid *root = (CHandlerGrid *)cookie;
+ if (root)
+ root->OnGridActivated(it, emission, source);
+ }
+
+ public:
+ CHandlerGrid(SEventLayout *ins) : IKeyDownListener(this), IMouseMoveListener(this), IRealizedListener(this), IUnrealizedListener(this), IFocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ m->Sigcb->cb(m->Sigcb->cookie, E_RETURN);
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ Elm_Object_Item *it;
+
+ it = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL, NULL);
+ if (!it)
+ return;
+
+ if (elm_object_item_focus_get(it))
+ return;
+
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
+ virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_add(item, "item_clicked",
+ "edc", sm_CbGridActivated, this);
+ }
+ virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_del(item, "item_clicked",
+ "edc", sm_CbGridActivated);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ m->current_item = item;
+
+ m->Sigcb->cb(m->Sigcb->cookie, E_HIGHLIGHT);
+ }
+ void OnGridActivated(Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ struct mediadata *md;
+ struct eventdata *ed;
+ int type;
+ struct view_data *vd;
+ char buf[256];
+
+ if (!it)
+ return;
+
+ ed = (struct eventdata *)elm_object_item_data_get(it);
+ if (!ed)
+ return;
+
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_NO_INFO) {
+ md = eventdata_get_mediadata(ed);
+ if (!md)
+ return;
+
+ type = mediadata_get_type(md);
+
+ vd = (struct view_data *)calloc(1, sizeof(*vd));
+ if (!vd)
+ return;
+
+ vd->media_list = util_create_media_list(m->media_list, type);
+ vd->md = md;
+
+ if (type == MEDIA_VIDEO)
+ video_player_play(vd);
+ else if (type == MEDIA_IMAGE)
+ CViewMgr::GetInstance()->PushView(VIEW_PHOTO_VIEWER, vd);
+ else {
+ _ERR("wrong media type");
+ free(vd);
+ return;
+ }
+ } else {
+ /* TODO: Launch next view as per GUI specs */
+ snprintf(buf, sizeof(buf), "< %s", eventdata_get_eventname(ed));
+
+ m->ld->media_list = eventdata_get_listinfo(ed);
+ m->ld->arglist = m->arglist;
+ m->ld->path = strdup(buf);
+ m->ld->sort = m->sort;
+ m->ld->prev_layout = E_LAYOUT_EVENTS;
+ m->ld->modified = EINA_TRUE;
+
+ m->pLayoutMgr->Show(layout_type[E_LAYOUT_ALL]);
+ m->layout_2ndview = EINA_TRUE;
+
+ m->FocusCb->cb(m->FocusCb->cookie);
+
+ m->current_item = it;
+ }
+
+ elm_gengrid_item_selected_set(it, EINA_FALSE);
+ }
+ } *pHandlerGrid;
+};
+
+char *CEventLayout::sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part)
+{
+ const char *display_name;
+ struct eventdata *ed;
+ struct mediadata *md;
+ Eina_List *list;
+ char buf[32];
+
+ if (!data)
+ return NULL;
+
+ ed = (struct eventdata *)data;
+
+ if (!strcmp(part, "elm.text")) {
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_NO_INFO) {
+ md = eventdata_get_mediadata(ed);
+ if (!md)
+ return NULL;
+ display_name = mediadata_get_displayname(md);
+ } else
+ display_name = eventdata_get_eventname(ed);
+
+ if (!display_name)
+ return NULL;
+
+ return strdup(display_name);
+ } else if (!strcmp(part, PART_FILECOUNT)) {
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_INFO) {
+ list = eventdata_get_listinfo(ed);
+ if (!list)
+ return NULL;
+
+ snprintf(buf, sizeof(buf), "%d files", eina_list_count(list));
+
+ return strdup(buf);
+ }
+ }
+
+ return NULL;
+}
+
+Evas_Object *CEventLayout::sm_CbGridContentGet(void *data, Evas_Object *obj, const char *part)
+{
+ struct eventdata *ed;
+ struct mediadata *md;
+ const char *thumbpath;
+ Eina_List *list;
+ Evas_Object *image, *ic;
+
+ if (!data)
+ return NULL;
+
+ ed = (struct eventdata *)data;
+
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_NO_INFO)
+ md = eventdata_get_mediadata(ed);
+ else {
+ list = eventdata_get_listinfo(ed);
+ if (!list)
+ return NULL;
+
+ md = (struct mediadata *)eina_list_nth(list, 0);
+ }
+
+ if (!md)
+ return NULL;
+
+ if (!strcmp(part, PART_ELM_SWALLOWICON)) {
+ image = elm_image_add(obj);
+
+ thumbpath = mediadata_get_thumbnailpath(md);
+
+ if (!thumbpath) {
+ ic = elm_icon_add(obj);
+ if (!ic)
+ return NULL;
+ elm_icon_thumb_set(ic,
+ mediadata_get_filepath(md), NULL);
+ elm_image_aspect_fixed_set(ic, EINA_FALSE);
+
+ return ic;
+ }
+
+ elm_image_file_set(image, thumbpath, NULL);
+ elm_image_aspect_fixed_set(image, EINA_FALSE);
+ evas_object_show(image);
+
+ return image;
+ }
+
+ return NULL;
+}
+
+Eina_Bool CEventLayout::sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part)
+{
+ return EINA_FALSE;
+}
+
+void CEventLayout::m_FreeItemclass(Elm_Gengrid_Item_Class *ic_photo,
+ Elm_Gengrid_Item_Class *ic_video, Elm_Gengrid_Item_Class *ic_event)
+{
+ if (ic_photo)
+ elm_gengrid_item_class_free(ic_photo);
+ if (ic_video)
+ elm_gengrid_item_class_free(ic_video);
+ if (ic_event)
+ elm_gengrid_item_class_free(ic_event);
+}
+
+Elm_Gengrid_Item_Class *CEventLayout::m_GetItemclass(int type)
+{
+ Elm_Gengrid_Item_Class *ic;
+
+ ic = elm_gengrid_item_class_new();
+ if (!ic)
+ return NULL;
+
+ ic->func.text_get = sm_CbGridTextGet;
+ ic->func.content_get = sm_CbGridContentGet;
+ ic->func.state_get = sm_CbGridStateGet;
+ ic->func.del = NULL;
+
+ if (type == MEDIA_IMAGE)
+ ic->item_style = STYLE_PHOTOITEM;
+ else if (type == MEDIA_VIDEO)
+ ic->item_style = STYLE_VIDEOITEM;
+ else
+ ic->item_style = STYLE_EVENTITEM;
+
+ return ic;
+}
+
+int CEventLayout::m_GetEventCount(Eina_List *event_list)
+{
+ Eina_List *l;
+ struct eventdata *ed;
+ int count;
+ void *obj;
+
+ if (!event_list)
+ return 0;
+
+ count = 0;
+ EINA_LIST_FOREACH(event_list, l, obj) {
+ ed = (struct eventdata *)obj;
+
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_INFO)
+ count++;
+ }
+
+ return count;
+}
+
+int CEventLayout::m_GetMediaCount(Eina_List *media_list, int type)
+{
+ Eina_List *l;
+ struct mediadata *md;
+ int count;
+ void *obj;
+
+ if (!media_list)
+ return 0;
+
+ count = 0;
+ EINA_LIST_FOREACH(media_list, l, obj) {
+ md = (struct mediadata *)obj;
+
+ if (mediadata_get_type(md) == type)
+ count++;
+ }
+
+ return count;
+}
+
+Evas_Object *CEventLayout::m_DrawGengrid(Evas_Object *layout)
+{
+ Evas_Object *grid;
+
+ if (!layout)
+ return NULL;
+
+ grid = elm_gengrid_add(layout);
+ if (!grid)
+ return NULL;
+
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
+
+ m->pHandlerGrid->Connect(grid);
+
+ return grid;
+}
+
+bool CEventLayout::m_DrawGengridItems(void)
+{
+ Elm_Gengrid_Item_Class *ic_photo, *ic_video, *ic_event;
+ Eina_List *event_list, *l;
+ Evas_Object *grid;
+ Elm_Object_Item *it;
+ struct eventdata *ed;
+ struct mediadata *md;
+ char buf[32];
+ void *obj;
+
+ grid = m->grid;
+ if (!grid)
+ return false;
+
+ elm_gengrid_clear(grid);
+
+ event_list = eventdata_create_list(m->media_list, m->sort);
+ if (!event_list)
+ return false;
+
+ m->event_list = event_list;
+
+ ic_photo = m_GetItemclass(MEDIA_IMAGE);
+ ic_video = m_GetItemclass(MEDIA_VIDEO);
+ ic_event = m_GetItemclass(MEDIA_EVENT);
+ if (!ic_photo || !ic_video || !ic_event)
+ goto error;
+
+ EINA_LIST_FOREACH(event_list, l, obj) {
+ ed = (struct eventdata *)obj;
+
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_INFO) {
+ it = elm_gengrid_item_append(grid, ic_event, ed, NULL, NULL);
+ } else {
+ md = eventdata_get_mediadata(ed);
+ if (!md)
+ goto error;
+
+ it = NULL;
+ if (mediadata_get_type(md) == MEDIA_IMAGE)
+ it = elm_gengrid_item_append(grid, ic_photo, md, NULL, NULL);
+ else if (mediadata_get_type(md) == MEDIA_VIDEO)
+ it = elm_gengrid_item_append(grid, ic_video, md, NULL, NULL);
+ }
+
+ elm_object_item_data_set(it, ed);
+ }
+
+ m_FreeItemclass(ic_photo, ic_video, ic_event);
+
+ snprintf(buf, sizeof(buf), "%d Events", m_GetEventCount(event_list));
+ elm_object_part_text_set(Layout(), PART_CATEGORY_TITLE, buf);
+
+ snprintf(buf, sizeof(buf), "%d", m_GetMediaCount(m->media_list,
+ MEDIA_CONTENT_TYPE_IMAGE));
+ elm_object_part_text_set(Layout(), PART_PHOTOCOUNT, buf);
+
+ snprintf(buf, sizeof(buf), "%d", m_GetMediaCount(m->media_list,
+ MEDIA_CONTENT_TYPE_VIDEO));
+ elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+
+ return true;
+
+error:
+ m_FreeItemclass(ic_photo, ic_video, ic_event);
+ eventdata_destroy_list(event_list);
+
+ return false;
+}
+
+void CEventLayout::DirectLaunch(const char *id)
+{
+ ASSERT(m);
+
+ Elm_Object_Item *it;
+ const char *display_name;
+ struct eventdata *ed;
+ time_t timeval;
+ char buf[32];
+ struct tm tm;
+
+ if (!id)
+ return;
+
+ timeval = atol(id);
+ if (timeval > 0) {
+ localtime_r(&timeval, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ } else
+ return;
+
+ for (it = elm_gengrid_first_item_get(m->grid);
+ it != NULL; it = elm_gengrid_item_next_get(it)) {
+
+ ed = (struct eventdata *)elm_object_item_data_get(it);
+ if (!ed)
+ break;
+
+ if (eventdata_get_type(ed) == E_TYPE_EVENT_INFO) {
+
+ display_name = eventdata_get_eventname(ed);
+
+ if (display_name &&
+ !strcmp(buf, display_name))
+ break;
+ }
+ }
+
+ if (it) {
+ elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_item_focus_set(it, EINA_TRUE);
+ m->pHandlerGrid->OnGridActivated(it, NULL, NULL);
+ }
+}
+
+void CEventLayout::Focus(void)
+{
+ ASSERT(m);
+
+ if (m->layout_2ndview) {
+ m->FocusCb->cb(m->FocusCb->cookie);
+ return;
+ }
+
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_item_focus_set(m->current_item, EINA_TRUE);
+}
+
+void CEventLayout::Sort(int sort)
+{
+ ASSERT(m);
+
+ m->sort = sort;
+
+ if (m->layout_2ndview) {
+ m->SortCb->cb(m->FocusCb->cookie, sort);
+ return;
+ }
+
+ m_DrawGengridItems();
+}
+
+void CEventLayout::Update(struct layout_data *ld)
+{
+ ASSERT(m);
+
+ m->arglist = ld->arglist;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->sort = ld->sort;
+
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1,
+ _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2,
+ _(TEXT_NOCONTENTAREA2));
+
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
+
+ if (!m_DrawGengridItems())
+ return;
+
+ m->current_item = elm_gengrid_first_item_get(m->grid);
+}
+
+void CEventLayout::SetFocusCallback(void (*cb)(void *cookie), void *cookie)
+{
+ ASSERT(m);
+
+ SFocusCallbackPair *fcb = new SFocusCallbackPair;
+ if (!fcb)
+ return;
+
+ fcb->cb = cb;
+ fcb->cookie = cookie;
+
+ m->FocusCb = fcb;
+}
+
+void CEventLayout::SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie)
+{
+ ASSERT(m);
+
+ SSortCallbackPair *scb = new SSortCallbackPair;
+ if (!scb)
+ return;
+
+ scb->cb = cb;
+ scb->cookie = cookie;
+
+ m->SortCb = scb;
+}
+
+void CEventLayout::SetSendSigCallback(void (*cb)(void *cookie, int sig), void *cookie)
+{
+ ASSERT(m);
+
+ SSigCallbackPair *rcb = new SSigCallbackPair;
+ if (!rcb)
+ return;
+
+ rcb->cb = cb;
+ rcb->cookie = cookie;
+
+ m->Sigcb = rcb;
+}
+
+bool CEventLayout::Create(CLayoutMgr *lmgr, void *data)
+{
+ ASSERT(!m);
+
+ struct layout_data *ld;
+
+ if (!lmgr || !data)
+ return false;
+
+ m = new SEventLayout;
+ if (!m)
+ return false;
+
+ m->base = lmgr->Base();
+ if (!m->base) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ Evas_Object *layout = elm_layout_add(m->base);
+ if (!layout) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_LAYOUT_EVENTS))
+ goto error;
+
+ ld = (struct layout_data *)data;
+
+ m->pLayoutMgr = lmgr;
+ m->arglist = ld->arglist;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->sort = ld->sort;
+ m->ld = ld;
+
+ m->grid = m_DrawGengrid(layout);
+ if (!m->grid)
+ goto error;
+
+ evas_object_data_set(m->base, LAYOUT_EVENT_DATA, m);
+
+ elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
+
+ CBaseLayout::Create(layout);
+
+ return true;
+
+error:
+ _ERR("create failed, returning NULL");
+ evas_object_del(layout);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+void CEventLayout::Destroy(void)
+{
+ ASSERT(m);
+
+ eventdata_destroy_list(m->event_list);
+
+ if (m->media_list)
+ eina_list_free(m->media_list);
+
+ evas_object_del(Layout());
+
+ CBaseLayout::Destroy();
+
+ free(m);
+ m = NULL;
+}
+
+void CEventLayout::t_OnShow(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnShow();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_TRUE);
+ elm_object_part_content_set(m->base, PART_CONTENTAREA, Layout());
+
+ m->layout_2ndview = EINA_FALSE;
+}
+
+void CEventLayout::t_OnHide(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnHide();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_FALSE);
+ elm_object_focus_set(m->grid, EINA_FALSE);
+
+ elm_object_part_content_unset(m->base, PART_CONTENTAREA);
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include "define.h"
+#include "mediadata.h"
+#include "menudef.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "BaseLayout.h"
+#include "LayoutMgr.h"
+#include "layout_all.h"
+#include "layout_folder.h"
+#include "gallery_view.h"
+#include "AppCommon.h"
+#include "InputHandler.h"
+
+struct SFocusCallbackPair {
+ void (*cb)(void *cookie);
+ void *cookie;
+};
+
+struct SSortCallbackPair {
+ void (*cb)(void *cookie, int sort);
+ void *cookie;
+};
+
+struct SSigCallbackPair {
+ void(*cb)(void *cookie, int sig);
+ void *cookie;
+};
+
+struct SFolderLayout{
+ Evas_Object *base;
+
+ Evas_Object *grid;
+ Elm_Object_Item *current_item;
+
+ struct arg_list *arglist;
+ Eina_List *media_list;
+ int sort;
+
+ Eina_Bool layout_2ndview;
+
+ struct layout_data *ld;
+
+ CLayoutMgr *pLayoutMgr;
+
+ SFocusCallbackPair *FocusCb;
+ SSortCallbackPair *SortCb;
+ SSigCallbackPair *Sigcb;
+
+ SFolderLayout() {
+ base = NULL;
+ grid = NULL;
+ current_item = NULL;
+
+ arglist = NULL;
+ media_list = NULL;
+ sort = 0;
+
+ layout_2ndview = EINA_FALSE;
+
+ ld = NULL;
+
+ pLayoutMgr = NULL;
+
+ FocusCb = NULL;
+ SortCb = NULL;
+ Sigcb = NULL;
+
+ pHandlerGrid = new CHandlerGrid(this);
+ }
+
+ ~SFolderLayout() {
+ delete pHandlerGrid;
+ }
+
+ class CHandlerGrid : public CListenerMgr, IKeyDownListener, IMouseMoveListener, IRealizedListener, IUnrealizedListener, IFocusedListener {
+ private:
+ SFolderLayout *m;
+
+ private:
+ static void sm_CbGridActivated(void *cookie, Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ CHandlerGrid *root = (CHandlerGrid *)cookie;
+ if (root)
+ root->OnGridActivated(it, emission, source);
+ }
+ void OnGridActivated(Elm_Object_Item *it, const char *emission, const char *source)
+ {
+ struct folderdata *fd;
+ char buf[256];
+
+ fd = (struct folderdata *)elm_object_item_data_get(it);
+ if (!fd)
+ return;
+
+ snprintf(buf, sizeof(buf), "< %s", folderdata_get_name(fd));
+
+ m->ld->media_list = folderdata_get_listinfo(fd);
+ m->ld->arglist = m->arglist;
+ m->ld->path = strdup(buf);
+ m->ld->sort = m->sort;
+ m->ld->prev_layout = E_LAYOUT_FOLDER;
+ m->ld->modified = EINA_TRUE;
+
+ m->pLayoutMgr->Show(layout_type[E_LAYOUT_ALL]);
+ m->layout_2ndview = EINA_TRUE;
+
+ m->FocusCb->cb(m->FocusCb->cookie);
+
+ m->current_item = it;
+
+ elm_gengrid_item_selected_set(it, EINA_FALSE);
+ }
+
+ public:
+ CHandlerGrid(SFolderLayout *ins) : IKeyDownListener(this), IMouseMoveListener(this), IRealizedListener(this), IUnrealizedListener(this), IFocusedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+ {
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ m->Sigcb->cb(m->Sigcb->cookie, E_RETURN);
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+ {
+ Elm_Object_Item *it;
+
+ it = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL, NULL);
+ if (!it)
+ return;
+
+ if (elm_object_item_focus_get(it))
+ return;
+
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
+ virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_add(item, "item_clicked",
+ "edc", sm_CbGridActivated, this);
+ }
+ virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ elm_object_item_signal_callback_del(item, "item_clicked",
+ "edc", sm_CbGridActivated);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+ {
+ m->current_item = item;
+
+ m->Sigcb->cb(m->Sigcb->cookie, E_HIGHLIGHT);
+
+ }
+ } *pHandlerGrid;
+};
+
+char *CFolderLayout::sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part)
+{
+ const char *display_name;
+ struct folderdata *fd;
+ Eina_List *list;
+ char buf[32];
+
+ if (!data)
+ return NULL;
+
+ fd = (struct folderdata *)data;
+
+ if (!strcmp(part, "elm.text")) {
+ display_name = folderdata_get_name(fd);
+ if (!display_name)
+ return NULL;
+
+ return strdup(display_name);
+ } else if (!strcmp(part, PART_FILECOUNT)) {
+ list = folderdata_get_listinfo(fd);
+ if (!list)
+ return NULL;
+
+ snprintf(buf, sizeof(buf), "%d files", eina_list_count(list));
+
+ return strdup(buf);
+ }
+
+ return NULL;
+}
+
+Evas_Object *CFolderLayout::sm_CbGridContentGet(void *data,
+ Evas_Object *obj, const char *part)
+{
+ return NULL;
+}
+
+Eina_Bool CFolderLayout::sm_CbGridStateGet(void *data, Evas_Object *obj, const char *part)
+{
+ return EINA_FALSE;
+}
+
+void CFolderLayout::m_FreeItemclass(Elm_Gengrid_Item_Class *ic)
+{
+ if (ic)
+ elm_gengrid_item_class_free(ic);
+}
+
+Elm_Gengrid_Item_Class *CFolderLayout::m_GetItemclass(void)
+{
+ Elm_Gengrid_Item_Class *ic;
+
+ ic = elm_gengrid_item_class_new();
+ if (!ic)
+ return NULL;
+
+ ic->func.text_get = sm_CbGridTextGet;
+ ic->func.content_get = sm_CbGridContentGet;
+ ic->func.state_get = sm_CbGridStateGet;
+ ic->func.del = NULL;
+ ic->item_style = STYLE_FOLDERITEM;
+
+ return ic;
+}
+
+int CFolderLayout::m_GetMediaCount(Eina_List *list, int type)
+{
+ Eina_List *media_list;
+ struct mediadata *md;
+ int count = 0;
+ void *obj;
+
+ if (!list)
+ return 0;
+
+ media_list = mediadata_get_filelist(list);
+ if (!media_list)
+ return 0;
+
+ EINA_LIST_FREE(media_list, obj) {
+ md = (struct mediadata *)obj;
+
+ if (mediadata_get_type(md) == type)
+ count++;
+ }
+
+ return count;
+}
+
+Evas_Object *CFolderLayout::m_DrawGengrid(Evas_Object *layout)
+{
+ Evas_Object *grid;
+
+ if (!layout)
+ return NULL;
+
+ grid = elm_gengrid_add(layout);
+ if (!grid)
+ return NULL;
+
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
+
+ m->pHandlerGrid->Connect(grid);
+ return grid;
+}
+
+bool CFolderLayout::m_DrawGengridItems(void)
+{
+ Elm_Gengrid_Item_Class *ic_folder;
+ Eina_List *l;
+ Evas_Object *grid;
+ Elm_Object_Item *it;
+ struct folderdata *fd;
+ char buf[32];
+ void *obj;
+
+ grid = m->grid;
+ if (!grid)
+ return false;
+
+ elm_gengrid_clear(grid);
+
+ ic_folder = m_GetItemclass();
+ if (!ic_folder) {
+ m_FreeItemclass(ic_folder);
+ return false;
+ }
+
+ EINA_LIST_FOREACH(m->media_list, l, obj) {
+ fd = (struct folderdata *)obj;
+
+ it = elm_gengrid_item_append(grid, ic_folder, fd, NULL, NULL);
+ elm_object_item_data_set(it, fd);
+ }
+
+ m_FreeItemclass(ic_folder);
+
+ snprintf(buf, sizeof(buf), "%d Folders", eina_list_count(m->media_list));
+ elm_object_part_text_set(Layout(), PART_CATEGORY_TITLE, buf);
+
+ snprintf(buf, sizeof(buf), "%d", m_GetMediaCount(m->media_list,
+ MEDIA_CONTENT_TYPE_IMAGE));
+ elm_object_part_text_set(Layout(), PART_PHOTOCOUNT, buf);
+
+ snprintf(buf, sizeof(buf), "%d", m_GetMediaCount(m->media_list,
+ MEDIA_CONTENT_TYPE_VIDEO));
+ elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+
+ return true;
+}
+
+static int _compare_cb_desc(const void *data1,
+ const void *data2)
+{
+ struct folderdata *m1 = (struct folderdata *)data1;
+ struct folderdata *m2 = (struct folderdata *)data2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ if (folderdata_get_modifiedtime(m2) >
+ folderdata_get_modifiedtime(m1))
+ return 1;
+
+ return -1;
+}
+
+static int _compare_cb_asc(const void *data1,
+ const void *data2)
+{
+ struct folderdata *m1 = (struct folderdata *)data1;
+ struct folderdata *m2 = (struct folderdata *)data2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ if (folderdata_get_modifiedtime(m2) <
+ folderdata_get_modifiedtime(m1))
+ return 1;
+
+ return -1;
+}
+
+static int _compare_cb_a_z(const void *data1,
+ const void *data2)
+{
+ struct folderdata *m1 = (struct folderdata *)data1;
+ struct folderdata *m2 = (struct folderdata *)data2;
+ const char *file1, *file2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ file1 = folderdata_get_name(m1);
+ file2 = folderdata_get_name(m2);
+ if (!file1 || !file2)
+ return -1;
+
+ return strcasecmp(file1, file2);
+}
+
+static int _compare_cb_z_a(const void *data1,
+ const void *data2)
+{
+ struct folderdata *m1 = (struct folderdata *)data1;
+ struct folderdata *m2 = (struct folderdata *)data2;
+ const char *file1, *file2;
+
+ if (!m1 || !m2)
+ return -1;
+
+ file1 = folderdata_get_name(m1);
+ file2 = folderdata_get_name(m2);
+ if (!file1 || !file2)
+ return -1;
+
+ return strcasecmp(file2, file1);
+}
+
+static Eina_List *_sort_list(Eina_List *list, int sort)
+{
+ Eina_List *result = NULL;
+
+ Eina_Compare_Cb _compare_cb_func[] = {
+ _compare_cb_desc,
+ _compare_cb_asc,
+ _compare_cb_a_z,
+ _compare_cb_z_a
+ };
+
+ if (sort < E_SORT_MAX)
+ result = eina_list_sort(list, 0, _compare_cb_func[sort]);
+
+ return result;
+}
+
+void CFolderLayout::DirectLaunch(const char *id)
+{
+ ASSERT(m);
+
+ if (!id)
+ return;
+}
+
+void CFolderLayout::Focus(void)
+{
+ ASSERT(m);
+
+ if (m->layout_2ndview) {
+ m->FocusCb->cb(m->FocusCb->cookie);
+ return;
+ }
+
+ elm_object_focus_set(m->grid, EINA_TRUE);
+ elm_object_item_focus_set(m->current_item, EINA_TRUE);
+}
+
+void CFolderLayout::Sort(int sort)
+{
+ ASSERT(m);
+
+ m->sort = sort;
+
+ if (m->layout_2ndview) {
+ m->SortCb->cb(m->FocusCb->cookie, sort);
+ return;
+ }
+
+ m->media_list = _sort_list(m->media_list, sort);
+ m_DrawGengridItems();
+}
+
+void CFolderLayout::Update(struct layout_data *ld)
+{
+ ASSERT(m);
+
+ m->arglist = ld->arglist;
+ m->sort = ld->sort;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->media_list = _sort_list(m->media_list, m->sort);
+
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1,
+ _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2,
+ _(TEXT_NOCONTENTAREA2));
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
+
+ if (!m_DrawGengridItems())
+ return;
+
+ m->current_item = elm_gengrid_first_item_get(m->grid);
+}
+
+void CFolderLayout::SetFocusCallback(void (*cb)(void *cookie), void *cookie)
+{
+ ASSERT(m);
+
+ SFocusCallbackPair *fcb = new SFocusCallbackPair;
+ if (!fcb)
+ return;
+
+ fcb->cb = cb;
+ fcb->cookie = cookie;
+
+ m->FocusCb = fcb;
+}
+
+void CFolderLayout::SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie)
+{
+ ASSERT(m);
+
+ SSortCallbackPair *scb = new SSortCallbackPair;
+ if (!scb)
+ return;
+
+ scb->cb = cb;
+ scb->cookie = cookie;
+
+ m->SortCb = scb;
+}
+
+void CFolderLayout::SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie)
+{
+ ASSERT(m);
+
+ SSigCallbackPair *rcb = new SSigCallbackPair;
+ if (!rcb)
+ return;
+
+ rcb->cb = cb;
+ rcb->cookie = cookie;
+
+ m->Sigcb = rcb;
+}
+
+bool CFolderLayout::Create(CLayoutMgr *lmgr, void *data)
+{
+ ASSERT(!m);
+
+ struct layout_data *ld;
+
+ if (!lmgr || !data)
+ return false;
+
+ m = new SFolderLayout;
+ if (!m)
+ return false;
+
+ m->base = lmgr->Base();
+ if (!m->base) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ Evas_Object *layout = elm_layout_add(m->base);
+ if (!layout) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_LAYOUT_EVENTS))
+ goto error;
+
+ ld = (struct layout_data *)data;
+
+ m->pLayoutMgr = lmgr;
+ m->arglist = ld->arglist;
+ m->sort = ld->sort;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->media_list = _sort_list(m->media_list, m->sort);
+ m->ld = ld;
+
+ m->grid = m_DrawGengrid(layout);
+ if (!m->grid)
+ goto error;
+
+ evas_object_data_set(m->base, LAYOUT_FOLDER_DATA, m);
+
+ elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
+
+ CBaseLayout::Create(layout);
+
+ return true;
+
+error:
+ _ERR("create failed, returning NULL");
+ evas_object_del(layout);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+void CFolderLayout::Destroy(void)
+{
+ ASSERT(m);
+
+ if (m->media_list)
+ eina_list_free(m->media_list);
+
+ evas_object_del(Layout());
+
+ CBaseLayout::Destroy();
+
+ free(m);
+ m = NULL;
+}
+
+void CFolderLayout::t_OnShow(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnShow();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_TRUE);
+ elm_object_part_content_set(m->base, PART_CONTENTAREA, Layout());
+
+ m->layout_2ndview = EINA_FALSE;
+}
+
+void CFolderLayout::t_OnHide(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::t_OnHide();
+
+ elm_object_tree_focus_allow_set(Layout(), EINA_FALSE);
+ elm_object_focus_set(m->grid, EINA_FALSE);
+
+ elm_object_part_content_unset(m->base, PART_CONTENTAREA);
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <app.h>
+#include "util.h"
+#include "menudef.h"
+#include "timeout_handler.h"
+#include "mediadata.h"
+#include "viewdata.h"
+#include "AppCommon.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "photoviewer_view.h"
+#include "zoom_view.h"
+
+#define BTN_ID "BTN_ID"
+#define SLIDESHOW_BTN_IDX 2
+
+
+double slideshow_timeout[] = {
+ TIMEOUT_SLIDESHOW_NORMAL,
+ TIMEOUT_SLIDESHOW_SLOW,
+ TIMEOUT_SLIDESHOW_FAST
+};
+
+enum _slideshow_state {
+ STATE_PAUSE = 0,
+ STATE_PLAY
+};
+
+enum _slideshow_speed {
+ SETTING_SPEED_NORMAL = 0,
+ SETTING_SPEED_SLOW,
+ SETTING_SPEED_FAST
+};
+
+enum _cur_ctxpopup {
+ CTXPOPUP_NONE = 0,
+ CTXPOPUP_ZOOM,
+ CTXPOPUP_SPEED,
+};
+
+
+struct SPhotoViewerView {
+ Evas_Object *win;
+ Evas_Object *base;
+
+ Evas_Object *btn[MAX_PHOTO_ICONS];
+ Evas_Object *focusedbtn;
+
+ struct view_data *vd;
+
+ int totalcount;
+
+ Evas_Object *photocam;
+ Ecore_Timer *tooltip_timer;
+
+ CTimeoutHandler cTimeoutHandler;
+
+ Ecore_Timer *slideshow_timer;
+ int slideshow_state;
+ int slideshow_speed;
+
+ Ecore_Timer *focus_timer;
+
+ Evas_Object *ctxpopup;
+ int cur_ctxpopup;
+
+ SPhotoViewerView() {
+ win = NULL;
+ base = NULL;
+
+ focusedbtn = NULL;
+ vd = NULL;
+
+ totalcount = 0;
+
+ photocam = NULL;
+ tooltip_timer = NULL;
+
+ slideshow_timer = NULL;
+ slideshow_state = 0;
+ slideshow_speed = 0;
+
+ focus_timer = NULL;
+
+ ctxpopup = NULL;
+ cur_ctxpopup = 0;
+
+ //pHandlerCtxPopup = new CHandlerCtxPopup(this);
+ int a;
+ for (a = 0; a < MAX_PHOTO_ICONS; a++) {
+ btn[a] = NULL;
+ pHandlerBtn[a] = new CHandlerBtn(this);
+ }
+
+ pHandlerCtxPopup = new CHandlerCtxPopup(this);
+ }
+
+ ~SPhotoViewerView() {
+ int a;
+ for (a = 0; a < MAX_PHOTO_ICONS; a++) {
+ delete pHandlerBtn[a];
+ }
+ delete pHandlerCtxPopup;
+ }
+
+ //evas_object_smart_callback_add(m->btn[i], SIG_CLICKED, _btn_clicked_common, m);
+ //evas_object_smart_callback_add(m->btn[i], SIG_FOCUSED, _photo_btn_focused, m);
+ //evas_object_event_callback_add(m->btn[i], EVAS_CALLBACK_KEY_DOWN, _photo_btn_key_pressed, m);
+ class CHandlerBtn : public CListenerMgr, IMouseMoveListener, IKeyDownListener, IFocusedListener, IMouseClickedListener {
+ private:
+ SPhotoViewerView *m;
+
+ private:
+ static Eina_Bool sm_CbTimerTooltip(void *dt) {
+ CHandlerBtn *root = (CHandlerBtn*)dt;
+
+ Eina_Bool ret = ECORE_CALLBACK_CANCEL;
+
+ if (root)
+ ret = root->OnTimerTooltip();
+
+ return ret;
+ }
+ Eina_Bool OnTimerTooltip(void) {
+ m->tooltip_timer = NULL;
+ elm_object_tooltip_hide(m->focusedbtn);
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ public:
+ CHandlerBtn(SPhotoViewerView *ins) : IMouseMoveListener(this), IKeyDownListener(this), IFocusedListener(this), IMouseClickedListener(this) { m = ins; }
+
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_BACK))
+ CViewMgr::GetInstance()->PopView();
+ else if (!strcmp(ev->keyname, KEY_MENU))
+ CViewMgr::GetInstance()->PushView(VIEW_CTXT_MENU, m->vd);
+ }
+ virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item) {
+ if (m->focusedbtn != obj) {
+
+ if (m->focusedbtn)
+ elm_object_tooltip_hide(m->focusedbtn);
+
+ elm_object_tooltip_show(obj);
+
+ m->focusedbtn = obj;
+ }
+
+ if (m->tooltip_timer)
+ ecore_timer_reset(m->tooltip_timer);
+ else {
+ m->tooltip_timer = ecore_timer_add(TIMEOUT_TOOLTIP, sm_CbTimerTooltip, this);
+ }
+ }
+ virtual void OnMouseClicked(int id, Evas_Object *obj) {
+ elm_object_signal_emit(obj, "mouse,anim,start", "");
+ }
+ } *pHandlerBtn[MAX_PHOTO_ICONS];
+
+ class CHandlerCtxPopup : public CListenerMgr, IMouseMoveListener, IMouseClickedListener, IKeyDownListener {
+ private:
+ SPhotoViewerView *m;
+
+ public:
+ void HandleZoomFunction(struct SPhotoViewerView *vdata, const char *btn_id)
+ {
+ int i;
+ struct zoom_data *zd;
+ int zoom_level;
+
+ if (!vdata || !btn_id)
+ return;
+
+ zoom_level = 0;
+
+ for (i = 0; i < MAX_ZOOM_BTNS; i++) {
+ if (!strcmp(btn_id, zoom_text[i])) {
+ zoom_level = i;
+ break;
+ }
+ }
+
+ DestroyCtxpopup();
+
+ switch (zoom_level) {
+
+ case E_ZOOM_X2:
+ case E_ZOOM_X4:
+ zd = (struct zoom_data *)calloc(1, sizeof(*zd));
+ if (!zd)
+ return;
+ zd->md = vdata->vd->md;
+ zd->zoom_level = zoom_level;
+ if (!CViewMgr::GetInstance()->PushView(VIEW_PHOTO_ZOOM, zd))
+ _ERR("VIEW_PHOTO_ZOOM view create failed");
+ break;
+
+ case E_ZOOM_ORIGINAL:
+ default:
+ break;
+ }
+ }
+
+ void HandleSpeedFunction(struct SPhotoViewerView *vdata, const char *btn_id)
+ {
+ int i;
+
+ if (!vdata || !btn_id)
+ return;
+
+ for (i = 0; i < MAX_SPEED_BTNS; i++) {
+ if (!strcmp(btn_id, speed_text[i])) {
+ vdata->slideshow_speed = i;
+ break;
+ }
+ }
+
+ if (vdata->slideshow_timer) {
+ ecore_timer_interval_set(vdata->slideshow_timer,
+ slideshow_timeout[vdata->slideshow_speed]);
+ ecore_timer_reset(vdata->slideshow_timer);
+ }
+
+ DestroyCtxpopup();
+ }
+ void DestroyCtxpopup(void)
+ {
+ if (!m->ctxpopup)
+ return;
+
+ evas_object_hide(m->ctxpopup);
+ evas_object_del(m->ctxpopup);
+
+ m->ctxpopup = NULL;
+ m->cur_ctxpopup = CTXPOPUP_NONE;
+
+ elm_object_focus_set(m->focusedbtn, EINA_TRUE);
+ }
+
+ public:
+ CHandlerCtxPopup(SPhotoViewerView *ins) : IMouseMoveListener(this), IMouseClickedListener(this), IKeyDownListener(this) { m = ins; }
+
+ virtual void OnMouseClicked(int id, Evas_Object *obj) {
+ const char *btn_id;
+
+ btn_id = (const char *)evas_object_data_get(obj, BTN_ID);
+
+ switch (m->cur_ctxpopup) {
+ case CTXPOPUP_ZOOM:
+ HandleZoomFunction(m, btn_id);
+ break;
+ case CTXPOPUP_SPEED:
+ HandleSpeedFunction(m, btn_id);
+ break;
+ default:
+ break;
+ }
+ }
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_BACK))
+ DestroyCtxpopup();
+ }
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ }
+ } *pHandlerCtxPopup;
+
+};
+
+
+void CPhotoViewerView::sm_CbPrevBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView* root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnPrevBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnPrevBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ Eina_List *current_list, *prev_list;
+ struct mediadata *md;
+
+ if (!m->vd)
+ return;
+
+ current_list = eina_list_data_find_list(m->vd->media_list,
+ m->vd->md);
+ if (!current_list)
+ return;
+
+ /* if first photo, show last photo */
+ prev_list = eina_list_prev(current_list);
+ if (!prev_list)
+ prev_list = eina_list_last(m->vd->media_list);
+
+ md = (struct mediadata *)eina_list_data_get(prev_list);
+
+ if (!m_DrawContentArea(md))
+ return;
+
+ if (!m_DrawTopArea(md))
+ return;
+
+ m->vd->md = md;
+}
+
+
+void CPhotoViewerView::sm_CbNextBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView* root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnNextBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnNextBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ Eina_List *current_list, *next_list;
+ struct mediadata *md;
+
+ if (!m->vd)
+ return;
+
+ current_list = eina_list_data_find_list(m->vd->media_list,
+ m->vd->md);
+ if (!current_list)
+ return;
+
+ /* if last photo, show first photo */
+ next_list = eina_list_next(current_list);
+ if (!next_list)
+ next_list = m->vd->media_list;
+
+ md = (struct mediadata *)eina_list_data_get(next_list);
+
+ if (!m_DrawContentArea(md))
+ return;
+
+ if (!m_DrawTopArea(md))
+ return;
+
+ m->vd->md = md;
+}
+
+
+
+void CPhotoViewerView::sm_CbSlideshowBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView* root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnSlideshowBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnSlideshowBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ if (m->slideshow_state == STATE_PAUSE) {
+ if (m->slideshow_timer)
+ ecore_timer_reset(m->slideshow_timer);
+ else {
+ m->slideshow_timer = ecore_timer_add(slideshow_timeout[m->slideshow_speed], sm_CbTimerSlideshow, this);
+ }
+ m->slideshow_state = STATE_PLAY;
+ }
+ else {
+
+ if (m->slideshow_timer) {
+ ecore_timer_del(m->slideshow_timer);
+ m->slideshow_timer = NULL;
+ }
+ m->slideshow_state = STATE_PAUSE;
+ }
+}
+
+
+void CPhotoViewerView::sm_CbSettingBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView *root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnSettingBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnSettingBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ elm_object_signal_emit(obj,
+ "elm,action,highlight", "elm");
+
+ m_DrawCtxpopup(speed_text, MAX_SPEED_BTNS, STYLE_BTN_SHORTTEXT, m->slideshow_speed, POSITION_SETTING_POPUP_X, POSITION_SETTING_POPUP_Y);
+
+ m->cur_ctxpopup = CTXPOPUP_SPEED;
+}
+
+
+void CPhotoViewerView::sm_CbZoomBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView *root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnZoomBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnZoomBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ elm_object_signal_emit(obj,
+ "elm,action,highlight", "elm");
+
+ m_DrawCtxpopup(zoom_text, MAX_ZOOM_BTNS, STYLE_BTN_SHORTTEXT, E_ZOOM_ORIGINAL, POSITION_ZOOM_POPUP_X, POSITION_ZOOM_POPUP_Y);
+
+ m->cur_ctxpopup = CTXPOPUP_ZOOM;
+}
+
+
+void CPhotoViewerView::sm_CbRotateBtnClicked(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView *root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnRotateBtnClicked(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnRotateBtnClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ Evas_Object *image;
+ Evas_Object *internalimage;
+ const char *file_path;
+ int w, h;
+
+ if (!m->vd || !m->vd->md)
+ return;
+
+ file_path = mediadata_get_filepath(m->vd->md);
+ if (!file_path)
+ return;
+
+ image = elm_image_add(m->base);
+ if (!image)
+ return;
+
+ elm_image_file_set(image, file_path, NULL);
+
+ elm_image_object_size_get(image, &w, &h);
+
+ /* return temporarily to prevent crash
+ texture size is 4096 */
+ if (w >= 4096 || h >= 4096) {
+ _ERR("Rotation failed");
+ return;
+ }
+
+ elm_image_orient_set(image, (Elm_Image_Orient)1);
+
+ internalimage = elm_image_object_get(image);
+ if (!internalimage)
+ return;
+
+ evas_object_image_save(internalimage, file_path,
+ NULL, "quality=100");
+
+ mediadata_update_to_db(m->vd->md);
+
+ m_DrawContentArea(m->vd->md);
+ m_DrawTopArea(m->vd->md);
+
+ if (image)
+ evas_object_del(image);
+}
+
+void CPhotoViewerView::m_DrawCtxpopup(const char **text_arr, int size_arr, const char *style, int selected_index, int position_x, int position_y)
+{
+ Evas_Object *ctxpopup, *box, *btn;
+ Evas_Object *firstbtn = NULL;
+ int i;
+
+ ctxpopup = elm_ctxpopup_add(m->base);
+ if (!ctxpopup)
+ return;
+
+ box = elm_box_add(ctxpopup);
+ if (!box) {
+ evas_object_del(ctxpopup);
+ return;
+ }
+
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
+
+ for (i = 0; i < size_arr; i++) {
+ btn = elm_button_add(box);
+ if (!btn) {
+ evas_object_del(ctxpopup);
+ return;
+ }
+ elm_object_style_set(btn, style);
+ elm_object_text_set(btn, _(text_arr[i]));
+ evas_object_data_set(btn, BTN_ID, text_arr[i]);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ if (i == 0)
+ firstbtn = btn; /* to set focus later */
+
+ /* TODO: Need to highlight current selected item */
+ if (i == selected_index)
+ elm_object_signal_emit(btn, "elm,action,highlight", "elm");
+
+ if (i == size_arr - 1) {
+ elm_object_signal_emit(btn, "elm,action,hideline", "elm");
+ }
+ m->pHandlerCtxPopup->Connect(btn);
+ //((IMouseClickedListener*)m->pHandlerCtxPopup)->Connect(btn); // evas_object_smart_callback_add(btn, SIG_CLICKED, _ctxpopup_btn_clicked, m);
+ //((IMouseMoveListener*)m->pHandlerCtxPopup)->Connect(btn); // evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_MOVE, _photo_btn_mousemove, m);
+ //((IKeyDownListener*)m->pHandlerCtxPopup)->Connect(btn); // evas_object_event_callback_add(btn, EVAS_CALLBACK_KEY_DOWN, _ctxpopup_btn_key_pressed, m);
+ }
+ evas_object_show(box);
+
+ elm_object_style_set(ctxpopup, STYLE_CTXPOPUP_VIEWER);
+ elm_object_content_set(ctxpopup, box);
+
+ evas_object_move(ctxpopup,
+ position_x * elm_config_scale_get(),
+ position_y * elm_config_scale_get());
+ evas_object_show(ctxpopup);
+
+ m->ctxpopup = ctxpopup;
+
+ if (firstbtn)
+ elm_object_focus_set(firstbtn, EINA_TRUE);
+}
+
+bool CPhotoViewerView::m_DrawContentArea(struct mediadata *md)
+{
+ const char *file_path;
+ int width, height;
+
+ if (!m->base || !md)
+ return false;
+
+ file_path = mediadata_get_filepath(md);
+ if (!file_path)
+ return false;
+
+ if (m->photocam)
+ evas_object_del(m->photocam);
+
+ m->photocam = elm_photocam_add(m->base);
+ if (!m->photocam)
+ return false;
+
+ elm_photocam_file_set(m->photocam, file_path);
+ elm_photocam_image_size_get(m->photocam, &width, &height);
+ if (height > width)
+ elm_photocam_zoom_mode_set(m->photocam,
+ ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
+ else
+ elm_photocam_zoom_mode_set(m->photocam,
+ ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL);
+ elm_object_focus_allow_set(m->photocam, EINA_FALSE);
+ elm_scroller_policy_set(m->photocam,
+ ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO);
+ elm_object_part_content_set(m->base, PART_CONTENTAREA, m->photocam);
+
+ return true;
+}
+
+
+bool CPhotoViewerView::m_DrawTopArea(struct mediadata *md)
+{
+ const char *display_name;
+ char buf[20];
+ time_t created_time;
+ int width, height;
+ int source;
+ struct tm tm;
+
+ if (!m->base)
+ return false;
+
+ display_name = mediadata_get_displayname(md);
+ if (!display_name)
+ return false;
+
+ elm_object_part_text_set(m->base, PART_TITLETEXT, display_name);
+
+ created_time = mediadata_get_createdtime(md);
+ if (created_time > 0) {
+ localtime_r(&created_time, &tm);
+ strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+ } else
+ snprintf(buf, sizeof(buf), "%s", _(TEXT_NODATE));
+
+ elm_object_part_text_set(m->base, PART_DATETEXT, buf);
+
+ elm_photocam_image_size_get(m->photocam, &width, &height);
+ snprintf(buf, sizeof(buf), "%d x %d", width, height);
+ elm_object_part_text_set(m->base, PART_RESOLUTIONTEXT, buf);
+
+ source = mediadata_get_source(md);
+ if (source == E_SOURCE_TV) {
+ elm_object_part_text_set(m->base, PART_SOURCETEXT, _("TV"));
+ } else {
+ elm_object_part_text_set(m->base, PART_SOURCETEXT, _("USB"));
+ }
+
+ snprintf(buf, sizeof(buf), "/%d", m->totalcount);
+ elm_object_part_text_set(m->base, PART_COUNTTEXT, buf);
+
+ snprintf(buf, sizeof(buf), "%d", util_eina_list_get_index( m->vd->media_list, md) + 1);
+ elm_object_part_text_set(m->base, PART_CURRENTTEXT, buf);
+
+ return true;
+}
+
+
+Eina_Bool CPhotoViewerView::sm_CbTimerSlideshow(void *dt)
+{
+ sm_CbNextBtnClicked(dt, NULL, NULL, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+
+Evas_Object *CPhotoViewerView::m_AddTooltipBtn(Evas_Object *parent, const char *style_text, const char *tt_text)
+{
+ Evas_Object *btn;
+ if (!parent)
+ return NULL;
+
+ btn = elm_button_add(parent);
+ if (!btn)
+ return NULL;
+
+ elm_object_style_set(btn, style_text);
+ elm_object_tooltip_text_set(btn, tt_text);
+ elm_object_tooltip_style_set(btn, STYLE_TOOLTIP);
+ elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_TOP);
+
+ evas_object_show(btn);
+
+ return btn;
+}
+
+
+bool CPhotoViewerView::m_DrawBottomArea(void)
+{
+ int i, j;
+ char buf[32];
+ Edje_Signal_Cb _edje_callback_function[] = {
+ sm_CbPrevBtnClicked,
+ sm_CbNextBtnClicked,
+ sm_CbSlideshowBtnClicked,
+ sm_CbSettingBtnClicked,
+ sm_CbZoomBtnClicked,
+ sm_CbRotateBtnClicked,
+ };
+ static const char * const _source_name[] = {
+ "prev",
+ "next",
+ "slideshow",
+ "setting",
+ "zoom",
+ "rotate"
+ };
+
+ if (!m->base)
+ return false;
+
+ for (i = 0; i < MAX_PHOTO_ICONS; i++) {
+ m->btn[i] = m_AddTooltipBtn(m->base, photo_icon_style[i], _(tooltip_text[i]));
+ if (!m->btn[i]) {
+ for (j = 0; j < i; j++)
+ m->btn[j] = NULL;
+ return false;
+ }
+
+ snprintf(buf, sizeof(buf), "part_btn%d", i);
+ elm_object_part_content_set(m->base,
+ buf, m->btn[i]);
+
+ elm_object_signal_callback_add(m->btn[i], "btn,anim,finish", _source_name[i], _edje_callback_function[i], this);
+ m->pHandlerBtn[i]->Connect(m->btn[i]);
+ //((IMouseClickedListener*)m->pHandlerBtn[i])->Connect(m->btn[i]); // evas_object_smart_callback_add(m->btn[i], SIG_CLICKED, _btn_clicked_common, m);
+ //((IFocusedListener*)m->pHandlerBtn[i])->Connect(m->btn[i]); // evas_object_smart_callback_add(m->btn[i], SIG_FOCUSED, _photo_btn_focused, m);
+ //((IKeyDownListener*)m->pHandlerBtn[i])->Connect(m->btn[i]); // evas_object_event_callback_add(m->btn[i], EVAS_CALLBACK_KEY_DOWN, _photo_btn_key_pressed, m);
+ //((IMouseMoveListener*)m->pHandlerBtn[i])->Connect(m->btn[i]); // evas_object_event_callback_add(m->btn[i], EVAS_CALLBACK_MOUSE_MOVE, _photo_btn_mousemove, m);
+
+ elm_object_focus_next_object_set(m->btn[i], m->btn[i], ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->btn[i], m->btn[i], ELM_FOCUS_DOWN);
+ }
+
+ util_ui_set_focus_directions(m->btn,
+ MAX_PHOTO_ICONS, EINA_TRUE);
+
+ m->slideshow_state = STATE_PAUSE;
+ m->slideshow_speed = SETTING_SPEED_NORMAL;
+ m->ctxpopup = NULL;
+
+ return true;
+}
+
+void CPhotoViewerView::sm_CbShowViewFinish(void *dt, Evas_Object *obj, const char *emission, const char *source)
+{
+ CPhotoViewerView *root = (CPhotoViewerView*)dt;
+
+ if (root)
+ root->m_OnShowViewFinish(obj, emission, source);
+}
+
+
+void CPhotoViewerView::m_OnShowViewFinish(Evas_Object *obj, const char *emission, const char *source)
+{
+ int i;
+
+ for (i = 0; i < MAX_PHOTO_ICONS; i++)
+ evas_object_freeze_events_set(m->btn[i], EINA_FALSE);
+}
+
+
+bool CPhotoViewerView::m_DrawItems(void)
+{
+ if (!m->vd)
+ return false;
+
+ if (!m_DrawContentArea(m->vd->md))
+ return false;
+
+ if (!m_DrawTopArea(m->vd->md))
+ return false;
+
+ if (!m_DrawBottomArea())
+ return false;
+
+ if (!m->cTimeoutHandler.Create(TIMEOUT_PHOTOVIEWER, this))
+ return false;
+
+ return true;
+}
+
+
+Eina_Bool CPhotoViewerView::sm_CbFocus(void *dt)
+{
+ CPhotoViewerView *root = (CPhotoViewerView*)dt;
+
+ Eina_Bool ret = ECORE_CALLBACK_CANCEL;
+
+ if (root)
+ ret = root->OnFocus();
+
+ return ret;
+}
+
+
+Eina_Bool CPhotoViewerView::OnFocus(void)
+{
+ /* set focus on Next button in photo viewer */
+ elm_object_focus_set(m->btn[1], EINA_TRUE);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+bool CPhotoViewerView::Create(void *data)
+{
+ ASSERT(!m);
+
+ Evas_Object *win;
+
+ win = CViewMgr::GetInstance()->Window();
+ ASSERT(win);
+
+ m = new SPhotoViewerView;
+ if (!m)
+ return false;
+ m->base = elm_layout_add(win);
+ if (!m->base) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+ if (!elm_layout_file_set(m->base, EDJEFILE, GRP_PHOTO_VIEWER))
+ goto error;
+
+ m->win = win;
+ m->vd = (struct view_data *)data;
+ m->totalcount = eina_list_count(m->vd->media_list);
+
+ if (!m_DrawItems())
+ goto error;
+
+ elm_object_signal_callback_add(m->base, SIG_SHOW_FINISH, "", sm_CbShowViewFinish, this);
+
+ /* temp hot fix */
+ m->focus_timer = ecore_timer_add(0.25, sm_CbFocus, this);
+
+ CBaseView::Create(NULL);
+
+ return true;
+
+error:
+ _ERR("error in creating layout");
+ evas_object_del(m->base);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+void CPhotoViewerView::Destroy()
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+
+ m->cTimeoutHandler.Destroy();
+
+ if (m->tooltip_timer)
+ ecore_timer_del(m->tooltip_timer);
+
+ if (m->slideshow_timer)
+ ecore_timer_del(m->slideshow_timer);
+
+ if (m->focus_timer)
+ ecore_timer_del(m->focus_timer);
+
+ eina_list_free(m->vd->media_list);
+ free(m->vd);
+
+ evas_object_del(m->base);
+
+ delete m;
+ m = NULL;
+}
+
+Evas_Object* CPhotoViewerView::Base(void)
+{
+ ASSERT(m);
+
+ return m->base;
+}
+
+void CPhotoViewerView::t_OnShow(void)
+{
+ ASSERT(m);
+
+ evas_object_show(m->base);
+}
+
+void CPhotoViewerView::t_OnHide(void)
+{
+ ASSERT(m);
+
+ evas_object_hide(m->base);
+}
+
+
+void CPhotoViewerView::t_OnPause(void)
+{
+ ASSERT(m);
+
+ if (m->slideshow_timer)
+ ecore_timer_freeze(m->slideshow_timer);
+
+ m->cTimeoutHandler.Pause();
+}
+
+void CPhotoViewerView::t_OnResume(void)
+{
+ ASSERT(m);
+
+ if (m->slideshow_timer)
+ ecore_timer_thaw(m->slideshow_timer);
+
+ m->cTimeoutHandler.Resume();
+
+ elm_object_focus_set(m->focusedbtn, EINA_TRUE);
+}
+
+
+void CPhotoViewerView::OnTimeout(void)
+{
+ int i;
+
+ m->pHandlerCtxPopup->DestroyCtxpopup();
+
+ elm_object_signal_emit(m->base, SIG_HIDE, "");
+
+ for (i = 0; i < MAX_PHOTO_ICONS; i++)
+ evas_object_freeze_events_set(m->btn[i], EINA_TRUE);
+}
+
+
+Eina_Bool CPhotoViewerView::OnEvent(int type, void *event_info)
+{
+ if (!event_info)
+ return EINA_FALSE;
+
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
+
+ if (type == ECORE_EVENT_KEY_UP) {
+ if (!strcmp(ev->keyname, KEY_LEFT)) {
+ sm_CbPrevBtnClicked(this, NULL, NULL, NULL);
+ return EINA_FALSE;
+ }
+ else if (!strcmp(ev->keyname, KEY_RIGHT)) {
+ sm_CbNextBtnClicked(this, NULL, NULL, NULL);
+ return EINA_FALSE;
+ }
+ else if (!strcmp(ev->keyname, KEY_ENTER)) {
+ if (m->slideshow_state == STATE_PLAY)
+ return EINA_FALSE;
+
+ elm_object_signal_emit(m->base, SIG_SHOW, "");
+ }
+ else if (!strcmp(ev->keyname, KEY_BACK)) {
+ if (m->slideshow_state == STATE_PLAY)
+ m->pHandlerBtn[SLIDESHOW_BTN_IDX]->OnMouseClicked(0, m->btn[SLIDESHOW_BTN_IDX]); //_btn_clicked_common(m, m->btn[SLIDESHOW_BTN_IDX], NULL);
+
+ elm_object_signal_emit(m->base, SIG_SHOW, "");
+
+ }
+ else if (!strcmp(ev->keyname, KEY_MENU)) {
+ CViewMgr::GetInstance()->PushView(VIEW_CTXT_MENU, m->vd);
+ return EINA_FALSE;
+ }
+ else
+ return EINA_FALSE;
+ }
+ else {
+ if (m->slideshow_state == STATE_PLAY)
+ m->pHandlerBtn[SLIDESHOW_BTN_IDX]->OnMouseClicked(0, m->btn[SLIDESHOW_BTN_IDX]); //_btn_clicked_common(m, m->btn[SLIDESHOW_BTN_IDX], NULL);
+
+ elm_object_signal_emit(m->base, SIG_SHOW, "");
+ }
+
+ return EINA_TRUE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include "util.h"
+#include "menudef.h"
+
+#include "timeout_handler.h"
+#include "mediadata.h"
+#include "AppCommon.h"
+#include "BaseView.h"
+#include "ViewMgr.h"
+#include "zoom_view.h"
+
+#define ZOOM_VALUE_X2 0.5
+#define ZOOM_VALUE_X4 0.25
+
+#define PHOTOCAM_MOVE_SIZE 10
+#define BORDER_SIZE 3
+#define RECT_BORDER_SIZE 5
+
+#define IMAGE_UPARROW IMAGEDIR"/ico_photozoom_arrow_up.png"
+#define IMAGE_DOWNARROW IMAGEDIR"/ico_photozoom_arrow_down.png"
+#define IMAGE_LEFTARROW IMAGEDIR"/ico_photozoom_arrow_left.png"
+#define IMAGE_RIGHTARROW IMAGEDIR"/ico_photozoom_arrow_right.png"
+
+#define IMAGE_ZOOM_NAVI_RECT IMAGEDIR"/zoom_navigator.png"
+#define IMAGE_ZOOM_NAVI_IMG_BORDER IMAGEDIR"/zoom_navigator_border.png"
+
+
+struct SPhotoZoomView {
+ Evas_Object *eoWin;
+ Evas_Object *eoBase;
+
+ Evas_Object *eoPhotocam;
+ Evas_Object *eoPhotocamNavi;
+ double ratio;
+
+ Evas_Object *eoBorder;
+ Evas_Object *eoRect;
+ Eina_Bool updated;
+ Eina_Bool drag;
+
+ CTimeoutHandler cTimeout;
+ Eina_Bool timeout;
+ int prev_event;
+
+ struct zoom_data *data;
+ Ecore_Idler *idler;
+
+ struct SArrow {
+ Evas_Object *eoLeft;
+ Evas_Object *eoRight;
+ Evas_Object *eoUp;
+ Evas_Object *eoDown;
+ } arrow;
+
+ class CHandlerArrow : public CListenerMgr, IMouseClickedListener {
+ private:
+ SPhotoZoomView *m;
+
+ public:
+ CHandlerArrow(SPhotoZoomView *ins) : IMouseClickedListener(this) { m = ins; }
+
+ virtual void OnMouseClicked(int id, Evas_Object *obj) {
+ int x, y, w, h;
+ elm_photocam_image_region_get(m->eoPhotocam, &x, &y, &w, &h);
+
+ if (m->arrow.eoLeft == obj) {
+ elm_photocam_image_region_show(m->eoPhotocam, x - PHOTOCAM_MOVE_SIZE, y, w, h);
+ }
+ else if (m->arrow.eoRight == obj) {
+ elm_photocam_image_region_show(m->eoPhotocam, x + PHOTOCAM_MOVE_SIZE, y, w, h);
+ }
+ else if (m->arrow.eoUp == obj) {
+ elm_photocam_image_region_show(m->eoPhotocam, x, y - PHOTOCAM_MOVE_SIZE, w, h);
+ }
+ else if (m->arrow.eoDown == obj) {
+ elm_photocam_image_region_show(m->eoPhotocam, x, y + PHOTOCAM_MOVE_SIZE, w, h);
+ }
+ }
+ } *pHandlerArrow;
+
+ class CHandlerZoomNavi : public CListenerMgr, IMouseMoveListener, IMouseUpListener, IMouseDownListener {
+ private:
+ SPhotoZoomView *m;
+
+ protected:
+ void t_MoveZoomNavi(Evas_Coord_Point coord)
+ {
+ int x, y, w, h, w2, h2;
+ int xr, yr, xp, yp, wp, hp;
+ int width, height;
+
+ evas_object_geometry_get(m->eoPhotocamNavi, &x, &y, &w, &h);
+ evas_object_geometry_get(m->eoRect, NULL, NULL, &w2, &h2);
+
+ elm_photocam_image_region_get(m->eoPhotocam, NULL, NULL, &wp, &hp);
+ elm_photocam_image_size_get(m->eoPhotocam, &width, &height);
+
+ xr = coord.x - (w2 / 2);
+ yr = coord.y - (h2 / 2);
+
+ if (xr < x)
+ xp = 0;
+ else if (xr > x + w - w2)
+ xp = width - wp;
+ else
+ xp = (xr - x) / m->ratio;
+
+ if (yr < y)
+ yp = 0;
+ else if (yr > y + h - h2)
+ yp = height - h2;
+ else
+ yp = (yr - y) / m->ratio;
+
+ elm_photocam_image_region_show(m->eoPhotocam, xp, yp, wp, hp);
+ }
+
+ public:
+ CHandlerZoomNavi(SPhotoZoomView *ins) : IMouseMoveListener(this),
+ IMouseUpListener(this), IMouseDownListener(this) { m = ins; }
+
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ if (!m->drag)
+ return;
+
+ t_MoveZoomNavi(ev->cur.canvas);
+ }
+ virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev) {
+ m->drag = EINA_FALSE;
+ }
+ virtual void OnMouseDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Down *ev) {
+ t_MoveZoomNavi(ev->canvas);
+
+ m->drag = EINA_TRUE;
+ }
+ } *pHandlerZoomNavi, *pHandlerRect;
+
+
+ SPhotoZoomView() {
+ eoWin = NULL;
+ eoBase = NULL;
+
+ eoPhotocam = NULL;
+ eoPhotocamNavi = NULL;
+ ratio = 0.0;
+
+ eoBorder = NULL;
+ eoRect = NULL;
+ updated = EINA_FALSE;
+ drag = EINA_FALSE;
+
+ timeout = EINA_FALSE;
+ prev_event = 0;;
+
+ data = NULL;
+ idler = NULL;
+ pHandlerArrow = new CHandlerArrow(this);
+ pHandlerZoomNavi = new CHandlerZoomNavi(this);
+ pHandlerRect = new CHandlerZoomNavi(this);
+ }
+ ~SPhotoZoomView() {
+ delete pHandlerArrow;
+ delete pHandlerZoomNavi;
+ delete pHandlerRect;
+ }
+
+};
+
+
+Eina_Bool CPhotoZoomView::sm_CbIdler(void *data)
+{
+ CPhotoZoomView *root = (CPhotoZoomView*)data;
+ Eina_Bool ret = ECORE_CALLBACK_CANCEL;
+
+ if (root)
+ ret = root->m_OnIdler();
+
+ return ret;
+}
+
+
+Eina_Bool CPhotoZoomView::m_OnIdler(void)
+{
+ m->idler = NULL;
+
+ elm_photocam_zoom_mode_set(m->eoPhotocam,
+ ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+ if (m->data->zoom_level == E_ZOOM_X2) {
+ elm_photocam_zoom_set(m->eoPhotocam, ZOOM_VALUE_X2);
+ elm_object_part_text_set(m->eoBase, "part_text", "X2");
+ }
+ else if (m->data->zoom_level == E_ZOOM_X4) {
+ elm_photocam_zoom_set(m->eoPhotocam, ZOOM_VALUE_X4);
+ elm_object_part_text_set(m->eoBase, "part_text", "X4");
+ }
+
+ if (!m_MoveZoomNaviImg())
+ return ECORE_CALLBACK_CANCEL;
+
+ t_GetZoomNaviRatio();
+ m_UpdateArrow();
+ m_UpdateZoomNavi();
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+void CPhotoZoomView::sm_CbContentMoved(void *dt, Evas_Object *obj, void *event_info)
+{
+ CPhotoZoomView *root = (CPhotoZoomView*)dt;
+
+ if (root)
+ root->m_OnContentMoved(obj);
+}
+
+
+void CPhotoZoomView::m_OnContentMoved(Evas_Object *obj)
+{
+ m_UpdateArrow();
+ m_UpdateZoomNavi();
+
+ m->updated = EINA_TRUE;
+}
+
+
+void CPhotoZoomView::m_UpdateArrow(void)
+{
+ int x, y, w, h;
+ int width, height;
+
+ elm_photocam_image_region_get(m->eoPhotocam, &x, &y, &w, &h);
+ elm_photocam_image_size_get(m->eoPhotocam, &width, &height);
+
+ if (x == 0)
+ elm_object_signal_emit(m->eoBase, SIG_LEFTARROW_HIDE, "");
+ else
+ elm_object_signal_emit(m->eoBase, SIG_LEFTARROW_SHOW, "");
+
+ if (x + w >= width - 1)
+ elm_object_signal_emit(m->eoBase, SIG_RIGHTARROW_HIDE, "");
+ else
+ elm_object_signal_emit(m->eoBase, SIG_RIGHTARROW_SHOW, "");
+
+ if (y == 0)
+ elm_object_signal_emit(m->eoBase, SIG_UPARROW_HIDE, "");
+ else
+ elm_object_signal_emit(m->eoBase, SIG_UPARROW_SHOW, "");
+
+ if (y + h >= height - 1)
+ elm_object_signal_emit(m->eoBase, SIG_DOWNARROW_HIDE, "");
+ else
+ elm_object_signal_emit(m->eoBase, SIG_DOWNARROW_SHOW, "");
+}
+
+
+void CPhotoZoomView::m_UpdateZoomNavi(void)
+{
+ int x, y, w, h, x2, y2;
+ int x_new, y_new, w_new, h_new;
+
+ elm_photocam_image_region_get(m->eoPhotocam, &x, &y, &w, &h);
+ evas_object_geometry_get(m->eoPhotocamNavi, &x2, &y2, NULL, NULL);
+
+ x_new = x2 + x * m->ratio;
+ y_new = y2 + y * m->ratio;
+ w_new = w * m->ratio;
+ h_new = h * m->ratio;
+
+ evas_object_resize(m->eoRect, w_new, h_new);
+ evas_object_move(m->eoRect, x_new, y_new);
+}
+
+void CPhotoZoomView::t_GetZoomNaviRatio(void)
+{
+ int width, width_navi;
+
+ elm_photocam_image_size_get(m->eoPhotocam, &width, NULL);
+ evas_object_geometry_get(m->eoPhotocamNavi,
+ NULL, NULL, &width_navi, NULL);
+
+ m->ratio = width_navi / (double)width;
+}
+
+bool CPhotoZoomView::m_MoveZoomNaviImg(void)
+{
+ Evas_Object *img;
+ int x, y, x2, y2, w2, h2;
+ int x_new, y_new;
+
+ evas_object_geometry_get(m->eoPhotocamNavi, &x, &y, NULL, NULL);
+
+ img = elm_photocam_internal_image_get(m->eoPhotocamNavi);
+ if (!img)
+ return false;
+
+ evas_object_geometry_get(img, &x2, &y2, &w2, &h2);
+
+ x_new = x2 + (x2 - x);
+ y_new = y2 + (y2 - y);
+
+ evas_object_resize(m->eoPhotocamNavi, w2, h2);
+ evas_object_move(m->eoPhotocamNavi, x_new, y_new);
+
+ evas_object_resize(m->eoBorder, w2 + BORDER_SIZE * 2, h2 + BORDER_SIZE * 2);
+ evas_object_move(m->eoBorder, x_new - BORDER_SIZE, y_new - BORDER_SIZE);
+
+ return true;
+}
+
+bool CPhotoZoomView::m_DrawArrow(void)
+{
+ m->arrow.eoUp = elm_image_add(m->eoBase);
+ if (!m->arrow.eoUp)
+ return false;
+
+ elm_image_file_set(m->arrow.eoUp, IMAGE_UPARROW, NULL);
+ m->pHandlerArrow->Connect(m->arrow.eoUp); //evas_object_smart_callback_add(m->arrow.eoUp, SIG_CLICKED, _uparrow_clicked, m);
+ elm_object_part_content_set(m->eoBase, PART_UPARROW, m->arrow.eoUp);
+
+ m->arrow.eoDown = elm_image_add(m->eoBase);
+ if (!m->arrow.eoDown)
+ return false;
+
+ elm_image_file_set(m->arrow.eoDown, IMAGE_DOWNARROW, NULL);
+ m->pHandlerArrow->Connect(m->arrow.eoDown); // evas_object_smart_callback_add(m->arrow.eoDown, SIG_CLICKED, _downarrow_clicked, m);
+ elm_object_part_content_set(m->eoBase, PART_DOWNARROW, m->arrow.eoDown);
+
+ m->arrow.eoLeft = elm_image_add(m->eoBase);
+ if (!m->arrow.eoLeft)
+ return false;
+
+ elm_image_file_set(m->arrow.eoLeft, IMAGE_LEFTARROW, NULL);
+ m->pHandlerArrow->Connect(m->arrow.eoLeft); // evas_object_smart_callback_add(m->arrow.eoLeft, SIG_CLICKED, _leftarrow_clicked, m);
+ elm_object_part_content_set(m->eoBase, PART_LEFTARROW, m->arrow.eoLeft);
+
+ m->arrow.eoRight = elm_image_add(m->eoBase);
+ if (!m->arrow.eoRight)
+ return false;
+
+ elm_image_file_set(m->arrow.eoRight, IMAGE_RIGHTARROW, NULL);
+ m->pHandlerArrow->Connect(m->arrow.eoRight); // evas_object_smart_callback_add(m->arrow.eoRight, SIG_CLICKED, _rightarrow_clicked, m);
+ elm_object_part_content_set(m->eoBase, PART_RIGHTARROW, m->arrow.eoRight);
+
+ return true;
+}
+
+
+bool CPhotoZoomView::m_DrawContent(void)
+{
+ const char *file_path;
+
+ if (!m->eoBase || !m->data || !m->data->md)
+ return false;
+
+ file_path = mediadata_get_filepath(m->data->md);
+ if (!file_path)
+ return false;
+
+ m->eoPhotocam = elm_photocam_add(m->eoBase);
+ if (!m->eoPhotocam)
+ return false;
+
+ elm_photocam_file_set(m->eoPhotocam, file_path);
+ elm_photocam_paused_set(m->eoPhotocam, EINA_TRUE);
+
+ elm_scroller_policy_set(m->eoPhotocam, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO);
+
+ evas_object_smart_callback_add(m->eoPhotocam, SIG_SCROLL, sm_CbContentMoved, this);
+
+ elm_object_part_content_set(m->eoBase, PART_CONTENTAREA, m->eoPhotocam);
+
+ if (!m_DrawArrow())
+ return false;
+
+ return true;
+}
+
+void CPhotoZoomView::m_AddMouseEventCallback(void)
+{
+ m->pHandlerZoomNavi->Connect(m->eoPhotocamNavi);
+ //((IMouseMoveListener*)m->pHandlerZoomNavi)->Connect(m->eoPhotocamNavi); // evas_object_event_callback_add(m->eoPhotocamNavi, EVAS_CALLBACK_MOUSE_DOWN, _zoom_navi_mouse_down, m);
+ //((IMouseUpListener*)m->pHandlerZoomNavi)->Connect(m->eoPhotocamNavi); // evas_object_event_callback_add(m->eoPhotocamNavi, EVAS_CALLBACK_MOUSE_UP, _zoom_navi_mouse_up, m);
+ //((IMouseDownListener*)m->pHandlerZoomNavi)->Connect(m->eoPhotocamNavi); // evas_object_event_callback_add(m->eoPhotocamNavi, EVAS_CALLBACK_MOUSE_MOVE, _zoom_navi_mouse_move, m);
+
+ m->pHandlerRect->Connect(m->eoRect);
+ //((IMouseMoveListener*)m->pHandlerRect)->Connect(m->eoRect); // evas_object_event_callback_add(m->eoRect, EVAS_CALLBACK_MOUSE_DOWN, _zoom_navi_mouse_down, m);
+ //((IMouseUpListener*)m->pHandlerRect)->Connect(m->eoRect); // evas_object_event_callback_add(m->eoRect, EVAS_CALLBACK_MOUSE_UP, _zoom_navi_mouse_up, m);
+ //((IMouseDownListener*)m->pHandlerRect)->Connect(m->eoRect); // evas_object_event_callback_add(m->eoRect, EVAS_CALLBACK_MOUSE_MOVE, _zoom_navi_mouse_move, m);
+
+}
+
+bool CPhotoZoomView::m_DrawZoomNavi(void)
+{
+ Evas *evas;
+ Evas_Object *ly;
+ const char *file_path;
+
+ if (!m->data || !m->eoBase || !m->data->md)
+ return false;
+
+ file_path = mediadata_get_filepath(m->data->md);
+ if (!file_path)
+ return false;
+
+ ly = elm_layout_add(m->eoBase);
+ if (!ly)
+ return false;
+
+ elm_object_part_content_set(m->eoBase, PART_ZOOM_NAVI, ly);
+ elm_layout_file_set(ly, EDJEFILE, GRP_ZOOM_NAVI);
+
+ evas = evas_object_evas_get(ly);
+ if (!evas)
+ return false;
+
+ m->eoBorder = evas_object_image_add(evas);
+ if (!m->eoBorder)
+ return false;
+
+ evas_object_image_file_set(m->eoBorder, IMAGE_ZOOM_NAVI_IMG_BORDER, NULL);
+ evas_object_image_filled_set(m->eoBorder, EINA_TRUE);
+
+ evas_object_color_set(m->eoBorder, 255, 255, 255, 196);
+
+ elm_object_part_content_set(ly, PART_ZOOM_NAVI_IMG_BORDER, m->eoBorder);
+
+ m->eoPhotocamNavi = elm_photocam_add(ly);
+ if (!m->eoPhotocamNavi)
+ return false;
+
+ elm_photocam_file_set(m->eoPhotocamNavi, file_path);
+ elm_photocam_paused_set(m->eoPhotocamNavi, EINA_TRUE);
+ elm_photocam_zoom_mode_set(m->eoPhotocamNavi, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
+
+ elm_object_focus_allow_set(m->eoPhotocamNavi, EINA_FALSE);
+
+ elm_object_part_content_set(ly, PART_ZOOM_NAVI_IMG, m->eoPhotocamNavi);
+
+ m->eoRect = evas_object_image_add(evas);
+ if (!m->eoRect)
+ return false;
+
+ evas_object_image_file_set(m->eoRect, IMAGE_ZOOM_NAVI_RECT, NULL);
+ evas_object_image_filled_set(m->eoRect, EINA_TRUE);
+ evas_object_image_border_set(m->eoRect, RECT_BORDER_SIZE, RECT_BORDER_SIZE, RECT_BORDER_SIZE, RECT_BORDER_SIZE);
+ evas_object_image_border_center_fill_set(m->eoRect, EVAS_BORDER_FILL_NONE);
+
+ evas_object_color_set(m->eoRect, 255, 255, 255, 196);
+
+ elm_object_part_content_set(ly, PART_ZOOM_NAVI_RECT, m->eoRect);
+
+ m_AddMouseEventCallback();
+
+ return true;
+}
+
+void CPhotoZoomView::t_OnShow(void)
+{
+ ASSERT(m);
+
+ evas_object_show(m->eoBase);
+
+ elm_object_focus_allow_set(m->eoBase, EINA_TRUE);
+ elm_object_focus_set(m->eoBase, EINA_TRUE);
+}
+
+
+void CPhotoZoomView::t_OnHide(void)
+{
+ ASSERT(m);
+
+ evas_object_hide(m->eoBase);
+}
+
+
+void CPhotoZoomView::t_OnPause(void)
+{
+ ASSERT(m);
+
+ m->cTimeout.Pause();
+}
+
+
+void CPhotoZoomView::t_OnResume(void)
+{
+ ASSERT(m);
+
+ m->cTimeout.Resume();
+}
+
+
+bool CPhotoZoomView::Create(void *data)
+{
+ ASSERT(!m);
+
+ Evas_Object *eoWin;
+ eoWin = CViewMgr::GetInstance()->Window();
+ ASSERT(eoWin);
+
+ m = new SPhotoZoomView;
+ if (!m)
+ return false;
+
+ m->eoBase = elm_layout_add(eoWin);
+ if (!m->eoBase) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ if (!elm_layout_file_set(m->eoBase, EDJEFILE, GRP_ZOOM_VIEW))
+ goto error;
+
+ m->eoWin = eoWin;
+ m->data = (struct zoom_data *)data;
+
+ if (!m_DrawContent())
+ goto error;
+
+ if (!m_DrawZoomNavi())
+ goto error;
+
+ m->idler = ecore_idler_add(sm_CbIdler, this);
+ if (!m->idler)
+ goto error;
+
+ if (!m->cTimeout.Create(TIMEOUT_PHOTOZOOM, this))
+ goto error;
+
+ CListenerMgr::Connect(m->eoBase); //evas_object_event_callback_add(m->eoBase, EVAS_CALLBACK_KEY_DOWN, _base_key_pressed, m);
+ CListenerMgr::Connect(m->eoBase); //evas_object_event_callback_add(m->eoBase, EVAS_CALLBACK_KEY_UP, _base_key_released, m);
+
+ CBaseView::Create(NULL);
+
+ return true;
+
+error:
+ _ERR("error in creating layout");
+ evas_object_del(m->eoBase);
+ delete m;
+ m = NULL;
+
+ return false;
+}
+
+
+void CPhotoZoomView::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+
+ if (m->data)
+ free(m->data);
+
+ ecore_idler_del(m->idler);
+ m->cTimeout.Destroy();
+ evas_object_del(m->eoBase);
+
+ delete m;
+ m = NULL;
+}
+
+
+Evas_Object* CPhotoZoomView::Base(void)
+{
+ ASSERT(m);
+
+ return m->eoBase;
+}
+
+
+void CPhotoZoomView::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+{
+ int height, width;
+
+ if (m->timeout)
+ return;
+
+ m->updated = EINA_FALSE;
+
+ if (!strcmp(ev->keyname, KEY_BACK)) {
+ CViewMgr::GetInstance()->PopView();
+ return;
+ }
+ else if (!strcmp(ev->keyname, KEY_ENTER)) {
+
+ elm_photocam_image_size_get(m->eoPhotocam, &width, &height);
+ if (m->data->zoom_level == E_ZOOM_X2) {
+
+ m->data->zoom_level = E_ZOOM_X4;
+ elm_photocam_zoom_mode_set(m->eoPhotocam,
+ ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+ elm_photocam_zoom_set(m->eoPhotocam, ZOOM_VALUE_X4);
+
+ elm_object_part_text_set(m->eoBase, "part_text", "X4");
+
+ }
+ else if (m->data->zoom_level == E_ZOOM_X4) {
+
+ m->data->zoom_level = E_ZOOM_ORIGINAL;
+ if (height > width)
+ elm_photocam_zoom_mode_set(m->eoPhotocam,
+ ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
+ else
+ elm_photocam_zoom_mode_set(m->eoPhotocam,
+ ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL);
+ elm_object_part_text_set(m->eoBase, "part_text", "Org.");
+
+ }
+ else if (m->data->zoom_level == E_ZOOM_ORIGINAL) {
+
+ m->data->zoom_level = E_ZOOM_X2;
+ elm_photocam_zoom_mode_set(m->eoPhotocam, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+ elm_photocam_zoom_set(m->eoPhotocam, ZOOM_VALUE_X2);
+ elm_object_part_text_set(m->eoBase, "part_text", "X2");
+ }
+ }
+
+ if (m->prev_event == EVAS_CALLBACK_KEY_DOWN)
+ m->cTimeout.Reset();
+
+ m->prev_event = EVAS_CALLBACK_KEY_DOWN;
+}
+
+
+void CPhotoZoomView::OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
+{
+ if (m->updated)
+ return;
+
+ m_UpdateArrow();
+ m_UpdateZoomNavi();
+
+ m->prev_event = EVAS_CALLBACK_KEY_UP;
+}
+
+
+void CPhotoZoomView::OnTimeout(void)
+{
+ elm_object_signal_emit(m->eoBase, SIG_HIDE, "");
+
+ m->timeout = EINA_TRUE;
+
+ evas_object_freeze_events_set(m->eoPhotocam, EINA_TRUE);
+}
+
+
+Eina_Bool CPhotoZoomView::OnEvent(int type, void *event_info)
+{
+ elm_object_signal_emit(m->eoBase, SIG_SHOW, "");
+
+ m->timeout = EINA_FALSE;
+
+ evas_object_freeze_events_set(m->eoPhotocam, EINA_FALSE);
+
+ return EINA_TRUE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <aul.h>
+#include "util.h"
+#include "menudef.h"
+#include "mediadata.h"
+#include "viewdata.h"
+
+#define PLAYLIST_FILE "/tmp/playlist"
+
+static int _create_playlist(Eina_List *list)
+{
+ struct mediadata *md;
+ Eina_List *l;
+ FILE *fp;
+ void *obj;
+
+ if (!list)
+ return -1;
+
+ fp = fopen(PLAYLIST_FILE, "w");
+ if (!fp)
+ return -1;
+
+ EINA_LIST_FOREACH(list, l, obj) {
+ md = (struct mediadata *)obj;
+ fprintf(fp, "%s\n", mediadata_get_filepath(md));
+ }
+
+ fclose(fp);
+
+ return 0;
+}
+
+Eina_Bool video_player_play(void *data)
+{
+ bundle *args;
+ const char *path;
+ struct view_data *vd;
+ int r;
+
+ if (!data)
+ return EINA_FALSE;
+
+ vd = (struct view_data *)data;
+
+ args = bundle_create();
+ if (!args) {
+ _ERR("bundle creation failed");
+ return EINA_FALSE;
+ }
+
+ if (_create_playlist(vd->media_list) != -1)
+ bundle_add(args, ARG_PLAYLIST_ID, PLAYLIST_FILE);
+
+ path = mediadata_get_filepath(vd->md);
+ bundle_add(args, ARG_URI, path);
+
+ r = aul_launch_app(VIDEO_PLAYER_APP, args);
+ if (r < 0) {
+ _ERR("Video player launching failed");
+
+ bundle_free(args);
+
+ eina_list_free(vd->media_list);
+ free(vd);
+
+ return EINA_FALSE;
+ }
+
+ bundle_free(args);
+
+ eina_list_free(vd->media_list);
+ free(vd);
+
+ return EINA_TRUE;
+}