From 711b54697c879e56845a05cc2d021f969142eb17 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sun, 1 Feb 2015 13:04:06 +0900 Subject: [PATCH] tizen 2.3 release --- AUTHORS | 1 + CMakeLists.txt | 31 +- LICENSE.Flora | 206 ----- NOTICE | 3 - data/CMakeLists.txt | 3 + data/edje/all_apps_portrait.edc | 62 +- data/edje/button_edit.edc | 57 +- data/edje/group_4x4_portrait.edc | 37 +- data/edje/index.edc | 35 +- data/edje/item_4x4.edc | 74 +- data/edje/layout_portrait.edc | 174 ++++- data/icons/org.tizen.menu-screen.png | Bin 0 -> 6016 bytes data/main_operation.launch | 2 + data/org.tizen.menu-screen.desktop.in | 7 - data/org.tizen.menu-screen.xml.in | 4 +- data/po/CMakeLists.txt | 13 +- data/po/ar.po | 3 +- data/po/az.po | 3 +- data/po/bg.po | 3 +- data/po/ca.po | 5 +- data/po/cs.po | 3 +- data/po/da.po | 3 +- data/po/de.po | 9 + data/po/el_GR.po | 3 +- data/po/en.po | 3 +- data/po/en_PH.po | 3 +- data/po/en_US.po | 3 +- data/po/es_ES.po | 5 +- data/po/es_US.po | 9 + data/po/et.po | 3 +- data/po/eu.po | 3 +- data/po/fi.po | 3 +- data/po/fr.po | 9 + data/po/fr_CA.po | 3 +- data/po/ga.po | 3 +- data/po/gl.po | 3 +- data/po/hi.po | 5 +- data/po/hr.po | 5 +- data/po/hu.po | 3 +- data/po/hy.po | 3 +- data/po/is.po | 3 +- data/po/it_IT.po | 3 +- data/po/ja_JP.po | 3 +- data/po/ka.po | 3 +- data/po/kk.po | 3 +- data/po/ko_KR.po | 3 +- data/po/lt.po | 3 +- data/po/lv.po | 3 +- data/po/mk.po | 3 +- data/po/nl.po | 9 + data/po/pl.po | 3 +- data/po/pt_BR.po | 5 +- data/po/pt_PT.po | 3 +- data/po/ro.po | 3 +- data/po/ru_RU.po | 3 +- data/po/sk.po | 3 +- data/po/sl.po | 3 +- data/po/sr.po | 3 +- data/po/sv.po | 3 +- data/po/tr_TR.po | 3 +- data/po/uk.po | 3 +- data/po/uz.po | 5 +- data/po/zh_CN.po | 3 +- data/po/zh_HK.po | 3 +- data/po/zh_TW.po | 5 +- include/all_apps/db.h | 39 +- include/all_apps/layout.h | 38 +- include/all_apps/list.h | 37 +- include/all_apps/shortcut.h | 38 +- include/conf.h | 49 +- include/db.h | 36 +- include/index.h | 38 +- include/item.h | 41 +- include/item_badge.h | 38 +- include/item_event.h | 36 +- include/key.h | 34 +- include/layout.h | 42 +- include/list.h | 42 +- include/mapbuf.h | 38 +- include/menu_screen.h | 40 +- include/mouse.h | 38 +- include/page.h | 38 +- include/page_scroller.h | 39 +- include/pkgmgr.h | 83 +- include/popup.h | 36 +- include/util.h | 42 +- org.tizen.menu-screen.efl | 98 +++ org.tizen.menu-screen.manifest | 3 +- org.tizen.menu-screen.rule | 94 --- packaging/org.tizen.menu-screen.spec | 57 +- src/all_apps/db.c | 52 +- src/all_apps/layout.c | 53 +- src/all_apps/list.c | 178 ++++- src/all_apps/shortcut.c | 40 +- src/db.c | 66 +- src/index.c | 38 +- src/item.c | 221 ++++-- src/item_badge.c | 38 +- src/item_event.c | 38 +- src/key.c | 38 +- src/layout.c | 197 ++++- src/list.c | 65 +- src/mapbuf.c | 38 +- src/menu_screen.c | 185 ++++- src/mouse.c | 38 +- src/page.c | 41 +- src/page_scroller.c | 502 +++++------- src/pkgmgr.c | 1008 +++++++++++-------------- src/popup.c | 41 +- src/util.c | 38 +- 110 files changed, 2700 insertions(+), 2223 deletions(-) mode change 100644 => 100755 CMakeLists.txt delete mode 100644 LICENSE.Flora delete mode 100644 NOTICE create mode 100755 data/icons/org.tizen.menu-screen.png create mode 100644 data/main_operation.launch delete mode 100644 data/org.tizen.menu-screen.desktop.in create mode 100755 data/po/de.po create mode 100755 data/po/es_US.po create mode 100755 data/po/fr.po create mode 100755 data/po/nl.po create mode 100755 org.tizen.menu-screen.efl delete mode 100644 org.tizen.menu-screen.rule mode change 100644 => 100755 packaging/org.tizen.menu-screen.spec mode change 100644 => 100755 src/menu_screen.c diff --git a/AUTHORS b/AUTHORS index 95e1254..49e578b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Jin Yoon +Junkyu Han Youngjoo Park diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 5fe2f0d..744947a --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,14 +7,25 @@ SET(EXEC_PREFIX "${PREFIX}/bin") SET(LIBDIR "${PREFIX}/lib") 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 @@ -33,15 +44,20 @@ pkg_check_modules(MENU_PKGS REQUIRED eina elementary evas - heynoti pkgmgr pkgmgr-info shortcut - sysman 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("-DPREFIX=\"${PREFIX}\"") @@ -57,6 +73,10 @@ FOREACH (flag ${MENU_PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) +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}") @@ -85,13 +105,12 @@ ADD_EXECUTABLE(${PROJECT_NAME} 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}/LICENSE.Flora DESTINATION /usr/share/license RENAME ${PACKAGE_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_NAME}.rule DESTINATION /opt/etc/smack/accesses.d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_NAME}.efl DESTINATION /etc/smack/accesses.d) ADD_SUBDIRECTORY(data) diff --git a/LICENSE.Flora b/LICENSE.Flora deleted file mode 100644 index 571fe79..0000000 --- a/LICENSE.Flora +++ /dev/null @@ -1,206 +0,0 @@ -Flora License - -Version 1.1, April, 2013 - -http://floralicense.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 Tizen Compliance Specification -and passes the Tizen Compliance Tests 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 - and your own copyright statement or terms and conditions do not conflict - the conditions stated in the License including section 3. - -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 [yyyy] [name of copyright owner] - - Licensed under the Flora License, Version 1.1 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://floralicense.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. - diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 04443b1..0000000 --- a/NOTICE +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. -Except as noted, this software is licensed under the Flora License, Version 1.1. -Please, see the LICENCE.Flora file for the Flora License, Version 1.1 terms and conditions. diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index b491de5..9c423e5 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -4,6 +4,9 @@ SET(MANIFESTDIR "/usr/share/packages") 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) diff --git a/data/edje/all_apps_portrait.edc b/data/edje/all_apps_portrait.edc index b413286..4b2c759 100644 --- a/data/edje/all_apps_portrait.edc +++ b/data/edje/all_apps_portrait.edc @@ -1,28 +1,37 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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,9 +59,8 @@ collections { mouse_events: 0; description { state: "default" 0.0; - rel1 { relative: 0.0 20/1210; to, "bg";} // 1280 - 70(indicator) - rel2 { relative: 1.0 124/1210; to, "bg";} // 174 - 70 - 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; } } @@ -79,8 +97,8 @@ collections { mouse_events: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 134/1210; to, "bg"; } // 154 - 70 - rel2 { relative: 1.0 1164/1210; to, "bg"; } + 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; } diff --git a/data/edje/button_edit.edc b/data/edje/button_edit.edc index 982220c..fefa59f 100644 --- a/data/edje/button_edit.edc +++ b/data/edje/button_edit.edc @@ -1,23 +1,31 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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 @@ -33,6 +41,7 @@ images { collections { + base_scale: 1.8; group { name: "button_edit"; parts { @@ -63,14 +72,13 @@ collections { mouse_events: 1; description { state: "default" 0.0; - rel1 { relative: 0.5 0.5; to, "edit_button"; } - rel2 { relative: 0.5 0.5; to, "edit_button"; } - min: BUTTON_EDIT_BG_SIZE; - max: BUTTON_EDIT_BG_SIZE; + 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: 30 30 0 0; + border: 15 15 0 0; middle: DEFAULT; border_scale: 1; } @@ -107,13 +115,12 @@ collections { description { state: "default" 0.0; align: 0.5 0.5; - rel1 { relative: 0.5 0.5; to, "edit_button_bg";} - rel2 { relative: 0.5 0.5; to, "edit_button_bg";} + 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; - max: BUTTON_EDIT_IMAGE_SIZE; + min: BUTTON_EDIT_IMAGE_SIZE_MIN; fixed: 1 1; visible: 1; } diff --git a/data/edje/group_4x4_portrait.edc b/data/edje/group_4x4_portrait.edc index de78a2a..ff7a34a 100644 --- a/data/edje/group_4x4_portrait.edc +++ b/data/edje/group_4x4_portrait.edc @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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) \ part { \ @@ -118,6 +122,7 @@ #define ITEM_15_Y ITEM_12_Y collections { + base_scale: 1.8; group { name: "menu_bg"; parts { diff --git a/data/edje/index.edc b/data/edje/index.edc index a5f2336..713e382 100644 --- a/data/edje/index.edc +++ b/data/edje/index.edc @@ -1,18 +1,24 @@ /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 @@ -20,6 +26,7 @@ #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"; diff --git a/data/edje/item_4x4.edc b/data/edje/item_4x4.edc index 6d9716b..541e59c 100644 --- a/data/edje/item_4x4.edc +++ b/data/edje/item_4x4.edc @@ -1,24 +1,29 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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 { @@ -38,6 +43,7 @@ images { collections { + base_scale: 1.8; group { name: "icon"; @@ -62,10 +68,10 @@ collections { mouse_events: 1; description { state: "default" 0.0; - rel1 { relative: 0.5 60/ITEM_HEIGHT; to: "bg"; } - rel2 { relative: 0.5 60/ITEM_HEIGHT; to: "bg"; } + 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; + //min: 117 117; fixed: 1 1; } } @@ -91,8 +97,8 @@ collections { description { state: "default" 0.0; visible: 0; - rel1 { relative: 110/ITEM_WIDTH 0.0; to, "bg"; } - rel2 { relative: 170/ITEM_WIDTH 60/ITEM_HEIGHT; to, "bg"; } + 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"; } @@ -158,12 +164,12 @@ collections { mouse_events: 1; description { state: "default" 0.0; - rel1 { relative: 40/ITEM_WIDTH 30/ITEM_HEIGHT; to, "bg"; } - rel2 { relative: 40/ITEM_WIDTH 30/ITEM_HEIGHT; to, "bg"; } + 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; + //min: 54 54; fixed: 1 1; visible: 0; } @@ -199,9 +205,10 @@ collections { text { text_class: "tizen"; font: "TIZEN:style=medium"; - size: 16; + size: 24; align: 0.5 0.1; } + visible: 1; } description { @@ -277,6 +284,21 @@ 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 { diff --git a/data/edje/layout_portrait.edc b/data/edje/layout_portrait.edc index 50c40e2..dc95b87 100644 --- a/data/edje/layout_portrait.edc +++ b/data/edje/layout_portrait.edc @@ -1,35 +1,65 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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,6 +75,84 @@ 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; @@ -81,6 +189,38 @@ collections { 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/icons/org.tizen.menu-screen.png b/data/icons/org.tizen.menu-screen.png new file mode 100755 index 0000000000000000000000000000000000000000..ee06044c844a721994003827bd37464d62f999ce GIT binary patch literal 6016 zcmV-`7k}u9P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000cDNklCakN^n<5)L37kPJaM4G=O4k|B@?fr(PE`W0sV0<8B;^2#Su zV-Cnv+ma~B$jv02#YFO>R%fLxbi(A{hxK}Wks+KoWaKo6@OTInGt6cyTkk10`Cm3) zwJtZRflRkAKZk_68zQujb#H^orJ%EEfK9-&l2EZ`$Y>Iz;ytkLCbs&A$$5{zHL8G2 zx3{*C2t7z7uh(vu(nt4#O<`nwmkdLVYk>+iX=byTt-C4+f9flc>Gov_BIiL8>Q-Io z413+XgV(-cXsOdU11dbez}Bo~c2_0mJ(2mq0h#VtKA%M75%!Lr;dbu;>C)l_ci=!{9p9`qS z50jsKY?be(o$griUFiIG-0odt7DNDGQ-IsO3()!Rq&rr8*H?{9cPw8FtJk~TyCv%! zJ`96Y6rsi$2EtjIocr_N)C^?0z4c-uddcm6D{kE`e3*s^H6qm5(#y$mjyz~`ht9NxV1kP=2CnM{0$?ZhA#c1C1u z@@fD}O9Gj0Z=KA#aJ|k3+kg|qXozTpmA^n1G=ac_0Q9p9ptC6mr}6r9d+Vy?ytVHZ z1(HatHePo;==J~sa3munt*_U$EI){vA-Ocz>EZ z*~?OGw=|#7ND}j{&Z@p3GX_+$h_Cctj)B!#1rqa50Ll6qwt0+&QIBAA!dK=2*4G@T zKh`T;YTb9f2ceWags%gw-s3bO$~rM9%rV3Rw;2Cz1#T&aNjfBcqrs*gOb zr9sFu1+d9YPHkzOp_t8O^`tyOn%c1hyr@P7CC+Lvo68hibJ0kYy6WX4>miq|xkwS~ z7B+>GODR5TN3l{@pU-0dWtIpsfywJPZ(`k|tkq{);|5ZM<#GkrU}8-f9~n%c*%}wt zdQ%jvo)l!s3?;w}&_&kSM|yxYNyV(2V0B=o%_Yn`DAPurO&eB&SvM(bZJ5~xX4=I{ zT9u}d)w+^;nl{+NS{qgX$C+*5W?i=kTBoe$gggs?0P+e%T`c6pASe(6 zC09NK$0JL~3@X?N36SVg039NsrgK1XySP~g7q?6M#bBT$p#V@yf#g0C;g5rR0^vW! zfaC!APe~vHQb`hFfaE(05PKk;z13Ky{uOG7mQ$M$9 zujmiq|0X99Okb}KtO#gD(HQ(i4m-?G3Qz-Gfizq`0 zFt}sd7dEGln>GND3~v%D9>Br}_T?y6h~N^dDvAdif9EAs93;cXchaf>#PTUNxgSHw zCcoOVCHp63UVEN5l3Od{sTs$E9qK)QuI4*u(YaAx_&GKeD=a351H)TB9uIBTxN3oM=WQ#0V=5szlQPgcHq`X`@d*l7s^$?_Oo$U&4SdKwxoxd-~4KLTEN|H-ACR05IYrx7Z_ z8H@5vAAF>WP68N@PQUK?eM17-kNksd-GwsJG|l8YeJQk7;wQt&k0LZ_cIA<{LT&T| zNf{XrfcKLKJy5ioR_x6g3tq?o@|z^1%uF@r_SJL8V*YL@-dNJKYnlUrWRw}=8-3VR z2qXZUd&A$J2Y8*6m|T;0&gb*Kk@Cs_8~i_g`yQ*GLq7)VX5R4k=SrG=`RZ?IC0lon ziZ##ls@V-jjMUD*A~tzW*&g#yCS2~lN?N}9@PCk?>OzeZYX*aNk_fFVKh+_s#yfv| z<@wC~Z|h|mhMR|bM&M|{LC%w~T;ILh$8~`iQO96h*n>07on|uJ2;n4ph{WYHZ)|(5 zCLjUe%}w(b0N7;mN2DFb!$B+)j3sDGV2liq1cnj}DY&oNROttxqL7gZ2EfAe7PkLx zXydD}kMZWypSS}MKQZ~kWcAqC0Z|&n2xMd;0DI?oi(Xt)(K(e~{Jcdkt^wP7Wn>~q zhQ}<3B*T3mvc0EL5Qn9a$Hw-JSKLD+?$?D*vR-ymPl-1YZ6}Xd!rge zCw@9e$PBZ+>HNhn{i!OKP|K3H?HfOFK7h?2oago&#Hf4_XTuo)<4pkbXDxp5jjFFy z>)OHXPtQwO>pen5ORSeAT~lsezo8=IA)FX9^Ex4%m9rMLkKChSPcrolmwz54eg@zy zuQ!dLcS=-W3R7_6%>b|;Y*(Cr)60MM<+^^ZX5GH&s<_pKdx>Zzm?LiQdq9Be(}#&5 zLh;i9qCB(xsZf#oW-V;h_8%L#IQ_3InvoCW4PL9_%wlW}`t+@ry3DG8`>BZLzJfG#kv1JT15-1O4^ zz(m$#qvdPA{#b;F76G&vL~{Wss|&Dh5B%EREMyoW)BvHv0HDF#0q{m - + Jin Yoon + Junkyu Han Youngjoo Park Simple Menu-screen Application + /usr/share/icons/default/small/org.tizen.menu-screen.png diff --git a/data/po/CMakeLists.txt b/data/po/CMakeLists.txt index 794280d..e804a6a 100644 --- a/data/po/CMakeLists.txt +++ b/data/po/CMakeLists.txt @@ -7,19 +7,18 @@ SET(POFILES ca.po cs.po da.po - de_DE.po + de.po el_GR.po en.po en_PH.po en_US.po es_ES.po - es_MX.po + es_US.po et.po eu.po - fa.po fi.po fr_CA.po - fr_FR.po + fr.po ga.po gl.po hi.po @@ -36,7 +35,7 @@ SET(POFILES lv.po mk.po nb.po - nl_NL.po + nl.po pl.po pt_BR.po pt_PT.po @@ -46,15 +45,13 @@ SET(POFILES sl.po sr.po sv.po - th.po tr_TR.po uk.po - ur.po uz.po zh_CN.po zh_HK.po - zh_SG.po zh_TW.po + zh_SG.po ) SET(MSGFMT "/usr/bin/msgfmt") diff --git a/data/po/ar.po b/data/po/ar.po index 31821ad..319a578 100644 --- a/data/po/ar.po +++ b/data/po/ar.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "هل تريد إلغاء تثبيت %s؟" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "إلغاء التثبيت" \ No newline at end of file +msgstr "إلغاء التثبيت" + diff --git a/data/po/az.po b/data/po/az.po index 991ce16..b6bf270 100644 --- a/data/po/az.po +++ b/data/po/az.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s silinsin?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Quraşdırılma ləğv edilsin" \ No newline at end of file +msgstr "Quraşdırılma ləğv edilsin" + diff --git a/data/po/bg.po b/data/po/bg.po index 20cb7d5..f82bad0 100644 --- a/data/po/bg.po +++ b/data/po/bg.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Деинсталиране на %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Деинсталиране" \ No newline at end of file +msgstr "Деинсталиране" + diff --git a/data/po/ca.po b/data/po/ca.po index a4bc2cb..cc107cf 100644 --- a/data/po/ca.po +++ b/data/po/ca.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "Realit" +msgstr "Fet" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Desinstal·lar %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstal·lar" \ No newline at end of file +msgstr "Desinstal·lar" + diff --git a/data/po/cs.po b/data/po/cs.po index 71d1942..792da6b 100644 --- a/data/po/cs.po +++ b/data/po/cs.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Odinstalovat %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Odinstalovat" \ No newline at end of file +msgstr "Odinstalovat" + diff --git a/data/po/da.po b/data/po/da.po index d99306a..0acd840 100644 --- a/data/po/da.po +++ b/data/po/da.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Afinstallér %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Afinstallér" \ No newline at end of file +msgstr "Afinstallér" + diff --git a/data/po/de.po b/data/po/de.po new file mode 100755 index 0000000..b356e8b --- /dev/null +++ b/data/po/de.po @@ -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/el_GR.po b/data/po/el_GR.po index be489f7..094af6f 100644 --- a/data/po/el_GR.po +++ b/data/po/el_GR.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Κατάργηση της εγκατάστασης του %s;" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Κατάργηση εγκατάστασης" \ No newline at end of file +msgstr "Κατάργηση εγκατάστασης" + diff --git a/data/po/en.po b/data/po/en.po index 9536899..43627f4 100644 --- a/data/po/en.po +++ b/data/po/en.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Uninstall %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Uninstall" \ No newline at end of file +msgstr "Uninstall" + diff --git a/data/po/en_PH.po b/data/po/en_PH.po index 9536899..43627f4 100644 --- a/data/po/en_PH.po +++ b/data/po/en_PH.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Uninstall %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Uninstall" \ No newline at end of file +msgstr "Uninstall" + diff --git a/data/po/en_US.po b/data/po/en_US.po index 9536899..43627f4 100644 --- a/data/po/en_US.po +++ b/data/po/en_US.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Uninstall %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Uninstall" \ No newline at end of file +msgstr "Uninstall" + diff --git a/data/po/es_ES.po b/data/po/es_ES.po index 02cc757..0678bb5 100644 --- a/data/po/es_ES.po +++ b/data/po/es_ES.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "Finalizado" +msgstr "Hecho" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "¿Desinstalar %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstalar" \ No newline at end of file +msgstr "Desinstalar" + diff --git a/data/po/es_US.po b/data/po/es_US.po new file mode 100755 index 0000000..c83a4b6 --- /dev/null +++ b/data/po/es_US.po @@ -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 index be64f0c..ff243b2 100644 --- a/data/po/et.po +++ b/data/po/et.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Kas desinstallida %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Deinstalli" \ No newline at end of file +msgstr "Deinstalli" + diff --git a/data/po/eu.po b/data/po/eu.po index 13b5795..9bbcfbe 100644 --- a/data/po/eu.po +++ b/data/po/eu.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Desinstalatu %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstalatu" \ No newline at end of file +msgstr "Desinstalatu" + diff --git a/data/po/fi.po b/data/po/fi.po index 0802515..73c0bc1 100644 --- a/data/po/fi.po +++ b/data/po/fi.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Poistetaanko kohteen %s asennus?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Poista asennus" \ No newline at end of file +msgstr "Poista asennus" + diff --git a/data/po/fr.po b/data/po/fr.po new file mode 100755 index 0000000..a08eb14 --- /dev/null +++ b/data/po/fr.po @@ -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 index 7977fd8..a08eb14 100644 --- a/data/po/fr_CA.po +++ b/data/po/fr_CA.po @@ -5,4 +5,5 @@ 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 +msgstr "Désinstaller" + diff --git a/data/po/ga.po b/data/po/ga.po index 36117b4..58c44f0 100644 --- a/data/po/ga.po +++ b/data/po/ga.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Díshuiteáil %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Díshuiteáil" \ No newline at end of file +msgstr "Díshuiteáil" + diff --git a/data/po/gl.po b/data/po/gl.po index 5c99a7f..d6b9554 100644 --- a/data/po/gl.po +++ b/data/po/gl.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Desexas desinstalar %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstalar" \ No newline at end of file +msgstr "Desinstalar" + diff --git a/data/po/hi.po b/data/po/hi.po index 78e0813..463c733 100644 --- a/data/po/hi.po +++ b/data/po/hi.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "पूरा हुआ" +msgstr "पूर्ण" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s की स्थापना रद्द करें?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "अस्थापित करें" \ No newline at end of file +msgstr "स्थापना रद्द करें" + diff --git a/data/po/hr.po b/data/po/hr.po index 8a4cf42..abe4bc5 100644 --- a/data/po/hr.po +++ b/data/po/hr.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "Kraj" +msgstr "OK" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Deinstalirati %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Deinstaliraj" \ No newline at end of file +msgstr "Deinstaliraj" + diff --git a/data/po/hu.po b/data/po/hu.po index 6140991..a2deccc 100644 --- a/data/po/hu.po +++ b/data/po/hu.po @@ -5,4 +5,5 @@ 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" \ No newline at end of file +msgstr "Eltávolítás" + diff --git a/data/po/hy.po b/data/po/hy.po index ec74b44..7c199dd 100644 --- a/data/po/hy.po +++ b/data/po/hy.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Ապատեղադրե՞լ %s-ը:" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Ապատեղադրել" \ No newline at end of file +msgstr "Ապատեղադրել" + diff --git a/data/po/is.po b/data/po/is.po index 0d5ee01..78593e2 100644 --- a/data/po/is.po +++ b/data/po/is.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Fjarlægja %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Fjarlægja" \ No newline at end of file +msgstr "Fjarlægja" + diff --git a/data/po/it_IT.po b/data/po/it_IT.po index 81b02da..ccaa8bc 100644 --- a/data/po/it_IT.po +++ b/data/po/it_IT.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Disinstallare %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Disinstalla" \ No newline at end of file +msgstr "Disinstalla" + diff --git a/data/po/ja_JP.po b/data/po/ja_JP.po index bacd41c..3396a50 100644 --- a/data/po/ja_JP.po +++ b/data/po/ja_JP.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%sをアンインストールしますか?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "アンインストール" \ No newline at end of file +msgstr "アンインストール" + diff --git a/data/po/ka.po b/data/po/ka.po index 31d2726..5143b50 100644 --- a/data/po/ka.po +++ b/data/po/ka.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "ამოინსტალირდეს %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "ინსტალაციის გაუქმება" \ No newline at end of file +msgstr "ინსტალაციის გაუქმება" + diff --git a/data/po/kk.po b/data/po/kk.po index c1d9813..42005b6 100644 --- a/data/po/kk.po +++ b/data/po/kk.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s жою керек пе?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Жою" \ No newline at end of file +msgstr "Жою" + diff --git a/data/po/ko_KR.po b/data/po/ko_KR.po index 606c7c2..f7f6c2c 100644 --- a/data/po/ko_KR.po +++ b/data/po/ko_KR.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s을(를) 삭제할까요?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "삭제" \ No newline at end of file +msgstr "삭제" + diff --git a/data/po/lt.po b/data/po/lt.po index dd44366..357647f 100644 --- a/data/po/lt.po +++ b/data/po/lt.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Pašalinti „%s“?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Pašalinti" \ No newline at end of file +msgstr "Pašalinti" + diff --git a/data/po/lv.po b/data/po/lv.po index 8160d6c..3aeba4d 100644 --- a/data/po/lv.po +++ b/data/po/lv.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Vai atinstalēt %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Atinstalēt" \ No newline at end of file +msgstr "Atinstalēt" + diff --git a/data/po/mk.po b/data/po/mk.po index eb6aca3..2ff16dc 100644 --- a/data/po/mk.po +++ b/data/po/mk.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Да се деинсталира %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Деинсталирај" \ No newline at end of file +msgstr "Деинсталирај" + diff --git a/data/po/nl.po b/data/po/nl.po new file mode 100755 index 0000000..2084f23 --- /dev/null +++ b/data/po/nl.po @@ -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/pl.po b/data/po/pl.po index c971254..092015d 100644 --- a/data/po/pl.po +++ b/data/po/pl.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Odinstalować %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Odinstaluj" \ No newline at end of file +msgstr "Odinstaluj" + diff --git a/data/po/pt_BR.po b/data/po/pt_BR.po index 28b996a..c173dd4 100644 --- a/data/po/pt_BR.po +++ b/data/po/pt_BR.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "Concluído" +msgstr "OK" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Desinstalar %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstalar" \ No newline at end of file +msgstr "Desinstalar" + diff --git a/data/po/pt_PT.po b/data/po/pt_PT.po index 8140980..77e33c5 100644 --- a/data/po/pt_PT.po +++ b/data/po/pt_PT.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Desinstalar %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Desinstalar" \ No newline at end of file +msgstr "Desinstalar" + diff --git a/data/po/ro.po b/data/po/ro.po index a93f226..ba7787e 100644 --- a/data/po/ro.po +++ b/data/po/ro.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Dezinstalaţi %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Dezinstalare" \ No newline at end of file +msgstr "Dezinstalare" + diff --git a/data/po/ru_RU.po b/data/po/ru_RU.po index 83768b3..576f9c2 100644 --- a/data/po/ru_RU.po +++ b/data/po/ru_RU.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Удалить %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Удалить" \ No newline at end of file +msgstr "Удалить" + diff --git a/data/po/sk.po b/data/po/sk.po index bd962da..20559e2 100644 --- a/data/po/sk.po +++ b/data/po/sk.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Odinštalovať program %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Odinštalovať" \ No newline at end of file +msgstr "Odinštalovať" + diff --git a/data/po/sl.po b/data/po/sl.po index 4b5555e..cf4858b 100644 --- a/data/po/sl.po +++ b/data/po/sl.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Želite odstraniti %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Odstrani" \ No newline at end of file +msgstr "Odstrani" + diff --git a/data/po/sr.po b/data/po/sr.po index a9fb721..e559c92 100644 --- a/data/po/sr.po +++ b/data/po/sr.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Deinstalirati %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Deinstaliraj" \ No newline at end of file +msgstr "Deinstaliraj" + diff --git a/data/po/sv.po b/data/po/sv.po index 330726d..494db5b 100644 --- a/data/po/sv.po +++ b/data/po/sv.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Avinstallera %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Avinstallera" \ No newline at end of file +msgstr "Avinstallera" + diff --git a/data/po/tr_TR.po b/data/po/tr_TR.po index 32ce85c..e0a2c44 100644 --- a/data/po/tr_TR.po +++ b/data/po/tr_TR.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s kaldırılsın mı?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Kaldır" \ No newline at end of file +msgstr "Kaldır" + diff --git a/data/po/uk.po b/data/po/uk.po index d50f5c5..02250ae 100644 --- a/data/po/uk.po +++ b/data/po/uk.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "Видалити %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Видалити" \ No newline at end of file +msgstr "Видалити" + diff --git a/data/po/uz.po b/data/po/uz.po index 170b97a..6234c67 100644 --- a/data/po/uz.po +++ b/data/po/uz.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "Qilindi" +msgstr "OK" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "%s olib tashlansinmi?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "Olib tashlash" \ No newline at end of file +msgstr "Olib tashlash" + diff --git a/data/po/zh_CN.po b/data/po/zh_CN.po index 781b4f0..e47a0ee 100644 --- a/data/po/zh_CN.po +++ b/data/po/zh_CN.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "是否卸载 %s?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "卸载" \ No newline at end of file +msgstr "卸载" + diff --git a/data/po/zh_HK.po b/data/po/zh_HK.po index 708e6ef..81236c8 100644 --- a/data/po/zh_HK.po +++ b/data/po/zh_HK.po @@ -5,4 +5,5 @@ msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "解除安裝 %s 嗎?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "解除安裝" \ No newline at end of file +msgstr "解除安裝" + diff --git a/data/po/zh_TW.po b/data/po/zh_TW.po index 708e6ef..629d4db 100644 --- a/data/po/zh_TW.po +++ b/data/po/zh_TW.po @@ -1,8 +1,9 @@ msgid "IDS_HS_BUTTON_DONE" -msgstr "完成" +msgstr "確定" msgid "IDS_AT_POP_UNINSTALL_PS_Q" msgstr "解除安裝 %s 嗎?" msgid "IDS_AT_BODY_UNINSTALL" -msgstr "解除安裝" \ No newline at end of file +msgstr "解除安裝" + diff --git a/include/all_apps/db.h b/include/all_apps/db.h index 60aeeb6..08997d5 100644 --- a/include/all_apps/db.h +++ b/include/all_apps/db.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ @@ -25,7 +29,6 @@ typedef struct _db_info { long long rowid; int type; - char *appid; char *name; char *content_info; diff --git a/include/all_apps/layout.h b/include/all_apps/layout.h index 73cd023..f3d6151 100644 --- a/include/all_apps/layout.h +++ b/include/all_apps/layout.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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_ diff --git a/include/all_apps/list.h b/include/all_apps/list.h index fe93e4f..126aed8 100644 --- a/include/all_apps/list.h +++ b/include/all_apps/list.h @@ -1,25 +1,30 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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 index 0d536bf..2421671 100644 --- a/include/all_apps/shortcut.h +++ b/include/all_apps/shortcut.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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_ diff --git a/include/conf.h b/include/conf.h index 50d40f8..47cb96c 100644 --- a/include/conf.h +++ b/include/conf.h @@ -1,35 +1,44 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 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 +#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 +#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 index dd962f6..5ec5bd9 100644 --- a/include/db.h +++ b/include/db.h @@ -1,18 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/index.h b/include/index.h index fcc2454..27ef1c0 100644 --- a/include/index.h +++ b/include/index.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/item.h b/include/item.h index ab7fe21..a42d3c8 100644 --- a/include/item.h +++ b/include/item.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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); diff --git a/include/item_badge.h b/include/item_badge.h index 068d03b..659b323 100644 --- a/include/item_badge.h +++ b/include/item_badge.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/item_event.h b/include/item_event.h index 547103a..d140130 100644 --- a/include/item_event.h +++ b/include/item_event.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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 index def465f..b3bb91c 100644 --- a/include/key.h +++ b/include/key.h @@ -1,18 +1,24 @@ /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/layout.h b/include/layout.h index d24aad0..4edc6b0 100644 --- a/include/layout.h +++ b/include/layout.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ @@ -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 diff --git a/include/list.h b/include/list.h index e39d285..9c6c1b9 100644 --- a/include/list.h +++ b/include/list.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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__ @@ -26,7 +30,8 @@ typedef struct { - char *package; + char *pkgid; + char *package; /* appid */ char *exec; char *name; char *icon; @@ -48,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; @@ -64,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__ diff --git a/include/mapbuf.h b/include/mapbuf.h index d42f1f5..db20904 100644 --- a/include/mapbuf.h +++ b/include/mapbuf.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/menu_screen.h b/include/menu_screen.h index 03848f3..06d8fc3 100644 --- a/include/menu_screen.h +++ b/include/menu_screen.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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__ @@ -33,6 +37,10 @@ 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__ // End of a file diff --git a/include/mouse.h b/include/mouse.h index 50b3442..85d0a29 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/page.h b/include/page.h index 990d860..4c4ad3a 100644 --- a/include/page.h +++ b/include/page.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ diff --git a/include/page_scroller.h b/include/page_scroller.h index 282a5f2..da9e4f2 100644 --- a/include/page_scroller.h +++ b/include/page_scroller.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ @@ -40,6 +44,7 @@ extern unsigned int page_scroller_count_page(Evas_Object *scroller); extern int page_scroller_get_page_no(Evas_Object* scroller, Evas_Object *page); 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); diff --git a/include/pkgmgr.h b/include/pkgmgr.h index 42b29c1..bd2aa06 100644 --- a/include/pkgmgr.h +++ b/include/pkgmgr.h @@ -1,65 +1,42 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 - -#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__ diff --git a/include/popup.h b/include/popup.h index b894376..d871b91 100644 --- a/include/popup.h +++ b/include/popup.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + * 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__ diff --git a/include/util.h b/include/util.h index 44579b3..4ddc2b7 100644 --- a/include/util.h +++ b/include/util.h @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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__ @@ -27,6 +31,10 @@ #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" diff --git a/org.tizen.menu-screen.efl b/org.tizen.menu-screen.efl new file mode 100755 index 0000000..ee4a59f --- /dev/null +++ b/org.tizen.menu-screen.efl @@ -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 index af98acf..180519a 100644 --- a/org.tizen.menu-screen.manifest +++ b/org.tizen.menu-screen.manifest @@ -7,5 +7,6 @@ + - \ No newline at end of file + diff --git a/org.tizen.menu-screen.rule b/org.tizen.menu-screen.rule deleted file mode 100644 index fe79e16..0000000 --- a/org.tizen.menu-screen.rule +++ /dev/null @@ -1,94 +0,0 @@ -org.tizen.menu-screen pkgmgr::db rw -org.tizen.menu-screen ail::db rw -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 system::use_internet r -org.tizen.menu-screen device::app_logging w -org.tizen.menu-screen device::camera rwx -org.tizen.menu-screen sys-assert::core rwxat -org.tizen.menu-screen pulseaudio rwxat -org.tizen.menu-screen net-config rx -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 rx -org.tizen.menu-screen cbhm rx -org.tizen.menu-screen sound_server rwx -org.tizen.menu-screen svi-data rx -org.tizen.menu-screen data-provider-master rwx -org.tizen.menu-screen org.tizen.indicator rwx -org.tizen.menu-screen org.tizen.setting rx -org.tizen.menu-screen sqlfs rx -org.tizen.menu-screen e17 rwx -org.tizen.menu-screen dlogutil rx -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 rx -org.tizen.menu-screen deviced rx -org.tizen.menu-screen sensor-framework rx -org.tizen.menu-screen secure-storage rx -org.tizen.menu-screen pkgmgr-client rx -org.tizen.menu-screen syslogd w -org.tizen.menu-screen system::vconf_multimedia rw -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.dailybriefing-ynews org.tizen.menu-screen rw -org.tizen.gallery org.tizen.menu-screen rw -org.tizen.email org.tizen.menu-screen rw -org.tizen.dailybriefing-yfinance 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.dailybriefing-accuweather 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 -e17 org.tizen.menu-screen rwx -stest-service org.tizen.menu-screen rx -org.tizen.menu-screen stest-service w -org.tizen.menu-screen org.tizen.setting::default-resources rx -org.tizen.menu-screen pkgmgr::svc rx -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 rx -org.tizen.menu-screen factory-15 rx -org.tizen.menu-screen telephony_framework::api_manager r -org.tizen.menu-screen telephony_framework::api_modem r -org.tizen.menu-screen telephony_framework::api_network r -org.tizen.menu-screen atd-server r -org.tizen.menu-screen factory::vconf rw -org.tizen.menu-screen mobileprint x -org.tizen.menu-screen _ wx diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec old mode 100644 new mode 100755 index bb6eab5..0a8155c --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -16,10 +16,10 @@ Name: org.tizen.menu-screen Summary: An utility library of the menu screen -Version: 1.2.7 +Version: 1.2.5 Release: 1.1 Group: TO_BE/FILLED_IN -License: Flora Software License +License: Apache Source0: %{name}-%{version}.tar.gz BuildRequires: pkgconfig(ail) BuildRequires: pkgconfig(appcore-efl) @@ -40,17 +40,22 @@ BuildRequires: pkgconfig(eet) BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(evas) -BuildRequires: pkgconfig(heynoti) BuildRequires: pkgconfig(pkgmgr) BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(shortcut) -BuildRequires: pkgconfig(sysman) 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. @@ -70,23 +75,47 @@ An utility library for developers of the menu screen (devel) %setup -q %build -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -CFLAGS="${CFLAGS} -Wall" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" +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 +%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 -INHOUSE_ID="5000" +/usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{_packagedir} + +VCONF_OPTION="-f -u 5000" +PRIVATE_OPTION="-s org.tizen.menu-screen" +INHOUSE_OPTION="-s idlescreen::vconf" init_vconf() { - vconftool set -t int memory/idle-screen/top 0 -i -u 5000 -f - vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -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 @@ -137,7 +166,9 @@ fi %{_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 -%{_usr_datadir}/license/%{name} -/opt/etc/smack/accesses.d/%{_package_name}.rule +%{_packagedir}/*.xml +/etc/smack/accesses.d/%{_package_name}.efl diff --git a/src/all_apps/db.c b/src/all_apps/db.c index ffed9c7..eb5485d 100644 --- a/src/all_apps/db.c +++ b/src/all_apps/db.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include @@ -27,7 +31,7 @@ #define QUERY_LEN 1024 -#define MENU_SCREEN_DB_FILE "/opt/usr/apps/com.samsung.menu-screen/data/dbspace/.menu_screen.db" +#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,"\ @@ -152,20 +156,24 @@ HAPI void all_apps_db_unretrieve_all_info(Eina_List *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); - char q[QUERY_LEN]; snprintf(q, sizeof(q), QUERY_COUNT_SHORTCUT, appid, name); stmt_h *st; st = db_prepare(q); retv_if(NULL == st, -1); - menu_screen_error_e ret = MENU_SCREEN_ERROR_FAIL; ret = db_next(st); - retv_if(MENU_SCREEN_ERROR_FAIL == ret, -1); + if (MENU_SCREEN_ERROR_FAIL == ret) { + db_finalize(st); + return -1; + } - int count = -1; count = db_get_int(st, 0); db_finalize(st); diff --git a/src/all_apps/layout.c b/src/all_apps/layout.c index 7182481..3842193 100644 --- a/src/all_apps/layout.c +++ b/src/all_apps/layout.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 @@ -223,7 +227,7 @@ static menu_screen_error_e _load_item(Evas_Object *scroller, app_list_item *item return MENU_SCREEN_ERROR_OK; } - retv_if(NULL == 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; @@ -257,6 +261,7 @@ ERROR: page_scroller_bring_in(scroller, 0); page_scroller_focus(scroller); menu_screen_set_done(true); + menu_screen_inc_booting_state(); return ECORE_CALLBACK_CANCEL; } @@ -299,6 +304,8 @@ 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; @@ -313,7 +320,7 @@ HAPI Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate) all_apps_edje = ALL_APPS_EDJE_PORTRAIT; page_edje = GROUP_4X4_EDJE_PORTRAIT; width = menu_screen_get_root_width(); - height = menu_screen_get_root_height() - INDEX_HEIGHT; + height = menu_screen_get_root_height(); item_width = ITEM_WIDTH_PROP * menu_screen_get_root_width(); item_height = ITEM_HEIGHT_PROP * menu_screen_get_root_height(); @@ -324,6 +331,14 @@ HAPI 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); diff --git a/src/all_apps/list.c b/src/all_apps/list.c index ee06cfc..2144455 100644 --- a/src/all_apps/list.c +++ b/src/all_apps/list.c @@ -1,27 +1,64 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 +#include #include #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,6 +167,29 @@ static int _all_apps_sort_cb(const void *d1, const void *d2) +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; @@ -109,39 +214,36 @@ HAPI 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"); + } -HAPI void all_apps_list_destroy(app_list *list) -{ - app_list_item *item; + for(i = (MAX_PAGE_NO * PAGE_MAX_APP); ilist); + _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 index fff1a61..0554491 100644 --- a/src/all_apps/shortcut.c +++ b/src/all_apps/shortcut.c @@ -1,20 +1,24 @@ /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include @@ -49,8 +53,8 @@ HAPI Evas_Object *all_apps_shortcut_add( ai.x_slp_removable = 1; ai.x_slp_taskmanage = 0; - if (ADD_TO_HOME_IS_LIVEBOX(type)) { - _D("This is a livebox"); + if (ADD_TO_HOME_IS_DYNAMICBOX(type)) { + _D("This is a dynamic box"); return NULL; } diff --git a/src/db.c b/src/db.c index 58a489c..9efce2d 100644 --- a/src/db.c +++ b/src/db.c @@ -1,20 +1,24 @@ /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include @@ -205,7 +209,9 @@ HAPI menu_screen_error_e db_finalize(stmt_h *handle) retv_if(NULL == handle->stmt, MENU_SCREEN_ERROR_INVALID_PARAMETER); ret = sqlite3_finalize(handle->stmt); - retv_with_dbmsg_if(ret != SQLITE_OK, MENU_SCREEN_ERROR_FAIL); + if(ret != SQLITE_OK) { + _E("Cannot finalize handle"); + } free(handle); return MENU_SCREEN_ERROR_OK; @@ -226,21 +232,20 @@ HAPI long long db_last_insert_rowid(void) HAPI menu_screen_error_e db_exec(const char *query) { - int ret; - char *errmsg; - retv_if(NULL == query, MENU_SCREEN_ERROR_INVALID_PARAMETER); retv_if(NULL == db_info.db, MENU_SCREEN_ERROR_FAIL); - ret = sqlite3_exec(db_info.db, query, NULL, NULL, &errmsg); - if (ret != SQLITE_OK) { - _E("Cannot execute this query - %s. because %s", - query, errmsg? errmsg:"uncatched error"); - sqlite3_free(errmsg); - return 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; } @@ -305,7 +310,12 @@ HAPI menu_screen_error_e db_end_transaction(bool success) } } } else { - sqlite3_exec(db_info.db, "ROLLBACK TRANSACTION", NULL, NULL, NULL); + 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; diff --git a/src/index.c b/src/index.c index fb21705..afac24b 100644 --- a/src/index.c +++ b/src/index.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 diff --git a/src/item.c b/src/item.c index b29b03d..f063db8 100644 --- a/src/item.c +++ b/src/item.c @@ -1,25 +1,32 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 +#include +#include #include #include #include +#include #include #include "menu_screen.h" @@ -40,6 +47,8 @@ #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" @@ -107,8 +116,9 @@ HAPI void item_set_name(Evas_Object *edje, char *name, int sync) 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"); + _E("Failed to set text on the part"); } + elm_object_signal_emit(edje, "text,on", "menu"); } } @@ -212,6 +222,40 @@ HAPI char *item_get_package(Evas_Object *edje) +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; @@ -498,6 +542,32 @@ HAPI menu_screen_error_e item_is_edje_icon(const char *icon) +static int _is_main_operation_launch(Evas_Object *scroller, const char *package) +{ + 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; @@ -549,6 +619,7 @@ HAPI 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); @@ -626,7 +697,6 @@ static char *_access_uninstall_cb(void *data, Evas_Object *obj) static void _uninstall_focus_clicked_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win; - Evas_Object *scroller; char *package; win = menu_screen_get_win(); @@ -635,11 +705,8 @@ static void _uninstall_focus_clicked_cb(void *data, Evas_Object *obj, void *even _D("Uninstall button is up"); Evas_Object *item = data; - scroller = evas_object_data_get(item, "scroller"); - package = item_get_package(item); ret_if(!package || strlen(package) == 0); - ret_if(pkgmgr_find_pended_object(package, 0, scroller, NULL)); _D("Uninstalling... [%s]", package); @@ -706,8 +773,6 @@ HAPI 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), "tizen", "TIZEN: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")); @@ -719,9 +784,17 @@ HAPI 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; } @@ -737,16 +810,27 @@ HAPI 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"); @@ -758,6 +842,7 @@ HAPI void item_destroy(Evas_Object *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); @@ -793,6 +878,7 @@ HAPI 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; @@ -830,32 +916,32 @@ static void _run_cb(bundle *b, int request_code, appsvc_result_val result, void } - +#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"); layout_enable_block(layout); - bool is_shortcut = (bool) evas_object_data_get(obj, "is_shortcut"); - bool shortcut_launch_package = (bool) evas_object_data_get(obj, "shortcut_launch_package"); + 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) { - bundle *b = NULL; b = bundle_create(); ret_if(NULL == b); appsvc_set_operation(b, APPSVC_OPERATION_VIEW); - appsvc_set_uri(b, evas_object_data_get(obj, "content_info")); + appsvc_set_uri(b, evas_object_data_get(item, "content_info")); int ret = -1; ret = appsvc_run_service(b, 0, _run_cb, NULL); @@ -869,34 +955,55 @@ HAPI void item_launch(Evas_Object *obj) bundle_free(b); } else { - ret_aul = aul_open_app(package); - if (ret_aul == AUL_R_EINVAL) { - char* sinform; - int len; + 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 (!name) { - name = package; + 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; - // IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS : "Unable to launch %s" - len = strlen(D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS")) + strlen(name) + 1; + if (!name) { + name = package; + } - sinform = calloc(len, sizeof(char)); - if (!sinform) { - _E("cannot calloc for popup."); - return; - } + // IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS : "Unable to launch %s" + len = strlen(D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS")) + strlen(name) + 1; - snprintf(sinform, len, D_("IDS_IDLE_POP_UNABLE_TO_LAUNCH_PS"), name); - popup_create_confirm(layout, sinform); + sinform = calloc(len, sizeof(char)); + if (!sinform) { + _E("cannot calloc for popup."); + return; + } - free(sinform); - layout_disable_block(layout); - } else { - _D("Launch app's ret : [%d]", ret_aul); - _T(package); - ecore_timer_add(LAYOUT_BLOCK_INTERVAL, _unblock_cb, NULL); + 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); } } diff --git a/src/item_badge.c b/src/item_badge.c index aa95272..ce4c853 100644 --- a/src/item_badge.c +++ b/src/item_badge.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include diff --git a/src/item_event.c b/src/item_event.c index 4b9ef37..01aa4f1 100644 --- a/src/item_event.c +++ b/src/item_event.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include diff --git a/src/key.c b/src/key.c index c8130fb..0cb6803 100644 --- a/src/key.c +++ b/src/key.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include diff --git a/src/layout.c b/src/layout.c index 8ac7374..6eef4b3 100644 --- a/src/layout.c +++ b/src/layout.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include @@ -27,6 +31,7 @@ #include "layout.h" #include "mapbuf.h" #include "page.h" +#include "page_scroller.h" #include "item.h" #include "util.h" #include "all_apps/layout.h" @@ -36,6 +41,8 @@ HAPI Evas_Object *layout_create(Evas_Object *conformant, const char *file, const char *group, int rotate) { Evas_Object *layout; + Evas_Object *bg; + Evas *evas; do { int width; @@ -45,7 +52,7 @@ HAPI Evas_Object *layout_create(Evas_Object *conformant, const char *file, const retv_if(NULL == layout, NULL); width = menu_screen_get_root_width(); - height = menu_screen_get_root_height() - INDEX_HEIGHT; + 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); @@ -53,6 +60,14 @@ HAPI Evas_Object *layout_create(Evas_Object *conformant, const char *file, const 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); @@ -148,4 +163,150 @@ HAPI 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 diff --git a/src/list.c b/src/list.c index 94fe8df..3532887 100644 --- a/src/list.c +++ b/src/list.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include @@ -95,10 +99,11 @@ HAPI menu_screen_error_e list_get_item(app_list *list, app_list_item **item) - +/* 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; @@ -111,6 +116,8 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) 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); @@ -119,6 +126,7 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) 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))); @@ -135,6 +143,8 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) return MENU_SCREEN_ERROR_OK; } + if (appinfo_h) ail_destroy_appinfo(appinfo_h); + return MENU_SCREEN_ERROR_FAIL; } @@ -145,6 +155,11 @@ HAPI void list_free_values(app_info_t *ai) ret_if(NULL == ai); /* Origin field */ + if (ai->pkgid) { + free(ai->pkgid); + ai->pkgid = NULL; + } + if (ai->package) { free(ai->package); ai->package = NULL; @@ -206,4 +221,18 @@ HAPI menu_screen_error_e list_sort(app_list *list, int (*_sort_cb)(const void *d +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 diff --git a/src/mapbuf.c b/src/mapbuf.c index af31932..a9fb5bb 100644 --- a/src/mapbuf.c +++ b/src/mapbuf.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 diff --git a/src/menu_screen.c b/src/menu_screen.c old mode 100644 new mode 100755 index 5ad84b9..42c3998 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -1,23 +1,28 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include +#include #include #include #include @@ -34,6 +39,7 @@ #include "mouse.h" #include "page.h" #include "page_scroller.h" +#include "pkgmgr.h" #include "util.h" #define MENU_SCREEN_ENGINE "file/private/org.tizen.menu-screen/engine" @@ -50,6 +56,7 @@ static struct { int root_width; int root_height; int is_tts; + int booting_state; Evas *evas; Ecore_Evas *ee; Evas_Object *win; @@ -58,6 +65,7 @@ static struct { } menu_screen_info = { .state = APP_STATE_PAUSE, .is_tts = false, + .booting_state = 0, .evas = NULL, .ee = NULL, .win = NULL, @@ -129,6 +137,52 @@ HAPI int menu_screen_is_tts(void) } +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 menu_screen_error_e _create_canvas(char *name, char *title) { @@ -320,6 +374,8 @@ static Evas_Object *_create_conformant(Evas_Object *win) elm_object_style_set(conformant, "nokeypad"); 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); @@ -338,6 +394,50 @@ static void _destroy_conformant(Evas_Object *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) { @@ -360,7 +460,6 @@ static bool _create_cb(void *data) _get_window_size(); _init_theme(); retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), false); - elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW); if (vconf_notify_key_changed(VCONFKEY_BGSET, _change_bg_cb, NULL) < 0) { _E("Failed to register a vconf cb for %s\n", VCONFKEY_BGSET); @@ -381,7 +480,7 @@ static bool _create_cb(void *data) } evas_object_data_set(menu_screen_info.win, "layout", layout); -if (vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, _tts_cb, NULL) < 0) { + 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); @@ -391,6 +490,9 @@ if (vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, _tts_cb, NULL) 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; } @@ -401,6 +503,9 @@ 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); } @@ -432,10 +537,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 %s to 0", VCONFKEY_IDLE_SCREEN_TOP); - } - menu_screen_info.state = APP_STATE_PAUSE; } @@ -445,10 +546,6 @@ 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 %s to 1", VCONFKEY_IDLE_SCREEN_TOP); - } - do { // Focus Evas_Object *layout = evas_object_data_get(menu_screen_info.win, "layout"); break_if(NULL == layout); @@ -467,14 +564,10 @@ static void _resume_cb(void *data) -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 %s to 1", VCONFKEY_IDLE_SCREEN_TOP); - } - do { // Focus Evas_Object *layout = evas_object_data_get(menu_screen_info.win, "layout"); break_if(NULL == layout); @@ -532,7 +625,10 @@ static void _language_changed_cb(void *data) item = page_get_item_at(page, j); if (!item) continue; - if (ail_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_destroy_appinfo(ai); continue; @@ -560,7 +656,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; @@ -576,18 +672,27 @@ static void _fini(void) -#define QP_EMUL_STR "Emulator" static bool _is_emulator_on(void) { - char *info; + int ret; + char *model; - if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) { - if (info == NULL) return false; - if (!strncmp(QP_EMUL_STR, info, strlen(info))) { - return true; + 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; } diff --git a/src/mouse.c b/src/mouse.c index e27d284..1dec1db 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include diff --git a/src/page.c b/src/page.c index dffa633..e51349b 100644 --- a/src/page.c +++ b/src/page.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 @@ -147,8 +151,6 @@ HAPI 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; @@ -156,7 +158,6 @@ HAPI 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"); page = layout_load_edj(scroller, page_edje, PAGE_GROUP_NAME); retv_if(!page, NULL); diff --git a/src/page_scroller.c b/src/page_scroller.c index aefcc49..178fd8e 100644 --- a/src/page_scroller.c +++ b/src/page_scroller.c @@ -1,22 +1,27 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 +#include #include #include "item_badge.h" @@ -169,6 +174,56 @@ static void _scroll_cb(void *data, Evas_Object *scroller, void *event_info) +static menu_screen_error_e _find_position_all_page(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data) +{ + 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; +} + + + static menu_screen_error_e _find_position_by_default(Evas_Object *scroller, int *candidate_page, int *candidate_pos, void *data) { Evas_Object *page; @@ -361,63 +416,6 @@ 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); - 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 Evas_Object *page_scroller_push_item(Evas_Object *scroller, app_info_t *ai) { Evas_Object *page; @@ -484,240 +482,21 @@ HAPI Evas_Object *page_scroller_push_item(Evas_Object *scroller, app_info_t *ai) -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; - - 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; - } - - if (ai.nodisplay || !ai.enabled) - { - 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_scroller_trim_items(scroller); - } - - item_destroy(item); - } - - break; - } - - 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) { - Evas_Object *item; - _D("package %s is installed directly", package); - item = page_scroller_push_item(scroller, &ai); - if (item) { - break; - } else { - list_free_values(&ai); - retv_if(1, MENU_SCREEN_ERROR_FAIL); - } - } - } - - _D("Package %s is found, update it!", package); - item_update(item, &ai); - } while(0); - - list_free_values(&ai); - return MENU_SCREEN_ERROR_OK; -} - - - -static inline menu_screen_error_e _update_cb(const char *package, void *data) -{ - Evas_Object *scroller = data; - Evas_Object *item; - int page_no = 0; - app_info_t ai = {0,}; - - 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 && ai.enabled) { - _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_scroller_trim_items(scroller); - } - item_destroy(item); - } - } else { - Evas_Object *item; - _D("Item is not found. Create a new one"); - item = ((!ai.nodisplay && ai.enabled) ? page_scroller_push_item(scroller, &ai) : NULL); - if (item) { - 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 && ai.enabled) { - item_update(item, &ai); - break; - } - - page = page_scroller_get_page_at(scroller, page_no); - if (page) { - page_unpack_item(page, item); - page_scroller_trim_items(scroller); - } - item_destroy(item); - } - } while (0); - - list_free_values(&ai); - return MENU_SCREEN_ERROR_OK; -} - - - -static inline menu_screen_error_e _delete_cb(const char *package, void *data) -{ - 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); - - 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); - - 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; - } - } - - item = _animated_unpack_item(scroller, page, i); - retv_if(NULL == item, MENU_SCREEN_ERROR_FAIL); - item_destroy(item); - } while (0); - - return MENU_SCREEN_ERROR_OK; -} - - - -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) -{ - char *event; - char type[10]; - char package[BUFSZE]; - register int i; - - event = vconf_get_str(vconf_keynode_get_name(node)); - ret_if(NULL == event); - - if (sscanf(event, "%10[^:]:%1023s", type, package) != 2) { - _D("Failed to parse the event format : [%s], [%s]", type, package); - } - - _D("command[%s], package[%s]", type, package); - - 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"); - } + int candidate_page = -1; + int candidate_pos = -1; + Evas_Object *item = NULL; - free(event); - return; + 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); - _E("Failed to find a proper event handler"); - free(event); + return item; } @@ -786,6 +565,97 @@ static void _mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_i +static inline char *_ltrim(char *str) +{ + retv_if(NULL == str, NULL); + while (*str && (*str == ' ' || *str == '\t' || *str == '\n')) str ++; + return str; +} + + + +static inline int _rtrim(char *str) +{ + int len; + + retv_if(NULL == str, 0); + + len = strlen(str); + while (--len >= 0 && (str[len] == ' ' || str[len] == '\n' || str[len] == '\t')) { + str[len] = '\0'; + } + + return len; +} + + + +static int _create_main_operation_list(Evas_Object *scroller) +{ + 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; + } + + while ((read = getline(&line, &size, fp)) != -1) { + char *begin; + + if (size <= 0) { + free(line); + line = NULL; + break; + } + + begin = _ltrim(line); + _rtrim(line); + + if (*begin == '#' || *begin == '\0') { + free(line); + line = NULL; + continue; + } + + data = strdup(begin); + main_operation_list = eina_list_append(main_operation_list, data); + + if (line) { + free(line); + line = NULL; + } + } + + fclose(fp); + evas_object_data_set(scroller, DATA_KEY_MAIN_OPERATION_LIST, main_operation_list); + + return 1; +} + + + +static void _destroy_main_operation_list(Evas_Object *scroller) +{ + char *data = NULL; + Eina_List *main_operation_list = NULL; + + main_operation_list = evas_object_data_del(scroller, DATA_KEY_MAIN_OPERATION_LIST); + ret_if(!main_operation_list); + + EINA_LIST_FREE(main_operation_list, data) { + free(data); + } +} + + + HAPI Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, page_scroller_sort_type_e sort_type, int rotate) { Evas_Object *box; @@ -852,17 +722,14 @@ HAPI Evas_Object *page_scroller_create(Evas_Object *tab, Evas_Object *index, pag evas_object_show(box); evas_object_show(scroller); - if (vconf_notify_key_changed(VCONFKEY_AIL_INFO_STATE, _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"); } - // FIXME : This will be enabled after rebuilding the routine for appid <-> pkgid. - //pkgmgr_init(scroller); item_badge_register_changed_cb(scroller); + if (!_create_main_operation_list(scroller)) { + _E("Cannot create the main operation list"); + } return scroller; } @@ -883,11 +750,9 @@ HAPI 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))); + _destroy_main_operation_list(scroller); item_badge_unregister_changed_cb(); - // FIXME : This will be enabled after rebuilding the routine for appid <-> pkgid. - //pkgmgr_fini(); - EINA_LIST_FOREACH_SAFE(page_list, l, ln, page) { int count; @@ -942,10 +807,6 @@ HAPI void page_scroller_destroy(Evas_Object *scroller) evas_object_del(scroller); - if (vconf_ignore_key_changed(VCONFKEY_AIL_INFO_STATE, _desktop_cb) < 0) { - _E("Failed to ignore the desktop event"); - } - if (vconf_ignore_key_changed("memory/menuscreen/mapbuf", _mapbuf_cb) < 0) { _E("Failed to remove vconf %s", "memory/menuscreen/mapbuf"); } @@ -992,7 +853,7 @@ HAPI Evas_Object *page_scroller_get_page_at(Evas_Object *scroller, unsigned int 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); @@ -1190,7 +1051,7 @@ HAPI void page_scroller_edit(Evas_Object *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); - ret_if(NULL == page); + if(!page) continue; for (position_no = 0; position_no < page_max_app; position_no ++) { item = page_get_item_at(page, position_no); @@ -1225,11 +1086,8 @@ HAPI void page_scroller_unedit(Evas_Object *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 --) { - int count; - page = page_scroller_get_page_at(scroller, page_no); - if (NULL == page) break; - count = page_count_item(page); + if(NULL == page) continue; page_scroller_trim_items(scroller); diff --git a/src/pkgmgr.c b/src/pkgmgr.c index d7fecc2..8ffe7ed 100644 --- a/src/pkgmgr.c +++ b/src/pkgmgr.c @@ -1,32 +1,36 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 #include #include #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" @@ -37,276 +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, }; -HAPI 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) { - 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); - char *pkgid = NULL; - char *appid = item_get_package(item); - retv_if(NULL == appid, MENU_SCREEN_ERROR_FAIL); + rt->package = strdup(package); + goto_if(NULL == rt->package, ERROR); - pkgmgr_client *req_pc = NULL; - req_pc = pkgmgr_client_new(PC_REQUEST); - retv_if(NULL == req_pc, MENU_SCREEN_ERROR_FAIL); + rt->status = strdup(status); + goto_if(NULL == rt->status, ERROR); - pkgmgrinfo_appinfo_h handle; - 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; - } + pkg_mgr_info.request_list = eina_list_append(pkg_mgr_info.request_list, rt); + goto_if(NULL == pkg_mgr_info.request_list, ERROR); - if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid)) { - if (PMINFO_R_OK != pkgmgrinfo_appinfo_destroy_appinfo(handle)) { - _E("cannot destroy the appinfo"); - } + return MENU_SCREEN_ERROR_OK; - if (PKGMGR_R_OK != pkgmgr_client_free(req_pc)) { - _E("cannot free pkgmgr_client for request."); - } +ERROR: + if (rt->status) free(rt->status); + if (rt->package) free(rt->package); + if (rt) free(rt); - return MENU_SCREEN_ERROR_FAIL; - } + return MENU_SCREEN_ERROR_FAIL; +} - if (!pkgid) pkgid = appid; - _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; + +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 (PMINFO_R_OK != pkgmgrinfo_appinfo_destroy_appinfo(handle)) { - _E("cannot destroy the appinfo"); - ret = MENU_SCREEN_ERROR_FAIL; + 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; } - if (PMINFO_R_OK != pkgmgr_client_free(req_pc)) { - _E("cannot free pkgmgr_client"); - ret = MENU_SCREEN_ERROR_FAIL; + return 0; +} + + + +static pkgmgr_request_s *_get_request_in_list(const char *package) +{ + retv_if(NULL == package, NULL); + + if (NULL == pkg_mgr_info.request_list) return NULL; + + 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; } - return ret; + return NULL; } -static menu_screen_error_e _start_download(const char *package, void *scroller) +HAPI menu_screen_error_e pkgmgr_item_list_append_item(const char *pkg_id, const char *app_id, Evas_Object *item) { - struct package_info *pi; - Eina_List *install_list; + 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; - install_list = evas_object_data_get(scroller, "install_list"); - pi = calloc(1, sizeof(struct package_info)); - retv_if(NULL == pi, MENU_SCREEN_ERROR_FAIL); + pkgmgr_install_s *pi = calloc(1, sizeof(pkgmgr_install_s)); + goto_if(NULL == pi, ERROR); - pi->status = DOWNLOAD_BEGIN; - pi->ai.package = strdup(package); - pi->ai.name = strdup("Download"); + tmp_pkg_id = strdup(pkg_id); + goto_if(NULL == tmp_pkg_id, ERROR); - 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); + 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->ai.enabled = true; - 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; - pi->ai.enabled = true; - } + 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 && pi->status != INSTALL_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_scroller_trim_items(scroller); - 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; + } - return MENU_SCREEN_ERROR_OK; + 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_recover(const char *package, void *scroller) +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_install(const char *package, void *scroller) +static menu_screen_error_e _start_uninstall(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 uninstalling 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); - if (!pi->ai.package) { - free(pi); - return MENU_SCREEN_ERROR_FAIL; - } - pi->ai.icon = strdup(DEFAULT_ICON); - if (!pi->ai.icon) { - free(pi->ai.package); - free(pi); - return MENU_SCREEN_ERROR_FAIL; - } +static menu_screen_error_e _start_update(const char *package, void *scroller) +{ + _D("Start updating for the package(%s)", package); + return MENU_SCREEN_ERROR_OK; +} - pi->item = page_scroller_find_item_by_package(scroller, package, &page_no); - if (!pi->item) { - if (NULL == page_scroller_push_item(scroller, &pi->ai)) _E("Cannot push an item"); - } - pi->item = page_scroller_find_item_by_package(scroller, package, &page_no); - pi->page = page_scroller_get_page_at(scroller, page_no); - if (pi->item && pi->page) { - pi->ai.nodisplay = false; - pi->ai.enabled = true; - } - install_list = eina_list_append(install_list, pi); - evas_object_data_set(scroller, "install_list", install_list); - } else { - if (pi->status != DOWNLOAD_END && pi->status != INSTALL_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_scroller_trim_items(scroller); - item_destroy(pi->item); - } - - list_free_values(&pi->ai); - free(pi); - return MENU_SCREEN_ERROR_FAIL; - } - } +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; +} - 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; } @@ -344,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; } @@ -363,47 +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) { - _D("There is no item for [%s]", package); - pi->ai.nodisplay = false; - pi->ai.enabled = true; - - if (NULL == 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 { - _D("There is an item for [%s:%p]", package, pi->item); - item_update(pi->item, &pi->ai); - } - } - + _D("package(%s) with %s", package, val); return MENU_SCREEN_ERROR_OK; } @@ -411,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->ai.enabled && 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; } @@ -451,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->ai.enabled && 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; } @@ -503,250 +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; + retv_if(NULL == item, EINA_FALSE); - pi->status = UNINSTALL_END; - _D("Package uninstalling is complete"); + item_set_removable(item, 1, 0); + elm_object_signal_emit(item, "uninstall,on", "menu"); - 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); - } - - 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 - ) - { - if (pi->page) { - page_unpack_item(pi->page, pi->item); - page_scroller_trim_items(scroller); - } 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); - - return MENU_SCREEN_ERROR_OK; -} + retv_if(!_exist_request_in_list(package), MENU_SCREEN_ERROR_FAIL); + 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; + } -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; + _D("Package(%s) : key(%s) - val(%s)", package, rt->status, val); - _D("package [%s], val [%s]", package, val); + /* Criteria : pkgid */ + if (!strcasecmp("uninstall", rt->status)) { + Evas_Object *layout = evas_object_data_get(menu_screen_get_win(), "layout"); + goto_if(NULL == layout, ERROR); - 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); - - list_free_values(&pi->ai); - if (MENU_SCREEN_ERROR_OK != list_get_values(package, &pi->ai)) _E("Cannot get values"); - item_update(pi->item, &pi->ai); + 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; } @@ -767,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; @@ -789,7 +600,76 @@ static menu_screen_error_e _pkgmgr_cb(int req_id, const char *pkg_type, const ch -HAPI 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; @@ -798,7 +678,7 @@ HAPI 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; } @@ -816,50 +696,4 @@ HAPI void pkgmgr_fini(void) -HAPI 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 diff --git a/src/popup.c b/src/popup.c index a3fa311..d340c03 100644 --- a/src/popup.c +++ b/src/popup.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 @@ -138,6 +142,7 @@ static void _uninstall_yes_cb(void *data, Evas_Object *obj, void *event_info) 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")); @@ -192,6 +197,8 @@ HAPI Evas_Object *popup_create_uninstall(Evas_Object *parent, Evas_Object *item) Evas_Object *btn2; char warning[BUFSZE]; + ret_if(!item); + popup_destroy_all(); popup = elm_popup_add(parent); diff --git a/src/util.c b/src/util.c index 864cb1e..2f518bc 100644 --- a/src/util.c +++ b/src/util.c @@ -1,20 +1,24 @@ - /* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.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 + * Junkyu Han + + * 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 -- 2.34.1