--- /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("file-browser" CXX C)
+
+SET(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
+
+IF(NOT DEFINED PACKAGE_NAME)
+ SET(PACKAGE_NAME "org.tizen.file-browser-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)
+IF(NOT DEFINED LANDSCAPE_ICON)
+ SET(LANDSCAPE_ICON ${PACKAGE_NAME}_4x2.png)
+ENDIF(NOT DEFINED LANDSCAPE_ICON)
+
+SET(SRCS src/main.cpp
+ src/views/FbContextView.cpp
+ src/views/BaseView/Popup.cpp
+ src/views/BaseView/FileGrid.cpp
+ src/views/BaseView/Info.cpp
+ src/views/BaseView/FbBaseView.cpp
+ src/views/BaseView/FbBaseLayout.cpp
+ src/views/BaseView/GengridItemClass.cpp
+ src/views/BaseView/SortCtxPopup.cpp
+ src/views/BaseView/SourceCtxPopup.cpp
+ src/views/Dummy/DummyContent.cpp
+ src/data/Mediadata.cpp
+ src/data/MediadataImpl.cpp
+ src/data/FileInfo.cpp
+ src/data/DirectoryInfo.cpp
+ src/data/FileList.cpp
+ src/device/ManagerUsb.cpp
+)
+
+SET(TARGET_EDJ "${PROJECT_NAME}.edj")
+SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
+
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
+ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(PKGS REQUIRED
+ application-common
+ capi-appfw-application
+ dlog
+ elementary
+ edje
+ utilX
+ capi-content-media-content
+ x11
+ aul
+)
+
+FOREACH(flag ${PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror")
+SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+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(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/icons/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/icons/${LANDSCAPE_ICON} DESTINATION ${DESKTOP_ICONDIR})
+
+#i18n
+ADD_SUBDIRECTORY(po)
+ADD_SUBDIRECTORY(res/edc)
+
--- /dev/null
+Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+ Apache License\r
+ Version 2.0, January 2004\r
+ http://www.apache.org/licenses/\r
+\r
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+ 1. Definitions.\r
+\r
+ "License" shall mean the terms and conditions for use, reproduction,\r
+ and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+ "Licensor" shall mean the copyright owner or entity authorized by\r
+ the copyright owner that is granting the License.\r
+\r
+ "Legal Entity" shall mean the union of the acting entity and all\r
+ other entities that control, are controlled by, or are under common\r
+ control with that entity. For the purposes of this definition,\r
+ "control" means (i) the power, direct or indirect, to cause the\r
+ direction or management of such entity, whether by contract or\r
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+ outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+ "You" (or "Your") shall mean an individual or Legal Entity\r
+ exercising permissions granted by this License.\r
+\r
+ "Source" form shall mean the preferred form for making modifications,\r
+ including but not limited to software source code, documentation\r
+ source, and configuration files.\r
+\r
+ "Object" form shall mean any form resulting from mechanical\r
+ transformation or translation of a Source form, including but\r
+ not limited to compiled object code, generated documentation,\r
+ and conversions to other media types.\r
+\r
+ "Work" shall mean the work of authorship, whether in Source or\r
+ Object form, made available under the License, as indicated by a\r
+ copyright notice that is included in or attached to the work\r
+ (an example is provided in the Appendix below).\r
+\r
+ "Derivative Works" shall mean any work, whether in Source or Object\r
+ form, that is based on (or derived from) the Work and for which the\r
+ editorial revisions, annotations, elaborations, or other modifications\r
+ represent, as a whole, an original work of authorship. For the purposes\r
+ of this License, Derivative Works shall not include works that remain\r
+ separable from, or merely link (or bind by name) to the interfaces of,\r
+ the Work and Derivative Works thereof.\r
+\r
+ "Contribution" shall mean any work of authorship, including\r
+ the original version of the Work and any modifications or additions\r
+ to that Work or Derivative Works thereof, that is intentionally\r
+ submitted to Licensor for inclusion in the Work by the copyright owner\r
+ or by an individual or Legal Entity authorized to submit on behalf of\r
+ the copyright owner. For the purposes of this definition, "submitted"\r
+ means any form of electronic, verbal, or written communication sent\r
+ to the Licensor or its representatives, including but not limited to\r
+ communication on electronic mailing lists, source code control systems,\r
+ and issue tracking systems that are managed by, or on behalf of, the\r
+ Licensor for the purpose of discussing and improving the Work, but\r
+ excluding communication that is conspicuously marked or otherwise\r
+ designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+ "Contributor" shall mean Licensor and any individual or Legal Entity\r
+ on behalf of whom a Contribution has been received by Licensor and\r
+ subsequently incorporated within the Work.\r
+\r
+ 2. Grant of Copyright License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ copyright license to reproduce, prepare Derivative Works of,\r
+ publicly display, publicly perform, sublicense, and distribute the\r
+ Work and such Derivative Works in Source or Object form.\r
+\r
+ 3. Grant of Patent License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ (except as stated in this section) patent license to make, have made,\r
+ use, offer to sell, sell, import, and otherwise transfer the Work,\r
+ where such license applies only to those patent claims licensable\r
+ by such Contributor that are necessarily infringed by their\r
+ Contribution(s) alone or by combination of their Contribution(s)\r
+ with the Work to which such Contribution(s) was submitted. If You\r
+ institute patent litigation against any entity (including a\r
+ cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+ or a Contribution incorporated within the Work constitutes direct\r
+ or contributory patent infringement, then any patent licenses\r
+ granted to You under this License for that Work shall terminate\r
+ as of the date such litigation is filed.\r
+\r
+ 4. Redistribution. You may reproduce and distribute copies of the\r
+ Work or Derivative Works thereof in any medium, with or without\r
+ modifications, and in Source or Object form, provided that You\r
+ meet the following conditions:\r
+\r
+ (a) You must give any other recipients of the Work or\r
+ Derivative Works a copy of this License; and\r
+\r
+ (b) You must cause any modified files to carry prominent notices\r
+ stating that You changed the files; and\r
+\r
+ (c) You must retain, in the Source form of any Derivative Works\r
+ that You distribute, all copyright, patent, trademark, and\r
+ attribution notices from the Source form of the Work,\r
+ excluding those notices that do not pertain to any part of\r
+ the Derivative Works; and\r
+\r
+ (d) If the Work includes a "NOTICE" text file as part of its\r
+ distribution, then any Derivative Works that You distribute must\r
+ include a readable copy of the attribution notices contained\r
+ within such NOTICE file, excluding those notices that do not\r
+ pertain to any part of the Derivative Works, in at least one\r
+ of the following places: within a NOTICE text file distributed\r
+ as part of the Derivative Works; within the Source form or\r
+ documentation, if provided along with the Derivative Works; or,\r
+ within a display generated by the Derivative Works, if and\r
+ wherever such third-party notices normally appear. The contents\r
+ of the NOTICE file are for informational purposes only and\r
+ do not modify the License. You may add Your own attribution\r
+ notices within Derivative Works that You distribute, alongside\r
+ or as an addendum to the NOTICE text from the Work, provided\r
+ that such additional attribution notices cannot be construed\r
+ as modifying the License.\r
+\r
+ You may add Your own copyright statement to Your modifications and\r
+ may provide additional or different license terms and conditions\r
+ for use, reproduction, or distribution of Your modifications, or\r
+ for any such Derivative Works as a whole, provided Your use,\r
+ reproduction, and distribution of the Work otherwise complies with\r
+ the conditions stated in this License.\r
+\r
+ 5. Submission of Contributions. Unless You explicitly state otherwise,\r
+ any Contribution intentionally submitted for inclusion in the Work\r
+ by You to the Licensor shall be under the terms and conditions of\r
+ this License, without any additional terms or conditions.\r
+ Notwithstanding the above, nothing herein shall supersede or modify\r
+ the terms of any separate license agreement you may have executed\r
+ with Licensor regarding such Contributions.\r
+\r
+ 6. Trademarks. This License does not grant permission to use the trade\r
+ names, trademarks, service marks, or product names of the Licensor,\r
+ except as required for reasonable and customary use in describing the\r
+ origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+ 7. Disclaimer of Warranty. Unless required by applicable law or\r
+ agreed to in writing, Licensor provides the Work (and each\r
+ Contributor provides its Contributions) on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+ implied, including, without limitation, any warranties or conditions\r
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+ PARTICULAR PURPOSE. You are solely responsible for determining the\r
+ appropriateness of using or redistributing the Work and assume any\r
+ risks associated with Your exercise of permissions under this License.\r
+\r
+ 8. Limitation of Liability. In no event and under no legal theory,\r
+ whether in tort (including negligence), contract, or otherwise,\r
+ unless required by applicable law (such as deliberate and grossly\r
+ negligent acts) or agreed to in writing, shall any Contributor be\r
+ liable to You for damages, including any direct, indirect, special,\r
+ incidental, or consequential damages of any character arising as a\r
+ result of this License or out of the use or inability to use the\r
+ Work (including but not limited to damages for loss of goodwill,\r
+ work stoppage, computer failure or malfunction, or any and all\r
+ other commercial damages or losses), even if such Contributor\r
+ has been advised of the possibility of such damages.\r
+\r
+ 9. Accepting Warranty or Additional Liability. While redistributing\r
+ the Work or Derivative Works thereof, You may choose to offer,\r
+ and charge a fee for, acceptance of support, warranty, indemnity,\r
+ or other liability obligations and/or rights consistent with this\r
+ License. However, in accepting such obligations, You may act only\r
+ on Your own behalf and on Your sole responsibility, not on behalf\r
+ of any other Contributor, and only if You agree to indemnify,\r
+ defend, and hold each Contributor harmless for any liability\r
+ incurred by, or claims asserted against, such Contributor by reason\r
+ of your accepting any such warranty or additional liability.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ APPENDIX: How to apply the Apache License to your work.\r
+\r
+ To apply the Apache License to your work, attach the following\r
+ boilerplate notice, with the fields enclosed by brackets "[]"\r
+ replaced with your own identifying information. (Don't include\r
+ the brackets!) The text should be enclosed in the appropriate\r
+ comment syntax for the file format. We also recommend that a\r
+ file or class name and description of purpose be included on the\r
+ same "printed page" as the copyright notice for easier\r
+ identification within third-party archives.\r
+\r
+ Copyright [yyyy] [name of copyright owner]\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
--- /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 __DIRECTORY_INFO_H__
+#define __DIRECTORY_INFO_H__
+
+
+#include "ExtNameInfo.h"
+
+
+class CDirectoryInfo : public CExtNameInfo {
+private:
+ struct SDirectoryInfo* m;
+
+public:
+ CDirectoryInfo() : m(0) {}
+ virtual ~CDirectoryInfo() {}
+
+ bool Create(EClassType type = CNameInfo::CLASS_TYPE_DIRECTORY);
+ virtual void Destroy(void);
+
+ bool SetCount(int nCount);
+ int Count(void);
+
+ virtual bool Duplicate(CNameInfo* obj);
+
+ bool SetLoadInfo(filter_h filter, media_folder_h folder);
+ virtual bool Load(void);
+};
+
+
+#endif /* __DIRECTORY_INFO_H__ */
\ No newline at end of file
--- /dev/null
+#ifndef __FBBASE_LAYOUT_H__
+#define __FBBASE_LAYOUT_H__
+
+
+class CFbBaseLayout : public CBaseLayout {
+private:
+ struct SFbBaseLayout *m;
+
+private:
+ static void sm_CbUpdateEmptyFocusSequence(void* cookie);
+ static void sm_CbUpdatedGrid(void* cookie);
+ static void sm_CbUnsetFocus(void* cookie);
+ static void sm_CbLinkApp(void* cookie, int type, int source_type, char *path);
+
+ bool t_CreateFileGrid(Evas_Object *layout);
+ void t_DestroyFileGrid(void);
+
+public:
+ CFbBaseLayout(const char *szLayoutId) : CBaseLayout(szLayoutId), m(0) {}
+ virtual ~CFbBaseLayout() {}
+
+ bool Create(CLayoutMgr *mgr, void *data);
+ virtual void Destroy(void);
+
+ void Update(bool flag);
+
+ void SetFocus(Eina_Bool flag);
+ Evas_Object* Grid(void);
+ void Action(void);
+};
+
+
+#endif /* __FBBASE_LAYOUT_H__ */
\ No newline at end of file
--- /dev/null
+#ifndef __FBBASE_VIEW_H__
+#define __FBBASE_VIEW_H__
+
+
+#include "ManagerUsb.h"
+
+
+class CFbBaseView : public CBaseView, CUsbConnectionListener, CDbUpdateListener {
+private:
+ struct SFbBaseView* m;
+
+public:
+ // For grid
+ void UpdateEmptyFocusSequence(void);
+ void UpdatedGrid(void);
+ void UnsetFocus(void);
+ void CbLinkApp( int type, int source_type, char *path);
+
+protected:
+
+ void t_CreateTopSession(void);
+ void t_CreateLeftSession(void);
+ void t_CreateGridView(void);
+
+ void t_CreateFullView(void);
+
+ void t_SetSelectedGroupButton(Evas_Object* obj);
+ Evas_Object* t_SelectedGroupButton(void);
+
+ virtual void t_OnShow(void);
+ virtual void t_OnUpdate(void *data);
+ virtual void t_OnHide(void);
+
+public:
+ CFbBaseView(const char *szViewId) : CBaseView(szViewId), m(0) {}
+ virtual ~CFbBaseView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+ virtual Evas_Object* Base(void);
+
+public:
+
+ virtual void OnConnect(void);
+ virtual void OnUpdated(const SEntity *entity);
+};
+
+
+#endif /* __FBBASE_VIEW_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 __FBCONTEXT_VIEW_H__
+#define __FBCONTEXT_VIEW_H__
+
+
+class CContextView : public CBaseView {
+private:
+ struct SContextView* m;
+
+ enum content_app_type {
+ APP_LINKED,
+ APP_OTHER,
+ };
+private:
+
+ static void _lbl_start_slide(Evas_Object *lbl);
+ static void _btn_focused(void *data, Evas_Object *obj, void *ev);
+ static void _btn_unfocused(void *data, Evas_Object *obj, void *ev);
+
+ static bool _add_btn_label(Evas_Object *btn, const char *txt);
+ static bool _add_btn_icon(Evas_Object *btn, const char *icon);
+ static bool _add_btn_info(Evas_Object *btn, const char *icon, const char *txt);
+ static Evas_Object *_add_btnbox(Evas_Object *base);
+ static bool _get_context_details(CExtNameInfo *pInfo, char **path, char **title, char *subtitle, char *subtitle2);
+ static Evas_Object *_add_rltv_ctnt(Evas_Object *obj, const char *name, const char *icon);
+ static Evas_Object *_add_scroller(Evas_Object *base);
+ static Evas_Object *_add_table(Evas_Object *base);
+ static Evas_Object *_get_icon(Evas_Object *obj, CExtNameInfo *finfo);
+ static void _set_default_thumb(Evas_Object *img, int type);
+ static Evas_Object *_create_lbl(Evas_Object *ly, char *title);
+
+ void m_SetBtnDownFocus(Evas_Object *btn);
+ void m_SetLayoutFocusOrder(Evas_Object *btn);
+ Evas_Object *m_AddButton(Evas_Object *base);
+ bool m_AddTableContents(Evas_Object *table, Eina_List *list, enum content_app_type type);
+
+ bool m_CreateContentApps(Eina_List *list, enum content_app_type type);
+ bool m_CreateBtnsPart(void);
+ bool m_CreateInfoPart(void);
+ static void sm_CbKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei);
+
+protected:
+ virtual void t_OnShow(void);
+ virtual void t_OnHide(void);
+
+public:
+ CContextView(const char *szViewId) : CBaseView(szViewId), m(0) {}
+ virtual ~CContextView() {}
+
+ virtual bool Create(void *data);
+ virtual void Destroy(void);
+ virtual Evas_Object* Base(void);
+};
+
+
+#endif /*__FBCONTEXT_VIEW_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 __FILE_INFO_H__
+#define __FILE_INFO_H__
+
+
+#include <media_content.h>
+
+
+class CFileInfo : public CExtNameInfo {
+private:
+ struct SFileInfo* m;
+
+public:
+ CFileInfo() : m(0) {}
+ virtual ~CFileInfo() {}
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ virtual bool Duplicate(CNameInfo* obj);
+
+ bool SetLoadInfo(media_info_h handle);
+ virtual bool Load(void);
+};
+
+
+#endif /*__FILE_INFO_H__*/
\ No newline at end of file
--- /dev/null
+#ifndef __MANAGER_USB_H__
+#define __MANAGER_USB_H__
+
+
+class CUsbConnectionListener {
+private:
+ void *m;
+
+public:
+ CUsbConnectionListener() : m(NULL) {}
+ virtual ~CUsbConnectionListener() {}
+ bool FlagCreate(void) { return !!m; }
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ bool FlagConnected(void);
+
+ virtual void OnConnect(void) {}
+};
+
+
+#include <media_content.h>
+
+
+class CDbUpdateListener {
+public:
+ struct SEntity {
+ media_content_error_e err;
+ 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;
+ };
+
+private:
+ void *m;
+
+public:
+ CDbUpdateListener() : m(NULL) {}
+ virtual ~CDbUpdateListener() {}
+ bool FlagCreate(void) { return !!m; }
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ virtual void OnUpdated(const SEntity *entity) = 0;
+};
+
+
+#endif /* __MANAGER_USB_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 __MEDIA_DATA_H__
+#define __MEDIA_DATA_H__
+
+
+class CMediadata {
+private:
+
+ struct SMediadata* m;
+
+public:
+
+ CMediadata() : m(0) {}
+ virtual ~CMediadata() { if (m) Destroy(); }
+ bool FlagCreate(void) { return !!m; }
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ bool GetMediaList(const char* pFolderId, int nMediaType, int nSourceType, Eina_List **ppList);
+ bool GetFolderList(int nMediaType, int nSourceType, Eina_List **ppList);
+};
+
+
+#endif /*__MEDIA_DATA_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 __COMMON_H__
+#define __COMMON_H__
+
+/* Enums */
+
+enum sources {
+ E_ALL,
+ E_TV,
+ E_USB,
+};
+
+enum groups {
+ E_GRP_NONE = -1,
+ E_GRP_ALL,
+ E_GRP_PHOTO,
+ E_GRP_VIDEO,
+ E_GRP_MUSIC,
+ E_GRP_OTHER,
+ E_GRP_FOLDER,
+};
+
+enum update_type {
+ E_USB_CONNECT,
+ E_CONTENT_UPDATE,
+};
+
+#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
+
+#endif /* __COMMON_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 __DBG_H__
+#define __DBG_H__
+
+#include <dlog.h>
+#include <AppCommon.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "file-browser"
+
+#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
+
+/* enums */
+enum music_error_status {
+ FBR_ERROR = -1,
+ FBR_ERROR_NONE
+};
+
+#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.
+ */
+
+#ifndef __DEFINE_H__
+#define __DEFINE_H__
+
+/* LAYOUT */
+#define FB_BASE_LAYOUT "FB_BASE_LAYOUT"
+
+/* TEXT */
+#define NO_FILE_MESSAGE "No File"
+#define NO_FILE_MESSAGE_SUB \
+ "There is no file in selected source"
+#define NO_PHOTO_MESSAGE "No Photo"
+#define NO_PHOTO_MESSAGE_SUB \
+ "There is no photo in selected source"
+#define NO_VIDEO_MESSAGE "No Video"
+#define NO_VIDEO_MESSAGE_SUB \
+ "There is no video in selected source"
+#define NO_MUSIC_MESSAGE "No Music"
+#define NO_MUSIC_MESSAGE_SUB \
+ "There is no music in selected source"
+
+/* FONTS */
+#define FONT_STYLE_REGULAR "TizenSans"
+#define FONT_STYLE_BOLD "TizenSans:style=Bold"
+#define FONT_STYLE_MEDIUM "TizenSans:style=Medium"
+
+/* GENERAL */
+#define MAX_LENGTH 1024
+#define FBR_TEXT_TITLE "FILE BROWSER"
+#define FBR_BTN_ID "FBR_BTN_ID"
+#define FBR_TEXT_LOADING "Updating..."
+#define FBR_TITLE_SLIDE_SPEED (40.0)
+#define RGB_FBR 126 128 255
+#define RGBA_BLACK_BG 0 0 0 (255*0.9)
+#define RGBA_COLOR_BG RGB_FBR (255*0.25)
+
+/* BASE VIEW MACROS */
+#define BASE_VIEW_DATA "BASE_VIEW_DATA"
+#define FBR_BASE_VIEW "FBR_BASE_VIEW"
+#define FBR_PART_MEDIA_GRID "FBR_PART_MEDIA_GRID"
+#define FBR_PART_TITLE "FBR_PART_TITLE"
+#define FBR_PART_FBR_ICON "FBR_PART_FBR_ICON"
+#define FBR_PART_GROUPBTN_BOX "FBR_PART_GROUPBTN_BOX"
+#define FBR_PART_SOURCE_HOVERSEL "FBR_PART_SOURCE_HOVERSEL"
+#define FBR_PART_SORT_HOVERSEL "FBR_PART_SORT_HOVERSEL"
+#define FBR_PART_SORT_POPUP "FBR_PART_SORT_POPUP"
+#define FBR_PART_SOURCE_POPUP "FBR_PART_SOURCE_POPUP"
+#define FBR_PART_ELM_SWALLOWICON "FBR_PART_ELM_SWALLOWICON"
+#define FBR_PART_NO_CONTENT "FBR_PART_NO_CONTENT"
+#define FBR_PART_NO_CONTENT_SUB "FBR_PART_NO_CONTENT_SUB"
+#define FBR_PART_CONTENT "FBR_PART_CONTENT"
+
+#define FBR_CONTEXT_VIEW "FBR_CONTEXT_VIEW"
+#define FBR_CONTEXT_BTN "FBR_CONTEXT_BTN"
+#define FBR_CONTEXT_APP "FBR_CONTEXT_APP"
+#define FBR_IMAGE_CTXT_BG "contextual_menu_bg.png"
+#define FBR_IMAGE_CTXT_ITEM_BG "focused_app_bg.png"
+#define FBR_IMAGE_CTXT_BTNBG_NOR "function_button_nor.png"
+#define FBR_IMAGE_CTXT_BTNBG_FOC "function_button_foc.png"
+#define FBR_IMAGE_CTXT_APPBG "app_ico_bg.png"
+#define FBR_IMAGE_CTXT_OPEN "ico_open.png"
+#define FBR_PART_CTXT_ICON "FBR_PART_CTXT_ICON"
+#define FBR_PART_CTXT_TITLE "FBR_PART_CTXT_TITLE"
+#define FBR_PART_CTXT_SUBTITLE "FBR_PART_CTXT_SUBTITLE"
+#define FBR_PART_CTXT_SUBTITLE2 "FBR_PART_CTXT_SUBTITLE2"
+#define FBR_PART_CTXT_BTNAREA "FBR_PART_CTXT_BTNAREA"
+#define FBR_PART_CTXT_LINK_TEXT "FBR_PART_CTXT_LINK_TEXT"
+#define FBR_PART_CTXT_LINK_AREA "FBR_PART_CTXT_LINK_AREA"
+#define FBR_PART_CTXT_REL_TEXT "FBR_PART_CTXT_REL_TEXT"
+#define FBR_PART_CTXT_REL_AREA "FBR_PART_CTXT_REL_AREA"
+#define FBR_PART_CTXT_BTNICON "FBR_PART_CTXT_BTNICON"
+#define FBR_PART_CTXT_BTNTEXT "FBR_PART_CTXT_BTNTEXT"
+#define FBR_PART_CTXT_BTNBG "FBR_PART_CTXT_BTNBG"
+#define FBR_PART_CTXT_RELCTNT_ICON "FBR_PART_CTXT_RELCTNT_ICON"
+#define FBR_PART_CTXT_RELCTNT_NAME "FBR_PART_CTXT_RELCTNT_NAME"
+#define FBR_DATA_TITLE_WIDTH "FBR_DATA_TITLE_WIDTH"
+
+ /* styles */
+#define FBR_STYLE_GROUPBTN "fbr_menubtn"
+#define FBR_STYLE_WIN_FOCUS "invisible"
+#define FBR_STYLE_MEDIA_GRID "fbr_mediagrid"
+#define FBR_STYLE_THUMB "noframe"
+#define FBR_STYLE_SORT_BTN "fbr_sortbtn"
+#define FBR_STYLE_SOURCE_BTN "fbr_sourcebtn"
+#define FBR_STYLE_HOVER_ENTRY "fbr_hover_entry"
+#define FBR_STYLE_HOVER_CTXPOPUP "fbr_common_popup"
+#define FBR_STYLE_LOADING_POPUP "loading"
+#define FBR_STYLE_LOADING_LABEL "popup/loading"
+#define FBR_STYLE_LABEL "slide_style_36"
+
+/* SIGNAL MACROS */
+#define FBR_SIGNAL_FOCUSED "focused"
+#define FBR_SIGNAL_UNFOCUSED "unfocused"
+#define FBR_SIGNAL_CLICKED "clicked"
+#define FBR_SIGNAL_ACTIVATED "activated"
+#define FBR_SIGNAL_SELECTED "selected"
+#define FBR_SIGNAL_REALIZED "realized"
+#define FBR_SIGNAL_UNREALIZED "unrealized"
+#define FBR_SIGNAL_GROUP_SELECTED "FBR_SIGNAL_GROUP_SELECTED"
+#define FBR_SIGNAL_GROUP_UNSELECTED "FBR_SIGNAL_GROUP_UNSELECTED"
+#define FBR_SIGNAL_CONTENT_CLICKED "FBR_SIGNAL_CONTENT_CLICKED"
+#define FBR_SIGNAL_BTN_CLICKED "FBR_SIGNAL_BTN_CLICKED"
+
+/* IMAGE FILES */
+#define FBR_IMAGE_GRPBTN_ALL "ico_filebrowser_all.png"
+#define FBR_IMAGE_GRPBTN_PHOTO "ico_filebrowser_photo.png"
+#define FBR_IMAGE_GRPBTN_VIDEO "ico_filebrowser_video.png"
+#define FBR_IMAGE_GRPBTN_MUSIC "ico_filebrowser_music.png"
+#define FBR_IMAGE_ICON "ico_filebrowser.png"
+#define FBR_GROUPBTN_BG "allbrowser_menu_bg.png"
+#define FBR_IMAGE_BTN_NORMAL_BG "btn_bg_round_stroke.png"
+#define FBR_IMAGE_BTN_FOCUS_BG "btn_bg_round_72x72.png"
+#define FBR_IMAGE_DEFAULT_MUSIC "ico_default_music_126.png"
+#define FBR_IMAGE_DEFAULT_VIDEO "ico_default_video_126.png"
+#define FBR_IMAGE_DEFAULT_OTHER "ico_default_other_126.png"
+#define FBR_IMAGE_NORMAL_MUSIC "ico_default_music_126_b.png"
+#define FBR_IMAGE_NORMAL_VIDEO "ico_default_video_126_b.png"
+#define FBR_IMAGE_NORMAL_OTHER "ico_default_other_126_b.png"
+#define FBR_IMAGE_PULLDOWN_ARROW "ico_pulldown_nor.png"
+#define FBR_IMAGE_FOLDER "ico_folder.png"
+#define FBR_IMAGE_TICK "ico_check_foc.png"
+#define FBR_IMAGE_ROUND_ICON "round_rectangle_4X4.png"
+#define FBR_IMAGE_LOADING "loading_48_01.png"
+#define FBR_IMAGE_DEFAULT_APP "ico_default.png"
+
+/* SWALLOW ICONS */
+#define FBR_PART_ELM_SWALLOWICON "FBR_PART_ELM_SWALLOWICON"
+#define FBR_POPUP_SWALLOW_ICON "elm.swallow.icon"
+
+/* KEY DEFINES */
+#define KEY_ENTER "Return"
+#define KEY_EXIT "XF86Close"
+
+#endif /* __DEFINE_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 __I18N_H__
+#define __I18N_H__
+
+#include <libintl.h>
+
+#define i18n_init() bindtextdomain(PACKAGE, LOCALEDIR)
+
+#ifdef _
+#undef _
+#endif
+#define _(s) dgettext(PACKAGE, s)
+#define dgettext_noop(s) (s)
+
+#ifdef N_
+#undef N_
+#endif
+#define N_(s) dgettext_noop(s)
+
+#endif /* __I18N_H__ */
--- /dev/null
+<manifest>
+ <define>
+ <domain name="dtv-org.tizen.file-browser-tv-ref"/>
+ <request>
+ <smack request="system::media" type="rwx"/>
+ <smack request="device::app_logging" type="rwx"/>
+ <smack request="ail::db" type="rwx"/>
+ <smack request="system::vconf" type="rwx"/>
+ <smack request="system::homedir" type="rwx"/>
+ <smack request="system::use_internet" type="rwx"/>
+ <smack request="xorg" type="rwx"/>
+ <smack request="isf" type="rwx"/>
+ <smack request="media-data::db" type="rwx"/>
+ </request>
+ </define>
+ <request>
+ <domain name="dtv-org.tizen.file-browser-tv-ref"/>
+ </request>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="@VERSION@" install-location="internal-only">
+ <label>file-browser</label>
+ <author email="g.praveenya@samsung.com" href="www.samsung.com">PRAVEENYA</author>
+ <description>File-browser</description>
+ <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">
+ <label>File Browser</label>
+ <icon>@DESKTOP_ICON@</icon>
+ </ui-application>
+</manifest>
--- /dev/null
+Name: org.tizen.file-browser-tv-ref
+Summary: Open UX file browser application
+Version: 0.2
+Release: 1
+Group: Applications/Core Applications
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(application-common)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(capi-content-media-content)
+BuildRequires: edje-bin
+BuildRequires: gettext-devel
+
+%define _pkgdir /usr/apps/%{name}
+%define _bindir %{_pkgdir}/bin
+%define _resdir %{_pkgdir}/res
+%define _localedir %{_resdir}/locale
+%define _manifestdir /usr/share/packages
+%define _desktop_icondir /usr/share/icons/default/small
+
+%description
+PUT DESCRIPTION HERE
+
+%prep
+%setup -q
+
+%build
+cmake \
+ -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \
+ -DPACKAGE_NAME=%{name} \
+ -DBINDIR=%{_bindir} \
+ -DLOCALEDIR=%{_localedir} \
+ -DMANIFESTDIR=%{_manifestdir} \
+ -DDESKTOP_ICONDIR=%{_desktop_icondir} \
+ -DVERSION=%{version}
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%files
+
+%defattr(-,root,root,-)
+%manifest %{name}.manifest
+%{_bindir}/*
+%{_resdir}/*
+%{_manifestdir}/%{name}.xml
+%{_desktop_icondir}/%{name}.png
+%{_desktop_icondir}/%{name}_4x2.png
--- /dev/null
+# for i18n
+
+SET(POFILES de_DE.po
+ el_GR.po
+ en.po
+ es_ES.po
+ fr_FR.po
+ it_IT.po
+ ja_JP.po
+ ko_KR.po
+ nl_NL.po
+ pt_PT.po
+ ru_RU.po
+ tr_TR.po
+ zh_CN.po
+ zh_HK.po
+ zh_TW.po)
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
--- /dev/null
+# List of source files containing translatable strings.
+src/main.c
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+#!/bin/sh
+
+APPNAME=music-player
+SRCROOT=..
+POTFILES=POTFILES.in
+
+ALL_LINGUAS="de_DE el_GR en es_ES fr_FR it_IT ja_JP ko_KR nl_NL pt_PT ru_RU tr_TR zh_CN zh_HK zh_TW"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${APPNAME}.pot "
+if [ ! -e $POTFILES ] ; then
+ echo "$POTFILES not found"
+ exit 1
+fi
+
+$XGETTEXT --default-domain=${APPNAME} --directory=${SRCROOT} \
+ --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES
+if [ $? -ne 0 ]; then
+ echo "xgettext error"
+ exit 1
+fi
+
+if [ ! -f ${APPNAME}.po ]; then
+ echo "No such file: ${APPNAME}.po"
+ exit 1
+fi
+
+rm -f ${APPNAME}.pot && mv ${APPNAME}.po ${APPNAME}.pot
+echo "done"
+
+for LANG in $ALL_LINGUAS; do
+ echo "$LANG : "
+
+ if [ ! -e $LANG.po ] ; then
+ sed 's/CHARSET/UTF-8/g' ${APPNAME}.pot > ${LANG}.po
+ echo "${LANG}.po created"
+ else
+ if $MSGMERGE ${LANG}.po ${APPNAME}.pot -o ${LANG}.new.po ; then
+ if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+ rm -f ${LANG}.new.po
+ else
+ if mv -f ${LANG}.new.po ${LANG}.po; then
+ echo ""
+ else
+ echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+ rm -f ${LANG}.new.po
+ exit 1
+ fi
+ fi
+ else
+ echo "msgmerge for $LANG failed!"
+ rm -f ${LANG}.new.po
+ fi
+ fi
+ echo ""
+done
+
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-20 17:28+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/main.c:50
+msgid "Hello! Tizen"
+msgstr ""
--- /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/define.h"
+
+collections {
+ #include "widgets/button.edc"
+ #include "widgets/gengrid.edc"
+ #include "widgets/ctxpopup.edc"
+ #include "widgets/label.edc"
+}
--- /dev/null
+#include "../../include/define.h"
+collections {
+ #include "views/common.edc"
+ #include "views/base-view.edc"
+ #include "views/base-layout.edc"
+ #include "views/context-view.edc"
+}
--- /dev/null
+group {
+ name: FB_BASE_LAYOUT;
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ }
+ }
+ PART_RECT_PADDING(padding_grid, 0 0, bg)
+ PART_SWALLOW_BASIC(FBR_PART_MEDIA_GRID, 1395+20 848,
+ padding_grid, 0 0)
+ }
+}
+
+
--- /dev/null
+group {
+ name: FBR_BASE_VIEW;
+ images {
+ image: FBR_IMAGE_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;
+ }
+ }
+
+ PART_RECT_PADDING(padding_icon, 63 78, bg)
+ PART_IMAGE_BASIC(FBR_PART_FBR_ICON, 84 84, padding_icon,
+ 0 0, FBR_IMAGE_ICON)
+
+ PART_RECT_PADDING(padding_titletxt, 63+84+22 78, bg)
+ PART_TEXT_FONT(FBR_PART_TITLE, 870 84, padding_titletxt, 0 0,
+ FONT_STYLE_BOLD, 70, 0 0.5)
+
+ PART_RECT_PADDING(padding_sortlist, 1107+72+20 82, bg)
+ PART_SWALLOW_BASIC(FBR_PART_SORT_HOVERSEL, 290 72,
+ padding_sortlist, 0 0)
+
+ PART_RECT_PADDING(padding_sourcelist, 1199+290+20 82, bg)
+ PART_SWALLOW_BASIC(FBR_PART_SOURCE_HOVERSEL, 290 72,
+ padding_sourcelist, 0 0)
+
+ PART_RECT_PADDING(padding_grpbtn, 0 232, bg)
+ PART_SWALLOW_BASIC(FBR_PART_GROUPBTN_BOX, 406 87*1,
+ padding_grpbtn, 0 0)
+
+ PART_RECT_PADDING(padding_nocontent, 1000 450, bg)
+ PART_TEXT_FONT(FBR_PART_NO_CONTENT, 800 50, padding_nocontent, 0.5 0.5,
+ FONT_STYLE_BOLD, 35, 0.5 0.5)
+
+ PART_RECT_PADDING(padding_nocontent_sub, 1000 450+40, bg)
+ PART_TEXT_FONT_COLOR(FBR_PART_NO_CONTENT_SUB, 800 30, padding_nocontent_sub, 0.5 0.5,
+ FONT_STYLE_BOLD, 24, 0.5 0.5, 255 255 255 102)
+
+ PART_RECT_PADDING(padding_content, 406 232, bg)
+ PART_SWALLOW_BASIC(FBR_PART_CONTENT, 1395+20 848,
+ padding_content, 0 0)
+
+ PART_RECT_PADDING(padding_sortpopup, 1199 155, bg)
+ PART_SWALLOW_BASIC(FBR_PART_SORT_POPUP, 290 720,
+ padding_sortpopup, 0 0)
+
+ PART_RECT_PADDING(padding_sourcepopup, 1509 155, bg)
+ PART_SWALLOW_BASIC(FBR_PART_SOURCE_POPUP, 290 720,
+ padding_sourcepopup, 0 0)
+ }
+}
--- /dev/null
+#define PART_RECT_COLOR(part_name, min_size, relative_name, align_info, clr) \
+ part { \
+ name: part_name; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: relative_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: relative_name; \
+ } \
+ fixed: 1 1; \
+ align: align_info; \
+ color: clr; \
+ } \
+ }
+
+#define PART_RECT_PADDING(part_name, min_size, rltv_name) \
+ part { \
+ name: part_name; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: rltv_name; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ relative: 0.0 0.0; \
+ } \
+ fixed: 1 1; \
+ visible: 0; \
+ align: 0.0 0.0; \
+ } \
+ }
+
+#define PART_RECT_RELATIVE_PADDING(part_name, min_size, rltv_name, rltv_x, rltv_y) \
+ part { \
+ name: part_name; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: rltv_name; \
+ relative: rltv_x rltv_y; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ relative: rltv_x rltv_y; \
+ } \
+ fixed: 1 1; \
+ visible: 0; \
+ align: 0.0 0.0; \
+ } \
+ }
+
+#define PART_SWALLOW_BASIC(part_name, min_size, relative_name, align_info) \
+ part { \
+ name: part_name; \
+ type: SWALLOW; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: relative_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: relative_name; \
+ } \
+ fixed: 1 1; \
+ align: align_info; \
+ } \
+ }
+
+#define PART_SWALLOW_SHOWHIDE(part_name, min_size, relative_name, align_info) \
+ part { \
+ name: part_name; \
+ type: SWALLOW; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: relative_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: relative_name; \
+ } \
+ fixed: 1 1; \
+ align: align_info; \
+ } \
+ description { \
+ state: "hide" 0.0; \
+ inherit: "default" 0.0; \
+ visible: "0"; \
+ }\
+ }
+
+#define PART_IMAGE_BASIC(part_name, min_size, rltv_name, align_info, img_path) \
+ part { \
+ name: part_name; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: rltv_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ } \
+ image { \
+ normal: img_path; \
+ } \
+ fixed: 1 1; \
+ align: align_info; \
+ } \
+ }
+
+#define PART_IMAGE_COLOR(part_name, min_size, rltv_name, align_info, img_path, color_code) \
+ part { \
+ name: part_name; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ rel1 { \
+ to: rltv_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ } \
+ image { \
+ normal: img_path; \
+ } \
+ fixed: 1 1; \
+ align: align_info; \
+ color: color_code; \
+ } \
+ }
+
+#define PART_TEXT_FONT(pname, min_size, rltv_name, palign, fstyle, \
+ fsize, falign) \
+ part { \
+ name: pname; \
+ type: TEXT; \
+ scale: 1; \
+ mouse_events: 0; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ max: min_size; \
+ color: 255 255 255 255; \
+ text { \
+ font: fstyle; \
+ size: fsize; \
+ align: falign; \
+ } \
+ rel1 { \
+ to: rltv_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ } \
+ fixed: 1 1; \
+ align: palign; \
+ } \
+ }
+#define PART_TEXT_FONT_COLOR(pname, min_size, rltv_name, palign, fstyle, \
+ fsize, falign, clr) \
+ part { \
+ name: pname; \
+ type: TEXT; \
+ scale: 1; \
+ mouse_events: 0; \
+ description { \
+ state: "default" 0.0; \
+ min: min_size; \
+ color: clr; \
+ text { \
+ font: fstyle; \
+ size: fsize; \
+ align: falign; \
+ } \
+ rel1 { \
+ to: rltv_name; \
+ relative: 1.0 1.0; \
+ } \
+ rel2 { \
+ to: rltv_name; \
+ } \
+ fixed: 1 1; \
+ align: palign; \
+ } \
+ }
--- /dev/null
+group {
+ name: FBR_CONTEXT_VIEW;
+ images {
+ image: FBR_IMAGE_CTXT_BG COMP;
+ image: FBR_IMAGE_CTXT_ITEM_BG COMP;
+ }
+ data.item: FBR_DATA_TITLE_WIDTH "318";
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ min: 1920 1080;
+ align: 0 0;
+ fixed: 1 1;
+ color: 0 0 0 245;
+ }
+ }
+ part {
+ name: "bg_img";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ image.normal: FBR_IMAGE_CTXT_BG;
+ }
+ }
+
+ PART_RECT_PADDING("pad_icon", 508 375, "bg")
+ PART_IMAGE_COLOR("icon_bg_img", 318 321, "pad_icon", 0 0, FBR_IMAGE_CTXT_ITEM_BG, 126 128 255 255)
+ PART_RECT_COLOR("icon_bg", 318 321, "pad_icon", 0 0, 28 36 49 204)
+ part {
+ name: FBR_PART_CTXT_ICON;
+ scale: 1;
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1.to: "icon_bg";
+ rel2.to: "icon_bg";
+ align: 0.5 0.5;
+ }
+ }
+
+ PART_RECT_PADDING("pad_title", 508+159 375+321+20, "bg")
+ PART_SWALLOW_BASIC(FBR_PART_CTXT_TITLE, 318 0, "pad_title", 0.5 0)
+
+ PART_RECT_PADDING("pad_subtitle", 508 375+321+20+43, "bg")
+ PART_TEXT_FONT(FBR_PART_CTXT_SUBTITLE, 318 31, "pad_subtitle", 0 0, FONT_STYLE_REGULAR, 24, 0 0.5)
+
+ PART_RECT_PADDING("pad_subtitle2", 508 375+321+20+43+31, "bg")
+ PART_TEXT_FONT(FBR_PART_CTXT_SUBTITLE2, 318 31, "pad_subtitle2", 0 0, FONT_STYLE_REGULAR, 24, 0 0.5)
+
+ PART_RECT_PADDING("pad_btnarea", 1334 75, "bg")
+ PART_SWALLOW_BASIC(FBR_PART_CTXT_BTNAREA, 0 115, "pad_btnarea", 0 0)
+
+ PART_RECT_RELATIVE_PADDING("pad_separator", 0 20, FBR_PART_CTXT_BTNAREA, 0, 1)
+ PART_RECT_COLOR("part_separator", 490 2, "pad_separator", 0 0, 255 255 255 51)
+
+ PART_RECT_RELATIVE_PADDING("pad_linkedtext", 16 30, "pad_separator", 0, 1)
+ PART_TEXT_FONT(FBR_PART_CTXT_LINK_TEXT, 458 38, "pad_linkedtext", 0 0, FONT_STYLE_MEDIUM, 27, 0 0)
+
+ PART_RECT_RELATIVE_PADDING("pad_linked", 0 8, FBR_PART_CTXT_LINK_TEXT, 0.5, 1)
+ PART_SWALLOW_BASIC(FBR_PART_CTXT_LINK_AREA, 490 229, "pad_linked", 0.5 0)
+
+ //PART_RECT_RELATIVE_PADDING("pad_reltext", 0 38, FBR_PART_CTXT_LINK_TEXT, 0, 1)
+ PART_RECT_RELATIVE_PADDING("pad_reltext", 16 30, FBR_PART_CTXT_LINK_AREA, 0, 1)
+ PART_TEXT_FONT(FBR_PART_CTXT_REL_TEXT, 458 38, "pad_reltext", 0 0, FONT_STYLE_MEDIUM, 27, 0 0)
+
+ PART_RECT_RELATIVE_PADDING("pad_relctntarea", 0 8, FBR_PART_CTXT_REL_TEXT, 0.5, 1)
+ PART_SWALLOW_BASIC(FBR_PART_CTXT_REL_AREA, 490 472, "pad_relctntarea", 0.5 0)
+
+ }
+}
+
+group {
+ name: FBR_CONTEXT_BTN;
+ images {
+ image: FBR_IMAGE_CTXT_BTNBG_NOR COMP;
+ image: FBR_IMAGE_CTXT_BTNBG_FOC COMP;
+ }
+ parts {
+ part {
+ name: "ctxt_menubtn_area";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 103 115;
+ visible: 0;
+ }
+ }
+ part {
+ name: FBR_PART_CTXT_BTNBG;
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 64 64;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 0.0;
+ image.normal: FBR_IMAGE_CTXT_BTNBG_NOR;
+ color: 100 109 124 255;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ image.normal: FBR_IMAGE_CTXT_BTNBG_FOC;
+ color: 126 128 255 255;
+ }
+ }
+ part {
+ name: FBR_PART_CTXT_BTNICON;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 64 64;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 0.0;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_btn_txt";
+ 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: FBR_PART_CTXT_BTNTEXT;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 103 43;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "padding_btn_txt";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to: "padding_btn_txt";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "focused";
+ signal: FBR_SIGNAL_FOCUSED;
+ source: FBR_CONTEXT_VIEW;
+ action: STATE_SET "focused" 0.0;
+ target: FBR_PART_CTXT_BTNBG;
+ transition: LINEAR 0.3;
+ }
+ program {
+ name: "unfocused";
+ signal: FBR_SIGNAL_UNFOCUSED;
+ source: FBR_CONTEXT_VIEW;
+ action: STATE_SET "default" 0.0;
+ target: FBR_PART_CTXT_BTNBG;
+ transition: LINEAR 0.3;
+ }
+ }
+}
+
+group {
+ name, FBR_CONTEXT_APP;
+ images {
+ image, FBR_IMAGE_CTXT_APPBG COMP;
+ }
+ parts {
+ 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;
+ min, 238 229;
+ color, 42 50 64 255;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ color, 126 128 255 255;
+ map.on: 1;
+ }
+ }
+ part {
+ name, "padding_app_icon";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 0 44;
+ rel1.relative, 0.5 0.0;
+ rel2.relative, 0.5 0.0;
+ align, 0.5 0.0;
+ visible, 0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "icon_bg";
+ type, IMAGE;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 104 104;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding_app_icon";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding_app_icon";
+ }
+ image.normal, FBR_IMAGE_CTXT_APPBG;
+ align, 0.5 0.0;
+ visible, 0;
+ fixed, 1 1;
+ color, 126 128 255 255;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ color, 255 255 255 255;
+ map.on: 1;
+ }
+ }
+ part {
+ name, FBR_PART_CTXT_RELCTNT_ICON;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 104 104;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding_app_icon";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding_app_icon";
+ }
+ align, 0.5 0.0;
+ fixed, 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name, "padding_thumb_txt";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 0 8;
+ rel1 {
+ relative, 0.5 1.0;
+ to, FBR_PART_CTXT_RELCTNT_ICON;
+ }
+ rel2 {
+ relative, 0.5 1.0;
+ to, FBR_PART_CTXT_RELCTNT_ICON;
+ }
+ align, 0.5 0.0;
+ visible, 0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, FBR_PART_CTXT_RELCTNT_NAME;
+ type, TEXT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 198 53;
+ rel1 {
+ relative, 0.0 1.0;
+ to, "padding_thumb_txt";
+ }
+ rel2 {
+ relative, 0.0 1.0;
+ to, "padding_thumb_txt";
+ }
+ text {
+ font, FONT_STYLE_MEDIUM;
+ size, 24;
+ }
+ color, 211 211 211 255;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ color, 255 255 255 255;
+ map.on: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name, "focused";
+ signal, FBR_SIGNAL_FOCUSED;
+ source, FBR_CONTEXT_VIEW;
+ action, STATE_SET "focused" 0.0;
+ target, "bg";
+ target, "icon_bg";
+ target, FBR_PART_CTXT_RELCTNT_NAME;
+ target, FBR_PART_CTXT_RELCTNT_ICON;
+ transition: LINEAR 0.3;
+ }
+ program {
+ name, "unfocused";
+ signal, FBR_SIGNAL_UNFOCUSED;
+ source, FBR_CONTEXT_VIEW;
+ action, STATE_SET "default" 0.0;
+ target, "bg";
+ target, "icon_bg";
+ target, FBR_PART_CTXT_RELCTNT_NAME;
+ target, FBR_PART_CTXT_RELCTNT_ICON;
+ transition: LINEAR 0.3;
+ }
+ program {
+ name: "animaion_start";
+ signal: FBR_SIGNAL_CONTENT_CLICKED;
+ source: FBR_CONTEXT_VIEW;
+ action: STATE_SET "clicked" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "animation_stop";
+ }
+ program {
+ name: "animation_stop";
+ action: STATE_SET "default" 0.0;
+ target: "map";
+ transition: DECELERATE 0.2;
+ after: "item_clicked";
+ }
+ program {
+ name: "item_clicked";
+ action: SIGNAL_EMIT FBR_SIGNAL_BTN_CLICKED FBR_CONTEXT_VIEW;
+ }
+
+ }
+}
--- /dev/null
+#define STATE_NORMAL 0
+#define STATE_HIGHLIGHT 1
+
+group {
+ name: "elm/button/base/fbr_hover_entry";
+ images {
+ image: FBR_IMAGE_TICK COMP;
+ }
+ script {
+ public cur_state;
+ public hide_line;
+ }
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 290 72;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 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: 290 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: 170 80;
+ rel1 {
+ to: "padding_text";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "padding_text";
+ }
+ text {
+ font: FONT_STYLE_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_MEDIUM;
+ }*/
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ /*text {
+ font: FONT_STYLE_MEDIUM;
+ }*/
+ color: 126 128 255 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: "image_part";
+ 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: FBR_IMAGE_TICK;
+ 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;
+ color: 126 128 255 255;
+ 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:"image_part", "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:"image_part", 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: "image_part";
+ 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/fbr_sourcebtn";
+ images {
+ image: FBR_IMAGE_PULLDOWN_ARROW COMP;
+ image: FBR_IMAGE_ROUND_ICON COMP;
+ }
+ script {
+ public cur_state;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 290 72;
+ rel2.relative: 0.0 0.0;
+ image {
+ normal: FBR_IMAGE_ROUND_ICON;
+ border: 4 4 4 4;
+ border_scale: 1;
+ }
+ color: 255 255 255 12;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ }
+ description {
+ state: "selected_0" 0.0;
+ inherit: "selected" 0.0;
+ color: 126 128 255 0;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ 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_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: 126 128 255 255;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 175 175 175 25;
+ }
+ }
+ 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: FBR_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;
+ color: 193 193 193 255;
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "focused" 0.0;
+ }
+ description {
+ state: "mouse_over" 0.0;
+ inherit: "focused" 0.0;
+ }
+ }
+ 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: FBR_IMAGE_PULLDOWN_ARROW;
+ align: 1.0 0.5;
+ fixed: 1 1;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 175 175 175 25;
+ }
+ }
+ }
+ 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);
+ set_state(PART:"elm.text", "selected", 0.0);
+ //run_program(PROGRAM:"focus,anim");
+ }
+ }
+ program {
+ name: "focus,anim";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ target: "elm.text";
+ target: FBR_PART_ELM_SWALLOWICON;
+ 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);
+ set_state(PART:FBR_PART_ELM_SWALLOWICON, "highlight", 0.0);
+ run_program(PROGRAM:"unfocus,high,anim");
+ } else {
+ //run_program(PROGRAM:"unfocus,default,anim");
+ set_state(PART:"bg","default", 0.0);
+ set_state(PART:"elm.text","default", 0.0);
+ }
+ }
+ }
+ 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: FBR_PART_ELM_SWALLOWICON;
+ transition: LINEAR 0.17;
+ }
+ program {
+ name: "unfocus";
+ signal: "unfocused";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.text";
+ target: FBR_PART_ELM_SWALLOWICON;
+ }
+ 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:FBR_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:FBR_PART_ELM_SWALLOWICON, "default", 0.0);
+ }
+ }
+ program {
+ name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ script {
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ set_state(PART:"arrow_img", "default", 0.0);
+ }
+ }
+ program {
+ name: "disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ script{
+ set_state(PART:"bg", "disabled", 0.0);
+ set_state(PART:"elm.text", "disabled", 0.0);
+ set_state(PART:"arrow_img", "disabled", 0.0);
+ }
+ }
+ }
+}
+
+group {
+ name: "elm/button/base/fbr_sortbtn";
+ inherit: "elm/button/base/fbr_sourcebtn";
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 76;
+ }
+ }
+ }
+}
+
+
+group {
+ name: "elm/button/base/fbr_menubtn";
+ images {
+ image: FBR_GROUPBTN_BG COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 406 87;
+ image.normal: FBR_GROUPBTN_BG;
+ color: 0 0 0 0;
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 51;
+ }
+ }
+ 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: FBR_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";
+ }
+ fixed: 1 0;
+ align: 0.0 0.5;
+ }
+ }
+ part {
+ name: "padding_text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 37 0;
+ rel1 {
+ to: FBR_PART_ELM_SWALLOWICON;
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: FBR_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: 219 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_REGULAR;
+ size: 30;
+ align: 0.0 0.5;
+ }
+ color: 255 255 255 153;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ description {
+ state: "focused" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_BOLD;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ text {
+ font: FONT_STYLE_MEDIUM;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ }
+ script {
+ public select_status = 0;
+ }
+ 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: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ action: STATE_SET "focused" 0.0;
+ script {
+ if (get_int(select_status) != 1) {
+ emit("elm,action,click", "");
+ }
+ set_state(PART:"bg", "focused", 0.0);
+ set_state(PART:"elm.text", "focused", 0.0);
+ }
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ script {
+ if (get_int(select_status) == 1) {
+ set_state(PART:"bg", "highlight", 0.0);
+ set_state(PART:"elm.text", "highlight", 0.0);
+ } else {
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ }
+ program {
+ name: "select";
+ signal: FBR_SIGNAL_GROUP_SELECTED;
+ source: "";
+ script {
+ set_int(select_status, 1);
+ }
+ }
+ program {
+ name: "unselect";
+ signal: FBR_SIGNAL_GROUP_UNSELECTED;
+ source: "";
+ script {
+ set_int(select_status, 0);
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ }
+}
+
--- /dev/null
+group { name: "elm/ctxpopup/base/fbr_common_popup";
+ parts {
+ part {
+ name: elm.swallow.content;
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ }
+ }
+ }
+}
--- /dev/null
+group {
+ name: "elm/gengrid/item/fbr_mediagrid/default";
+ data.item: "selectraise" "on";
+ data.item: "texts" "elm.text elm.text1";
+ data.item: "contents" "elm.swallow.icon elm.swallow.icon1";
+ parts {
+ part {
+ name: "bg_with_border";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 263+20 359+20;
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "map";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ perspective {
+ zplane: 0;
+ focal: 1000;
+ }
+ visible: 0;
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ perspective.zplane: 50;
+ }
+ 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;
+ min: 263 263;
+ rel1.to:"bg_with_border";
+ rel2.to:"bg_with_border";
+ rel2.relative: 0.0 0.0;
+ color: 0 0 0 76;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "icon_bg";
+ scale: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ min: 263 263;
+ rel1 {
+ to: "elm.bg";
+ }
+ rel2 {
+ to: "elm.bg";
+ relative: 0.0 0.0;
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 0 0 0 76;
+ aspect: 1.0 1.0;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "elm.swallow.icon";
+ scale: 1;
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1.to: "icon_bg";
+ rel2.to: "icon_bg";
+ align: 0.5 0.5;
+ fixed: 1 1;
+ aspect: 1.0 1.0;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "elm.swallow.icon1";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1.to: "icon_bg";
+ rel2.to: "icon_bg";
+ align: 0.5 0.5;
+ fixed: 1 1;
+ aspect: 1.0 1.0;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part { name: "left_over";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 263;
+ rel1.to:"icon_bg";
+ rel2.to:"icon_bg";
+ rel2.relative: 0.0 0.0;
+ color: 126 128 255 0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ map.on: 1;
+ }
+ }
+ part { name: "right_over";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 8 263;
+ rel1.to:"icon_bg";
+ rel1.relative: 1.0 0.0;
+ rel2.to:"icon_bg";
+ rel2.relative: 1.0 0.0;
+ color: 126 128 255 0;
+ align: 1.0 0.0;
+ fixed: 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ map.on: 1;
+ }
+ }
+ part { name: "top_over";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 263-16 8;
+ rel1.to: "left_over";
+ rel1.relative: 1.0 0.0;
+ rel2.to: "right_over";
+ rel2.relative: 0.0 0.0;
+ color: 126 128 255 0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ map.on: 1;
+ }
+ }
+ part { name: "bottom_bg";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 263 96;
+ rel1.to:"icon_bg";
+ rel1.relative: 0.0 1.0;
+ rel2.to:"icon_bg";
+ rel2.relative: 0.0 1.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 0 0 0 76;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ map.on: 1;
+ }
+ }
+ part { name: "bottom_over";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 263 96;
+ rel1.to:"icon_bg";
+ rel1.relative: 0.0 1.0;
+ rel2.to:"icon_bg";
+ rel2.relative: 0.0 1.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 126 128 255 0;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 126 128 255 255;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "padding_text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 20 16;
+ rel1 {
+ to: "icon_bg";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "icon_bg";
+ relative: 0.0 1.0;
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 40;
+ max: 223 40;
+ text {
+ font: FONT_STYLE_MEDIUM;
+ size: 30;
+ }
+ rel1 {
+ to: "padding_text";
+ relative: 1 1;
+ }
+ rel2 {
+ to: "padding_text";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 211 211 211 255;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ }
+ }
+ part {
+ name: "elm.padding.text";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 40;
+ rel1 {
+ to: "elm.text";
+ }
+ rel2 {
+ to: "elm.text";
+ relative: 0.0 0.0;
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 0;
+ }
+ }
+ part {
+ name: "elm.text1";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 223 25;
+ max: 223 25;
+ text {
+ font: FONT_STYLE_REGULAR;
+ size: 22;
+ }
+ rel1 {
+ to: "elm.padding.text";
+ relative: 1 1;
+ }
+ rel2 {
+ to: "elm.padding.text";
+ }
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 128 128 128 255;
+ map {
+ on: 0;
+ perspective_on: 1;
+ alpha: 1;
+ perspective: "map";
+ }
+ }
+ description {
+ state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ map.on: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active";
+ signal: "elm,state,focused";
+ source: "elm";
+ action: STATE_SET "selected" 0.0;
+ target: "elm.swallow.icon";
+ target: "elm.swallow.icon1";
+ target: "elm.text";
+ target: "elm.text1";
+ target: "bottom_over";
+ target: "left_over";
+ target: "top_over";
+ target: "right_over";
+ target: "elm.bg";
+ target: "icon_bg";
+ target: "bottom_bg";
+ //target: "map";
+ transition: LINEAR 0.3;
+ }
+ program {
+ name: "go_passive";
+ signal: "elm,state,unfocused";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.icon";
+ target: "elm.swallow.icon1";
+ target: "elm.text";
+ target: "elm.text1";
+ target: "bottom_over";
+ target: "left_over";
+ target: "top_over";
+ target: "right_over";
+ target: "elm.bg";
+ target: "icon_bg";
+ target: "bottom_bg";
+ //target: "map";
+ transition: LINEAR 0.3;
+ }
+ 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 FBR_SIGNAL_BTN_CLICKED FBR_BASE_VIEW;
+ }
+ }
+}
+
--- /dev/null
+styles {
+ style {
+ name, "text_style_36_unfocused";
+ base, "font=TizenSans:style=Bold font_size=36 color=#ffffff align=left";
+ }
+ style {
+ name, "text_style_36_focused";
+ base, "font=TizenSans:style=Bold font_size=36 color=#ffffff align=left";
+ }
+}
+
+group {
+ name, "elm/label/base/slide_style_36";
+ script {
+ public g_duration = 0, g_stopslide, g_timer_id, g_anim_id;
+ public message(Msg_Type:type, id, ...) {
+ if (type == MSG_FLOAT_SET) {
+ new Float:duration;
+ duration = getfarg(2);
+ set_float(g_duration, duration);
+ }
+ }
+ public slide_to_end_anim(val, Float:pos) {
+ new stopflag;
+ new id;
+ stopflag = get_int(g_stopslide);
+ if (stopflag == 1)
+ return;
+ set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
+ if (pos >= 1.0) {
+ id = timer(0.5, "slide_to_begin", 1);
+ set_int(g_timer_id, id);
+ }
+ }
+ public slide_to_end() {
+ new stopflag;
+ new id;
+ new Float:duration;
+ stopflag = get_int(g_stopslide);
+ if (stopflag == 1)
+ return;
+ duration = get_float(g_duration);
+ id = anim(duration, "slide_to_end_anim", 1);
+ set_int(g_anim_id, id);
+ }
+ public slide_to_begin() {
+ new stopflag;
+ new id;
+ stopflag = get_int(g_stopslide);
+ if (stopflag == 1) return;
+ set_state(PART:"elm.text", "slide_begin", 0.0);
+ id = timer(0.5, "slide_to_end", 1);
+ set_int(g_timer_id, id);
+ }
+ public start_slide() {
+ set_int(g_stopslide, 0);
+ set_state(PART:"elm.text", "slide_begin", 0.0);
+ slide_to_end();
+ }
+ public stop_slide() {
+ new id;
+ set_int(g_stopslide, 1);
+ id = get_int(g_anim_id);
+ cancel_anim(id);
+ id = get_int(g_timer_id);
+ cancel_timer(id);
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ parts {
+ part {
+ name, "label.text.clip";
+ type, RECT;
+ description {
+ state, "default" 0.0;
+ }
+ }
+ part {
+ name, "elm.text";
+ type, TEXTBLOCK;
+ scale, 1;
+ clip_to, "label.text.clip";
+ description {
+ state, "default" 0.0;
+ rel1.relative, 0.0 0.0;
+ rel2.relative, 1.0 1.0;
+ align, 0.0 0.5;
+ text {
+ style, "text_style_36_unfocused";
+ min, 0 1;
+ align, 0.0 0.0;
+ }
+ }
+ description {
+ state, "slide_end" 0.0;
+ inherit, "default" 0.0;
+ rel1.relative, 1.0 0.0;
+ rel2.relative, 1.0 1.0;
+ align, 1.0 0.5;
+ text {
+ style, "text_style_36_focused";
+ min, 1 1;
+ align, 0.0 0.0;
+ }
+ }
+ description {
+ state, "slide_begin" 0.0;
+ inherit, "default" 0.0;
+ rel1.relative, 0.0 0.0;
+ rel2.relative, 0.0 1.0;
+ align, 0.0 0.5;
+ text {
+ style, "text_style_36_focused";
+ min, 1 1;
+ align, 0.0 0.0;
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name, "start_slide";
+ signal, "elm,state,slide,start";
+ source, "elm";
+ script {
+ start_slide();
+ }
+ }
+ program {
+ name, "stop_slide";
+ signal, "elm,state,slide,stop";
+ source, "elm";
+ script {
+ stop_slide();
+ }
+ }
+ }
+}
--- /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 <stdlib.h>
+#include <string.h>
+#include "dbg.h"
+#include "i18n.h"
+#include "common.h"
+#include <media_content.h>
+
+#include "ExtNameInfo.h"
+#include "DirectoryInfo.h"
+
+
+struct SDirectoryInfo {
+ int nCount;
+
+ filter_h filter;
+ media_folder_h folder;
+};
+
+
+bool CDirectoryInfo::Create(CNameInfo::EClassType type)
+{
+ if (m)
+ return false;
+
+ m = new SDirectoryInfo;
+ if (!m)
+ return false;
+
+ if (!CExtNameInfo::Create(CLASS_TYPE_DIRECTORY)) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ return true;
+}
+
+
+void CDirectoryInfo::Destroy(void)
+{
+ if (!m)
+ return;
+
+ CExtNameInfo::Destroy();
+
+ delete m;
+ m = NULL;
+}
+
+
+bool CDirectoryInfo::SetCount(int nCount)
+{
+ if (!m)
+ return false;
+
+ m->nCount = nCount;
+
+ return true;
+}
+
+
+int CDirectoryInfo::Count(void)
+{
+ if (!m)
+ return 0;
+
+ return m->nCount;
+}
+
+
+bool CDirectoryInfo::Duplicate(CNameInfo *obj)
+{
+ if (!m)
+ return false;
+
+ CDirectoryInfo *dst = (CDirectoryInfo*)obj;
+
+ if (!CExtNameInfo::Duplicate(obj))
+ return false;
+
+ if (!SetCount(dst->Count()))
+ return false;
+
+ return true;
+}
+
+
+static bool gFolderSize(media_info_h media_h, void *dt)
+{
+ long long unsigned int size;
+ long long unsigned int *total_size;
+
+ if (!dt)
+ return false;
+
+ total_size = (long long unsigned int *)dt;
+
+ if (media_info_get_size(media_h, &size) == MEDIA_CONTENT_ERROR_NONE)
+ *total_size = *total_size + size;
+
+ return true;
+}
+
+
+bool CDirectoryInfo::SetLoadInfo(filter_h filter, media_folder_h folder)
+{
+ if (!m)
+ return false;
+
+ m->filter = filter;
+ m->folder = folder;
+
+ return true;
+}
+
+
+bool CDirectoryInfo::Load(void)
+{
+ if (!m)
+ return false;
+
+ int r;
+ bool ret = false;
+ do {
+ char* str;
+ r = media_folder_get_name(m->folder, &str);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get name failed");
+ break;
+ }
+ SetName(str);
+ free(str);
+
+ r = media_folder_get_path(m->folder, &str);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get path failed");
+ break;
+ }
+ SetPath(str);
+ free(str);
+
+ r = media_folder_get_folder_id(m->folder, &str);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get id failed");
+ break;
+ }
+ SetId(str);
+ free(str);
+
+ int count = 0;
+ r = media_folder_get_media_count_from_db(Id(), m->filter, &count);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get id failed");
+ break;
+ }
+ SetCount(count);
+
+ SetType(E_GRP_FOLDER);
+
+ TTime time;
+ r = media_folder_get_modified_time(m->folder, &time);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get mod time failed");
+ break;
+ }
+ SetModifieidTime(time);
+
+ TSize size;
+ r = media_folder_foreach_media_from_db(Id(), m->filter, gFolderSize, &size);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder get size failed");
+ break;
+ }
+
+ SetSize(size);
+
+ ret = true;
+ } while (0);
+
+ return ret;
+}
--- /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 <stdlib.h>
+#include <string.h>
+#include "dbg.h"
+#include "i18n.h"
+#include "common.h"
+#include <media_content.h>
+
+#include "ExtNameInfo.h"
+#include "FileInfo.h"
+
+
+struct SFileInfo {
+ media_info_h handle;
+};
+
+
+bool CFileInfo::Create(void)
+{
+ if (m)
+ return false;
+
+ m = new SFileInfo;
+ if (!m)
+ return false;
+
+ memset(m, 0, sizeof(SFileInfo));
+
+ if (!CExtNameInfo::Create(CExtNameInfo::CLASS_TYPE_FILE)) {
+ delete m;
+ m = NULL;
+ return false;
+ }
+
+ return true;
+}
+
+
+void CFileInfo::Destroy(void)
+{
+ if (!m)
+ return;
+
+ CExtNameInfo::Destroy();
+
+ delete m;
+ m = NULL;
+}
+
+
+groups gType(media_content_type_e type)
+{
+ groups ret = E_GRP_OTHER;
+
+ switch (type) {
+ case MEDIA_CONTENT_TYPE_IMAGE:
+ ret = E_GRP_PHOTO;
+ break;
+
+ case MEDIA_CONTENT_TYPE_VIDEO:
+ ret = E_GRP_VIDEO;
+ break;
+ case MEDIA_CONTENT_TYPE_MUSIC:
+ ret = E_GRP_MUSIC;
+ break;
+ default:
+ ret = E_GRP_OTHER;
+ break;
+ }
+
+ return ret;
+}
+
+
+bool CFileInfo::Duplicate(CNameInfo* obj)
+{
+ if (!m)
+ return false;
+
+ if (!CExtNameInfo::Duplicate(obj))
+ return false;
+
+ return true;
+}
+
+
+bool CFileInfo::SetLoadInfo(media_info_h handle)
+{
+ if (!m)
+ return false;
+
+ m->handle = handle;
+ return true;
+}
+
+bool CFileInfo::Load(void)
+{
+ if (!m)
+ return false;
+
+ bool ret = false;
+ do {
+ char* str;
+ if (media_info_get_media_id(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media ID Fetch error");
+ break;
+ }
+ SetId(str);
+ free(str);
+
+ if (media_info_get_title(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media name Fetch error");
+ break;
+ }
+ SetName(str);
+ free(str);
+
+ media_content_type_e ctype;
+ if (media_info_get_media_type(m->handle, &ctype) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media type Fetch error");
+ break;
+ }
+ SetType(gType(ctype));
+
+ TSize size;
+ if (media_info_get_size(m->handle, &size) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media size Fetch error");
+ break;
+ }
+ SetSize(size);
+
+ if (media_info_get_file_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media file path Fetch error");
+ break;
+ }
+ SetPath(str);
+ free(str);
+
+ if (media_info_get_thumbnail_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media thumb Fetch error");
+ break;
+ }
+ if(str == NULL)
+ {
+ _ERR("Fail to get string by media_info_get_thumbnail_path");
+ break;
+ }
+ SetThumbnailPath(str);
+ free(str);
+
+ TTime time;
+ if (media_info_get_modified_time(m->handle, &time) != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("media mod time Fetch error");
+ break;
+ }
+ SetModifieidTime(time);
+
+ ret = true;
+ } while (0);
+
+ return ret;
+}
--- /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 <stdio.h>
+#include <stdlib.h>
+#include <Eina.h>
+#include "dbg.h"
+#include "common.h"
+#include "i18n.h"
+
+#include <media_content.h>
+#include "AppCommon.h"
+#include "ExtNameInfo.h"
+#include "FileList.h"
+
+int CFileList::t_Max(void)
+{
+ return m_max;
+}
+
+void CFileList::t_Remove(Eina_List** list)
+{
+ _DBG("");
+ if (*list == NULL)
+ return;
+
+ Eina_List* filelist = *list;
+ CExtNameInfo *pInfo;
+ void* obj;
+
+ EINA_LIST_FREE(filelist, obj) {
+ pInfo = (CExtNameInfo *)obj;
+ pInfo->Destroy();
+ delete pInfo;
+ }
+
+ *list = NULL;
+}
+
+CFileList::CFileList(int max)
+{
+ m_lists = new Eina_List*[max + 1];
+ for (int a = 0; a <= max; a++)
+ m_lists[a] = NULL;
+
+ m_max = max;
+}
+
+CFileList::~CFileList()
+{
+ RemoveAll();
+ delete[] m_lists;
+ m_lists = NULL;
+}
+
+void CFileList::Add(int idx, void* obj)
+{
+ ASSERT(0 <= idx && idx <= t_Max());
+ m_lists[idx] = eina_list_append(m_lists[idx], obj);
+}
+
+Eina_List* CFileList::Clone(int idx)
+{
+ ASSERT(0 <= idx && idx <= t_Max());
+ return eina_list_clone(m_lists[idx]);
+}
+
+void CFileList::RemoveAll(void)
+{
+ for (int a = 0; a <= t_Max(); a++)
+ t_Remove(&m_lists[a]);
+}
--- /dev/null
+#ifndef __FILE_LIST_H__
+#define __FILE_LIST_H__
+
+
+class CFileList {
+protected:
+
+ int m_max;
+ Eina_List **m_lists;
+
+protected:
+
+ int t_Max(void);
+ void t_Remove(Eina_List** list);
+
+public:
+ CFileList(int max);
+ virtual ~CFileList();
+
+ void Add(int idx, void* obj);
+ Eina_List* Clone(int idx);
+
+ void RemoveAll(void);
+};
+
+
+#endif /* __FILE_LIST_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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <Eina.h>
+#include <media_content.h>
+//#include <usb-device.h>
+#include "dbg.h"
+#include "common.h"
+#include "i18n.h"
+
+#include "AppCommon.h"
+#include "FileList.h"
+#include "ExtNameInfo.h"
+#include "Mediadata.h"
+#include "MediadataImpl.h"
+
+#define M ((CMediadataImpl*)m)
+
+bool CMediadata::Create(void)
+{
+ if (m)
+ return false;
+
+ _CREATE_BEGIN{
+ _CHECK(m = (SMediadata*)(new CMediadataImpl))
+ _CHECK(M->Create())
+ _WHEN_SUCCESS{
+
+ }
+ _CHECK_FAIL{ M->Destroy(); }
+ _CHECK_FAIL{ delete M; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+ return true;
+}
+
+void CMediadata::Destroy(void)
+{
+ if (!m)
+ return;
+
+ M->Destroy();
+ delete M;
+ m = NULL;
+}
+
+bool CMediadata::GetMediaList(const char* folderid, int media_type, int source_type, Eina_List **list)
+{
+ if (!m)
+ return false;
+
+ return ((CMediadataImpl*)m)->GetMediaList(folderid, media_type, source_type, list);
+}
+
+bool CMediadata::GetFolderList(int media_type, int source_type, Eina_List **list)
+{
+ if (!m)
+ return false;
+
+ return ((CMediadataImpl*)m)->GetFolderList(media_type, source_type, 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <Eina.h>
+#include <media_content.h>
+#include "dbg.h"
+#include "common.h"
+#include "i18n.h"
+
+#include "AppCommon.h"
+#include "FileList.h"
+#include "ExtNameInfo.h"
+#include "FileInfo.h"
+#include "DirectoryInfo.h"
+#include "Mediadata.h"
+#include "MediadataImpl.h"
+
+struct SMediadataImpl {
+ Eina_List *filelist;
+
+ filter_h filter;
+ int source_type;
+ int media_type;
+};
+
+bool CMediadataImpl::m_CreateFilter(int source_type, int media_type)
+{
+ char buf[1024];
+ int ret;
+
+ struct SPairSources {
+ sources source;
+ const char* string;
+ } source_condn[] = {
+ { E_ALL, "" },
+ { E_TV, "(MEDIA_STORAGE_TYPE=0)" },
+ { E_USB, "(MEDIA_STORAGE_TYPE=1)" }
+ };
+ ASSERT(source_condn[E_ALL].source == E_ALL &&
+ source_condn[E_TV].source == E_TV &&
+ source_condn[E_USB].source == E_USB);
+
+ struct SPairMedia {
+ enum groups groups;
+ const char* string;
+ } media_condn[] = {
+ { E_GRP_ALL, "" },
+ { E_GRP_PHOTO, "(MEDIA_TYPE=0)" },
+ { E_GRP_VIDEO, "(MEDIA_TYPE=1)" },
+ { E_GRP_MUSIC, "(MEDIA_TYPE=3)" }
+ };
+ ASSERT(media_condn[E_GRP_ALL].groups == E_GRP_ALL &&
+ media_condn[E_GRP_PHOTO].groups == E_GRP_PHOTO &&
+ media_condn[E_GRP_VIDEO].groups == E_GRP_VIDEO &&
+ media_condn[E_GRP_MUSIC].groups == E_GRP_MUSIC);
+
+ ret = media_filter_create(&m->filter);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media Filter Creation Failed");
+ return false;
+ }
+
+ _DBG("media: %d, source: %d", media_type, source_type);
+ if (media_type == E_GRP_ALL) {
+ if (source_type == E_ALL)
+ return true;
+
+ snprintf(buf, sizeof(buf), "%s", source_condn[source_type].string);
+ }
+ else {
+ if (source_type == E_ALL)
+ snprintf(buf, sizeof(buf), "%s", media_condn[media_type].string);
+ else
+ snprintf(buf, sizeof(buf), "%s AND %s", source_condn[source_type].string, media_condn[media_type].string);
+ }
+
+ media_filter_set_condition(m->filter, buf, MEDIA_CONTENT_COLLATE_RTRIM);
+
+ return true;
+}
+
+void CMediadataImpl::m_DestroyFilter(filter_h filter)
+{
+ if (!filter)
+ return;
+
+ int r = media_filter_destroy(filter);
+ ASSERT(r == MEDIA_CONTENT_ERROR_NONE);
+}
+
+bool CMediadataImpl::sm_CbMediaInfo(media_info_h media, void *dt)
+{
+ CMediadataImpl* root = (CMediadataImpl*)dt;
+
+ bool ret = false;
+ if (root)
+ ret = root->m_OnMediaInfo(media);
+
+ return ret;
+}
+
+bool CMediadataImpl::m_OnMediaInfo(media_info_h media)
+{
+ CFileInfo *pInfo = NULL;
+
+ _CREATE_BEGIN{
+ _CHECK(pInfo = new CFileInfo)
+ _CHECK(pInfo->Create())
+ _CHECK(pInfo->SetLoadInfo(media))
+ _CHECK(pInfo->Load())
+ _WHEN_SUCCESS{
+ m->filelist = eina_list_append(m->filelist, pInfo);
+ }
+ _CHECK_FAIL{}
+ _CHECK_FAIL{}
+ _CHECK_FAIL{ pInfo->Destroy(); }
+ _CHECK_FAIL{ delete pInfo; pInfo = NULL; }
+ }_CREATE_END_AND_CATCH{ return false; }
+
+ return true;
+}
+
+bool CMediadataImpl::sm_CbFolderInfo(media_folder_h folder, void* data)
+{
+ CMediadataImpl* root = (CMediadataImpl*)data;
+
+ _DBG("root: %x, m: %x", root, root->m);
+ bool ret = false;
+ if (root)
+ ret = root->m_OnFolderInfo(folder);
+
+ return ret;
+}
+
+bool CMediadataImpl::m_OnFolderInfo(media_folder_h folder)
+{
+ CDirectoryInfo *pDir = NULL;
+
+ _CREATE_BEGIN{
+ _CHECK(pDir = new CDirectoryInfo)
+ _CHECK(pDir->Create())
+ _CHECK(pDir->SetLoadInfo(m->filter, folder))
+ _CHECK(pDir->Load())
+ _WHEN_SUCCESS{
+ Add(m->media_type, pDir);
+ }
+ _CHECK_FAIL{}
+ _CHECK_FAIL{}
+ _CHECK_FAIL{ pDir->Destroy(); }
+ _CHECK_FAIL{ delete pDir; pDir = NULL; }
+ }_CREATE_END_AND_CATCH{ return false; }
+
+ return true;
+}
+
+bool CMediadataImpl::m_GetMediaList(const char *folderid)
+{
+ t_Remove(&m->filelist);
+
+ int r = media_folder_foreach_media_from_db(folderid, m->filter, sm_CbMediaInfo, this);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("Media folder foreach folder from db failed");
+ }
+ return r == MEDIA_CONTENT_ERROR_NONE ? true : false;
+}
+
+void CMediadataImpl::m_GetFolderList(void)
+{
+ int r;
+ _DBG("this: 0x%x", this);
+ r = media_folder_foreach_folder_from_db(m->filter, sm_CbFolderInfo, this);
+ _DBG("");
+ if (r != MEDIA_CONTENT_ERROR_NONE)
+ _ERR("Media folder foreach folder from db failed");
+}
+
+void CMediadataImpl::m_UpdateFolderLists(void)
+{
+ int type;
+
+ RemoveAll();
+
+ for (type = E_GRP_ALL; type <= E_GRP_MUSIC; type++) {
+ m->media_type = type;
+
+ bool r = m_CreateFilter(m->source_type, m->media_type);
+ if (!r) {
+ _ERR("Media Filter Creation Failed");
+ continue;
+ }
+
+ m_GetFolderList();
+
+ m_DestroyFilter(m->filter);
+ m->filter = NULL;
+ }
+}
+
+bool CMediadataImpl::Create(void)
+{
+ if (m)
+ return false;
+
+ _CREATE_BEGIN{
+ _CHECK(m = new SMediadataImpl)
+ _CHECK(media_content_connect() == MEDIA_CONTENT_ERROR_NONE)
+ _WHEN_SUCCESS{
+
+ }
+ _CHECK_FAIL{ media_content_disconnect(); }
+ _CHECK_FAIL{ delete m; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+ m->source_type = E_GRP_NONE;
+ m->media_type = E_GRP_ALL;
+ m->filelist = NULL;
+
+ return true;
+}
+
+void CMediadataImpl::Destroy(void)
+{
+ if (!m)
+ return;
+
+ _DBG("#########################");
+
+ t_Remove(&m->filelist);
+ RemoveAll();
+
+ int r;
+ r = media_content_disconnect();
+ if (r != MEDIA_CONTENT_ERROR_NONE)
+ _ERR("Media Content Connect Failed");
+
+ delete m;
+ m = NULL;
+}
+
+bool CMediadataImpl::GetMediaList(const char* folderid, int media_type, int source_type, Eina_List **list)
+{
+ ASSERT(0 <= media_type && media_type <= t_Max());
+
+ if (!m)
+ return false;
+
+ /* Inner Level */
+ m->media_type = media_type;
+ m->source_type = source_type;
+
+ bool r = m_CreateFilter(m->source_type, m->media_type);
+ if (!r) {
+ _ERR("Media Filter Creation Failed");
+ return false;
+ }
+
+ // ƯÁ¤ Æú´õ ³»¿¡ ÀÖ´Â ÆÄÀϵéÀ» »Ì¾Æ m->filelist¿¡ ³ÖÀ½.
+ r = m_GetMediaList(folderid);
+
+ m_DestroyFilter(m->filter);
+ m->filter = NULL;
+
+ if (m->filelist) {
+ *list = eina_list_clone(m->filelist);
+ r = true;
+ }
+
+ return r;
+}
+
+bool CMediadataImpl::GetFolderList(int media_type, int source_type, Eina_List **list)
+{
+ ASSERT(0 <= media_type && media_type <= t_Max());
+
+ if (!m)
+ return false;
+
+ _DBG("sourceType: %d, m->source_Type: %d", source_type, m->source_type);
+ /* Outer level */
+ if (source_type != m->source_type) {
+ m->source_type = source_type;
+ m_UpdateFolderLists();
+ }
+
+ *list = Clone(media_type);
+ return true;
+}
--- /dev/null
+#ifndef __MEDIA_DATA_IMPL_H__
+#define __MEDIA_DATA_IMPL_H__
+
+
+class CMediadataImpl : protected CFileList {
+private:
+
+ struct SMediadataImpl* m;
+
+private:
+
+ static bool sm_CbMediaInfo(media_info_h media, void *data);
+ bool m_OnMediaInfo(media_info_h media);
+
+ static bool sm_CbFolderInfo(media_folder_h folder, void* data);
+ bool m_OnFolderInfo(media_folder_h folder);
+
+ bool m_CreateFilter(int source_type, int media_type);
+ void m_DestroyFilter(filter_h filter);
+
+ bool m_GetMediaList(const char *folderid);
+ void m_GetFolderList(void);
+
+ void m_UpdateFolderLists(void);
+
+public:
+
+ CMediadataImpl() : CFileList(E_GRP_MUSIC), m(0) {}
+ virtual ~CMediadataImpl() { if (m) Destroy(); }
+ bool FlagCreate(void) { return !!m; }
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ bool GetMediaList(const char* folderid, int media_type, int source_type, Eina_List **list);
+ bool GetFolderList(int media_type, int source_type, Eina_List **list);
+};
+
+
+#endif /* __MEDIA_DATA_IMPL_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.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <Eina.h>
+#include "dbg.h"
+#include <AppCommon.h>
+#include <media_content.h>
+#include "common.h"
+#include "i18n.h"
+
+#include "ManagerUsb.h"
+
+
+class CUsbConnectionListenerImpl {
+private:
+ Eina_List *m_elListener;
+ bool m_created;
+
+#if 0
+private:
+ static void sm_CbConnected(usb_device_h usb_device, char *action, void *dt)
+ {
+ CUsbConnectionListenerImpl* root = (CUsbConnectionListenerImpl*)dt;
+ if (root)
+ root->t_OnConnected(usb_device, action);
+ }
+
+protected:
+ virtual void t_OnConnected(usb_device_h usb_device, char *action) {
+ Eina_List *l;
+ void *obj;
+
+ EINA_LIST_FOREACH(m_elListener, l, obj) {
+ CUsbConnectionListener* listener = (CUsbConnectionListener*)obj;
+ listener->OnConnect();
+ }
+ }
+#endif
+
+public:
+ CUsbConnectionListenerImpl() {
+ m_created = false;
+ }
+ ~CUsbConnectionListenerImpl() {
+ }
+ bool FlagCreate(void) { return !!m_created; }
+
+ bool Create(void) {
+ ASSERT(!FlagCreate());
+ ASSERT(!"Not Yet");
+#if 0
+ m_elListener = NULL;
+ if (!usb_device_init()) {
+ return false;
+ }
+ usb_set_connected_cb(sm_CbConnected, this);
+
+ m_created = true;
+#endif
+ return true;
+ }
+ virtual void Destroy(void) {
+ ASSERT(FlagCreate());
+#if 0
+ usb_unset_connected_cb();
+ usb_device_fini();
+ m_created = false;
+#endif
+ }
+ void Add(CUsbConnectionListener *listener) {
+ ASSERT(FlagCreate());
+
+ m_elListener = eina_list_append(m_elListener, listener);
+ }
+ void Remove(CUsbConnectionListener *listener) {
+ ASSERT(FlagCreate());
+
+ m_elListener = eina_list_remove(m_elListener, listener);
+ }
+ bool FlagConnected(void) {
+ ASSERT(FlagCreate());
+#if 0
+ if (usb_get_connected_device_number(USB_MASS_STORAGE) <= 0)
+ return false;
+#endif
+ return true;
+ }
+};
+
+
+static CUsbConnectionListenerImpl refUCS;
+static int refUCSCnt = 0;
+
+
+bool CUsbConnectionListener::Create(void)
+{
+ ASSERT(!FlagCreate());
+
+ if (refUCSCnt == 0) {
+ if (!refUCS.Create()) {
+ return false;
+ }
+ }
+ refUCSCnt++;
+
+ refUCS.Add(this);
+
+ m = (void*)1;
+
+ return true;
+}
+
+
+void CUsbConnectionListener::Destroy(void)
+{
+ ASSERT(FlagCreate());
+
+ refUCS.Remove(this);
+ refUCSCnt--;
+ if (refUCSCnt == 0) {
+ refUCS.Destroy();
+ }
+ m = NULL;
+}
+
+
+bool CUsbConnectionListener::FlagConnected(void)
+{
+ ASSERT(FlagCreate());
+
+ return refUCS.FlagConnected();
+}
+
+
+class CDbUpdateListenerImpl {
+private:
+ Eina_List *m_elListener;
+ bool m_created;
+
+private:
+ static void sm_CbDbUpdated(media_content_error_e err, 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)
+ {
+ CDbUpdateListenerImpl* root = (CDbUpdateListenerImpl*)dt;
+ if (root) {
+ CDbUpdateListener::SEntity entity;
+ entity.err = err;
+ entity.pid = pid;
+ entity.update_item = update_item;
+ entity.update_type = update_type;
+ entity.media_type = media_type;
+ entity.uuid = uuid;
+ entity.path = path;
+ entity.mime_type = mime_type;
+ root->t_OnDbUpdated(&entity);
+ }
+ }
+
+protected:
+ virtual void t_OnDbUpdated(CDbUpdateListener::SEntity *entity) {
+ Eina_List *l;
+ void *obj;
+
+ EINA_LIST_FOREACH(m_elListener, l, obj) {
+ CDbUpdateListener* listener = (CDbUpdateListener*)obj;
+ listener->OnUpdated(entity);
+ }
+ }
+
+public:
+ CDbUpdateListenerImpl() {
+ m_created = false;
+ }
+ ~CDbUpdateListenerImpl() {
+ }
+ bool FlagCreate(void) { return !!m_created; }
+
+ bool Create(void) {
+ ASSERT(!FlagCreate());
+
+ m_elListener = NULL;
+
+ if (media_content_set_db_updated_cb(sm_CbDbUpdated, this) != MEDIA_CONTENT_ERROR_NONE)
+ return false;
+
+ m_created = true;
+ return true;
+ }
+ virtual void Destroy(void) {
+ ASSERT(FlagCreate());
+ media_content_unset_db_updated_cb();
+ m_created = false;
+ }
+ void Add(CDbUpdateListener *listener) {
+ ASSERT(FlagCreate() == true);
+ m_elListener = eina_list_append(m_elListener, listener);
+ }
+ void Remove(CDbUpdateListener *listener) {
+ ASSERT(FlagCreate() == true);
+ m_elListener = eina_list_remove(m_elListener, listener);
+ }
+};
+
+
+static CDbUpdateListenerImpl refDUS;
+static int refDUSCnt = 0;
+
+
+bool CDbUpdateListener::Create(void)
+{
+ ASSERT(!FlagCreate());
+
+ if (refDUSCnt == 0) {
+ if (!refDUS.Create()) {
+ return false;
+ }
+ }
+ refDUSCnt++;
+ refDUS.Add(this);
+
+ m = (void*)1;
+
+ return true;
+}
+
+
+void CDbUpdateListener::Destroy(void)
+{
+ ASSERT(FlagCreate());
+
+ refDUS.Remove(this);
+
+ refDUSCnt--;
+ if (refDUSCnt == 0) {
+ refDUS.Destroy();
+ }
+
+ 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 <string.h>
+#include <app.h>
+#include <Elementary.h>
+#include <Eina.h>
+#include "dbg.h"
+#include "define.h"
+#include "BaseApp.h"
+
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include <CtxPopup.h>
+#include <InputHandler.h>
+
+#include "FbBaseView.h"
+#include <ExtNameInfo.h>
+#include "FbContextView.h"
+
+#define PARAM_SOURCE "source"
+#define FBR_WIN_TITLE "File Browser"
+
+Evas_Object *_add_win(const char *name)
+{
+ Evas_Object *win;
+
+ win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (!win)
+ return NULL;
+
+ elm_win_title_set(win, FBR_WIN_TITLE);
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+ elm_win_focus_highlight_style_set(win, FBR_STYLE_WIN_FOCUS);
+ elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
+ evas_object_show(win);
+
+ return win;
+}
+
+class CApp : public CBaseApp {
+
+ struct _appdata {
+ const char *name;
+ Evas_Object *win;
+ char *source;
+ } ad;
+
+ CFbBaseView *pFbBaseView;
+ CContextView *pContextView;
+protected:
+
+ virtual bool OnCreate(void)
+ {
+ Evas_Object *win;
+
+ elm_theme_overlay_add(NULL, THEMEFILE);
+
+ win = _add_win(ad.name);
+ if (!win)
+ return false;
+
+ ad.win = win;
+
+ return true;
+ }
+
+ virtual void OnTerminate(void)
+ {
+ CViewMgr::Finalize();
+
+ if (ad.win)
+ evas_object_del(ad.win);
+
+ free(ad.source);
+ }
+
+ virtual void OnService(service_h service)
+ {
+ char *source;
+ int r;
+ CViewMgr* viewmgr = NULL;
+
+ _DBG(" ******************* OnService *********************");
+ _DBG("222");
+ elm_win_activate(ad.win);
+
+ r = service_get_extra_data(service, PARAM_SOURCE, &source);
+ if (r != SERVICE_ERROR_NONE)
+ source = NULL;
+
+ if (source) {
+ ad.source = strdup(source);
+ free(source);
+ }
+
+ CViewMgr::Initialize(ad.win,NULL);
+ viewmgr = CViewMgr::GetInstance();
+ if(!viewmgr) {
+ _ERR("Fail to get viewmgr instance");
+ goto error;
+ }
+
+ pFbBaseView = new CFbBaseView(FBR_BASE_VIEW);
+ if(!viewmgr->AddView(pFbBaseView))
+ {
+ _ERR("Fail to add pFbBaseView");
+ goto error;
+ }
+
+ pContextView = new CContextView(FBR_CONTEXT_VIEW);
+ if(!viewmgr->AddView(pContextView))
+ {
+ _ERR("Fail to add pContextView");
+ goto error;
+ }
+
+ if (!viewmgr->PushView(FBR_BASE_VIEW, ad.source)) {
+ _ERR("Fail to push view");
+ goto error;
+ }
+ return;
+
+ error:
+ CViewMgr::Finalize();
+ 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
+
+#include <Elementary.h>
+#include <AppCommon.h>
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include <BaseLayout.h>
+#include <LayoutMgr.h>
+
+#include "dbg.h"
+#include "define.h"
+#include "FileGrid.h"
+
+#include <CtxPopup.h>
+#include "FbBaseView.h"
+#include "FbBaseLayout.h"
+
+
+struct SFbBaseLayout {
+ Evas_Object *eoWin;
+ Evas_Object *eoBase;
+ CFileGrid *pFileGrid;
+
+ CLayoutMgr *pLayoutMgr;
+ CViewMgr *pViewMgr;
+};
+
+
+void CFbBaseLayout::sm_CbUpdateEmptyFocusSequence(void* cookie)
+{
+ _DBG();
+ CFbBaseView *pfbBaseView = NULL;
+ Evas_Object *eoBase = (Evas_Object*)cookie;
+
+ if (!eoBase)
+ return;
+
+ pfbBaseView = (CFbBaseView*)evas_object_data_get(eoBase, BASE_VIEW_DATA);
+ ASSERT(pfbBaseView);
+ pfbBaseView->UpdateEmptyFocusSequence();
+}
+
+
+void CFbBaseLayout::sm_CbUpdatedGrid(void* cookie)
+{
+ _DBG();
+ CFbBaseView *pfbBaseView = NULL;
+ Evas_Object *eoBase = (Evas_Object*)cookie;
+ if (!eoBase)
+ return;
+
+ pfbBaseView = (CFbBaseView*)evas_object_data_get(eoBase, BASE_VIEW_DATA);
+ ASSERT(pfbBaseView);
+ pfbBaseView->UpdatedGrid();
+}
+
+
+void CFbBaseLayout::sm_CbUnsetFocus(void* cookie)
+{
+ _DBG();
+ CFbBaseView *pfbBaseView = NULL;
+ Evas_Object *eoBase = (Evas_Object*)cookie;
+ if (eoBase) {
+ pfbBaseView = (CFbBaseView*)evas_object_data_get(eoBase, BASE_VIEW_DATA);
+ ASSERT(pfbBaseView);
+ pfbBaseView->UnsetFocus();
+ }
+}
+
+
+void CFbBaseLayout::sm_CbLinkApp(void* cookie, int type, int source_type, char *path)
+{
+ _DBG();
+ CFbBaseView *pfbBaseView = NULL;
+ Evas_Object *eoBase = (Evas_Object*)cookie;
+ if (eoBase)
+ {
+ pfbBaseView = (CFbBaseView*)evas_object_data_get(eoBase, BASE_VIEW_DATA);
+ ASSERT(pfbBaseView);
+ pfbBaseView->CbLinkApp(type, source_type, path);
+ }
+}
+
+
+bool CFbBaseLayout::t_CreateFileGrid(Evas_Object *layout)
+{
+ m->pFileGrid = new CFileGrid;
+ if (!m->pFileGrid)
+ return false;
+
+ CFileGrid::SCallback cb;
+ cb.cbUpdateEmptyFocusSequence = sm_CbUpdateEmptyFocusSequence;
+ cb.cbUpdatedGrid = sm_CbUpdatedGrid;
+ cb.cbUnsetFocus = sm_CbUnsetFocus;
+ cb.cbLinkApp = sm_CbLinkApp;
+ cb.cookie = m->eoBase;
+ if (!m->pFileGrid->Create(m->eoWin, layout, &cb)) {
+ delete m->pFileGrid;
+ m->pFileGrid = NULL;
+ return false;
+ }
+ return true;
+}
+
+
+void CFbBaseLayout::t_DestroyFileGrid(void)
+{
+ if (!m->pFileGrid)
+ return;
+
+ m->pFileGrid->Destroy();
+ delete m->pFileGrid;
+ m->pFileGrid = NULL;
+}
+
+
+bool CFbBaseLayout::Create(CLayoutMgr *mgr, void *data)
+{
+ ASSERT(!m);
+ ASSERT(mgr);
+
+ Evas_Object *layout = NULL;
+
+ _CREATE_BEGIN{
+ _CHECK(m = new SFbBaseLayout)
+ _CHECK(m->pLayoutMgr = mgr)
+ _CHECK(m->pViewMgr = CViewMgr::GetInstance())
+ _CHECK(m->eoBase = m->pLayoutMgr->Base())
+ _CHECK(m->eoWin = m->pViewMgr->Window())
+ _CHECK(layout = elm_layout_add(m->eoBase))
+ _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_BASE_LAYOUT))
+ _CHECK(t_CreateFileGrid(layout))
+ _COMMAND{ elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); }
+ _CHECK(CBaseLayout::Create(layout))
+
+ _WHEN_SUCCESS{}
+
+ _CHECK_FAIL{ CBaseLayout::Destroy(); }
+ _CHECK_FAIL{ t_DestroyFileGrid(); }
+ _CHECK_FAIL{ /* elm_layout_file_set */ }
+ _CHECK_FAIL{ /* elm_layout_add */ }
+ _CHECK_FAIL{ /* m->pViewMgr->Window()*/ }
+ _CHECK_FAIL{ /* m->pLayoutMgr->Base() */ }
+ _CHECK_FAIL{ /* CViewMgr::GetInstace() */ }
+ _CHECK_FAIL{ /* m->pLayoutMgr = mgr */ }
+ _CHECK_FAIL{ delete m; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+ return true;
+}
+
+
+void CFbBaseLayout::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseLayout::Destroy();
+ t_DestroyFileGrid();
+ delete m;
+ m = NULL;
+}
+
+
+void CFbBaseLayout::Update(bool flag)
+{
+ ASSERT(m);
+ _DBG();
+
+ m->pFileGrid->Update(flag);
+}
+
+
+void CFbBaseLayout::SetFocus(Eina_Bool flag)
+{
+ ASSERT(m);
+ _DBG();
+
+ m->pFileGrid->SetFocus(flag);
+}
+
+
+Evas_Object* CFbBaseLayout::Grid(void)
+{
+ ASSERT(m);
+
+ return m->pFileGrid->Grid();
+}
+
+
+void CFbBaseLayout::Action(void)
+{
+ ASSERT(m);
+
+ return m->pFileGrid->Action();
+}
--- /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 <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+#include "define.h"
+
+#include "AppCommon.h"
+#include "ExtNameInfo.h"
+#include "common.h"
+#include "dbg.h"
+#include "ManagerUsb.h"
+#include "SortName.h"
+#include "Popup.h"
+#include "InputHandler.h"
+
+#include <CtxPopup.h>
+
+#include <BaseView.h>
+#include "FbBaseView.h"
+#include "Info.h"
+
+#include "SourceCtxPopup.h"
+#include "SortCtxPopup.h"
+
+#include <ViewMgr.h>
+#include <LayoutMgr.h>
+#include <BaseLayout.h>
+#include "FbBaseLayout.h"
+
+#define TOTAL_GROUP_BTNS 4
+#define TOTAL_TOP_BTNS 2
+#define TOTAL_UPDATE_CALLBACKS 2
+#define PARAM_URI "uri"
+#define PARAM_SOURCE "source"
+
+struct _btn_info {
+ const char *txt;
+ const char *part;
+ const char *style;
+ const char *icon_path;
+};
+
+enum topbtns {
+ TOPBTN_SOURCE,
+ TOPBTN_SORT,
+};
+
+const char *source_arg[] = {
+ "all",
+ "tv",
+ "pUsb"
+};
+
+const char *linked_app[] = {
+ N_(""),
+ N_("org.tizen.gallery-tv-ref"),
+ N_("org.tizen.video-player-tv-ref"),
+ N_("org.tizen.music-player-tv-ref"),
+ N_(""),
+};
+
+struct SFbBaseView {
+ Evas_Object *eoWin;
+ Evas_Object *eoBase;
+ Evas_Object *eoBtnGroup[TOTAL_GROUP_BTNS];
+ Evas_Object *eoSelectedBtnGroup;//Evas_Object *c_grpbtn;
+ Evas_Object *eoBtnSource;
+ Evas_Object *eoBtnSort;
+
+ CCtxPopup *pCtxPopup;
+
+ CPopup *pPopup;
+
+ CLayoutMgr *pLayoutMgr;
+ CFbBaseLayout *pFbBaseLayout;
+
+ SFbBaseView() {
+ int a;
+
+ memset(eoBtnGroup, 0, sizeof(eoBtnGroup));
+ pHandlerBase = new CHandlerBase(this);
+ for (a = 0; a < TOTAL_TOP_BTNS; a++)
+ pHandlerButton[a] = new CHandlerButton(this);
+ for (a = 0; a < TOTAL_GROUP_BTNS; a++){
+ pHandlerGroup[a] = new CHandlerGroup(this);
+ }
+ }
+ virtual ~SFbBaseView() {
+ int a;
+
+ delete pHandlerBase;
+ for (a = 0; a < TOTAL_TOP_BTNS; a++)
+ delete pHandlerButton[a];
+ for (a = 0; a < TOTAL_GROUP_BTNS; a++)
+ delete pHandlerGroup[a];
+ }
+
+ class CHandlerBase : public CListenerMgr, public IKeyDownListener {
+ SFbBaseView *m;
+
+ public:
+ CHandlerBase(SFbBaseView *ins) : IKeyDownListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_EXIT))
+ elm_exit();
+ else if (!strcmp(ev->keyname, KEY_ENTER)) {
+ if (elm_object_focus_get(m->eoSelectedBtnGroup)) {
+ m->pFbBaseLayout->SetFocus(EINA_TRUE);
+ }
+ }
+ }
+ } *pHandlerBase;
+
+ class CHandlerButton : public CListenerMgr, protected IKeyDownListener, IMouseMoveListener, IMouseClickedListener {
+ private:
+ SFbBaseView *m;
+ private:
+ static void sm_CbCtxPopupSelected(void* cookie, CCtxPopup* instance, const char* text)
+ {
+ SFbBaseView* m = (SFbBaseView*)cookie;
+ if (!m)
+ return;
+
+ _DBG(" instance->Type(): %d", instance->Type());
+ switch (instance->Type()) {
+ case CCtxPopup::TOPBTN_SORT:
+ elm_object_text_set(m->eoBtnSort, text);
+ m->pFbBaseLayout->Update(true);
+ break;
+
+ case CCtxPopup::TOPBTN_SOURCE:
+ elm_object_text_set(m->eoBtnSource, text);
+ m->pFbBaseLayout->Update(false);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ public:
+ CHandlerButton(SFbBaseView *ins) : IKeyDownListener(this), IMouseMoveListener(this), IMouseClickedListener(this) { m = ins; }
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
+ if (!strcmp(ev->keyname, KEY_BACK))
+ elm_object_focus_set(m->eoSelectedBtnGroup, EINA_TRUE);
+ }
+ 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 OnMouseClicked(int id, Evas_Object *obj) {
+ CSourceCtxPopup::SCallback cb;
+ cb.cookie = m;
+ cb.onSelected = sm_CbCtxPopupSelected;
+
+ if (obj == m->eoBtnSource) {
+ CSourceCtxPopup* pCtxPopup = new CSourceCtxPopup;
+ m->pCtxPopup = pCtxPopup;
+ pCtxPopup->Create(m->eoBase, &cb);
+ }
+ else if (obj == m->eoBtnSort) {
+ CSortCtxPopup* pCtxPopup = new CSortCtxPopup;
+ m->pCtxPopup = pCtxPopup;
+ pCtxPopup->Create(m->eoBase, &cb);
+ }
+ }
+ } *pHandlerButton[TOTAL_TOP_BTNS];
+
+ class CHandlerGroup : public CListenerMgr, IMouseMoveListener, IKeyDownListener, IMouseClickedListener {
+ private:
+ SFbBaseView *m;
+ public:
+ CHandlerGroup(SFbBaseView *ins) :
+ IMouseMoveListener(this),
+ IKeyDownListener(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))
+ elm_exit();
+ }
+ virtual void OnMouseClicked(int id, Evas_Object *obj) {
+ if (m->eoSelectedBtnGroup == obj)
+ return;
+
+ elm_object_signal_emit(m->eoSelectedBtnGroup, FBR_SIGNAL_GROUP_UNSELECTED, "");
+ m->eoSelectedBtnGroup = obj;
+ elm_object_signal_emit(m->eoSelectedBtnGroup, FBR_SIGNAL_GROUP_SELECTED, "");
+
+ m->pFbBaseLayout->Update(false);
+ }
+ } *pHandlerGroup[TOTAL_GROUP_BTNS];
+};
+
+
+
+Evas_Object *_add_button(Evas_Object *box)
+{
+ Evas_Object *button;
+
+ if (!box)
+ return NULL;
+
+ button = elm_button_add(box);
+ if (!button)
+ return NULL;
+
+ evas_object_size_hint_weight_set(button,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(button);
+
+ return button;
+}
+
+void CFbBaseView::UpdateEmptyFocusSequence(void)
+{
+ int i;
+ _DBG("");
+
+ for (i = 0; i < TOTAL_GROUP_BTNS; i++)
+ elm_object_focus_next_object_set(m->eoBtnGroup[i], m->eoBtnSort, ELM_FOCUS_RIGHT);
+
+ elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_ALL], m->eoBtnSort, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->eoBtnSort, m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->eoBtnSource, m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_DOWN);
+
+ if (t_SelectedGroupButton() == m->eoBtnGroup[E_GRP_ALL]) {
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, _(NO_FILE_MESSAGE));
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, _(NO_FILE_MESSAGE_SUB));
+ }
+ else if (t_SelectedGroupButton() == m->eoBtnGroup[E_GRP_PHOTO]) {
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, _(NO_PHOTO_MESSAGE));
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, _(NO_PHOTO_MESSAGE_SUB));
+ }
+ else if (t_SelectedGroupButton() == m->eoBtnGroup[E_GRP_VIDEO]) {
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, _(NO_VIDEO_MESSAGE));
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, _(NO_VIDEO_MESSAGE_SUB));
+ }
+ else if (t_SelectedGroupButton() == m->eoBtnGroup[E_GRP_MUSIC]) {
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, _(NO_MUSIC_MESSAGE));
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, _(NO_MUSIC_MESSAGE_SUB));
+ }
+}
+
+void CFbBaseView::UnsetFocus(void)
+{
+ elm_object_focus_set(t_SelectedGroupButton(), EINA_TRUE);
+}
+
+void CFbBaseView::CbLinkApp(int type, int source_type, char *path)
+{
+ bundle *args;
+ int r;
+
+ args = bundle_create();
+ if (!args) {
+ _ERR("unable to create bundle");
+ return;
+ }
+
+ bundle_add(args, PARAM_SOURCE, source_arg[source_type]);
+ bundle_add(args, PARAM_URI, path);
+
+ r = aul_launch_app(linked_app[type], args);
+ if (args)
+ bundle_free(args);
+ if (r < 0) {
+ _ERR(" Unable to launch linked app");
+ return;
+ }
+
+ return;
+}
+
+void CFbBaseView::UpdatedGrid(void)
+{
+ int i;
+
+ for (i = 0; i < TOTAL_GROUP_BTNS; i++)
+ elm_object_focus_next_object_set(m->eoBtnGroup[i],
+ m->pFbBaseLayout->Grid(), ELM_FOCUS_RIGHT);
+
+ elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_ALL],
+ m->eoBtnSort, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->eoBtnSort,
+ m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m->eoBtnSort,
+ m->pFbBaseLayout->Grid(), ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->eoBtnSource,
+ m->pFbBaseLayout->Grid(), ELM_FOCUS_DOWN);
+
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, "");
+ elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, "");
+}
+
+void CFbBaseView::t_CreateTopSession(void)
+{
+ _DBG();
+ int i;
+ Evas_Object *btn;
+ struct _btn_info btninfo[TOTAL_TOP_BTNS];
+ btninfo[TOPBTN_SOURCE].style = FBR_STYLE_SOURCE_BTN;
+ btninfo[TOPBTN_SOURCE].part = FBR_PART_SOURCE_HOVERSEL;
+
+ btninfo[TOPBTN_SORT].style = FBR_STYLE_SORT_BTN;
+ btninfo[TOPBTN_SORT].part = FBR_PART_SORT_HOVERSEL;
+
+ elm_object_part_text_set(m->eoBase, FBR_PART_TITLE,
+ _(FBR_TEXT_TITLE));
+
+ for (i = 0; i < TOTAL_TOP_BTNS; i++) {
+ btn = _add_button(m->eoBase);
+ if (!btn) {
+ _ERR(" Adding btn failed ");
+ return;
+ }
+
+ elm_object_style_set(btn, btninfo[i].style);
+ elm_object_part_content_set(m->eoBase, btninfo[i].part, btn);
+
+ m->pHandlerButton[i]->Connect(btn);
+
+ if (i == TOPBTN_SOURCE)
+ m->eoBtnSource = btn;
+ else if (i == TOPBTN_SORT)
+ m->eoBtnSort = btn;
+ }
+
+ elm_object_text_set(m->eoBtnSource, _(CSourceCtxPopup::SourceText(CInfo::SourceType())));
+ elm_object_text_set(m->eoBtnSort, _(CSortCtxPopup::SortText(CInfo::SortType())));
+}
+
+void CFbBaseView::t_CreateLeftSession(void)
+{
+ _DBG();
+ Evas_Object *box, *ic;
+ int i;
+ char buf[MAX_LENGTH];
+ static struct _btn_info btninfo[TOTAL_GROUP_BTNS];
+ btninfo[E_GRP_ALL].txt = N_("ALL");
+ btninfo[E_GRP_ALL].icon_path = FBR_IMAGE_GRPBTN_ALL;
+ btninfo[E_GRP_PHOTO].txt = N_("PHOTO");
+ btninfo[E_GRP_PHOTO].icon_path = FBR_IMAGE_GRPBTN_PHOTO;
+ btninfo[E_GRP_VIDEO].txt = N_("VIDEO");
+ btninfo[E_GRP_VIDEO].icon_path = FBR_IMAGE_GRPBTN_VIDEO;
+ btninfo[E_GRP_MUSIC].txt = N_("MUSIC");
+ btninfo[E_GRP_MUSIC].icon_path = FBR_IMAGE_GRPBTN_MUSIC;
+
+ box = elm_box_add(m->eoBase);
+ if (!box)
+ return;
+ 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);
+ evas_object_show(box);
+
+ for (i = 0; i < TOTAL_GROUP_BTNS; i++) {
+ m->eoBtnGroup[i] = _add_button(box);
+ if (!m->eoBtnGroup[i]) {
+ _ERR(" failed to add button to box ");
+ continue;
+ }
+
+ elm_box_pack_end(box, m->eoBtnGroup[i]);
+ elm_object_style_set(m->eoBtnGroup[i], FBR_STYLE_GROUPBTN);
+ elm_object_text_set(m->eoBtnGroup[i], _(btninfo[i].txt));
+
+ m->pHandlerGroup[i]->Connect(m->eoBtnGroup[i]);
+ ic = elm_image_add(m->eoBtnGroup[i]);
+ if (!ic)
+ continue;
+ _DBG("");
+
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ btninfo[i].icon_path);
+ elm_image_file_set(ic, buf, NULL);
+ elm_object_part_content_set(m->eoBtnGroup[i],
+ FBR_PART_ELM_SWALLOWICON, ic);
+ }
+ _DBG("");
+
+ t_SetSelectedGroupButton(m->eoBtnGroup[E_GRP_ALL]);
+ _DBG("");
+
+ elm_object_signal_emit(m->eoBtnGroup[E_GRP_ALL],
+ FBR_SIGNAL_GROUP_SELECTED, "");
+ elm_object_focus_set(m->eoBtnGroup[E_GRP_ALL], EINA_TRUE);
+ elm_object_part_content_set(m->eoBase, FBR_PART_GROUPBTN_BOX, box);
+}
+
+void CFbBaseView::t_CreateFullView(void)
+{
+ t_CreateTopSession();
+ t_CreateLeftSession();
+ _DBG("UpdateLayout");
+ m->pFbBaseLayout->Update(false);
+}
+
+void CFbBaseView::t_SetSelectedGroupButton(Evas_Object* obj)
+{
+ m->eoSelectedBtnGroup = obj;
+ int idx = -1;
+
+ int a;
+ for (a = 0; a < TOTAL_GROUP_BTNS; a++) {
+ if (m->eoBtnGroup[a] == obj)
+ idx = a;
+ }
+ CInfo::SetGroupIndex(idx);
+}
+
+Evas_Object* CFbBaseView::t_SelectedGroupButton(void)
+{
+ return m->eoSelectedBtnGroup;
+}
+
+void CFbBaseView::t_OnShow(void)
+{
+ _DBG();
+
+ evas_object_show(m->eoBase);
+
+ CBaseView::t_OnShow();
+}
+
+void CFbBaseView::t_OnUpdate(void *data)
+{
+ _DBG();
+ m->pFbBaseLayout->Action();
+}
+
+void CFbBaseView::t_OnHide(void)
+{
+ evas_object_hide(m->eoBase);
+
+ CBaseView::t_OnHide();
+}
+
+bool CFbBaseView::Create(void *data)
+{
+ ASSERT(!m);
+
+ Evas_Object *eoWin = CViewMgr::GetInstance()->Window();
+ Evas_Object *eoBase = NULL;
+
+ int source_type = E_ALL;
+
+ _CREATE_BEGIN{
+ _CHECK(m = new SFbBaseView)
+ _CHECK(eoBase = elm_layout_add(eoWin))
+ _CHECK(elm_layout_file_set(eoBase, EDJEFILE, FBR_BASE_VIEW))
+ _COMMAND{
+ evas_object_size_hint_weight_set(eoBase, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(eoWin, eoBase);
+
+ /* get the source_type using 'data' string */
+ if (data) {
+ // Find Index
+ int i;
+ int arrsize = ARRAY_SIZE(source_arg);
+ for (i = 0; i < arrsize; i++) {
+ if (source_arg[i] && !strcmp(source_arg[i], (const char*)data)) {
+ source_type = i;
+ break;
+ }
+ }
+ if (source_type < E_ALL || source_type > E_USB)
+ source_type = E_ALL;
+ CInfo::SetSourceType(source_type);
+ m->eoWin = eoWin;
+ m->eoBase = eoBase;
+ }
+ }
+ _CHECK(m->pLayoutMgr = new CLayoutMgr)
+ _CHECK(m->pLayoutMgr->Create(eoBase, NULL))
+ _CHECK(m->pFbBaseLayout = new CFbBaseLayout(FB_BASE_LAYOUT))
+ _CHECK(m->pFbBaseLayout->Create(m->pLayoutMgr, NULL))
+ _CHECK(m->pLayoutMgr->AddLayout(m->pFbBaseLayout))
+ _CHECK(CUsbConnectionListener::Create())
+
+ _WHEN_SUCCESS{}
+
+ _CHECK_FAIL{ CUsbConnectionListener::Destroy(); }
+ _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbBaseLayout); }
+ _CHECK_FAIL{ m->pFbBaseLayout->Destroy(); }
+ _CHECK_FAIL{ delete m->pFbBaseLayout; m->pFbBaseLayout = NULL; }
+ _CHECK_FAIL{ m->pLayoutMgr->Destroy(); }
+ _CHECK_FAIL{ delete m->pLayoutMgr; m->pLayoutMgr = NULL; }
+ _CHECK_FAIL{ /* elm_layout_file_set*/ }
+ _CHECK_FAIL{ evas_object_del(eoBase); }
+ _CHECK_FAIL{ delete m; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+
+ // original create grid
+ m->pLayoutMgr->Show(FB_BASE_LAYOUT);
+ CInfo::SetSortType(0/*CSort::SORT_NAME_AZ*/);
+ evas_object_data_set(eoBase, BASE_VIEW_DATA, this);
+ t_CreateFullView();
+ elm_object_focus_allow_set(eoBase, EINA_FALSE);
+ m->pHandlerBase->Connect(eoBase);
+ CBaseView::Create(NULL);
+ return true;
+}
+
+void CFbBaseView::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+ CUsbConnectionListener::Destroy();
+
+ m->pLayoutMgr->RemoveLayout(m->pFbBaseLayout);
+ m->pFbBaseLayout->Destroy();
+ delete m->pFbBaseLayout;
+
+ m->pLayoutMgr->Destroy();
+ delete m->pLayoutMgr;
+
+ evas_object_del(m->eoBase);
+
+ delete m;
+ m = NULL;
+}
+
+
+Evas_Object* CFbBaseView::Base(void)
+{
+ ASSERT(m);
+
+ return m->eoBase;
+}
+
+
+void CFbBaseView::OnConnect(void)
+{
+ m->pPopup = new CPopup;
+ if (!m->pPopup)
+ return;
+ if (!m->pPopup->Create(m->eoBase)) {
+ delete m->pPopup;
+ m->pPopup = NULL;
+ return;
+ }
+
+ if (CInfo::SourceType() == E_USB) {
+ if (!FlagConnected()) {
+ CInfo::SetSourceType(E_ALL);
+ elm_object_text_set(m->eoBtnSource,
+ _(CSourceCtxPopup::SourceText(CInfo::SourceType())));
+ }
+ }
+}
+
+
+void CFbBaseView::OnUpdated(const SEntity *entity)
+{
+ m->pPopup->Destroy();
+ delete m->pPopup;
+ m->pPopup = NULL;
+
+ if (m->pCtxPopup) {
+ m->pCtxPopup->Destroy();
+ delete m->pCtxPopup;
+ m->pCtxPopup = NULL;
+ }
+ if (CInfo::SourceType() != E_TV) {
+ m->pFbBaseLayout->Update(false);
+ elm_object_focus_set(t_SelectedGroupButton(), 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 <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "dbg.h"
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+
+#include <AppCommon.h>
+#include "Mediadata.h"
+#include "ExtNameInfo.h"
+#include "SortName.h"
+#include "GengridItemClass.h"
+#include "InputHandler.h"
+#include "FileGrid.h"
+#include "Info.h"
+#include <BaseView.h>
+#include <InputHandler.h>
+#include <ViewMgr.h>
+#include "FbContextView.h"
+
+
+#define GENGRID_ITEM_SIZE_W (263 + 20)
+#define GENGRID_ITEM_SIZE_H (359 + 20)
+
+
+static Elm_Object_Item *_find_item_by_id(Eina_List *list, char *fid)
+{
+ Eina_List *l;
+ SItemInfo *pItemInfo;
+ void* obj;
+ char *id;
+
+ EINA_LIST_FOREACH(list, l, obj) {
+ pItemInfo = (SItemInfo *)obj;
+ id = pItemInfo->pInfo->Id();
+ if (id && !strcmp(id, fid))
+ return pItemInfo->item;
+ }
+
+ return NULL;
+}
+
+static SItemInfo *_find_item_info(Eina_List *list, Elm_Object_Item *item)
+{
+ Eina_List *l;
+ SItemInfo *pItemInfo;
+ void* obj;
+
+ EINA_LIST_FOREACH(list, l, obj) {
+ pItemInfo = (SItemInfo*)obj;
+ if (pItemInfo->item == item)
+ return pItemInfo;
+ }
+
+ return NULL;
+}
+
+
+struct SFileGrid {
+ CMediadata *pMediadata;
+
+ Evas_Object *eoWin;
+ Evas_Object *eoBase;
+ Evas_Object *eoGrid;
+
+ Eina_List *elFile;
+ Eina_List *elItemInfo;
+
+ CFileGrid::SCallback callback;
+
+ int depth;
+ SItemInfo *ctxt_itinfo;
+ SItemInfo *handle_itinfo;
+
+ char *fid;
+
+ CGengridItemClass *pGengridItemClass;
+
+ SFileGrid() {
+ memset(this, 0, sizeof(SFileGrid));
+ }
+};
+
+
+void CFileGrid::sm_CbRealized(void *data, Evas_Object *obj, void *event_info)
+{
+ _DBG();
+ if (!data || !obj || !event_info)
+ return;
+
+ elm_object_item_signal_callback_add((Elm_Object_Item*)event_info,
+ FBR_SIGNAL_BTN_CLICKED, FBR_BASE_VIEW,
+ sm_CbSelectItem, data);
+}
+
+void CFileGrid::sm_CbUnrealized(void *data, Evas_Object *obj, void *event_info)
+{
+ _DBG();
+ if (!data || !obj || !event_info)
+ return;
+
+ elm_object_item_signal_callback_del((Elm_Object_Item*)event_info,
+ FBR_SIGNAL_BTN_CLICKED, FBR_BASE_VIEW,
+ sm_CbSelectItem);
+}
+
+void CFileGrid::Action(void)
+{
+ m->handle_itinfo = m->ctxt_itinfo;
+ m_HandleSelection();
+ m_DeleteContextView();
+}
+
+void CFileGrid::m_DeleteContextView(void)
+{
+ if(CViewMgr::GetInstance()->CheckTop(FBR_CONTEXT_VIEW))
+ CViewMgr::GetInstance()->PopView();
+}
+
+void CFileGrid::sm_CbSelectItem(void *data, Elm_Object_Item *it, const char *emission, const char *source)
+{
+ CFileGrid* root = (CFileGrid*)data;
+ SItemInfo *pItemInfo;
+
+ if (!data || !it)
+ return;
+
+ pItemInfo = _find_item_info(root->m->elItemInfo, it);
+ if (!pItemInfo) {
+ _ERR(" no item info found ");
+ return;
+ }
+
+ root->m->handle_itinfo = pItemInfo;
+ root->m_HandleSelection();
+}
+
+void CFileGrid::m_HandleSelection(void)
+{
+ char *path;
+ int type;
+ char *id;
+ SItemInfo *pItemInfo = m->handle_itinfo;
+
+ if (!pItemInfo)
+ return;
+
+ type = pItemInfo->pInfo->Type();
+ if (type == E_GRP_FOLDER) {
+ if (m->fid) {
+ free(m->fid);
+ m->fid = NULL;
+ }
+ id = pItemInfo->pInfo->Id();
+ if (!id)
+ return;
+
+ m->fid = strdup(id);
+ if (!m->fid)
+ return;
+
+ elm_object_tree_focus_allow_set(m->eoBase, EINA_FALSE);
+ t_Update(m->fid, false);//_update_filegrid(m, m->fid, false);
+ elm_object_tree_focus_allow_set(m->eoBase, EINA_TRUE);
+ elm_object_focus_set(m->eoGrid, EINA_TRUE);
+ }
+ else {
+ path = pItemInfo->pInfo->Path();
+ if (!path)
+ return;
+
+ if (m->callback.cbLinkApp)
+ m->callback.cbLinkApp(m->callback.cookie, type, CInfo::SourceType(), path);
+ elm_gengrid_item_selected_set(pItemInfo->item, EINA_FALSE);
+ }
+}
+
+void CFileGrid::m_GetMediaList(char *fid)
+{
+ bool ret;
+ ret = m->pMediadata->GetMediaList(fid, CInfo::GroupIndex(), CInfo::SourceType(), &m->elFile);
+ if (ret == false) {
+ _ERR(" Fetching all list from file failed ");
+ return;
+ }
+}
+
+void CFileGrid::m_GetFolderList(void)
+{
+ bool ret;
+ ret = m->pMediadata->GetFolderList(CInfo::GroupIndex(), CInfo::SourceType(), &m->elFile);
+ if (ret == false) {
+ _ERR(" Fetching all list from file failed ");
+ return;
+ }
+}
+
+void CFileGrid::t_CreateFileGrid(void)
+{
+ Evas_Object *grid;
+
+ grid = elm_gengrid_add(m->eoBase);
+ if (!grid)
+ return;
+ evas_object_size_hint_weight_set(grid,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_gengrid_align_set(grid, 0, 0);
+ elm_object_part_content_set(m->eoBase, FBR_PART_MEDIA_GRID, grid);
+
+
+ Connect(grid);
+
+ evas_object_smart_callback_add(grid, FBR_SIGNAL_REALIZED, sm_CbRealized, this);
+ evas_object_smart_callback_add(grid, FBR_SIGNAL_UNREALIZED, sm_CbUnrealized, this);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
+ elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
+
+ m->eoGrid = grid;
+
+ m->pGengridItemClass = new CGengridItemClass;
+ if (!m->pGengridItemClass->Create()) {
+ delete m->pGengridItemClass;
+ m->pGengridItemClass = NULL;
+ evas_object_del(grid);
+ _ERR(" elm_genlist_item_class_new failed ");
+ return;
+ }
+
+ evas_object_show(grid);
+}
+
+
+void CFileGrid::t_Empty(bool sort_flag)
+{
+ if (m->eoGrid) {
+ elm_gengrid_clear(m->eoGrid);
+ evas_object_del(m->eoGrid);
+ m->eoGrid = NULL;
+ }
+
+ if (m->pGengridItemClass)
+ {
+ m->pGengridItemClass->Destroy();
+ delete m->pGengridItemClass;
+ m->pGengridItemClass = NULL;
+ }
+
+ if (sort_flag == false) {
+ eina_list_free(m->elFile);
+ m->elFile = NULL;
+ }
+
+ m->elItemInfo = NULL;
+ if (m->callback.cbUpdateEmptyFocusSequence)
+ m->callback.cbUpdateEmptyFocusSequence(m->callback.cookie);
+}
+
+
+void CFileGrid::t_Update(char *fid, bool sort_flag)
+{
+ _DBG("fid: %s, sort_flag: %d", fid, sort_flag);
+ t_Empty(sort_flag);
+ t_CreateFileGrid();
+
+ if (sort_flag == false) {
+ if (fid)
+ m_GetMediaList(fid);
+ else
+ m_GetFolderList();
+ }
+ m->elFile = CSortName::Sort(m->elFile, (CSortName::ESort)CInfo::SortType());
+ t_Fill();
+
+ if (fid) // folder
+ m->depth = 1;
+ else
+ m->depth = 0;
+}
+
+
+void CFileGrid::t_Fill(void)
+{
+ CExtNameInfo *pInfo;
+ Eina_List *l;
+ SItemInfo *pItemInfo;
+ void* obj;
+ int ts;
+
+ _DBG("grid: %x, flist: %x", m->eoGrid, m->elFile);
+ if (!m->eoGrid || !m->elFile)
+ return;
+
+ ts = eina_list_count(m->elFile);
+ _DBG("count: %d", ts);
+ if (ts == 0) {
+ t_Empty(false);
+ return;
+ }
+
+ EINA_LIST_FOREACH(m->elFile, l, obj) {
+ pInfo = (CExtNameInfo*)obj;
+ pItemInfo = (SItemInfo *)calloc(1, sizeof(SItemInfo));
+ if (!pItemInfo) {
+ t_Empty(false);
+ return;
+ }
+
+ pItemInfo->pInfo = pInfo;
+ pItemInfo->item = elm_gengrid_item_append(m->eoGrid, m->pGengridItemClass->Handle(), pItemInfo, NULL, m);
+ m->elItemInfo = eina_list_append(m->elItemInfo, pItemInfo);
+ }
+
+ if (m->callback.cbUpdatedGrid)
+ m->callback.cbUpdatedGrid(m->callback.cookie);
+}
+
+
+bool CFileGrid::Create(Evas_Object* win, Evas_Object *base, const SCallback *cb)
+{
+ ASSERT(!m);
+ ASSERT(cb);
+
+ _CREATE_BEGIN{
+ _CHECK(m = new SFileGrid)
+ _CHECK(m->pMediadata = new CMediadata )
+ _CHECK(m->pMediadata->Create())
+
+ _WHEN_SUCCESS{}
+
+ _CHECK_FAIL{ m->pMediadata->Destroy(); }
+ _CHECK_FAIL{ delete m->pMediadata; }
+ _CHECK_FAIL{ delete m; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+ m->eoWin = win;
+ m->eoBase = base;
+ m->callback = *cb;
+
+ return true;
+}
+
+
+void CFileGrid::Destroy(void)
+{
+ ASSERT(m);
+
+ t_Empty(false);
+
+ m_DeleteContextView();
+
+ free(m->fid);
+
+ m->pMediadata->Destroy();
+ delete m->pMediadata;
+ delete m;
+ m = NULL;
+}
+
+
+void CFileGrid::Update(bool sort_flag)
+{
+ ASSERT(m);
+
+ char* fid = NULL;
+ if (sort_flag == true) {
+ fid = m->fid;
+ }
+ t_Update(fid, sort_flag);
+}
+
+
+void CFileGrid::SetFocus(Eina_Bool flag)
+{
+ ASSERT(m);
+
+ elm_object_focus_set(m->eoGrid, flag);
+}
+
+
+Evas_Object* CFileGrid::Grid(void)
+{
+ ASSERT(m);
+
+ return m->eoGrid;
+}
+
+
+void CFileGrid::OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev) {
+ _DBG();
+ Elm_Object_Item *it;
+ SItemInfo *pItemInfo;
+
+ if (strcmp(ev->keyname, KEY_BACK) == 0) {
+ if (m->depth == 0) {
+ if (m->callback.cbUnsetFocus)
+ m->callback.cbUnsetFocus(m->callback.cookie);
+ }
+ else {
+ t_Update(NULL, false);
+ it = _find_item_by_id(m->elItemInfo, m->fid);
+ elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
+ elm_object_item_focus_set(it, EINA_TRUE);
+ }
+ }
+ else if (strcmp(ev->keyname, KEY_MENU) == 0) {
+ it = elm_object_focused_item_get(obj);
+ if (!it) {
+ _ERR(" unable to get focused item ");
+ return;
+ }
+ pItemInfo = _find_item_info(m->elItemInfo, it);
+ if (!pItemInfo)
+ return;
+
+ m->ctxt_itinfo = pItemInfo;
+
+ CViewMgr::GetInstance()->PushView(FBR_CONTEXT_VIEW, pItemInfo->pInfo);
+ }
+}
+
+
+void CFileGrid::OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
+ _DBG();
+ Elm_Object_Item *item;
+
+ if (!obj)
+ return;
+
+ item = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL, NULL);
+ if (!item)
+ return;
+
+ elm_object_item_focus_set(item, 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.
+*/
+
+#ifndef __FILE_GRID_H__
+#define __FILE_GRID_H__
+
+
+#include <InputHandler.h>
+
+
+class CFileGrid : public CListenerMgr, IMouseMoveListener, IKeyUpListener {
+private:
+ struct SFileGrid* m;
+
+public:
+ struct SCallback {
+ void(*cbUpdateEmptyFocusSequence)(void* cookie);
+ void(*cbUpdatedGrid)(void* cookie);
+ void(*cbUnsetFocus)(void* cookie);
+ void(*cbLinkApp)(void* cookie, int type, int source_type, char *path);
+ void* cookie;
+ };
+
+private:
+ static void sm_CbRealized(void *data, Evas_Object *obj, void *event_info);
+ static void sm_CbUnrealized(void *data, Evas_Object *obj, void *event_info);
+
+ void m_DeleteContextView(void);
+ static void sm_CbSelectItem(void *data, Elm_Object_Item *it, const char *emission, const char *source);
+
+ void m_HandleSelection(void);
+ void m_GetMediaList(char *pFolderId);
+ void m_GetFolderList(void);
+
+protected:
+ void t_CreateFileGrid(void);
+
+ void t_Empty(bool sort_flag);
+ void t_Update(char *fid, bool sort_flag);
+ void t_Fill(void);
+
+public:
+ CFileGrid() : IMouseMoveListener(this), IKeyUpListener(this), m(0) { }
+ virtual ~CFileGrid() { if (m) Destroy(); }
+
+ bool Create(Evas_Object* win, Evas_Object* base, const SCallback* cb);
+ virtual void Destroy(void);
+ void Update(bool sort_flag);
+
+ void SetFocus(Eina_Bool flag);
+ Evas_Object* Grid(void);
+ void Action(void);
+
+ //!
+ virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
+ //!
+ virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
+};
+
+
+#endif /* __FILE_GRID_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+#include "dbg.h"
+#include <media_content.h>
+#include "ExtNameInfo.h"
+#include "DirectoryInfo.h"
+#include "GengridItemClass.h"
+
+const char *typestr[] = {
+ N_(""),
+ N_("Photo"),
+ N_("Video"),
+ N_("Music"),
+ N_("Other"),
+ N_("Folder"),
+};
+
+void CGengridItemClass::sm_SetTypeimage(Evas_Object *img, int type)
+{
+ char buf[MAX_LENGTH];
+
+ if (!img)
+ return;
+
+ switch (type) {
+ case E_GRP_VIDEO:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_NORMAL_VIDEO);
+ break;
+ case E_GRP_MUSIC:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_NORMAL_MUSIC);
+ break;
+ default:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_NORMAL_OTHER);
+ break;
+ }
+
+ elm_image_file_set(img, buf, NULL);
+}
+
+Evas_Object *CGengridItemClass::sm_GetIcon(Evas_Object *obj, CExtNameInfo *pInfo)
+{
+ Evas_Object *icon;
+ char *path;
+
+ path = pInfo->Path();
+ if (!path)
+ return NULL;
+
+ icon = elm_icon_add(obj);
+ if (!icon)
+ return NULL;
+
+ elm_need_ethumb();
+ elm_icon_thumb_set(icon, path, NULL);
+ elm_image_aspect_fixed_set(icon, EINA_FALSE);
+
+ return icon;
+}
+
+Evas_Object *CGengridItemClass::sm_AddThumbnail(Evas_Object *obj, CExtNameInfo *pInfo)
+{
+ char *path;
+ char buf[MAX_LENGTH];
+ int type;
+ Evas_Object *img;
+
+ if (!obj || !pInfo)
+ return NULL;
+
+ type = pInfo->Type();
+ path = pInfo->ThumbnailPath();
+ _DBG("path: %x", path);
+
+ if (!path && type == E_GRP_PHOTO) {
+ img = sm_GetIcon(obj, pInfo);
+ return img;
+ }
+
+ img = elm_image_add(obj);
+ if (!img)
+ return NULL;
+ evas_object_show(img);
+
+ if (path) {
+ elm_image_file_set(img, path, "NULL");
+ elm_image_aspect_fixed_set(img, EINA_FALSE);
+ return img;
+ }
+
+ switch (type) {
+ case E_GRP_FOLDER:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_FOLDER);
+ break;
+ case E_GRP_VIDEO:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_VIDEO);
+ break;
+ case E_GRP_MUSIC:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_MUSIC);
+ break;
+ case E_GRP_OTHER:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_OTHER);
+ break;
+ }
+ elm_image_no_scale_set(img, EINA_TRUE);
+ elm_image_aspect_fixed_set(img, EINA_TRUE);
+ elm_image_file_set(img, buf, NULL);
+ return img;
+}
+
+
+char *CGengridItemClass::sm_CbTextGet(void *data, Evas_Object *obj, const char *part)
+{
+ if (!data || !obj)
+ return NULL;
+
+ SItemInfo *itinfo = (SItemInfo *)data;
+ CExtNameInfo *pInfo = itinfo->pInfo;
+
+ char *txt;
+ char buf[MAX_LENGTH];
+ int count;
+ int type;
+
+ if (!strcmp(part, "elm.text")) {
+ txt = pInfo->Name();
+ if (txt)
+ return strdup(txt);
+ }
+ else if (!strcmp(part, "elm.text1")) {
+ type = pInfo->Type();
+ if (type == E_GRP_FOLDER) {
+ CDirectoryInfo* pDirInfo = (CDirectoryInfo*)pInfo;
+ count = pDirInfo->Count();
+ snprintf(buf, sizeof(buf), "%d", count);
+ return strdup(buf);
+ }
+ else
+ return strdup(typestr[type]);
+ }
+
+ return NULL;
+}
+
+Evas_Object *CGengridItemClass::sm_CbContentGet(void *data, Evas_Object *obj, const char *part)
+{
+ CExtNameInfo *pInfo;
+ SItemInfo *itinfo;
+ Evas_Object *img;
+ int type;
+ char *path;
+
+ if (!data || !obj)
+ return NULL;
+
+ itinfo = (SItemInfo *)data;
+ pInfo = itinfo->pInfo;
+
+ if (!strcmp(part, "elm.swallow.icon")) {
+ img = sm_AddThumbnail(obj, pInfo);
+ return img;
+ }
+ else if (!strcmp(part, "elm.swallow.icon1")) {
+ type = pInfo->Type();
+ if (type == E_GRP_FOLDER || type == E_GRP_PHOTO)
+ return NULL;
+
+ path = pInfo->ThumbnailPath();
+ if (!path)
+ return NULL;
+
+ img = elm_image_add(obj);
+ if (!img)
+ return NULL;
+
+ sm_SetTypeimage(img, type);
+ elm_image_no_scale_set(img, EINA_TRUE);
+ evas_object_show(img);
+ return img;
+ }
+
+ return NULL;
+}
+
+void CGengridItemClass::sm_CbRemove(void *data, Evas_Object *obj)
+{
+ free(data);
+}
+
+bool CGengridItemClass::Create(void)
+{
+ if (m_pItemClass)
+ return false;
+
+ m_pItemClass = elm_gengrid_item_class_new();
+ if (!m_pItemClass) {
+ return false;
+ }
+
+ m_pItemClass->item_style = FBR_STYLE_MEDIA_GRID;
+ m_pItemClass->func.text_get = sm_CbTextGet;
+ m_pItemClass->func.content_get = sm_CbContentGet;
+ m_pItemClass->func.state_get = NULL;
+ m_pItemClass->func.del = sm_CbRemove;
+
+ return true;
+}
+
+void CGengridItemClass::Destroy(void)
+{
+ if (!m_pItemClass)
+ return;
+
+ elm_gengrid_item_class_free(m_pItemClass);
+ m_pItemClass = NULL;
+}
+
+Elm_Gengrid_Item_Class* CGengridItemClass::Handle(void)
+{
+ return m_pItemClass;
+}
--- /dev/null
+#ifndef __GENGRID_ITEM_CLASS_H__
+#define __GENGRID_ITEM_CLASS_H__
+
+
+struct SItemInfo {
+ CExtNameInfo *pInfo;
+ Elm_Object_Item *item;
+};
+
+class CGengridItemClass {
+protected:
+
+ Elm_Gengrid_Item_Class *m_pItemClass;
+
+private:
+
+ static void sm_SetTypeimage(Evas_Object *img, int type);
+ static Evas_Object *sm_GetIcon(Evas_Object *obj, CExtNameInfo *pInfo);
+ static Evas_Object *sm_AddThumbnail(Evas_Object *obj, CExtNameInfo *pInfo);
+
+ static char *sm_CbTextGet (void *data, Evas_Object *obj, const char *part);
+ static Evas_Object *sm_CbContentGet(void *data, Evas_Object *obj, const char *part);
+ static void sm_CbRemove (void *data, Evas_Object *obj);
+
+public:
+
+ CGengridItemClass() : m_pItemClass(NULL) {}
+ virtual ~CGengridItemClass() { }
+
+ bool Create(void);
+ virtual void Destroy(void);
+
+ Elm_Gengrid_Item_Class* Handle(void);
+};
+
+
+#endif /* __GENGRID_ITEM_CLASS_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+#include "ExtNameInfo.h"
+#include "Info.h"
+
+
+struct SInfo {
+ int group_index;
+ int source_type;
+ int sort_type;
+};
+
+static SInfo g_info;
+
+void CInfo::SetGroupIndex(int index)
+{
+ g_info.group_index = index;
+}
+
+int CInfo::GroupIndex(void)
+{
+ return g_info.group_index;
+}
+
+void CInfo::SetSourceType(int source_type)
+{
+ g_info.source_type = source_type;
+}
+
+int CInfo::SourceType(void)
+{
+ return g_info.source_type;
+}
+
+void CInfo::SetSortType(int type)
+{
+ g_info.sort_type = type;
+}
+
+int CInfo::SortType(void)
+{
+ return g_info.sort_type;
+}
--- /dev/null
+#ifndef __INFO_H__
+#define __INFO_H__
+
+
+class CInfo {
+public:
+
+ static void SetGroupIndex(int index);
+ static int GroupIndex(void);
+
+ static void SetSourceType(int source_type);
+ static int SourceType(void);
+
+ static void SetSortType(int type);
+ static int SortType(void);
+};
+
+
+#endif /* __INFO_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+
+#include "AppCommon.h"
+#include "define.h"
+#include "common.h"
+#include "dbg.h"
+#include "Popup.h"
+
+#define MAX_POPUP_TIME 10 /* seconds */
+#define POPUP_ICON_SIZE 48
+
+struct SPopup {
+ Evas_Object *popup;
+ Elm_Transit *transit;
+};
+
+bool CPopup::Create(Evas_Object* base)
+{
+ ASSERT(base);
+
+ if (m)
+ return false;
+
+ m = new SPopup;
+ if (!m)
+ return false;
+
+ Evas_Object *popup, *label, *icon;
+ double scale;
+ char buf[MAX_LENGTH];
+
+ popup = elm_popup_add(base);
+ if (!popup)
+ return NULL;
+
+ elm_object_style_set(popup, FBR_STYLE_LOADING_POPUP);
+ elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP_RIGHT);
+ elm_popup_timeout_set(popup, MAX_POPUP_TIME);
+ evas_object_show(popup);
+
+ label = elm_label_add(popup);
+ if (!label)
+ goto error;
+
+ elm_object_style_set(label, FBR_STYLE_LOADING_LABEL);
+ elm_object_text_set(label, _(FBR_TEXT_LOADING));
+ elm_object_content_set(popup, label);
+ scale = elm_config_scale_get();
+
+ icon = elm_icon_add(popup);
+ if (!icon)
+ goto error;
+
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, FBR_IMAGE_LOADING);
+ elm_image_file_set(icon, buf, NULL);
+ elm_image_animated_set(icon, EINA_TRUE);
+ elm_image_animated_play_set(icon, EINA_TRUE);
+ evas_object_size_hint_min_set(icon, POPUP_ICON_SIZE * scale,
+ POPUP_ICON_SIZE * scale);
+ elm_object_part_content_set(popup, FBR_POPUP_SWALLOW_ICON, icon);
+
+ m->transit = elm_transit_add();
+ if (!m->transit)
+ goto error;
+
+ elm_transit_object_add(m->transit, icon);
+ elm_transit_effect_rotation_add(m->transit, 0, 360);
+ elm_transit_duration_set(m->transit, 1);
+ elm_transit_repeat_times_set(m->transit, 5);
+ elm_transit_objects_final_state_keep_set(m->transit, EINA_TRUE);
+ elm_transit_go(m->transit);
+
+ return true;
+
+error:
+ evas_object_del(popup);
+
+ return false;
+}
+
+void CPopup::Destroy(void)
+{
+ if (!m)
+ return;
+
+ if (m->transit) {
+ elm_transit_del(m->transit);
+ }
+ evas_object_del(m->popup);
+
+ delete m;
+ m = NULL;
+}
--- /dev/null
+#ifndef __POPUP_H__
+#define __POPUP_H__
+
+
+class CPopup {
+private:
+
+ struct SPopup* m;
+
+public:
+
+ CPopup() : m(0) {}
+ virtual ~CPopup() { }
+
+ bool Create(Evas_Object* base);
+ virtual void Destroy(void);
+};
+
+
+#endif /* __POPUP_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+
+#include "Info.h"
+#include "CtxPopup.h"
+#include "SortCtxPopup.h"
+
+const char *sorttext[] = {
+ N_("Title A-Z"),
+ N_("Title Z-A"),
+ N_("Date ↓"),
+ N_("Date ↑"),
+ N_("Size ↓"),
+ N_("Size ↑"),
+};
+
+const char *sortbtnids[] = {
+ "Title A-Z",
+ "Title Z-A",
+ "Date Asc",
+ "Date Des",
+ "Size Asc",
+ "Size Des"
+};
+
+void CSortCtxPopup::t_OnConfiguration(void)
+{
+ t_SetList(sorttext, ARRAY_SIZE(sorttext), (int)CInfo::SortType(), CCtxPopup::TOPBTN_SORT, sortbtnids, FBR_PART_SORT_POPUP);
+}
+
+void CSortCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
+{
+ if (!obj)
+ return;
+
+ int index = -1;
+ const char *id = (const char*)evas_object_data_get(obj, FBR_BTN_ID);
+
+ if (!id)
+ return;
+
+ // Find Index
+ int i;
+ int arrsize = ARRAY_SIZE(sortbtnids);
+ for (i = 0; i < arrsize; i++) {
+ if (sortbtnids[i] && !strcmp(sortbtnids[i], id)) {
+ index = i;
+ break;
+ }
+ }
+
+ if (index == -1 || index == CInfo::SortType())
+ return;
+
+ CInfo::SetSortType(index);
+ CCtxPopup::t_OnBtnClicked(obj, ev);
+
+ Destroy(); //_destroy_ctxpopup(bd);
+}
+
+const char* CSortCtxPopup::SortText(int index)
+{
+ return sorttext[index];
+}
--- /dev/null
+#ifndef __SORT_CTX_POPUP_H__
+#define __SORT_CTX_POPUP_H__
+
+
+class CSortCtxPopup : public CCtxPopup {
+protected:
+
+ virtual void t_OnConfiguration(void);
+ virtual void t_OnBtnClicked(Evas_Object* obj, void* ev);
+
+public:
+
+ static const char* SortText(int index);
+};
+
+
+#endif /* __SORT_CTX_POPUP_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include <aul.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+
+#include "Info.h"
+#include "CtxPopup.h"
+#include "ManagerUsb.h"
+#include "SourceCtxPopup.h"
+
+const char *srcbtnids[] = {
+ "ALL",
+ "TV",
+ "USB"
+};
+
+const char *sourcetext[] = {
+ N_("All Source"),
+ N_("TV"),
+ N_("USB"),
+};
+
+void CSourceCtxPopup::t_OnConfiguration(void)
+{
+ int size = ARRAY_SIZE(sourcetext);
+
+ CUsbConnectionListener usb;
+ usb.Create();
+ if (!usb.FlagConnected())
+ size--;
+ usb.Destroy();
+ t_SetList(sourcetext, size, (int)CInfo::SourceType(), CCtxPopup::TOPBTN_SOURCE, srcbtnids, FBR_PART_SOURCE_POPUP);
+}
+
+
+void CSourceCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
+{
+ if (!obj)
+ return;
+
+ int index = -1;
+ const char *id = (const char*)evas_object_data_get(obj, FBR_BTN_ID);
+
+ if (!id)
+ return;
+
+ // Find Index
+ int i;
+ int arrsize = ARRAY_SIZE(srcbtnids);
+ for (i = 0; i < arrsize; i++) {
+ if (srcbtnids[i] && !strcmp(srcbtnids[i], id)) {
+ index = i;
+ break;
+ }
+ }
+ if (index == -1 || index == CInfo::SourceType())
+ return;
+
+ CInfo::SetSourceType(index);
+ CCtxPopup::t_OnBtnClicked(obj, ev);
+
+ Destroy();
+}
+
+const char* CSourceCtxPopup::SourceText(int index)
+{
+ return sourcetext[index];
+}
--- /dev/null
+#ifndef __SOURCE_CTX_POPUP_H__
+#define __SOURCE_CTX_POPUP_H__
+
+
+class CSourceCtxPopup : public CCtxPopup {
+protected:
+
+ virtual void t_OnConfiguration(void);
+ virtual void t_OnBtnClicked(Evas_Object* obj, void* ev);
+
+public:
+
+ static const char* SourceText(int index);
+};
+
+
+#endif /* __SOURCE_CTX_POPUP_H__ */
\ No newline at end of file
--- /dev/null
+#include <Elementary.h>\r
+#include "dbg.h"\r
+#include <AppCommon.h>\r
+#include "DummyContent.h"\r
+\r
+\r
+#define TOTAL_REL_CONTENTS 10
+
+
+/* Dummy content for testing. Actuals should come from app store */
+struct CDummyContent::SRelativeContent rltv_ctnt_list[] = {
+ {
+ "Rel Content 1",
+ "",
+ "CONTENT1"
+ },
+ {
+ "Rel Content 2",
+ "",
+ "CONTENT2"
+ },
+ {
+ "Rel Content 3",
+ "",
+ "CONTENT3"
+ },
+ {
+ "Rel Content 4",
+ "",
+ "CONTENT4"
+ },
+ {
+ "Rel Content 5",
+ "",
+ "CONTENT5"
+ },
+ {
+ "Rel Content 6",
+ "",
+ "CONTENT6"
+ },
+ {
+ "Rel Content 7",
+ "",
+ "CONTENT7"
+ },
+ {
+ "Rel Content 8",
+ "",
+ "CONTENT8"
+ },
+ {
+ "Rel Content 9",
+ "",
+ "CONTENT9"
+ },
+ {
+ "Rel Content 10",
+ "",
+ "CONTENT10"
+ }
+};
+
+
+Eina_List *CDummyContent::ListLinkApp(int type)
+{
+ /*Dummy function. Actual should come from app store*/
+ Eina_List *list = NULL;
+ int i;
+
+ for (i = 0; i < 2; i++)
+ list = eina_list_append(list, &rltv_ctnt_list[i]);
+
+ return list;
+}
+
+
+Eina_List *CDummyContent::ListRelative(int type)
+{
+ /*Dummy function. Actual should come from app store*/
+ Eina_List *list = NULL;
+ int i;
+
+ for (i = 0; i < TOTAL_REL_CONTENTS; i++)
+ list = eina_list_append(list, &rltv_ctnt_list[i]);
+
+ return list;
+}
--- /dev/null
+#ifndef __DUMMY_CONTENT_H__\r
+#define __DUMMY_CONTENT_H__\r
+\r
+\r
+class CDummyContent {\r
+public:\r
+ struct SRelativeContent {\r
+ const char *title;\r
+ const char *imgpath;\r
+ const char *link;\r
+ };\r
+\r
+public:\r
+ static Eina_List *ListLinkApp(int type);\r
+ static Eina_List *ListRelative(int type);\r
+};\r
+\r
+\r
+#endif /* __DUMMY_CONTENT_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.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <utilX.h>
+#include "i18n.h"
+#include "dbg.h"
+
+#include "AppCommon.h"
+#include "InputHandler.h"
+#include "define.h"
+#include "common.h"
+#include "ExtNameInfo.h"
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include "FbContextView.h"
+#include "Dummy/DummyContent.h"
+
+//#define _GET_PRIV(o) evas_object_data_get(o, "CTMDATA");
+//#define _SET_PRIV(o, data) evas_object_data_set(o, "CTMDATA", data);
+
+#define FBR_TEXT_SIZE N_("Size")
+#define FBR_TEXT_FORMAT N_("Format")
+#define FBR_TEXT_OPEN N_("OPEN")
+#define FBR_TEXT_LINK N_("Other linkable apps")
+#define FBR_TEXT_REL N_("Other apps for this type")
+#define EMPTY_STR ""
+#define TOTAL_CONTEXT_BTNS 5
+#define TABLE_MAX_COL 2
+#define MIN_LABEL_WIDTH 103
+#define FBR_CTXT_BTN_WPAD 26
+#define FBR_CTXT_TABLE_WPAD 14
+#define FBR_CTXT_TABLE_HPAD 14
+
+
+struct SContextView {
+ Evas_Object *eoWin;
+ Evas_Object *eoBase;
+ Evas_Object *eoBtnOpen;
+ Evas_Object *rel_first[TABLE_MAX_COL];
+ Evas_Object *rel_last[TABLE_MAX_COL];
+ Evas_Object *link_first[TABLE_MAX_COL];
+ Evas_Object *link_last[TABLE_MAX_COL];
+
+ CExtNameInfo *finfo;
+
+ CDummyContent content;
+
+ SContextView() {
+ eoWin = NULL;
+ eoBase = NULL;
+ eoBtnOpen = NULL;
+ int a;
+ for (a = 0; a < TABLE_MAX_COL; a++) {
+ rel_first[a] = NULL;
+ rel_last[a] = NULL;
+ link_first[a] = NULL;
+ link_last[a] = NULL;
+ }
+ finfo = NULL;
+ pHandlerButton = new SContextView::CHandlerButton(this);
+ }
+ ~SContextView() {
+ delete pHandlerButton;
+ }
+
+ class CHandlerButton : public CListenerMgr, IMouseMoveListener, IMouseUpListener, IKeyUpListener {
+ SContextView *m;
+ public:
+ CHandlerButton(SContextView *ins) : IMouseMoveListener(this), IMouseUpListener(this), IKeyUpListener(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 OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev) {
+ _DBG();
+ if (m->eoBtnOpen == obj) {
+ _DBG();
+ if (strcmp(ev->keyname, KEY_ENTER))
+ return;
+
+ CViewMgr::GetInstance()->UpdateView(FBR_BASE_VIEW, NULL);
+ }
+ else {
+ _DBG();
+ if (strcmp(ev->keyname, KEY_ENTER))
+ return;
+
+ elm_object_signal_emit(obj, FBR_SIGNAL_CONTENT_CLICKED, FBR_CONTEXT_VIEW);
+ }
+ }
+ virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev) {
+ _DBG();
+ if (m->eoBtnOpen == obj) {
+ CViewMgr::GetInstance()->UpdateView(FBR_BASE_VIEW, NULL);
+ }
+ else {
+ elm_object_signal_emit(obj, FBR_SIGNAL_CONTENT_CLICKED, FBR_CONTEXT_VIEW);
+ }
+ }
+ } *pHandlerButton;
+};
+
+
+extern const char *typestr[];
+
+
+void CContextView::_lbl_start_slide(Evas_Object *lbl)
+{
+ elm_label_ellipsis_set(lbl, EINA_FALSE);
+ elm_label_slide_mode_set(lbl, ELM_LABEL_SLIDE_MODE_AUTO);
+ elm_label_slide_go(lbl);
+}
+
+void CContextView::_btn_focused(void *data, Evas_Object *obj, void *ev)
+{
+ _DBG();
+ if (!obj)
+ return;
+
+ elm_object_signal_emit(obj, FBR_SIGNAL_FOCUSED, FBR_CONTEXT_VIEW);
+
+}
+
+void CContextView::_btn_unfocused(void *data, Evas_Object *obj, void *ev)
+{
+ _DBG();
+ if (!obj)
+ return;
+
+ elm_object_signal_emit(obj, FBR_SIGNAL_UNFOCUSED, FBR_CONTEXT_VIEW);
+}
+
+
+bool CContextView::_add_btn_label(Evas_Object *btn, const char *txt)
+{
+ Evas_Object *lbl;
+ char buf[MAX_LENGTH];
+
+ if (!btn || !txt)
+ return false;
+
+ lbl = elm_label_add(btn);
+ if (!lbl) {
+ _ERR("elm_label_add failed.");
+ return false;
+ }
+
+ snprintf(buf, sizeof(buf),
+ "<align=center><color=#FFFFFFFF>"
+ "<font=%s>"
+ "<font_size=21>%s</font_size>"
+ "</font></color></align>", FONT_STYLE_MEDIUM, _(txt));
+ elm_object_text_set(lbl, buf);
+ elm_label_line_wrap_set(lbl, ELM_WRAP_WORD);
+ evas_object_size_hint_min_set(lbl, MIN_LABEL_WIDTH, 0);
+ elm_object_part_content_set(btn, FBR_PART_CTXT_BTNTEXT, lbl);
+
+ return true;
+}
+
+bool CContextView::_add_btn_icon(Evas_Object *btn, const char *icon)
+{
+ Evas_Object *img;
+ char buf[MAX_LENGTH];
+
+ if (!btn || !icon)
+ return false;
+
+ img = elm_image_add(btn);
+ if (!img) {
+ _ERR("elm_image_add failed.");
+ return false;
+ }
+
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, icon);
+ elm_image_file_set(img, buf, NULL);
+ elm_object_part_content_set(btn, FBR_PART_CTXT_BTNICON, img);
+
+ return true;
+}
+
+bool CContextView::_add_btn_info(Evas_Object *btn, const char *icon, const char *txt)
+{
+ if (!btn || !icon || !txt)
+ return false;
+
+ if (!_add_btn_icon(btn, icon))
+ return false;
+
+ if (!_add_btn_label(btn, txt))
+ return false;
+
+ return true;
+}
+
+
+Evas_Object *CContextView::_add_btnbox(Evas_Object *eoBase)
+{
+ Evas_Object *box;
+
+ if (!eoBase)
+ return NULL;
+
+ box = elm_box_add(eoBase);
+ if (!box) {
+ _ERR(" elm_box_add failed ");
+ return NULL;
+ }
+
+ elm_box_horizontal_set(box, EINA_TRUE);
+ elm_box_padding_set(box, FBR_CTXT_BTN_WPAD, 0);
+ elm_box_align_set(box, 0, 0.5);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ return box;
+}
+
+bool CContextView::_get_context_details(CExtNameInfo *pInfo, char **path, char **title, char *subtitle, char *subtitle2)
+{
+ char buf[MAX_LENGTH];
+ TSize size;
+ double size_mb;
+ int type;
+
+ if (!pInfo)
+ return false;
+
+ *title = pInfo->Name();
+ *path = pInfo->ThumbnailPath();
+ size = pInfo->Size();
+
+ size_mb = (double)size / (1024 * 1024); /* Convert to MB */
+
+ snprintf(buf, sizeof(buf), "%s : %f MB", _(FBR_TEXT_SIZE), size_mb);
+ strcpy(subtitle, buf);
+
+ type = pInfo->Type();
+ snprintf(buf, sizeof(buf), "%s : %s", _(FBR_TEXT_FORMAT), _(typestr[type]));
+ strcpy(subtitle2, buf);
+
+ return true;
+}
+
+Evas_Object *CContextView::_add_rltv_ctnt(Evas_Object *obj, const char *name, const char *icon)
+{
+ Evas_Object *ly, *img;
+ char buf[MAX_LENGTH];
+
+ if (!obj) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ ly = elm_layout_add(obj);
+ if (!ly) {
+ _ERR("elm_layout_add failed.");
+ return NULL;
+ }
+
+ elm_layout_file_set(ly, EDJEFILE, FBR_CONTEXT_APP);
+ evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ img = elm_image_add(ly);
+ if (!img) {
+ _ERR("elm_image_add failed.");
+ evas_object_del(ly);
+ return NULL;
+ }
+
+ if (!icon || !strcmp(icon, EMPTY_STR)) {
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, FBR_IMAGE_DEFAULT_APP);
+ elm_image_file_set(img, buf, NULL);
+ elm_image_no_scale_set(img, EINA_TRUE);
+ } else {
+ elm_image_file_set(img, icon, NULL);
+ elm_image_aspect_fixed_set(img, EINA_FALSE);
+ }
+
+ elm_object_part_content_set(ly, FBR_PART_CTXT_RELCTNT_ICON, img);
+ elm_object_part_text_set(ly, FBR_PART_CTXT_RELCTNT_NAME, name);
+ elm_object_focus_allow_set(ly, EINA_TRUE);
+
+ return ly;
+}
+
+
+Evas_Object *CContextView::_add_scroller(Evas_Object *eoBase)
+{
+ Evas_Object *scroller;
+
+ if (!eoBase) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ scroller = elm_scroller_add(eoBase);
+ if (!scroller) {
+ _ERR("elm_scroller_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+
+ return scroller;
+}
+
+Evas_Object *CContextView::_add_table(Evas_Object *eoBase)
+{
+ Evas_Object *table;
+
+ if (!eoBase) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ table = elm_table_add(eoBase);
+ if (!table) {
+ _ERR("elm_table_add failed.");
+ return NULL;
+ }
+
+ elm_table_homogeneous_set(table, EINA_TRUE);
+ elm_table_padding_set(table,
+ FBR_CTXT_TABLE_WPAD * elm_config_scale_get(),
+ FBR_CTXT_TABLE_HPAD * elm_config_scale_get());
+ evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(table);
+
+ return table;
+}
+
+
+Evas_Object *CContextView::_get_icon(Evas_Object *obj, CExtNameInfo *finfo)
+{
+ Evas_Object *icon;
+ char *path;
+
+ path = finfo->Path();
+ if (!path)
+ return NULL;
+
+ icon = elm_icon_add(obj);
+ if (!icon)
+ return NULL;
+
+ elm_need_ethumb();
+ elm_icon_thumb_set(icon, path, NULL);
+ elm_image_aspect_fixed_set(icon, EINA_FALSE);
+
+ return icon;
+}
+
+
+void CContextView::_set_default_thumb(Evas_Object *img, int type)
+{
+ char buf[MAX_LENGTH];
+
+ if (!img)
+ return;
+
+ switch (type) {
+ case E_GRP_FOLDER:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_FOLDER);
+ break;
+
+ case E_GRP_VIDEO:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_VIDEO);
+ break;
+
+ case E_GRP_MUSIC:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_MUSIC);
+ break;
+
+ default:
+ snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
+ FBR_IMAGE_DEFAULT_OTHER);
+ break;
+ }
+
+ elm_image_file_set(img, buf, NULL);
+ elm_image_no_scale_set(img, EINA_TRUE);
+}
+
+
+Evas_Object *CContextView::_create_lbl(Evas_Object *ly, char *title)
+{
+ Evas_Object *lbl;
+ const char *s;
+ char buf[MAX_LENGTH];
+
+ if (!title)
+ return NULL;
+
+ lbl = elm_label_add(ly);
+ if (!lbl) {
+ return NULL;
+ }
+
+ elm_object_style_set(lbl, FBR_STYLE_LABEL);
+ elm_label_ellipsis_set(lbl, EINA_TRUE);
+ s = edje_object_data_get(elm_layout_edje_get(ly),
+ FBR_DATA_TITLE_WIDTH);
+ if (s)
+ elm_label_wrap_width_set(lbl, atoi(s));
+ else
+ _ERR("No title width exist");
+
+ snprintf(buf, sizeof(buf),
+ "<align=left><color=#FFFFFFFF>"
+ "<font=%s>"
+ "<font_size=36>%s</font_size>"
+ "</font></color></align>", FONT_STYLE_BOLD, _(title));
+ elm_object_text_set(lbl, buf);
+ elm_label_slide_speed_set(lbl, FBR_TITLE_SLIDE_SPEED);
+
+ return lbl;
+}
+
+
+
+void CContextView::m_SetBtnDownFocus(Evas_Object *btn)
+{
+ ASSERT(m);
+
+ if (!m->link_first[0] && !m->rel_first[0]) {
+ elm_object_focus_next_object_set(btn, btn,
+ ELM_FOCUS_DOWN);
+ return;
+ }
+
+ if (m->link_first[0])
+ elm_object_focus_next_object_set(btn, m->link_first[0],
+ ELM_FOCUS_DOWN);
+ else
+ elm_object_focus_next_object_set(btn, m->rel_first[0],
+ ELM_FOCUS_DOWN);
+}
+
+
+void CContextView::m_SetLayoutFocusOrder(Evas_Object *btn)
+{
+ ASSERT(btn);
+
+ int i;
+ Evas_Object *obj;
+
+ if (m->link_first[0]) {
+ elm_object_focus_next_object_set(m->link_first[0], btn,
+ ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->link_first[0],
+ m->rel_first[0], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->link_first[1], btn,
+ ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->link_first[1],
+ m->rel_first[0], ELM_FOCUS_DOWN);
+ }
+
+ for (i = 0; i < TABLE_MAX_COL; i++) {
+ if (!m->rel_first[i])
+ continue;
+
+ obj = m->rel_first[i];
+ if (m->link_first[0])
+ elm_object_focus_next_object_set(obj, m->link_first[0],
+ ELM_FOCUS_UP);
+ else
+ elm_object_focus_next_object_set(obj, btn,
+ ELM_FOCUS_UP);
+ }
+}
+
+
+Evas_Object *CContextView::m_AddButton(Evas_Object *eoBase)
+{
+ ASSERT(eoBase);
+
+ Evas_Object *btn;
+
+ btn = elm_layout_add(eoBase);
+ if (!btn) {
+ _ERR("elm_layout_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(btn,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, 0.0, 0.5);
+
+ elm_layout_file_set(btn, EDJEFILE, FBR_CONTEXT_BTN);
+ elm_object_focus_allow_set(btn, EINA_TRUE);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_RIGHT);
+
+ evas_object_smart_callback_add(btn, FBR_SIGNAL_FOCUSED, _btn_focused, NULL);
+ evas_object_smart_callback_add(btn, FBR_SIGNAL_UNFOCUSED, _btn_unfocused, NULL);
+
+ evas_object_show(btn);
+ elm_object_focus_set(btn, EINA_TRUE);
+
+ return btn;
+}
+
+
+bool CContextView::m_AddTableContents(Evas_Object *table, Eina_List *list, enum content_app_type type)
+{
+ ASSERT(list);
+
+ int row, col;
+ Evas_Object *ly;
+ Eina_List *l;
+ CDummyContent::SRelativeContent *rctnt;
+ void* obj;
+
+ row = 0;
+ col = 0;
+
+ EINA_LIST_FOREACH(list, l, obj) {
+ rctnt = (CDummyContent::SRelativeContent *)obj;
+ ly = _add_rltv_ctnt(table, rctnt->title, rctnt->imgpath);
+ if (!ly)
+ continue;
+ //_SET_PRIV(ly, rctnt);
+ elm_table_pack(table, ly, col, row, 1, 1);
+ evas_object_show(ly);
+
+ evas_object_smart_callback_add(ly, FBR_SIGNAL_FOCUSED, _btn_focused, NULL);
+ evas_object_smart_callback_add(ly, FBR_SIGNAL_UNFOCUSED, _btn_unfocused, NULL);
+
+ m->pHandlerButton->Connect(ly);
+
+ if (row == 0) {
+ if (type == APP_LINKED)
+ m->link_first[col] = ly;
+ else
+ m->rel_first[col] = ly;
+ }
+
+ if (col == 0)
+ elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_LEFT);
+ else if (col == TABLE_MAX_COL - 1)
+ elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_RIGHT);
+
+ if (type == APP_LINKED)
+ m->link_last[col] = ly;
+ else
+ m->rel_last[col] = ly;
+
+ col++;
+ if (col >= TABLE_MAX_COL) {
+ row++;
+ col = 0;
+ }
+ }
+
+ return true;
+}
+
+
+bool CContextView::m_CreateContentApps(Eina_List *list, enum content_app_type type)
+{
+ if (!list)
+ return false;
+
+ Evas_Object *scroller, *table;
+ int r;
+
+ scroller = _add_scroller(m->eoBase);
+ if (!scroller) {
+ _ERR("_add_scroller failed.");
+ return false;
+ }
+
+ table = _add_table(scroller);
+ if (!table) {
+ _ERR("_add_table failed.");
+ evas_object_del(scroller);
+ return false;
+ }
+
+ r = m_AddTableContents(table, list, type);
+ if (!r) {
+ _ERR("m_AddTableContents failed.");
+ evas_object_del(scroller);
+ return false;
+ }
+
+ elm_object_content_set(scroller, table);
+
+ if (type == APP_LINKED)
+ elm_object_part_content_set(m->eoBase, FBR_PART_CTXT_LINK_AREA,
+ scroller);
+ else
+ elm_object_part_content_set(m->eoBase, FBR_PART_CTXT_REL_AREA,
+ scroller);
+
+ return true;
+}
+
+
+bool CContextView::m_CreateBtnsPart(void)
+{
+ Evas_Object *btn, *box;
+ box = _add_btnbox(m->eoBase);
+ if (!box)
+ return false;
+
+ btn = m_AddButton(box);
+ if (!btn) {
+ evas_object_del(box);
+ return false;
+ }
+ if (!_add_btn_info(btn, FBR_IMAGE_CTXT_OPEN, FBR_TEXT_OPEN)) {
+ evas_object_del(box);
+ return false;
+ }
+
+ m_SetBtnDownFocus(btn);
+ m_SetLayoutFocusOrder(btn);
+ elm_box_pack_end(box, btn);
+ m->eoBtnOpen = btn;
+
+ m->pHandlerButton->Connect(m->eoBtnOpen);
+
+ elm_object_part_content_set(m->eoBase, FBR_PART_CTXT_BTNAREA, box);
+
+ return true;
+}
+
+
+bool CContextView::m_CreateInfoPart(void)
+{
+ Evas_Object *img = NULL;
+ char *title = NULL;
+
+ char subtitle[MAX_LENGTH];
+ char subtitle2[MAX_LENGTH];
+
+ char *path = NULL;
+ Eina_List *rltvlist = NULL;
+ Eina_List *linkapplist = NULL;
+ int type;
+ Evas_Object *lbl = NULL;
+
+ if (!_get_context_details(m->finfo, &path, &title, subtitle, subtitle2))
+ return false;
+
+ type = m->finfo->Type();
+ if (!path) {
+ if (type == E_GRP_PHOTO) {
+ img = _get_icon(m->eoBase, m->finfo);
+ if (!img)
+ goto finish;
+ } else {
+ img = elm_image_add(m->eoBase);
+ if (!img)
+ goto finish;
+ _set_default_thumb(img, type);
+ }
+ } else {
+ img = elm_image_add(m->eoBase);
+ if (!img)
+ goto finish;
+ elm_image_file_set(img, path, NULL);
+ elm_image_aspect_fixed_set(img, EINA_FALSE);
+ }
+
+ elm_object_part_content_set(m->eoBase, FBR_PART_CTXT_ICON, img);
+
+ lbl = _create_lbl(m->eoBase, title);
+ if (lbl) {
+ elm_object_part_content_set(m->eoBase, FBR_PART_CTXT_TITLE, lbl);
+ _lbl_start_slide(lbl);
+ }
+
+ elm_object_part_text_set(m->eoBase, FBR_PART_CTXT_SUBTITLE, subtitle);
+ elm_object_part_text_set(m->eoBase, FBR_PART_CTXT_SUBTITLE2, subtitle2);
+
+ elm_object_part_text_set(m->eoBase, FBR_PART_CTXT_LINK_TEXT, _(FBR_TEXT_LINK));
+ linkapplist = CDummyContent::ListLinkApp(type);
+ if (linkapplist)
+ m_CreateContentApps(linkapplist, APP_LINKED);
+
+ elm_object_part_text_set(m->eoBase, FBR_PART_CTXT_REL_TEXT, _(FBR_TEXT_REL));
+ rltvlist = CDummyContent::ListRelative(type);
+ if (rltvlist)
+ m_CreateContentApps(rltvlist, APP_OTHER);
+
+finish:
+
+ return true;
+}
+
+
+void CContextView::sm_CbKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei)
+{
+ _DBG();
+ Evas_Event_Key_Down *ev;
+
+ if (!dt || !ei)
+ return;
+
+ ev = (Evas_Event_Key_Down *)ei;
+
+ if (!strcmp(ev->keyname, KEY_BACK))
+ {
+ CViewMgr::GetInstance()->PopView();
+ }
+ else if (!strcmp(ev->keyname, KEY_EXIT))
+ elm_exit();
+}
+
+void CContextView::t_OnShow(void)
+{
+ evas_object_show(m->eoBase);
+}
+
+void CContextView::t_OnHide(void)
+{
+ evas_object_hide(m->eoBase);
+}
+
+bool CContextView::Create(void *data)
+{
+ ASSERT(!m);
+
+ Evas_Object *eoBase = NULL;
+ Evas_Object *eoWin = CViewMgr::GetInstance()->Window();
+
+
+ _CREATE_BEGIN{
+ _CHECK(m = new SContextView)
+ _CHECK(eoBase = elm_layout_add(eoWin))
+ _CHECK(elm_layout_file_set(eoBase, EDJEFILE, FBR_CONTEXT_VIEW))
+ _COMMAND{ m->eoWin = eoWin; m->eoBase = eoBase; m->finfo = (CExtNameInfo*)data; }
+ _CHECK(m_CreateInfoPart())
+ _CHECK(m_CreateBtnsPart())
+
+ _WHEN_SUCCESS{
+ evas_object_event_callback_add(eoBase, EVAS_CALLBACK_KEY_DOWN, sm_CbKeyPressed, m);
+ }
+
+ _CHECK_FAIL{ /* m_CreateBtnsPart */ }
+ _CHECK_FAIL{ /* m_CreateInfoPart */ }
+ _CHECK_FAIL{}
+ _CHECK_FAIL{ evas_object_del(eoBase); }
+ _CHECK_FAIL{ delete m; m = NULL; }
+ } _CREATE_END_AND_CATCH{ return false; }
+
+ return true;
+}
+
+void CContextView::Destroy(void)
+{
+ ASSERT(m);
+
+ evas_object_del(m->eoBase);
+ delete m;
+ m = NULL;
+}
+
+Evas_Object* CContextView::Base(void)
+{
+ ASSERT(m);
+
+ return m->eoBase;
+}