tizen 2.3.1 release submit/tizen_2.3.1/20150915.072830 tizen_2.3.1_release
authorjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 12:38:02 +0000 (21:38 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 12:38:02 +0000 (21:38 +0900)
147 files changed:
AUTHORS [new file with mode: 0644]
CMakeLists.txt [changed mode: 0644->0755]
LICENSE [changed mode: 0644->0755]
NOTICE [deleted file]
data/CMakeLists.txt
data/edje/CMakeLists.txt
data/edje/all_apps_portrait.edc
data/edje/button_edit.edc [new file with mode: 0644]
data/edje/conf.edc [new symlink]
data/edje/group_4x4_portrait.edc
data/edje/index.edc [new file with mode: 0644]
data/edje/item_4x4.edc
data/edje/layout_portrait.edc
data/edje/pagecontrol.edc [deleted file]
data/icons/org.tizen.menu-screen.png [new file with mode: 0755]
data/images/CMakeLists.txt [new file with mode: 0644]
data/images/RM06_App tray_Btn_Uninstall.png [new file with mode: 0644]
data/images/RM06_App tray_Btn_Uninstall_press.png [new file with mode: 0644]
data/images/RM06_App_tray_edit_btn.png [new file with mode: 0644]
data/images/RM06_App_tray_edit_btn_press.png [new file with mode: 0644]
data/images/RM06_App_tray_setting.png [new file with mode: 0644]
data/images/RM06_App_tray_setting_press.png [new file with mode: 0644]
data/images/btn_edit_nor.9.png [new file with mode: 0644]
data/images/btn_edit_press.9.png [new file with mode: 0644]
data/images/default.png [new file with mode: 0644]
data/images/icon_btn_done_nor.png [new file with mode: 0644]
data/images/icon_btn_done_press.png [new file with mode: 0644]
data/images/icon_btn_edit_nor.png [new file with mode: 0644]
data/images/icon_btn_edit_press.png [new file with mode: 0644]
data/images/menu_badge_01.png [new file with mode: 0644]
data/images/page indicator.png [new file with mode: 0644]
data/images/page indicator_focus.png [new file with mode: 0644]
data/main_operation.launch [new file with mode: 0644]
data/org.tizen.menu-screen.desktop.in [deleted file]
data/org.tizen.menu-screen.xml.in
data/po/CMakeLists.txt [new file with mode: 0644]
data/po/ar.po [new file with mode: 0644]
data/po/az.po [new file with mode: 0644]
data/po/bg.po [new file with mode: 0644]
data/po/ca.po [new file with mode: 0644]
data/po/cs.po [new file with mode: 0644]
data/po/da.po [new file with mode: 0644]
data/po/de.po [new file with mode: 0755]
data/po/de_DE.po [new file with mode: 0644]
data/po/el_GR.po [new file with mode: 0644]
data/po/en.po [new file with mode: 0644]
data/po/en_PH.po [new file with mode: 0644]
data/po/en_US.po [new file with mode: 0644]
data/po/es_ES.po [new file with mode: 0644]
data/po/es_MX.po [new file with mode: 0644]
data/po/es_US.po [new file with mode: 0755]
data/po/et.po [new file with mode: 0644]
data/po/eu.po [new file with mode: 0644]
data/po/fa.po [new file with mode: 0755]
data/po/fi.po [new file with mode: 0644]
data/po/fr.po [new file with mode: 0755]
data/po/fr_CA.po [new file with mode: 0644]
data/po/fr_FR.po [new file with mode: 0644]
data/po/ga.po [new file with mode: 0644]
data/po/gl.po [new file with mode: 0644]
data/po/hi.po [new file with mode: 0644]
data/po/hr.po [new file with mode: 0644]
data/po/hu.po [new file with mode: 0644]
data/po/hy.po [new file with mode: 0644]
data/po/is.po [new file with mode: 0644]
data/po/it_IT.po [new file with mode: 0644]
data/po/ja_JP.po [new file with mode: 0644]
data/po/ka.po [new file with mode: 0644]
data/po/kk.po [new file with mode: 0644]
data/po/ko_KR.po [new file with mode: 0644]
data/po/lt.po [new file with mode: 0644]
data/po/lv.po [new file with mode: 0644]
data/po/mk.po [new file with mode: 0644]
data/po/nb.po [new file with mode: 0644]
data/po/nl.po [new file with mode: 0755]
data/po/nl_NL.po [new file with mode: 0644]
data/po/pl.po [new file with mode: 0644]
data/po/pt_BR.po [new file with mode: 0644]
data/po/pt_PT.po [new file with mode: 0644]
data/po/ro.po [new file with mode: 0644]
data/po/ru_RU.po [new file with mode: 0644]
data/po/sk.po [new file with mode: 0644]
data/po/sl.po [new file with mode: 0644]
data/po/sr.po [new file with mode: 0644]
data/po/sv.po [new file with mode: 0644]
data/po/th.po [new file with mode: 0755]
data/po/tr_TR.po [new file with mode: 0644]
data/po/uk.po [new file with mode: 0644]
data/po/ur.po [new file with mode: 0755]
data/po/uz.po [new file with mode: 0644]
data/po/zh_CN.po [new file with mode: 0644]
data/po/zh_HK.po [new file with mode: 0644]
data/po/zh_SG.po [new file with mode: 0644]
data/po/zh_TW.po [new file with mode: 0644]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/jobs [deleted file]
debian/org.tizen.menu-screen.install.in [deleted file]
debian/org.tizen.menu-screen.postinst [deleted file]
debian/rules [deleted file]
include/all_apps/db.h [new file with mode: 0644]
include/all_apps/layout.h
include/all_apps/list.h
include/all_apps/shortcut.h [new file with mode: 0644]
include/conf.h
include/db.h [new file with mode: 0644]
include/index.h
include/item.h
include/item_badge.h [new file with mode: 0644]
include/item_event.h
include/key.h [new file with mode: 0644]
include/layout.h
include/list.h
include/mapbuf.h
include/menu_screen.h
include/mouse.h
include/page.h
include/page_scroller.h
include/pkgmgr.h
include/popup.h
include/util.h
org.tizen.menu-screen.efl [new file with mode: 0755]
org.tizen.menu-screen.manifest [new file with mode: 0644]
packaging/org.tizen.menu-screen.changes [deleted file]
packaging/org.tizen.menu-screen.spec [changed mode: 0644->0755]
src/all_apps/db.c [new file with mode: 0644]
src/all_apps/layout.c
src/all_apps/list.c
src/all_apps/shortcut.c [new file with mode: 0644]
src/db.c [new file with mode: 0644]
src/index.c
src/item.c
src/item_badge.c [new file with mode: 0644]
src/item_event.c
src/key.c [new file with mode: 0644]
src/layout.c
src/list.c
src/mapbuf.c
src/menu_screen.c [changed mode: 0644->0755]
src/mouse.c
src/page.c
src/page_scroller.c
src/pkgmgr.c
src/popup.c
src/util.c

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..49e578b
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,3 @@
+Jin Yoon <jinny.yoon at samsung dot com>
+Junkyu Han <junkyu.han at samsung dot com>
+Youngjoo Park <yjoo93.part at samsung dot com>
old mode 100644 (file)
new mode 100755 (executable)
index 0c437bc..bf11187
@@ -2,22 +2,36 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(menu-screen C)
 
 SET(PACKAGE_NAME "org.tizen.${PROJECT_NAME}")
-SET(PREFIX "/opt/apps/${PACKAGE_NAME}")
+SET(PREFIX "/usr/apps/${PACKAGE_NAME}")
 SET(EXEC_PREFIX "${PREFIX}/bin")
 SET(LIBDIR "${PREFIX}/lib")
-SET(DATADIR "${PREFIX}/data")
+SET(DATADIR "/opt${PREFIX}/data")
 SET(RESDIR "${PREFIX}/res")
+SET(ICONDIR "/usr/share/icons/default/small")
 SET(IMAGEDIR "${RESDIR}/images")
 SET(EDJEDIR "${RESDIR}/edje")
 SET(LOCALEDIR "${RESDIR}/locale")
 SET(VERSION 0.1.0)
 
+#IF("${ARCH}" STREQUAL "arm")
+#      OPTION(USE_ARM "Use Arm" ON)
+#      ADD_DEFINITIONS("-DARM_TYPE")
+#ELSE()
+#      OPTION(USE_EMULATOR "Use Emulator" ON)
+#      ADD_DEFINITIONS("-DEMULATOR_TYPE")
+#ENDIF()
+#MESSAGE("ARCH: ${ARCH}")
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(MENU_PKGS REQUIRED
        ail
+       appcore-efl
+       appsvc
        aul
+       badge
        bundle
        capi-appfw-application
+       capi-system-info
        dlog
        ecore
        ecore-evas
@@ -30,15 +44,22 @@ pkg_check_modules(MENU_PKGS REQUIRED
        eina
        elementary
        evas
-       heynoti
        pkgmgr
-       sysman
+       pkgmgr-info
+       shortcut
        syspopup-caller
        utilX
 )
 
+IF(USE_ARM)
+pkg_check_modules(ARM_PKGS REQUIRED
+       bincfg
+       factory
+)
+ENDIF()
+
 ADD_DEFINITIONS("-DENABLE_BGIMAGE")
-ADD_DEFINITIONS("-DLOG_TAG=\"menu-screen\"")
+ADD_DEFINITIONS("-DLOG_TAG=\"MENU_SCREEN\"")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
 ADD_DEFINITIONS("-DVERSION=\"${VERSION}\"")
@@ -52,14 +73,31 @@ FOREACH (flag ${MENU_PKGS_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+FOREACH(flag ${ARM_PKGS_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
+SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 std=c++0x -g -fPIE")
+SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
+SET(CMAKE_CXX_FLAGS_CCOV "-O2 std=c++0x -g --coverage -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 ADD_EXECUTABLE(${PROJECT_NAME}
+       src/db.c
        src/index.c
        src/item.c
+       src/item_badge.c
        src/item_event.c
+       src/key.c
        src/layout.c
        src/list.c
        src/mapbuf.c
@@ -70,15 +108,18 @@ ADD_EXECUTABLE(${PROJECT_NAME}
        src/pkgmgr.c
        src/popup.c
        src/util.c
+       src/all_apps/db.c
        src/all_apps/layout.c
        src/all_apps/list.c
+       src/all_apps/shortcut.c
 )
 
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ARM_PKGS_LDFLAGS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MENU_PKGS_LDFLAGS})
 
-# Install 
+# Install
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${EXEC_PREFIX})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_NAME}.efl DESTINATION /etc/smack/accesses.d)
 
 ADD_SUBDIRECTORY(data)
 
diff --git a/LICENSE b/LICENSE
old mode 100644 (file)
new mode 100755 (executable)
index 7ccb5b5..3d4a47d
--- a/LICENSE
+++ b/LICENSE
-Flora License
-
-Version 1.0, May, 2012
-
-http://www.tizenopensource.org/license
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Flora License to your work
-
-To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
 
    Copyright [yyyy] [name of copyright owner]
 
-   Licensed under the Flora License, Version 1.0 (the "License");
+   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.tizenopensource.org/license
+       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.
+
diff --git a/NOTICE b/NOTICE
deleted file mode 100644 (file)
index e69de29..0000000
index e743f02d6e18be58bf23d3aac34c716fa94e9640..9c423e5257f5281f65b4f3fdea0f70c21564d374 100644 (file)
@@ -1,9 +1,14 @@
-SET(MANIFESTDIR "/opt/share/packages")
+SET(MANIFESTDIR "/usr/share/packages")
 
 # manifest
 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
 
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/main_operation.launch DESTINATION ${RESDIR}/data)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/${PACKAGE_NAME}.png DESTINATION /usr/share/icons/default/small)
+
 ADD_SUBDIRECTORY(edje)
+ADD_SUBDIRECTORY(images)
+ADD_SUBDIRECTORY(po)
 
 # End of a file
index 2f3351ea49318335fe77c3210155c23227472edc..2e334a08ff0797fb0145c97bf1ee9fe7cfe43044 100644 (file)
@@ -1,3 +1,13 @@
+ADD_CUSTOM_TARGET(index.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../images ${EDJE_CFLAGS}
+               ${CMAKE_CURRENT_SOURCE_DIR}/index.edc index.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/index.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} index.edj)
+INSTALL(FILES index.edj DESTINATION ${EDJEDIR})
+
+
+
 ADD_CUSTOM_TARGET(item_4x4.edj
                COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../images ${EDJE_CFLAGS}
                ${CMAKE_CURRENT_SOURCE_DIR}/item_4x4.edc item_4x4.edj
@@ -38,4 +48,14 @@ INSTALL(FILES layout_portrait.edj DESTINATION ${EDJEDIR})
 
 
 
+ADD_CUSTOM_TARGET(button_edit.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../images ${EDJE_CFLAGS}
+               ${CMAKE_CURRENT_SOURCE_DIR}/button_edit.edc button_edit.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/button_edit.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} button_edit.edj)
+INSTALL(FILES button_edit.edj DESTINATION ${EDJEDIR})
+
+
+
 # End of a file
index e7985ee85d6c738087ccf2b9e24f235a576acf77..4b2c759b14c1b43969504f843ed09abfe2f3049b 100644 (file)
@@ -1,28 +1,37 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
+#include "conf.edc"
+
+#define _BASE_HEIGHT 1280
 
 collections {
+       base_scale: 1.8;
        group {
                name: "all_apps";
                parts {
                        part {
                                name: "bg";
-                               type: RECT;
+                               type: SWALLOW;
                                scale: 1;
                                mouse_events: 1;
                                description {
@@ -32,7 +41,17 @@ collections {
                                        visible: 0;
                                }
                        }
-
+                       part {
+                               name: "indicator_spacer";
+                               type: SPACER;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 INDICATOR_HEIGHT_PROP; to, "bg"; }
+                               }
+                       }
                        part {
                                name: "index_bg";
                                type: RECT;
@@ -40,38 +59,50 @@ collections {
                                mouse_events: 0;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 50/1280; to, "bg";}
-                                       rel2 { relative: 1.0 154/1280; to, "bg";}
-                                       color: 0 0 0 255;
+                                       rel1 { relative: 0.0 80/_BASE_HEIGHT; to, "bg";} // 1280 - 70(indicator)
+                                       rel2 { relative: 1.0 184/_BASE_HEIGHT; to, "bg";} // 174 - 70
                                        visible: 0;
                                }
                        }
-            part {
-                name: "index";
-                type: SWALLOW;
-                mouse_events: 0;
-                description {
-                    state: "default" 0.0;
-                    align: 0.5 0.5;
-                                       rel1 { relative: 0.0 0.0; to, "index_bg";}
-                                       rel2 { relative: 1.0 1.0; to, "index_bg";}
+                       part {
+                               name: "index";
+                               type: SWALLOW;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       align: 0.5 0.5;
+                                       rel1 { relative: 0.2 0.0; to, "index_bg";}
+                                       rel2 { relative: 0.8 1.0; to, "index_bg";}
                                        visible: 1;
-                }   
-            }
-
-            part {
-               name: "content_bg";
-               type: RECT;
-               scale: 1;
-               mouse_events: 1;
-               description {
+                               }
+                       }
+                       part {
+                               name: "button_edit";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 154/1280; to, "bg"; }
-                                       rel2 { relative: 1.0 1214/1280; to, "bg"; }
+                                       align: 0.5 0.5;
+                                       rel1 { relative: 16/720 8/70; to, "index_bg";}
+                                       rel2 { relative: 144/720 62/70; to, "index_bg";}
+                                       fixed: 1 1;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "content_bg";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 194/_BASE_HEIGHT; to, "bg"; } // 154 - 70
+                                       rel2 { relative: 1.0 1224/_BASE_HEIGHT; to, "bg"; }
                                        color: 34 34 34 255;
                                        visible: 0;
-               }
-            }
+                               }
+                       }
 
                        part {
                                name: "content";
@@ -80,7 +111,7 @@ collections {
                                mouse_events: 1;
                                description {
                                        state: "default" 0.0;
-                    align: 0.5 0.0;
+                                       align: 0.5 0.0;
                                        rel1 { relative: 0.0 0.0; to, "content_bg";}
                                        rel2 { relative: 1.0 1.0; to, "content_bg";}
                                        visible: 1;
diff --git a/data/edje/button_edit.edc b/data/edje/button_edit.edc
new file mode 100644 (file)
index 0000000..fefa59f
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#define BUTTON_EDIT_BG_SIZE 98 56
+#define BUTTON_EDIT_BG_SIZE_MIN 45 30
+#define BUTTON_EDIT_IMAGE_SIZE 35 35
+#define BUTTON_EDIT_IMAGE_SIZE_MIN 17 17
+#define BUTTON_EDIT_W 128
+#define BUTTON_EDIT_H 80
+
+
+
+images {
+       image: "../images/btn_edit_nor.9.png" COMP;
+       image: "../images/btn_edit_press.9.png" COMP;
+       image: "../images/icon_btn_edit_press.png" COMP;
+       image: "../images/icon_btn_edit_nor.png" COMP;
+       image: "../images/icon_btn_done_press.png" COMP;
+       image: "../images/icon_btn_done_nor.png" COMP;
+}
+
+
+
+collections {
+       base_scale: 1.8;
+       group {
+               name: "button_edit";
+               parts {
+            part {
+                               name: "edit_button";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "enable" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                               description {
+                                       state: "hide" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                       }
+            part {
+                               name: "edit_button_bg";
+                               type: IMAGE;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 15/BUTTON_EDIT_W 12/BUTTON_EDIT_H; to, "edit_button"; }
+                                       rel2 { relative: 113/BUTTON_EDIT_W 68/BUTTON_EDIT_H; to, "edit_button"; }
+                                       min: BUTTON_EDIT_BG_SIZE_MIN;
+                                       fixed: 1 1;
+                                       image {
+                                               normal: "../images/btn_edit_nor.9.png";
+                                               border: 15 15 0 0;
+                                               middle: DEFAULT;
+                                               border_scale: 1;
+                                       }
+                                       color: 255 255 255 255;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "edit" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                               description {
+                                       state: "enable" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 255 255 255 255;
+                               }
+                               description {
+                                       state: "press" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "../images/btn_edit_press.9.png";
+                                       }
+                               }
+                               description {
+                                       state: "hide" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+            part {
+                name: "edit_button_image";
+                type: IMAGE;
+                               scale: 1;
+                mouse_events: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.5 0.5;
+                                       rel1 { relative: 46/BUTTON_EDIT_W 22/BUTTON_EDIT_H; to, "edit_button_bg";}
+                                       rel2 { relative: 81/BUTTON_EDIT_W 57/BUTTON_EDIT_H; to, "edit_button_bg";}
+                                       image {
+                                               normal: "../images/icon_btn_edit_nor.png";
+                                       }
+                                       min: BUTTON_EDIT_IMAGE_SIZE_MIN;
+                                       fixed: 1 1;
+                                       visible: 1;
+                }
+                               description {
+                                       state: "edit" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "../images/icon_btn_done_nor.png";
+                                       }
+                               }
+                description {
+                    state: "press" 0.0;
+                    inherit: "default" 0.0;
+                                       image {
+                                               normal: "../images/icon_btn_edit_press.png";
+                                       }
+                }
+                               description {
+                                       state: "edit_press" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "../images/icon_btn_done_press.png";
+                                       }
+                               }
+            }
+            part {
+                name: "edit_button_event";
+                type: RECT;
+                               scale: 1;
+                mouse_events: 1;
+                description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: -0.1 -0.1; to: "edit_button_bg"; }
+                                       rel2 { relative: 1.1 1.1; to: "edit_button_bg"; }
+                                       color: 0 0 0 0;
+                                       visible: 1;
+                }
+                               description {
+                                       state: "hide" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+            }
+                       part {
+                               name: "focus";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "edit_button_event"; }
+                                       rel2 { relative: 1.0 1.0; to: "edit_button_event"; }
+                                       fixed: 1 1;
+                                       visible: 1;
+                               }
+                       }
+            part {
+                name: "state_edit";
+                type: RECT;
+                               scale: 1;
+                mouse_events: 1;
+                description {
+                                       state: "default" 0.0;
+                                       visible: 0;
+                }
+                               description {
+                                       state: "edit" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+            }
+               }
+
+               programs {
+                       program {
+                               name: "edit_button,down";
+                               signal: "mouse,down,1";
+                               source: "edit_button_event";
+                               action: STATE_SET "press" 0.0;
+                               target: "edit_button_bg";
+                               after: "press_state";
+                       }
+                       program {
+                               name: "press_state";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"state_edit", st, 30, vl);
+                                       if (!strcmp(st, "default"))
+                                       {
+                                               set_state(PART:"edit_button_image", "press", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"edit_button_image", "edit_press", 0.0);
+                                       }
+                               }
+                               after: "edit_button,down,after";
+                       }
+                       program {
+                               name: "edit_button,down,after";
+                               action: SIGNAL_EMIT "edit_button,down" "menu";
+                       }
+
+                       program {
+                               name: "edit_button,up";
+                               signal: "mouse,up,1";
+                               source: "edit_button_event";
+                               action: STATE_SET "default" 0.0;
+                               target: "edit_button_bg";
+                               after: "edit_button,up,after";
+                       }
+                       program { // Edit or unedit in C codes.
+                               name: "edit_button,up,after";
+                               action: SIGNAL_EMIT "edit_button,up" "menu";
+                       }
+                       program { // This program is called from C.
+                               name: "release_state";
+                               signal: "edit_button,release";
+                               source: "menu";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"state_edit", st, 30, vl);
+                                       if (!strcmp(st, "default")) // Normal mode
+                                       {
+                                               set_state(PART:"edit_button_image", "default", 0.0);
+                                       }
+                                       else // Edit mode
+                                       {
+                                               set_state(PART:"edit_button_image", "edit", 0.0);
+                                       }
+                               }
+                       }
+
+                       program { // Edit mode
+                               name: "edit_button_state,edit";
+                               signal: "edit_button_state,edit";
+                               source: "menu";
+                               action: STATE_SET "edit" 0.0;
+                               target: "state_edit";
+                               target: "edit_button_bg";
+                               target: "edit_button_image";
+                       }
+                       program { // Normal mode
+                               name: "edit_button_state,unedit";
+                               signal: "edit_button_state,unedit";
+                               source: "menu";
+                               action: STATE_SET "default" 0.0;
+                               target: "state_edit";
+                               target: "edit_button_bg";
+                               target: "edit_button_image";
+                       }
+
+                       program {
+                               name: "edit_button,show";
+                               signal: "edit_button,show";
+                               source: "menu";
+                               action: STATE_SET "default" 0.0;
+                               target: "edit_button_bg";
+                               target: "edit_button_image";
+                               target: "edit_button_event";
+                       }
+                       program {
+                               name: "edit_button,hide";
+                               signal: "edit_button,hide";
+                               source: "menu";
+                               action: STATE_SET "hide" 0.0;
+                               target: "edit_button_bg";
+                               target: "edit_button_image";
+                               target: "edit_button_event";
+                       }
+               }
+       }
+}
+
+
+// End of file
diff --git a/data/edje/conf.edc b/data/edje/conf.edc
new file mode 120000 (symlink)
index 0000000..de97229
--- /dev/null
@@ -0,0 +1 @@
+../../include/conf.h
\ No newline at end of file
index a4a513265663d6589553c0f056205cf58833f1ec..ff7a34a2889632e634425d379a01c6ff154b7823 100644 (file)
@@ -1,22 +1,26 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
-
-#define MENU(part_name, p_relx, p_rely, relx, rely, n_relx, n_rely, ratio)  \
+#define MENU(part_name, p_relx, p_rely, relx, rely, n_relx, n_rely)  \
        part { \
                name: "menu_swallow_"part_name; \
                type: SWALLOW; \
                        state: "default" 0.0;   \
                        visible: 1; \
                        fixed: 1 1; \
-                       rel1 { relative: (relx)+(ratio) (rely)+(ratio); to, "bg"; } \
-                       rel2 { relative: (relx)+(ratio) (rely)+(ratio); to, "bg"; } \
+                       rel1 { relative: (relx) (rely); to, "bg"; } \
+                       rel2 { relative: (relx) (rely); to, "bg"; } \
                } \
                description { \
                        state: "prev" 0.0;      \
                        inherit: "default" 0.0; \
-                       rel1.relative: (p_relx)+(ratio) (p_rely)+(ratio); \
-                       rel2.relative: (p_relx)+(ratio) (p_rely)+(ratio); \
+                       rel1.relative: (p_relx) (p_rely); \
+                       rel2.relative: (p_relx) (p_rely); \
                } \
                description { \
                        state: "next" 0.0;      \
                        inherit: "default" 0.0; \
-                       rel1.relative: (n_relx)+(ratio) (n_rely)+(ratio); \
-                       rel2.relative: (n_relx)+(ratio) (n_rely)+(ratio); \
+                       rel1.relative: (n_relx) (n_rely); \
+                       rel2.relative: (n_relx) (n_rely); \
                } \
                description { \
                        state: "invisible" 0.0; \
                        inherit: "default" 0.0; \
                        visible: 0; \
-                       rel1.relative: (n_relx)+(ratio) (n_rely)+(ratio); \
-                       rel2.relative: (n_relx)+(ratio) (n_rely)+(ratio); \
+                       rel1.relative: (n_relx) (n_rely); \
+                       rel2.relative: (n_relx) (n_rely); \
                } \
        } \
 
                target: "menu_swallow_"part_name; \
        }
 
+#define ITEM_00_X (1.0/8.0)
+#define ITEM_00_Y (1.0/8.0)
+#define ITEM_01_X (3.0/8.0)
+#define ITEM_01_Y ITEM_00_Y
+#define ITEM_02_X (5.0/8.0)
+#define ITEM_02_Y ITEM_00_Y
+#define ITEM_03_X (7.0/8.0)
+#define ITEM_03_Y ITEM_00_Y
+
+#define ITEM_04_X ITEM_00_X
+#define ITEM_04_Y (3.0/8.0)
+#define ITEM_05_X ITEM_01_X
+#define ITEM_05_Y ITEM_04_Y
+#define ITEM_06_X ITEM_02_X
+#define ITEM_06_Y ITEM_04_Y
+#define ITEM_07_X ITEM_03_X
+#define ITEM_07_Y ITEM_04_Y
+
+#define ITEM_08_X ITEM_00_X
+#define ITEM_08_Y (5.0/8.0)
+#define ITEM_09_X ITEM_01_X
+#define ITEM_09_Y ITEM_08_Y
+#define ITEM_10_X ITEM_02_X
+#define ITEM_10_Y ITEM_08_Y
+#define ITEM_11_X ITEM_03_X
+#define ITEM_11_Y ITEM_08_Y
+
+#define ITEM_12_X ITEM_00_X
+#define ITEM_12_Y (7.0/8.0)
+#define ITEM_13_X ITEM_01_X
+#define ITEM_13_Y ITEM_12_Y
+#define ITEM_14_X ITEM_02_X
+#define ITEM_14_Y ITEM_12_Y
+#define ITEM_15_X ITEM_03_X
+#define ITEM_15_Y ITEM_12_Y
 
 collections {
+       base_scale: 1.8;
        group {
                name: "menu_bg";
                parts {
@@ -97,30 +137,22 @@ collections {
                                }
                        }
 
-                       MENU("0", -0.25, 0.0, 0.0, 0.0, 0.25, 0.0, 0.125)
-                       MENU("1", 0.0, 0.0, 0.25, 0.0, 0.50, 0.0, 0.125)
-                       MENU("2", 0.25, 0.0, 0.50, 0.0, 0.75, 0.0, 0.125)
-                       MENU("3", 0.50, 0.0, 0.75, 0.0, 0.0, 0.20, 0.125)
-
-                       MENU("4", 0.75, 0.0, 0.0, 0.20, 0.25, 0.20, 0.125)
-                       MENU("5", 0.0, 0.20, 0.25, 0.20, 0.50, 0.20, 0.125)
-                       MENU("6", 0.25, 0.20, 0.50, 0.20, 0.75, 0.20, 0.125)
-                       MENU("7", 0.50, 0.20, 0.75, 0.20, 0.0, 0.40, 0.125)
-
-                       MENU("8", 0.75, 0.20, 0.0, 0.40, 0.25, 0.40, 0.125)
-                       MENU("9", 0.0, 0.40, 0.25, 0.40, 0.50, 0.40, 0.125)
-                       MENU("10", 0.25, 0.40, 0.50, 0.40, 0.75, 0.40, 0.125)
-                       MENU("11", 0.50, 0.40, 0.75, 0.40, 0.0, 0.60, 0.125)
-
-                       MENU("12", 0.75, 0.40, 0.0, 0.60, 0.25, 0.60, 0.125)
-                       MENU("13", 0.0, 0.60, 0.25, 0.60, 0.50, 0.60, 0.125)
-                       MENU("14", 0.25, 0.60, 0.50, 0.60, 0.75, 0.60, 0.125)
-                       MENU("15", 0.50, 0.60, 0.75, 0.60, 1.0, 0.80, 0.125)
-
-                       MENU("16", 0.75, 0.60, 0.0, 0.80, 0.25, 0.80, 0.125)
-                       MENU("17", 0.0, 0.80, 0.25, 0.80, 0.50, 0.80, 0.125)
-                       MENU("18", 0.25, 0.80, 0.50, 0.80, 0.75, 0.80, 0.125)
-                       MENU("19", 0.50, 0.80, 0.75, 0.80, 1.0, 0.80, 0.125)
+                       MENU("0", ITEM_00_X, ITEM_00_Y, ITEM_00_X, ITEM_00_Y, ITEM_01_X, ITEM_01_Y)
+                       MENU("1", ITEM_00_X, ITEM_00_Y, ITEM_01_X, ITEM_01_Y, ITEM_02_X, ITEM_02_Y)
+                       MENU("2", ITEM_01_X, ITEM_01_Y, ITEM_02_X, ITEM_02_Y, ITEM_03_X, ITEM_03_Y)
+                       MENU("3", ITEM_02_X, ITEM_02_Y, ITEM_03_X, ITEM_03_Y, ITEM_04_X, ITEM_04_Y)
+                       MENU("4", ITEM_03_X, ITEM_03_Y, ITEM_04_X, ITEM_04_Y, ITEM_05_X, ITEM_05_Y)
+                       MENU("5", ITEM_04_X, ITEM_04_Y, ITEM_05_X, ITEM_05_Y, ITEM_06_X, ITEM_06_Y)
+                       MENU("6", ITEM_05_X, ITEM_05_Y, ITEM_06_X, ITEM_06_Y, ITEM_07_X, ITEM_07_Y)
+                       MENU("7", ITEM_06_X, ITEM_06_Y, ITEM_07_X, ITEM_07_Y, ITEM_08_X, ITEM_08_Y)
+                       MENU("8", ITEM_07_X, ITEM_07_Y, ITEM_08_X, ITEM_08_Y, ITEM_09_X, ITEM_09_Y)
+                       MENU("9", ITEM_08_X, ITEM_08_Y, ITEM_09_X, ITEM_09_Y, ITEM_10_X, ITEM_10_Y)
+                       MENU("10", ITEM_09_X, ITEM_09_Y, ITEM_10_X, ITEM_10_Y, ITEM_11_X, ITEM_11_Y)
+                       MENU("11", ITEM_10_X, ITEM_10_Y, ITEM_11_X, ITEM_11_Y, ITEM_12_X, ITEM_12_Y)
+                       MENU("12", ITEM_11_X, ITEM_11_Y, ITEM_12_X, ITEM_12_Y, ITEM_13_X, ITEM_13_Y)
+                       MENU("13", ITEM_12_X, ITEM_12_Y, ITEM_13_X, ITEM_13_Y, ITEM_14_X, ITEM_14_Y)
+                       MENU("14", ITEM_13_X, ITEM_13_Y, ITEM_14_X, ITEM_14_Y, ITEM_15_X, ITEM_15_Y)
+                       MENU("15", ITEM_14_X, ITEM_14_Y, ITEM_15_X, ITEM_15_Y, ITEM_15_X, ITEM_15_Y)
 
                        part {
                                name: "dim";
@@ -159,10 +191,6 @@ collections {
                        MENU_PROGRAM("13")
                        MENU_PROGRAM("14")
                        MENU_PROGRAM("15")
-                       MENU_PROGRAM("16")
-                       MENU_PROGRAM("17")
-                       MENU_PROGRAM("18")
-                       MENU_PROGRAM("19")
 
                        program {
                                name: "dim,on";
diff --git a/data/edje/index.edc b/data/edje/index.edc
new file mode 100644 (file)
index 0000000..713e382
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#define INDEX_PAGECONTROL_IND_INC 35 35
+#define INDEX_PAGECONTROL_IND_MIN_INC 35 35
+#define INDEX_PAGECONTROL_FONT_COLOR_INC 255 255 255
+#define INDEX_PAGECONTROL_FONT_SIZE_INC 18
+
+collections {
+   base_scale: 1.8;
+   group {
+      name: "elm/index/base/vertical/menuscreen/index";
+      alias: "elm/index/base/horizontal/menuscreen/index";
+      parts {
+         part { name: "clip";
+            type: RECT;
+            mouse_events: 0;
+            description { state: "default" 0.0;
+               visible:  0;
+               color: 255 255 255 0;
+            }
+            description { state: "active" 0.0;
+               visible:  1;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "elm.swallow.index.0";
+            type: SWALLOW;
+            scale: 1;
+            mouse_events: 0;
+            clip_to: "clip";
+            description {
+               state: "default" 0.0;
+               align: 0.5 0.5;
+               rel1.relative: 0 0;
+               rel2.relative: 1 1;
+            }
+         }
+         part { name: "elm.swallow.event.0";
+            type: SWALLOW;
+            mouse_events: 0;
+            repeat_events: 0;
+            description { state: "default" 0.0;
+               align: 0.5 0.5;
+            }
+         }
+      }
+      programs {
+         program { name: "active";
+            signal: "elm,state,active";
+            source: "elm";
+            action: STATE_SET "active" 0.0;
+            transition: DECELERATE 0.5;
+            target: "clip";
+         }
+         program { name: "inactive";
+            signal: "elm,state,inactive";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 0.5;
+            target: "clip";
+         }
+      }
+   }
+   group {
+      name: "elm/index/item/vertical/menuscreen/index";
+      alias: "elm/index/item_odd/vertical/menuscreen/index";
+      alias: "elm/index/item/horizontal/menuscreen/index";
+      alias: "elm/index/item_odd/horizontal/menuscreen/index";
+      images {
+         image: "../images/page indicator.png" COMP;
+         image: "../images/page indicator_focus.png" COMP;
+      }
+      parts {
+         part { name:"bg";
+            type : RECT;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: INDEX_PAGECONTROL_IND_INC;
+               max: INDEX_PAGECONTROL_IND_INC;
+               visible: 0;
+               align: 0.5 0.5;
+            }
+         }
+         part { name: "indicator1";
+            type: IMAGE;
+            mouse_events: 0;
+            scale: 1;
+            description { state: "default" 0.0;
+               align: 0.5 0.5;
+               fixed: 1 1;
+               rel1.to: "bg";
+               rel2.to: "bg";
+               image {
+                  normal: "../images/page indicator.png";
+               }
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part { name: "indicator2";
+            type: IMAGE;
+            mouse_events: 0;
+            scale: 1;
+            description { state: "default" 0.0;
+               align: 0.5 0.5;
+               fixed: 1 1;
+               min: INDEX_PAGECONTROL_IND_MIN_INC;
+               max: INDEX_PAGECONTROL_IND_MIN_INC;
+               image.normal: "../images/page indicator_focus.png";
+               visible: 0;
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               min: INDEX_PAGECONTROL_IND_INC;
+               max: INDEX_PAGECONTROL_IND_INC;
+               visible: 1;
+            }
+         }
+         part { name: "elm.text";
+            type: TEXT;
+            mouse_events: 0;
+            scale: 1;
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               color: INDEX_PAGECONTROL_FONT_COLOR_INC 0;
+               align: 0.5 0.5;
+               text {
+                  font: "TIZEN:style=Bold";
+                  size: INDEX_PAGECONTROL_FONT_SIZE_INC;
+                  min: 0 1;
+                  //FIXME:values should be 0.5 0.5 when fonts are aligned correctly.
+                  align: 0.53 0.56;
+               }
+               rel1 { to: "indicator2"; }
+               rel2 { to: "indicator2"; }
+            }
+            description { state: "active" 0.0;
+               inherit: "default" 0.0;
+               color: INDEX_PAGECONTROL_FONT_COLOR_INC 255;
+            }
+         }
+      }
+      programs {
+         program { name: "active";
+            signal: "elm,state,active";
+            source: "elm";
+            action: STATE_SET "active" 0.0;
+            target: "indicator1";
+            target: "indicator2";
+            target: "elm.text";
+            transition: LINEAR 0.2;
+         }
+         program { name: "inactive";
+            signal: "elm,state,inactive";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "indicator1";
+            target: "indicator2";
+            target: "elm.text";
+            transition: LINEAR 0.2;
+         }
+      }
+   }
+}
index 03f1e056dd899792aa14339527063d1c273a7adf..541e59c56a54a9f993a5ad1e58ffc746eba3b139 100644 (file)
@@ -1,33 +1,49 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
+#include "conf.edc"
+
+#define _ITEM_HEIGHT 180.0
+#define _ITEM_WIDTH 198.0
 
 styles {
        style {
                name: "app_name_style";
-               base: "font=SLP:style=MEDIUM font_size=27 align=center valign=top color=#FFFFFF style=soft_shadow shadow_color=#00000060 ellipsis=1";
+               base: "font=TIZEN:style=MEDIUM font_size=27 align=center valign=top color=#FFFFFF style=soft_shadow shadow_color=#00000060 ellipsis=1";
 
                tag: "br" "\n";
        }
 }
 
+images {
+       image: "../images/RM06_App tray_Btn_Uninstall.png" COMP;
+       image: "../images/RM06_App tray_Btn_Uninstall_press.png" COMP;
+       image: "../images/menu_badge_01.png" COMP;
+}
+
 
 
 collections {
+       base_scale: 1.8;
        group {
                name: "icon";
 
@@ -41,47 +57,88 @@ collections {
                                        state: "default" 0.0;
                                        rel1 { relative: 0.0 0.0; }
                                        rel2 { relative: 1.0 1.0; }
-                                       color: 0 0 0 0;
+                                       fixed: 1 1;
+                                       visible: 0;
                                }
                        }
-
                        part {
-                               name: "icon_bg";
-                               type: RECT;
+                               name: "icon_image";
+                               type: SWALLOW;
                                scale: 1;
                                mouse_events: 1;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 48/180 30/180; to, "bg"; }
-                                       rel2 { relative: 132/180 114/180; to, "bg"; }
-                                       color: 0 0 0 0;
+                                       rel1 { relative: 31/_ITEM_WIDTH 0.0; to: "bg"; }
+                                       rel2 { relative: 148/_ITEM_WIDTH 117/_ITEM_HEIGHT; to: "bg"; }
+                                       align: 0.5 0.5;
+                                       //min: 117 117;
+                                       fixed: 1 1;
                                }
                        }
                        part {
-                               name: "icon_image";
-                               type: SWALLOW;
+                               name: "icon_image_event";
+                               type: RECT;
                                scale: 1;
                                mouse_events: 1;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; to, "icon_bg"; }
-                                       rel2 { relative: 1.0 1.0; to, "icon_bg"; }
+                                       /* Enlarge the starting point of Y for tester's request */
+                                       rel1 { relative: 0.0 0.0; to, "bg"; } //0.0 -0.1
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                                       color: 0 0 0 0;
+                                       visible: 1;
                                }
                        }
                        part {
-                               name: "icon_image_event";
-                               type: RECT;
+                               name: "badge";
+                               type: IMAGE;
                                scale: 1;
-                               mouse_events: 1;
+                               mouse_events: 0;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 15/180 10/180; to, "bg"; }
-                                       rel2 { relative: 165/180 160/180; to, "bg"; }
-                                       color: 0 0 0 0;
+                                       visible: 0;
+                                       rel1 { relative: 110/_ITEM_WIDTH 0.0; to, "bg"; }
+                                       rel2 { relative: 170/_ITEM_WIDTH 60/_ITEM_HEIGHT; to, "bg"; }
+                                       image {
+                                               normal: "../images/menu_badge_01.png";
+                                       }
+                               }
+                               description {
+                                       state: "badge" 0.0;
+                                       inherit: "default" 0.0;
                                        visible: 1;
                                }
                        }
 
+                       part {
+                               name: "badge,txt";
+                               type: TEXT;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       visible: 0;
+                                       rel1 { relative: 0.1 0.1; to, "badge"; }
+                                       rel2 { relative: 0.9 0.9; to, "badge"; }
+                                       align: 0.5 0.5;
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 35;
+                                       color3: 0 0 0 35;
+                                       text {
+                                               text_class: "tizen";
+                                               font: "TIZEN:style=medium";
+                                               size: 12;
+                                               text: "1";
+                                               align: 0.5 0.5;
+                                               fit: 1 1;
+                                       }
+                               }
+                               description {
+                                       state: "badge" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
                        part {
                                name: "block_event";
                                type: RECT;
@@ -100,9 +157,38 @@ collections {
                                        visible: 0;
                                }
                        }
+                       part {
+                               name: "uninstall";
+                               type: IMAGE;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 13/_ITEM_WIDTH 3/_ITEM_HEIGHT; to, "bg"; }
+                                       rel2 { relative: 67/_ITEM_WIDTH 57/_ITEM_HEIGHT; to, "bg"; }
+                                       image {
+                                               normal: "../images/RM06_App tray_Btn_Uninstall.png";
+                                       }
+                                       //min: 54 54;
+                                       fixed: 1 1;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "edit,release" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "edit,press" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "../images/RM06_App tray_Btn_Uninstall_press.png";
+                                       }
+                                       visible: 1;
+                               }
+                       }
                        part {
                                name: "txt";
-                               //type: TEXTBLOCK;
                                type: TEXT;
                                effect: SOFT_SHADOW;
                                scale: 1;
@@ -110,22 +196,19 @@ collections {
                                description
                                {
                                        state: "default" 0.0;
-                                       //rel1 { relative: 0.0 120/180; to, "bg"; }
-                                       //rel2 { relative: 1.0 180/180; to, "bg"; }
-                                       rel1 { relative: 0.0 114/180; to, "bg"; }
-                                       rel2 { relative: 1.0 175/180; to, "bg"; }
-                                       align: 0.5 0.5;
+                                       rel1 { relative: 0.0 1.0; to_x, "bg"; to_y, "icon_image"; offset: 0 7; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                                       align: 0.5 0.0;
                                        color: 255 255 255 255;
                                        color2: 0 0 0 35;
                                        color3: 0 0 0 35;
                                        text {
-                                               //style: "app_name_style";
-                                               text_class: "menu_item";
-                                               font: "SLP:style=medium";
-                                               size: 16;
-                                               text: "Icon";
+                                               text_class: "tizen";
+                                               font: "TIZEN:style=medium";
+                                               size: 24;
                                                align: 0.5 0.1;
                                        }
+                                       visible: 1;
                                }
                                description
                                {
@@ -135,8 +218,59 @@ collections {
                                        color: 0 0 0 0;
                                }
                        }
+                       part {
+                               name: "focus";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       /* Enlarge the starting point of Y for tester's request */
+                                       rel1 { relative: 0.0 -0.1; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                                       fixed: 1 1;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "uninstall_event";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: -0.2 -0.2; to, "uninstall"; }
+                                       rel2 { relative: 1.1 1.1; to, "uninstall"; }
+                                       color: 0 0 0 0;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "edit,release" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "uninstall_focus";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "uninstall_event"; }
+                                       rel2 { relative: 1.0 1.0; to, "uninstall_event"; }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "edit,release" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
                }
-               
+
                programs {
                        program {
                                name: "item,down";
@@ -150,7 +284,84 @@ collections {
                                source: "icon_image_event";
                                action: SIGNAL_EMIT "item,up" "menu";
                        }
+                       program {
+                               name: "text,on";
+                               signal: "text,on";
+                               source: "menu";
+                               action: STATE_SET "default" 0.0;
+                               target: "txt";
+                       }
+                       program {
+                               name: "text,off";
+                               signal: "text,off";
+                               source: "menu";
+                               action: STATE_SET "hide" 0.0;
+                               target: "txt";
+                       }
+
+
+                       // Badge
+                       program {
+                               name: "badge,on";
+                               signal: "badge,on";
+                               source: "menu";
+                               action: STATE_SET "badge" 0.0;
+                               target: "badge";
+                               target: "badge,txt";
+                       }
+                       program {
+                               name: "badge,off";
+                               signal: "badge,off";
+                               source: "menu";
+                               action: STATE_SET "default" 0.0;
+                               target: "badge";
+                               target: "badge,txt";
+                       }
 
+                       program {
+                               name: "uninstall,on";
+                               signal: "uninstall,on";
+                               source: "menu";
+                               action: STATE_SET "edit,release" 0.0;
+                               target: "block_event";
+                               target: "uninstall";
+                               target: "uninstall_event";
+                               target: "uninstall_focus";
+                       }
+                       program {
+                               name: "uninstall,off";
+                               signal: "uninstall,off";
+                               source: "menu";
+                               action: STATE_SET "default" 0.0;
+                               target: "block_event";
+                               target: "uninstall";
+                               target: "uninstall_event";
+                               target: "uninstall_focus";
+                       }
+                       program {
+                               name: "uninstall,down";
+                               signal: "mouse,down,*";
+                               source: "uninstall_event";
+                               action: SIGNAL_EMIT "uninstall,down" "menu";
+                               after: "uninstall,down,after";
+                       }
+                       program {
+                               name: "uninstall,down,after";
+                               action: STATE_SET "edit,press" 0.0;
+                               target: "uninstall";
+                       }
+                       program {
+                               name: "uninstall,up";
+                               signal: "mouse,up,*";
+                               source: "uninstall_event";
+                               action: SIGNAL_EMIT "uninstall,up" "menu";
+                               after: "uninstall,up,after";
+                       }
+                       program {
+                               name: "uninstall,up,after";
+                               action: STATE_SET "edit,release" 0.0;
+                               target: "uninstall";
+                       }
                }
        } // group
 } // collections
index da4dff1768cea644962f76004866c5f41260806b..dc95b87b08b3d2e7df608beb85796889fe182510 100644 (file)
@@ -1,35 +1,65 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+styles {
+       style {
+               name: "factory_text_style_big";
+               base: "font=TIZEN:style=MEDIUM font_size=28 align=left valign=top color=#FFFFFF style=soft_shadow shadow_color=#00000060 ellipsis=1";
+
+               tag: "b" "+ font_weight=Bold";
+               tag: "u" "+ underline=on underline_color=#FFFFFF";
+       }
+       style {
+               name: "factory_text_style_small";
+               base: "font=TIZEN:style=MEDIUM font_size=10 align=left valign=top color=#FFFFFF style=soft_shadow shadow_color=#00000060 ellipsis=1";
+
+               tag: "b" "+ font_weight=Bold";
+               tag: "u" "+ underline=on underline_color=#FFFFFF";
+       }
+       style {
+               name: "factory_text_style_middle";
+               base: "font=TIZEN:style=MEDIUM font_size=17 align=left valign=top color=#FFFFFF style=soft_shadow shadow_color=#00000060 ellipsis=1";
+
+               tag: "b" "+ font_weight=Bold";
+               tag: "u" "+ underline=on underline_color=#FFFFFF";
+       }
+}
 
 
 
 collections {
+       base_scale: 1.8;
        group {
                name: "layout";
                parts {
                        part {
                                name: "bg";
-                               type: RECT;
+                               type: SWALLOW;
                                scale: 1;
                                mouse_events: 1;
                                description {
                                        state: "default" 0.0;
                                        rel1 { relative: 0.0 0.0; }
                                        rel2 { relative: 1.0 1.0; }
-                                       color: 0 0 0 0;
                                        visible: 0;
                                }
                        }
@@ -45,9 +75,152 @@ collections {
                                        visible: 1;
                                }
                        }
+
+                       part {
+                               name: "factory_bg";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.05 0.0;
+                                                       to_x: "bg";
+                                                       to_y: "factory_text";
+                                                       offset: 0 -15;
+                                       }
+                                       rel2 { relative: 0.95 1.0;
+                                                       to_x: "bg";
+                                                       to_y: "factory_text";
+                                                       offset: 0 15;
+                                       }
+                                       color: 0 0 0 125;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show_small" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show_middle" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "factory_text";
+                               type: TEXTBLOCK;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.1 0.9; to, "bg"; }
+                                       rel2 { relative: 0.1 0.9; to, "bg"; }
+                                       text {
+                                               style: "factory_text_style_big";
+                                               align: 0.0 0.5;
+                                               min: 1 1;
+                                       }
+                                       align: 0.0 1.0;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show_big" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show_small" 0.0;
+                                       inherit: "default" 0.0;
+                                       text {
+                                               style: "factory_text_style_small";
+                                       }
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show_middle" 0.0;
+                                       inherit: "default" 0.0;
+                                       text {
+                                               style: "factory_text_style_middle";
+                                       }
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "content,blocker";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 1;
+                               repeat_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: 0 0 0 0;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "block" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
                }
 
                programs {
+                       program {
+                               name: "block,content";
+                               signal: "block";
+                               source: "layout";
+                               action: STATE_SET "block" 0.0;
+                               target: "content,blocker";
+                       }
+                       program {
+                               name: "unblock,content";
+                               signal: "unblock";
+                               source: "layout";
+                               action: STATE_SET "default" 0.0;
+                               target: "content,blocker";
+                       }
+                       program {
+                               name: "factory_text,hide";
+                               signal: "hide";
+                               source: "factory_text";
+                               action: STATE_SET "default" 0.0;
+                               target: "factory_bg";
+                               target: "factory_text";
+                       }
+                       program {
+                               name: "factory_text,show";
+                               signal: "show";
+                               source: "factory_text";
+                               action: STATE_SET "show" 0.0;
+                               target: "factory_bg";
+                               target: "factory_text";
+                       }
+                       program {
+                               name: "factory_text,show_small";
+                               signal: "show_small";
+                               source: "factory_text";
+                               action: STATE_SET "show_small" 0.0;
+                               target: "factory_bg";
+                               target: "factory_text";
+                       }
+                       program {
+                               name: "factory_text,show_middle";
+                               signal: "show_middle";
+                               source: "factory_text";
+                               action: STATE_SET "show_middle" 0.0;
+                               target: "factory_bg";
+                               target: "factory_text";
+                       }
                }
        } // group
 } // collections
diff --git a/data/edje/pagecontrol.edc b/data/edje/pagecontrol.edc
deleted file mode 100644 (file)
index ebb5c31..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-
-collections {
-       group { 
-          name: "elm/pagecontrol/base/default";
-
-          parts {
-                 part {
-                        name: "bg";
-                        type: RECT;
-                        mouse_events: 1;
-                        scale: 1;
-                        description {
-                               state: "default" 0.0;
-                               color: 0 0 0 0;
-                        }
-                 }
-                 part {
-                        name: "elm.swallow.page";
-                        type: SWALLOW;
-                        mouse_events: 1;
-                        scale: 1;
-                        description {
-                               state: "default" 0.0;
-                               min: 332 32;
-                        }
-                 }
-          }
-       }
-
-       #define PAGE_ITEM(number) \
-       group { \
-          name: "elm/page/item/default_"number; \
-          images { \
-                 image: "../images/RM06_App tray_page indicator.png" COMP; \
-                 image: "../images/RM06_App tray_page indicator_focus.png" COMP; \
-          } \
-          parts { \
-                 part { \
-                        name: "bg"; \
-                        type: RECT; \
-                        mouse_events: 0; \
-                        scale: 1; \
-                        description { \
-                               state: "default" 0.0; \
-                               min: 44 40; \
-                               max: 44 40; \
-                               align: 0.5 0.5; \
-                               color: 0 0 0 0; \
-                        } \
-                 } \
-                 part { \
-                        name: "indicator_1"; \
-                        mouse_events: 0; \
-                        scale: 1; \
-                        description { \
-                               state: "default" 0.0; \
-                               min: 8 8; \
-                               max: 8 8; \
-                               fixed: 1 1; \
-                               align: 0.5 0.5; \
-                               visible: 1; \
-                               rel1 { to: "bg"; } \
-                               rel2 { to: "bg"; } \
-                               image { \
-                                  normal: "../images/RM06_App tray_page indicator.png"; \
-                               } \
-                        } \
-                        description { \
-                               state: "selected" 0.0; \
-                               inherit: "default" 0.0; \
-                               min: 8 8; \
-                               max: 8 8; \
-                               visible: 0; \
-                        } \
-                 } \
-                 part { \
-                        name: "indicator_2"; \
-                        mouse_events: 0; \
-                        scale: 1; \
-                        description { \
-                               state: "default" 0.0; \
-                               min: 8 8; \
-                               max: 8 8; \
-                               fixed: 1 1; \
-                               align: 0.5 0.5; \
-                               visible: 0; \
-                               rel1 { to: "bg"; } \
-                               rel2 { to: "bg"; } \
-                               image { \
-                                  normal: "../images/RM06_App tray_page indicator_focus.png"; \
-                               } \
-                        } \
-                        description { \
-                               state: "selected" 0.0; \
-                               inherit: "default" 0.0; \
-                               min: 8 8; \
-                               max: 8 8; \
-                               visible: 1; \
-                        } \
-                 } \
-          } \
-          programs { \
-                 program { \
-                        name: "indicator_on"; \
-                        signal: "elm,state,indicator,on"; \
-                        source: "elm"; \
-                        action: STATE_SET "selected" 0.0; \
-                        target: "indicator_1"; \
-                        target: "indicator_2"; \
-                 } \
-                 program { \
-                        name: "indicator_off"; \
-                        signal: "elm,state,indicator,off"; \
-                        source: "elm"; \
-                        action: STATE_SET "default" 0.0; \
-                        target: "indicator_1"; \
-                        target: "indicator_2"; \
-                 } \
-                 program { \
-                        name: "indicator_clicked"; \
-                        signal: "mouse,clicked,1"; \
-                        source: "bg"; \
-                        action: SIGNAL_EMIT "clicked" "indicator_clicked"; \
-                 } \
-          } \
-       } \
-
-       PAGE_ITEM(1)
-       PAGE_ITEM(2)
-       PAGE_ITEM(3)
-       PAGE_ITEM(4)
-       PAGE_ITEM(5)
-       PAGE_ITEM(6)
-       PAGE_ITEM(7)
-       PAGE_ITEM(8)
-       PAGE_ITEM(9)
-       PAGE_ITEM(10)
-}
diff --git a/data/icons/org.tizen.menu-screen.png b/data/icons/org.tizen.menu-screen.png
new file mode 100755 (executable)
index 0000000..ee06044
Binary files /dev/null and b/data/icons/org.tizen.menu-screen.png differ
diff --git a/data/images/CMakeLists.txt b/data/images/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cb60ac7
--- /dev/null
@@ -0,0 +1 @@
+INSTALL(FILES default.png DESTINATION ${IMAGEDIR})
diff --git a/data/images/RM06_App tray_Btn_Uninstall.png b/data/images/RM06_App tray_Btn_Uninstall.png
new file mode 100644 (file)
index 0000000..7145638
Binary files /dev/null and b/data/images/RM06_App tray_Btn_Uninstall.png differ
diff --git a/data/images/RM06_App tray_Btn_Uninstall_press.png b/data/images/RM06_App tray_Btn_Uninstall_press.png
new file mode 100644 (file)
index 0000000..2ac8311
Binary files /dev/null and b/data/images/RM06_App tray_Btn_Uninstall_press.png differ
diff --git a/data/images/RM06_App_tray_edit_btn.png b/data/images/RM06_App_tray_edit_btn.png
new file mode 100644 (file)
index 0000000..0674e9c
Binary files /dev/null and b/data/images/RM06_App_tray_edit_btn.png differ
diff --git a/data/images/RM06_App_tray_edit_btn_press.png b/data/images/RM06_App_tray_edit_btn_press.png
new file mode 100644 (file)
index 0000000..eefc4f9
Binary files /dev/null and b/data/images/RM06_App_tray_edit_btn_press.png differ
diff --git a/data/images/RM06_App_tray_setting.png b/data/images/RM06_App_tray_setting.png
new file mode 100644 (file)
index 0000000..1b357fc
Binary files /dev/null and b/data/images/RM06_App_tray_setting.png differ
diff --git a/data/images/RM06_App_tray_setting_press.png b/data/images/RM06_App_tray_setting_press.png
new file mode 100644 (file)
index 0000000..3858945
Binary files /dev/null and b/data/images/RM06_App_tray_setting_press.png differ
diff --git a/data/images/btn_edit_nor.9.png b/data/images/btn_edit_nor.9.png
new file mode 100644 (file)
index 0000000..1cb7440
Binary files /dev/null and b/data/images/btn_edit_nor.9.png differ
diff --git a/data/images/btn_edit_press.9.png b/data/images/btn_edit_press.9.png
new file mode 100644 (file)
index 0000000..8619ff3
Binary files /dev/null and b/data/images/btn_edit_press.9.png differ
diff --git a/data/images/default.png b/data/images/default.png
new file mode 100644 (file)
index 0000000..983c883
Binary files /dev/null and b/data/images/default.png differ
diff --git a/data/images/icon_btn_done_nor.png b/data/images/icon_btn_done_nor.png
new file mode 100644 (file)
index 0000000..a28bd95
Binary files /dev/null and b/data/images/icon_btn_done_nor.png differ
diff --git a/data/images/icon_btn_done_press.png b/data/images/icon_btn_done_press.png
new file mode 100644 (file)
index 0000000..cc9256f
Binary files /dev/null and b/data/images/icon_btn_done_press.png differ
diff --git a/data/images/icon_btn_edit_nor.png b/data/images/icon_btn_edit_nor.png
new file mode 100644 (file)
index 0000000..f79ea92
Binary files /dev/null and b/data/images/icon_btn_edit_nor.png differ
diff --git a/data/images/icon_btn_edit_press.png b/data/images/icon_btn_edit_press.png
new file mode 100644 (file)
index 0000000..aaaa7fa
Binary files /dev/null and b/data/images/icon_btn_edit_press.png differ
diff --git a/data/images/menu_badge_01.png b/data/images/menu_badge_01.png
new file mode 100644 (file)
index 0000000..f297f72
Binary files /dev/null and b/data/images/menu_badge_01.png differ
diff --git a/data/images/page indicator.png b/data/images/page indicator.png
new file mode 100644 (file)
index 0000000..28081e7
Binary files /dev/null and b/data/images/page indicator.png differ
diff --git a/data/images/page indicator_focus.png b/data/images/page indicator_focus.png
new file mode 100644 (file)
index 0000000..42beee6
Binary files /dev/null and b/data/images/page indicator_focus.png differ
diff --git a/data/main_operation.launch b/data/main_operation.launch
new file mode 100644 (file)
index 0000000..5bac5ca
--- /dev/null
@@ -0,0 +1,2 @@
+org.tizen.phone
+org.tizen.contacts
diff --git a/data/org.tizen.menu-screen.desktop.in b/data/org.tizen.menu-screen.desktop.in
deleted file mode 100644 (file)
index a762e53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Name=Simple Menu Screen
-Type=Application
-Exec=@EXEC_PREFIX@/@PROJECT_NAME@
-Icon=@PACKAGE_NAME@.png
-NoDisplay=True
-X-Tizen-TaskManage=False
-X-Tizen-Removable=False
index 732d48e5bed2fc3e45441aae798d341e46629a8f..75ab12492a8658b6fc0eec1796db3e992fd40213 100755 (executable)
@@ -1,10 +1,13 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="0.4.2" install-location="internal-only">\r
-       <label>Menu-screen</label>\r
-       <author email="jinny.yoon@samsung.com" href="www.samsung.com">Jin Yoon</author>\r
-       <author email="yjoo93.park@samsung.com" href="www.samsung.com">Youngjoo Park</author>\r
-       <description>Menu-screen Application</description>\r
-       <ui-application appid="@PACKAGE_NAME@" exec="@EXEC_PREFIX@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="false" categories="home-screen">\r
-               <label>Menu-screen</label>\r
-       </ui-application>\r
-</manifest>\r
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="1.2.5" install-location="internal-only" api-version="2.3.1">
+       <label>Simple Menu-screen</label>
+       <author email="jinny.yoon@samsung.com" href="www.samsung.com">Jin Yoon</author>
+       <author email="junkyu.han@samsung.com" href="www.samsung.com">Junkyu Han</author>
+       <author email="yjoo93.park@samsung.com" href="www.samsung.com">Youngjoo Park</author>
+       <description>Simple Menu-screen Application</description>
+       <ui-application appid="@PACKAGE_NAME@" exec="@EXEC_PREFIX@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="false">
+               <label>Simple Menu-screen</label>
+               <category name="http://tizen.org/category/homeapp"/>
+               <icon>/usr/share/icons/default/small/org.tizen.menu-screen.png</icon>
+       </ui-application>
+</manifest>
diff --git a/data/po/CMakeLists.txt b/data/po/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e804a6a
--- /dev/null
@@ -0,0 +1,76 @@
+# for i18n
+
+SET(POFILES
+       ar.po
+       az.po
+       bg.po
+       ca.po
+       cs.po
+       da.po
+       de.po
+       el_GR.po
+       en.po
+       en_PH.po
+       en_US.po
+       es_ES.po
+       es_US.po
+       et.po
+       eu.po
+       fi.po
+       fr_CA.po
+       fr.po
+       ga.po
+       gl.po
+       hi.po
+       hr.po
+       hu.po
+       hy.po
+       is.po
+       it_IT.po
+       ja_JP.po
+       ka.po
+       kk.po
+       ko_KR.po
+       lt.po
+       lv.po
+       mk.po
+       nb.po
+       nl.po
+       pl.po
+       pt_BR.po
+       pt_PT.po
+       ro.po
+       ru_RU.po
+       sk.po
+       sl.po
+       sr.po
+       sv.po
+       tr_TR.po
+       uk.po
+       uz.po
+       zh_CN.po
+       zh_HK.po
+       zh_TW.po
+       zh_SG.po
+)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+MESSAGE(STATUS "po files ---")
+FOREACH(pofile ${POFILES})
+       SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+       MESSAGE(STATUS "  ${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)
+
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/data/po/ar.po b/data/po/ar.po
new file mode 100644 (file)
index 0000000..319a578
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "تم"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "هل تريد إلغاء تثبيت %s؟"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "إلغاء التثبيت"
+
diff --git a/data/po/az.po b/data/po/az.po
new file mode 100644 (file)
index 0000000..b6bf270
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Tamam"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s silinsin?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Quraşdırılma ləğv edilsin"
+
diff --git a/data/po/bg.po b/data/po/bg.po
new file mode 100644 (file)
index 0000000..f82bad0
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Готово"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Деинсталиране на %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Деинсталиране"
+
diff --git a/data/po/ca.po b/data/po/ca.po
new file mode 100644 (file)
index 0000000..cc107cf
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Fet"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Desinstal·lar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstal·lar"
+
diff --git a/data/po/cs.po b/data/po/cs.po
new file mode 100644 (file)
index 0000000..792da6b
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Hot."
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Odinstalovat %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Odinstalovat"
+
diff --git a/data/po/da.po b/data/po/da.po
new file mode 100644 (file)
index 0000000..0acd840
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Udført"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Afinstallér %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Afinstallér"
+
diff --git a/data/po/de.po b/data/po/de.po
new file mode 100755 (executable)
index 0000000..b356e8b
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Fertig"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s deinstallieren?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Deinstallieren"
+
diff --git a/data/po/de_DE.po b/data/po/de_DE.po
new file mode 100644 (file)
index 0000000..f5f4d32
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Fertig"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s deinstallieren?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Deinstallieren"
\ No newline at end of file
diff --git a/data/po/el_GR.po b/data/po/el_GR.po
new file mode 100644 (file)
index 0000000..094af6f
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Τέλος"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Κατάργηση της εγκατάστασης του %s;"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Κατάργηση εγκατάστασης"
+
diff --git a/data/po/en.po b/data/po/en.po
new file mode 100644 (file)
index 0000000..43627f4
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Done"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Uninstall %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Uninstall"
+
diff --git a/data/po/en_PH.po b/data/po/en_PH.po
new file mode 100644 (file)
index 0000000..43627f4
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Done"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Uninstall %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Uninstall"
+
diff --git a/data/po/en_US.po b/data/po/en_US.po
new file mode 100644 (file)
index 0000000..43627f4
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Done"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Uninstall %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Uninstall"
+
diff --git a/data/po/es_ES.po b/data/po/es_ES.po
new file mode 100644 (file)
index 0000000..0678bb5
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Hecho"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "¿Desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
+
diff --git a/data/po/es_MX.po b/data/po/es_MX.po
new file mode 100644 (file)
index 0000000..279a111
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Realiz."
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "¿Desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
\ No newline at end of file
diff --git a/data/po/es_US.po b/data/po/es_US.po
new file mode 100755 (executable)
index 0000000..c83a4b6
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Aceptar"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "¿Desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
+
diff --git a/data/po/et.po b/data/po/et.po
new file mode 100644 (file)
index 0000000..ff243b2
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Valmis"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Kas desinstallida %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Deinstalli"
+
diff --git a/data/po/eu.po b/data/po/eu.po
new file mode 100644 (file)
index 0000000..9bbcfbe
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Egina"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Desinstalatu %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalatu"
+
diff --git a/data/po/fa.po b/data/po/fa.po
new file mode 100755 (executable)
index 0000000..e77e4a2
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "انجام شد"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "لغو نصب %s؟"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "لغو نصب"
diff --git a/data/po/fi.po b/data/po/fi.po
new file mode 100644 (file)
index 0000000..73c0bc1
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Valmis"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Poistetaanko kohteen %s asennus?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Poista asennus"
+
diff --git a/data/po/fr.po b/data/po/fr.po
new file mode 100755 (executable)
index 0000000..a08eb14
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Désinstaller %s ?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Désinstaller"
+
diff --git a/data/po/fr_CA.po b/data/po/fr_CA.po
new file mode 100644 (file)
index 0000000..a08eb14
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Désinstaller %s ?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Désinstaller"
+
diff --git a/data/po/fr_FR.po b/data/po/fr_FR.po
new file mode 100644 (file)
index 0000000..7977fd8
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Désinstaller %s ?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Désinstaller"
\ No newline at end of file
diff --git a/data/po/ga.po b/data/po/ga.po
new file mode 100644 (file)
index 0000000..58c44f0
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Déanta"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Díshuiteáil %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Díshuiteáil"
+
diff --git a/data/po/gl.po b/data/po/gl.po
new file mode 100644 (file)
index 0000000..d6b9554
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Feito"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Desexas desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
+
diff --git a/data/po/hi.po b/data/po/hi.po
new file mode 100644 (file)
index 0000000..463c733
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "पूर्ण"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s की स्थापना रद्द करें?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "स्थापना रद्द करें"
+
diff --git a/data/po/hr.po b/data/po/hr.po
new file mode 100644 (file)
index 0000000..abe4bc5
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Deinstalirati %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Deinstaliraj"
+
diff --git a/data/po/hu.po b/data/po/hu.po
new file mode 100644 (file)
index 0000000..a2deccc
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Kész"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Eltávolítja a(z) %s animált emotikont?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Eltávolítás"
+
diff --git a/data/po/hy.po b/data/po/hy.po
new file mode 100644 (file)
index 0000000..7c199dd
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Արված է"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Ապատեղադրե՞լ %s-ը:"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Ապատեղադրել"
+
diff --git a/data/po/is.po b/data/po/is.po
new file mode 100644 (file)
index 0000000..78593e2
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Lokið"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Fjarlægja %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Fjarlægja"
+
diff --git a/data/po/it_IT.po b/data/po/it_IT.po
new file mode 100644 (file)
index 0000000..ccaa8bc
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Fatto"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Disinstallare %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Disinstalla"
+
diff --git a/data/po/ja_JP.po b/data/po/ja_JP.po
new file mode 100644 (file)
index 0000000..3396a50
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "完了"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%sをアンインストールしますか?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "アンインストール"
+
diff --git a/data/po/ka.po b/data/po/ka.po
new file mode 100644 (file)
index 0000000..5143b50
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "შესრულდა"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "ამოინსტალირდეს %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "ინსტალაციის გაუქმება"
+
diff --git a/data/po/kk.po b/data/po/kk.po
new file mode 100644 (file)
index 0000000..42005b6
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Дайын"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s жою керек пе?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Жою"
+
diff --git a/data/po/ko_KR.po b/data/po/ko_KR.po
new file mode 100644 (file)
index 0000000..f7f6c2c
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "완료"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s을(를) 삭제할까요?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "삭제"
+
diff --git a/data/po/lt.po b/data/po/lt.po
new file mode 100644 (file)
index 0000000..357647f
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Atlikta"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Pašalinti „%s“?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Pašalinti"
+
diff --git a/data/po/lv.po b/data/po/lv.po
new file mode 100644 (file)
index 0000000..3aeba4d
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Gatavs"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Vai atinstalēt %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Atinstalēt"
+
diff --git a/data/po/mk.po b/data/po/mk.po
new file mode 100644 (file)
index 0000000..2ff16dc
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Готово"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Да се деинсталира %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Деинсталирај"
+
diff --git a/data/po/nb.po b/data/po/nb.po
new file mode 100644 (file)
index 0000000..e6961ca
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Utført"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Avinstallere %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Avinstaller"
\ No newline at end of file
diff --git a/data/po/nl.po b/data/po/nl.po
new file mode 100755 (executable)
index 0000000..2084f23
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Gereed"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s verwijderen?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Verwijderen"
+
diff --git a/data/po/nl_NL.po b/data/po/nl_NL.po
new file mode 100644 (file)
index 0000000..f29bdb7
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Gereed"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s verwijderen?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Verwijderen"
\ No newline at end of file
diff --git a/data/po/pl.po b/data/po/pl.po
new file mode 100644 (file)
index 0000000..092015d
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Gotowe"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Odinstalować %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Odinstaluj"
+
diff --git a/data/po/pt_BR.po b/data/po/pt_BR.po
new file mode 100644 (file)
index 0000000..c173dd4
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
+
diff --git a/data/po/pt_PT.po b/data/po/pt_PT.po
new file mode 100644 (file)
index 0000000..77e33c5
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Concluir"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Desinstalar %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Desinstalar"
+
diff --git a/data/po/ro.po b/data/po/ro.po
new file mode 100644 (file)
index 0000000..ba7787e
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Efectuat"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Dezinstalaţi %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Dezinstalare"
+
diff --git a/data/po/ru_RU.po b/data/po/ru_RU.po
new file mode 100644 (file)
index 0000000..576f9c2
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Готово"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Удалить %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Удалить"
+
diff --git a/data/po/sk.po b/data/po/sk.po
new file mode 100644 (file)
index 0000000..20559e2
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Hotovo"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Odinštalovať program %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Odinštalovať"
+
diff --git a/data/po/sl.po b/data/po/sl.po
new file mode 100644 (file)
index 0000000..cf4858b
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Končano"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Želite odstraniti %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Odstrani"
+
diff --git a/data/po/sr.po b/data/po/sr.po
new file mode 100644 (file)
index 0000000..e559c92
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Gotovo"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Deinstalirati %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Deinstaliraj"
+
diff --git a/data/po/sv.po b/data/po/sv.po
new file mode 100644 (file)
index 0000000..494db5b
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Klar"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Avinstallera %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Avinstallera"
+
diff --git a/data/po/th.po b/data/po/th.po
new file mode 100755 (executable)
index 0000000..57e613c
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "เรียบร้อย"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "ถอนการติดตั้ง %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "ลบการติดตั้ง"
diff --git a/data/po/tr_TR.po b/data/po/tr_TR.po
new file mode 100644 (file)
index 0000000..e0a2c44
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Tamam"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s kaldırılsın mı?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Kaldır"
+
diff --git a/data/po/uk.po b/data/po/uk.po
new file mode 100644 (file)
index 0000000..02250ae
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "Готово"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "Видалити %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Видалити"
+
diff --git a/data/po/ur.po b/data/po/ur.po
new file mode 100755 (executable)
index 0000000..08ede49
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "مکمل"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s نا تنصیب کریں؟"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "نا تنصیب کریں"
diff --git a/data/po/uz.po b/data/po/uz.po
new file mode 100644 (file)
index 0000000..6234c67
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "OK"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "%s olib tashlansinmi?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "Olib tashlash"
+
diff --git a/data/po/zh_CN.po b/data/po/zh_CN.po
new file mode 100644 (file)
index 0000000..e47a0ee
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "完成"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "是否卸载 %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "卸载"
+
diff --git a/data/po/zh_HK.po b/data/po/zh_HK.po
new file mode 100644 (file)
index 0000000..81236c8
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "完成"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "解除安裝 %s 嗎?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "解除安裝"
+
diff --git a/data/po/zh_SG.po b/data/po/zh_SG.po
new file mode 100644 (file)
index 0000000..781b4f0
--- /dev/null
@@ -0,0 +1,8 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "完成"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "是否卸载 %s?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "卸载"
\ No newline at end of file
diff --git a/data/po/zh_TW.po b/data/po/zh_TW.po
new file mode 100644 (file)
index 0000000..629d4db
--- /dev/null
@@ -0,0 +1,9 @@
+msgid "IDS_HS_BUTTON_DONE"
+msgstr "確定"
+
+msgid "IDS_AT_POP_UNINSTALL_PS_Q"
+msgstr "解除安裝 %s 嗎?"
+
+msgid "IDS_AT_BODY_UNINSTALL"
+msgstr "解除安裝"
+
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 6b877ed..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-org.tizen.menu-screen (1.0.13) unstable; urgency=low
-
-  * Git: apps/home/menu-screen
-  * Tag: menu-screen_1.0.13
-
-  * modify the vconf key for the selected menu-screen.
-
- -- Jin Yoon <jinny.yoon@samsung.com>  Tue, 21 Aug 2012 10:37:58 +0900
-
-org.tizen.menu-screen (1.0.12) unstable; urgency=low
-
-  * Git: apps/home/menu-screen
-  * Tag: menu-screen_1.0.12
-
-  * [Modify] Environment for ELM_ENGINE, ELM_FPS
-
- -- Jin Yoon <jinny.yoon@samsung.com>  Wed, 02 May 2012 19:00:43 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index 1a1fe81..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Source: menu-screen
-Section: utils
-Priority: extra
-Maintainer: Jin Yoon <jinny.yoon@samsung.com>
-Build-Depends: debhelper (>= 5), libelm-dev, libslp-utilx-dev, libslp-setting-dev, libefreet-dev, libslp-sysman-dev, libslp-pm-dev, dlog-dev, libecore-dev, libaul-1-dev, libpkgmgr-client-dev, syspopup-caller-dev, libheynoti-dev, libail-0-dev, librua-dev, libslp-shortcut-dev, menu-daemon, capi-appfw-application-dev
-Homepage: N/A
-Standards-Version: 0.1.0
-
-Package: org.tizen.menu-screen
-Section: utils
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libelm, libeina, libslp-utilx-0, libslp-setting-0, libefreet, libslp-sysman, libslp-pm-0, libdlog-0, libaul-1, libpkgmgr-client-0, syspopup-caller-0, libheynoti-0, libail-0, menu-daemon, capi-appfw-application
-Description: inhouse menu-screen
-
-Package: org.tizen.menu-screen-dbg
-Section: debug
-Architecture: any
-Depends: org.tizen.menu-screen (= ${Source-Version})
-Description: inhouse menu-screen (unstripped)
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/jobs b/debian/jobs
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/org.tizen.menu-screen.install.in b/debian/org.tizen.menu-screen.install.in
deleted file mode 100644 (file)
index 2f9f68e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/opt/apps/org.tizen.menu-screen/*
-/opt/share/packages/*
diff --git a/debian/org.tizen.menu-screen.postinst b/debian/org.tizen.menu-screen.postinst
deleted file mode 100644 (file)
index 129d28f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-INHOUSE_ID="5000"
-
-init_vconf()
-{
-       # for menu daemon
-       vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f
-
-       # for menu-screen
-       vconftool set -t int memory/idle_screen/top 0 -i -u 5000 -f
-       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f
-}
-
-
-
-init_vconf
-
-# End of a file
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index 7fb4408..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-CFLAGS += -Wall -fPIC -fpie
-CXXFLAGS +=  -Wall -fPIC -fpie
-LDFLAGS ?= 
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-       CXXFLAGS += -O0
-else
-       CFLAGS += -O2
-       CXXFLAGS += -O2
-endif
-
-ifneq (,$(findstring arm,$(DEB_HOST_ARCH)))
-       export ARCH = arm
-else
-       export ARCH = i686
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed -pie
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       # Add here commands to configure the package.
-       CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-
-       touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-       dh_testdir
-
-       # Add here commands to compile the package.
-       $(MAKE)
-       #docbook-to-man debian/wavplayer.sgml > wavplayer.1
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
-       done
-
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-
-       # Add here commands to clean up after the build process.
-       -$(MAKE) clean
-       rm -rf CMakeCache.txt
-       rm -rf CMakeFiles
-       rm -rf cmake_install.cmake
-       rm -rf Makefile
-       rm -rf install_manifest.txt
-
-       rm -rf data/CMakeCache.txt
-       rm -rf data/CMakeFiles
-       rm -rf data/cmake_install.cmake
-       rm -rf data/install_manifest.txt
-       rm -rf data/Makefile
-
-       rm -rf data/themes/CMakeCache.txt
-       rm -rf data/themes/CMakeFiles
-       rm -rf data/themes/cmake_install.cmake
-       rm -rf data/themes/install_manifest.txt
-       rm -rf data/themes/Makefile
-
-       rm -rf data/kdm/CMakeCache.txt
-       rm -rf data/kdm/CMakeFiles
-       rm -rf data/kdm/cmake_install.cmake
-       rm -rf data/kdm/install_manifest.txt
-       rm -rf data/kdm/Makefile
-                                       
-       rm -rf data/po/CMakeCache.txt
-       rm -rf data/po/CMakeFiles
-       rm -rf data/po/cmake_install.cmake
-       rm -rf data/po/install_manifest.txt
-       rm -rf data/po/Makefile
-                                       
-       rm -rf data/themes/*.edj
-       rm -rf data/*.edj
-       rm -rf *.so
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       # Add here commands to install the package into debian/wavplayer.
-       $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-#      dh_installchangelogs 
-#      dh_installdocs
-#      dh_installexamples
-       dh_install --sourcedir=debian/tmp
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=org.tizen.menu-screen-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/include/all_apps/db.h b/include/all_apps/db.h
new file mode 100644 (file)
index 0000000..08997d5
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_SCREEN_ALL_APPS_DB_H__
+#define __MENU_SCREEN_ALL_APPS_DB_H__
+
+#include "Elementary.h"
+#include "util.h"
+
+typedef struct _db_info {
+       long long rowid;
+       int type;
+       char *appid;
+       char *name;
+       char *content_info;
+       char *icon;
+} db_info;
+
+extern menu_screen_error_e all_apps_db_init(void);
+extern void all_apps_db_fini(void);
+
+extern Eina_List *all_apps_db_retrieve_all_info(void);
+extern void all_apps_db_unretrieve_info(db_info *info);
+extern void all_apps_db_unretrieve_all_info(Eina_List *list);
+
+extern long long all_apps_db_insert_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon);
+extern menu_screen_error_e all_apps_db_delete_shortcut(long long rowid);
+extern int all_apps_db_count_shortcut(const char *appid, const char *name);
+
+#endif // __MENU_SCREEN_ALL_APPS_DB_H__
+// End of file
index 71eac5073e781f2b2d134cf90547864460545e3d..f3d615196ed786500e24b1a85e9614ab32a894c4 100644 (file)
@@ -1,27 +1,35 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef _MENU_SCREEN_CONTROLBAR_ALL_APPS_H_
 #define _MENU_SCREEN_CONTROLBAR_ALL_APPS_H_
 
 #include <Evas.h>
 
-#define PAGE_MAX_APP 20
+#define PAGE_MAX_APP 16
+
+extern bool all_apps_layout_is_edited(Evas_Object *all_apps);
+extern void all_apps_layout_edit(Evas_Object *all_apps);
+extern void all_apps_layout_unedit(Evas_Object *all_apps);
 
 extern Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate);
 extern void all_apps_layout_destroy(Evas_Object *all_apps);
index 7197f509de78c0e624fe0c40884c545f8cad62ed..126aed85b79dc09b6a1e652294fc8db3e42a02c3 100644 (file)
@@ -1,25 +1,30 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_LIST_ALL_APPS_H__
 #define __MENU_SCREEN_LIST_ALL_APPS_H__
 
 extern app_list *all_apps_list_create(void);
+extern int all_apps_list_find_installed_time(const char *id);
 extern void all_apps_list_destroy(app_list *list);
 
 #endif //__MENU_SCREEN_LIST_ALL_APPS_H__
diff --git a/include/all_apps/shortcut.h b/include/all_apps/shortcut.h
new file mode 100644 (file)
index 0000000..2421671
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _MENU_SCREEN_ALL_APPS_SHORTCUT_H_
+#define _MENU_SCREEN_ALL_APPS_SHORTCUT_H_
+
+#include <Elementary.h>
+#include <stdbool.h>
+
+extern Evas_Object *all_apps_shortcut_add(Evas_Object *scroller, long long rowid, const char *pkgname, const char *exec, const char *name, const char *icon, int type);
+extern void all_apps_shortcut_remove(Evas_Object *item);
+
+extern menu_screen_error_e all_apps_shortcut_add_all(Evas_Object *scroller);
+
+extern bool all_apps_shortcut_init(Evas_Object *all_apps);
+extern void all_apps_shortcut_fini(void);
+
+#endif // _MENU_SCREEN_ALL_APPS_SHORTCUT_H_
+
+// End of a file
index 0df39be66947594923e1acbf49c74723fe18ec0d..47cb96c21fbccd563b0f41046d1a66746bba53cc 100644 (file)
@@ -1,30 +1,45 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef _MENU_SCREEN_CONF_H_
 #define _MENU_SCREEN_CONF_H_
 
-#define MAX_PAGE_NO 9
+#define MAX_PAGE_NO 10
 
 #define BASE_HEIGHT 1280.0f
 #define BASE_WIDTH 720.0f
 
-#define PAGE_PORTRAIT_HEIGHT 1060.0f
+#define INDICATOR_PORT_HEIGHT 70
+#define INDICATOR_HEIGHT_PROP (INDICATOR_PORT_HEIGHT/BASE_HEIGHT)
+
+#define PAGE_PORTRAIT_HEIGHT 1030.0f
+#define INDEX_HEIGHT 70
+
+#define ITEM_WIDTH 180.0 //180.0
+#define LITE_ITEM_WIDTH 90.0
+#define ITEM_WIDTH_PROP (ITEM_WIDTH/BASE_WIDTH)
+#define ITEM_HEIGHT 198.0 //198.0
+#define LITE_ITEM_HEIGHT 99.0
+#define ITEM_HEIGHT_PROP (ITEM_HEIGHT/BASE_HEIGHT)
 
 #endif // _MENU_SCREEN_CONF_H_
 
diff --git a/include/db.h b/include/db.h
new file mode 100644 (file)
index 0000000..5ec5bd9
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_SCREEN_DB_H__
+#define __MENU_SCREEN_DB_H__
+
+#include <stdbool.h>
+
+#include "util.h"
+
+typedef struct stmt stmt_h;
+
+extern stmt_h *db_prepare(const char *query);
+extern menu_screen_error_e db_bind_bool(stmt_h *handle, int idx, bool value);
+extern menu_screen_error_e db_bind_int(stmt_h *handle, int idx, int value);
+extern menu_screen_error_e db_bind_str(stmt_h *handle, int idx, const char *str);
+extern menu_screen_error_e db_next(stmt_h *handle);
+extern bool db_get_bool(stmt_h *handle, int index);
+extern int db_get_int(stmt_h *handle, int index);
+extern long long db_get_long_long(stmt_h *handle, int index);
+extern const char *db_get_str(stmt_h *handle, int index);
+extern menu_screen_error_e db_reset(stmt_h *handle);
+extern menu_screen_error_e db_finalize(stmt_h *handle);
+extern menu_screen_error_e db_exec(const char *query);
+extern long long db_last_insert_rowid(void);
+
+extern menu_screen_error_e db_open(const char *db_file);
+extern void db_close(void);
+
+extern menu_screen_error_e db_begin_transaction(void);
+extern menu_screen_error_e db_end_transaction(bool success);
+
+#endif // __MENU_SCREEN_DB_H__
+// End of file
index 1f3b75b7370f37a1be9e3d0bfc8772667100dbca..27ef1c0c893a23531aefb0c94e2d8949f8c963dd 100644 (file)
@@ -1,35 +1,39 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
-
-#ifndef __APP_TRAY_PAGE_CONTROL_H__
-#define __APP_TRAY_PAGE_CONTROL_H__
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_SCREEN_PAGE_CONTROL_H__
+#define __MENU_SCREEN_PAGE_CONTROL_H__
 
 #include <Evas.h>
 
 extern void index_bring_in(Evas_Object *index, int idx);
 
-extern Evas_Object *index_create(Evas_Object *layout, unsigned int count);
+extern Evas_Object *index_create(Evas_Object *layout, unsigned int count, unsigned int current_idx);
 extern Evas_Object *index_update(Evas_Object *layout, Evas_Object *index, unsigned int count);
 extern void index_destroy(Evas_Object *index);
 
 extern void index_show(Evas_Object *index);
 extern void index_hide(Evas_Object *index);
 
-#endif //__APP_TRAY_PAGE_CONTROL_H__
+#endif //__MENU_SCREEN_PAGE_CONTROL_H__
 
 // End of the file
index 70844a31566263a8617719e91f53de330d4aba82..a42d3c82fc60e7ff450777ee3b2615f5646143ea 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_ITEM_H__
 #define __MENU_SCREEN_ITEM_H__
@@ -30,6 +34,9 @@ extern void item_set_icon(Evas_Object *item, char *icon, int sync);
 extern char *item_get_name(Evas_Object *item);
 extern void item_set_name(Evas_Object *item, char *name, int sync);
 
+extern void item_set_pkgid(Evas_Object *edje, char *package, int sync);
+extern char *item_get_pkgid(Evas_Object *edje);
+
 extern char *item_get_package(Evas_Object *item);
 extern void item_set_package(Evas_Object *item, char *package, int sync);
 
@@ -42,9 +49,19 @@ extern void item_set_page(Evas_Object *edje, Evas_Object *page, int sync);
 extern char *item_get_desktop(Evas_Object *item);
 extern void item_set_desktop(Evas_Object *item, char *name, int sync);
 
+extern int item_get_type(Evas_Object *item);
+extern void item_set_type(Evas_Object *edje, int type, int sync);
+
 extern void item_enable_delete(Evas_Object *obj);
 extern void item_disable_delete(Evas_Object *item);
 
+extern void item_show_badge(Evas_Object *obj, int value);
+extern void item_hide_badge(Evas_Object *obj);
+extern int item_is_enabled_badge(Evas_Object *obj);
+
+extern void item_edit(Evas_Object *item);
+extern void item_unedit(Evas_Object *item);
+
 extern Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai);
 extern void item_update(Evas_Object *item, app_info_t *ai);
 extern void item_destroy(Evas_Object *obj);
diff --git a/include/item_badge.h b/include/item_badge.h
new file mode 100644 (file)
index 0000000..659b323
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_SCREEN_BADGE_H__
+#define __MENU_SCREEN_BADGE_H__
+
+#include <stdbool.h>
+
+#include "util.h"
+
+extern menu_screen_error_e item_badge_register(Evas_Object *item);
+extern void item_badge_unregister(Evas_Object *item);
+extern bool item_badge_is_registered(Evas_Object *item);
+extern int item_badge_count(char *package);
+
+extern void item_badge_register_changed_cb(Evas_Object *scroller);
+extern void item_badge_unregister_changed_cb(void);
+
+#endif
+// End of a file
index 3e65df39ab2cfadb0214a5bbb23459bd51a24e98..d140130f15dcb5d79b82f2b55588972e54d9f195 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_ITEM_EVENT_H__
 #define __MENU_SCREEN_ITEM_EVENT_H__
diff --git a/include/key.h b/include/key.h
new file mode 100644 (file)
index 0000000..b3bb91c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MENU_SCREEN_INPUT_KEY_H__
+#define __MENU_SCREEN_INPUT_KEY_H__
+
+#include "util.h"
+
+HAPI void key_register(void);
+HAPI void key_unregister(void);
+HAPI void key_grab_home(void);
+HAPI void key_ungrab_home(void);
+
+#endif //__MENU_SCREEN_INPUT_KEY_H__
+
+// End of a file
index 8dc322da23a8dc37d43879a0d12736f13b257b6a..4edc6b011331a6c4d479fc4777ea10df792dbf87 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_LAYOUT_H__
 #define __MENU_SCREEN_LAYOUT_H__
@@ -22,7 +26,7 @@
 #include <Evas.h>
 #include "util.h"
 
-extern Evas_Object *layout_create(Evas_Object *win, const char *file, const char *group, int rotate);
+extern Evas_Object *layout_create(Evas_Object *conformant, const char *file, const char *group, int rotate);
 extern void layout_destroy(Evas_Object *layout);
 
 extern void layout_enable_block(Evas_Object *layout);
@@ -31,6 +35,10 @@ extern void layout_disable_block(Evas_Object *layout);
 extern Evas_Object* layout_load_edj(Evas_Object *parent, const char *edjname, const char *grpname);
 extern void layout_unload_edj(Evas_Object *layout);
 
+HAPI void layout_create_package(Evas_Object *layout, const char *package);
+HAPI void layout_update_package(Evas_Object *layout, const char *package);
+HAPI void layout_delete_package(Evas_Object *layout, const char *package);
+
 #endif //__MENU_SCREEN_LAYOUT_H__
 
 // End of a file
index 7e5465bd5fb83bba67aac3bd30955ddc39ecd4be..9c6c1b9c642db52fa4b262fbf6b8bff9ea22cd77 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_LIST_H__
 #define __MENU_SCREEN_LIST_H__
 
 typedef struct
 {
-       char *package;
+       char *pkgid;
+       char *package; /* appid */
        char *exec;
        char *name;
        char *icon;
        char *desktop;
        bool nodisplay;
+       bool enabled;
        bool x_slp_removable;
        bool x_slp_taskmanage;
        pid_t pid;
@@ -47,7 +53,7 @@ typedef struct _app_list_item {
        char *package;
        pid_t pid;
        time_t launch_time;
-       long long installed_time;
+       int installed_time;
        void *data;
 } app_list_item;
 
@@ -63,6 +69,7 @@ extern void list_free_values(app_info_t *ai);
 extern menu_screen_error_e list_append_item(app_list *list, app_list_item *item);
 extern menu_screen_error_e list_remove_item(app_list *list, app_list_item *item);
 extern menu_screen_error_e list_sort(app_list *list, int (*_sort_cb)(const void *d1, const void *d2));
+extern app_list_item *list_nth(app_list *parent, unsigned int nth);
 
 #endif //__MENU_SCREEN_LIST_H__
 
index 839ddc76cc87f3538541a10e1359f0ae105cea70..db209041ffe3440f120ed9707b0d7838a97d2152 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_MAPBUF_H__
 #define __MENU_SCREEN_MAPBUF_H__
index 12ed01790ee79d0c6dd6820b0ed38be2fb27ea88..06d8fc3041c427b56d7f7b0a2519e2d2975131b2 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_H__
 #define __MENU_SCREEN_H__
 
 extern int menu_screen_get_root_width(void);
 extern int menu_screen_get_root_height(void);
-extern double menu_screen_get_yscale(void);
 extern Evas *menu_screen_get_evas(void);
 extern Evas_Object *menu_screen_get_win(void);
+extern Elm_Theme *menu_screen_get_theme(void);
 extern bool menu_screen_get_done(void);
 extern void menu_screen_set_done(bool is_done);
+extern int menu_screen_get_state(void);
+extern int menu_screen_is_tts(void);
+
+extern void menu_screen_inc_booting_state(void);
+extern void menu_screen_dec_booting_state(void);
+extern int menu_screen_get_booting_state(void);
 
 #endif //__MENU_SCREEN_H__
 
index 8d4a5ea2c219926bd3158a1ec450eedc233f2533..85d0a29c30570fe35934ee785975998dc7b81d3c 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_EVENT_H__
 #define __MENU_SCREEN_EVENT_H__
index f0921fc05dff8d13f81b3a51dc8d6b97eae972e6..4c4ad3aeb7432ea28c703e07ab2c7efa71a0508a 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_PAGE_H__
 #define __MENU_SCREEN_PAGE_H__
index 4f12bda2d744259b7cd072b8a55f133025f1979f..da9e4f25ad971d40f6a6846baf2f9ffebbac5e79 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_PAGE_SCROLLER_H__
 #define __MENU_SCREEN_PAGE_SCROLLER_H__
@@ -39,12 +43,21 @@ extern Evas_Object *page_scroller_get_page_at(Evas_Object *scroller, unsigned in
 extern unsigned int page_scroller_count_page(Evas_Object *scroller);
 extern int page_scroller_get_page_no(Evas_Object* scroller, Evas_Object *page);
 
-extern menu_screen_error_e page_scroller_push_item(Evas_Object *scroller, app_info_t *ai);
+extern Evas_Object *page_scroller_push_item(Evas_Object *scroller, app_info_t *ai);
+extern Evas_Object *page_scroller_push_item_by_order(Evas_Object *scroller, app_info_t *ai);
+extern int page_scroller_get_current_page_no(Evas_Object *scroller);
 extern Evas_Object *page_scroller_find_item_by_package(Evas_Object *scroller, const char *package, int *page_no);
 extern void page_scroller_trim_items(Evas_Object *scroller);
 extern void page_scroller_bring_in(Evas_Object *scroller, int idx);
 extern void page_scroller_show_region(Evas_Object *scroller, int idx);
 
+extern void page_scroller_edit(Evas_Object *scroller);
+extern void page_scroller_unedit(Evas_Object *scroller);
+extern bool page_scroller_is_edited(Evas_Object *scroller);
+
+extern void page_scroller_focus(Evas_Object *scroller);
+extern void page_scroller_focus_into_vector(Evas_Object *scroller, int vector);
+
 #endif //__MENU_SCREEN_PAGE_SCROLLER_H__
 
 // End of a file
index 179732c88166e2027d916814c8344b2d2d29d204..bd2aa06732252dbdf6b726219acc8d493ffd1733 100644 (file)
@@ -1,65 +1,42 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_PKGMGR_H__
 #define __MENU_SCREEN_PKGMGR_H__
 
-#include <Evas.h>
-
-#include "list.h"
-#include "util.h"
-
-
-
-enum package_install_status {
-       UNKNOWN = 0x00,
-       DOWNLOAD_BEGIN,
-       DOWNLOADING,
-       DOWNLOAD_END,
-       INSTALL_BEGIN,
-       INSTALLING,
-       INSTALL_END,
-       UNINSTALL_BEGIN,
-       UNINSTALLING,
-       UNINSTALL_END,
-       UPDATE_BEGIN,
-       UPDATING,
-       UPDATE_END,
-       MAX_STATUS,
-};
-
 
+HAPI menu_screen_error_e pkgmgr_item_list_append_item(const char *pkg_id, const char *app_id, Evas_Object *item);
+HAPI menu_screen_error_e pkgmgr_item_list_remove_item(const char *pkg_id, const char *app_id, Evas_Object *item);
 
-struct package_info {
-       enum package_install_status status;
-       app_info_t ai;
-       Evas_Object *item;
-       Evas_Object *page;
-       Eina_Bool desktop_file_found;
-       int error_count;
-};
+HAPI void pkgmgr_item_list_affect_pkgid(const char *pkg_id, Eina_Bool (*_affected_cb)(const char *, Evas_Object *, void *), void *data);
+HAPI void pkgmgr_item_list_affect_appid(const char *app_id, Eina_Bool (*_affected_cb)(const char *, Evas_Object *, void *), void *data);
 
+HAPI inline menu_screen_error_e pkgmgr_uninstall(Evas_Object *item);
 
+HAPI menu_screen_error_e pkgmgr_reserve_list_push_request(const char *package, const char *key, const char *val);
+HAPI menu_screen_error_e pkgmgr_reserve_list_pop_request(void);
 
-extern menu_screen_error_e pkgmgr_init(Evas_Object *scroller);
-extern void pkgmgr_fini(void);
-extern Evas_Object *pkgmgr_find_pended_object(const char *package, int with_desktop_file, Evas_Object *scroller, Evas_Object **page);
-extern menu_screen_error_e pkgmgr_uninstall(Evas_Object *obj);
+HAPI menu_screen_error_e pkgmgr_init(void);
+HAPI void pkgmgr_fini(void);
 
 #endif //__MENU_SCREEN_PKGMGR_H__
 
index f07d1627c02fe506d426986a715336996f334ebf..d871b919713dc04f2032406a907eefd049773d23 100644 (file)
@@ -1,31 +1,33 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
+#ifndef __MENU_SCREEN_POPUP_H__
+#define __MENU_SCREEN_POPUP_H__
 
-#ifndef __APP_TRAY_POPUP_H__
-#define __APP_TRAY_POPUP_H__
+extern Evas_Object *popup_exist(void);
+extern void popup_destroy_all(void);
+extern Evas_Object *popup_create_confirm(Evas_Object *parent, const char *warning);
+extern Evas_Object *popup_create_uninstall(Evas_Object *parent, Evas_Object *item);
 
-extern void popup_append_list(Evas_Object *popup);
-extern void popup_remove_list(Evas_Object *popup);
-extern void popup_free_list();
-
-extern Evas_Object *popup_create(Evas_Object *parent, const char *warning);
-extern void popup_destroy(Evas_Object *popup);
-
-#endif //__APP_TRAY_POPUP_H__
+#endif //__MENU_SCREEN_POPUP_H__
 
 // End of a file
index 68d6e6661f3a59ab7cdfa02024952ce9a2d78da7..4ddc2b71bb2e296993f39553119880e4b07d51e3 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef __MENU_SCREEN_UTIL_H__
 #define __MENU_SCREEN_UTIL_H__
 #define STR_ENV_MAPBUF "BEATUX_MAPBUF"
 
 #define ALL_APPS_TABLE "all_apps"
+#define BOOTING_STATE_DONE 1
+
+/* Data key */
+#define DATA_KEY_MAIN_OPERATION_LIST "ma_op_li"
+
+/* Accessibility */
+#define ACCESS_BUTTON "button"
+#define ACCESS_EDIT "edit"
 
 /* Multi-language */
 #define D_(str) dgettext("sys_string", str)
 
 /* Log */
 #if !defined(_W)
-#define _W(fmt, arg...) LOGW("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#define _W(fmt, arg...) LOGW(fmt"\n", ##arg)
 #endif
 
 #if !defined(_D)
-#define _D(fmt, arg...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#define _D(fmt, arg...) LOGD(fmt"\n", ##arg)
 #endif
 
 #if !defined(_E)
-#define _E(fmt, arg...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#define _E(fmt, arg...) LOGE(fmt"\n", ##arg)
 #endif
 
 #if !defined(_T)
 #define _T(package) LOG(LOG_DEBUG, "LAUNCH", "[%s:Menuscreen:launch:done]", package);
 #endif
 
+/* Multi-language */
+#ifndef _
+#define _(str) gettext(str)
+#endif
+
+#define gettext_noop(str) (str)
+#define N_(str) gettext_noop(str)
+#define D_(str) dgettext("sys_string", str)
+
+/* Build */
+#define HAPI __attribute__((visibility("hidden")))
+
+/* Packaging */
+#define DEFAULT_ICON IMAGEDIR"/default.png"
+
 #ifdef APPFWK_MEASUREMENT
 #define PRINT_APPFWK() do {            \
     struct timeval tv;                         \
diff --git a/org.tizen.menu-screen.efl b/org.tizen.menu-screen.efl
new file mode 100755 (executable)
index 0000000..ee4a59f
--- /dev/null
@@ -0,0 +1,98 @@
+org.tizen.menu-screen app-svc rwx--- ------
+org.tizen.menu-screen pkgmgr::db rw---l ------
+org.tizen.menu-screen ail::db rw---- ------
+org.tizen.menu-screen system::use_internet r----- ------
+org.tizen.menu-screen device::app_logging -w---- ------
+org.tizen.menu-screen net-config r-x--- ------
+org.tizen.menu-screen xorg rwx--- ------
+org.tizen.menu-screen isf rwx--- ------
+org.tizen.menu-screen dbus rwx--- ------
+org.tizen.menu-screen ug-image-viewer-efl r-x--- ------
+org.tizen.menu-screen cbhm r-x--- ------
+org.tizen.menu-screen sound_server rwx--- ------
+org.tizen.menu-screen svi-data r-x--- ------
+org.tizen.menu-screen data-provider-master rwx--- ------
+org.tizen.menu-screen org.tizen.indicator rwx--- ------
+org.tizen.menu-screen org.tizen.setting r-x--- ------
+org.tizen.menu-screen sqlfs r-x--- ------
+org.tizen.menu-screen e17 rwx--- ------
+org.tizen.menu-screen dlogutil r-x--- ------
+org.tizen.menu-screen immvibed rwx--- ------
+org.tizen.menu-screen rua::db rw---- ------
+org.tizen.menu-screen org.tizen.clock -w---- ------
+org.tizen.menu-screen badge::db rw---- ------
+org.tizen.menu-screen aul rwx--- ------
+org.tizen.menu-screen system-server r-x--- ------
+org.tizen.menu-screen deviced r-x--- ------
+org.tizen.menu-screen sensor-framework r-x--- ------
+org.tizen.menu-screen secure-storage r-x--- ------
+org.tizen.menu-screen pkgmgr-client r-x--- ------
+org.tizen.menu-screen syslogd -w---- ------
+org.tizen.indicator org.tizen.menu-screen rwx--- ------
+org.tizen.browser org.tizen.menu-screen rw---- ------
+org.tizen.contact org.tizen.menu-screen rw---- ------
+org.tizen.youtube-shortcut org.tizen.menu-screen rw---- ------
+org.tizen.message org.tizen.menu-screen rw---- ------
+org.tizen.voicerecorder org.tizen.menu-screen rw---- ------
+org.tizen.calendar org.tizen.menu-screen rw---- ------
+org.tizen.episode org.tizen.menu-screen rw---- ------
+org.tizen.keepit org.tizen.menu-screen rw---- ------
+org.tizen.calculator org.tizen.menu-screen rw---- ------
+org.tizen.clock org.tizen.menu-screen rw---- ------
+org.tizen.camera-app org.tizen.menu-screen rw---- ------
+org.tizen.svoice org.tizen.menu-screen rw---- ------
+org.tizen.group-cast org.tizen.menu-screen rw---- ------
+org.tizen.phone org.tizen.menu-screen rw---- ------
+org.tizen.smartsearch org.tizen.menu-screen rw---- ------
+org.tizen.setting org.tizen.menu-screen rw---- ------
+org.tizen.myfile org.tizen.menu-screen rw---- ------
+org.tizen.rcs-im org.tizen.menu-screen rw---- ------
+org.tizen.smemo org.tizen.menu-screen rw---- ------
+org.tizen.facebook org.tizen.menu-screen rw---- ------
+org.tizen.gallery org.tizen.menu-screen rw---- ------
+org.tizen.email org.tizen.menu-screen rw---- ------
+org.tizen.music-player org.tizen.menu-screen rw---- ------
+org.tizen.nfc-app org.tizen.menu-screen rw---- ------
+org.tizen.video-player org.tizen.menu-screen rw---- ------
+org.tizen.contacts org.tizen.menu-screen rw---- ------
+dbus org.tizen.menu-screen rwx--- ------
+stest-service org.tizen.menu-screen r-x--- ------
+org.tizen.menu-screen stest-service -w---- ------
+org.tizen.menu-screen org.tizen.setting::default-resources r-x--- ------
+org.tizen.menu-screen pkgmgr::svc r-x--- ------
+org.tizen.menu-screen pkgmgr::info r----- ------
+org.tizen.menu-screen system::vconf_system rw---- ------
+org.tizen.menu-screen system::vconf_inhouse rw---- ------
+org.tizen.menu-screen aul::launch --x--- ------
+org.tizen.menu-screen data-provider-master::shortcut rw---- ------
+org.tizen.menu-screen data-provider-master::shortcut.shortcut -w---- ------
+org.tizen.menu-screen data-provider-master::notification rw---- ------
+org.tizen.menu-screen data-provider-master::notification.client -w---- ------
+org.tizen.menu-screen data-provider-master::badge rw---- ------
+org.tizen.menu-screen data-provider-master::badge.client -w---- ------
+org.tizen.menu-screen tts-server rwx--- ------
+org.tizen.menu-screen idlescreen::vconf rwx--- ------
+org.tizen.app-tray org.tizen.menu-screen r-x--- ------
+org.tizen.menu-screen factory-15 r-x--- ------
+org.tizen.menu-screen telephony_framework::api_manager r----- ------
+org.tizen.menu-screen telephony_framework::api_modem r-x--- ------
+org.tizen.menu-screen telephony_framework::api_network r-x--- ------
+org.tizen.menu-screen atd-server r----- ------
+org.tizen.menu-screen factory::vconf rw---- ------
+org.tizen.menu-screen dfms-kernel r----- ------
+org.tizen.menu-screen system::homedir rwxat- ------
+org.tizen.menu-screen system::vconf rwxat- ------
+org.tizen.menu-screen system::media rwxat- ------
+org.tizen.menu-screen system::share rwxat- ------
+org.tizen.menu-screen pulseaudio rwxat- ------
+e17 org.tizen.menu-screen -w---- ------
+org.tizen.menu-screen sys-assert::core rwxat- ------
+org.tizen.menu-screen privacy-manager::db r----l ------
+org.tizen.menu-screen system::vconf_setting rw---- ------
+org.tizen.menu-screen system::vconf_privacy rw---- ------
+org.tizen.menu-screen system::vconf_multimedia rw---- ------
+org.tizen.menu-screen system::vconf_network rw---- ------
+org.tizen.menu-screen system::vconf_misc rw---- ------
+org.tizen.menu-screen ecore::lock rwxat- ------
+org.tizen.menu-screen org.tizen.wallpaper-ui-service rwxat- ------
+org.tizen.menu-screen system::storage rwxat- ------
diff --git a/org.tizen.menu-screen.manifest b/org.tizen.menu-screen.manifest
new file mode 100644 (file)
index 0000000..180519a
--- /dev/null
@@ -0,0 +1,12 @@
+<manifest>
+       <define>
+               <domain name="org.tizen.menu-screen" />
+       </define>
+       <request>
+               <domain name="org.tizen.menu-screen" />
+       </request>
+       <assign>
+               <filesystem path="/usr/share/packages/org.tizen.menu-screen.xml" label="_" />
+               <filesystem path="/usr/share/icons/default/small/org.tizen.menu-screen.png" label="_" />
+       </assign>
+</manifest>
diff --git a/packaging/org.tizen.menu-screen.changes b/packaging/org.tizen.menu-screen.changes
deleted file mode 100644 (file)
index 41d21f9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-* Tue Jan 29 00:14:44 UTC 2013 - tracy.graydon@intel.com
-- Add the .changes file 
old mode 100644 (file)
new mode 100755 (executable)
index 3e287a1..cde2b6f
@@ -1,39 +1,61 @@
 %define _optdir /opt
-%define _appdir %{_optdir}/apps
-%define _opt_datadir %{_optdir}/share
+%define _usrdir /usr
+%define _appdir %{_usrdir}/apps
+%define _usr_datadir %{_usrdir}/share
+
+%define _project_name menu-screen
+%define _package_name org.tizen.%{_project_name}
+
+%define _packagedir %{_appdir}/%{_package_name}
+%define _bindir %{_packagedir}/bin
+%define _datadir %{_optdir}%{_packagedir}/data
+%define _resdir %{_packagedir}/res
+%define _sharedir %{_packagedir}/share
+
+%define _localedir %{_resdir}/locale
 
 Name:       org.tizen.menu-screen
 Summary:    An utility library of the menu screen
-Version:    1.0.13
+Version:    1.2.5
 Release:    1.1
 Group:      TO_BE/FILLED_IN
-License:    Flora Software License
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(ail)
 BuildRequires:  pkgconfig(appcore-efl)
-BuildRequires:  pkgconfig(utilX)
+BuildRequires:  pkgconfig(appsvc)
 BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(sysman)
+BuildRequires:  pkgconfig(badge)
 BuildRequires:  pkgconfig(bundle)
-BuildRequires:  pkgconfig(pkgmgr)
-BuildRequires:  pkgconfig(syspopup-caller)
-BuildRequires:  pkgconfig(heynoti)
-BuildRequires:  pkgconfig(evas)
-BuildRequires:  pkgconfig(ecore-evas)
-BuildRequires:  pkgconfig(edje)
+BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(ecore-evas)
 BuildRequires:  pkgconfig(ecore-file)
 BuildRequires:  pkgconfig(ecore-imf)
 BuildRequires:  pkgconfig(ecore-input)
+BuildRequires:  pkgconfig(edje)
 BuildRequires:  pkgconfig(eet)
 BuildRequires:  pkgconfig(eina)
-BuildRequires:  pkgconfig(ail)
-BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(evas)
+BuildRequires:  pkgconfig(pkgmgr)
+BuildRequires:  pkgconfig(pkgmgr-info)
+BuildRequires:  pkgconfig(shortcut)
+BuildRequires:  pkgconfig(syspopup-caller)
+BuildRequires:  pkgconfig(utilX)
 BuildRequires:  cmake
 BuildRequires:  edje-tools
 BuildRequires:  gettext-tools
-
+BuildRequires:  hash-signer
+# %ifarch %{arm}
+# %define ARCH arm
+# BuildRequires:  pkgconfig(bincfg)
+# BuildRequires:  pkgconfig(factory)
+# %else
+# %define ARCH emulator
+# %endif
 
 %description
 An utility library for developers of the menu screen.
@@ -53,42 +75,100 @@ An utility library for developers of the menu screen (devel)
 %setup -q
 
 %build
-CFLAGS="-I/usr/lib/glib-2.0/include/ -I/usr/include/glib-2.0 -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0 -I/usr/include/e_dbus-1 -I/usr/include/ethumb-0 -I/usr/include/edje-1 -I/usr/include/efreet-1 -I/usr/include/embryo-1 -I/usr/include/ecore-1 -I/usr/include/eet-1 -I/usr/include/evas-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina $CFLAGS" CXXFLAGS=$CXXFLAGS cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
+CFLAGS+=" -fPIC -fPIE ";export CFLAGS
+CXXFLAGS+=" -fPIC -fPIE -fvisibility=hidden -fvisibility-inlines-hidden ";export CXXFLAGS
+LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed -pie ";export LDFLAGS
+
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
+export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
+%endif
+
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=%{ARCH}
 make %{?jobs:-j%jobs}
 
 %install
 %make_install
-mkdir %{buildroot}/opt/apps/org.tizen.menu-screen/data
+%define tizen_sign 1
+%define tizen_sign_base %{_packagedir}
+%define tizen_sign_level platform
+%define tizen_author_sign 1
+%define tizen_dist_sign 1
 
+mkdir -p %{buildroot}%{_datadir}
+mkdir -p %{buildroot}/usr/share/license
 
 %post
+/usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{_packagedir}
 
-INHOUSE_ID="5000"
-
-chown -R 5000:5000 /opt/apps/org.tizen.menu-screen/data
+VCONF_OPTION="-f -u 5000"
+PRIVATE_OPTION="-s org.tizen.menu-screen"
+INHOUSE_OPTION="-s idlescreen::vconf"
 
 init_vconf()
 {
-       # for menu daemon
-       vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f
-
-       # for menu-screen
-       vconftool set -t int memory/idle_screen/top 0 -i -u 5000 -f
-       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f
+       vconftool set -t int memory/idle-screen/top 0 -i $VCONF_OPTION $INHOUSE_OPTION
+       vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" $VCONF_OPTION $PRIVATE_OPTION
 }
-
-
-
 init_vconf
 
-#%files -f %{name}.lang
-%files 
-%{_appdir}/org.tizen.menu-screen/bin/menu-screen
-%{_appdir}/org.tizen.menu-screen/res/edje/all_apps_portrait.edj
-%{_appdir}/org.tizen.menu-screen/res/edje/group_4x4_portrait.edj
-%{_appdir}/org.tizen.menu-screen/res/edje/item_4x4.edj
-%{_appdir}/org.tizen.menu-screen/res/edje/layout_portrait.edj
-%{_opt_datadir}/packages/org.tizen.menu-screen.xml
-
+if [ ! -d %{_datadir}/dbspace ]
+then
+       mkdir -p %{_datadir}/dbspace
+fi
+
+if [ ! -d %{_datadir}/shortcut ]
+then
+       mkdir -p %{_datadir}/shortcut
+else
+       rm -rf %{_datadir}/shortcut/*
+fi
+
+sqlite3 %{_datadir}/dbspace/.menu_screen.db 'PRAGMA journal_mode = PERSIST;
+       create table if not exists shortcut (
+               ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
+               appid TEXT,
+               name TEXT,
+               type INTEGER,
+               content_info TEXT,
+               icon TEXT
+       );
+'
 
+INHOUSE_ID="5000"
+chown -R $INHOUSE_ID:$INHOUSE_ID %{_datadir}
+chown root:$INHOUSE_ID %{_datadir}/dbspace/.menu_screen.db
+chown root:$INHOUSE_ID %{_datadir}/dbspace/.menu_screen.db-journal
+
+chmod 660 %{_datadir}/dbspace/.menu_screen.db
+chmod 660 %{_datadir}/dbspace/.menu_screen.db-journal
+
+if [ -f /usr/lib/rpm-plugins/msm.so ]
+then
+       chsmack -a 'org.tizen.menu-screen' %{_datadir}/dbspace/.menu_screen.db*
+fi
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_bindir}/menu-screen
+%{_resdir}/edje/all_apps_portrait.edj
+%{_resdir}/edje/button_edit.edj
+%{_resdir}/edje/group_4x4_portrait.edj
+%{_resdir}/edje/item_4x4.edj
+%{_resdir}/edje/layout_portrait.edj
+%{_resdir}/edje/index.edj
+%{_resdir}/images/default.png
+%{_resdir}/data/main_operation.launch
+%{_localedir}/*/*/*.mo
+%{_usr_datadir}/icons/default/small/org.tizen.menu-screen.png
+%{_usr_datadir}/packages/org.tizen.menu-screen.xml
+%{_packagedir}/*.xml
+/etc/smack/accesses.d/%{_package_name}.efl
diff --git a/src/all_apps/db.c b/src/all_apps/db.c
new file mode 100644 (file)
index 0000000..eb5485d
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <sys/stat.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "db.h"
+#include "util.h"
+#include "all_apps/db.h"
+
+#define QUERY_LEN 1024
+
+#define MENU_SCREEN_DB_FILE "/opt/usr/apps/org.tizen.menu-screen/data/dbspace/.menu_screen.db"
+#define SHORTCUT_TABLE "shortcut"
+#define QUERY_INSERT_SHORTCUT "INSERT INTO "SHORTCUT_TABLE" ("\
+       "appid,"\
+       "name,"\
+       "type,"\
+       "content_info,"\
+       "icon"\
+       ") VALUES ("\
+       "'%s', '%s', %d, '%s', '%s');"
+#define QUERY_DELETE_SHORTCUT "DELETE FROM "SHORTCUT_TABLE" WHERE ROWID=%lld"
+#define QUERY_GET_ALL "SELECT ROWID, appid, name, type, content_info, icon FROM "SHORTCUT_TABLE
+#define QUERY_COUNT_SHORTCUT "SELECT COUNT(*) FROM "SHORTCUT_TABLE" WHERE appid='%s' AND name='%s'"
+
+
+
+HAPI menu_screen_error_e all_apps_db_init(void)
+{
+       return db_open(MENU_SCREEN_DB_FILE);
+}
+
+
+
+HAPI void all_apps_db_fini(void)
+{
+       db_close();
+}
+
+
+
+HAPI Eina_List *all_apps_db_retrieve_all_info(void)
+{
+       stmt_h *st;
+       Eina_List *list = NULL;
+
+       retv_if(MENU_SCREEN_ERROR_OK != db_open(MENU_SCREEN_DB_FILE), NULL);
+
+       st = db_prepare(QUERY_GET_ALL);
+       retv_if(NULL == st, NULL);
+
+       menu_screen_error_e ret = MENU_SCREEN_ERROR_FAIL;
+       for (ret = db_next(st); MENU_SCREEN_ERROR_FAIL != ret && MENU_SCREEN_ERROR_NO_DATA != ret; ret = db_next(st)) {
+               db_info *info;
+               info = calloc(1, sizeof(db_info));
+               break_if(NULL == info);
+
+               info->rowid = db_get_long_long(st, 0); // 0 : ROWID
+
+               char *tmp = NULL;
+               tmp = (char *) db_get_str(st, 1); // 1 : appid
+               if (tmp && strlen(tmp)) {
+                       info->appid = strdup(tmp);
+                       goto_if(NULL == info->appid, APP_ERROR);
+               }
+
+               tmp = (char *) db_get_str(st, 2); // 2 : name
+               if (tmp && strlen(tmp)) {
+                       info->name = strdup(tmp);
+                       goto_if(NULL == info->name, APP_ERROR);
+               }
+
+               info->type = db_get_int(st, 3); // 3 : type
+
+               tmp = (char *) db_get_str(st, 4); // 4 : content_info
+               if (tmp && strlen(tmp)) {
+                       info->content_info = strdup(tmp);
+                       goto_if(NULL == info->content_info, APP_ERROR);
+               }
+
+               tmp = (char *) db_get_str(st, 5); // 5 : icon
+               if (tmp && strlen(tmp)) {
+                       info->icon = strdup(tmp);
+                       goto_if(NULL == info->icon, APP_ERROR);
+               }
+
+               list = eina_list_append(list, info);
+
+               continue;
+APP_ERROR:
+               if (info->appid) free(info->appid);
+               if (info->name) free(info->name);
+               if (info->content_info) free(info->content_info);
+               if (info->icon) free(info->icon);
+               if (info) free(info);
+       }
+
+       db_finalize(st);
+
+       return list;
+}
+
+
+
+HAPI void all_apps_db_unretrieve_info(db_info *info)
+{
+       ret_if(NULL == info);
+       if (info->appid) free(info->appid);
+       if (info->name) free(info->name);
+       if (info->content_info) free(info->content_info);
+       if (info->icon) free(info->icon);
+       if (info) free(info);
+}
+
+
+
+HAPI void all_apps_db_unretrieve_all_info(Eina_List *list)
+{
+       db_info *info = NULL;
+
+       EINA_LIST_FREE(list, info) {
+               if (NULL == info) break;
+               if (info->appid) free(info->appid);
+               if (info->name) free(info->name);
+               if (info->content_info) free(info->content_info);
+               if (info->icon) free(info->icon);
+               if (info) free(info);
+       }
+
+       eina_list_free(list);
+}
+
+
+
+HAPI int all_apps_db_count_shortcut(const char *appid, const char *name)
+{
+       int count = -1;
+       char q[QUERY_LEN];
+       menu_screen_error_e ret = MENU_SCREEN_ERROR_FAIL;
+
+       retv_if(MENU_SCREEN_ERROR_OK != db_open(MENU_SCREEN_DB_FILE), -1);
+
+       snprintf(q, sizeof(q), QUERY_COUNT_SHORTCUT, appid, name);
+
+       stmt_h *st;
+       st = db_prepare(q);
+       retv_if(NULL == st, -1);
+
+       ret = db_next(st);
+       if (MENU_SCREEN_ERROR_FAIL == ret) {
+               db_finalize(st);
+               return -1;
+       }
+
+       count = db_get_int(st, 0);
+
+       db_finalize(st);
+
+       return count;
+}
+
+
+
+HAPI long long all_apps_db_insert_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon)
+{
+       char q[QUERY_LEN];
+
+       retv_if(MENU_SCREEN_ERROR_OK != db_open(MENU_SCREEN_DB_FILE), -1l);
+
+       snprintf(q, sizeof(q), QUERY_INSERT_SHORTCUT, appid, name, type, content_info, icon);
+       retv_if(db_exec(q) < 0, -1l);
+
+       long long id = -1l;
+       id = db_last_insert_rowid();
+
+       return id;
+}
+
+
+
+HAPI menu_screen_error_e all_apps_db_delete_shortcut(long long rowid)
+{
+       char q[QUERY_LEN];
+
+       retv_if(MENU_SCREEN_ERROR_OK != db_open(MENU_SCREEN_DB_FILE), MENU_SCREEN_ERROR_FAIL);
+
+       snprintf(q, sizeof(q), QUERY_DELETE_SHORTCUT, rowid);
+       retv_if(db_exec(q) < 0, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+// END
index e22070f05b0eb8018df5031e3403382a1545e653..3842193c6df44e2d0346efbb7b42aae4c7eb294c 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 
 #include "conf.h"
 #include "index.h"
 #include "item_event.h"
+#include "key.h"
 #include "layout.h"
 #include "list.h"
 #include "page_scroller.h"
+#include "popup.h"
 #include "util.h"
 #include "all_apps/layout.h"
 #include "all_apps/list.h"
+#include "all_apps/shortcut.h"
 
 #define ALL_APPS_EDJE_PORTRAIT EDJEDIR"/all_apps_portrait.edj"
 #define ALL_APPS_GROUP "all_apps"
 
 #define GROUP_4X4_EDJE_PORTRAIT EDJEDIR"/group_4x4_portrait.edj";
 
+#define ALL_APPS_EDIT_BUTTON_EDJE EDJEDIR"/button_edit.edj"
+#define ALL_APPS_EDIT_BUTTON_GROUP "button_edit"
+#define ALL_APPS_EDIT_BUTTON_PART "button_edit"
+
+#define IDS_HS_BUTTON_DONE "IDS_HS_BUTTON_DONE"
+
+
+
+HAPI bool all_apps_layout_is_edited(Evas_Object *all_apps)
+{
+       retv_if(NULL == all_apps, false);
+       return (bool) evas_object_data_get(all_apps, "is_edited");
+}
+
+
+
+HAPI void all_apps_layout_edit(Evas_Object *all_apps)
+{
+       Evas_Object *edit_button;
+       Evas_Object *scroller;
+
+       //elm_object_tree_focus_allow_set(all_apps, EINA_FALSE);
+       evas_object_data_set(all_apps, "is_edited", (void *) true);
+
+       edit_button = elm_object_part_content_get(all_apps, ALL_APPS_EDIT_BUTTON_PART);
+       ret_if(NULL == edit_button);
+       elm_object_signal_emit(edit_button, "edit_button_state,edit", "menu");
+
+       scroller = elm_object_part_content_get(all_apps, "content");
+       ret_if(NULL == scroller);
+       page_scroller_edit(scroller);
+
+       key_grab_home();
+}
+
+
+
+HAPI void all_apps_layout_unedit(Evas_Object *all_apps)
+{
+       Evas_Object *edit_button;
+
+       ret_if(NULL == all_apps);
+
+       //elm_object_tree_focus_allow_set(all_apps, EINA_TRUE);
+       key_ungrab_home();
+       popup_destroy_all();
+
+       bool is_edited = (bool) evas_object_data_get(all_apps, "is_edited");
+       if (false == is_edited) return;
+
+       do {
+               edit_button = elm_object_part_content_get(all_apps, ALL_APPS_EDIT_BUTTON_PART);
+               ret_if(NULL == edit_button);
+               elm_object_signal_emit(edit_button, "edit_button_state,unedit", "menu");
+       } while (0);
+
+       do {
+               Evas_Object *scroller;
+
+               scroller = elm_object_part_content_get(all_apps, "content");
+               ret_if(NULL == scroller);
+
+               page_scroller_unedit(scroller);
+       } while (0);
+}
+
+
+
+static char *_access_info_cb(void *data, Evas_Object *obj)
+{
+       Evas_Object *scroller = data;
+
+       char *info;
+       if (page_scroller_is_edited(scroller)) {
+               info = _(IDS_HS_BUTTON_DONE);
+       } else {
+               info = ACCESS_EDIT;
+       }
+
+       char *tmp;
+       tmp = strdup(info);
+       if (!tmp) return NULL;
+       return tmp;
+}
+
+
+
+static void _focus_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Evas_Object *scroller = data;
+
+       _D("Edit button is up");
+
+       Evas_Object *all_apps;
+       all_apps = evas_object_data_get(scroller, "tab");
+       ret_if(NULL == all_apps);
+
+       if (page_scroller_is_edited(scroller)) {
+               _D("Go to the normal mode");
+               all_apps_layout_unedit(all_apps);
+       } else {
+               _D("Go to the edit mode");
+               all_apps_layout_edit(all_apps);
+       }
+
+       elm_object_signal_emit(obj, "edit_button,release", "menu");
+}
+
+
+
+
+static void _edit_button_down_cb(void *data, Evas_Object *obj, const char* emission, const char* source)
+{
+       _D("Edit button is down");
+}
+
+
+
+static void _edit_button_up_cb(void *data, Evas_Object *obj, const char* emission, const char* source)
+{
+       _D("Edit button is up");
+
+       elm_object_signal_emit(obj, "edit_button,release", "menu");
+}
+
+
+
+static Evas_Object *_add_edit_button(Evas_Object *parent, Evas_Object *scroller)
+{
+       Evas_Object *button;
+
+       retv_if(NULL == parent, NULL);
+       retv_if(NULL == scroller, NULL);
+
+       button = layout_load_edj(parent, ALL_APPS_EDIT_BUTTON_EDJE, ALL_APPS_EDIT_BUTTON_GROUP);
+       retv_if(NULL == button, NULL);
+
+       edje_object_signal_callback_add(_EDJ(button), "edit_button,down", "menu", _edit_button_down_cb, scroller);
+       edje_object_signal_callback_add(_EDJ(button), "edit_button,up", "menu", _edit_button_up_cb, scroller);
+
+       do { // focus
+               Evas_Object *focus= NULL;
+               focus = elm_button_add(button);
+               retv_if(NULL == focus, NULL);
+
+               elm_object_style_set(focus, "focus");
+               elm_object_part_content_set(button, "focus", focus);
+               elm_access_info_cb_set(focus, ELM_ACCESS_INFO, _access_info_cb, scroller);
+               evas_object_smart_callback_add(focus, "clicked", _focus_clicked_cb, scroller);
+       } while (0);
+
+       return button;
+}
+
+
+
+static void _remove_edit_button(Evas_Object *button)
+{
+       ret_if(NULL == button);
+
+       do {
+               Evas_Object *focus = NULL;
+               focus = elm_object_part_content_unset(button, "focus");
+               if (NULL == focus) break;
+               evas_object_smart_callback_del(focus, "clicked", _focus_clicked_cb);
+               evas_object_del(focus);
+       } while (0);
+
+       edje_object_signal_callback_del(_EDJ(button), "edit_button,down", "menu", _edit_button_down_cb);
+       edje_object_signal_callback_del(_EDJ(button), "edit_button,up", "menu", _edit_button_up_cb);
+
+       layout_unload_edj(button);
+}
+
 
 
 static menu_screen_error_e _load_item(Evas_Object *scroller, app_list_item *item)
@@ -42,11 +223,11 @@ static menu_screen_error_e _load_item(Evas_Object *scroller, app_list_item *item
 
        retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
        ai = item->data;
-       if (ai->nodisplay == true) {
-               return MENU_SCREEN_ERROR_FAIL;
+       if (ai->nodisplay || !ai->enabled) {
+               return MENU_SCREEN_ERROR_OK;
        }
 
-       retv_if(MENU_SCREEN_ERROR_FAIL == page_scroller_push_item(scroller, ai), MENU_SCREEN_ERROR_FAIL);
+       retv_if(NULL == page_scroller_push_item_by_order(scroller, ai), MENU_SCREEN_ERROR_FAIL);
 
        return MENU_SCREEN_ERROR_OK;
 
@@ -78,7 +259,9 @@ ERROR:
        all_apps_list_destroy(list);
        evas_object_data_del(all_apps, "list");
        page_scroller_bring_in(scroller, 0);
+       page_scroller_focus(scroller);
        menu_screen_set_done(true);
+       menu_screen_inc_booting_state();
 
        return ECORE_CALLBACK_CANCEL;
 }
@@ -95,22 +278,39 @@ static menu_screen_error_e _push_items(Evas_Object *all_apps)
 
        evas_object_data_set(all_apps, "list", list);
        idle_timer = ecore_idler_add(_push_items_idler_cb, all_apps);
+       retv_if(NULL == idle_timer, MENU_SCREEN_ERROR_FAIL);
+
+       Evas_Object *scroller;
+       scroller = evas_object_data_get(all_apps, "scroller");
+       if (MENU_SCREEN_ERROR_OK != all_apps_shortcut_add_all(scroller))
+               _E("Cannot add shortcuts");
+
+       do {
+               Evas_Object *button;
+               button = _add_edit_button(all_apps, scroller);
+               if (NULL == button) {
+                       _D("cannot make the edit button");
+               }
+               elm_object_part_content_set(all_apps, ALL_APPS_EDIT_BUTTON_PART, button);
+       } while (0);
 
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
+HAPI Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
 {
        Evas_Object *all_apps;
        Evas_Object *index;
        Evas_Object *scroller;
+       Evas_Object *bg;
+       Evas *evas;
 
        static const char item_edje[] = EDJEDIR"/item_4x4.edj";
        static const char *page_edje;
        static const char *all_apps_edje;
-       int item_width;
+       int item_width, item_height;
        int width;
        int height;
 
@@ -121,7 +321,9 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
        page_edje = GROUP_4X4_EDJE_PORTRAIT;
        width = menu_screen_get_root_width();
        height = menu_screen_get_root_height();
-       item_width = width / 4.0f;
+
+       item_width = ITEM_WIDTH_PROP * menu_screen_get_root_width();
+       item_height = ITEM_HEIGHT_PROP * menu_screen_get_root_height();
 
        if (EINA_FALSE == elm_layout_file_set(all_apps, all_apps_edje, ALL_APPS_GROUP)) {
                evas_object_del(all_apps);
@@ -129,6 +331,14 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
                return NULL;
        }
 
+       evas = menu_screen_get_evas();
+       bg = evas_object_rectangle_add(evas);
+       evas_object_size_hint_min_set(bg, width, height);
+       evas_object_size_hint_max_set(bg, width, height);
+       evas_object_resize(bg, width, height);
+       elm_object_part_content_set(all_apps, "bg", bg);
+       evas_object_show(bg);
+
        evas_object_data_set(all_apps, "win", evas_object_data_get(controlbar, "win"));
        evas_object_data_set(all_apps, "layout", evas_object_data_get(controlbar, "layout"));
        evas_object_data_set(all_apps, "controlbar", controlbar);
@@ -136,15 +346,18 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
        evas_object_data_set(all_apps, "page_max_app", (void *) PAGE_MAX_APP);
        evas_object_data_set(all_apps, "item_edje", (void *) item_edje);
        evas_object_data_set(all_apps, "item_width", (void *) item_width);
-       evas_object_data_set(all_apps, "item_height", (void *) item_width);
+       evas_object_data_set(all_apps, "item_height", (void *) item_height);
        evas_object_data_set(all_apps, "item_enable_long_press", (void *) true);
        evas_object_data_set(all_apps, "item_text_dual_line", (void *) true);
        evas_object_data_set(all_apps, "is_under_pkgmgr", (void *) true);
        evas_object_data_set(all_apps, "rotate", (void *) rotate);
        evas_object_data_set(all_apps, "enable_bg_image", (void *) true);
+       evas_object_data_set(all_apps, "is_edited", (void *) true);
+       evas_object_size_hint_min_set(all_apps, width, height);
+       evas_object_size_hint_max_set(all_apps, width, height);
        evas_object_resize(all_apps, width, height);
 
-       index = index_create(all_apps, 0);
+       index = index_create(all_apps, 0, 0);
        if (NULL == index) {
                evas_object_del(all_apps);
                _E("cannot create index.");
@@ -163,7 +376,7 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
 
        elm_object_part_content_set(all_apps, "content", scroller);
        evas_object_data_set(all_apps, "scroller", scroller);
-
+       if (!all_apps_shortcut_init(all_apps)) _E("Cannot initialize shortcut");
        retv_if(MENU_SCREEN_ERROR_FAIL == _push_items(all_apps), NULL);
 
        return all_apps;
@@ -171,15 +384,30 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate)
 
 
 
-void all_apps_layout_destroy(Evas_Object *all_apps)
+HAPI void all_apps_layout_destroy(Evas_Object *all_apps)
 {
        Evas_Object *index;
        Evas_Object *scroller;
 
-       index = evas_object_data_get(all_apps, "index");
-       scroller = evas_object_data_get(all_apps, "scroller");
+       ret_if(NULL == all_apps);
+
+       all_apps_shortcut_fini();
+
+       do {
+               Evas_Object *button;
+               if(all_apps) {
+                       button = elm_object_part_content_unset(all_apps, ALL_APPS_EDIT_BUTTON_PART);
+                       _remove_edit_button(button);
+               } else {
+                       _D("cannot find the all_apps object");
+               }
+       } while (0);
 
+       scroller = evas_object_data_get(all_apps, "scroller");
+       ret_if(NULL == scroller);
        if (scroller) page_scroller_destroy(scroller);
+
+       index = evas_object_data_get(scroller, "index");
        if (index) index_destroy(index);
 
        evas_object_data_del(all_apps, "win");
@@ -197,6 +425,7 @@ void all_apps_layout_destroy(Evas_Object *all_apps)
        evas_object_data_del(all_apps, "is_under_pkgmgr");
        evas_object_data_del(all_apps, "rotate");
        evas_object_data_del(all_apps, "enable_bg_image");
+       evas_object_data_del(all_apps, "is_edited");
 
        evas_object_del(all_apps);
 }
index e3bc0b8cb1e843386d9eac7f1533d180a3180a96..2144455a58572f857ec5b1bc6a3caefe6658a062 100644 (file)
@@ -1,27 +1,64 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
+#include <pkgmgr-info.h>
 #include <ail.h>
 
 #include "menu_screen.h"
 #include "conf.h"
 #include "list.h"
+#include "all_apps/layout.h"
+
+
+HAPI int all_apps_list_find_installed_time(const char *id)
+{
+       pkgmgrinfo_pkginfo_h handle = NULL;
+       pkgmgrinfo_appinfo_h appinfo_h = NULL;
+
+       int ret = 0;
+       int installed_time = 0;
+
+       goto_if(0> pkgmgrinfo_appinfo_get_appinfo(id, &appinfo_h), ERROR);
+
+       char *pkgid = NULL;
+       goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(appinfo_h, &pkgid), ERROR);
+       goto_if (NULL == pkgid, ERROR);
+
+       goto_if (0>pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle), ERROR);
+
+       ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
+       goto_if (ret != PMINFO_R_OK, ERROR);
+
+       pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+       return installed_time;
+
+ERROR:
+       if (appinfo_h) pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+       if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       return 0;
+}
 
 
 
@@ -29,6 +66,8 @@ static ail_cb_ret_e _all_apps_cb(ail_appinfo_h ai, void *data)
 {
        app_list *list = data;
        app_list_item *item;
+       app_info_t *item_info;
+       int installed_time = 0;
        char *value;
 
        retv_if(ail_appinfo_get_str(ai, AIL_PROP_PACKAGE_STR, &value) == AIL_ERROR_FAIL, AIL_CB_RET_CANCEL);
@@ -52,6 +91,31 @@ static ail_cb_ret_e _all_apps_cb(ail_appinfo_h ai, void *data)
                return AIL_CB_RET_CANCEL;
        }
 
+       item_info = item->data;
+       if (NULL == item_info) {
+               free(item->data);
+               free(item->package);
+               free(item);
+               return AIL_CB_RET_CANCEL;
+       }
+
+       if (item_info->nodisplay || !item_info->enabled) {
+               free(item->data);
+               free(item->package);
+               free(item);
+               return AIL_CB_RET_CONTINUE;
+       }
+
+       installed_time = all_apps_list_find_installed_time(item->package);
+       item->installed_time = installed_time;
+
+       if (0 == item->installed_time) {
+               free(item->data);
+               free(item->package);
+               free(item);
+               return AIL_CB_RET_CANCEL;
+       }
+
        if (list_append_item(list, item) != MENU_SCREEN_ERROR_OK) {
                free(item->data);
                free(item->package);
@@ -66,6 +130,24 @@ static ail_cb_ret_e _all_apps_cb(ail_appinfo_h ai, void *data)
 
 
 
+static int _all_apps_installed_time_sort_cb(const void *d1, const void *d2)
+{
+       app_list_item *item[2];
+
+       retv_if(NULL == d1, 0);
+       retv_if(NULL == d2, 0);
+
+       item[0] = (app_list_item *) d1;
+       item[1] = (app_list_item *) d2;
+
+
+       if (item[0]->installed_time > item[1]->installed_time) return (1);
+       if (item[0]->installed_time < item[1]->installed_time) return (-1);
+       else return (0);
+}
+
+
+
 static int _all_apps_sort_cb(const void *d1, const void *d2)
 {
        app_info_t *ai[2];
@@ -85,7 +167,30 @@ static int _all_apps_sort_cb(const void *d1, const void *d2)
 
 
 
-app_list *all_apps_list_create(void)
+HAPI void all_apps_list_destroy(app_list *list)
+{
+       app_list_item *item;
+
+       ret_if(NULL == list);
+       ret_if(NULL == list->list);
+
+       EINA_LIST_FREE(list->list, item) {
+               if (NULL == item) break;
+               if (item->package) free(item->package);
+               if (item->data) {
+                       list_free_values(item->data);
+                       free(item->data);
+               }
+               free(item);
+       }
+
+       eina_list_free(list->list);
+       free(list);
+}
+
+
+
+HAPI app_list *all_apps_list_create(void)
 {
        int count = 0;
        app_list *list;
@@ -94,7 +199,11 @@ app_list *all_apps_list_create(void)
        list = calloc(1, sizeof(app_list));
        retv_if(NULL == list, NULL);
 
-       retv_if(ail_filter_new(&f) != AIL_ERROR_OK, NULL);
+       if (ail_filter_new(&f) != AIL_ERROR_OK) {
+               free(list);
+               return NULL;
+       }
+
        if (ail_filter_add_bool(f, AIL_PROP_NODISPLAY_BOOL, false) != AIL_ERROR_OK){
                _E("Failed to add filter");
                ail_filter_destroy(f);
@@ -105,39 +214,36 @@ app_list *all_apps_list_create(void)
        ail_filter_list_appinfo_foreach(f, _all_apps_cb, list);
        ail_filter_destroy(f);
 
-       if(MENU_SCREEN_ERROR_FAIL == list_sort(list, _all_apps_sort_cb)) {
-               _D("Cannot sort apps.");
-       }
-
-       if(MENU_SCREEN_ERROR_FAIL == list_count(list, &count)) {
+       if (MENU_SCREEN_ERROR_FAIL == list_count(list, &count)) {
                _D("Cannot count apps.");
        }
+
        _D("Total package count = %d", count);
 
-       return list;
-}
+       if (count > (MAX_PAGE_NO * PAGE_MAX_APP)) {
 
+               int i;
 
+               if (MENU_SCREEN_ERROR_FAIL == list_sort(list, _all_apps_installed_time_sort_cb)) {
+               _E("Cannot sort installed_time");
+               }
 
-void all_apps_list_destroy(app_list *list)
-{
-       app_list_item *item;
+               for(i = (MAX_PAGE_NO * PAGE_MAX_APP); i<count; i++) {
+                       app_list_item *item = list_nth(list, (MAX_PAGE_NO * PAGE_MAX_APP));
+                       if(!item)
+                               continue;
 
-       ret_if(NULL == list);
-       ret_if(NULL == list->list);
+                       _D("%d: %s will be removed", i, item->package);
 
-       EINA_LIST_FREE(list->list, item) {
-               if (NULL == item) break;
-               if (item->package) free(item->package);
-               if (item->data) {
-                       list_free_values(item->data);
-                       free(item->data);
+                       retv_if(MENU_SCREEN_ERROR_FAIL == list_remove_item(list, item), NULL);
                }
-               free(item);
        }
 
-       eina_list_free(list->list);
-       free(list);
+       if (MENU_SCREEN_ERROR_FAIL == list_sort(list, _all_apps_sort_cb)) {
+               _D("Cannot sort apps.");
+       }
+
+       return list;
 }
 
 
diff --git a/src/all_apps/shortcut.c b/src/all_apps/shortcut.c
new file mode 100644 (file)
index 0000000..0554491
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <shortcut.h>
+#include <stdbool.h>
+
+#include "item.h"
+#include "list.h"
+#include "page_scroller.h"
+#include "util.h"
+#include "all_apps/db.h"
+
+
+
+HAPI Evas_Object *all_apps_shortcut_add(
+               Evas_Object *scroller,
+               long long rowid,
+               const char *pkgname,
+               const char *exec,
+               const char *name,
+               const char *content_info,
+               const char *icon,
+               int type)
+{
+       _D("Shortcut : pkgname(%s) exec(%s) name(%s) icon(%s)", pkgname, exec, name, icon);
+
+       app_info_t ai = {0, };
+       ai.package = (char *) pkgname;
+       ai.exec = (char *) exec;
+       ai.name = (char *) name;
+       ai.icon = (char *) icon;
+       ai.nodisplay = 0;
+       ai.enabled = 1;
+       ai.x_slp_removable = 1;
+       ai.x_slp_taskmanage = 0;
+
+       if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
+               _D("This is a dynamic box");
+               return NULL;
+       }
+
+       Evas_Object *item = NULL;
+       retv_if(NULL == (item = page_scroller_push_item(scroller, &ai)), NULL);
+
+       long long *tmp;
+       tmp = calloc(1, sizeof(long long));
+       if (NULL == tmp) {
+               item_destroy(item);
+               return NULL;
+       }
+
+       if (LAUNCH_BY_PACKAGE == type) {
+               _D("This is a package");
+               evas_object_data_set(item, "shortcut_launch_package", (void *) true);
+       } else {
+               _D("This is a shortcut");
+               evas_object_data_set(item, "shortcut_launch_package", (void *) false);
+       }
+
+       *tmp = rowid;
+       evas_object_data_set(item, "is_shortcut", (void *) true);
+       evas_object_data_set(item, "rowid", tmp);
+       evas_object_data_set(item, "type", (void *) type);
+       evas_object_data_set(item, "content_info", content_info);
+
+       return item;
+}
+
+
+
+static Eina_Bool _push_items_idler_cb(void *data)
+{
+       Evas_Object *scroller = data;
+       Eina_List *list = evas_object_data_get(scroller, "list");
+       Eina_List *n;
+       Eina_List *t;
+       db_info *info = NULL;
+       EINA_LIST_FOREACH_SAFE(list, n, t, info) {
+               goto_if(NULL == info, ERROR);
+               Evas_Object *item = NULL;
+               item = all_apps_shortcut_add(
+                       scroller,
+                       info->rowid,
+                       info->appid,
+                       NULL,
+                       info->name,
+                       info->content_info,
+                       info->icon,
+                       info->type);
+
+               list = eina_list_remove(list, info);
+               evas_object_data_set(scroller, "list", list);
+
+               all_apps_db_unretrieve_info(info);
+               break_if(NULL == item);
+       }
+
+       return ECORE_CALLBACK_RENEW;
+ERROR:
+       list = evas_object_data_del(scroller, "list");
+       all_apps_db_unretrieve_all_info(list);
+       return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+HAPI menu_screen_error_e all_apps_shortcut_add_all(Evas_Object *scroller)
+{
+       Eina_List *list;
+
+       list = all_apps_db_retrieve_all_info();
+       if (NULL == list) {
+               _D("There is no shortcut");
+               return MENU_SCREEN_ERROR_OK;
+       }
+
+       evas_object_data_set(scroller, "list", list);
+
+       Ecore_Idler *idle_timer = NULL;
+       idle_timer = ecore_idler_add(_push_items_idler_cb, scroller);
+       retv_if(NULL == idle_timer, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI void all_apps_shortcut_remove(Evas_Object *item)
+{
+       long long *tmp;
+       tmp = evas_object_data_del(item, "rowid");
+       if (tmp) {
+               all_apps_db_delete_shortcut(*tmp);
+               free(tmp);
+       }
+
+       Evas_Object *scroller;
+       scroller = evas_object_data_get(item, "scroller");
+
+       evas_object_data_del(item, "type");
+       evas_object_data_del(item, "content_info");
+       evas_object_data_del(item, "shortcut_launch_package");
+       evas_object_data_del(item, "is_shortcut");
+       item_destroy(item);
+
+       if (scroller) page_scroller_trim_items(scroller);
+}
+
+
+
+static int _shorcut_request_cb(
+               const char *pkgname,
+               const char *name,
+               int type,
+               const char *content_info,
+               const char *icon,
+               int pid,
+               double period,
+               int allow_duplicate,
+               void *data)
+{
+       Evas_Object *scroller = data;
+
+       retv_if(NULL == pkgname, -1);
+
+       _D("Package name: %s", pkgname);
+       _D("Name: %s", name);
+       _D("Type: %d", type);
+       _D("Content: %s", content_info);
+       _D("Icon: %s", icon);
+       _D("Requested from: %d", pid);
+       _D("period : %.2f", period);
+       _D("CBDATA: %p", data);
+
+       if (!allow_duplicate) {
+               int count = 0;
+               count = all_apps_db_count_shortcut(pkgname, name);
+               if (0 < count) {
+                       _D("There is already a package(%s:%s) in the Menu-screen", pkgname, name);
+                       return -1;
+               }
+       }
+
+       long long rowid = -1l;
+       rowid = all_apps_db_insert_shortcut(pkgname, name, type, content_info, icon);
+       retv_if(0l > rowid, -1);
+
+       Evas_Object *item = NULL;
+       item = all_apps_shortcut_add(scroller, rowid, pkgname, NULL, name, content_info, icon, type);
+       retv_if(NULL == item, -1);
+
+       return 0;
+}
+
+
+
+HAPI bool all_apps_shortcut_init(Evas_Object *all_apps)
+{
+       retv_if(NULL == all_apps, false);
+       retv_if(MENU_SCREEN_ERROR_OK != all_apps_db_init(), false);
+
+       Evas_Object *scroller;
+       scroller = evas_object_data_get(all_apps, "scroller");
+       retv_if(NULL == scroller, false);
+
+       int ret;
+       ret = shortcut_set_request_cb(_shorcut_request_cb, scroller);
+
+       return 0 == ret ? true : false;
+}
+
+
+
+HAPI void all_apps_shortcut_fini(void)
+{
+       all_apps_db_fini();
+}
+
+
+
+// End of file.
diff --git a/src/db.c b/src/db.c
new file mode 100644 (file)
index 0000000..9efce2d
--- /dev/null
+++ b/src/db.c
@@ -0,0 +1,326 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <db-util.h>
+#include <sqlite3.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "util.h"
+#include "db.h"
+
+
+
+#define retv_with_dbmsg_if(expr, val) do { \
+       if (expr) { \
+               _E("%s", sqlite3_errmsg(db_info.db)); \
+               return (val); \
+       } \
+} while (0)
+
+
+
+static struct {
+       sqlite3 *db;
+} db_info = {
+       .db = NULL,
+};
+
+struct stmt {
+       sqlite3_stmt *stmt;
+};
+
+
+
+HAPI menu_screen_error_e db_open(const char *db_file)
+{
+       int ret;
+
+       retv_if(NULL == db_file, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       if (db_info.db) {
+               return MENU_SCREEN_ERROR_OK;
+       }
+
+       ret = db_util_open(db_file, &db_info.db, DB_UTIL_REGISTER_HOOK_METHOD);
+       retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI stmt_h *db_prepare(const char *query)
+{
+       int ret;
+       stmt_h *handle;
+
+       retv_if(NULL == query, NULL);
+
+       handle = calloc(1, sizeof(stmt_h));
+       retv_if(NULL == handle, NULL);
+
+       ret = sqlite3_prepare_v2(db_info.db, query, strlen(query), &(handle->stmt), NULL);
+       if (ret != SQLITE_OK) {
+               free(handle);
+               _E("%s", sqlite3_errmsg(db_info.db));
+               return NULL;
+       }
+
+       return handle;
+}
+
+
+
+HAPI menu_screen_error_e db_bind_bool(stmt_h *handle, int idx, bool value)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_FAIL);
+
+       ret = sqlite3_bind_int(handle->stmt, idx, (int) value);
+       retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI menu_screen_error_e db_bind_int(stmt_h *handle, int idx, int value)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_FAIL);
+
+       ret = sqlite3_bind_int(handle->stmt, idx, value);
+       retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI menu_screen_error_e db_bind_str(stmt_h *handle, int idx, const char *str)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_FAIL);
+
+       ret = sqlite3_bind_text(handle->stmt, idx, str, strlen(str), SQLITE_TRANSIENT);
+       retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI menu_screen_error_e db_next(stmt_h *handle)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_FAIL);
+
+       ret = sqlite3_step(handle->stmt);
+       switch (ret) {
+               case SQLITE_ROW:
+                       return MENU_SCREEN_ERROR_OK;
+               case SQLITE_DONE:
+                       return MENU_SCREEN_ERROR_NO_DATA;
+               default:
+                       retv_with_dbmsg_if(1, MENU_SCREEN_ERROR_FAIL);
+       }
+}
+
+
+
+HAPI bool db_get_bool(stmt_h *handle, int index)
+{
+       retv_if(NULL == handle, false);
+       return (bool) sqlite3_column_int(handle->stmt, index);
+}
+
+
+
+HAPI int db_get_int(stmt_h *handle, int index)
+{
+       retv_if(NULL == handle, 0);
+       return sqlite3_column_int(handle->stmt, index);
+}
+
+
+
+HAPI long long db_get_long_long(stmt_h *handle, int index)
+{
+       retv_if(NULL == handle, 0l);
+       return sqlite3_column_int64(handle->stmt, index);
+}
+
+
+HAPI const char *db_get_str(stmt_h *handle, int index)
+{
+       retv_if(NULL == handle, NULL);
+       return (const char *) sqlite3_column_text(handle->stmt, index);
+}
+
+
+
+HAPI menu_screen_error_e db_reset(stmt_h *handle)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == handle->stmt, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       ret = sqlite3_reset(handle->stmt);
+       retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL);
+
+       sqlite3_clear_bindings(handle->stmt);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI menu_screen_error_e db_finalize(stmt_h *handle)
+{
+       int ret;
+
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == handle->stmt, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       ret = sqlite3_finalize(handle->stmt);
+       if(ret != SQLITE_OK) {
+               _E("Cannot finalize handle");
+       }
+       free(handle);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI long long db_last_insert_rowid(void)
+{
+       retv_if(NULL == db_info.db, -1l);
+
+       long long rowid = sqlite3_last_insert_rowid(db_info.db);
+
+       return rowid;
+}
+
+
+
+HAPI menu_screen_error_e db_exec(const char *query)
+{
+       retv_if(NULL == query, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == db_info.db, MENU_SCREEN_ERROR_FAIL);
+
+       stmt_h *handle = db_prepare(query);
+       retv_if(NULL == handle, MENU_SCREEN_ERROR_FAIL);
+
+       goto_if(MENU_SCREEN_ERROR_FAIL == db_next(handle), ERROR);
+       if (MENU_SCREEN_ERROR_OK != db_finalize(handle)) return MENU_SCREEN_ERROR_FAIL;
+
+       return MENU_SCREEN_ERROR_OK;
+
+ERROR:
+       if (handle) db_finalize(handle);
+       return MENU_SCREEN_ERROR_FAIL;
+}
+
+
+
+HAPI void db_close(void)
+{
+       ret_if(!db_info.db);
+       sqlite3_close(db_info.db);
+       db_info.db = NULL;
+}
+
+
+
+HAPI menu_screen_error_e db_begin_transaction(void)
+{
+       int ret = -1;
+
+       ret = sqlite3_exec(db_info.db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+
+       while (SQLITE_BUSY == ret) {
+               sleep(1);
+               ret = sqlite3_exec(db_info.db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+       }
+
+       if (SQLITE_OK != ret) {
+               _E("sqlite3_exec() Failed(%d)", ret);
+               return MENU_SCREEN_ERROR_FAIL;
+       }
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+#define MENU_SCREEN_COMMIT_TRY_MAX 3
+HAPI menu_screen_error_e db_end_transaction(bool success)
+{
+       int ret = -1;
+       int i = 0;
+       char *errmsg = NULL;
+
+       if (success) {
+               ret = sqlite3_exec(db_info.db, "COMMIT TRANSACTION", NULL, NULL, &errmsg);
+               if (SQLITE_OK != ret) {
+                       _E("sqlite3_exec(COMMIT) Failed(%d, %s)", ret, errmsg);
+                       sqlite3_free(errmsg);
+
+                       while (SQLITE_BUSY == ret && i < MENU_SCREEN_COMMIT_TRY_MAX) {
+                               i++;
+                               sleep(1);
+                               ret = sqlite3_exec(db_info.db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+                       }
+
+                       if (SQLITE_OK != ret) {
+                               _E("sqlite3_exec() Failed(%d)", ret);
+                               ret = sqlite3_exec(db_info.db, "ROLLBACK TRANSACTION", NULL, NULL, NULL);
+                               if (SQLITE_OK != ret) {
+                                       _E("sqlite3_exec() Failed(%d)", ret);
+                               }
+
+                               return MENU_SCREEN_ERROR_FAIL;
+                       }
+               }
+       } else {
+               ret = sqlite3_exec(db_info.db, "ROLLBACK TRANSACTION", NULL, NULL, NULL);
+               if (SQLITE_OK != ret) {
+                       _E("sqlite3_exec() Faild(%d)", ret);
+
+                       return MENU_SCREEN_ERROR_FAIL;
+               }
+       }
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+// End of file.
index 296acacdf1c21764bfbc0fa1ed18d908cb526187..82a71d098b2d5ddda335d16edda2d8be8bbba177 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 
@@ -28,7 +32,7 @@
 
 
 
-inline void index_bring_in(Evas_Object *index, int idx)
+HAPI inline void index_bring_in(Evas_Object *index, int idx)
 {
        Elm_Object_Item *idx_it;
 
@@ -39,8 +43,10 @@ inline void index_bring_in(Evas_Object *index, int idx)
 
 
 
-void index_destroy(Evas_Object *index)
+HAPI void index_destroy(Evas_Object *index)
 {
+       ret_if(NULL == index);
+
        evas_object_data_del(index, "win");
        evas_object_data_del(index, "layout");
        evas_object_data_del(index, "controlbar");
@@ -52,32 +58,34 @@ void index_destroy(Evas_Object *index)
 
 
 
-Evas_Object *index_create(Evas_Object *tab, unsigned int count)
+HAPI Evas_Object *index_create(Evas_Object *tab, unsigned int count, unsigned int current_idx)
 {
        Evas_Object *index;
        Evas_Object *scroller;
        register int i;
-       char *number;
+       char number_pre[256] = { 0, };
+       char *number = NULL;
 
        retv_if(NULL == tab, NULL);
        index = elm_index_add(tab);
        retv_if(NULL == index, NULL);
 
-       elm_object_style_set(index, "pagecontrol");
+       elm_object_theme_set(index, menu_screen_get_theme());
+       elm_object_style_set(index, "menuscreen/index");
        elm_index_horizontal_set(index, EINA_TRUE);
        elm_index_autohide_disabled_set(index, EINA_TRUE);
 
-       number = malloc(((size_t) log10((double) MAX_PAGE_NO)) + 2);
-       retv_if(NULL == number, NULL);
-
        for (i = 0; i < count; i++) {
-               sprintf(number, "%d", i + 1);
+               snprintf(number_pre, sizeof(number_pre), "%d", i + 1);
+               number = strdup(number_pre);
+               retv_if(!number, NULL);
                elm_index_item_append(index, number, NULL, (void *) i);
+               free(number);
        }
        elm_index_level_go(index, 0);
 
        if (count > 0) {
-               index_bring_in(index, 0);
+               index_bring_in(index, current_idx);
        }
 
        elm_object_part_content_set(tab, PAGE_CONTROLLER_GROUP_NAME, index);
@@ -104,23 +112,34 @@ Evas_Object *index_create(Evas_Object *tab, unsigned int count)
 
 
 
-Evas_Object *index_update(Evas_Object *layout, Evas_Object *index, unsigned int count)
+HAPI Evas_Object *index_update(Evas_Object *layout, Evas_Object *index, unsigned int count)
 {
+       int idx = 0;
+
+       int cur_count = (int) evas_object_data_get(index, "count");
+       if (cur_count > 0) {
+               Elm_Object_Item *idx_it = elm_index_selected_item_get(index, 0);
+               if (idx_it) idx = (int) elm_object_item_data_get(idx_it);
+       }
+
+       if(count == idx) idx--;
+       if(idx == -1) idx = 0;
 
+       _D("Current index %d, Current count: %d", idx,count);
        index_destroy(index);
-       return index_create(layout, count);
+       return index_create(layout, count, idx);
 }
 
 
 
-void index_hide(Evas_Object *index)
+HAPI void index_hide(Evas_Object *index)
 {
        edje_object_signal_emit(_EDJ(index), "hide", "index");
 }
 
 
 
-void index_show(Evas_Object *index)
+HAPI void index_show(Evas_Object *index)
 {
        edje_object_signal_emit(_EDJ(index), "show", "index");
 }
index a9dd1072c80789e948d10e8128e80867e22bf41e..e91448938eef40ab355659667dcfae39be24a595 100644 (file)
@@ -1,27 +1,36 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <Elementary.h>
-#include <aul.h>
 #include <ail.h>
+#include <appsvc.h>
+#include <app_control.h>
+#include <aul.h>
 
 #include "menu_screen.h"
+#include "item_badge.h"
 #include "conf.h"
 #include "item.h"
 #include "item_event.h"
@@ -29,6 +38,8 @@
 #include "list.h"
 #include "mapbuf.h"
 #include "page.h"
+#include "page_scroller.h"
+#include "pkgmgr.h"
 #include "popup.h"
 #include "util.h"
 
 #define LAYOUT_BLOCK_INTERVAL          1.0
 #define ITEM_GROUP_NAME "icon"
 
+#define DATA_KEY_ITEM_LAUNCH_MAIN_OPERATION "dk_it_launch"
+#define STR_ATTRIBUTE_PKGID "pkgid"
 #define STR_ATTRIBUTE_NAME "name"
 #define STR_ATTRIBUTE_ICON "icon"
 #define STR_ATTRIBUTE_PKG_NAME "package"
 #define STR_ATTRIBUTE_REMOVABLE        "removable"
 #define STR_ATTRIBUTE_DESKTOP "desktop"
+#define STR_ATTRIBUTE_TYPE "type"
 #define STR_ATTRIBUTE_PAGE "pending,page"
 #define STR_ICON_IMAGE_TYPE_OBJECT "object"
 #define STR_ICON_IMAGE_TYPE_EDJE "edje"
 
 
 
-#if 0 // Dual line is disabled temporarily.
-static char *_space_to_new_line(const char *str)
-{
-       char *tmp;
-       int len;
-       int space_idx = 0;
-
-       retv_if(NULL == str, NULL);
-       len = strlen(str);
-
-       if (len > LINE_SIZE) {
-               for (space_idx = LINE_SIZE - 1; str[space_idx] != ' ' && space_idx > 0; space_idx--);
-               if (!space_idx) {
-                       space_idx = strcspn(str, " ");
-                       space_idx = (space_idx == len ? 0 : space_idx);
-               }
-       }
-
-       if (space_idx) {
-               int i;
-               retv_if(NULL == (tmp = calloc(1, len + 4)), NULL);
-
-               for (i = 0; i < space_idx; i++) {
-                       tmp[i] = str[i];
-               }
-               strcat(tmp, "<br>");
-               for (i = space_idx + 1; i < len; i++) {
-                       tmp[i + 3] = str[i];
-               }
-       } else {
-               retv_if(NULL == (tmp = strdup(str)), NULL);
-       }
-
-       return tmp;
-}
-#endif
-
-
-
-void item_set_icon(Evas_Object *edje, char *icon, int sync)
+HAPI void item_set_icon(Evas_Object *edje, char *icon, int sync)
 {
        char *tmp;
        int changed;
@@ -114,68 +89,49 @@ void item_set_icon(Evas_Object *edje, char *icon, int sync)
 
 
 
-inline char *item_get_icon(Evas_Object *edje)
+HAPI char *item_get_icon(Evas_Object *edje)
 {
        return evas_object_data_get(edje, STR_ATTRIBUTE_ICON);
 }
 
 
 
-
-void item_set_name(Evas_Object *edje, char *name, int sync)
+HAPI void item_set_name(Evas_Object *edje, char *name, int sync)
 {
        char *tmp;
        int changed;
-       bool is_dual_line;
 
        tmp = evas_object_data_get(edje, STR_ATTRIBUTE_NAME);
+       if (!(tmp||name)) return;
        changed = (tmp && name) ? strcmp(name, tmp) : 1;
 
        if (!changed) {
                return;
        }
 
-       free(tmp);
+       if (tmp) free(tmp);
        evas_object_data_del(edje, STR_ATTRIBUTE_NAME);
-       if (name) {
+       if (name && (strcmp(name, "(NULL)"))) {
                tmp = strdup(name);
-               if (tmp) {
-                       evas_object_data_set(edje, STR_ATTRIBUTE_NAME, tmp);
-               }else {
-                       _E("No more memory for allocating space \"%s\"", name);
-               }
-
-               is_dual_line = (bool) evas_object_data_get(edje, "item_text_dual_line");
-               if (is_dual_line) {
-                       char *dual_txt;
-
-                       # if 0 // Dual line is disabled temporarily.
-                       dual_txt = _space_to_new_line(name);
-                       #else
-                       dual_txt = strdup(name);
-                       #endif
-                       if (edje_object_part_text_set(_EDJ(edje), "txt", dual_txt) == EINA_FALSE){
-                               //_E("Failed to set text on the part");
-                       }
-                       free(dual_txt);
-               } else {
-                       if (edje_object_part_text_set(_EDJ(edje), "txt", name) == EINA_FALSE){
-                               //_E("Failed to set text on the part");
-                       }
+               ret_if(NULL == tmp);
+               evas_object_data_set(edje, STR_ATTRIBUTE_NAME, tmp);
+               if (edje_object_part_text_set(_EDJ(edje), "txt", tmp) == EINA_FALSE){
+                       _E("Failed to set text on the part");
                }
+               elm_object_signal_emit(edje, "text,on", "menu");
        }
 }
 
 
 
-inline char *item_get_name(Evas_Object *edje)
+HAPI inline char *item_get_name(Evas_Object *edje)
 {
        return evas_object_data_get(edje, STR_ATTRIBUTE_NAME);
 }
 
 
 
-void item_set_desktop(Evas_Object *edje, char *name, int sync)
+HAPI void item_set_desktop(Evas_Object *edje, char *name, int sync)
 {
        char *tmp;
        int changed;
@@ -201,14 +157,38 @@ void item_set_desktop(Evas_Object *edje, char *name, int sync)
 
 
 
-inline char *item_get_desktop(Evas_Object *edje)
+HAPI inline char *item_get_desktop(Evas_Object *edje)
 {
        return evas_object_data_get(edje, STR_ATTRIBUTE_DESKTOP);
 }
 
 
 
-void item_set_package(Evas_Object *edje, char *package, int sync)
+HAPI void item_set_type(Evas_Object *edje, int type, int sync)
+{
+       int tmp;
+       int changed;
+
+       tmp = (int) evas_object_data_get(edje, STR_ATTRIBUTE_TYPE);
+       changed = (tmp == type ? 0 : 1);        // We have to do sync when an attribute is created
+
+       if (!changed) {
+               return ;
+       }
+
+       evas_object_data_set(edje, STR_ATTRIBUTE_TYPE, (void *) type);
+}
+
+
+
+HAPI inline int item_get_type(Evas_Object *edje)
+{
+       return (int) evas_object_data_get(edje, STR_ATTRIBUTE_TYPE);
+}
+
+
+
+HAPI void item_set_package(Evas_Object *edje, char *package, int sync)
 {
        char *tmp;
        int changed;
@@ -235,14 +215,48 @@ void item_set_package(Evas_Object *edje, char *package, int sync)
 
 
 
-inline char *item_get_package(Evas_Object *edje)
+HAPI char *item_get_package(Evas_Object *edje)
 {
        return evas_object_data_get(edje, STR_ATTRIBUTE_PKG_NAME);
 }
 
 
 
-void item_set_removable(Evas_Object *edje, int removable, int sync)
+HAPI void item_set_pkgid(Evas_Object *edje, char *package, int sync)
+{
+       char *tmp;
+       int changed;
+
+       tmp = evas_object_data_get(edje, STR_ATTRIBUTE_PKGID);
+       changed = (package && tmp) ? strcmp(tmp, package) : 1;
+
+       if (!changed) {
+               return;
+       }
+
+       free(tmp);
+       evas_object_data_del(edje, STR_ATTRIBUTE_PKGID);
+
+       if (package) {
+               tmp = strdup(package);
+               if (!tmp) {
+                       _E("No more space for string \"%s\"", package);
+               } else {
+                       evas_object_data_set(edje, STR_ATTRIBUTE_PKGID, tmp);
+               }
+       }
+}
+
+
+
+HAPI char *item_get_pkgid(Evas_Object *edje)
+{
+       return evas_object_data_get(edje, STR_ATTRIBUTE_PKGID);
+}
+
+
+
+HAPI void item_set_removable(Evas_Object *edje, int removable, int sync)
 {
        int value;
        int changed;
@@ -263,14 +277,14 @@ void item_set_removable(Evas_Object *edje, int removable, int sync)
 
 
 
-inline int item_get_removable(Evas_Object *edje)
+HAPI int item_get_removable(Evas_Object *edje)
 {
        return (int) evas_object_data_get(edje, STR_ATTRIBUTE_REMOVABLE);
 }
 
 
 
-void item_set_page(Evas_Object *edje, Evas_Object *page, int sync)
+HAPI void item_set_page(Evas_Object *edje, Evas_Object *page, int sync)
 {
        Evas_Object *value;
        int changed;
@@ -291,7 +305,7 @@ void item_set_page(Evas_Object *edje, Evas_Object *page, int sync)
 
 
 
-inline Evas_Object *item_get_page(Evas_Object *edje)
+HAPI Evas_Object *item_get_page(Evas_Object *edje)
 {
        return evas_object_data_get(edje, STR_ATTRIBUTE_PAGE);
 }
@@ -299,7 +313,7 @@ inline Evas_Object *item_get_page(Evas_Object *edje)
 
 
 
-inline void item_enable_delete(Evas_Object *item)
+HAPI void item_enable_delete(Evas_Object *item)
 {
        if (item_get_removable(item) > 0) {
                edje_object_signal_emit(_EDJ(item), "delete,on", "menu");
@@ -308,7 +322,7 @@ inline void item_enable_delete(Evas_Object *item)
 
 
 
-inline void item_disable_delete(Evas_Object *item)
+HAPI void item_disable_delete(Evas_Object *item)
 {
        if (item_get_removable(item) > 0) {
                edje_object_signal_emit(_EDJ(item), "delete,off", "menu");
@@ -316,7 +330,50 @@ inline void item_disable_delete(Evas_Object *item)
 }
 
 
-void item_enable_progress(Evas_Object *obj)
+
+HAPI void item_show_badge(Evas_Object *obj, int value)
+{
+       char str[BUFSZE];
+       Evas_Object *scroller;
+
+       ret_if(NULL == obj);
+       ret_if(value <= 0);
+
+       snprintf(str, sizeof(str), "%d", value);
+       if (edje_object_part_text_set(_EDJ(obj), "badge,txt", str) == EINA_FALSE) {
+               _E("Failed to set text on the part, edje:%p, part:%s, text:%s", _EDJ(obj), "badge,txt", str);
+       }
+
+       scroller = evas_object_data_get(obj, "scroller");
+       ret_if(NULL == scroller);
+       ret_if(page_scroller_is_edited(scroller));
+
+       edje_object_signal_emit(_EDJ(obj), "badge,on", "menu");
+       evas_object_data_set(obj, "badge,enabled", (void*)1);
+
+       _D("Badge is updated to %s", str);
+}
+
+
+
+HAPI void item_hide_badge(Evas_Object *obj)
+{
+       ret_if(NULL == obj);
+
+       edje_object_signal_emit(_EDJ(obj), "badge,off", "menu");
+       evas_object_data_del(obj, "badge,enabled");
+}
+
+
+
+HAPI int item_is_enabled_badge(Evas_Object *obj)
+{
+       return evas_object_data_get(obj, "badge,enabled") != NULL;
+}
+
+
+
+HAPI void item_enable_progress(Evas_Object *obj)
 {
        Evas_Object *progress;
 
@@ -328,7 +385,7 @@ void item_enable_progress(Evas_Object *obj)
                evas_object_del(progress);
        }
 
-       progress = elm_progressbar_add(menu_screen_get_win());
+       progress = elm_progressbar_add(obj);
        ret_if(NULL == progress);
 
        elm_object_part_content_set(obj, "progress,swallow", progress);
@@ -347,7 +404,7 @@ void item_enable_progress(Evas_Object *obj)
 
 
 
-void item_update_progress(Evas_Object *obj, int value)
+HAPI void item_update_progress(Evas_Object *obj, int value)
 {
        Evas_Object *progress;
 
@@ -363,7 +420,7 @@ void item_update_progress(Evas_Object *obj, int value)
 
 
 
-void item_disable_progress(Evas_Object *obj)
+HAPI void item_disable_progress(Evas_Object *obj)
 {
        Evas_Object *progress;
 
@@ -381,28 +438,60 @@ void item_disable_progress(Evas_Object *obj)
 
 
 
-int item_is_enabled_progress(Evas_Object *obj)
+HAPI int item_is_enabled_progress(Evas_Object *obj)
 {
        return evas_object_data_get(obj, "progress,enabled") != NULL;
 }
 
 
 
-static Evas_Object *_add_icon_image(const char *icon_file)
+HAPI void item_edit(Evas_Object *item)
+{
+       if (item_get_removable(item)) {
+               edje_object_signal_emit(_EDJ(item), "uninstall,on", "menu");
+       }
+       edje_object_signal_emit(_EDJ(item), "badge,off", "menu");
+       item_unmark_dirty(item);
+}
+
+
+
+HAPI void item_unedit(Evas_Object *item)
+{
+       char *package;
+
+       edje_object_signal_emit(_EDJ(item), "uninstall,off", "menu");
+
+       package = item_get_package(item);
+       if (item_badge_is_registered(item)
+                       && item_badge_count(package) > 0)
+       {
+               edje_object_signal_emit(_EDJ(item), "badge,on", "menu");
+       }
+}
+
+
+
+static Evas_Object *_add_icon_image(Evas_Object *item, const char *icon_file)
 {
        Evas_Object *icon;
 
-       icon = elm_icon_add(menu_screen_get_win());
-       if (elm_icon_file_set(icon, icon_file, NULL) == EINA_FALSE) {
+       retv_if(NULL == item, NULL);
+       retv_if(NULL == icon_file, NULL);
+
+       icon = elm_icon_add(item);
+       retv_if(NULL == icon, NULL);
+
+       if (elm_image_file_set(icon, icon_file, NULL) == EINA_FALSE) {
                _E("Icon file is not accessible (%s)", icon_file);
                evas_object_del(icon);
                icon = NULL;
        }
 
-       elm_icon_resizable_set(icon, EINA_TRUE, EINA_TRUE);
+       elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE);
 
-       if (menu_screen_get_root_height() >= BASE_HEIGHT || menu_screen_get_root_width() >= BASE_WIDTH) {
-               elm_icon_no_scale_set(icon, EINA_TRUE);
+       if (menu_screen_get_root_height() > BASE_HEIGHT || menu_screen_get_root_width() > BASE_WIDTH) {
+               elm_image_no_scale_set(icon, EINA_TRUE);
        }
 
        return icon;
@@ -410,15 +499,19 @@ static Evas_Object *_add_icon_image(const char *icon_file)
 
 
 
-static Evas_Object *_add_edje_icon(const char *icon_file)
+static Evas_Object *_add_edje_icon(Evas_Object *item, const char *icon_file)
 {
        Evas_Object *icon;
+
+       retv_if(NULL == item, NULL);
+       retv_if(NULL == icon_file, NULL);
+
        if (access(icon_file, R_OK) != 0) {
                _E("Failed to get an icon");
                return NULL;
        }
 
-       icon = layout_load_edj(menu_screen_get_win(), (char*)icon_file, ITEM_GROUP_NAME);
+       icon = layout_load_edj(item, (char*)icon_file, ITEM_GROUP_NAME);
        if (!icon) {
                _E("Failed to load an edje, [%s] group icon", icon_file);
                evas_object_del(icon);
@@ -430,7 +523,7 @@ static Evas_Object *_add_edje_icon(const char *icon_file)
 
 
 
-menu_screen_error_e item_is_edje_icon(const char *icon)
+HAPI menu_screen_error_e item_is_edje_icon(const char *icon)
 {
        int len;
        const char *ext = "jde.";
@@ -449,17 +542,57 @@ menu_screen_error_e item_is_edje_icon(const char *icon)
 
 
 
-void item_update(Evas_Object *item, app_info_t *ai)
+static int _is_main_operation_launch(Evas_Object *scroller, const char *package)
 {
-       Evas_Object *icon;
+       Eina_List *main_operation_list;
+
+       retv_if(!package, 0);
+
+       main_operation_list = evas_object_data_get(scroller, DATA_KEY_MAIN_OPERATION_LIST);
+       if (!main_operation_list) {
+               _D("main operation list is NULL");
+               return 0;
+       }
+
+       const Eina_List *l, *l_next;
+       char *data;
+       EINA_LIST_FOREACH_SAFE(main_operation_list, l, l_next, data) {
+               continue_if(!data);
+               if (!strcmp(package, data)) {
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+
+
+HAPI void item_update(Evas_Object *item, app_info_t *ai)
+{
+       Evas_Object *icon = NULL;
+
+       ret_if(NULL == item);
+       ret_if(NULL == ai);
 
        if (!ai->image) {
-               if (item_is_edje_icon(ai->icon) == MENU_SCREEN_ERROR_OK) {
-                       icon = _add_edje_icon(ai->icon);
-                       evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_EDJE);
-               } else {
-                       icon = _add_icon_image(ai->icon);
-                       evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_OBJECT);
+               if (ai->icon) {
+                       FILE *fp;
+                       fp = fopen(ai->icon, "rb");
+                       if (fp) {
+                               fseek(fp, 0L, SEEK_END);
+                               _D("Access to file [%s], size[%ld]", ai->icon, ftell(fp));
+                               fclose(fp);
+                       } else _E("Cannot get the file pointer[%s]", ai->icon);
+
+                       if (item_is_edje_icon(ai->icon) == MENU_SCREEN_ERROR_OK) {
+                               icon = _add_edje_icon(item, ai->icon);
+                               evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_EDJE);
+                       } else {
+                               icon = _add_icon_image(item, ai->icon);
+                               ret_if(!icon);
+                               evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_OBJECT);
+                       }
                }
        } else {
                icon = ai->image;
@@ -477,17 +610,103 @@ void item_update(Evas_Object *item, app_info_t *ai)
                evas_object_data_set(item, "icon_image", icon);
        }
 
+       item_set_pkgid(item, ai->pkgid, 0);
        item_set_package(item, ai->package, 0);
        item_set_desktop(item, ai->desktop, 0);
        item_set_name(item, ai->name, 0);
        item_set_icon(item, ai->icon, 0);
        evas_object_data_set(item, STR_ATTRIBUTE_REMOVABLE, (void*) ai->x_slp_removable);
        evas_object_data_set(item, "pid", (void *) ai->pid);
+
+       item_badge_register(item);
+
+       do {
+               Evas_Object *scroller;
+
+               scroller = evas_object_data_get(item, "scroller");
+               break_if(NULL == scroller);
+
+               if (false == page_scroller_is_edited(scroller)) break;
+               item_edit(item);
+       } while (0);
+}
+
+
+
+static char *_access_info_cb(void *data, Evas_Object *obj)
+{
+       Evas_Object *item = data;
+       char *name = NULL;
+       name = item_get_name(item);
+       retv_if(NULL == name, NULL);
+
+       char *tmp = NULL;
+       tmp = strdup(name);
+       retv_if(NULL == tmp, NULL);
+       return tmp;
+}
+
+
+
+/* This function is similar to _item_up_cb. But it's apparently different */
+static void _focus_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Evas_Object *scroller;
+
+       Evas_Object *item = data;
+       ret_if(NULL == item);
+
+       _D("ITEM: mouse up event callback is invoked for %p", item);
+       PRINT_APPFWK();
+
+       scroller = evas_object_data_get(item, "scroller");
+       ret_if(NULL == scroller);
+
+       if (true == page_scroller_is_edited(scroller)) {
+               return;
+       }
+       item_launch(item);
 }
 
 
 
-Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai)
+#define IDS_AT_BODY_UNINSTALL "IDS_AT_BODY_UNINSTALL"
+static char *_access_uninstall_cb(void *data, Evas_Object *obj)
+{
+       char *info;
+       char *tmp;
+       info = _(IDS_AT_BODY_UNINSTALL);
+       if (!info) return NULL;
+       tmp = strdup(info);
+       if (!tmp) return NULL;
+       return tmp;
+}
+
+
+
+/* This function is similar to _uninstall_up_cb in item_event.c */
+static void _uninstall_focus_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Evas_Object *win;
+       char *package;
+
+       win = menu_screen_get_win();
+       ret_if(NULL == win);
+
+       _D("Uninstall button is up");
+
+       Evas_Object *item = data;
+       package = item_get_package(item);
+       ret_if(!package || strlen(package) == 0);
+
+       _D("Uninstalling... [%s]", package);
+
+       popup_create_uninstall(win, item);
+}
+
+
+
+HAPI Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai)
 {
        Evas_Object *item;
        Evas_Object *bg;
@@ -497,14 +716,42 @@ Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai)
        int item_height;
 
        item_edje = evas_object_data_get(scroller, "item_edje");
-       item = layout_load_edj(menu_screen_get_win(), item_edje, ITEM_GROUP_NAME);
+       retv_if(!item_edje, NULL);
+       item = layout_load_edj(scroller, item_edje, ITEM_GROUP_NAME);
        if (!item) {
                _E("Failed to load an item object");
                return NULL;
        }
 
+       Evas_Object *item_focus = NULL;
+       Evas_Object *focus = NULL;
+
+       do { // focus
+               item_focus = elm_button_add(item);
+               retv_if(NULL == item_focus, NULL);
+
+               elm_object_style_set(item_focus, "focus");
+               elm_object_part_content_set(item, "focus", item_focus);
+               elm_access_info_cb_set(item_focus, ELM_ACCESS_INFO, _access_info_cb, item);
+               evas_object_smart_callback_add(item_focus, "clicked", _focus_clicked_cb, item);
+       } while (0);
+
+       do { // make a button for a focus button of deleting.
+               focus = elm_button_add(item);
+               retv_if(NULL == focus, NULL);
+
+               elm_object_style_set(focus, "focus");
+               elm_object_part_content_set(item, "uninstall_focus", focus);
+               elm_access_info_cb_set(focus, ELM_ACCESS_INFO, _access_uninstall_cb, item);
+               evas_object_smart_callback_add(focus, "clicked", _uninstall_focus_clicked_cb, item);
+       } while (0);
+
+       elm_object_focus_next_object_set(item_focus, focus, ELM_FOCUS_UP);
+       elm_object_focus_next_object_set(focus, item_focus, ELM_FOCUS_DOWN);
+
        bg = evas_object_rectangle_add(menu_screen_get_evas());
        if (!bg) {
+               _E("Cannot add an rectangle");
                evas_object_del(item);
                return NULL;
        }
@@ -518,8 +765,6 @@ Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai)
        evas_object_size_hint_max_set(bg, item_width, item_height);
        elm_object_part_content_set(item, "bg", bg);
 
-       edje_object_text_class_set(_EDJ(item), "menu_item", "SLP:style=medium", 24);
-
        evas_object_data_set(item, "win", evas_object_data_get(scroller, "win"));
        evas_object_data_set(item, "layout", evas_object_data_get(scroller, "layout"));
        evas_object_data_set(item, "controlbar", evas_object_data_get(scroller, "controlbar"));
@@ -531,16 +776,24 @@ Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai)
        evas_object_data_set(item, "x", (void *) 0);
        evas_object_data_set(item, "y", (void *) 0);
        evas_object_data_set(item, "dirty", (void *) 0);
+       if (_is_main_operation_launch(scroller, ai->package)) {
+               evas_object_data_set(item, DATA_KEY_ITEM_LAUNCH_MAIN_OPERATION, (void *) 1);
+       }
 
        item_update(item, ai);
        item_event_register(item);
+       if (MENU_SCREEN_ERROR_OK !=
+                                       pkgmgr_item_list_append_item(ai->pkgid, ai->package, item))
+       {
+               _E("Cannot append an item into the item list");
+       }
 
        return item;
 }
 
 
 
-void item_destroy(Evas_Object *item)
+HAPI void item_destroy(Evas_Object *item)
 {
        Evas_Object *icon;
        Evas_Object *bg;
@@ -549,24 +802,39 @@ void item_destroy(Evas_Object *item)
        Eina_List *n;
        Eina_List *t;
        Evas_Object *pend_item;
-       int pending_idx;
        const char *icon_image_type;
+       char *pkgid = NULL;
+       char *package= NULL;
 
        ret_if(NULL == item);
 
+       pkgid = item_get_pkgid(item);
+       package = item_get_package(item);
+
+       if (pkgid
+               && package
+               && MENU_SCREEN_ERROR_OK !=
+                                       pkgmgr_item_list_remove_item(pkgid, package, item))
+       {
+               _E("Cannot remove an item in the item list");
+       }
+
        page = item_get_page(item);
        pending_list = evas_object_data_get(page, "pending,list");
        EINA_LIST_FOREACH_SAFE(pending_list, n, t, pend_item) {
                if (pend_item == item) {
-                       pending_idx = (int)evas_object_data_get(pend_item, "pending,idx");
                        pending_list = eina_list_remove(pending_list, pend_item);
                        evas_object_data_set(page, "pending,list", pending_list);
                        evas_object_data_del(pend_item, "pending,idx");
                }
        }
 
+       if (item_badge_is_registered(item)) {
+               item_badge_unregister(item);
+       }
        item_event_unregister(item);
 
+       item_set_pkgid(item, NULL, 0);
        item_set_package(item, NULL, 1);
        item_set_desktop(item, NULL, 1);
        item_set_name(item, NULL, 1);
@@ -602,6 +870,24 @@ void item_destroy(Evas_Object *item)
        evas_object_data_del(item, "x");
        evas_object_data_del(item, "y");
        evas_object_data_del(item, "dirty");
+       evas_object_data_del(item, DATA_KEY_ITEM_LAUNCH_MAIN_OPERATION);
+
+       do {
+               Evas_Object *focus = NULL;
+               focus = elm_object_part_content_unset(item, "focus");
+               if (NULL == focus) break;
+               evas_object_smart_callback_del(focus, "clicked", _focus_clicked_cb);
+               evas_object_del(focus);
+       } while (0);
+
+       do {
+               Evas_Object *focus = NULL;
+               focus = elm_object_part_content_unset(item, "uninstall_focus");
+               if (NULL == focus) break;
+               evas_object_smart_callback_del(focus, "clicked", _uninstall_focus_clicked_cb);
+               evas_object_del(focus);
+       } while (0);
+
        layout_unload_edj(item);
 }
 
@@ -610,50 +896,104 @@ void item_destroy(Evas_Object *item)
 static Eina_Bool _unblock_cb(void *data)
 {
        Evas_Object *layout;
-       layout = evas_object_data_get(menu_screen_get_win(), "layout_current");
+       layout = evas_object_data_get(menu_screen_get_win(), "layout");
        layout_disable_block(layout);
        return EINA_FALSE;
 }
 
 
 
-void item_launch(Evas_Object *obj)
+static void _run_cb(bundle *b, int request_code, appsvc_result_val result, void *data)
+{
+}
+
+
+#define BUNDLE_KEY_OPERATION    "__APP_SVC_OP_TYPE__"
+HAPI void item_launch(Evas_Object *obj)
 {
        char *package;
        char *name;
-       int ret_aul;
-       Evas_Object *layout;
+       bundle *b = NULL;
+       Evas_Object *layout = NULL;
 
-       ret_if(NULL == obj);
+       Evas_Object *item = obj;
+       ret_if(NULL == item);
 
-       name = item_get_name(obj);
-       package = item_get_package(obj);
+       name = item_get_name(item);
+       package = item_get_package(item);
        ret_if(NULL == package);
 
-       layout = evas_object_data_get(menu_screen_get_win(), "layout_current");
+       layout = evas_object_data_get(menu_screen_get_win(), "layout");
        layout_enable_block(layout);
 
-       ret_aul = aul_open_app(package);
-       if (ret_aul == AUL_R_EINVAL) {
-               char* sinform;
-               int len;
+       bool is_shortcut = (bool) evas_object_data_get(item, "is_shortcut");
+       bool shortcut_launch_package = (bool) evas_object_data_get(item, "shortcut_launch_package");
+       if (is_shortcut && !shortcut_launch_package) {
+               b = bundle_create();
+               ret_if(NULL == b);
 
-               // IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS : "Unable to launch %s"
-               len = strlen(D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS")) + strlen(name) + 1;
+               appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
+               appsvc_set_uri(b, evas_object_data_get(item, "content_info"));
 
-               sinform = calloc(len, sizeof(char));
-               if (!sinform) {
-                       _E("cannot calloc for popup.");
-                       return;
+               int ret = -1;
+               ret = appsvc_run_service(b, 0, _run_cb, NULL);
+               if (0 > ret) {
+                       _E("cannot run service. ret [%d]", ret);
+                       layout_disable_block(layout);
+               } else {
+                       _D("Launch app's ret : [%d]", ret);
+                       ecore_timer_add(LAYOUT_BLOCK_INTERVAL, _unblock_cb, NULL);
                }
 
-               snprintf(sinform, len, D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS"), name);
-               popup_create(obj, sinform);
-
-               free(sinform);
-               layout_disable_block(layout);
+               bundle_free(b);
        } else {
+               int ret_aul = AUL_R_OK;
+               if (evas_object_data_get(item, DATA_KEY_ITEM_LAUNCH_MAIN_OPERATION)) {
+                       b = bundle_create();
+                       ret_if(NULL == b);
+
+                       if (0 != bundle_add(b, BUNDLE_KEY_OPERATION, APP_CONTROL_OPERATION_MAIN)) {
+                               _E("Cannot add to a bundle");
+                               bundle_free(b);
+                               return;
+                       }
+
+                       if (b) {
+                               ret_aul = aul_launch_app(package, b);
+                               if (AUL_R_EINVAL == ret_aul) {
+                                       _E("cannot launch app");
+                               }
+                               bundle_free(b);
+                       }
+               } else {
+                       ret_aul = aul_open_app(package);
+                       if (AUL_R_EINVAL == ret_aul) {
+                               char* sinform;
+                               int len;
+
+                               if (!name) {
+                                       name = package;
+                               }
+
+                               // IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS : "Unable to launch %s"
+                               len = strlen(D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS")) + strlen(name) + 1;
+
+                               sinform = calloc(len, sizeof(char));
+                               if (!sinform) {
+                                       _E("cannot calloc for popup.");
+                                       return;
+                               }
+
+                               snprintf(sinform, len, D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS"), name);
+                               popup_create_confirm(layout, sinform);
+
+                               free(sinform);
+                               layout_disable_block(layout);
+                       }
+               }
+
                _D("Launch app's ret : [%d]", ret_aul);
+
                _T(package);
                ecore_timer_add(LAYOUT_BLOCK_INTERVAL, _unblock_cb, NULL);
        }
@@ -661,7 +1001,7 @@ void item_launch(Evas_Object *obj)
 
 
 
-int item_get_position(Evas_Object *item)
+HAPI int item_get_position(Evas_Object *item)
 {
        Evas_Object *scroller;
        Evas_Object *layout;
@@ -716,21 +1056,21 @@ int item_get_position(Evas_Object *item)
 
 
 
-void item_mark_dirty(Evas_Object *item)
+HAPI void item_mark_dirty(Evas_Object *item)
 {
        evas_object_data_set(item, "dirty", (void *) 1);
 }
 
 
 
-void item_unmark_dirty(Evas_Object *item)
+HAPI void item_unmark_dirty(Evas_Object *item)
 {
        evas_object_data_set(item, "dirty", (void *) 0);
 }
 
 
 
-int item_is_dirty(Evas_Object *item)
+HAPI int item_is_dirty(Evas_Object *item)
 {
        return (int) evas_object_data_get(item, "dirty");
 }
diff --git a/src/item_badge.c b/src/item_badge.c
new file mode 100644 (file)
index 0000000..aa52032
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <badge.h>
+#include <Elementary.h>
+#include <stdbool.h>
+
+#include "menu_screen.h"
+#include "conf.h"
+#include "item.h"
+#include "page_scroller.h"
+#include "util.h"
+
+
+
+HAPI int item_badge_count(char *package)
+{
+       unsigned int is_display = 0;
+       unsigned int count = 0;
+       badge_error_e err = BADGE_ERROR_NONE;
+
+       err = badge_get_display(package, &is_display);
+       if (BADGE_ERROR_NONE != err) _D("cannot get badge display");
+
+       if (0 == is_display) return 0;
+
+       err = badge_get_count(package, &count);
+       if (BADGE_ERROR_NONE != err) _D("cannot get badge count");
+
+       _D("Badge for package %s : %u", package, count);
+
+       return (int) count;
+}
+
+
+
+static Eina_Bool _idler_cb(void *data)
+{
+       char *package;
+       int count;
+       Evas_Object *item = data;
+
+       package = item_get_package(item);
+       if (!package) {
+               _D("Failed to get a package name");
+               evas_object_data_del(item, "idle_timer");
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       count = item_badge_count(package);
+       _D("Register badge to Item, count: %d", count);
+       if (count) item_show_badge(item, count);
+       else item_hide_badge(item);
+
+       evas_object_data_del(item, "idle_timer");
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+HAPI bool item_badge_is_registered(Evas_Object *item)
+{
+       const char *pkgname;
+       badge_error_e err;
+       bool existing = false;
+
+       pkgname = item_get_package(item);
+       retv_if(NULL == pkgname, false);
+
+       err = badge_is_existing(pkgname, &existing);
+       if (BADGE_ERROR_NONE != err) _E("cannot know whether the badge for %s is or not.", pkgname);
+
+       return existing? true : false;
+}
+
+
+
+HAPI menu_screen_error_e item_badge_register(Evas_Object *item)
+{
+       Ecore_Idler *idle_timer;
+       bool is_registered;
+
+       is_registered = item_badge_is_registered(item);
+       if (false == is_registered) return MENU_SCREEN_ERROR_OK;
+
+       idle_timer = ecore_idler_add(_idler_cb, item);
+       retv_if(NULL == idle_timer, MENU_SCREEN_ERROR_FAIL);
+       evas_object_data_set(item, "idle_timer", idle_timer);
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
+HAPI void item_badge_unregister(Evas_Object *item)
+{
+       char *package;
+       Ecore_Idler *idle_timer;
+
+       package = item_get_package(item);
+       if (!package) return;
+
+       idle_timer = evas_object_data_get(item, "idle_timer");
+       if (idle_timer) {
+               _D("Badge handler for package %s is not yet ready", package);
+               evas_object_data_del(item, "idle_timer");
+               ecore_idler_del(idle_timer);
+               return;
+       }
+
+       item_hide_badge(item);
+}
+
+
+
+static void _badge_change_cb(unsigned int action, const char *pkgname, unsigned int count, void *data)
+{
+       Evas_Object *scroller = data;
+       Evas_Object *item;
+       unsigned int is_display = 0;
+       badge_error_e err;
+
+       _D("Badge changed, action : %u, pkgname : %s, count : %u", action, pkgname, count);
+
+       ret_if(NULL == pkgname);
+
+       if (BADGE_ACTION_REMOVE == action) {
+               count = 0;
+               is_display = false;
+       } else {
+               count = item_badge_count(pkgname);
+       }
+
+       item = page_scroller_find_item_by_package(scroller, pkgname, NULL);
+       if (NULL == item) return;
+
+       _D("Badge change cb, count: %d", count);
+       if (count) item_show_badge(item, count);
+       else item_hide_badge(item);
+}
+
+
+
+HAPI void item_badge_register_changed_cb(Evas_Object *scroller)
+{
+       badge_error_e err;
+
+       err = badge_register_changed_cb(_badge_change_cb, scroller);
+       ret_if(BADGE_ERROR_NONE != err);
+}
+
+
+
+HAPI void item_badge_unregister_changed_cb(void)
+{
+       badge_error_e err;
+
+       err = badge_unregister_changed_cb(_badge_change_cb);
+       ret_if(BADGE_ERROR_NONE != err);
+}
+
+
+
+// End of a file
index 4742b9b3bd4f02baf7430f4b362ca2679ebc41c6..01aa4f1cd4ae2e9395ffd3f8ab84ee64e372ae06 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 #include <string.h>
@@ -29,6 +33,8 @@
 #include "mouse.h"
 #include "page.h"
 #include "page_scroller.h"
+#include "pkgmgr.h"
+#include "popup.h"
 #include "util.h"
 #include "all_apps/layout.h"
 
@@ -83,26 +89,44 @@ static void _item_up_cb(void *data, Evas_Object *obj, const char* emission, cons
        evas_object_color_set(icon_image, 255, 255, 255, 255);
 
        ret_if(NULL == item_event_info.pressed_item);
+       if (item != item_event_info.pressed_item) {
+               item_event_info.pressed_item = NULL;
+               return;
+       }
+       item_event_info.pressed_item = NULL;
+}
 
-       if (item_event_info.pressed_item == item) {
-               bool item_enable_long_press;
 
-               item_enable_long_press = (bool) evas_object_data_get(item, "item_enable_long_press");
-               _D("Not Edit Mode");
 
-               if (mouse_is_scrolling()) {
-                       return;
-               }
+static void _uninstall_down_cb(void *data, Evas_Object *obj, const char* emission, const char* source)
+{
+       _D("Uninstall button is down");
+       obj = evas_object_data_get(obj, "evas_object");
+       if (obj) evas_object_data_set(obj, "removing", (void*)1);
+}
 
-               item_launch(item);
-       }
 
-       item_event_info.pressed_item = NULL;
+
+static void _uninstall_up_cb(void *item, Evas_Object *obj, const char* emission, const char* source)
+{
+       Evas_Object *win;
+
+       ret_if(mouse_is_scrolling());
+
+       win = menu_screen_get_win();
+       ret_if(NULL == win);
+
+       _D("Uninstall button is up");
+       obj = evas_object_data_get(obj, "evas_object");
+       ret_if(NULL == obj);
+       ret_if(NULL == evas_object_data_get(obj, "removing"));
+
+       evas_object_data_del(obj, "removing");
 }
 
 
 
-void item_event_register(Evas_Object *item)
+HAPI void item_event_register(Evas_Object *item)
 {
        Evas_Object *item_edje;
        item_edje = _EDJ(item);
@@ -110,11 +134,14 @@ void item_event_register(Evas_Object *item)
 
        edje_object_signal_callback_add(item_edje, "item,down", "menu", _item_down_cb, NULL);
        edje_object_signal_callback_add(item_edje, "item,up", "menu", _item_up_cb, NULL);
+
+       edje_object_signal_callback_add(item_edje, "uninstall,down", "menu", _uninstall_down_cb, NULL);
+       edje_object_signal_callback_add(item_edje, "uninstall,up", "menu", _uninstall_up_cb, item);
 }
 
 
 
-void item_event_unregister(Evas_Object *item)
+HAPI void item_event_unregister(Evas_Object *item)
 {
        Evas_Object *item_edje;
        item_edje = _EDJ(item);
@@ -122,6 +149,9 @@ void item_event_unregister(Evas_Object *item)
        edje_object_signal_callback_del(item_edje, "item,down", "menu", _item_down_cb);
        edje_object_signal_callback_del(item_edje, "item,up", "menu", _item_up_cb);
 
+       edje_object_signal_callback_del(item_edje, "uninstall,down", "menu", _uninstall_down_cb);
+       edje_object_signal_callback_del(item_edje, "uninstall,up", "menu", _uninstall_up_cb);
+
        evas_object_data_del(item_edje, "item");
 }
 
diff --git a/src/key.c b/src/key.c
new file mode 100644 (file)
index 0000000..682deb4
--- /dev/null
+++ b/src/key.c
@@ -0,0 +1,237 @@
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <Elementary.h>
+#include <utilX.h>
+#include <Ecore_X.h>
+
+#include "conf.h"
+#include "key.h"
+#include "menu_screen.h"
+#include "page_scroller.h"
+#include "popup.h"
+#include "util.h"
+#include "all_apps/layout.h"
+
+
+
+static struct {
+       Eina_Bool pressed;
+       Ecore_Event_Handler *press_handler;
+       Ecore_Event_Handler *release_handler;
+       Eina_Bool register_handler;
+       Ecore_Timer *long_press;
+       Eina_Bool home_grabbed;
+} key_info = {
+       .pressed = 0,
+       .press_handler = NULL,
+       .release_handler = NULL,
+       .register_handler = EINA_FALSE,
+       .long_press = NULL,
+       .home_grabbed = EINA_FALSE,
+};
+
+
+
+#define KEY_LEFT "Left"
+#define KEY_RIGHT "Right"
+#define KEY_UP "Up"
+#define KEY_DOWN "Down"
+#define KEY_ESC "Escape"
+static Eina_Bool _key_release_cb(void *data, int type, void *event)
+{
+       Evas_Event_Key_Up *ev = event;
+
+       retv_if(EINA_FALSE == key_info.register_handler, ECORE_CALLBACK_CANCEL);
+       retv_if(NULL == ev, ECORE_CALLBACK_CANCEL);
+
+       _D("Key(%s) released %d", ev->keyname, key_info.pressed);
+
+       if (key_info.pressed == EINA_FALSE) return ECORE_CALLBACK_CANCEL;
+
+       do {
+               Evas_Object *win;
+               win = menu_screen_get_win();
+               break_if(NULL == win);
+
+               Evas_Object *layout;
+               layout = evas_object_data_get(win, "layout");
+               break_if(NULL == layout);
+
+               Evas_Object *all_apps;
+               all_apps = evas_object_data_get(layout, "all_apps");
+               break_if(NULL == all_apps);
+
+               Evas_Object *scroller = evas_object_data_get(all_apps, "scroller");
+               break_if(NULL == scroller);
+
+               if (!strcmp(ev->keyname, KEY_SELECT) || !strcmp(ev->keyname, KEY_BACK)) {
+                       if (popup_exist()) {
+                               popup_destroy_all();
+                               break;
+                       }
+
+                       if (all_apps_layout_is_edited(all_apps)) {
+                               all_apps_layout_unedit(all_apps);
+                       }
+               } else if (!strcmp(ev->keyname, KEY_LEFT) ||
+                                       !strcmp(ev->keyname, KEY_RIGHT) ||
+                                       !strcmp(ev->keyname, KEY_UP) ||
+                                       !strcmp(ev->keyname, KEY_DOWN))
+               {
+                       int cur_idx = page_scroller_get_current_page_no(scroller);
+                       int idx = 0, x = 0, w = 0;
+                       elm_scroller_region_get(scroller, &x, NULL, &w, NULL);
+
+                       if (w) idx = x / w;
+                       if (cur_idx != idx) {
+                               page_scroller_bring_in(scroller, idx);
+                               break;
+                       }
+
+                       /* If there are no items to be focused after pressing keys,
+                          Menu-screen forces to focus the first item of the other page */
+                       int rest = 0;
+                       if (w) {
+                               rest = x % w;
+                       }
+                       if (rest) {
+                               page_scroller_focus_into_vector(scroller, rest > w / 2 ? -1 : 1);
+                       }
+               }
+               else if (!strcmp(ev->keyname, KEY_ESC))
+               {
+                       if (popup_exist())
+                       {
+                               popup_destroy_all();
+                               break;
+                       }
+                       if (all_apps_layout_is_edited(all_apps)) {
+                               all_apps_layout_unedit(all_apps);
+                       }
+               }
+       } while (0);
+
+       key_info.pressed = EINA_FALSE;
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+static Eina_Bool _key_press_cb(void *data, int type, void *event)
+{
+       Evas_Event_Key_Down *ev = event;
+
+       retv_if(EINA_FALSE == key_info.register_handler, ECORE_CALLBACK_CANCEL);
+       retv_if(NULL == ev, ECORE_CALLBACK_CANCEL);
+
+       key_info.pressed = EINA_TRUE;
+       _D("Key pressed %d", key_info.pressed);
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+HAPI void key_register(void)
+{
+       if (!key_info.release_handler) {
+               key_info.release_handler = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, NULL);
+               if (!key_info.release_handler) {
+                       _E("Failed to register a key up event handler");
+               }
+       }
+
+       if (!key_info.press_handler) {
+               key_info.press_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, NULL);
+               if (!key_info.press_handler) {
+                       _E("Failed to register a key down event handler");
+               }
+       }
+
+       key_info.pressed = EINA_FALSE;
+       key_info.register_handler = EINA_TRUE;
+}
+
+
+
+HAPI void key_unregister(void)
+{
+       if (key_info.long_press) {
+               ecore_timer_del(key_info.long_press);
+               key_info.long_press = NULL;
+       }
+
+       if (key_info.release_handler) {
+               ecore_event_handler_del(key_info.release_handler);
+               key_info.release_handler = NULL;
+       }
+
+       if (key_info.press_handler) {
+               ecore_event_handler_del(key_info.press_handler);
+               key_info.press_handler = NULL;
+       }
+
+       key_info.register_handler = EINA_FALSE;
+}
+
+
+
+HAPI void key_grab_home(void)
+{
+       if (EINA_TRUE == key_info.home_grabbed) return;
+
+       Ecore_X_Window win = elm_win_xwindow_get(menu_screen_get_win());
+       Display* dpy = ecore_x_display_get();
+
+       int ret = utilx_grab_key(dpy, win, KEY_SELECT, TOP_POSITION_GRAB);
+       ret_if(0 != ret);
+
+       ret = utilx_grab_key(dpy, win, KEY_BACK, TOP_POSITION_GRAB);
+       ret_if(0 != ret);
+
+       key_info.home_grabbed = EINA_TRUE;
+}
+
+
+
+HAPI void key_ungrab_home(void)
+{
+       if (key_info.home_grabbed == EINA_FALSE) return;
+
+       Ecore_X_Window win = elm_win_xwindow_get(menu_screen_get_win());
+       Display* dpy = ecore_x_display_get();
+
+       int ret = utilx_ungrab_key(dpy, win, KEY_SELECT);
+       ret_if(0 != ret);
+
+       ret = utilx_ungrab_key(dpy, win, KEY_BACK);
+       ret_if(0 != ret);
+
+       key_info.home_grabbed = EINA_FALSE;
+}
+
+
+
+// End of a file
index cc5a60dedbde20aadc27c90cff13fcdddc7126cf..6eef4b3b4bec151511eb4e12ea9a5a1249eec788 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 #include <Ecore_X.h>
 #include "layout.h"
 #include "mapbuf.h"
 #include "page.h"
+#include "page_scroller.h"
 #include "item.h"
 #include "util.h"
 #include "all_apps/layout.h"
 
 
 
-Evas_Object *layout_create(Evas_Object *win, const char *file, const char *group, int rotate)
+HAPI Evas_Object *layout_create(Evas_Object *conformant, const char *file, const char *group, int rotate)
 {
        Evas_Object *layout;
-       Evas_Object *all_apps;
-       int width;
-       int height;
-
-       layout = layout_load_edj(win, file, group);
-       retv_if(NULL == layout, NULL);
-
-       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_win_resize_object_add(win, layout);
-
-       evas_object_data_set(layout, "win", win);
-       evas_object_data_set(layout, "rotate", (void *) rotate);
-
-       width = menu_screen_get_root_width();
-       height = menu_screen_get_root_height();
-
-       evas_object_data_set(layout, "width", (void *) width);
-       evas_object_data_set(layout, "height", (void *) height);
-
-       all_apps = all_apps_layout_create(layout, rotate);
-       if (NULL == all_apps) {
-               _E("Failed to create scroller");
-               layout_destroy(layout);
-               return NULL;
-       }
-       evas_object_data_set(layout, "all_apps", all_apps);
-       elm_object_part_content_set(layout, "content", all_apps);
+       Evas_Object *bg;
+       Evas *evas;
+
+       do {
+               int width;
+               int height;
+
+               layout = layout_load_edj(conformant, file, group);
+               retv_if(NULL == layout, NULL);
+
+               width = menu_screen_get_root_width();
+               height = menu_screen_get_root_height();
+
+               evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_min_set(layout, width, height);
+               evas_object_size_hint_max_set(layout, width, height);
+               evas_object_resize(layout, width, height);
+               evas_object_show(layout);
+
+               evas = evas_object_evas_get(layout);
+               bg = evas_object_rectangle_add(evas);
+               evas_object_size_hint_min_set(bg, width, height);
+               evas_object_size_hint_max_set(bg, width, height);
+               evas_object_resize(bg, width, height);
+               elm_object_part_content_set(layout, "bg", bg);
+               evas_object_show(bg);
+
+               evas_object_data_set(layout, "win", menu_screen_get_win());
+               evas_object_data_set(layout, "rotate", (void *) rotate);
+               evas_object_data_set(layout, "width", (void *) width);
+               evas_object_data_set(layout, "height", (void *) height);
+       } while (0);
+
+       do {
+               Evas_Object *all_apps;
+
+               all_apps = all_apps_layout_create(layout, rotate);
+               if (NULL == all_apps) {
+                       _E("Failed to create scroller");
+                       layout_destroy(layout);
+                       return NULL;
+               }
+               evas_object_data_set(layout, "all_apps", all_apps);
+               elm_object_part_content_set(layout, "content", all_apps);
+       } while (0);
 
        return layout;
 }
 
 
 
-void layout_destroy(Evas_Object *layout)
+HAPI void layout_destroy(Evas_Object *layout)
 {
        Evas_Object *all_apps;
 
-       all_apps = evas_object_data_get(layout, "all_apps");
+       all_apps = evas_object_data_del(layout, "all_apps");
        all_apps_layout_destroy(all_apps);
 
        evas_object_data_del(layout, "win");
-       evas_object_data_del(layout, "all_apps");
        evas_object_data_del(layout, "rotate");
        evas_object_data_del(layout, "width");
        evas_object_data_del(layout, "height");
@@ -87,7 +109,7 @@ void layout_destroy(Evas_Object *layout)
 
 
 
-void layout_enable_block(Evas_Object *layout)
+HAPI void layout_enable_block(Evas_Object *layout)
 {
        ret_if(NULL == layout);
 
@@ -97,7 +119,7 @@ void layout_enable_block(Evas_Object *layout)
 
 
 
-void layout_disable_block(Evas_Object *layout)
+HAPI void layout_disable_block(Evas_Object *layout)
 {
        ret_if(NULL == layout);
 
@@ -107,7 +129,7 @@ void layout_disable_block(Evas_Object *layout)
 
 
 
-Evas_Object* layout_load_edj(Evas_Object *parent, const char *edjname, const char *grpname)
+HAPI Evas_Object* layout_load_edj(Evas_Object *parent, const char *edjname, const char *grpname)
 {
        Evas_Object *eo;
 
@@ -125,7 +147,7 @@ Evas_Object* layout_load_edj(Evas_Object *parent, const char *edjname, const cha
 
 
 
-void layout_unload_edj(Evas_Object *layout)
+HAPI void layout_unload_edj(Evas_Object *layout)
 {
        Evas_Object *evas_object;
 
@@ -141,4 +163,150 @@ void layout_unload_edj(Evas_Object *layout)
 
 
 
+HAPI void layout_create_package(Evas_Object *layout, const char *package)
+{
+       app_info_t ai = {0,};
+       Evas_Object *all_apps = NULL;
+       Evas_Object *scroller = NULL;
+       Evas_Object *item = NULL;
+
+       if (MENU_SCREEN_ERROR_FAIL == list_get_values(package, &ai)) {
+               list_free_values(&ai);
+               return;
+       }
+
+       if (ai.nodisplay) {
+               _D("This app(%s) is nodisplay", ai.package);
+               list_free_values(&ai);
+               return;
+       }
+
+
+       all_apps = evas_object_data_get(layout, "all_apps");
+       goto_if(!all_apps, EXIT);
+
+       scroller = evas_object_data_get(all_apps, "scroller");
+       goto_if(!scroller, EXIT);
+
+       /* Update the package */
+       item = page_scroller_find_item_by_package(scroller, ai.package, NULL);
+       if (item) {
+               _D("Package %s is found, update it!", package);
+               item_update(item, &ai);
+               goto EXIT;
+       }
+
+       /* Create the package */
+       _D("package %s is installed directly", package);
+       item = page_scroller_push_item_by_order(scroller, &ai);
+       if (!item) _E("item is NULL");
+
+EXIT:
+       list_free_values(&ai);
+       return;
+}
+
+
+
+HAPI void layout_update_package(Evas_Object *layout, const char *package)
+{
+    layout_create_package(layout, package);
+}
+
+
+
+static Evas_Object *_animated_unpack_item(Evas_Object *scroller, Evas_Object *page, unsigned int pos)
+{
+       Evas_Object *out = NULL;
+       Evas_Object *item;
+       Evas_Object *next_page;
+
+       char buf[32];
+       unsigned int page_max_app;
+       unsigned int page_no;
+       page_scroller_sort_type_e sort_type;
+
+       out = page_unpack_item_at(page, pos);
+       retv_if(NULL == out, NULL);
+
+       page_no = page_scroller_get_page_no(scroller, page);
+       page_max_app = (unsigned int) evas_object_data_get(scroller, "page_max_app");
+       sort_type = (page_scroller_sort_type_e) evas_object_data_get(scroller, "sort_type");
+
+       pos ++;
+       while (page && page_no < MAX_PAGE_NO) {
+               if (0 == page_count_item(page)) {
+                       page_destroy(scroller, page);
+                       break;
+               }
+
+               for (; pos < page_max_app; pos ++) {
+                       item = page_unpack_item_at(page, pos);
+                       if (NULL == item) continue;
+
+                       page_pack_item(page, pos - 1, item);
+                       snprintf(buf, 32, "menu%d", pos - 1);
+                       edje_object_signal_emit(_EDJ(page), STR_MOVE_NEXT, buf);
+                       edje_object_signal_emit(_EDJ(page), STR_ANI_RETURN, buf);
+               }
+
+               if (sort_type == PAGE_SCROLLER_SORT_MAX) {
+                       return NULL;
+               }
+
+               page_no ++;
+               next_page = page_scroller_get_page_at(scroller, page_no);
+               if (next_page) {
+                       item = page_unpack_item_at(next_page, 0);
+                       if (NULL == item) continue;
+
+                       page_pack_item(page, page_max_app - 1, item);
+               } else break;
+
+               pos = 1;
+               page = next_page;
+       }
+
+       return out;
+}
+
+
+
+HAPI void layout_delete_package(Evas_Object *layout, const char *package)
+{
+       Evas_Object *all_apps = NULL;
+       Evas_Object *scroller = NULL;
+       Evas_Object *page = NULL;
+       Evas_Object *item = NULL;
+       int page_no = 0;
+       register unsigned int i;
+       unsigned int page_max_app;
+
+       all_apps = evas_object_data_get(layout, "all_apps");
+       ret_if(!all_apps);
+
+       scroller = evas_object_data_get(all_apps, "scroller");
+       ret_if(!scroller);
+
+       item = page_scroller_find_item_by_package(scroller, package, &page_no);
+       if (!item) return;
+
+       page = page_scroller_get_page_at(scroller, page_no);
+       ret_if(!page);
+
+       page_max_app = (unsigned int) evas_object_data_get(scroller, "page_max_app");
+       for (i = 0; i < page_max_app; i++) {
+               if (item == page_get_item_at(page, i)) {
+                       break;
+               }
+       }
+       if (i == page_max_app) return;
+
+       item = _animated_unpack_item(scroller, page, i);
+       ret_if(!item);
+       item_destroy(item);
+}
+
+
+
 // End of file
index 5109904fe482d98bc061b82c0c81881bcb8fbeb5..35328879a6fed544c963983f5b68da3c883b9903 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdbool.h>
 #include <stdlib.h>
@@ -27,7 +31,7 @@
 
 
 
-menu_screen_error_e list_count(app_list *list, int *count)
+HAPI menu_screen_error_e list_count(app_list *list, int *count)
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
        retv_if(NULL == list->list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
@@ -40,7 +44,7 @@ menu_screen_error_e list_count(app_list *list, int *count)
 
 
 
-menu_screen_error_e list_first(app_list *list)
+HAPI menu_screen_error_e list_first(app_list *list)
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
 
@@ -51,7 +55,7 @@ menu_screen_error_e list_first(app_list *list)
 
 
 
-menu_screen_error_e list_next(app_list *list)
+HAPI menu_screen_error_e list_next(app_list *list)
 {
        int count;
 
@@ -68,7 +72,7 @@ menu_screen_error_e list_next(app_list *list)
 
 
 
-menu_screen_error_e list_is_ended(app_list *list, bool *flag)
+HAPI menu_screen_error_e list_is_ended(app_list *list, bool *flag)
 {
        int count;
 
@@ -83,7 +87,7 @@ menu_screen_error_e list_is_ended(app_list *list, bool *flag)
 
 
 
-menu_screen_error_e list_get_item(app_list *list, app_list_item **item)
+HAPI menu_screen_error_e list_get_item(app_list *list, app_list_item **item)
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
        retv_if(NULL == list->list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
@@ -95,10 +99,11 @@ menu_screen_error_e list_get_item(app_list *list, app_list_item **item)
 
 
 
-
-menu_screen_error_e list_get_values(const char *package, app_info_t *ai)
+/* FIXME : package -> appid */
+HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai)
 {
        ail_appinfo_h appinfo_h;
+       char *pkgid;
        char *exec;
        char *name;
        char *icon;
@@ -108,51 +113,77 @@ menu_screen_error_e list_get_values(const char *package, app_info_t *ai)
        retv_if(NULL == ai, MENU_SCREEN_ERROR_FAIL);
        retv_if(NULL == (ai->package = strdup(package)), MENU_SCREEN_ERROR_FAIL);
 
-       ret = ail_package_get_appinfo(ai->package, &appinfo_h);
+       ret = ail_get_appinfo(ai->package, &appinfo_h);
        if (AIL_ERROR_OK == ret) {
                do {
+                       /* FIXME : Please check this */
+                       break_if(ail_appinfo_get_str(appinfo_h, AIL_PROP_X_SLP_PKGID_STR, &pkgid) < 0);
                        break_if(ail_appinfo_get_str(appinfo_h, AIL_PROP_EXEC_STR, &exec) < 0);
                        break_if(ail_appinfo_get_str(appinfo_h, AIL_PROP_NAME_STR, &name) < 0);
                        break_if(ail_appinfo_get_str(appinfo_h, AIL_PROP_ICON_STR, &icon) < 0);
                        break_if(ail_appinfo_get_bool(appinfo_h, AIL_PROP_NODISPLAY_BOOL, &ai->nodisplay) < 0);
+                       break_if(ail_appinfo_get_bool(appinfo_h, AIL_PROP_X_SLP_ENABLED_BOOL, &ai->enabled) < 0);
                        break_if(ail_appinfo_get_bool(appinfo_h, AIL_PROP_X_SLP_REMOVABLE_BOOL, &ai->x_slp_removable) < 0);
                        break_if(ail_appinfo_get_bool(appinfo_h, AIL_PROP_X_SLP_TASKMANAGE_BOOL, &ai->x_slp_taskmanage) < 0);
 
+                       break_if(NULL == pkgid || NULL == (ai->pkgid = strdup(pkgid)));
                        break_if(NULL == exec || NULL == (ai->exec = strdup(exec)));
                        break_if(NULL == name || NULL == (ai->name = strdup(name)));
                        break_if(NULL == icon || NULL == (ai->icon = strdup(icon)));
 
-                       ail_package_destroy_appinfo(appinfo_h);
+                       ail_destroy_appinfo(appinfo_h);
 
                        return MENU_SCREEN_ERROR_OK;
                } while(0);
 
-               ail_package_destroy_appinfo(appinfo_h);
+               ail_destroy_appinfo(appinfo_h);
                list_free_values(ai);
                return MENU_SCREEN_ERROR_FAIL;
        } else if (AIL_ERROR_NO_DATA == ret) {
                return MENU_SCREEN_ERROR_OK;
        }
 
+       if (appinfo_h) ail_destroy_appinfo(appinfo_h);
+
        return MENU_SCREEN_ERROR_FAIL;
 }
 
 
 
-void list_free_values(app_info_t *ai)
+HAPI void list_free_values(app_info_t *ai)
 {
        ret_if(NULL == ai);
 
        /* Origin field */
-       if (ai->package) free(ai->package);
-       if (ai->exec) free(ai->exec);
-       if (ai->name) free(ai->name);
-       if (ai->icon) free(ai->icon);
+       if (ai->pkgid) {
+               free(ai->pkgid);
+               ai->pkgid = NULL;
+       }
+
+       if (ai->package) {
+               free(ai->package);
+               ai->package = NULL;
+       }
+
+       if (ai->exec) {
+               free(ai->exec);
+               ai->exec = NULL;
+       }
+
+       if (ai->name) {
+               free(ai->name);
+               ai->name = NULL;
+       }
+
+       if (ai->icon) {
+               free(ai->icon);
+               ai->icon = NULL;
+       }
 }
 
 
 
-menu_screen_error_e list_append_item(app_list *list, app_list_item *item)
+HAPI menu_screen_error_e list_append_item(app_list *list, app_list_item *item)
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
        retv_if(NULL == item, MENU_SCREEN_ERROR_INVALID_PARAMETER);
@@ -165,7 +196,7 @@ menu_screen_error_e list_append_item(app_list *list, app_list_item *item)
 
 
 
-menu_screen_error_e list_remove_item(app_list *list, app_list_item *item)
+HAPI menu_screen_error_e list_remove_item(app_list *list, app_list_item *item)
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
        retv_if(NULL == list->list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
@@ -178,7 +209,7 @@ menu_screen_error_e list_remove_item(app_list *list, app_list_item *item)
 
 
 
-menu_screen_error_e list_sort(app_list *list, int (*_sort_cb)(const void *d1, const void *d2))
+HAPI menu_screen_error_e list_sort(app_list *list, int (*_sort_cb)(const void *d1, const void *d2))
 {
        retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
 
@@ -190,4 +221,18 @@ menu_screen_error_e list_sort(app_list *list, int (*_sort_cb)(const void *d1, co
 
 
 
+HAPI app_list_item *list_nth(app_list *parent, unsigned int nth)
+{
+       Eina_List *list;
+
+       retv_if(NULL == parent, NULL);
+
+       list = parent->list;
+       retv_if(NULL == list, NULL);
+
+       return eina_list_nth(list, nth);
+}
+
+
+
 // End of a file
index e2ac478db8f7f19f9eed2de955d4aa2d8598d661..a9fb5bb3fca07dd4d387326ab979e92493a090b0 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 
@@ -26,7 +30,7 @@
 
 
 
-Evas_Object *mapbuf_get_mapbuf(Evas_Object *obj)
+HAPI Evas_Object *mapbuf_get_mapbuf(Evas_Object *obj)
 {
        Evas_Object *mapbuf;
 
@@ -42,7 +46,7 @@ Evas_Object *mapbuf_get_mapbuf(Evas_Object *obj)
 
 
 
-Evas_Object *mapbuf_get_page(Evas_Object *obj)
+HAPI Evas_Object *mapbuf_get_page(Evas_Object *obj)
 {
        Evas_Object *page;
 
@@ -58,7 +62,21 @@ Evas_Object *mapbuf_get_page(Evas_Object *obj)
 
 
 
-menu_screen_error_e mapbuf_enable(Evas_Object *obj, int force)
+static void _move_pages(Evas_Object *page)
+{
+       if(NULL == page) return;
+
+       Evas_Object *scroller = evas_object_data_get(page, "scroller");
+       if(NULL == scroller) return;
+
+       Evas_Coord x, y;
+       evas_object_geometry_get(scroller, &x, &y, NULL, NULL);
+       evas_object_move(page, x, y);
+}
+
+
+
+HAPI menu_screen_error_e mapbuf_enable(Evas_Object *obj, int force)
 {
        Evas_Object *mapbuf;
        int cnt;
@@ -69,9 +87,21 @@ menu_screen_error_e mapbuf_enable(Evas_Object *obj, int force)
                return MENU_SCREEN_ERROR_FAIL;
        }
 
+       Evas_Object *page = mapbuf_get_page(obj);
+       if(!page) {
+               return MENU_SCREEN_ERROR_FAIL;
+       }
+
+       if(menu_screen_is_tts()) {
+               evas_object_data_set(mapbuf, "mapbuf_enabled", (void*)0);
+               elm_mapbuf_enabled_set(mapbuf, 0);
+               return MENU_SCREEN_ERROR_OK;
+       }
+
        if (force) {
                evas_object_data_set(mapbuf, "mapbuf_enabled", (void*)0);
-               elm_mapbuf_enabled_set(mapbuf, 1);
+               _move_pages(page);
+               elm_mapbuf_enabled_set(mapbuf, 1); // Mapbuf has been disabled because of a mapbuf bug.
                return MENU_SCREEN_ERROR_OK;
        }
 
@@ -82,7 +112,8 @@ menu_screen_error_e mapbuf_enable(Evas_Object *obj, int force)
 
        if (cnt == 0) {
                if (!elm_mapbuf_enabled_get(mapbuf)) {
-                       elm_mapbuf_enabled_set(mapbuf, 1);
+                       _move_pages(page);
+                       elm_mapbuf_enabled_set(mapbuf, 1); // Mapbuf has been disabled because of a mapbuf bug.
                        //_D("[%s] mapbuf enabled", __func__);
                }
        }
@@ -92,7 +123,7 @@ menu_screen_error_e mapbuf_enable(Evas_Object *obj, int force)
 
 
 
-int mapbuf_is_enabled(Evas_Object *obj)
+HAPI int mapbuf_is_enabled(Evas_Object *obj)
 {
        Evas_Object *mapbuf;
        mapbuf = mapbuf_get_mapbuf(obj);
@@ -105,7 +136,7 @@ int mapbuf_is_enabled(Evas_Object *obj)
 
 
 
-int mapbuf_disable(Evas_Object *obj, int force)
+HAPI int mapbuf_disable(Evas_Object *obj, int force)
 {
        Evas_Object *mapbuf;
        int cnt;
@@ -139,7 +170,7 @@ int mapbuf_disable(Evas_Object *obj, int force)
 
 
 
-Evas_Object *mapbuf_bind(Evas_Object *box, Evas_Object *page)
+HAPI Evas_Object *mapbuf_bind(Evas_Object *box, Evas_Object *page)
 {
        Evas_Object *mapbuf;
 
@@ -163,7 +194,7 @@ Evas_Object *mapbuf_bind(Evas_Object *box, Evas_Object *page)
 
 
 
-Evas_Object *mapbuf_unbind(Evas_Object *obj)
+HAPI Evas_Object *mapbuf_unbind(Evas_Object *obj)
 {
        Evas_Object *page;
        Evas_Object *mapbuf;
old mode 100644 (file)
new mode 100755 (executable)
index 20e4beb..ee36cc3
@@ -1,42 +1,48 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
-
-
-#include <Elementary.h>
-#include <Ecore_X.h>
 #include <ail.h>
 #include <app.h>
+#include <appcore-efl.h>
+#include <aul.h>
+#include <Ecore_X.h>
+#include <Elementary.h>
 #include <stdbool.h>
+#include <system_info.h>
 #include <vconf.h>
-#include <utilX.h>
-#include <aul.h>
 
 #include "conf.h"
 #include "item.h"
+#include "key.h"
 #include "layout.h"
 #include "mapbuf.h"
 #include "menu_screen.h"
 #include "mouse.h"
 #include "page.h"
 #include "page_scroller.h"
+#include "pkgmgr.h"
 #include "util.h"
 
-#define STR_ENV_ENGINE "LAUNCHER_ENGINE"
-#define STR_ENV_FPS "LAUNCHER_FPS"
+#define MENU_SCREEN_ENGINE "file/private/org.tizen.menu-screen/engine"
 
 #define LAYOUT_EDJE_PORTRAIT EDJEDIR"/layout_portrait.edj"
 #define LAYOUT_GROUP_NAME "layout"
@@ -49,74 +55,177 @@ static struct {
        int state;
        int root_width;
        int root_height;
-       double xscale;
-       double yscale;
+       int is_tts;
+       int booting_state;
        Evas *evas;
        Ecore_Evas *ee;
        Evas_Object *win;
+       Elm_Theme *theme;
        bool is_done;
 } menu_screen_info = {
        .state = APP_STATE_PAUSE,
+       .is_tts = false,
+       .booting_state = 0,
        .evas = NULL,
        .ee = NULL,
        .win = NULL,
+       .theme = NULL,
        .is_done = false,
 };
 
 
 
-Evas *menu_screen_get_evas(void)
+HAPI Evas *menu_screen_get_evas(void)
 {
        return menu_screen_info.evas;
 }
 
 
 
-int menu_screen_get_root_width(void)
+HAPI int menu_screen_get_root_width(void)
 {
        return menu_screen_info.root_width;
 }
 
 
 
-int menu_screen_get_root_height(void)
+HAPI int menu_screen_get_root_height(void)
 {
        return menu_screen_info.root_height;
 }
 
 
 
-double menu_screen_get_yscale(void)
+HAPI Evas_Object *menu_screen_get_win(void)
 {
-       return menu_screen_info.yscale;
+       return menu_screen_info.win;
 }
 
 
 
-Evas_Object *menu_screen_get_win(void)
+HAPI Elm_Theme *menu_screen_get_theme(void)
 {
-       return menu_screen_info.win;
+       return menu_screen_info.theme;
 }
 
 
 
-bool menu_screen_get_done(void)
+HAPI bool menu_screen_get_done(void)
 {
        return menu_screen_info.is_done;
 }
 
 
 
-void menu_screen_set_done(bool is_done)
+HAPI void menu_screen_set_done(bool is_done)
 {
        menu_screen_info.is_done = is_done;
 }
 
 
 
+HAPI int menu_screen_get_state(void)
+{
+       return menu_screen_info.state;
+}
+
+
+
+HAPI int menu_screen_is_tts(void)
+{
+       return menu_screen_info.is_tts;
+}
+
+
+static Eina_Bool _appcore_flush_cb(void *data)
+{
+       if (APP_STATE_PAUSE != menu_screen_info.state) return ECORE_CALLBACK_CANCEL;
+       if (0 != appcore_flush_memory()) _E("Cannot flush memory");
+       return ECORE_CALLBACK_CANCEL;
+}
+
+
+
+HAPI void menu_screen_inc_booting_state(void)
+{
+       menu_screen_info.booting_state++;
+       if (BOOTING_STATE_DONE > menu_screen_info.booting_state) return;
+
+       menu_screen_error_e ret = MENU_SCREEN_ERROR_OK;
+       do {
+               ret = pkgmgr_reserve_list_pop_request();
+       } while (MENU_SCREEN_ERROR_OK == ret);
+
+       /*  Cache memory is cleared when the application paused (every time, after 5 seconds (in appcore)),
+       *  but after running in a minimized mode (HIDE_LAUNCH) application have status AS_RUNNING.
+       *  Application have status AS_PAUSED only after change of visibility to hidden condition by user (on hiding window)
+       *  Cleaning must be performed only once after application loading in hidden condition
+       *  (and stay in a hidden condition at time of cleaning).
+       */
+       if (APP_STATE_PAUSE == menu_screen_info.state)
+               ecore_timer_add(5, _appcore_flush_cb, NULL);
+}
+
+
+
+HAPI void menu_screen_dec_booting_state(void)
+{
+       menu_screen_info.booting_state --;
+}
+
+
+
+HAPI int menu_screen_get_booting_state(void)
+{
+       return menu_screen_info.booting_state;
+}
+
+
+
+static bool _is_emulator_on(void)
+{
+       int ret;
+       char *model;
+
+       ret = system_info_get_platform_string("tizen.org/system/model_name", &model);
+       if (SYSTEM_INFO_ERROR_NONE != ret) {
+               if (model) {
+                       free(model);
+               }
+               return false;
+       }
+
+       if (!strncmp(model, "Emulator", strlen(model))) {
+               _D("This model is on Emulator");
+               free(model);
+               return true;
+       }
+
+       _D("This model is NOT on Emulator");
+       free(model);
+       return false;
+}
+
+
 static menu_screen_error_e _create_canvas(char *name, char *title)
 {
        Ecore_X_Atom ATOM_WM_WINDOW_ROLE;
+       char *buf;
+
+       if (_is_emulator_on()) {
+               _D("ELM_ENGINE is set as [software_x11]");
+               elm_config_accel_preference_set("opengl");
+       } else {
+               buf = vconf_get_str(MENU_SCREEN_ENGINE);
+               if (buf) {
+                       _D("ELM_ENGINE is set as [%s]", buf);
+                       elm_config_accel_preference_set(buf);
+                       free(buf);
+               } else {
+                       _D("ELM_ENGINE is set as [gl]");
+                       elm_config_accel_preference_set("gl");
+               }
+       }
 
        menu_screen_info.win = elm_win_add(NULL, name, ELM_WIN_BASIC);
        retv_if(NULL == menu_screen_info.win, MENU_SCREEN_ERROR_FAIL);
@@ -144,7 +253,8 @@ static menu_screen_error_e _create_canvas(char *name, char *title)
                _E("[%s] Failed to get ecore_evas object", __func__);
        }
 
-       evas_object_move(menu_screen_info.win, 0, 0);
+       evas_object_size_hint_min_set(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height);
+       evas_object_size_hint_max_set(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height);
        evas_object_resize(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height);
        evas_object_show(menu_screen_info.win);
 
@@ -162,19 +272,13 @@ static void _destroy_canvas(void)
 
 static int _dead_cb(int pid, void *data)
 {
-       utilx_hide_fake_effect(
-               ecore_x_display_get(),
-               ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
-       );
-
        return EXIT_SUCCESS;
 }
 
 
 
-static void _set_scale(void)
+static void _get_window_size(void)
 {
-       double scale;
        Ecore_X_Window focus_win;
        Ecore_X_Window root_win;
 
@@ -182,11 +286,7 @@ static void _set_scale(void)
        root_win = ecore_x_window_root_get(focus_win);
        ecore_x_window_size_get(root_win, &menu_screen_info.root_width, &menu_screen_info.root_height);
 
-       menu_screen_info.xscale = (double) menu_screen_info.root_width / (double) BASE_WIDTH;
-       menu_screen_info.yscale = (double) menu_screen_info.root_height / (double) BASE_HEIGHT;
-       scale = menu_screen_info.xscale < menu_screen_info.yscale ? menu_screen_info.xscale : menu_screen_info.yscale;
-       _D("width:%d, height:%d, scale:%f", menu_screen_info.root_width, menu_screen_info.root_height, scale);
-       elm_config_scale_set(scale);
+       _D("width:%d, height:%d", menu_screen_info.root_width, menu_screen_info.root_height);
 }
 
 
@@ -227,6 +327,7 @@ static void _create_bg(void)
                        free(buf);
                        return;
                }
+               evas_object_image_load_orientation_set(bg, EINA_TRUE);
                evas_object_data_set(menu_screen_get_win(), "bg", bg);
        }
 
@@ -245,7 +346,7 @@ static void _create_bg(void)
        wf = (double) width / (double) w;
        hf = (double) height / (double) h;
 
-       f = wf > hf ? hf : wf;
+       f = wf < hf ? hf : wf;
 
        w = (int) ((double) f * (double) w);
        h = (int) ((double) f * (double) h);
@@ -284,31 +385,152 @@ static void _change_bg_cb(keynode_t *node, void *data)
 
 
 
-static bool _create_cb(void *data)
+static void _init_theme(void)
 {
-       Evas_Object *layout;
+       menu_screen_info.theme = elm_theme_new();
+       elm_theme_ref_set(menu_screen_info.theme, NULL);
+       elm_theme_extension_add(menu_screen_info.theme, EDJEDIR"/index.edj");
+}
+
 
-       _set_scale();
-       retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), EXIT_FAILURE);
+
+static void _fini_theme(void)
+{
+       elm_theme_extension_del(menu_screen_info.theme, EDJEDIR"/index.edj");
+       elm_theme_free(menu_screen_info.theme);
+       menu_screen_info.theme = NULL;
+
+}
+
+
+
+static Evas_Object *_create_conformant(Evas_Object *win)
+{
+       Evas_Object *conformant;
+
+       conformant = elm_conformant_add(win);
+       retv_if(NULL == conformant, NULL);
+
+       elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_TRANSLUCENT);
+       evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_signal_emit(conformant, "elm,state,indicator,overlap", "elm");
        elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW);
+       evas_object_data_set(conformant, "win", win);
+       evas_object_show(conformant);
+
+       elm_win_resize_object_add(win, conformant);
+       elm_win_conformant_set(win, EINA_TRUE);
+
+       return conformant;
+}
+
+
+
+static void _destroy_conformant(Evas_Object *conformant)
+{
+       evas_object_data_del(conformant, "win");
+       evas_object_del(conformant);
+}
+
+
+static char *_replace_str(char *str, const char *before, const char *after)
+{
+       retv_if(NULL == str, NULL);
+       retv_if(NULL == before, NULL);
+       retv_if(NULL == after, NULL);
+
+       size_t before_len = strlen(before);
+       retv_if(before_len < 1, str);
+
+       size_t after_len = strlen(after);
+       size_t i, count = 0;
+       if (after_len != before_len) {
+               for (i = 0; str[i] != '\0';) {
+                       if (0 == memcmp(&str[i], before, before_len)) {
+                               count++;
+                               i += before_len;
+                       } else {
+                               i++;
+                       }
+               }
+       } else {
+               i = strlen(str);
+       }
+
+       char *result;
+       result = malloc(i + 1 + count * (after_len - before_len));
+       retv_if(result == NULL, NULL);
+
+       char *sr;
+       sr = result;
+       while (*str) {
+               if (0 == memcmp(str, before, before_len)) {
+                       memcpy(sr, after, after_len);
+                       sr += after_len;
+                       str += before_len;
+               } else {
+                       *sr++ = *str++;
+               }
+       }
+       *sr = '\0';
+
+       return result;
+}
+
+
+static void _tts_cb(keynode_t *node, void *data)
+{
+       _D("change tts");
+
+       int val = -1;
+       if (0 == vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &val) &&
+                       menu_screen_info.is_tts != val)
+       {
+               menu_screen_info.is_tts = val;
+       }
+}
+
+
+
+static bool _create_cb(void *data)
+{
+       Evas_Object *conformant;
+
+       _get_window_size();
+       _init_theme();
+       retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), false);
 
        if (vconf_notify_key_changed(VCONFKEY_BGSET, _change_bg_cb, NULL) < 0) {
                _E("Failed to register a vconf cb for %s\n", VCONFKEY_BGSET);
        }
        _create_bg();
 
-       layout = layout_create(menu_screen_info.win, LAYOUT_EDJE_PORTRAIT,
+       conformant = _create_conformant(menu_screen_info.win);
+       retv_if(NULL == conformant, false);
+       evas_object_data_set(menu_screen_info.win, "conformant", conformant);
+
+       Evas_Object *layout;
+       layout = layout_create(conformant, LAYOUT_EDJE_PORTRAIT,
                                LAYOUT_GROUP_NAME, MENU_SCREEN_ROTATE_PORTRAIT);
        if (NULL == layout) {
-               _E("Faield to load an edje object");
+               _E("Failed to load an edje object");
                evas_object_del(menu_screen_info.win);
-               return EXIT_FAILURE;
+               return false;
        }
        evas_object_data_set(menu_screen_info.win, "layout", layout);
-       evas_object_show(layout);
 
+       if (vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, _tts_cb, NULL) < 0) {
+               _E("Failed to register the tts callback");
+       }
+       retv_if(vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &menu_screen_info.is_tts) < 0, MENU_SCREEN_ERROR_FAIL);
+
+       elm_object_content_set(conformant, layout);
        mouse_register();
        aul_listen_app_dead_signal(_dead_cb, NULL);
+       key_register();
+
+       // FIXME : This will be enabled after rebuilding the routine for appid <-> pkgid.
+       pkgmgr_init();
 
        return true;
 }
@@ -317,21 +539,34 @@ static bool _create_cb(void *data)
 
 static void _terminate_cb(void *data)
 {
+       Evas_Object *conformant;
        Evas_Object *layout;
 
+       // FIXME : This will be enabled after rebuilding the routine for appid <-> pkgid.
+       pkgmgr_fini();
+
        if (vconf_ignore_key_changed(VCONFKEY_BGSET, _change_bg_cb) < 0) {
-               _E("Failed to remove bgset %s\n", VCONFKEY_BGSET);
+               _E("Failed to remove bgset [%s]\n", VCONFKEY_BGSET);
+       }
+
+       if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, _tts_cb) < 0) {
+               _E("Failed to ignore the alpha callback");
        }
 
        evas_object_hide(menu_screen_info.win);
 
+       key_unregister();
        mouse_unregister();
 
        layout = evas_object_data_del(menu_screen_info.win, "layout");
-       layout_destroy(layout);
+       if (layout) layout_destroy(layout);
+
+       conformant = evas_object_data_del(menu_screen_info.win, "conformant");
+       if (conformant) _destroy_conformant(conformant);
 
        _destroy_bg();
        _destroy_canvas();
+       _fini_theme();
        evas_object_del(menu_screen_info.win);
 }
 
@@ -341,10 +576,6 @@ static void _pause_cb(void *data)
 {
        _D("Pause start");
 
-       if (vconf_set_int(VCONFKEY_IDLE_SCREEN_TOP, VCONFKEY_IDLE_SCREEN_TOP_FALSE) < 0) {
-               _E("Failed to set memory/idle/top to 0");
-       }
-
        menu_screen_info.state = APP_STATE_PAUSE;
 }
 
@@ -354,32 +585,40 @@ static void _resume_cb(void *data)
 {
        _D("START RESUME");
 
-       if (vconf_set_int(VCONFKEY_IDLE_SCREEN_TOP, VCONFKEY_IDLE_SCREEN_TOP_TRUE) < 0) {
-               _E("Failed to set memory/idle/top to 1");
-       }
+       do { // Focus
+               Evas_Object *layout = evas_object_data_get(menu_screen_info.win, "layout");
+               break_if(NULL == layout);
+
+               Evas_Object *all_apps = evas_object_data_get(layout, "all_apps");
+               break_if(NULL == all_apps);
+
+               Evas_Object *scroller = elm_object_part_content_get(all_apps, "content");
+               break_if(NULL == scroller);
 
-       utilx_hide_fake_effect(
-               ecore_x_display_get(),
-               ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
-       );
+               page_scroller_focus(scroller);
+       } while (0);
 
        menu_screen_info.state = APP_STATE_RESUME;
 }
 
 
 
-static void _service_cb(service_h service, void *data)
+static void _app_control_cb(app_control_h service, void *data)
 {
        _D("START RESET : %d", menu_screen_info.state);
 
-       if (vconf_set_int(VCONFKEY_IDLE_SCREEN_TOP, VCONFKEY_IDLE_SCREEN_TOP_TRUE) < 0) {
-               _E("Failed to set memory/idle/top to 1");
-       }
+       do { // Focus
+               Evas_Object *layout = evas_object_data_get(menu_screen_info.win, "layout");
+               break_if(NULL == layout);
+
+               Evas_Object *all_apps = evas_object_data_get(layout, "all_apps");
+               break_if(NULL == all_apps);
 
-       utilx_hide_fake_effect(
-               ecore_x_display_get(),
-               ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
-       );
+               Evas_Object *scroller = elm_object_part_content_get(all_apps, "content");
+               break_if(NULL == scroller);
+
+               page_scroller_focus(scroller);
+       } while (0);
 }
 
 
@@ -425,20 +664,23 @@ static void _language_changed_cb(void *data)
                        item = page_get_item_at(page, j);
                        if (!item) continue;
 
-                       if (ail_package_get_appinfo(item_get_package(item), &ai) < 0) continue;
+                       if (ail_get_appinfo(item_get_package(item), &ai) < 0) {
+                               ail_destroy_appinfo(ai);
+                               continue;
+                       }
                        if (ail_appinfo_get_str(ai, AIL_PROP_NAME_STR, &name) < 0) {
-                               ail_package_destroy_appinfo(ai);
+                               ail_destroy_appinfo(ai);
                                continue;
                        }
 
                        if (!name) {
-                               _D("Faield to get name for %s", item_get_package(item));
-                               ail_package_destroy_appinfo(ai);
+                               _D("Failed to get name for %s", item_get_package(item));
+                               ail_destroy_appinfo(ai);
                                continue;
                        }
 
                        item_set_name(item, name, 0);
-                       ail_package_destroy_appinfo(ai);
+                       ail_destroy_appinfo(ai);
                }
 
                mapbuf_enable(page, 1);
@@ -453,7 +695,7 @@ static void _init(app_event_callback_s *event_callback)
        event_callback->terminate = _terminate_cb;
        event_callback->pause = _pause_cb;
        event_callback->resume = _resume_cb;
-       event_callback->service = _service_cb;
+       event_callback->app_control = _app_control_cb;
        event_callback->low_memory = NULL;
        event_callback->low_battery = NULL;
        event_callback->device_orientation = NULL;
@@ -471,27 +713,8 @@ static void _fini(void)
 
 int main(int argc, char *argv[])
 {
-       const char *env;
        app_event_callback_s event_callback;
 
-       env = getenv(STR_ENV_ENGINE);
-       if (env) {
-               _D("ELM_ENGINE is set as [%s]", env);
-               setenv("ELM_ENGINE", env, 1);
-       } else {
-               _D("ELM_ENGINE is set as [%s]", "gl");
-               setenv("ELM_ENGINE", "gl", 1);
-       }
-
-       env = getenv(STR_ENV_FPS);
-       if (env) {
-               _D("ELM_FPS is set as [%s]", env);
-               setenv("ELM_FPS", env, 1);
-       } else {
-               _D("ELM_FPS is set as [%s]", "6000");
-               setenv("ELM_FPS", "6000", 1);
-       }
-
        _init(&event_callback);
        app_efl_main(&argc, &argv, &event_callback, NULL);
        _fini();
index 078323fca72e12f411bc1985ccca2f551fd9964d..1dec1dbf5d0c223261e54643144032194c8dcd45 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -68,7 +72,7 @@ static struct {
 
 
 
-bool mouse_is_scrolling(void)
+HAPI bool mouse_is_scrolling(void)
 {
        bool scroll_x = false;
        bool scroll_y = false;
@@ -141,7 +145,7 @@ static Eina_Bool _move_cb(void *data, int type, void *event)
 
 
 
-void mouse_register(void)
+HAPI void mouse_register(void)
 {
        mouse_info.mouse_down = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _down_cb, NULL);
        if (!mouse_info.mouse_down) {
@@ -168,7 +172,7 @@ void mouse_register(void)
 
 
 
-void mouse_unregister(void)
+HAPI void mouse_unregister(void)
 {
        if (mouse_info.mouse_down) {
                ecore_event_handler_del(mouse_info.mouse_down);
index c37cc8dfc6560b94800b5af7f04705fb9d9608ca..edb31e1c00dbb78a4d308a4b81c2e2a8cabc3645 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 
@@ -34,7 +38,7 @@
 
 
 
-inline void page_mark_dirty(Evas_Object *page)
+HAPI inline void page_mark_dirty(Evas_Object *page)
 {
        int value;
        value = (int) evas_object_data_get(page, "dirty");
@@ -43,7 +47,7 @@ inline void page_mark_dirty(Evas_Object *page)
 
 
 
-inline void page_unmark_dirty(Evas_Object *page)
+HAPI inline void page_unmark_dirty(Evas_Object *page)
 {
        int value;
        value = (int) evas_object_data_get(page, "dirty");
@@ -54,35 +58,20 @@ inline void page_unmark_dirty(Evas_Object *page)
 
 
 
-inline void page_clean_dirty(Evas_Object *page)
+HAPI inline void page_clean_dirty(Evas_Object *page)
 {
        evas_object_data_set(page, "dirty", 0);
 }
 
 
 
-inline int page_is_dirty(Evas_Object *page)
+HAPI inline int page_is_dirty(Evas_Object *page)
 {
        return (int) evas_object_data_get(page, "dirty");
 }
 
 
 
-static void _changed_size_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-       Evas_Object *map;
-       Evas_Coord w, h;
-
-       evas_object_size_hint_min_get(obj, &w, &h);
-
-       map = mapbuf_get_mapbuf(obj);
-       if (map) {
-               evas_object_size_hint_min_set(map, w, h);
-       }
-}
-
-
-
 static menu_screen_error_e _insert_page_at(Evas_Object *scroller, Evas_Object *page, int index)
 {
        unsigned int nr_of_pages;
@@ -152,7 +141,7 @@ static void _dim_up_cb(void *data, Evas_Object *obj, const char* emission, const
 
 
 
-Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
+HAPI Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
 {
        Evas_Object *page;
        Evas_Object *bg;
@@ -162,8 +151,6 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
        Evas_Object *box;
 
        char *page_edje;
-       bool enable_bg_image;
-
        unsigned int count;
        int page_height;
        int page_width;
@@ -171,12 +158,11 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
        _D("Create a new page[%d]", idx);
 
        page_edje = evas_object_data_get(scroller, "page_edje");
-       enable_bg_image = (bool) evas_object_data_get(scroller, "enable_bg_image");
+       retv_if(!page_edje, NULL);
 
        page = layout_load_edj(scroller, page_edje, PAGE_GROUP_NAME);
        retv_if(!page, NULL);
 
-       evas_object_event_callback_add(page, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, NULL);
        edje_object_signal_callback_add(_EDJ(page), "dim,down", "menu", _dim_down_cb, NULL);
        edje_object_signal_callback_add(_EDJ(page), "dim,up", "menu", _dim_up_cb, NULL);
 
@@ -198,6 +184,11 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
 
        evas_object_size_hint_min_set(bg, page_width, page_height);
        evas_object_size_hint_max_set(bg, page_width, page_height);
+
+       evas_object_size_hint_min_set(page, page_width, page_height);
+       evas_object_size_hint_max_set(page, page_width, page_height);
+       evas_object_resize(page, page_width, page_height);
+
        elm_object_part_content_set(page, "bg", bg);
 
        evas_object_data_set(page, "win", evas_object_data_get(scroller, "win"));
@@ -221,7 +212,8 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
        if (index) {
                tab = evas_object_data_get(scroller, "tab");
                count = page_scroller_count_page(scroller);
-               index_update(tab, index, count);
+               index = index_update(tab, index, count);
+               evas_object_data_set(scroller, "index", index);
        }
 
        return page;
@@ -229,7 +221,7 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate)
 
 
 
-void page_destroy(Evas_Object *scroller, Evas_Object *page)
+HAPI void page_destroy(Evas_Object *scroller, Evas_Object *page)
 {
        Evas_Object *mapbuf;
        Evas_Object *bg;
@@ -243,8 +235,6 @@ void page_destroy(Evas_Object *scroller, Evas_Object *page)
        int page_max_app;
        unsigned int count;
 
-       evas_object_event_callback_del(page, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb);
-
        page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
        for (i = 0; i < page_max_app; i ++) {
                item = page_unpack_item_at(page, i);
@@ -271,10 +261,17 @@ void page_destroy(Evas_Object *scroller, Evas_Object *page)
        }
 
        index = evas_object_data_get(scroller, "index");
-       if (index) {
-               tab = evas_object_data_get(scroller, "tab");
+       tab = evas_object_data_get(scroller, "tab");
+       if (index && tab) {
                count = page_scroller_count_page(scroller);
-               index_update(tab, index, count);
+               if (count) {
+                       index = index_update(tab, index, count);
+                       evas_object_data_set(scroller, "index", index);
+               }
+               else {
+                       index_destroy(index);
+                       evas_object_data_set(scroller, "index", NULL);
+               }
        }
 
        evas_object_data_del(page, "win");
@@ -292,7 +289,7 @@ void page_destroy(Evas_Object *scroller, Evas_Object *page)
 
 
 
-Evas_Object *page_get_item_at(Evas_Object *page, unsigned int idx)
+HAPI Evas_Object *page_get_item_at(Evas_Object *page, unsigned int idx)
 {
        Eina_List *pending_list;
        Eina_List *n;
@@ -318,7 +315,7 @@ Evas_Object *page_get_item_at(Evas_Object *page, unsigned int idx)
 
 
 
-menu_screen_error_e page_unpack_item(Evas_Object *page, Evas_Object *item)
+HAPI menu_screen_error_e page_unpack_item(Evas_Object *page, Evas_Object *item)
 {
        char tmp[PATH_MAX];
        Evas_Object *check_item;
@@ -341,7 +338,7 @@ menu_screen_error_e page_unpack_item(Evas_Object *page, Evas_Object *item)
        }
 
        retv_if(pending_idx == -1, MENU_SCREEN_ERROR_FAIL);
-       sprintf(tmp, "menu_swallow_%d", pending_idx);
+       snprintf(tmp, sizeof(tmp), "menu_swallow_%d", pending_idx);
 
        check_item = edje_object_part_swallow_get(_EDJ(page), tmp);
        retv_if(check_item != item, MENU_SCREEN_ERROR_FAIL);
@@ -352,12 +349,15 @@ menu_screen_error_e page_unpack_item(Evas_Object *page, Evas_Object *item)
                page_mark_dirty(page);
        }
 
+       mapbuf_disable(page, 1);
+       mapbuf_enable(page, 1);
+
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-Evas_Object *page_unpack_item_at(Evas_Object *page, int idx)
+HAPI Evas_Object *page_unpack_item_at(Evas_Object *page, int idx)
 {
        Eina_List *pending_list;
        Eina_List *n;
@@ -381,7 +381,7 @@ Evas_Object *page_unpack_item_at(Evas_Object *page, int idx)
        object = page_get_item_at(page, idx);
        if (object) {
                Evas_Object *check_object;
-               sprintf(tmp, "menu_swallow_%d", idx);
+               snprintf(tmp, sizeof(tmp), "menu_swallow_%d", idx);
 
                check_object = elm_object_part_content_unset(page, tmp);
                if (check_object != object) {
@@ -391,12 +391,16 @@ Evas_Object *page_unpack_item_at(Evas_Object *page, int idx)
 
                page_mark_dirty(page);
        }
+
+       mapbuf_disable(page, 1);
+       mapbuf_enable(page, 1);
+
        return object;
 }
 
 
 
-void page_pack_item(Evas_Object *page, int idx, Evas_Object *item)
+HAPI void page_pack_item(Evas_Object *page, int idx, Evas_Object *item)
 {
        char tmp[PATH_MAX];
        Evas_Object *object;
@@ -425,12 +429,14 @@ void page_pack_item(Evas_Object *page, int idx, Evas_Object *item)
        item_mark_dirty(item);
        elm_object_part_content_set(page, tmp, item);
        page_mark_dirty(page);
-       mapbuf_enable(page, 0);
+
+       mapbuf_disable(page, 1);
+       mapbuf_enable(page, 1);
 }
 
 
 
-void page_set_item(Evas_Object *page, int idx, Evas_Object *item)
+HAPI void page_set_item(Evas_Object *page, int idx, Evas_Object *item)
 {
        Eina_List *list;
 
@@ -445,11 +451,14 @@ void page_set_item(Evas_Object *page, int idx, Evas_Object *item)
        evas_object_data_set(item, "pending,idx", (void *) idx);
 
        item_set_page(item, page, 1);
+
+       mapbuf_disable(page, 1);
+       mapbuf_enable(page, 1);
 }
 
 
 
-inline unsigned int page_count_item(Evas_Object *page)
+HAPI inline unsigned int page_count_item(Evas_Object *page)
 {
        register unsigned int i;
        unsigned int count = 0;
@@ -467,7 +476,7 @@ inline unsigned int page_count_item(Evas_Object *page)
 
 
 
-int page_find_empty_near(Evas_Object *page, int pivot)
+HAPI int page_find_empty_near(Evas_Object *page, int pivot)
 {
        int pivot_saved = pivot;
        Evas_Object *obj;
@@ -504,7 +513,7 @@ int page_find_empty_near(Evas_Object *page, int pivot)
 
 
 
-int page_find_first_empty(Evas_Object *page, int pivot)
+HAPI int page_find_first_empty(Evas_Object *page, int pivot)
 {
        Evas_Object *item;
        Evas_Object *scroller;
@@ -526,7 +535,7 @@ int page_find_first_empty(Evas_Object *page, int pivot)
 
 
 
-void page_trim_items(Evas_Object *page)
+HAPI void page_trim_items(Evas_Object *page)
 {
        Evas_Object *item;
        register unsigned int i;
index 337cabba2b70b7fe20376a146d24edbc589bb065..178fd8ec9fdb0609e1e2ceaf1495e6a8280d662a 100644 (file)
@@ -1,33 +1,39 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
+#include <stdio.h>
 #include <vconf.h>
 
-#include "menu_screen.h"
+#include "item_badge.h"
 #include "conf.h"
-#include "list.h"
-#include "mapbuf.h"
-#include "page.h"
 #include "index.h"
 #include "item.h"
 #include "item_event.h"
 #include "layout.h"
+#include "list.h"
+#include "mapbuf.h"
+#include "menu_screen.h"
+#include "page.h"
 #include "page_scroller.h"
 #include "pkgmgr.h"
 #include "util.h"
 
 
 
-static int _count_pages(Evas_Object *scroller)
-{
-       const Eina_List *children;
-       Evas_Object *box;
-
-       box = evas_object_data_get(scroller, "box");
-       retv_if(NULL == box, 0);
-
-       children = elm_box_children_get(box);
-       return eina_list_count(children);
-}
-
-
-
-void page_scroller_bring_in(Evas_Object *scroller, int idx)
+HAPI void page_scroller_bring_in(Evas_Object *scroller, int idx)
 {
        Evas_Object *index;
        int w, h;
@@ -74,7 +66,7 @@ void page_scroller_bring_in(Evas_Object *scroller, int idx)
 
 
 
-void page_scroller_show_region(Evas_Object *scroller, int idx)
+HAPI void page_scroller_show_region(Evas_Object *scroller, int idx)
 {
        Evas_Object *index;
        int w, h;
@@ -94,49 +86,44 @@ void page_scroller_show_region(Evas_Object *scroller, int idx)
 
 static void _anim_stop_cb(void *data, Evas_Object *scroller, void *event_info)
 {
-       _D("Invoked");
-}
+       _D("stop the scroller(%p) animation", scroller);
 
+       /* page_scroller_focus & index_bring_in in _drag_stop_cb & _anim_stop_cb */
+       Evas_Coord x, y, w, h;
+       elm_scroller_region_get(scroller, &x, &y, &w, &h);
 
+       if (x % w) return;
 
-static void _anim_start_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       Evas_Coord x;
-       Evas_Coord y;
-       Evas_Coord w;
-       Evas_Coord h;
-       Evas_Object *index;
-       Elm_Object_Item *idx_it;
+       if(evas_object_data_get(scroller, "mouse_wheel_scroller_start")) {
+               // "page_scroller_bring_in" was invoked in "_mouse_wheel_cb",
+               // so condition cur_idx == idx will be true and "page_scroller_focus" won't be executed
+               // so "page_scroller_focus" is executed here.
+               evas_object_data_set(scroller, "mouse_wheel_scroller_start", (void *) 0);
+               page_scroller_focus(scroller);
+       }
 
-       int idx;
-       int drag_start;
-       int previous_x;
-       int threshold;
+       int cur_idx = page_scroller_get_current_page_no(scroller);
+       int idx = 0;
+       if (w) idx = x / w;
+       if (cur_idx == idx) return;
 
-       _D("Invoked");
+       page_scroller_bring_in(scroller, idx);
+       page_scroller_focus(scroller);
+}
 
-       drag_start = (int) evas_object_data_get(scroller, "drag_start");
-       previous_x = (int) evas_object_data_get(scroller, "previous_x");
-       index = evas_object_data_get(scroller, "index");
 
-       ret_if(drag_start == 0);
-       evas_object_data_set(scroller, "drag_start", (void *) 0);
 
-       elm_scroller_region_get(scroller, &x, &y, &w, &h);
-       threshold = w * PAGE_SCROLL_SENSITIVE;
+static void _anim_start_cb(void *data, Evas_Object *scroller, void *event_info)
+{
+       _D("start the scroller(%p) animation", scroller);
 
-       idx_it = elm_index_selected_item_get(index, 0);
-       idx = (int) elm_object_item_data_get(idx_it);
+       int drag_start = (int) evas_object_data_get(scroller, "drag_start");
+       if (drag_start == 0) return;
+       evas_object_data_set(scroller, "drag_start", (void *) 0);
+}
 
-       if (abs(previous_x - x) > threshold) {
-               if (x > previous_x) idx ++;
-               else if ((x < previous_x) && (idx != 0)) idx --;
-       }
 
-       ret_if(idx >= _count_pages(scroller) || idx < 0);
 
-       page_scroller_bring_in(scroller, idx);
-}
 
 
 
@@ -155,10 +142,7 @@ static void _drag_start_cb(void *data, Evas_Object *scroller, void *event_info)
 
 static void _drag_stop_cb(void *data, Evas_Object *scroller, void *event_info)
 {
-       Evas_Coord x;
-       Evas_Coord w;
-       Evas_Coord y;
-       Evas_Coord h;
+       Evas_Coord x, y, w, h;
        int previous_x;
 
        _D("Invoked");
@@ -168,31 +152,79 @@ static void _drag_stop_cb(void *data, Evas_Object *scroller, void *event_info)
        if (x == previous_x) {
                _D("\e[33mHold scroller (previous) %d (current) %d\e[0m", previous_x, x);
        }
-}
 
+       /* page_scroller_focus & index_bring_in in _drag_stop_cb & _anim_stop_cb */
+       if (x % w) return;
+
+       int cur_idx = page_scroller_get_current_page_no(scroller);
+       int idx = 0;
+       if (w) idx = x / w;
 
+       if (cur_idx == idx) return;
 
-static void _scroller_register(Evas_Object *scroller)
+       page_scroller_bring_in(scroller, idx);
+       page_scroller_focus(scroller);
+}
+
+
+static void _scroll_cb(void *data, Evas_Object *scroller, void *event_info)
 {
-       evas_object_smart_callback_add(scroller, "scroll,anim,start", _anim_start_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,anim,stop", _anim_stop_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,drag,start", _drag_start_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,drag,stop", _drag_stop_cb, NULL);
+       _drag_stop_cb(data, scroller, event_info);
 }
 
 
 
-static void _scroller_unregister(Evas_Object *scroller)
+static menu_screen_error_e _find_position_all_page(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
 {
-       evas_object_smart_callback_del(scroller, "scroll,anim,start", _anim_start_cb);
-       evas_object_smart_callback_del(scroller, "scroll,anim,stop", _anim_stop_cb);
-       evas_object_smart_callback_del(scroller, "scroll,drag,start", _drag_start_cb);
-       evas_object_smart_callback_del(scroller, "scroll,drag,stop", _drag_stop_cb);
+       Evas_Object *page;
+       Evas_Object *item;
+       register unsigned int page_no;
+       register unsigned int position_no;
+       int nr_of_pages;
+       int page_max_app;
+
+       retv_if(NULL == scroller, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == candidate_page, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == candidate_pos, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       *candidate_page = -1;
+       *candidate_pos = -1;
+       nr_of_pages = page_scroller_count_page(scroller);
+       page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
+
+       page = page_scroller_get_page_at(scroller, nr_of_pages-1);
+       page_no = nr_of_pages-1;
+       for (position_no = 0; position_no < page_max_app; position_no ++) {
+               item = page_get_item_at(page, position_no);
+               if (!item) {
+                       *candidate_page = page_no;
+                       *candidate_pos = position_no;
+                       return MENU_SCREEN_ERROR_OK;
+               }
+       }
+
+       for (page_no = 0; page_no < nr_of_pages -1; page_no ++) {
+               page = page_scroller_get_page_at(scroller, page_no);
+               if(!page) {
+                       return MENU_SCREEN_ERROR_FAIL;
+               }
+
+               for (position_no = 0; position_no < page_max_app; position_no ++) {
+                       item = page_get_item_at(page, position_no);
+                       if (!item) {
+                               *candidate_page = page_no;
+                               *candidate_pos = position_no;
+                               return MENU_SCREEN_ERROR_OK;
+                       }
+               }
+       }
+
+       return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-menu_screen_error_e _find_position_by_default(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
+static menu_screen_error_e _find_position_by_default(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
 {
        Evas_Object *page;
        Evas_Object *item;
@@ -234,7 +266,7 @@ menu_screen_error_e _find_position_by_default(Evas_Object *scroller, int *candid
 
 
 
-menu_screen_error_e _find_position_by_package(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
+static menu_screen_error_e _find_position_by_package(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
 {
        Evas_Object *page;
        Evas_Object *item;
@@ -282,6 +314,54 @@ menu_screen_error_e _find_position_by_package(Evas_Object *scroller, int *candid
 
 
 
+static menu_screen_error_e _find_position_by_name(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data)
+{
+       Evas_Object *page;
+       Evas_Object *item;
+       register int page_no;
+       register int position_no;
+       unsigned int nr_of_pages;
+       int page_max_app;
+       app_info_t *ai = data;
+
+       retv_if(NULL == scroller, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == candidate_page, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == candidate_pos, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == data, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == ai->name, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       *candidate_page = 0;
+       *candidate_pos = 0;
+       nr_of_pages = page_scroller_count_page(scroller);
+       page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
+       for (page_no = 0; page_no < nr_of_pages; page_no ++) {
+               page = page_scroller_get_page_at(scroller, page_no);
+               if (!page) {
+                       _D("Page is not found at %d", page_no);
+                       return MENU_SCREEN_ERROR_FAIL;
+               }
+
+               for (position_no = 0; position_no < page_max_app; position_no ++) {
+                       char *name;
+
+                       item = page_get_item_at(page, position_no);
+                       if (!item) {
+                               *candidate_page = page_no;
+                               *candidate_pos = position_no;
+                               return MENU_SCREEN_ERROR_OK;
+                       } else if ((name = item_get_name(item)) && strcmp(name, ai->name) > 0) {
+                               *candidate_page = page_no;
+                               *candidate_pos = position_no;
+                               return MENU_SCREEN_ERROR_OK;
+                       }
+               }
+       }
+
+       return MENU_SCREEN_ERROR_OK;
+}
+
+
+
 static menu_screen_error_e _animated_pack_item(Evas_Object *item, Evas_Object *scroller, Evas_Object *page, int from)
 {
        Evas_Object *item_out_page = NULL;
@@ -336,60 +416,7 @@ static menu_screen_error_e _animated_pack_item(Evas_Object *item, Evas_Object *s
 
 
 
-static Evas_Object *_animated_unpack_item(Evas_Object *scroller, Evas_Object *page, unsigned int pos)
-{
-       Evas_Object *out = NULL;
-       Evas_Object *item;
-       Evas_Object *next_page;
-
-       char buf[32];
-       unsigned int page_max_app;
-       unsigned int page_no;
-       page_scroller_sort_type_e sort_type;
-
-       out = page_unpack_item_at(page, pos);
-       retv_if(NULL == out, NULL);
-
-       page_no = page_scroller_get_page_no(scroller, page);
-       page_max_app = (unsigned int) evas_object_data_get(scroller, "page_max_app");
-       sort_type = (page_scroller_sort_type_e) evas_object_data_get(scroller, "sort_type");
-
-       pos ++;
-       while (page && page_no < MAX_PAGE_NO) {
-               if (0 == page_count_item(page)) {
-                       page_destroy(scroller, page);
-                       break;
-               }
-
-               for (; pos < page_max_app; pos ++) {
-                       item = page_unpack_item_at(page, pos);
-                       page_pack_item(page, pos - 1, item);
-                       snprintf(buf, 32, "menu%d", pos - 1);
-                       edje_object_signal_emit(_EDJ(page), STR_MOVE_NEXT, buf);
-                       edje_object_signal_emit(_EDJ(page), STR_ANI_RETURN, buf);
-               }
-
-               if (sort_type == PAGE_SCROLLER_SORT_MAX) {
-                       return NULL;
-               }
-
-               page_no ++;
-               next_page = page_scroller_get_page_at(scroller, page_no);
-               if (next_page) {
-                       item = page_unpack_item_at(next_page, 0);
-                       page_pack_item(page, page_max_app - 1, item);
-               } else break;
-
-               pos = 1;
-               page = next_page;
-       }
-
-       return out;
-}
-
-
-
-menu_screen_error_e page_scroller_push_item(Evas_Object *scroller, app_info_t *ai)
+HAPI Evas_Object *page_scroller_push_item(Evas_Object *scroller, app_info_t *ai)
 {
        Evas_Object *page;
        Evas_Object *item;
@@ -413,7 +440,7 @@ menu_screen_error_e page_scroller_push_item(Evas_Object *scroller, app_info_t *a
                },
                {
                        .sort_type = PAGE_SCROLLER_SORT_BY_NAME,
-                       .sort_func = NULL,
+                       .sort_func = _find_position_by_name,
                },
                {
                        .sort_type = PAGE_SCROLLER_SORT_MAX,
@@ -432,307 +459,204 @@ menu_screen_error_e page_scroller_push_item(Evas_Object *scroller, app_info_t *a
 
                rotate = (int) evas_object_data_get(scroller, "rotate");
                new_page = page_create(scroller, nr_of_pages, rotate);
-               retv_if(NULL == new_page, MENU_SCREEN_ERROR_FAIL);
+               retv_if(NULL == new_page, NULL);
                mapbuf_enable(new_page, 0);
        }
 
        item = item_create(scroller, ai);
-       retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
+       retv_if(NULL == item, NULL);
 
        page = page_scroller_get_page_at(scroller, candidate_page);
        if (!page) {
                _D("Impossible, page is not found");
                item_destroy(item);
-               return MENU_SCREEN_ERROR_FAIL;
+               return NULL;
        }
 
        retv_if(MENU_SCREEN_ERROR_OK !=
                        _animated_pack_item(item, scroller, page, candidate_pos),
-                       MENU_SCREEN_ERROR_FAIL);
+                       NULL);
 
-       return MENU_SCREEN_ERROR_OK;
+       return item;
 }
 
 
 
-static inline menu_screen_error_e _create_cb(const char *package, void *data)
+HAPI Evas_Object *page_scroller_push_item_by_order(Evas_Object *scroller, app_info_t *ai)
 {
-       app_info_t ai = {0,};
-       Evas_Object *item;
-       Evas_Object *scroller = data;
+       int candidate_page = -1;
+       int candidate_pos = -1;
+       Evas_Object *item = NULL;
 
-       if (MENU_SCREEN_ERROR_FAIL == list_get_values(package, &ai)) {
-               list_free_values(&ai);
-               return MENU_SCREEN_ERROR_FAIL;
+       if (MAX_PAGE_NO == page_scroller_count_page(scroller)) {
+               _find_position_all_page(scroller, &candidate_page, &candidate_pos, &ai);
+               if (-1 != candidate_page || -1 != candidate_pos) {
+                       item = page_scroller_push_item(scroller, ai);
+               }
        }
+       else item = page_scroller_push_item(scroller, ai);
 
-       do {
-               if (!scroller) {
-                       _D("Scroller is NULL.");
-                       break;
-               }
+       return item;
+}
 
-               if (ai.nodisplay) {
-                       Evas_Object *page;
 
-                       _D("package %s is not visible", package);
-                       item = pkgmgr_find_pended_object(ai.package, 1, scroller, &page);
-                       if (item) {
-                               if (page) {
-                                       page_unpack_item(page, item);
-                                       page_trim_items(page);
-                               }
 
-                               item_destroy(item);
-                       }
+static void _mapbuf_cb(keynode_t *node, void *data)
+{
+       int value;
+       int nr_of_pages;
+       register int i;
+       Evas_Object *page;
 
-                       break;
-               }
+       if (vconf_get_int("memory/menuscreen/mapbuf", &value) < 0) {
+               _D("Failed to get mapbuf status");
+               return;
+       }
 
-               item = pkgmgr_find_pended_object(ai.package, 1, scroller, NULL);
-               if (!item) {
-                       item = page_scroller_find_item_by_package(scroller, ai.package, NULL);
-                       if (!item) {
-                               int ret;
-
-                               _D("package %s is installed directly", package);
-                               ret = page_scroller_push_item(scroller, &ai);
-                               if (ret == MENU_SCREEN_ERROR_OK) {
-                                       break;
-                               } else {
-                                       list_free_values(&ai);
-                                       retv_if(1, MENU_SCREEN_ERROR_FAIL);
-                               }
+       nr_of_pages = page_scroller_count_page(data);
+       if (value) {
+               for (i = 0; i < nr_of_pages; i ++) {
+                       page = page_scroller_get_page_at(data, i);
+                       if (!page) continue;
+
+                       if (!mapbuf_is_enabled(page)) {
+                               _D("Enable mapbuf %d", i);
+                               mapbuf_enable(page, 1);
                        }
                }
+       } else {
+               for (i = 0; i < nr_of_pages; i ++) {
+                       page = page_scroller_get_page_at(data, i);
+                       if (!page) continue;
 
-               _D("Package %s is found, update it!", package);
-               item_update(item, &ai);
-       } while(0);
-
-       list_free_values(&ai);
-       return MENU_SCREEN_ERROR_OK;
+                       if (mapbuf_is_enabled(page)) {
+                               _D("Disable mapbuf %d", i);
+                               mapbuf_disable(page, 1);
+                       }
+               }
+       }
 }
 
 
 
-static inline menu_screen_error_e _update_cb(const char *package, void *data)
+static void _mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
+       Evas_Event_Mouse_Wheel *ei = event_info;
        Evas_Object *scroller = data;
-       Evas_Object *item;
-       int page_no = 0;
-       app_info_t ai = {0,};
+       int x, y, w, h;
+       int idx = -1;
 
-       if (MENU_SCREEN_ERROR_FAIL == list_get_values(package, &ai)) {
-               list_free_values(&ai);
-               return MENU_SCREEN_ERROR_FAIL;
-       }
-
-       do {
-               if (!scroller) {
-                       _D("Scroller is NULL.");
-                       break;
-               }
-
-               item = page_scroller_find_item_by_package(scroller, package, &page_no);
-               if (!item) {
-                       Evas_Object *page;
-                       _D("There is no loaded item is found");
-                       item = pkgmgr_find_pended_object(package, 1, scroller, &page);
-                       if (item) {
-                               if (!ai.nodisplay) {
-                                       _D("Item is found for updating from the install list, Ignore this.");
-                                       item_update(item, &ai);
-                               } else {
-                                       _D("Item is found for updating from the install list, But nodisplay");
-                                       if (page) {
-                                               page_unpack_item(page, item);
-                                               page_trim_items(page);
-                                       }
-                                       item_destroy(item);
-                               }
-                       } else {
-                               int ret;
-                               _D("Item is not found. Create a new one");
-
-                               ret = (ai.nodisplay == false ? page_scroller_push_item(scroller, &ai) : MENU_SCREEN_ERROR_OK);
-                               if (ret == MENU_SCREEN_ERROR_OK) {
-                                       break;
-                               } else {
-                                       list_free_values(&ai);
-                                       retv_if(1, MENU_SCREEN_ERROR_FAIL);
-                               }
-                       }
-               } else {
-                       Evas_Object *page;
-                       Evas_Object *pended_item;
-
-                       pended_item = pkgmgr_find_pended_object(package, 1, scroller, &page);
-                       if (!pended_item ) {
-                               _D("Cannot find package in the install list");
-                       }
-
-                       if (ai.nodisplay == false) {
-                               item_update(item, &ai);
-                               break;
-                       }
+       _D("Wheel's up or down(%d)", ei->z);
 
-                       page = page_scroller_get_page_at(scroller, page_no);
-                       if (page) {
-                               page_unpack_item(page, item);
-                               page_trim_items(page);
-                       }
-                       item_destroy(item);
-               }
-       } while (0);
+       elm_scroller_region_get(scroller, &x, &y, &w, &h);
+       if (ei->z > 0) { // Wheel's up
+               idx = x / w;
+               idx ++;
+       } else if (ei->z < 0) { // Wheel's down
+               idx = x / w; // Scroller got ECORE events at first, then Menu-screen gets EVAS events.
+       } else { // Wheel's not moving.
+               _D("Wheel's not moving");
+       }
 
-       list_free_values(&ai);
-       return MENU_SCREEN_ERROR_OK;
+       if (idx >= page_scroller_count_page(scroller) || idx < 0) return;
+       evas_object_data_set(scroller, "mouse_wheel_scroller_start", (void *) 1);
+       page_scroller_bring_in(scroller, idx);
 }
 
 
 
-static inline menu_screen_error_e _delete_cb(const char *package, void *data)
+static inline char *_ltrim(char *str)
 {
-       Evas_Object *item;
-       Evas_Object *page;
-       Evas_Object *scroller = data;
-       Evas_Object *tmp;
-       int page_no = 0;
-       register unsigned int i;
-       unsigned int page_max_app;
-
-       do {
-               if (!scroller) {
-                       _D("Scroller is NULL.");
-                       break;
-               }
-
-               tmp = pkgmgr_find_pended_object(package, 1, scroller, NULL);
+       retv_if(NULL == str, NULL);
+       while (*str && (*str == ' ' || *str == '\t' || *str == '\n')) str ++;
+       return str;
+}
 
-               item = page_scroller_find_item_by_package(scroller, package, &page_no);
-               retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
 
-               if (tmp != item) {
-                       _D("Pended item is %p, Found item is %p", tmp, item);
-               }
 
-               page = page_scroller_get_page_at(scroller, page_no);
-               retv_if(NULL == page, MENU_SCREEN_ERROR_FAIL);
+static inline int _rtrim(char *str)
+{
+       int len;
 
-               page_max_app = (unsigned int) evas_object_data_get(scroller, "page_max_app");
-               for (i = 0; i < page_max_app; i++) {
-                       if (item == page_get_item_at(page, i)) {
-                               break;
-                       }
-               }
+       retv_if(NULL == str, 0);
 
-               item = _animated_unpack_item(scroller, page, i);
-               retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
-               item_destroy(item);
-       } while (0);
+       len = strlen(str);
+       while (--len >= 0 && (str[len] == ' ' || str[len] == '\n' || str[len] == '\t')) {
+               str[len] = '\0';
+       }
 
-       return MENU_SCREEN_ERROR_OK;
+       return len;
 }
 
 
 
-static struct pkg_event_handler {
-       const char *event_name;
-       int (*event_handler)(const char *package, void *data);
-} event_table[] = {
-       {
-               .event_name = "create",
-               .event_handler = _create_cb,
-       },
-       {
-               .event_name = "update",
-               .event_handler = _update_cb,
-       },
-       {
-               .event_name = "delete",
-               .event_handler = _delete_cb,
-       },
-       {
-               .event_name = NULL,
-               .event_handler = NULL,
-       },
-};
-
-
-
-static void _desktop_cb(keynode_t *node, void *data)
+static int _create_main_operation_list(Evas_Object *scroller)
 {
-       char *event;
-       char type[10];
-       char package[BUFSZE];
-       register int i;
+       FILE *fp;
+       const char *filename = RESDIR"/data/main_operation.launch";
+       char *line = NULL;
+       size_t size = 0;
+       ssize_t read;
+       char *data = NULL;
+       Eina_List *main_operation_list = NULL;
+
+       fp = fopen(filename, "r");
+       if (!fp) {
+               _D("cannot open fp");
+               return 0;
+       }
 
-       event = vconf_get_str(vconf_keynode_get_name(node));
-       ret_if(NULL == event);
+       while ((read = getline(&line, &size, fp)) != -1) {
+               char *begin;
 
-       if (sscanf(event, "%10[^:]:%1023s", type, package) != 2) {
-               _D("Failed to parse the event format : [%s], [%s]", type, package);
-       }
+               if (size <= 0) {
+                       free(line);
+                       line = NULL;
+                       break;
+               }
 
-       _D("command[%s], package[%s]", type, package);
+               begin = _ltrim(line);
+               _rtrim(line);
 
-       for (i = 0; event_table[i].event_name; i ++) {
-               if (!strcasecmp(type, event_table[i].event_name)) {
-                       if (event_table[i].event_handler(package, data) == MENU_SCREEN_ERROR_FAIL) {
-                               _E("Failed to handles the desktop notification event");
-                       }
+               if (*begin == '#' || *begin == '\0') {
+                       free(line);
+                       line = NULL;
+                       continue;
+               }
 
-                       free(event);
-                       return;
+               data = strdup(begin);
+               main_operation_list = eina_list_append(main_operation_list, data);
+
+               if (line) {
+                       free(line);
+                       line = NULL;
                }
        }
 
-       _E("Failed to find a proper event handler");
-       free(event);
+       fclose(fp);
+       evas_object_data_set(scroller, DATA_KEY_MAIN_OPERATION_LIST, main_operation_list);
+
+       return 1;
 }
 
 
 
-static void _mapbuf_cb(keynode_t *node, void *data)
+static void _destroy_main_operation_list(Evas_Object *scroller)
 {
-       int value;
-       int nr_of_pages;
-       register int i;
-       Evas_Object *page;
-
-       if (vconf_get_int("memory/menuscreen/mapbuf", &value) < 0) {
-               _D("Failed to get mapbuf status");
-               return;
-       }
+       char *data = NULL;
+       Eina_List *main_operation_list = NULL;
 
-       nr_of_pages = page_scroller_count_page(data);
-       if (value) {
-               for (i = 0; i < nr_of_pages; i ++) {
-                       page = page_scroller_get_page_at(data, i);
-                       if (!page) continue;
+       main_operation_list = evas_object_data_del(scroller, DATA_KEY_MAIN_OPERATION_LIST);
+       ret_if(!main_operation_list);
 
-                       if (!mapbuf_is_enabled(page)) {
-                               _D("Enable mapbuf %d", i);
-                               mapbuf_enable(page, 1);
-                       }
-               }
-       } else {
-               for (i = 0; i < nr_of_pages; i ++) {
-                       page = page_scroller_get_page_at(data, i);
-                       if (!page) continue;
-
-                       if (mapbuf_is_enabled(page)) {
-                               _D("Disable mapbuf %d", i);
-                               mapbuf_disable(page, 1);
-                       }
-               }
+       EINA_LIST_FREE(main_operation_list, data) {
+               free(data);
        }
 }
 
 
 
-Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, page_scroller_sort_type_e sort_type, int rotate)
+HAPI Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, page_scroller_sort_type_e sort_type, int rotate)
 {
        Evas_Object *box;
        Evas_Object *scroller;
@@ -749,14 +673,13 @@ Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, page_scr
        width = menu_screen_get_root_width();
        height = (int) ((double) PROP_PORTRAIT_HEIGHT * ((double) menu_screen_get_root_height()));
        elm_scroller_page_size_set(scroller, width, height);
+       elm_scroller_page_scroll_limit_set(scroller, 1, 1);
 
        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);
        evas_object_size_hint_min_set(scroller, width, height);
        evas_object_size_hint_max_set(scroller, width, height);
 
-       _scroller_register(scroller);
-
        box = elm_box_add(scroller);
        if (!box) {
                _D("Failed to create box");
@@ -788,32 +711,36 @@ Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, page_scr
        evas_object_data_set(scroller, "is_edited", (void *) false);
        elm_object_content_set(scroller, box);
 
+       evas_object_smart_callback_add(scroller, "scroll,anim,start", _anim_start_cb, NULL);
+       evas_object_smart_callback_add(scroller, "scroll,anim,stop", _anim_stop_cb, NULL);
+       evas_object_smart_callback_add(scroller, "scroll,drag,start", _drag_start_cb, NULL);
+       evas_object_smart_callback_add(scroller, "scroll,drag,stop", _drag_stop_cb, NULL);
+       evas_object_smart_callback_add(scroller, "scroll", _scroll_cb, NULL);
        evas_object_event_callback_add(box, EVAS_CALLBACK_DEL, _evas_object_event_del_cb, "BOX");
+       evas_object_event_callback_add(scroller, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, scroller);
 
        evas_object_show(box);
        evas_object_show(scroller);
 
-       if (vconf_notify_key_changed("memory/menuscreen/desktop", _desktop_cb, scroller) < 0) {
-               _E("Failed to register a desktop change event handler");
-       }
-
        if (vconf_notify_key_changed("memory/menuscreen/mapbuf", _mapbuf_cb, scroller) < 0) {
                _E("Failed to register a vconf cb for %s", "memory/menuscreen/mapbuf");
        }
 
-       pkgmgr_init(scroller);
+       item_badge_register_changed_cb(scroller);
+       if (!_create_main_operation_list(scroller)) {
+               _E("Cannot create the main operation list");
+       }
 
        return scroller;
 }
 
 
 
-void page_scroller_destroy(Evas_Object *scroller)
+HAPI void page_scroller_destroy(Evas_Object *scroller)
 {
        Evas_Object *box;
        Evas_Object *page;
        Evas_Object *tmp;
-       Evas_Object *tab;
 
        const Eina_List *page_list;
        const Eina_List *l;
@@ -823,9 +750,8 @@ void page_scroller_destroy(Evas_Object *scroller)
        ret_if(NULL == (box = evas_object_data_get(scroller, "box")));
        ret_if(NULL == (page_list = elm_box_children_get(box)));
 
-       tab = evas_object_data_get(scroller, "tab");
-
-       pkgmgr_fini();
+       _destroy_main_operation_list(scroller);
+       item_badge_unregister_changed_cb();
 
        EINA_LIST_FOREACH_SAFE(page_list, l, ln, page) {
                int count;
@@ -850,7 +776,6 @@ void page_scroller_destroy(Evas_Object *scroller)
        box = elm_object_content_unset(scroller);
        evas_object_del(box);
 
-       _scroller_unregister(scroller);
        evas_object_data_del(scroller, "win");
        evas_object_data_del(scroller, "layout");
        evas_object_data_del(scroller, "controlbar");
@@ -872,12 +797,15 @@ void page_scroller_destroy(Evas_Object *scroller)
        evas_object_data_del(scroller, "is_edited");
        evas_object_data_del(scroller, "install_list");
 
-       evas_object_del(scroller);
+       evas_object_smart_callback_del(scroller, "scroll,anim,start", _anim_start_cb);
+       evas_object_smart_callback_del(scroller, "scroll,anim,stop", _anim_stop_cb);
+       evas_object_smart_callback_del(scroller, "scroll,drag,start", _drag_start_cb);
+       evas_object_smart_callback_del(scroller, "scroll,drag,stop", _drag_stop_cb);
+       evas_object_smart_callback_del(scroller, "scroll", _scroll_cb);
        evas_object_event_callback_del(box, EVAS_CALLBACK_DEL, _evas_object_event_del_cb);
+       evas_object_event_callback_del(scroller, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb);
 
-       if (vconf_ignore_key_changed("memory/menuscreen/desktop", _desktop_cb) < 0) {
-               _E("Failed to ignore the desktop event");
-       }
+       evas_object_del(scroller);
 
        if (vconf_ignore_key_changed("memory/menuscreen/mapbuf", _mapbuf_cb) < 0) {
                _E("Failed to remove vconf %s", "memory/menuscreen/mapbuf");
@@ -886,7 +814,7 @@ void page_scroller_destroy(Evas_Object *scroller)
 
 
 
-void page_scroller_clean(Evas_Object *scroller)
+HAPI void page_scroller_clean(Evas_Object *scroller)
 {
        Evas_Object *page;
        Evas_Object *item;
@@ -919,13 +847,13 @@ void page_scroller_clean(Evas_Object *scroller)
 
 
 
-Evas_Object *page_scroller_get_page_at(Evas_Object *scroller, unsigned int idx)
+HAPI Evas_Object *page_scroller_get_page_at(Evas_Object *scroller, unsigned int idx)
 {
        const Eina_List *page_list;
        Evas_Object *item;
        Evas_Object *box;
 
-       retv_if(idx >= MAX_PAGE_NO, NULL);
+       retv_if(idx > MAX_PAGE_NO, NULL);
 
        box = evas_object_data_get(scroller, "box");
        retv_if(NULL == box, NULL);
@@ -943,7 +871,7 @@ Evas_Object *page_scroller_get_page_at(Evas_Object *scroller, unsigned int idx)
 
 
 
-unsigned int page_scroller_count_page(Evas_Object *scroller)
+HAPI unsigned int page_scroller_count_page(Evas_Object *scroller)
 {
        const Eina_List *page_list;
        Evas_Object *box;
@@ -959,7 +887,7 @@ unsigned int page_scroller_count_page(Evas_Object *scroller)
 
 
 
-int page_scroller_get_page_no(Evas_Object* scroller, Evas_Object *page)
+HAPI int page_scroller_get_page_no(Evas_Object* scroller, Evas_Object *page)
 {
        Evas_Object *item;
        Evas_Object *box;
@@ -990,7 +918,14 @@ int page_scroller_get_page_no(Evas_Object* scroller, Evas_Object *page)
 
 
 
-Evas_Object *page_scroller_find_item_by_package(Evas_Object *scroller, const char *package, int *page_no)
+HAPI int page_scroller_get_current_page_no(Evas_Object *scroller)
+{
+       return (int) evas_object_data_get(scroller, "current_idx");
+}
+
+
+
+HAPI Evas_Object *page_scroller_find_item_by_package(Evas_Object *scroller, const char *package, int *page_no)
 {
        register int i;
        register int j;
@@ -1031,18 +966,7 @@ Evas_Object *page_scroller_find_item_by_package(Evas_Object *scroller, const cha
 
 
 
-void _show(Evas_Object *scroller, int page)
-{
-       Evas_Coord w;
-       Evas_Coord h;
-
-       evas_object_geometry_get(scroller, NULL, NULL, &w, &h);
-       elm_scroller_region_show(scroller, page * w, 0, w, h);
-}
-
-
-
-void page_scroller_trim_items(Evas_Object *scroller)
+HAPI void page_scroller_trim_items(Evas_Object *scroller)
 {
        register unsigned int i;
        register unsigned int j;
@@ -1114,16 +1038,128 @@ void page_scroller_trim_items(Evas_Object *scroller)
 
 
 
-Evas_Object *_unpack_updated_item(Evas_Object *scroller, unsigned int page_no, unsigned int position_no)
+HAPI void page_scroller_edit(Evas_Object *scroller)
 {
        Evas_Object *page;
-       Evas_Object *temp;
+       Evas_Object *item;
+       register unsigned int page_no;
+       register unsigned int position_no;
+       unsigned int nr_of_pages;
+       int page_max_app;
+
+       nr_of_pages = page_scroller_count_page(scroller);
+       page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
+       for (page_no = 0; page_no < nr_of_pages; page_no ++) {
+               page = page_scroller_get_page_at(scroller, page_no);
+               if(!page) continue;
+
+               for (position_no = 0; position_no < page_max_app; position_no ++) {
+                       item = page_get_item_at(page, position_no);
+                       if (!item) {
+                               continue;
+                       }
+
+                       item_edit(item);
+               }
+       }
+       evas_object_data_set(scroller, "is_edited", (void *) true);
+}
+
+
+
+HAPI void page_scroller_unedit(Evas_Object *scroller)
+{
+       Evas_Object *all_apps;
+       Evas_Object *page;
+       Evas_Object *item;
+       register int page_no;
+       register unsigned int position_no;
+       unsigned int nr_of_pages;
+       int page_max_app;
+
+       ret_if(NULL == scroller);
+
+       all_apps = evas_object_data_get(scroller, "tab");
+       ret_if(NULL == all_apps);
+
+       nr_of_pages = page_scroller_count_page(scroller);
+       page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
+
+       for (page_no = nr_of_pages - 1; page_no >= 0; page_no --) {
+               page = page_scroller_get_page_at(scroller, page_no);
+               if(NULL == page) continue;
+
+               page_scroller_trim_items(scroller);
+
+               for (position_no = 0; position_no < page_max_app; position_no ++) {
+                       item = page_get_item_at(page, position_no);
+                       if (!item) {
+                               break;
+                       }
+
+                       item_unedit(item);
+               }
+       }
+
+       evas_object_data_set(scroller, "is_edited", (void *) false);
+}
 
-       retv_if(NULL == scroller, NULL);
-       page = page_scroller_get_page_at(scroller, page_no);
-       temp = page_unpack_item_at(page, (int) position_no);
 
-       return temp;
+
+HAPI bool page_scroller_is_edited(Evas_Object *scroller)
+{
+       return (bool) evas_object_data_get(scroller, "is_edited");
+}
+
+
+
+HAPI void page_scroller_focus(Evas_Object *scroller)
+{
+       int idx = 0;
+       idx = page_scroller_get_current_page_no(scroller);
+
+       Evas_Object *page = NULL;
+       page = page_scroller_get_page_at(scroller, (unsigned int) idx);
+       ret_if(NULL == page);
+
+       Evas_Object *item = NULL;
+       item = page_get_item_at(page, 0);
+       ret_if(NULL == item);
+
+       Evas_Object *focus_button = NULL;
+       focus_button = elm_object_part_content_get(item, "focus");
+       ret_if(NULL == focus_button);
+
+       _D("Focus set scroller(%p), page:%d, item:%s", scroller, idx, item_get_name(item));
+       elm_object_focus_set(focus_button, EINA_TRUE);
+}
+
+
+
+HAPI void page_scroller_focus_into_vector(Evas_Object *scroller, int vector)
+{
+       int idx = 0;
+       idx = page_scroller_get_current_page_no(scroller);
+       idx += vector;
+
+       ret_if(0 > idx);
+
+       Evas_Object *page = NULL;
+       page = page_scroller_get_page_at(scroller, (unsigned int) idx);
+       ret_if(NULL == page);
+
+       Evas_Object *item = NULL;
+       item = page_get_item_at(page, 0);
+       ret_if(NULL == item);
+
+       Evas_Object *focus_button = NULL;
+       focus_button = elm_object_part_content_get(item, "focus");
+       ret_if(NULL == focus_button);
+
+       _D("Focus set scroller(%p), page:%d, item:%s", scroller, idx, item_get_name(item));
+       elm_object_focus_set(focus_button, EINA_TRUE);
+
+       page_scroller_bring_in(scroller, idx);
 }
 
 
index f39a7c198ef2f33f16edc428fc9a1c9407b6431c..8ffe7ede78a644f202e4455cb9dfc63b8720ed0a 100644 (file)
@@ -1,31 +1,36 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 #include <package-manager.h>
+#include <pkgmgr-info.h>
 
 #include "conf.h"
-#include "index.h"
+#include "menu_screen.h"
 #include "item.h"
+#include "layout.h"
 #include "list.h"
 #include "page.h"
 #include "page_scroller.h"
-#include "mapbuf.h"
 #include "pkgmgr.h"
 #include "util.h"
 
@@ -36,226 +41,330 @@ struct pkgmgr_handler {
        int (*func)(const char *package, const char *val, void *data);
 };
 
+typedef struct {
+       char* package;
+       char* key;
+       char* val;
+} pkgmgr_reserve_s;
 
+typedef struct {
+       char* package;
+       char* status;
+} pkgmgr_request_s;
+
+typedef struct {
+       char* pkg_id;
+       char* app_id;
+       Evas_Object *item;
+} pkgmgr_install_s;
 
 static struct {
        pkgmgr_client *listen_pc;
+       Eina_List *reserve_list;
+       Eina_List *request_list;
+       Eina_List *item_list;
 } pkg_mgr_info = {
        .listen_pc = NULL,
+       .reserve_list = NULL,
+       .request_list = NULL,
+       .item_list = NULL,
 };
 
 
 
-inline menu_screen_error_e pkgmgr_uninstall(Evas_Object *item)
+static menu_screen_error_e _append_request_in_list(const char *package, const char *status)
 {
-       pkgmgr_client *req_pc = NULL;
-       int ret = MENU_SCREEN_ERROR_OK;
+       retv_if(NULL == package, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == status, MENU_SCREEN_ERROR_INVALID_PARAMETER);
 
-       retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
+       pkgmgr_request_s *rt = calloc(1, sizeof(pkgmgr_request_s));
+       retv_if(NULL == rt, MENU_SCREEN_ERROR_FAIL);
 
-       req_pc = pkgmgr_client_new(PC_REQUEST);
-       retv_if(NULL == req_pc, MENU_SCREEN_ERROR_FAIL);
+       rt->package = strdup(package);
+       goto_if(NULL == rt->package, ERROR);
 
-       if (pkgmgr_client_uninstall(req_pc, NULL, item_get_package(item), PM_DEFAULT, NULL, NULL) < 0) {
-               _E("cannot uninstall %s.", item_get_package(item));
-               ret = MENU_SCREEN_ERROR_FAIL;
+       rt->status = strdup(status);
+       goto_if(NULL == rt->status, ERROR);
+
+       pkg_mgr_info.request_list = eina_list_append(pkg_mgr_info.request_list, rt);
+       goto_if(NULL == pkg_mgr_info.request_list, ERROR);
+
+       return MENU_SCREEN_ERROR_OK;
+
+ERROR:
+       if (rt->status) free(rt->status);
+       if (rt->package) free(rt->package);
+       if (rt) free(rt);
+
+       return MENU_SCREEN_ERROR_FAIL;
+}
+
+
+
+static menu_screen_error_e _remove_request_in_list(const char *package)
+{
+       retv_if(NULL == package, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       if (NULL == pkg_mgr_info.request_list) return MENU_SCREEN_ERROR_OK;
+
+       const Eina_List *l = NULL;
+       const Eina_List *ln = NULL;
+       pkgmgr_request_s *rt = NULL;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.request_list, l, ln, rt) {
+               if (!rt) continue;
+               if (!rt->package) continue;
+               if (strcmp(rt->package, package)) continue;
+
+               pkg_mgr_info.request_list = eina_list_remove(pkg_mgr_info.request_list, rt);
+               free(rt->package);
+               if (rt->status) free(rt->status);
+               free(rt);
+               return MENU_SCREEN_ERROR_OK;
        }
 
-       if (pkgmgr_client_free(req_pc) != PKGMGR_R_OK) {
-               _E("cannot free pkgmgr_client for request.");
+       return MENU_SCREEN_ERROR_FAIL;
+}
+
+
+
+static int _exist_request_in_list(const char *package)
+{
+       retv_if(NULL == package, 0);
+
+       if (NULL == pkg_mgr_info.request_list) return 0;
+
+       const Eina_List *l = NULL;
+       const Eina_List *ln = NULL;
+       pkgmgr_request_s *rt = NULL;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.request_list, l, ln, rt) {
+               if (!rt) continue;
+               if (!rt->package) continue;
+               if (strcmp(rt->package, package)) continue;
+               return 1;
        }
 
-       return ret;
+       return 0;
 }
 
 
 
-static menu_screen_error_e _start_download(const char *package, void *scroller)
+static pkgmgr_request_s *_get_request_in_list(const char *package)
 {
-       struct package_info *pi;
-       Eina_List *install_list;
+       retv_if(NULL == package, NULL);
 
-       install_list = evas_object_data_get(scroller, "install_list");
-       pi = calloc(1, sizeof(struct package_info));
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
+       if (NULL == pkg_mgr_info.request_list) return NULL;
 
-       pi->status = DOWNLOAD_BEGIN;
-       pi->ai.package = strdup(package);
-       pi->ai.name = strdup("Download");
+       const Eina_List *l = NULL;
+       const Eina_List *ln = NULL;
+       pkgmgr_request_s *rt = NULL;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.request_list, l, ln, rt) {
+               if (!rt) continue;
+               if (!rt->package) continue;
+               if (strcmp(rt->package, package)) continue;
+               return rt;
+       }
 
-       install_list = eina_list_append(install_list, pi);
-       evas_object_data_set(scroller, "install_list", install_list);
-       _D("Package [%s] is jump into the downloading phase", package);
+       return NULL;
+}
+
+
+
+HAPI menu_screen_error_e pkgmgr_item_list_append_item(const char *pkg_id, const char *app_id, Evas_Object *item)
+{
+       retv_if(NULL == pkg_id, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == app_id, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == item, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       char *tmp_pkg_id = NULL;
+       char *tmp_app_id = NULL;
+
+       pkgmgr_install_s *pi = calloc(1, sizeof(pkgmgr_install_s));
+       goto_if(NULL == pi, ERROR);
+
+       tmp_pkg_id = strdup(pkg_id);
+       goto_if(NULL == tmp_pkg_id, ERROR);
+
+       tmp_app_id = strdup(app_id);
+       goto_if(NULL == tmp_app_id, ERROR);
+
+       pi->pkg_id = tmp_pkg_id;
+       pi->app_id = tmp_app_id;
+       pi->item = item;
+
+       pkg_mgr_info.item_list = eina_list_append(pkg_mgr_info.item_list, pi);
+       goto_if(NULL == pkg_mgr_info.item_list, ERROR);
 
        return MENU_SCREEN_ERROR_OK;
+
+ERROR:
+       if (tmp_app_id) free(tmp_app_id);
+       if (tmp_pkg_id) free(tmp_pkg_id);
+       free(pi);
+
+       return MENU_SCREEN_ERROR_FAIL;
 }
 
 
 
-static menu_screen_error_e _start_uninstall(const char *package, void *scroller)
+HAPI menu_screen_error_e pkgmgr_item_list_remove_item(const char *pkg_id, const char *app_id, Evas_Object *item)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       int page_no = 0;
-       struct package_info *pi = NULL;
-       Eina_List *install_list;
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
-       }
+       retv_if(NULL == pkg_id, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == app_id, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == item, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       const Eina_List *l = NULL;
+       const Eina_List *ln = NULL;
+       pkgmgr_install_s *pi = NULL;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.item_list, l, ln, pi) {
+               continue_if(NULL == pi);
+               continue_if(NULL == pi->pkg_id);
+               continue_if(NULL == pi->app_id);
+               continue_if(NULL == pi->item);
+
+               if (strcmp(pi->pkg_id, pkg_id)) continue;
+               if (strcmp(pi->app_id, app_id)) continue;
+               if (pi->item != item) continue;
+
+               pkg_mgr_info.item_list = eina_list_remove(pkg_mgr_info.item_list, pi);
+
+               free(pi->app_id);
+               free(pi->pkg_id);
+               free(pi);
 
-       retv_if(pi, MENU_SCREEN_ERROR_FAIL);
+               return MENU_SCREEN_ERROR_OK;
+       }
 
-       pi = calloc(1, sizeof(struct package_info));
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
+       return MENU_SCREEN_ERROR_FAIL;
+}
 
-       pi->status = UNINSTALL_BEGIN;
-       pi->ai.package = strdup(package);
-       pi->ai.nodisplay = false;
-       pi->item = page_scroller_find_item_by_package(scroller, package, &page_no);
-       pi->page = page_scroller_get_page_at(scroller, page_no);
 
-       install_list = eina_list_append(install_list, pi);
-       evas_object_data_set(scroller, "install_list", install_list);
 
-       return MENU_SCREEN_ERROR_OK;
+HAPI void pkgmgr_item_list_affect_pkgid(const char *pkg_id, Eina_Bool (*_affected_cb)(const char *, Evas_Object *, void *), void *data)
+{
+       ret_if(NULL == pkg_mgr_info.item_list);
+       ret_if(NULL == pkg_id);
+       ret_if(NULL == _affected_cb);
+
+       const Eina_List *l;
+       const Eina_List *ln;
+       pkgmgr_install_s *pi;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.item_list, l, ln, pi) {
+               continue_if(NULL == pi);
+               continue_if(NULL == pi->app_id);
+               continue_if(NULL == pi->item);
+
+               if (strcmp(pkg_id, pi->pkg_id)) continue;
+               /* It's possible that many items with the same package name are in the install list */
+               continue_if(EINA_TRUE != _affected_cb(pi->app_id, pi->item, data));
+       }
 }
 
 
 
-static menu_screen_error_e _start_update(const char *package, void *scroller)
+HAPI void pkgmgr_item_list_affect_appid(const char *app_id, Eina_Bool (*_affected_cb)(const char *, Evas_Object *, void *), void *data)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi = NULL;
-       Eina_List *install_list;
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
+       ret_if(NULL == pkg_mgr_info.item_list);
+       ret_if(NULL == app_id);
+       ret_if(NULL == _affected_cb);
+
+       const Eina_List *l;
+       const Eina_List *ln;
+       pkgmgr_install_s *pi;
+       EINA_LIST_FOREACH_SAFE(pkg_mgr_info.item_list, l, ln, pi) {
+               continue_if(NULL == pi);
+               continue_if(NULL == pi->app_id);
+               continue_if(NULL == pi->item);
+
+               if (strcmp(app_id, pi->app_id)) continue;
+               /* It's possible that many items with the same package name are in the install list */
+               if (EINA_FALSE == _affected_cb(pi->app_id, pi->item, data)) break;
        }
+}
 
-       if (!pi) {
-               int page_no = 0;
-               _D("Package [%s] is starting update phase directly (without downloading phase)", package);
 
-               pi = calloc(1, sizeof(struct package_info));
-               retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
 
-               pi->ai.package = strdup(package);
-               pi->item = page_scroller_find_item_by_package(scroller, package, &page_no);
-               if (pi->item) {
-                       pi->page = page_scroller_get_page_at(scroller, page_no);
-               }
+HAPI inline menu_screen_error_e pkgmgr_uninstall(Evas_Object *item)
+{
+       char *pkgid = NULL;
+       char *appid = NULL;
+       pkgmgr_client *req_pc = NULL;
+       pkgmgrinfo_appinfo_h handle = NULL;
+       int ret = MENU_SCREEN_ERROR_OK;
 
-               if (pi->item && pi->page) {
-                       pi->ai.nodisplay = false;
-               }
+       retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL);
 
-               install_list = eina_list_append(install_list, pi);
-               evas_object_data_set(scroller, "install_list", install_list);
-       } else {
-               if (pi->status != DOWNLOAD_END) {
-                       _D("Package [%s] is in invalid state (%d), cancel this", package, pi->status);
-                       install_list = eina_list_remove(install_list, pi);
-                       evas_object_data_set(scroller, "install_list", install_list);
-                       if (pi->item) {
-                               page_unpack_item(pi->page, pi->item);
-                               page_trim_items(pi->page);
-                               item_destroy(pi->item);
-                       }
-
-                       list_free_values(&pi->ai);
-                       free(pi);
-                       return MENU_SCREEN_ERROR_FAIL;
+       pkgid = item_get_pkgid(item);
+       retv_if(NULL == pkgid, MENU_SCREEN_ERROR_FAIL);
+
+       appid = item_get_package(item);
+       retv_if(NULL == appid, MENU_SCREEN_ERROR_FAIL);
+
+       req_pc = pkgmgr_client_new(PC_REQUEST);
+       retv_if(NULL == req_pc, MENU_SCREEN_ERROR_FAIL);
+
+       if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_appinfo(appid, &handle)) {
+               if (PKGMGR_R_OK != pkgmgr_client_free(req_pc)) {
+                       _E("cannot free pkgmgr_client for request.");
                }
+               return MENU_SCREEN_ERROR_FAIL;
        }
 
-       pi->status = UPDATE_BEGIN;
-       pi->ai.name = strdup("Update");
-       if (pi->item) {
-               item_set_name(pi->item, pi->ai.name, 0);
+       if (PMINFO_R_OK != pkgmgrinfo_appinfo_destroy_appinfo(handle)) {
+               _E("cannot destroy the appinfo");
+               ret = MENU_SCREEN_ERROR_FAIL;
        }
 
-       _D("Package [%s] is jump into the updating phase", package);
+       _D("Uninstall a package[%s] from an app[%s]", pkgid, appid);
+       if (pkgmgr_client_uninstall(req_pc, NULL, pkgid, PM_QUIET, NULL, NULL) < 0) {
+               _E("cannot uninstall %s.", item_get_package(item));
+               ret = MENU_SCREEN_ERROR_FAIL;
+       }
 
+       if (PMINFO_R_OK != pkgmgr_client_free(req_pc)) {
+               _E("cannot free pkgmgr_client");
+               ret = MENU_SCREEN_ERROR_FAIL;
+       }
+
+       return ret;
+}
+
+
+
+static menu_screen_error_e _start_download(const char *package, void *scroller)
+{
+       _D("Start downloading for the package(%s)", package);
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-static menu_screen_error_e _start_recover(const char *package, void *scroller)
+static menu_screen_error_e _start_uninstall(const char *package, void *scroller)
 {
+       _D("Start uninstalling for the package(%s)", package);
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-static menu_screen_error_e _start_install(const char *package, void *scroller)
+static menu_screen_error_e _start_update(const char *package, void *scroller)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi = NULL;
-       Eina_List *install_list;
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
-       }
+       _D("Start updating for the package(%s)", package);
+       return MENU_SCREEN_ERROR_OK;
+}
 
-       if (!pi) {
-               int page_no = 0;
-               _D("Package [%s] is starting install phase directly (without downloading phase)", package);
-               pi = calloc(1, sizeof(struct package_info));
-               retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
 
-               pi->ai.package = strdup(package);
-               pi->item = page_scroller_find_item_by_package(scroller, package, &page_no);
-               if (pi->item) {
-                       pi->page = page_scroller_get_page_at(scroller, page_no);
-               }
 
-               if (pi->item && pi->page) {
-                       pi->ai.nodisplay = false;
-               }
+static menu_screen_error_e _start_recover(const char *package, void *scroller)
+{
+       _D("Start recovering for the package(%s)", package);
+       return MENU_SCREEN_ERROR_OK;
+}
 
-               install_list = eina_list_append(install_list, pi);
-               evas_object_data_set(scroller, "install_list", install_list);
-       } else {
-               if (pi->status != DOWNLOAD_END) {
-                       _D("Package [%s] is in invalid state (%d), cancel this", package, pi->status);
-                       install_list = eina_list_remove(install_list, pi);
-                       evas_object_data_set(scroller, "install_list", install_list);
-                       if (pi->item) {
-                               page_unpack_item(pi->page, pi->item);
-                               page_trim_items(pi->page);
-                               item_destroy(pi->item);
-                       }
-
-                       list_free_values(&pi->ai);
-                       free(pi);
-                       return MENU_SCREEN_ERROR_FAIL;
-               }
-       }
 
-       pi->status = INSTALL_BEGIN;
-       pi->ai.name = strdup("Install");
-       if (pi->item) {
-               // Update app name to install
-               item_set_name(pi->item, pi->ai.name, 0);
-       }
-       _D("Package [%s] is jump into the installing phase", package);
 
+static menu_screen_error_e _start_install(const char *package, void *scroller)
+{
+       _D("Start installing for the package(%s)", package);
        return MENU_SCREEN_ERROR_OK;
 }
 
@@ -293,18 +402,18 @@ static menu_screen_error_e _start(const char *package, const char *val, void *sc
                },
        };
 
-       register unsigned int i;
-
-       _D("package [%s]", package);
+       _D("package [%s], val [%s]", package, val);
+       retv_if(_exist_request_in_list(package), MENU_SCREEN_ERROR_FAIL);
+       retv_if(MENU_SCREEN_ERROR_OK != _append_request_in_list(package, val), MENU_SCREEN_ERROR_FAIL);
 
+       register unsigned int i;
        for (i = 0; start_cb[i].name; i ++) {
-               if (!strcasecmp(val, start_cb[i].name) && start_cb[i].handler) {
-                       return start_cb[i].handler(package, scroller);
-               }
+               if (strcasecmp(val, start_cb[i].name)) continue;
+               break_if(NULL == start_cb[i].handler);
+               return start_cb[i].handler(package, scroller);
        }
 
-       _D("Unknown status for starting phase signal'd from package manager");
-
+       _E("Unknown status for starting phase signal'd from package manager");
        return MENU_SCREEN_ERROR_OK;
 }
 
@@ -312,44 +421,7 @@ static menu_screen_error_e _start(const char *package, const char *val, void *sc
 
 static menu_screen_error_e _icon_path(const char *package, const char *val, void *scroller)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi = NULL;
-       Eina_List *install_list;
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       retv_if(!package, MENU_SCREEN_ERROR_FAIL);
-       retv_if(!val, MENU_SCREEN_ERROR_FAIL);
-
-       _D("package [%s] with %s", package, val);
-
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
-       }
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
-
-       if (strlen(val)) {
-               pi->ai.icon = strdup(val);
-               retv_if (NULL == pi->ai.icon, MENU_SCREEN_ERROR_OUT_OF_MEMORY);
-
-               if (!pi->item) {
-                       pi->ai.nodisplay = false;
-
-                       if (MENU_SCREEN_ERROR_FAIL == page_scroller_push_item(scroller, &pi->ai)) {
-                               _E("Failed to create a new item, remove this package from the installing list");
-                               list_free_values(&pi->ai);
-                               install_list = eina_list_remove(install_list, pi);
-                               evas_object_data_set(scroller, "install_list", install_list);
-                               free(pi);
-                       }
-               } else {
-                       item_update(pi->item, &pi->ai);
-               }
-       }
-
+       _D("package(%s) with %s", package, val);
        return MENU_SCREEN_ERROR_OK;
 }
 
@@ -357,39 +429,7 @@ static menu_screen_error_e _icon_path(const char *package, const char *val, void
 
 static menu_screen_error_e _download_percent(const char *package, const char *val, void *scroller)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi = NULL;
-       Eina_List *install_list;
-
-       _D("package [%s] with %s", package, val);
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
-       }
-
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
-
-       if (pi->status == DOWNLOAD_BEGIN) {
-               pi->status = DOWNLOADING;
-       } else if (pi->status == DOWNLOADING) {
-               // Do nothing, just we are in proper state
-       } else {
-               _D("Invalid state for %s, This is not started from the download_begin state(%s)", package, val);
-       }
-
-       if (!pi->ai.nodisplay && pi->item) {
-               if (!item_is_enabled_progress(pi->item)) {
-                       item_enable_progress(pi->item);
-               }
-
-               item_update_progress(pi->item, atoi(val));
-       }
-
+       _D("package(%s) with %s", package, val);
        return MENU_SCREEN_ERROR_OK;
 }
 
@@ -397,51 +437,9 @@ static menu_screen_error_e _download_percent(const char *package, const char *va
 
 static menu_screen_error_e _install_percent(const char *package, const char *val, void *scroller)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi;
-       int progress;
-       Eina_List *install_list;
-
-       _D("package [%s] with %s", package, val);
-
-       pi = NULL;
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-
-               pi = NULL;
-       }
-
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
-
-       progress = atoi(val);
-
-       if (pi->status == INSTALL_BEGIN) {
-               pi->status = INSTALLING;
-       } else if (pi->status == UNINSTALL_BEGIN) {
-               progress = 100 - progress;
-               pi->status = UNINSTALLING;
-       } else if (pi->status == UPDATE_BEGIN) {
-               pi->status = UPDATING;
-       } else if (pi->status == INSTALLING) {
-       } else if (pi->status == UNINSTALLING) {
-               progress = 100 - progress;
-       } else if (pi->status == UPDATING) {
-       } else {
-               _D("Invalid state for %s, This is not the uninstall or install_begin state(%s)", package, val);
-       }
-
-       if (!pi->ai.nodisplay && pi->item) {
-               if (!item_is_enabled_progress(pi->item)) {
-                       item_enable_progress(pi->item);
-               }
-
-               item_update_progress(pi->item, progress);
-       }
-
+       _D("package(%s) with %s", package, val);
+       if (_exist_request_in_list(package)) return MENU_SCREEN_ERROR_OK;
+       retv_if(MENU_SCREEN_ERROR_OK != _append_request_in_list(package, "install"), MENU_SCREEN_ERROR_FAIL);
        return MENU_SCREEN_ERROR_OK;
 }
 
@@ -449,247 +447,115 @@ static menu_screen_error_e _install_percent(const char *package, const char *val
 
 static menu_screen_error_e _error(const char *package, const char *val, void *scroller)
 {
-       struct package_info *pi = NULL;
-       Eina_List *l;
-       Eina_List *tmp;
-       Eina_List *install_list;
-
-       _D("package [%s] with %s", package, val);
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-
-               pi = NULL;
-       }
-
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
-
-       pi->error_count ++;
+       _D("package(%s) with %s", package, val);
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-static menu_screen_error_e _end_downloading(const char *package, struct package_info *pi, void *scroller)
+static int _end_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
 {
-       pi->status = DOWNLOAD_END;
-       _D("Package downloading is complete, waiting install progress");
-       return MENU_SCREEN_ERROR_OK;
-}
+       retv_if(NULL == handle, -1);
+       retv_if(NULL == user_data, -1);
 
+       char *appid = NULL;
+       pkgmgrinfo_appinfo_get_appid(handle, &appid);
 
+       Evas_Object *layout = evas_object_data_get(menu_screen_get_win(), "layout");
+       retv_if(NULL == layout, MENU_SCREEN_ERROR_FAIL);
 
-static menu_screen_error_e _end_installing(const char *package, struct package_info *pi, void *scroller)
-{
-       // This status will not be referenced from the others.
-       // because it will be freed right after set it. ;)
-       Eina_List *install_list;
-
-       pi->status = INSTALL_END;
-       _D("Package installing is complete");
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       if (pi->desktop_file_found == 1) {
-               install_list = eina_list_remove(install_list, pi);
-               evas_object_data_set(scroller, "install_list", install_list);
-               list_free_values(&pi->ai);
-               free(pi);
+       pkgmgr_request_s *rt = user_data;
+       if (!strcmp(rt->status, "install")) {
+               layout_create_package(layout, appid);
+       } else if (!strcmp(rt->status, "update")) {
+               layout_update_package(layout, appid);
+       } else {
+               _E("No routines for this status (%s:%s)", rt->package, rt->status);
        }
 
-
-       // TODO: Need to register a timer callback
-       return MENU_SCREEN_ERROR_OK;
+       return 0;
 }
 
 
 
-static menu_screen_error_e _end_updating(const char *package, struct package_info *pi, void *scroller)
+static Eina_Bool _uninstall_cb(const char *app_id, Evas_Object *item, void *data)
 {
-       // This status will not be referenced from the others.
-       // because it will be freed right after set it. ;)
-       Eina_List *install_list;
-
-       pi->status = UPDATE_END;
-       _D("Package updating is complete");
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       if (pi->desktop_file_found == 1) {
-               install_list = eina_list_remove(install_list, pi);
-               evas_object_data_set(scroller, "install_list", install_list);
-               list_free_values(&pi->ai);
-               free(pi);
-       }
+       retv_if(NULL == data, EINA_FALSE);
 
+       Evas_Object *layout = data;
+       layout_delete_package(layout, app_id);
 
-       // TODO: Need to register a timer callback
-       return MENU_SCREEN_ERROR_OK;
+       return EINA_TRUE;
 }
 
 
 
-static menu_screen_error_e _end_uninstalling(const char *package, struct package_info *pi, void *scroller)
+static Eina_Bool _set_removable_cb(const char *app_id, Evas_Object *item, void *data)
 {
-       Eina_List *install_list;
-
-       pi->status = UNINSTALL_END;
-       _D("Package uninstalling is complete");
+       retv_if(NULL == item, EINA_FALSE);
 
-       install_list = evas_object_data_get(scroller, "install_list");
-       if (pi->desktop_file_found == 1) {
-               install_list = eina_list_remove(install_list, pi);
-               evas_object_data_set(scroller, "install_list", install_list);
-               list_free_values(&pi->ai);
-               free(pi);
-       }
+       item_set_removable(item, 1, 0);
+       elm_object_signal_emit(item, "uninstall,on", "menu");
 
-       return MENU_SCREEN_ERROR_OK;
+       return EINA_TRUE;
 }
 
 
 
-static menu_screen_error_e _end_unknown(const char *package, struct package_info *pi, void *scroller)
+static menu_screen_error_e _end(const char *package, const char *val, void *data)
 {
-       Eina_List *install_list;
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       install_list = eina_list_remove(install_list, pi);
-       evas_object_data_set(scroller, "install_list", install_list);
-
-       if (pi->item) {
-               // Remove an item only if it is installing.
-               if (
-                       pi->status == INSTALL_BEGIN || pi->status == INSTALLING || pi->status == INSTALL_END ||
-                       pi->status == DOWNLOAD_BEGIN || pi->status == DOWNLOADING || pi->status == DOWNLOAD_END ||
-                       pi->status == UPDATE_BEGIN || pi->status == UPDATING || pi->status == UPDATE_END
-               )
-               {
-                       if (pi->page) {
-                               page_unpack_item(pi->page, pi->item);
-                               page_trim_items(pi->page);
-                       } else {
-                               _D("Page is not valid (%s)", package);
-                       }
-                       item_destroy(pi->item);
-                       page_scroller_trim_items(scroller);
-               }
-       }
+       pkgmgrinfo_pkginfo_h handle = NULL;
 
-       list_free_values(&pi->ai);
-       free(pi);
+       retv_if(!_exist_request_in_list(package), MENU_SCREEN_ERROR_FAIL);
 
-       return MENU_SCREEN_ERROR_OK;
-}
+       pkgmgr_request_s *rt = _get_request_in_list(package);
+       retv_if(NULL == rt, MENU_SCREEN_ERROR_FAIL);
+       if(strcasecmp(val, "ok")) {
+               pkgmgr_item_list_affect_pkgid(package, _set_removable_cb, NULL);
+               _E("cannot end that package(%s) is %s", rt->package, rt->status);
 
+               goto ERROR;
+       }
 
+       _D("Package(%s) : key(%s) - val(%s)", package, rt->status, val);
 
-static menu_screen_error_e _end(const char *package, const char *val, void *scroller)
-{
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi;
-       register int i;
-       struct end_cb_set {
-               int status;
-               int (*handler)(const char *package, struct package_info *pi, void *scroller);
-       } end_cb[] = {
-               {
-                       .status = DOWNLOADING,
-                       .handler = _end_downloading,
-               },
-               {
-                       .status = INSTALLING,
-                       .handler = _end_installing,
-               },
-               {
-                       .status = UNINSTALLING,
-                       .handler = _end_uninstalling,
-               },
-               {
-                       .status = UPDATING,
-                       .handler = _end_updating,
-               },
-               {
-                       .status = UNKNOWN,
-                       .handler = _end_unknown,
-               },
-               {
-                       .status = MAX_STATUS,
-                       .handler = NULL,
-               },
-       };
-       Eina_List *install_list;
+       /* Criteria : pkgid */
+       if (!strcasecmp("uninstall", rt->status)) {
+               Evas_Object *layout = evas_object_data_get(menu_screen_get_win(), "layout");
+               goto_if(NULL == layout, ERROR);
 
-       _D("package [%s]", package);
-
-       pi = NULL;
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       break;
-               }
-               pi = NULL;
+               pkgmgr_item_list_affect_pkgid(package, _uninstall_cb, layout);
+               goto OUT;
        }
 
-       retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL);
+       goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_pkginfo(package, &handle), ERROR);
 
-       if (item_is_enabled_progress(pi->item)) {
-               item_disable_progress(pi->item);
+       /* Criteria : appid */
+       if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, _end_cb, rt)) {
+               goto ERROR;
        }
 
-       // NOTE: Don't release the 'pi'
-       //       Release it from each handler
-       for (i = 0; end_cb[i].handler; i ++) {
-               if (end_cb[i].status == pi->status && end_cb[i].handler) {
-                       int ret;
+OUT:
+       if (MENU_SCREEN_ERROR_OK != _remove_request_in_list(package))
+               _E("cannot remove a request(%s:%s)", rt->package, rt->status);
+       if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
 
-                       if (strcasecmp(val, "ok")) {
-                               ret = _end_unknown(package, pi, scroller);
-                       } else {
-                               ret = end_cb[i].handler(package, pi, scroller);
-                       }
+       return MENU_SCREEN_ERROR_OK;
 
-                       return ret;
-               }
-       }
+ERROR:
+       if (MENU_SCREEN_ERROR_OK != _remove_request_in_list(package))
+               _E("cannot remove a request(%s:%s)", rt->package, rt->status);
+       if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
 
-       return _end_unknown(package, pi, scroller);
+       return MENU_SCREEN_ERROR_FAIL;
 }
 
 
 
 static menu_screen_error_e _change_pkg_name(const char *package, const char *val, void *scroller)
 {
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi;
-       Eina_List *install_list;
-
-       _D("package [%s]", package);
-
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (!pi) {
-                       continue;
-               }
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       _D("Replace package name %s to %s", pi->ai.package, val);
-                       free(pi->ai.package);
-                       pi->ai.package = strdup(val);
-                       if (!pi->ai.package) {
-                               _E("cannot strdup");
-                               return MENU_SCREEN_ERROR_FAIL;
-                       }
-                       if (pi->item) {
-                               item_set_package(pi->item, (char*) val, 0);
-                       }
-                       return MENU_SCREEN_ERROR_OK;
-               }
-       }
-
-       return MENU_SCREEN_ERROR_FAIL;
+       _D("package(%s) with %s", package, val);
+       return MENU_SCREEN_ERROR_OK;
 }
 
 
@@ -710,21 +576,23 @@ static struct pkgmgr_handler pkgmgr_cbs[] = {
 static menu_screen_error_e _pkgmgr_cb(int req_id, const char *pkg_type, const char *package, const char *key, const char *val, const void *pmsg, void *data)
 {
        register unsigned int i;
-       Evas_Object *scroller = data;
 
-       _D("pkgmgr request [%s] for %s, val(%s)", key, package, val);
+       _D("pkgmgr request [%s:%s] for %s", key, val, package);
+
+       if (BOOTING_STATE_DONE > menu_screen_get_booting_state()) {
+               pkgmgr_reserve_list_push_request(package, key, val);
+               return MENU_SCREEN_ERROR_OK;
+       }
 
        for (i = 0; i < sizeof(pkgmgr_cbs) / sizeof(struct pkgmgr_handler); i++) {
-               if (!strcasecmp(pkgmgr_cbs[i].key, key)) {
-                       if (pkgmgr_cbs[i].func) {
-                               if (MENU_SCREEN_ERROR_OK != pkgmgr_cbs[i].func(package, val, scroller)) {
-                                       _E("pkgmgr_cbs[%u].func has errors.", i);
-                               }
-                       } else {
-                               _E("Cannot find pkgmgr_cbs[%u].func.", i);
-                       }
-                       return MENU_SCREEN_ERROR_OK;
+               if (strcasecmp(pkgmgr_cbs[i].key, key)) continue;
+               break_if(!pkgmgr_cbs[i].func);
+
+               if (MENU_SCREEN_ERROR_OK != pkgmgr_cbs[i].func(package, val, NULL)) {
+                       _E("pkgmgr_cbs[%u].func has errors.", i);
                }
+
+               return MENU_SCREEN_ERROR_OK;
        }
 
        return MENU_SCREEN_ERROR_FAIL;
@@ -732,7 +600,76 @@ static menu_screen_error_e _pkgmgr_cb(int req_id, const char *pkg_type, const ch
 
 
 
-menu_screen_error_e pkgmgr_init(Evas_Object *scroller)
+HAPI menu_screen_error_e pkgmgr_reserve_list_push_request(const char *package, const char *key, const char *val)
+{
+       retv_if(NULL == package, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == key, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == val, MENU_SCREEN_ERROR_INVALID_PARAMETER);
+
+       char *tmp_package = NULL;
+       char *tmp_key = NULL;
+       char *tmp_val = NULL;
+
+       pkgmgr_reserve_s *pr = calloc(1, sizeof(pkgmgr_reserve_s));
+       retv_if(NULL == pr, MENU_SCREEN_ERROR_FAIL);
+
+       tmp_package = strdup(package);
+       goto_if(NULL == tmp_package, ERROR);
+       pr->package = tmp_package;
+
+       tmp_key = strdup(key);
+       goto_if(NULL == tmp_key, ERROR);
+       pr->key = tmp_key;
+
+       tmp_val = strdup(val);
+       goto_if(NULL == tmp_val, ERROR);
+       pr->val = tmp_val;
+
+       pkg_mgr_info.reserve_list = eina_list_append(pkg_mgr_info.reserve_list, pr);
+       goto_if(NULL == pkg_mgr_info.reserve_list, ERROR);
+
+       return MENU_SCREEN_ERROR_OK;
+
+ERROR:
+       if (tmp_val) free(tmp_val);
+       if (tmp_key) free(tmp_key);
+       if (tmp_package) free(tmp_package);
+       free(pr);
+
+       return MENU_SCREEN_ERROR_FAIL;
+}
+
+
+
+HAPI menu_screen_error_e pkgmgr_reserve_list_pop_request(void)
+{
+       if (!pkg_mgr_info.reserve_list) return MENU_SCREEN_ERROR_NO_DATA;
+
+       pkgmgr_reserve_s *pr = eina_list_nth(pkg_mgr_info.reserve_list, 0);
+       if (!pr) return MENU_SCREEN_ERROR_NO_DATA;
+       pkg_mgr_info.reserve_list = eina_list_remove(pkg_mgr_info.reserve_list, pr);
+
+       goto_if(MENU_SCREEN_ERROR_OK != _pkgmgr_cb(0, NULL, pr->package, pr->key, pr->val, NULL, NULL), ERROR);
+
+       if (pr->package) free(pr->package);
+       if (pr->key) free(pr->key);
+       if (pr->val) free(pr->val);
+       free(pr);
+
+       return MENU_SCREEN_ERROR_OK;
+
+ERROR:
+       if (pr->package) free(pr->package);
+       if (pr->key) free(pr->key);
+       if (pr->val) free(pr->val);
+       free(pr);
+
+       return MENU_SCREEN_ERROR_FAIL;
+}
+
+
+
+HAPI menu_screen_error_e pkgmgr_init(void)
 {
        if (NULL != pkg_mgr_info.listen_pc) {
                return MENU_SCREEN_ERROR_OK;
@@ -741,14 +678,14 @@ menu_screen_error_e pkgmgr_init(Evas_Object *scroller)
        pkg_mgr_info.listen_pc = pkgmgr_client_new(PC_LISTENING);
        retv_if(NULL == pkg_mgr_info.listen_pc, MENU_SCREEN_ERROR_FAIL);
        retv_if(pkgmgr_client_listen_status(pkg_mgr_info.listen_pc,
-                       _pkgmgr_cb, scroller) != PKGMGR_R_OK, MENU_SCREEN_ERROR_FAIL);
+                       _pkgmgr_cb, NULL) != PKGMGR_R_OK, MENU_SCREEN_ERROR_FAIL);
 
        return MENU_SCREEN_ERROR_OK;
 }
 
 
 
-void pkgmgr_fini(void)
+HAPI void pkgmgr_fini(void)
 {
        ret_if(NULL == pkg_mgr_info.listen_pc);
        if (pkgmgr_client_free(pkg_mgr_info.listen_pc) != PKGMGR_R_OK) {
@@ -759,50 +696,4 @@ void pkgmgr_fini(void)
 
 
 
-Evas_Object *pkgmgr_find_pended_object(const char *package, int with_desktop_file, Evas_Object *scroller, Evas_Object **page)
-{
-       Eina_List *l;
-       Eina_List *tmp;
-       struct package_info *pi;
-       Eina_List *install_list;
-
-       _D("package [%s]", package);
-
-       retv_if(NULL == package, NULL);
-       install_list = evas_object_data_get(scroller, "install_list");
-       EINA_LIST_FOREACH_SAFE(install_list, l, tmp, pi) {
-               if (!pi) {
-                       continue;
-               }
-               if (pi->ai.package && !strcmp(pi->ai.package, package)) {
-                       Evas_Object *item;
-                       _D("Installing(Downloading) package is found (%p)", pi->item);
-
-                       item = pi->item;
-
-                       if (with_desktop_file) {
-                               pi->desktop_file_found = 1;
-
-                               if (pi->status == INSTALL_END || pi->status == UNINSTALL_END || pi->status == UPDATE_END) {
-                                       install_list = eina_list_remove(install_list, pi);
-                                       evas_object_data_set(scroller, "install_list", install_list);
-                                       list_free_values(&pi->ai);
-                                       free(pi);
-                                       pi = NULL;
-                               }
-                       }
-
-                       if (page) {
-                               *page = pi ? pi->page : NULL;
-                       }
-                       return item;
-               }
-       }
-
-       _D("Failed to find a installing/downloading package");
-       return NULL;
-}
-
-
-
 // End of a file
index 38493837fc97d724c2aabf520a867f7c33bb1b53..8e3c3dc6bac1c199150be1fe59d695a0016fe4f7 100644 (file)
@@ -1,48 +1,92 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Elementary.h>
 
 #include "conf.h"
+#include "item.h"
 #include "menu_screen.h"
+#include "pkgmgr.h"
 #include "util.h"
+#include "all_apps/shortcut.h"
 
+#define BUFSZE 1024
+#define ELLIPSIS "..."
+#define STRSZE 128
 
 
-static void _response_cb(void *data, Evas_Object *obj, void *event_info)
-{
+
+static struct {
        Evas_Object *popup;
+} popup_info = {
+       .popup = NULL,
+};
+
+
 
+HAPI Evas_Object *popup_exist(void)
+{
+       return popup_info.popup;
+}
+
+
+
+HAPI void popup_destroy_all(void)
+{
+       void (*_destroy_popup)(void *data, Evas_Object *obj, void *event_info);
+
+       if (NULL == popup_info.popup) return;
+
+       _destroy_popup = evas_object_data_get(popup_info.popup, "func_destroy_popup");
+       if (_destroy_popup) _destroy_popup(popup_info.popup, NULL, NULL);
+
+       popup_info.popup = NULL;
+}
+
+
+
+static void _response_cb(void *data, Evas_Object *obj, void *event_info)
+{
        ret_if(NULL == data);
-       popup = data;
+
+       Evas_Object *popup = data;
+       evas_object_data_del(popup, "func_destroy_popup");
+       popup_info.popup = NULL;
+
        evas_object_del(evas_object_data_del(popup, "button"));
        evas_object_del(popup);
 }
 
 
 
-Evas_Object *popup_create(Evas_Object *parent, const char *warning)
+HAPI Evas_Object *popup_create_confirm(Evas_Object *parent, const char *warning)
 {
        Evas_Object *popup;
        Evas_Object *btn;
 
        retv_if(NULL == warning, NULL);
 
+       popup_destroy_all();
+
        popup = elm_popup_add(parent);
        retv_if(NULL == popup, NULL);
 
@@ -57,11 +101,152 @@ Evas_Object *popup_create(Evas_Object *parent, const char *warning)
 
        elm_object_part_content_set(popup, "button1", btn);
        evas_object_smart_callback_add(btn, "clicked", _response_cb, popup);
-
        evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
        elm_object_part_text_set(popup, "title,text", D_("IDS_COM_POP_WARNING"));
        elm_object_text_set(popup, warning);
+       elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
+       evas_object_show(popup);
+
+       evas_object_data_set(popup, "func_destroy_popup", _response_cb);
+       popup_info.popup = popup;
+
+       return popup;
+}
+
+
+
+static void _uninstall_no_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ret_if(NULL == data);
+
+       Evas_Object *popup = data;
+       evas_object_data_del(popup, "func_destroy_popup");
+       popup_info.popup = NULL;
+
+       evas_object_del(evas_object_data_del(popup, "button1"));
+       evas_object_del(evas_object_data_del(popup, "button2"));
+       evas_object_data_del(popup, "item");
+       evas_object_del(popup);
+}
+
+
+
+static void _uninstall_yes_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ret_if(NULL == data);
+
+       Evas_Object *popup = data;
+       evas_object_data_del(popup, "func_destroy_popup");
+       popup_info.popup = NULL;
+
+       Evas_Object *item;
+       item = evas_object_data_del(popup, "item");
+       ret_if(!item);
+
+       evas_object_del(evas_object_data_del(popup, "button1"));
+       evas_object_del(evas_object_data_del(popup, "button2"));
+       evas_object_del(popup);
+
+       bool is_shortcut = false;
+       is_shortcut = (bool) evas_object_data_get(item, "is_shortcut");
+
+       if (is_shortcut) {
+               all_apps_shortcut_remove(item);
+       } else {
+               if (MENU_SCREEN_ERROR_OK != pkgmgr_uninstall(item)) {
+                       _E("Cannot communicate with the pkgmgr-server.");
+               }
+       }
+}
+
+
+
+static char *_popup_set_name(Evas_Object *item)
+{
+       char *name;
+       char *get_name = item_get_name(item);
+       if(!get_name) get_name = item_get_package(item);
+       retv_if(NULL == get_name, NULL);
+
+       name = calloc(strlen(get_name)+1, sizeof(char));
+       retv_if(NULL == name, NULL);
+       strncpy(name, get_name, strlen(get_name));
+
+       if (strlen(name) > STRSZE) {
+               char *temp, *ellipsis = ELLIPSIS;
+
+               name = realloc(name, (STRSZE + strlen(ellipsis) + 1)*sizeof(char));
+               retv_if(NULL == name, NULL);
+
+               temp = name + STRSZE;
+
+               while (*ellipsis) *temp++ = *ellipsis++;
+               *temp = '\0';
+       }
+       return name;
+}
+
+
+
+#define IDS_AT_POP_UNINSTALL_PS_Q "IDS_AT_POP_UNINSTALL_PS_Q"
+HAPI Evas_Object *popup_create_uninstall(Evas_Object *parent, Evas_Object *item)
+{
+       Evas_Object *popup;
+       Evas_Object *btn1;
+       Evas_Object *btn2;
+       char warning[BUFSZE];
+
+       retv_if(!item, NULL);
+
+       popup_destroy_all();
+
+       popup = elm_popup_add(parent);
+       retv_if(NULL == popup, NULL);
+
+       evas_object_data_set(popup, "item", item);
+
+       btn1 = elm_button_add(popup);
+       if (NULL == btn1) {
+               evas_object_del(popup);
+               return NULL;
+       }
+       elm_object_style_set(btn1, "popup_button/default");
+       elm_object_text_set(btn1, D_("IDS_COM_SK_CANCEL"));
+       evas_object_data_set(popup, "button1", btn1);
+       elm_object_part_content_set(popup, "button1", btn1);
+       evas_object_smart_callback_add(btn1, "clicked", _uninstall_no_cb, popup);
+
+       btn2 = elm_button_add(popup);
+       if (NULL == btn2) {
+               evas_object_del(popup);
+               return NULL;
+       }
+       elm_object_style_set(btn2, "popup_button/default");
+       elm_object_text_set(btn2, D_("IDS_COM_SK_OK"));
+       evas_object_data_set(popup, "button2", btn2);
+       elm_object_part_content_set(popup, "button2", btn2);
+       evas_object_smart_callback_add(btn2, "clicked", _uninstall_yes_cb, popup);
+
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_data_set(popup, "func_destroy_popup", _uninstall_no_cb);
+       popup_info.popup = popup;
        evas_object_show(popup);
+       char *name = _popup_set_name(item);
+       retv_if(NULL == name, popup);
+
+       char *markup_name = elm_entry_utf8_to_markup(name);
+       if (NULL == markup_name) {
+               _E("(NULL == markup_name) -> %s() return", __func__);
+               free(name);
+               return popup;
+       }
+
+       snprintf(warning, sizeof(warning), _(IDS_AT_POP_UNINSTALL_PS_Q), markup_name);
+       free(name);
+       free(markup_name);
+
+       elm_object_text_set(popup, warning);
 
        return popup;
 }
index 7ec1f36865ee5393b9c04ad91b781471b3f10ec1..2f518bcaa002228483c17dada85354cd2cca78af 100644 (file)
@@ -1,20 +1,24 @@
- /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.tizenopensource.org/license
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
-
-
+/*
+ * MENU-SCREEN
+ *
+ * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ *          Junkyu Han <junkyu.han@samsung.com>
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <Evas.h>
 
@@ -22,7 +26,7 @@
 
 
 
-void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+HAPI void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        Evas_Coord x;
        Evas_Coord y;
@@ -35,14 +39,14 @@ void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_i
 
 
 
-void _evas_object_event_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+HAPI void _evas_object_event_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        _D("%s IS REMOVED!", (const char *) data);
 }
 
 
 
-void _evas_object_event_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+HAPI void _evas_object_event_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        Evas_Coord x;
        Evas_Coord y;
@@ -55,7 +59,7 @@ void _evas_object_event_move_cb(void *data, Evas *e, Evas_Object *obj, void *eve
 
 
 
-void _evas_object_event_show_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+HAPI void _evas_object_event_show_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        Evas_Coord x;
        Evas_Coord y;