apply FSL(Flora Software License)
authorKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:11 +0000 (14:54 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:11 +0000 (14:54 +0900)
54 files changed:
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
daemon/common.h [new file with mode: 0755]
daemon/idletxt/idletxt.c [new file with mode: 0755]
daemon/modules.c [new file with mode: 0755]
daemon/modules.h [new file with mode: 0755]
daemon/notifications/noti.c [new file with mode: 0644]
daemon/notifications/noti_display_app.c [new file with mode: 0644]
daemon/notifications/noti_display_app.h [new file with mode: 0644]
daemon/notifications/noti_win.c [new file with mode: 0644]
daemon/notifications/noti_win.h [new file with mode: 0644]
daemon/notifications/ticker.c [new file with mode: 0644]
daemon/quickpanel-ui.c [new file with mode: 0644]
daemon/quickpanel-ui.h [new file with mode: 0644]
data/CMakeLists.txt [new file with mode: 0755]
data/base/CMakeLists.txt [new file with mode: 0755]
data/base/image/RQ02_button_normal_center.png [new file with mode: 0755]
data/base/image/RQ02_button_normal_left.png [new file with mode: 0755]
data/base/image/RQ02_button_normal_right.png [new file with mode: 0755]
data/base/image/RQ02_button_press_center.png [new file with mode: 0755]
data/base/image/RQ02_button_press_left.png [new file with mode: 0755]
data/base/image/RQ02_button_press_right.png [new file with mode: 0755]
data/base/quickpanel_noti.edc [new file with mode: 0644]
data/base/quickpanel_noti_def.h [new file with mode: 0755]
data/base/quickpanel_theme.edc [new file with mode: 0755]
data/base/quickpanel_theme_def.h [new file with mode: 0755]
data/quickpanel.desktop.in [new file with mode: 0644]
data/quickpanel.sh.in [new file with mode: 0755]
debian/changelog [new file with mode: 0755]
debian/compat [new file with mode: 0755]
debian/control [new file with mode: 0644]
debian/org.tizen.quickpanel.install.in [new file with mode: 0755]
debian/org.tizen.quickpanel.postinst.in [new file with mode: 0755]
debian/rules [new file with mode: 0755]
icons/quickpanel_icon_default.png [new file with mode: 0644]
packaging/org.tizen.quickpanel.spec [new file with mode: 0644]
po/CMakeLists.txt [new file with mode: 0755]
po/de_DE.po [new file with mode: 0644]
po/el_GR.po [new file with mode: 0644]
po/en.po [new file with mode: 0644]
po/es_ES.po [new file with mode: 0644]
po/fr_FR.po [new file with mode: 0644]
po/it_IT.po [new file with mode: 0644]
po/ja_JP.po [new file with mode: 0644]
po/ko_KR.po [new file with mode: 0644]
po/nl_NL.po [new file with mode: 0644]
po/pt_PT.po [new file with mode: 0644]
po/ru_RU.po [new file with mode: 0644]
po/tr_TR.po [new file with mode: 0644]
po/zh_CN.po [new file with mode: 0644]
po/zh_HK.po [new file with mode: 0644]
po/zh_TW.po [new file with mode: 0644]
test/quickpanel_debug_util.c [new file with mode: 0755]
test/quickpanel_debug_util.h [new file with mode: 0755]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b76a535
--- /dev/null
@@ -0,0 +1,100 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(quickpanel C)
+
+FILE(GLOB_RECURSE DAEMON_SRCS daemon/*.c)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS)
+SET(SRCS ${DAEMON_SRCS} ${TEST_SRCS})
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(ICONDIR "${RESDIR}/icons")
+SET(EDJDIR "${RESDIR}/edje")
+SET(DATADIR "${PREFIX}/data")
+SET(DESKTOPDIR "/opt/share/applications")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(
+               ${CMAKE_CURRENT_SOURCE_DIR}/daemon
+               ${CMAKE_CURRENT_SOURCE_DIR}/test
+               )
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED 
+       appcore-efl 
+       appcore-common 
+       heynoti
+       notification 
+       vconf 
+       aul 
+       appsvc 
+       svi 
+       libprivilege-control 
+       ecore-x 
+       edbus 
+       evas 
+       ecore 
+       edje 
+       mm-sound 
+       icu-i18n 
+       iniparser 
+       enotify
+       elementary
+       dlog
+       syspopup-caller
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-fpie")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
+
+#ADD_DEFINITIONS("-DFILE_DEBUG")
+ADD_DEFINITIONS("-D_DLOG_USED")
+ADD_DEFINITIONS("-DHAVE_X")
+
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie")
+#-lefence 
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/icons DESTINATION ${RESDIR})
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+
+# i18n
+ADD_SUBDIRECTORY(data)
+ADD_SUBDIRECTORY(po)
+
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.org/license
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Flora License, Version 1.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.tizenopensource.org/license
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/daemon/common.h b/daemon/common.h
new file mode 100755 (executable)
index 0000000..cfa50c2
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QP_COMMON_H_
+#define __QP_COMMON_H_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "quickpanel_debug_util.h"
+
+#define QP_OK  (0)
+#define QP_FAIL        (-1)
+
+#ifdef _DLOG_USED
+#define LOG_TAG "quickpanel"
+#include <dlog.h>
+
+#define ERR(str,args...)               LOGE("%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define DBG(str,args...)               LOGD("%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define INFO(str,args...)              LOGI(#str"\n", ##args)
+#elif FILE_DEBUG /*_DLOG_USED*/
+#define ERR(str,args...)               debug_printf("%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define DBG(str,args...)               debug_printf("%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define INFO(str,args...)              debug_printf(#str"\n", ##args)
+#else /*_DLOG_USED*/
+#define ERR(str,args...)               fprintf( stderr, "%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define DBG(str,args...)               fprintf( stderr, "%s[%d]\t " #str "\n", __func__, __LINE__, ##args)
+#define INFO(str,args...)              fprintf( stderr, #str"\n", ##args)
+#endif /*_DLOG_USED*/
+
+#define retif(cond, ret, str, args...) do{\
+       if(cond) {\
+               DBG(str, ##args);\
+               return ret;\
+       }\
+}while(0);
+
+#define gotoif(cond, target, str, args...) do{\
+       if(cond) {\
+               DBG(str, ##args);\
+               goto target;\
+       }\
+}while(0);
+
+#endif                         /* __QP_COMMON_H_ */
diff --git a/daemon/idletxt/idletxt.c b/daemon/idletxt/idletxt.c
new file mode 100755 (executable)
index 0000000..820c9fe
--- /dev/null
@@ -0,0 +1,363 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vconf.h>
+#include "common.h"
+#include "quickpanel-ui.h"
+
+#define QP_IDLETXT_PART                        "qp.noti.swallow.spn"
+
+#define QP_IDLETXT_MAX_KEY             4
+#define QP_IDLETXT_MAX_LEN             1024
+#define QP_IDLETXT_SLIDE_LEN   130
+
+#define QP_IDLETXT_LABEL_STRING        "<font_size=30><color=#8C8C8CFF><align=left>%s</align></color></font_size>"
+
+static int quickpanel_idletxt_init(void *data);
+static int quickpanel_idletxt_fini(void *data);
+static int quickpanel_idletxt_suspend(void *data);
+static int quickpanel_idletxt_resume(void *data);
+
+QP_Module idletxt = {
+       .name = "idletxt",
+       .init = quickpanel_idletxt_init,
+       .fini = quickpanel_idletxt_fini,
+       .suspend = quickpanel_idletxt_suspend,
+       .resume = quickpanel_idletxt_resume,
+       .lang_changed = NULL
+};
+
+static Evas_Object *_quickpanel_idletxt_create_label(Evas_Object * parent,
+                                                    char *txt)
+{
+       Evas_Object *obj = NULL;
+       char buf[QP_IDLETXT_MAX_LEN] = { 0, };
+       int len = 0;
+
+       retif(parent == NULL || txt == NULL, NULL, "Invalid parameter!");
+
+       memset(buf, 0x00, sizeof(buf));
+
+       len = snprintf(buf, sizeof(buf), QP_IDLETXT_LABEL_STRING, txt);
+
+       retif(len < 0, NULL, "len < 0");
+
+       obj = elm_label_add(parent);
+       if (obj != NULL) {
+               elm_object_text_set(obj, buf);
+
+               evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND,
+                                                EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0.5);
+
+               evas_object_show(obj);
+       }
+
+       return obj;
+}
+
+static Evas_Object *_quickpanel_idletxt_create_box(Evas_Object * parent)
+{
+       Evas_Object *box = NULL;
+
+       retif(parent == NULL, NULL, "Invalid parameter!");
+
+       box = elm_box_add(parent);
+       if (box != NULL) {
+               elm_box_horizontal_set(box, EINA_FALSE);
+
+               evas_object_show(box);
+       }
+
+       return box;
+}
+
+static int _quickpanel_idletxt_get_txt(const char *key, char *txt, int size)
+{
+       int len = 0;
+       char *str = NULL;
+       int i = 0;
+
+       str = vconf_get_str(key);
+       if (str == NULL || str[0] == '\0') {
+               return 0;
+       }
+
+       /* check ASCII code */
+       for (i = strlen(str) - 1; i >= 0; i--) {
+               if (str[i] < 31 || str[i] > 127) {
+                       goto failed;
+               }
+       }
+
+       len = snprintf(txt, size, "%s", str);
+
+ failed:
+       if (str) {
+               free(str);
+       }
+
+       return len;
+}
+
+static Evas_Object *_quickpanel_idletxt_add_label(Evas_Object * box,
+                                                 char *key[])
+{
+       char txt[QP_IDLETXT_MAX_LEN] = { 0, };
+       char buf[QP_IDLETXT_MAX_LEN] = { 0, };
+       int len = 0;
+       int i = 0;
+       Evas_Object *obj = NULL;
+
+       retif(key == NULL || key[0] == '\0', NULL, "Invalid parameter!");
+
+       memset(txt, 0x00, sizeof(txt));
+
+       for (i = 0; key[i]; i++) {
+               memset(buf, 0x00, sizeof(buf));
+
+               /* get next key string */
+               if (_quickpanel_idletxt_get_txt(key[i], buf, sizeof(buf))) {
+                       INFO("VCONFKEY(%s) = %s", key[i], buf);
+
+                       len = strlen(txt);
+
+                       snprintf(&txt[len], sizeof(txt) - len, "%s%s",
+                                len ? " - " : "", buf);
+               }
+       }
+
+       len = strlen(txt);
+
+       if (len) {
+               obj = _quickpanel_idletxt_create_label(box, txt);
+
+               if (obj != NULL) {
+                       if (len > QP_IDLETXT_SLIDE_LEN) {
+                               elm_label_slide_set(obj, EINA_TRUE);
+                       }
+
+                       return obj;
+               }
+       }
+
+       return NULL;
+}
+
+static Evas_Object *_quickpanel_idletxt_get_spn(Evas_Object * box)
+{
+       Evas_Object *label = NULL;
+       char *keylist[QP_IDLETXT_MAX_KEY] = { 0, };
+       int ret = 0;
+       int state = 0;
+       int i = 0;
+
+       /* make keylist */
+       ret = vconf_get_int(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, &state);
+       if (ret == 0) {
+               INFO("VCONFKEY(%s) = %d",
+                    VCONFKEY_TELEPHONY_SPN_DISP_CONDITION, state);
+               if (i < QP_IDLETXT_MAX_KEY) {
+                       if (state & VCONFKEY_TELEPHONY_DISP_SPN) {
+                               keylist[i++] =
+                                   strdup(VCONFKEY_TELEPHONY_SPN_NAME);
+                       }
+
+                       if (state & VCONFKEY_TELEPHONY_DISP_PLMN) {
+                               keylist[i++] =
+                                   strdup(VCONFKEY_TELEPHONY_NWNAME);
+                       }
+               }
+
+       }
+
+       if (i > 0) {
+               /* get string with keylist */
+               label = _quickpanel_idletxt_add_label(box, keylist);
+
+               /* free keylist */
+               while (i > 0) {
+                       if (keylist[i]) {
+                               free(keylist[i]);
+                       }
+
+                       i--;
+               }
+       }
+
+       return label;
+}
+
+static Evas_Object *_quickpanel_idletxt_get_sat_text(Evas_Object * box)
+{
+       Evas_Object *label = NULL;
+       char *keylist[] = { VCONFKEY_SAT_IDLE_TEXT, 0 };
+
+       /* get string with keylist */
+       label = _quickpanel_idletxt_add_label(box, keylist);
+
+       return label;
+}
+
+static void quickpanel_idletxt_changed_cb(keynode_t * node, void *data)
+{
+       Evas_Object *label = NULL;
+       struct appdata *ad = (struct appdata *)data;
+
+       retif(ad == NULL,, "Invalid parameter!");
+
+       if (ad->idletxtbox == NULL) {
+               ad->idletxtbox = _quickpanel_idletxt_create_box(ad->noti.ly);
+               retif(ad->idletxtbox == NULL,, "Failed to create box!");
+
+               edje_object_part_swallow(_EDJ(ad->noti.ly), QP_IDLETXT_PART,
+                                        ad->idletxtbox);
+       }
+
+       elm_box_clear(ad->idletxtbox);
+
+       /* get spn */
+       label = _quickpanel_idletxt_get_spn(ad->idletxtbox);
+       if (label != NULL) {
+               elm_box_pack_end(ad->idletxtbox, label);
+       }
+
+       /* get sat idle text */
+       label = _quickpanel_idletxt_get_sat_text(ad->idletxtbox);
+       if (label != NULL) {
+               elm_box_pack_end(ad->idletxtbox, label);
+       }
+}
+
+static int _quickpanel_idletxt_register_event_handler(void *data)
+{
+       int ret = 0;
+
+       ret =
+           vconf_notify_key_changed(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION,
+                                    quickpanel_idletxt_changed_cb, data);
+       if (ret != 0) {
+               ERR("Failed to register VCONFKEY_TELEPHONY_SPN_DISP_CONDITION change callback!");
+       }
+
+       ret =
+           vconf_notify_key_changed(VCONFKEY_TELEPHONY_SPN_NAME,
+                                    quickpanel_idletxt_changed_cb, data);
+       if (ret != 0) {
+               ERR("Failed to register VCONFKEY_TELEPHONY_SPN_NAME change callback!");
+       }
+
+       ret =
+           vconf_notify_key_changed(VCONFKEY_TELEPHONY_NWNAME,
+                                    quickpanel_idletxt_changed_cb, data);
+       if (ret != 0) {
+               ERR("Failed to register VCONFKEY_TELEPHONY_NWNAME change callback!");
+       }
+
+       ret =
+           vconf_notify_key_changed(VCONFKEY_SAT_IDLE_TEXT,
+                                    quickpanel_idletxt_changed_cb, data);
+       if (ret != 0) {
+               ERR("Failed to register VCONFKEY_SAT_IDLE_TEXT change callback!");
+       }
+
+       quickpanel_idletxt_changed_cb(NULL, data);
+
+       return QP_OK;
+}
+
+static int _quickpanel_idletxt_unregister_event_handler(void)
+{
+       int ret = 0;
+
+       ret =
+           vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SPN_DISP_CONDITION,
+                                    quickpanel_idletxt_changed_cb);
+       if (ret != 0) {
+               ERR("Failed to unregister VCONFKEY_TELEPHONY_SPN_DISP_CONDITION change callback!");
+       }
+
+       ret =
+           vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SPN_NAME,
+                                    quickpanel_idletxt_changed_cb);
+       if (ret != 0) {
+               ERR("Failed to unregister VCONFKEY_TELEPHONY_SPN_NAME change callback!");
+       }
+
+       ret =
+           vconf_ignore_key_changed(VCONFKEY_TELEPHONY_NWNAME,
+                                    quickpanel_idletxt_changed_cb);
+       if (ret != 0) {
+               ERR("Failed to unregister VCONFKEY_TELEPHONY_NWNAME change callback!");
+       }
+
+       ret =
+           vconf_ignore_key_changed(VCONFKEY_SAT_IDLE_TEXT,
+                                    quickpanel_idletxt_changed_cb);
+       if (ret != 0) {
+               ERR("Failed to unregister VCONFKEY_SAT_IDLE_TEXT change callback!");
+       }
+
+       return QP_OK;
+}
+
+static int quickpanel_idletxt_init(void *data)
+{
+       struct appdata *ad = (struct appdata *)data;
+
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       ad->idletxtbox = _quickpanel_idletxt_create_box(ad->noti.ly);
+       retif(ad->idletxtbox == NULL, QP_FAIL, "Failed to create box!");
+
+       edje_object_part_swallow(_EDJ(ad->noti.ly), QP_IDLETXT_PART,
+                                ad->idletxtbox);
+
+       _quickpanel_idletxt_register_event_handler(ad);
+
+       return QP_OK;
+}
+
+static int quickpanel_idletxt_fini(void *data)
+{
+       struct appdata *ad = (struct appdata *)data;
+
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       _quickpanel_idletxt_unregister_event_handler();
+
+       edje_object_part_unswallow(_EDJ(ad->noti.ly), ad->idletxtbox);
+
+       if (ad->idletxtbox != NULL) {
+               evas_object_hide(ad->idletxtbox);
+
+               evas_object_del(ad->idletxtbox);
+
+               ad->idletxtbox = NULL;
+       }
+
+       return QP_OK;
+}
+
+static int quickpanel_idletxt_suspend(void *data)
+{
+       return QP_OK;
+}
+
+static int quickpanel_idletxt_resume(void *data)
+{
+       return QP_OK;
+}
diff --git a/daemon/modules.c b/daemon/modules.c
new file mode 100755 (executable)
index 0000000..7ed45da
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <appcore-efl.h>
+#include "common.h"
+#include "modules.h"
+
+/*******************************************************************
+  *
+  * MODULES
+  *
+  *****************************************************************/
+/* searchbar */
+/* extern QP_Module searchbar; */
+/* notification */
+extern QP_Module noti;
+extern QP_Module ticker;
+/* idle test */
+extern QP_Module idletxt;
+
+static QP_Module *modules[] = {
+       &noti,
+       &ticker,
+       &idletxt
+};
+
+int init_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->init) {
+                       modules[i]->init(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+int fini_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->fini) {
+                       modules[i]->fini(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+int suspend_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->suspend) {
+                       modules[i]->suspend(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+int resume_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->resume) {
+                       modules[i]->resume(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+int hib_enter_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->hib_enter) {
+                       modules[i]->hib_enter(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+int hib_leave_modules(void *data)
+{
+       int i;
+
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->hib_leave) {
+                       modules[i]->hib_leave(data);
+               }
+       }
+
+       return QP_OK;
+}
+
+/******************************************************************
+  *
+  * LANGUAGE
+  *
+  ****************************************************************/
+
+void lang_change_modules(void *data)
+{
+       int i;
+       retif(data == NULL,, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->lang_changed) {
+                       modules[i]->lang_changed(data);
+               }
+       }
+}
+
+void refresh_modules(void *data)
+{
+       int i;
+       retif(data == NULL,, "Invalid parameter!");
+
+       for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+               if (modules[i]->refresh) {
+                       modules[i]->refresh(data);
+               }
+       }
+}
diff --git a/daemon/modules.h b/daemon/modules.h
new file mode 100755 (executable)
index 0000000..650e611
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QP_MODULES_H__
+#define __QP_MODULES_H__
+
+#include <stdlib.h>
+#include "quickpanel-ui.h"
+
+extern int init_modules(void *data);
+extern int fini_modules(void *data);
+extern int suspend_modules(void *data);
+extern int resume_modules(void *data);
+extern int hib_enter_modules(void *data);
+extern int hib_leave_modules(void *data);
+extern void lang_change_modules(void *data);
+extern void refresh_modules(void *data);
+
+#endif /* __QP_MODULES_H__ */
diff --git a/daemon/notifications/noti.c b/daemon/notifications/noti.c
new file mode 100644 (file)
index 0000000..e98ec8e
--- /dev/null
@@ -0,0 +1,1292 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aul.h>
+#include <appsvc.h>
+
+#include <time.h>
+#include <vconf.h>
+#include <appcore-common.h>
+#include <Ecore_X.h>
+
+#include <unicode/uloc.h>
+#include <unicode/udat.h>
+#include <unicode/udatpg.h>
+#include <unicode/ustring.h>
+
+#include <notification.h>
+
+#include "quickpanel-ui.h"
+#include "common.h"
+
+#define QP_DEFAULT_ICON        ICONDIR"/quickpanel_icon_default.png"
+#define QP_NOTI_DAY_DEC        (24 * 60 * 60)
+
+static int suspended = 0;
+
+static notification_list_h g_notification_list = NULL;
+static notification_list_h g_notification_ongoing_list = NULL;
+
+static Elm_Genlist_Item_Class *itc_noti;
+static Elm_Genlist_Item_Class *g_itc;
+
+static Evas_Object *g_window = NULL;
+
+static int quickpanel_noti_init(void *data);
+static int quickpanel_noti_fini(void *data);
+static int quickpanel_noti_suspend(void *data);
+static int quickpanel_noti_resume(void *data);
+static void quickpanel_noti_lang_changed(void *data);
+
+QP_Module noti = {
+       .name = "noti",
+       .init = quickpanel_noti_init,
+       .fini = quickpanel_noti_fini,
+       .suspend = quickpanel_noti_suspend,
+       .resume = quickpanel_noti_resume,
+       .lang_changed = quickpanel_noti_lang_changed,
+};
+
+static void _quickpanel_noti_clear_clicked_cb(void *data, Evas_Object * obj,
+                                             void *event_info)
+{
+       int count = 0;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+       noti_err =
+           notification_get_count(NOTIFICATION_TYPE_NOTI, NULL,
+                                  NOTIFICATION_GROUP_ID_NONE,
+                                  NOTIFICATION_PRIV_ID_NONE, &count);
+
+       if (noti_err == NOTIFICATION_ERROR_NONE && count > 0) {
+               notifiation_clear(NOTIFICATION_TYPE_NOTI);
+       }
+
+       DBG("Clear Clicked : noti_err(%d), count(%d)", noti_err, count);
+}
+
+static char *_quickpanel_noti_get_progress(notification_h noti, char *buf,
+                                          int buf_len)
+{
+       double size = 0.0;
+       double percentage = 0.0;
+
+       retif(noti == NULL, NULL, "Invalid parameter!");
+
+       notification_get_size(noti, &size);
+       notification_get_progress(noti, &percentage);
+
+       if (percentage < 1 && percentage > 0) {
+               if (snprintf(buf, buf_len, "%d%%", (int)(percentage * 100)) <=
+                   0) {
+                       return NULL;
+               }
+               return buf;
+       } else if (size > 0) {
+               if (size > (1 << 30)) {
+                       if (snprintf
+                           (buf, buf_len, "%.1lfGB",
+                            size / 1000000000.0) <= 0) {
+                               return NULL;
+                       }
+                       return buf;
+               } else if (size > (1 << 20)) {
+                       if (snprintf(buf, buf_len, "%.1lfMB", size / 1000000.0)
+                           <= 0) {
+                               return NULL;
+                       }
+                       return buf;
+               } else if (size > (1 << 10)) {
+                       if (snprintf(buf, buf_len, "%.1lfKB", size / 1000.0) <=
+                           0) {
+                               return NULL;
+                       }
+                       return buf;
+               } else {
+                       if (snprintf(buf, buf_len, "%lfB", size) <= 0) {
+                               return NULL;
+                       }
+                       return buf;
+               }
+       }
+
+       return NULL;
+}
+
+static notification_h _quickpanel_noti_update_item_progress(const char *pkgname,
+                                                           int priv_id,
+                                                           double progress)
+{
+       notification_h noti = NULL;
+       notification_list_h head = NULL;
+       char *noti_pkgname = NULL;
+       int noti_priv_id = 0;
+
+       if (g_notification_ongoing_list) {
+               head = notification_list_get_head(g_notification_ongoing_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_progress(noti, progress);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       if (g_notification_list) {
+               head = notification_list_get_head(g_notification_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_progress(noti, progress);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       return NULL;
+}
+
+static notification_h _quickpanel_noti_update_item_size(const char *pkgname,
+                                                       int priv_id,
+                                                       double size)
+{
+       notification_h noti = NULL;
+       notification_list_h head = NULL;
+       char *noti_pkgname = NULL;
+       int noti_priv_id = 0;
+
+       if (g_notification_ongoing_list) {
+               head = notification_list_get_head(g_notification_ongoing_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_size(noti, size);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       if (g_notification_list) {
+               head = notification_list_get_head(g_notification_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_size(noti, size);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       return NULL;
+}
+
+static notification_h _quickpanel_noti_update_item_content(const char *pkgname,
+                                                       int priv_id,
+                                                       char *content)
+{
+       notification_h noti = NULL;
+       notification_list_h head = NULL;
+       char *noti_pkgname = NULL;
+       int noti_priv_id = 0;
+
+       if (g_notification_ongoing_list) {
+               head = notification_list_get_head(g_notification_ongoing_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+                                       content, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       if (g_notification_list) {
+               head = notification_list_get_head(g_notification_list);
+
+               while (head != NULL) {
+                       noti = notification_list_get_data(head);
+                       notification_get_pkgname(noti, &noti_pkgname);
+                       notification_get_id(noti, NULL, &noti_priv_id);
+                       if (!strcmp(noti_pkgname, pkgname)
+                           && priv_id == noti_priv_id) {
+                               notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+                                       content, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+                               return noti;
+                       }
+                       head = notification_list_get_next(head);
+               }
+       }
+
+       return NULL;
+}
+
+static void _quickpanel_noti_update_progressbar(void *data,
+                                               notification_h update_noti)
+{
+       Evas_Object *eo = (Evas_Object *) data;
+       Elm_Object_Item *head = NULL;
+       Elm_Object_Item *it = NULL;
+       notification_h noti = NULL;
+
+       head = elm_genlist_first_item_get(eo);
+       retif(head == NULL,, "no first item in genlist");
+
+       for (it = head; it != NULL; it = elm_genlist_item_next_get(it)) {
+               noti = elm_object_item_data_get(it);
+               if (noti == update_noti || update_noti == NULL) {
+                       elm_genlist_item_update(it);
+               }
+       }
+}
+
+static void _quickpanel_noti_item_progress_update_cb(void *data,
+                                                    DBusMessage * msg)
+{
+       DBusError err;
+       char *pkgname = 0;
+       int priv_id = 0;
+       double progress = 0;
+       notification_h noti = NULL;
+
+       retif(data == NULL || msg == NULL,, "Invalid parameter!");
+
+       dbus_error_init(&err);
+       dbus_message_get_args(msg, &err,
+                             DBUS_TYPE_STRING, &pkgname,
+                             DBUS_TYPE_INT32, &priv_id,
+                             DBUS_TYPE_DOUBLE, &progress, DBUS_TYPE_INVALID);
+
+       /* check item on the list */
+       noti =
+           _quickpanel_noti_update_item_progress(pkgname, priv_id, progress);
+       retif(noti == NULL,, "Can not found noti data.");
+
+       if (!suspended) {
+               _quickpanel_noti_update_progressbar(data, noti);
+       }
+}
+
+static void _quickpanel_noti_item_size_update_cb(void *data, DBusMessage * msg)
+{
+       DBusError err;
+       char *pkgname = 0;
+       int priv_id = 0;
+       double size = 0;
+       notification_h noti = NULL;
+
+       retif(data == NULL || msg == NULL,, "Invalid parameter!");
+
+       dbus_error_init(&err);
+       dbus_message_get_args(msg, &err,
+                             DBUS_TYPE_STRING, &pkgname,
+                             DBUS_TYPE_INT32, &priv_id,
+                             DBUS_TYPE_DOUBLE, &size, DBUS_TYPE_INVALID);
+
+       /* check item on the list */
+       noti = _quickpanel_noti_update_item_size(pkgname, priv_id, size);
+       retif(noti == NULL,, "Can not found noti data.");
+
+       if (!suspended) {
+               _quickpanel_noti_update_progressbar(data, noti);
+       }
+}
+
+static void _quickpanel_noti_item_content_update_cb(void *data, DBusMessage * msg)
+{
+       DBusError err;
+       char *pkgname = NULL;
+       int priv_id = 0;
+       char *content = NULL;
+       notification_h noti = NULL;
+
+       retif(data == NULL || msg == NULL,, "Invalid parameter!");
+
+       dbus_error_init(&err);
+       dbus_message_get_args(msg, &err,
+                             DBUS_TYPE_STRING, &pkgname,
+                             DBUS_TYPE_INT32, &priv_id,
+                             DBUS_TYPE_STRING, &content, DBUS_TYPE_INVALID);
+
+       INFO("content update : %s(%d) : %s", pkgname, priv_id, content);
+
+       /* check item on the list */
+       noti = _quickpanel_noti_update_item_content(pkgname, priv_id, content);
+       retif(noti == NULL,, "Can not found noti data.");
+
+       if (!suspended) {
+               _quickpanel_noti_update_progressbar(data, noti);
+       }
+}
+
+static char *_quickpanel_noti_get_time(time_t t, char *buf, int buf_len)
+{
+       UErrorCode status = U_ZERO_ERROR;
+       UDateTimePatternGenerator *generator;
+       UDateFormat *formatter;
+       UChar skeleton[40] = { 0 };
+       UChar pattern[40] = { 0 };
+       UChar formatted[40] = { 0 };
+       int32_t patternCapacity, formattedCapacity;
+       int32_t skeletonLength, patternLength, formattedLength;
+       UDate date;
+       const char *locale;
+       const char customSkeleton[] = UDAT_YEAR_NUM_MONTH_DAY;
+       char bf1[32] = { 0, };
+       enum appcore_time_format timeformat;
+
+       struct tm loc_time;
+       time_t today, yesterday;
+       int ret = 0;
+
+       today = time(NULL);
+       localtime_r(&today, &loc_time);
+
+       loc_time.tm_sec = 0;
+       loc_time.tm_min = 0;
+       loc_time.tm_hour = 0;
+       today = mktime(&loc_time);
+
+       yesterday = today - QP_NOTI_DAY_DEC;
+
+       localtime_r(&t, &loc_time);
+
+       if (t >= yesterday && t < today) {
+               ret = snprintf(buf, buf_len, _S("IDS_COM_BODY_YESTERDAY"));
+       } else if (t < yesterday) {
+               /* set UDate  from time_t */
+               date = (UDate) t *1000;
+
+               /* get default locale  */
+               uloc_setDefault(__secure_getenv("LC_TIME"), &status);   /* for thread saftey  */
+               locale = uloc_getDefault();
+
+               /* open datetime pattern generator */
+               generator = udatpg_open(locale, &status);
+               if (generator == NULL)
+                       return NULL;
+
+               /* calculate pattern string capacity */
+               patternCapacity =
+                   (int32_t) (sizeof(pattern) / sizeof((pattern)[0]));
+
+               /* ascii to unicode for input skeleton */
+               u_uastrcpy(skeleton, customSkeleton);
+
+               /* get skeleton length */
+               skeletonLength = strlen(customSkeleton);
+
+               /* get best pattern using skeleton */
+               patternLength =
+                   udatpg_getBestPattern(generator, skeleton, skeletonLength,
+                                         pattern, patternCapacity, &status);
+
+               /* open datetime formatter using best pattern */
+               formatter =
+                   udat_open(UDAT_IGNORE, UDAT_DEFAULT, locale, NULL, -1,
+                             pattern, patternLength, &status);
+               if (formatter == NULL) {
+                       udatpg_close(generator);
+                       return NULL;
+               }
+
+               /* calculate formatted string capacity */
+               formattedCapacity =
+                   (int32_t) (sizeof(formatted) / sizeof((formatted)[0]));
+
+               /* formatting date using formatter by best pattern */
+               formattedLength =
+                   udat_format(formatter, date, formatted, formattedCapacity,
+                               NULL, &status);
+
+               /* unicode to ascii to display */
+               u_austrcpy(bf1, formatted);
+
+               /* close datetime pattern generator */
+               udatpg_close(generator);
+
+               /* close datetime formatter */
+               udat_close(formatter);
+
+               ret = snprintf(buf, buf_len, "%s", bf1);
+       } else {
+               ret = appcore_get_timeformat(&timeformat);
+               if (ret == 0 && timeformat == APPCORE_TIME_FORMAT_24) {
+                       ret = strftime(buf, buf_len, "%H:%M", &loc_time);
+               } else {
+                       strftime(bf1, sizeof(bf1), "%l:%M", &loc_time);
+
+                       if (loc_time.tm_hour >= 0 && loc_time.tm_hour < 12) {
+                               ret = snprintf(buf, buf_len, "%s%s", bf1, "AM");
+                       } else {
+                               ret = snprintf(buf, buf_len, "%s%s", bf1, "PM");
+                       }
+               }
+
+       }
+
+       return ret <= 0 ? NULL : buf;
+}
+
+static Evas_Object *_quickpanel_noti_gl_get_content(void *data, Evas_Object * obj,
+                                                const char *part)
+{
+       notification_h noti = (notification_h) data;
+       Evas_Object *ic = NULL;
+       char *icon_path = NULL;
+       char *thumbnail_path = NULL;
+       char *ret_path = NULL;
+       double size = 0.0;
+       double percentage = 0.0;
+       notification_type_e type = NOTIFICATION_TYPE_NONE;
+
+       retif(noti == NULL, NULL, "Invalid parameter!");
+
+       if (!strncmp
+           (part, "elm.swallow.progress", strlen("elm.swallow.progress"))) {
+               notification_get_type(noti, &type);
+               if (type == NOTIFICATION_TYPE_ONGOING) {
+                       notification_get_size(noti, &size);
+                       notification_get_progress(noti, &percentage);
+
+                       if (percentage > 0 && percentage <= 1) {
+                               ic = elm_progressbar_add(obj);
+                               if (ic == NULL) {
+                                       return NULL;
+                               }
+
+                               elm_object_style_set(ic, "list_progress");
+                               elm_progressbar_value_set(ic, percentage);
+                               elm_progressbar_horizontal_set(ic, EINA_TRUE);
+                               elm_progressbar_pulse(ic, EINA_FALSE);
+                       } else if (size > 0) {
+                               ic = elm_progressbar_add(obj);
+                               if (ic == NULL) {
+                                       return NULL;
+                               }
+                               elm_object_style_set(ic, "pending_list");
+                               elm_progressbar_horizontal_set(ic, EINA_TRUE);
+                               elm_progressbar_pulse(ic, EINA_TRUE);
+                       }
+               }
+               return ic;
+       }
+
+       ic = elm_icon_add(obj);
+       retif(ic == NULL, NULL, "Failed to create elm icon.");
+
+       notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL,
+                              &thumbnail_path);
+       notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path);
+
+       if (!strncmp
+           (part, "elm.swallow.thumbnail", strlen("elm.swallow.thumbnail"))) {
+               if (thumbnail_path == NULL) {
+                       ret_path = icon_path;
+               } else {
+                       ret_path = thumbnail_path;
+               }
+
+               elm_icon_resizable_set(ic, EINA_FALSE, EINA_TRUE);
+
+               if (ret_path == NULL
+                   || (elm_icon_file_set(ic, ret_path, NULL) == EINA_FALSE)) {
+                       elm_icon_file_set(ic, QP_DEFAULT_ICON, NULL);
+               }
+       } else
+           if (!strncmp(part, "elm.swallow.icon", strlen("elm.swallow.icon")))
+       {
+               if (thumbnail_path == NULL) {
+                       ret_path = NULL;
+               } else {
+                       ret_path = icon_path;
+               }
+
+               if (ret_path != NULL) {
+                       elm_icon_file_set(ic, ret_path, NULL);
+               }
+       }
+
+       return ic;
+}
+
+static char *_quickpanel_noti_gl_get_text(void *data, Evas_Object * obj,
+                                          const char *part)
+{
+       notification_h noti = (notification_h) data;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+       char *text = NULL;
+       char *str = NULL;
+       char *loc_str = NULL;
+       char *get_loc_str = NULL;
+       char *domain = NULL;
+       char *dir = NULL;
+       char *temp = NULL;
+       char *pkgname = NULL;
+       char *caller_pkgname = NULL;
+       int group_id = 0, priv_id = 0, count = 0, unread_count = 0, temp_count;
+       char buf[128] = { 0, };
+       time_t time;
+       notification_type_e type = NOTIFICATION_TYPE_NONE;
+       notification_count_display_type_e count_display =
+           NOTIFICATION_COUNT_DISPLAY_TYPE_NONE;
+
+       retif(noti == NULL, NULL, "Invalid parameter!");
+
+       // Set text domain
+       notification_get_text_domain(noti, &domain, &dir);
+       if (domain != NULL && dir != NULL) {
+               bindtextdomain(domain, dir);
+       }
+       // Get pkgname & id
+       notification_get_pkgname(noti, &pkgname);
+       notification_get_application(noti, &caller_pkgname);
+       notification_get_id(noti, &group_id, &priv_id);
+       notification_get_type(noti, &type);
+
+       if (!strcmp(part, "elm.text.title")) {
+               notification_get_count(type, pkgname,
+                                      group_id, priv_id, &count);
+
+               if (count > 1) {
+                       /* Multi event */
+                       noti_err =
+                           notification_get_text(noti,
+                                                 NOTIFICATION_TEXT_TYPE_GROUP_TITLE,
+                                                 &text);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               text = NULL;
+                       }
+               } else {
+                       /* Single event */
+                       noti_err =
+                           notification_get_text(noti,
+                                                 NOTIFICATION_TEXT_TYPE_TITLE,
+                                                 &text);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               text = NULL;
+                       }
+               }
+       } else if (!strcmp(part, "elm.text.content")) {
+               notification_get_count(type, pkgname,
+                                      group_id, priv_id, &count);
+
+               if (count > 1) {
+                       /* Multi event */
+                       noti_err =
+                           notification_get_text(noti,
+                                                 NOTIFICATION_TEXT_TYPE_GROUP_CONTENT,
+                                                 &text);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               text = NULL;
+                       }
+
+                       if (text == NULL) {
+                               /* Default string */
+                               if (!strcmp
+                                   (caller_pkgname, "org.tizen.phone")) {
+                                       snprintf(buf, sizeof(buf), "%d %s",
+                                                count,
+                                                _S("IDS_COM_POP_MISSED_CALLS"));
+                               } else
+                                   if (!strcmp
+                                       (caller_pkgname,
+                                        "org.tizen.message")) {
+                                       snprintf(buf, sizeof(buf), "%d %s",
+                                                count,
+                                                _S("IDS_COM_POP_NEW_MESSAGES"));
+                               }/* else {
+                                       snprintf(buf, sizeof(buf), "%d %s",
+                                                count,
+                                                _S("IDS_COM_POP_MISSED_EVENT"));
+                               }*/
+                               text = buf;
+                       }
+               } else {
+                       /* Single event */
+                       noti_err =
+                           notification_get_text(noti,
+                                                 NOTIFICATION_TEXT_TYPE_CONTENT,
+                                                 &text);
+                       if (noti_err != NOTIFICATION_ERROR_NONE) {
+                               text = NULL;
+                       }
+
+                       /* Default string */
+                       if (text == NULL) {
+                               if (!strcmp
+                                   (caller_pkgname, "org.tizen.phone")) {
+                                       snprintf(buf, sizeof(buf), "%s",
+                                                _S("IDS_COM_POP_MISSED_CALL"));
+                               }
+                               text = buf;
+                       }
+               }
+       } else if (!strcmp(part, "elm.text.time")) {
+               if (type == NOTIFICATION_TYPE_ONGOING) {
+                       text =
+                           _quickpanel_noti_get_progress(noti, buf,
+                                                         sizeof(buf));
+               } else {
+                       notification_get_time(noti, &time);
+
+                       if ((int)time > 0) {
+                               text =
+                                   _quickpanel_noti_get_time(time, buf,
+                                                             sizeof(buf));
+                       } else {
+                               notification_get_insert_time(noti, &time);
+                               text =
+
+                                   _quickpanel_noti_get_time(time, buf,
+                                                             sizeof(buf));
+                       }
+               }
+       }
+
+       if (text != NULL) {
+               return strdup(text);
+       }
+
+       return NULL;
+}
+
+static Eina_Bool _quickpanel_noti_gl_get_state(void *data, Evas_Object * obj,
+                                              const char *part)
+{
+       notification_h noti = (notification_h) data;
+       char *pkgname = NULL;
+       int group_id = 0, priv_id = 0, count = 0;
+       char *content = NULL;
+       time_t time;
+
+       retif(noti == NULL, EINA_FALSE, "Invalid parameter!");
+
+       notification_get_pkgname(noti, &pkgname);
+       notification_get_id(noti, &group_id, &priv_id);
+
+       if (!strcmp(part, "elm.text.content")) {
+                notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &content);
+               if (content != NULL) {
+                       return EINA_TRUE;
+               }
+       } else if (!strcmp(part, "elm.text.time")) {
+               notification_get_time(noti, &time);
+
+               if ((int)time > 0) {
+                       return EINA_TRUE;
+               }
+       }
+
+       return EINA_FALSE;
+}
+
+static void quickpanel_noti_select_cb(void *data, Evas_Object * obj,
+                                     void *event_info)
+{
+       notification_h noti = (notification_h) data;
+       char *pkgname = NULL;
+       char *caller_pkgname = NULL;
+       bundle *args = NULL;
+       bundle *group_args = NULL;
+       bundle *single_service_handle = NULL;
+       bundle *multi_service_handle = NULL;
+       int flags = 0, group_id = 0, priv_id = 0, count = 0, flag_launch =
+           0, flag_delete = 0;
+       notification_type_e type = NOTIFICATION_TYPE_NONE;
+
+       elm_genlist_item_selected_set((Elm_Object_Item *) event_info,
+                                     EINA_FALSE);
+
+       retif(noti == NULL,, "Invalid parameter!");
+
+       notification_get_pkgname(noti, &caller_pkgname);
+       notification_get_application(noti, &pkgname);
+       if (pkgname == NULL) {
+               pkgname = caller_pkgname;
+       }
+
+       notification_get_id(noti, &group_id, &priv_id);
+       notification_get_property(noti, &flags);
+       notification_get_type(noti, &type);
+
+       if (flags & NOTIFICATION_PROP_DISABLE_APP_LAUNCH) {
+               flag_launch = 0;
+       } else {
+               flag_launch = 1;
+       }
+
+       if (flags & NOTIFICATION_PROP_DISABLE_AUTO_DELETE) {
+               flag_delete = 0;
+       } else {
+               flag_delete = 1;
+       }
+
+       notification_get_execute_option(noti,
+                                       NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+                                       NULL, &single_service_handle);
+       notification_get_execute_option(noti,
+                                       NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH,
+                                       NULL, &multi_service_handle);
+
+       if (flag_launch == 1) {
+               if (group_id != NOTIFICATION_GROUP_ID_NONE) {
+                       notification_get_count(type,
+                                              caller_pkgname, group_id,
+                                              priv_id, &count);
+               } else {
+                       count = 1;
+               }
+
+               if (count > 1 && multi_service_handle != NULL) {
+                       appsvc_run_service(multi_service_handle, 0, NULL, NULL);
+               } else if (single_service_handle != NULL) {
+                       appsvc_run_service(single_service_handle, 0, NULL,
+                                          NULL);
+               } else {
+                       notification_get_args(noti, &args, &group_args);
+
+                       /* AUL launch, this will be removed */
+                       if (count > 1 && group_args != NULL) {
+                               aul_launch_app(pkgname, group_args);
+                       } else {
+                               aul_launch_app(pkgname, args);
+                       }
+               }
+
+               // Hide quickpanel
+               Ecore_X_Window zone;
+               zone = ecore_x_e_illume_zone_get(elm_win_xwindow_get(g_window));
+               ecore_x_e_illume_quickpanel_state_send(zone,
+                                                      ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+       }
+
+       if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) {
+               notification_delete_group_by_priv_id(caller_pkgname,
+                                                    NOTIFICATION_TYPE_NOTI,
+                                                    priv_id);
+       }
+}
+
+static Evas_Object *_quickpanel_noti_gl_get_group_content(void *data,
+                                                      Evas_Object * obj,
+                                                      const char *part)
+{
+       Evas_Object *eo = NULL;
+
+       eo = elm_button_add(obj);
+       retif(eo == NULL, NULL, "Failed to create clear button!");
+
+       elm_object_style_set(eo, "noticlear");
+
+       elm_object_text_set(eo, _S("IDS_COM_POP_CLEAR"));
+       evas_object_smart_callback_add(eo, "clicked",
+                                      _quickpanel_noti_clear_clicked_cb, NULL);
+
+       return eo;
+}
+
+static char *_quickpanel_noti_gl_get_group_text(void *data, Evas_Object * obj,
+                                                const char *part)
+{
+       char buf[128] = { 0, };
+       int noti_count = 0;
+       struct appdata *ad = (struct appdata *)data;
+
+       retif(ad == NULL, NULL, "Invalid parameter!");
+
+       if (!strncmp(part, "elm.text", 8)) {
+               memset(buf, 0x00, sizeof(buf));
+
+               notification_get_count(NOTIFICATION_TYPE_NONE, NULL,
+                                      NOTIFICATION_GROUP_ID_NONE,
+                                      NOTIFICATION_PRIV_ID_NONE,
+                                      &noti_count);
+
+               snprintf(buf, sizeof(buf), _("IDS_QP_BODY_NOTIFICATIONS_HPD"),
+                        noti_count);
+
+               return strdup(buf);
+       }
+
+       return NULL;
+}
+
+static void _quickpanel_noti_get_new_list(void)
+{
+       notification_list_h new_noti_list = NULL;
+       notification_list_h head = NULL;
+       notification_list_h new_head = NULL;
+       notification_h noti = NULL;
+       notification_h new_noti = NULL;
+       notification_type_e new_type = NOTIFICATION_TYPE_NONE;
+       char *pkgname = NULL;
+       char *new_pkgname = NULL;
+       int priv_id = 0;
+       int new_priv_id = 0;
+       double percentage = 0.0;
+       double size = 0.0;
+
+       if (g_notification_ongoing_list != NULL) {
+               notification_free_list(g_notification_ongoing_list);
+               g_notification_ongoing_list = new_noti_list;
+       }
+
+       /* Get all list */
+       notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1,
+                                      &new_noti_list);
+       if (g_notification_list != NULL) {
+               head = notification_list_get_head(g_notification_list);
+               while (head != NULL) {
+                       new_head = notification_list_get_head(new_noti_list);
+                       while (new_head != NULL) {
+                               noti = notification_list_get_data(head);
+                               new_noti = notification_list_get_data(new_head);
+
+                               notification_get_type(new_noti, &new_type);
+                               if (new_type == NOTIFICATION_TYPE_ONGOING) {
+                                       notification_get_id(noti, NULL,
+                                                           &priv_id);
+                                       notification_get_id(new_noti, NULL,
+                                                           &new_priv_id);
+
+                                       notification_get_pkgname(noti,
+                                                                &pkgname);
+                                       notification_get_pkgname(new_noti,
+                                                                &new_pkgname);
+
+                                       if (!strcmp(pkgname, new_pkgname)
+                                           && priv_id == new_priv_id) {
+                                               notification_get_progress(noti,
+                                                                         &percentage);
+                                               notification_get_size(noti,
+                                                                     &size);
+                                               notification_set_progress
+                                                   (new_noti, percentage);
+                                               notification_set_size(new_noti,
+                                                                     size);
+                                       }
+                               }
+
+                               new_head = notification_list_get_next(new_head);
+                       }
+                       head = notification_list_get_next(head);
+               }
+
+               notification_free_list(g_notification_list);
+               g_notification_list = new_noti_list;
+       } else {
+               g_notification_list = new_noti_list;
+       }
+}
+
+void _quickpanel_noti_update_notilist(struct appdata *ad)
+{
+       Evas_Object *eo = ad->notilist;
+       Elm_Object_Item *grp = NULL;
+       notification_h noti = NULL;
+       notification_list_h get_list = NULL;
+       int r;
+       int applist = NOTIFICATION_DISPLAY_APP_ALL;
+
+       DBG("%s(%d)", __FUNCTION__, __LINE__);
+
+       retif(ad == NULL,, "Invalid parameter!");
+
+       eo = ad->notilist;
+       retif(eo == NULL,, "Failed to get noti genlist.");
+
+       /* Clear genlist */
+       elm_genlist_clear(eo);
+
+       /* Update notification list */
+       _quickpanel_noti_get_new_list();
+
+       /* append ongoing data to genlist */
+       if (g_notification_ongoing_list) {
+               get_list =
+                   notification_list_get_head(g_notification_ongoing_list);
+               noti = notification_list_get_data(get_list);
+
+               while (get_list != NULL) {
+                       notification_get_display_applist(noti, &applist);
+
+                       if (applist &
+                           NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
+                               elm_genlist_item_append(eo, itc_noti, noti,
+                                                       NULL,
+                                                       ELM_GENLIST_ITEM_NONE,
+                                                       quickpanel_noti_select_cb,
+                                                       noti);
+                       }
+
+                       get_list = notification_list_get_next(get_list);
+                       noti = notification_list_get_data(get_list);
+               }
+       }
+
+       /* append noti title to genlist */
+       grp = elm_genlist_item_append(eo, g_itc, ad,
+                                     NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+
+       /* append noti data to genlist */
+       if (g_notification_list) {
+               get_list = notification_list_get_head(g_notification_list);
+               noti = notification_list_get_data(get_list);
+
+               while (get_list != NULL) {
+                       notification_get_display_applist(noti, &applist);
+
+                       if (applist &
+                           NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
+                               elm_genlist_item_append(eo, itc_noti, noti,
+                                                       grp,
+                                                       ELM_GENLIST_ITEM_NONE,
+                                                       quickpanel_noti_select_cb,
+                                                       noti);
+                       }
+
+                       get_list = notification_list_get_next(get_list);
+                       noti = notification_list_get_data(get_list);
+               }
+       }
+}
+
+static void _quickpanel_noti_delete_volatil_data(void)
+{
+       notification_list_h noti_list = NULL;
+       notification_list_h noti_list_head = NULL;
+       notification_h noti = NULL;
+       int property = 0;
+
+       notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
+
+       noti_list_head = noti_list;
+
+       while (noti_list != NULL) {
+               noti = notification_list_get_data(noti_list);
+               notification_get_property(noti, &property);
+
+               if (property & NOTIFICATION_PROP_VOLATILE_DISPLAY) {
+                       notification_set_property(noti,
+                                                 property |
+                                                 NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE);
+                       notification_delete(noti);
+               }
+
+               noti_list = notification_list_get_next(noti_list);
+       }
+
+       notification_free_list(noti_list_head);
+
+       notification_update(NULL);
+}
+
+static void _quickpanel_noti_changed_cb(void *data, notification_type_e type)
+{
+       _quickpanel_noti_update_notilist(data);
+}
+
+static void _quickpanel_noti_update_sim_status_cb(keynode_t * node, void *data)
+{
+       struct appdata *ad = data;
+
+       if (ad != NULL && ad->notilist != NULL) {
+               _quickpanel_noti_update_notilist(ad);
+       }
+}
+
+static int _quickpanel_noti_register_event_handler(struct appdata *ad)
+{
+       int ret = 0;
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       g_window = ad->noti.win;
+
+       /* Add dbus signal */
+       e_dbus_init();
+       ad->dbus_connection = e_dbus_bus_get(DBUS_BUS_SYSTEM);
+       if (ad->dbus_connection == NULL) {
+               ERR("noti register : failed to get dbus bus");
+               return -1;
+       }
+
+       ad->dbus_handler_size = e_dbus_signal_handler_add(ad->dbus_connection,
+                                                         NULL,
+                                                         "/dbus/signal",
+                                                         "notification.ongoing",
+                                                         "update_progress",
+                                                         _quickpanel_noti_item_progress_update_cb,
+                                                         ad->notilist);
+       if (ad->dbus_handler_size == NULL) {
+               ERR("noti register : failed to add size signal");
+       }
+
+       ad->dbus_handler_progress =
+           e_dbus_signal_handler_add(ad->dbus_connection, NULL, "/dbus/signal",
+                                     "notification.ongoing", "update_size",
+                                     _quickpanel_noti_item_size_update_cb,
+                                     ad->notilist);
+       if (ad->dbus_handler_progress == NULL) {
+               ERR("noti register : failed to add progress signal");
+       }
+
+       ad->dbus_handler_content =
+           e_dbus_signal_handler_add(ad->dbus_connection, NULL, "/dbus/signal",
+                                     "notification.ongoing", "update_content",
+                                     _quickpanel_noti_item_content_update_cb,
+                                     ad->notilist);
+       if (ad->dbus_handler_content == NULL) {
+               ERR("noti register : failed to add content signal");
+       }
+
+       /* Notify vconf key */
+       ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,
+                                      _quickpanel_noti_update_sim_status_cb,
+                                      (void *)ad);
+       if (ret != 0) {
+               ERR("Failed to register SIM_SLOT change callback!");
+       }
+
+       /* Register notification changed cb */
+       notification_resister_changed_cb(_quickpanel_noti_changed_cb, ad);
+
+       /* Update notification list */
+       _quickpanel_noti_update_notilist(ad);
+
+       return ret;
+}
+
+static int _quickpanel_noti_unregister_event_handler(struct appdata *ad)
+{
+       int ret = 0;
+
+       /* Unregister notification changed cb */
+       notification_unresister_changed_cb(_quickpanel_noti_changed_cb);
+
+       /* Ignore vconf key */
+       ret =
+           vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,
+                                    _quickpanel_noti_update_sim_status_cb);
+       if (ret != 0) {
+               ERR("Failed to ignore SIM_SLOT change callback!");
+       }
+
+       /* Delete dbus signal */
+       if (ad->dbus_handler_size != NULL) {
+               e_dbus_signal_handler_del(ad->dbus_connection,
+                                         ad->dbus_handler_size);
+               ad->dbus_handler_size = NULL;
+       }
+       if (ad->dbus_handler_progress != NULL) {
+               e_dbus_signal_handler_del(ad->dbus_connection,
+                                         ad->dbus_handler_progress);
+               ad->dbus_handler_progress = NULL;
+       }
+       if (ad->dbus_handler_content != NULL) {
+               e_dbus_signal_handler_del(ad->dbus_connection,
+                                         ad->dbus_handler_content);
+               ad->dbus_handler_content = NULL;
+       }
+
+       if (ad->dbus_connection != NULL) {
+               e_dbus_connection_close(ad->dbus_connection);
+               ad->dbus_connection = NULL;
+       }
+
+       return QP_OK;
+}
+
+static void _quickpanel_noti_gl_style_init(void)
+{
+       Elm_Genlist_Item_Class *noti = NULL;
+       Elm_Genlist_Item_Class *group = NULL;
+
+       /* item style for noti items*/
+       noti = elm_genlist_item_class_new();
+       if (noti) {
+               noti->item_style = "notification_item";
+               noti->func.text_get = _quickpanel_noti_gl_get_text;
+               noti->func.content_get = _quickpanel_noti_gl_get_content;
+               noti->func.state_get = _quickpanel_noti_gl_get_state;
+               itc_noti = noti;
+       }
+
+       /* item style for noti group title */
+       group = elm_genlist_item_class_new();
+       if (group) {
+               group->item_style = "qp_group_title";
+               group->func.text_get = _quickpanel_noti_gl_get_group_text;
+               group->func.content_get = _quickpanel_noti_gl_get_group_content;
+               g_itc = group;
+       }
+}
+
+static void _quickpanel_noti_gl_style_fini(void)
+{
+       if (itc_noti) {
+               elm_genlist_item_class_free(itc_noti);
+               itc_noti = NULL;
+       }
+
+       if (g_itc) {
+               elm_genlist_item_class_free(g_itc);
+               g_itc = NULL;
+       }
+}
+
+static Evas_Object *_quickpanel_noti_create_notilist(Evas_Object * parent)
+{
+       Evas_Object *gl = NULL;
+
+       gl = elm_genlist_add(parent);
+       retif(gl == NULL, NULL, "Failed to add elm genlist.");
+
+       return gl;
+}
+
+static int _quickpanel_noti_add_layout(struct appdata *ad)
+{
+       Evas_Object *eo = NULL;
+       char buf[1024] = { 0, };
+
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       eo = _quickpanel_noti_create_notilist(ad->noti.ly);
+       retif(eo == NULL, QP_FAIL, "Failed to create notification list!");
+
+       _quickpanel_noti_gl_style_init();
+
+       edje_object_part_swallow(_EDJ(ad->noti.ly), "qp.noti.swallow.notilist",
+                                eo);
+       ad->notilist = eo;
+
+       elm_theme_extension_add(NULL, DEFAULT_CUSTOM_EDJ);
+
+       return QP_OK;
+}
+
+static void _quickpanel_noti_del_layout(struct appdata *ad)
+{
+       retif(ad == NULL,, "Invalid parameter!");
+
+       if (ad->notilist) {
+               evas_object_hide(ad->notilist);
+               evas_object_del(ad->notilist);
+               ad->notilist = NULL;
+       }
+
+       _quickpanel_noti_gl_style_fini();
+}
+
+static int quickpanel_noti_init(void *data)
+{
+       struct appdata *ad = data;
+       int ret = 0;
+
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       /* Add noti layout */
+       ret = _quickpanel_noti_add_layout(ad);
+       retif(ret != QP_OK, QP_FAIL, "Failed to add noti layout!");
+
+       /* Remove ongoing and volatile noti data */
+       notifiation_clear(NOTIFICATION_TYPE_ONGOING);
+
+       _quickpanel_noti_delete_volatil_data();
+
+       /* Register event handler */
+       _quickpanel_noti_register_event_handler(ad);
+
+       return QP_OK;
+}
+
+static int quickpanel_noti_fini(void *data)
+{
+       /* Remove notification list */
+       if (g_notification_ongoing_list != NULL) {
+               notification_free_list(g_notification_ongoing_list);
+
+               g_notification_ongoing_list = NULL;
+       }
+
+       if (g_notification_list != NULL) {
+               notification_free_list(g_notification_list);
+
+               g_notification_list = NULL;
+       }
+
+       /* Unregister event handler */
+       _quickpanel_noti_unregister_event_handler(data);
+
+       /* Delete noti layout */
+       _quickpanel_noti_del_layout((struct appdata *)data);
+
+       return QP_OK;
+}
+
+static int quickpanel_noti_suspend(void *data)
+{
+       suspended = 1;
+
+       return QP_OK;
+}
+
+static int quickpanel_noti_resume(void *data)
+{
+       struct appdata *ad = data;
+       retif(ad == NULL, QP_FAIL, "Invalid parameter!");
+
+       suspended = 0;
+       _quickpanel_noti_update_progressbar(ad->notilist, NULL);
+
+       return QP_OK;
+}
+
+void quickpanel_noti_lang_changed(void *data)
+{
+       struct appdata *ad = data;
+
+       retif(ad == NULL,, "Invalid parameter!");
+
+       _quickpanel_noti_update_notilist(ad);
+}
diff --git a/daemon/notifications/noti_display_app.c b/daemon/notifications/noti_display_app.c
new file mode 100644 (file)
index 0000000..e120cd1
--- /dev/null
@@ -0,0 +1,425 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <E_Notify.h>
+#include <E_Notification_Daemon.h>
+#include <Elementary.h>
+#include "noti_win.h"
+#include "quickpanel-ui.h"
+#include "noti_display_app.h"
+
+#define INFO(str, args...) fprintf(stdout, str"\n", ##args)
+#define ERR(str, args...) fprintf(stderr, str"\n", ##args)
+
+static E_Notification_Daemon *g_notification_daemon;
+static const char *data_key = "_noti_data";
+static Evas_Object *app_win;
+
+struct Daemon_Data {
+       E_Notification_Daemon *daemon;
+       Eina_List *notes;
+       double default_timeout;
+       int next_id;
+};
+
+struct Timer_Data {
+       struct Daemon_Data *daemon_data;
+       E_Notification *n;
+       Ecore_Timer *timer;
+       enum Noti_Orient orient;
+};
+
+struct Noti_Data {
+       E_Notification *n;
+       const char *time;
+};
+
+/* Windows to display different orientations of notification */
+static Evas_Object *noti_win[NOTI_ORIENT_LAST];
+
+Eina_List *notification_daemon_note_list_get()
+{
+       struct Daemon_Data *daemon_data;
+
+       if (!g_notification_daemon)
+               return NULL;
+       daemon_data = e_notification_daemon_data_get(g_notification_daemon);
+       if (!daemon_data)
+               return NULL;
+       return daemon_data->notes;
+}
+
+void notification_daemon_note_list_clear()
+{
+       struct Daemon_Data *daemon_data;
+       Eina_List *l;
+       E_Notification *n;
+       struct Noti_Data *noti_data;
+
+       if (!g_notification_daemon)
+               return;
+       daemon_data = e_notification_daemon_data_get(g_notification_daemon);
+       if (!daemon_data)
+               return;
+       EINA_LIST_FOREACH(daemon_data->notes, l, noti_data) {
+               daemon_data->notes = eina_list_remove(daemon_data->notes,
+                       noti_data);
+               n = noti_data->n;
+               eina_stringshare_replace(&noti_data->time, NULL);
+               e_notification_unref(n);
+               free(noti_data);
+       }
+}
+
+static struct Noti_Data *_notification_daemon_noti_data_find(
+       struct Daemon_Data *daemon_data, E_Notification *n)
+{
+       Eina_List *l;
+       struct Noti_Data *noti_data;
+
+       EINA_LIST_FOREACH(daemon_data->notes, l, noti_data)
+       if (noti_data->n == n)
+               return noti_data;
+
+       return NULL;
+}
+
+static void _notification_daemon_note_close(struct Daemon_Data *daemon_data,
+       E_Notification *n, int reason)
+{
+       struct Noti_Data *noti_data;
+       struct Noti_Data *noti_data_temp;
+       Eina_List *l;
+
+       noti_data = _notification_daemon_noti_data_find(daemon_data, n);
+       if (!noti_data)
+               return;
+       daemon_data->notes = eina_list_remove(daemon_data->notes, noti_data);
+       n = noti_data->n;
+       eina_stringshare_replace(&noti_data->time, NULL);
+       e_notification_unref(n);
+       free(noti_data);
+       e_notification_closed_set(n, 1);
+       e_notification_daemon_signal_notification_closed(daemon_data->daemon,
+               e_notification_id_get(n), reason);
+}
+
+static void _note_destroy(struct Timer_Data *timer_data,
+       enum E_Notification_Closed_Reason reason)
+{
+       enum Noti_Orient orient;
+
+       if (!timer_data)
+               return;
+       orient = timer_data->orient;
+       if (!e_notification_closed_get(timer_data->n))
+               _notification_daemon_note_close(timer_data->daemon_data,
+                       timer_data->n,
+                       reason);
+       e_notification_unref(timer_data->n);
+       ecore_timer_del(timer_data->timer);
+       free(timer_data);
+       if (noti_win[orient]) {
+               evas_object_data_set(noti_win[orient], data_key, NULL);
+               evas_object_del(noti_win[orient]);
+               noti_win[orient] = NULL;
+       }
+}
+
+Eina_Bool _note_close_timer_cb(void *data)
+{
+       _note_destroy(data, E_NOTIFICATION_CLOSED_EXPIRED);
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static E_Notification *_notification_daemon_note_open_find(
+               struct Daemon_Data *daemon_data, unsigned int id)
+{
+       Eina_List *l;
+       struct Noti_Data *noti_data;
+
+       EINA_LIST_FOREACH(daemon_data->notes, l, noti_data)
+       if (e_notification_id_get(noti_data->n) == id)
+               return noti_data->n;
+
+       return NULL;
+}
+
+static void _notification_daemon_note_close_cb(E_Notification_Daemon *daemon,
+       unsigned int notification_id)
+{
+       struct Daemon_Data *daemon_data;
+       E_Notification *n;
+
+       daemon_data = e_notification_daemon_data_get(daemon);
+       n = _notification_daemon_note_open_find(daemon_data, notification_id);
+       if (n)
+               _notification_daemon_note_close(daemon_data, n,
+                       E_NOTIFICATION_CLOSED_REQUESTED);
+       /* else send error */
+}
+
+
+static void _noti_hide_cb(void *data, Evas_Object *obj,
+       const char *emission, const char *source)
+{
+       _note_destroy(data, E_NOTIFICATION_CLOSED_DISMISSED);
+}
+
+static void _noti_button_clicked_cb(void *data, Evas_Object *obj,
+       void *event_info)
+{
+       _note_destroy(data, E_NOTIFICATION_CLOSED_REQUESTED);
+}
+
+static void _noti_show(E_Notification *n, enum Noti_Orient orient,
+       struct Timer_Data *timer_data)
+{
+       const char *summary;
+       Evas_Object *layout;
+       const char *path_icon;
+       Evas_Object *icon;
+       const char *category;
+       const char *data_win_height = NULL;
+       int noti_height = 50;
+       struct Timer_Data *old_timer_data = NULL;
+       Evas_Object *button = NULL;
+
+       if (noti_win[orient]) {
+               old_timer_data = evas_object_data_get(noti_win[orient],
+                       data_key);
+               _note_destroy(old_timer_data, E_NOTIFICATION_CLOSED_REQUESTED);
+       }
+       noti_win[orient] = noti_win_add(NULL);
+       evas_object_data_set(noti_win[orient], data_key, timer_data);
+       layout = elm_layout_add(noti_win[orient]);
+       /* Only for sample code the theme implementation for layout has been
+       used. Apps should implement this layout/edje object which can have
+       at least one TEXT/TEXT BLOCK for showing body of notification and one
+       swallow part for showing icon of the notification.
+       Optionally the summary can be shown as well.
+       Applications need to set the minimum height of the layout or edje object
+       using evas_object_size_hint_min_set which can be used by the
+       notification window to resize itself.
+       */
+       if (orient == NOTI_ORIENT_BOTTOM)
+               elm_layout_theme_set(layout, "tickernoti", "base", "info");
+       else {
+                       elm_layout_theme_set(layout, "tickernoti", "base",
+                               "default");
+                       button = elm_button_add(layout);
+                       elm_object_style_set(button, "tickernoti");
+                       elm_object_text_set(button, _S("IDS_COM_BODY_CLOSE"));
+                       elm_object_part_content_set(layout, "button", button);
+                       evas_object_smart_callback_add(button, "clicked",
+                               _noti_button_clicked_cb, timer_data);
+       }
+       elm_object_signal_callback_add(layout, "request,hide", "",
+               _noti_hide_cb, timer_data);
+       /* Getting the height of the layout from theme just for sample code.
+       App is free to use any other method.
+       */
+       data_win_height = (char *)elm_layout_data_get(layout, "height");
+       if (data_win_height != NULL && elm_config_scale_get() > 0.0)
+               noti_height = (int)(elm_config_scale_get()
+                       * atoi(data_win_height));
+       evas_object_size_hint_min_set(layout, 1, noti_height);
+       noti_win_content_set(noti_win[orient], layout);
+       summary = e_notification_summary_get(n);
+       if (summary)
+               elm_object_part_text_set(layout, "elm.text", summary);
+       else
+               elm_object_part_text_set(layout, "elm.text",
+                       "new notification");
+       path_icon = e_notification_app_icon_get(n);
+       if (path_icon) {
+               INFO("%s", path_icon);
+               icon = elm_icon_add(layout);
+               if (elm_icon_file_set(icon, path_icon, NULL)) {
+                       elm_icon_resizable_set(icon, EINA_TRUE, EINA_TRUE);
+                       elm_object_part_content_set(layout, "icon", icon);
+               }
+       }
+       noti_win_orient_set(noti_win[orient], orient);
+       if (app_win)
+               elm_win_rotation_with_resize_set(noti_win[orient],
+                       elm_win_rotation_get(app_win));
+       evas_object_show(noti_win[orient]);
+}
+
+void _notification_daemon_note_show(struct Daemon_Data *daemon_data,
+       E_Notification *n)
+{
+       int timeout;
+       const char *category;
+       enum Noti_Orient orient = NOTI_ORIENT_TOP;
+       struct Noti_Data *noti_data;
+       time_t current;
+       char buf[256];
+       struct tm time_st;
+       struct Timer_Data *timer_data;
+
+       category = e_notification_hint_category_get(n);
+       if (category) {
+               if (!strcmp("device", category))
+                       orient = NOTI_ORIENT_BOTTOM;
+       }
+
+       noti_data = calloc(1, sizeof(struct Noti_Data));
+       if (!noti_data)
+               return;
+       e_notification_ref(n);
+       noti_data->n = n;
+       current = time(NULL);
+       localtime_r(&current, &time_st);
+       strftime(buf, sizeof(buf), "%I:%M %p", &time_st);
+       eina_stringshare_replace(&noti_data->time, buf);
+       daemon_data->notes = eina_list_append(daemon_data->notes, noti_data);
+       timeout = e_notification_timeout_get(n);
+       timer_data = calloc(1, sizeof(struct Timer_Data));
+       _noti_show(n, orient, timer_data);
+       timer_data->daemon_data = daemon_data;
+       timer_data->orient = orient;
+       e_notification_ref(n);
+       e_notification_closed_set(n, 0);
+       timer_data->n = n;
+       timer_data->timer = ecore_timer_add(timeout == -1 ?
+               daemon_data->default_timeout : (float)timeout / 1000,
+               _note_close_timer_cb, timer_data);
+
+       INFO("Received notification from %s:%s %s",
+       e_notification_app_name_get(n),
+       e_notification_summary_get(n), e_notification_body_get(n));
+}
+
+static int _notification_cb(E_Notification_Daemon *daemon, E_Notification *n)
+{
+       struct Daemon_Data *daemon_data;
+       unsigned int replaces_id;
+       unsigned int new_id;
+
+       daemon_data = e_notification_daemon_data_get(daemon);
+       replaces_id = e_notification_replaces_id_get(n);
+       if (replaces_id)
+               new_id = replaces_id;
+       else
+               new_id = daemon_data->next_id++;
+       e_notification_id_set(n, new_id);
+       _notification_daemon_note_show(daemon_data, n);
+       return new_id;
+}
+
+static Eina_Bool _init()
+{
+       Eina_Bool ret = EINA_FALSE;
+       struct Daemon_Data *daemon_data;
+
+       if (!g_notification_daemon) {
+               e_notification_daemon_init();
+               g_notification_daemon = e_notification_daemon_add("notification"
+                       , "Enlightenment");
+               if (!g_notification_daemon) {
+                       ERR("Unable to add a notification daemon");
+                       return EINA_FALSE;
+               }
+               daemon_data = calloc(1, sizeof(struct Daemon_Data));
+               if (!daemon_data) {
+                       notification_daemon_shutdown();
+                       return EINA_FALSE;
+               }
+               daemon_data->default_timeout = 1.0;
+               daemon_data->daemon = g_notification_daemon;
+               e_notification_daemon_data_set(g_notification_daemon,
+                       daemon_data);
+               e_notification_daemon_callback_notify_set(g_notification_daemon,
+                       _notification_cb);
+               e_notification_daemon_callback_close_notification_set(
+                       g_notification_daemon,
+                       _notification_daemon_note_close_cb);
+               INFO("Initializing Notification Daemon");
+       }
+       ret = !!g_notification_daemon;
+       return ret;
+}
+
+static Eina_Bool _shutdown()
+{
+       struct Daemon_Data *daemon_data;
+       Eina_List *l;
+       E_Notification *n;
+       int i;
+       struct Noti_Data *noti_data;
+       Eina_Bool ret = EINA_FALSE;
+
+       for (i = 0; i < NOTI_ORIENT_LAST; i++)
+               if (noti_win[i]) {
+                       evas_object_del(noti_win[i]);
+                       noti_win[i] = NULL;
+               }
+       if (!g_notification_daemon)
+               return ret;
+       daemon_data = e_notification_daemon_data_get(
+                       g_notification_daemon);
+       if (!daemon_data)
+               return ret;
+       EINA_LIST_FOREACH(daemon_data->notes, l, noti_data) {
+               daemon_data->notes = eina_list_remove(daemon_data->notes,
+                       noti_data);
+               n = noti_data->n;
+               eina_stringshare_replace(&noti_data->time, NULL);
+               e_notification_unref(n);
+               free(noti_data);
+       }
+       free(daemon_data);
+       e_notification_daemon_free(g_notification_daemon);
+       e_notification_daemon_shutdown();
+       g_notification_daemon = NULL;
+       ret = EINA_TRUE;
+       return ret;
+}
+
+void notification_daemon_init()
+{
+       int i;
+
+       if (!_init()) {
+               ERR("Error in intializing the notification daemon");
+               return;
+       }
+       for (i = 0; i < NOTI_ORIENT_LAST; i++)
+               if (noti_win[i]) {
+                       evas_object_del(noti_win[i]);
+                       noti_win[i] = NULL;
+               }
+}
+
+void notification_daemon_win_set(Evas_Object *win)
+{
+       /* This window is used to detect the orientation of the receiver app
+       window to support rotation of the notification window.
+       */
+       app_win = win;
+}
+
+void notification_daemon_shutdown()
+{
+       if (!_shutdown()) {
+               ERR("Error in shutting down the notification daemon");
+               return;
+       }
+       app_win = NULL;
+       INFO("Terminating Notification Daemon");
+}
diff --git a/daemon/notifications/noti_display_app.h b/daemon/notifications/noti_display_app.h
new file mode 100644 (file)
index 0000000..919a591
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __NOTI_DISPLAY_APP_H__
+#define __NOTI_DISPLAY_APP_H__
+#include <Elementary.h>
+
+/* Initializes the notification daemon */
+void notification_daemon_init();
+/* Sets the window which rotation will be used to rotate the notification popup
+while displaying */
+void notification_daemon_win_set(Evas_Object *win);
+/* Terminates the notification daemon */
+void notification_daemon_shutdown();
+#endif
diff --git a/daemon/notifications/noti_win.c b/daemon/notifications/noti_win.c
new file mode 100644 (file)
index 0000000..7e0ddbe
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#define NOTI_HEIGHT 50
+#ifndef __UNUSED__
+#define __UNUSED__ __attribute__((unused))
+#endif
+/* Using this macro to emphasize that some portion like stacking and
+rotation handling are implemented for X based platform
+*/
+
+#ifdef HAVE_X
+#include <Ecore_X.h>
+#endif
+#include "noti_win.h"
+
+struct Internal_Data {
+       Evas_Object *content;
+       Ecore_Event_Handler *rotation_event_handler;
+       Evas_Coord w;
+       Evas_Coord h;
+       int angle;
+       enum Noti_Orient orient;
+};
+
+static const char *data_key = "_data";
+
+static void _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+       void *event_info __UNUSED__)
+{
+       struct Internal_Data *wd = evas_object_data_get(obj, data_key);
+
+       if (!wd)
+               return;
+       if (wd->content)
+               evas_object_show(wd->content);
+}
+
+static void _content_hide(void *data, Evas *e __UNUSED__,
+       Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+       evas_object_hide(data);
+}
+
+static void _content_changed_size_hints(void *data, Evas *e __UNUSED__,
+       Evas_Object *obj, void *event_info __UNUSED__)
+{
+       Evas_Coord h;
+       struct Internal_Data *wd = evas_object_data_get(data, data_key);
+
+       if (!wd)
+               return;
+
+       evas_object_size_hint_min_get(obj, NULL, &h);
+       if ((h > 0)) {
+               wd->h = h;
+               evas_object_size_hint_min_set(obj, wd->w, wd->h);
+               evas_object_size_hint_min_set(data, wd->w, wd->h);
+               evas_object_resize(data, wd->w, wd->h);
+       }
+}
+
+static void _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
+{
+       struct Internal_Data *wd = evas_object_data_get(obj, data_key);
+       Evas_Object *sub = event_info;
+
+       if (!wd)
+               return;
+       if (sub == wd->content) {
+               evas_object_event_callback_del(wd->content, EVAS_CALLBACK_HIDE,
+                       _content_hide);
+               evas_object_event_callback_del(wd->content,
+                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                       _content_changed_size_hints);
+               wd->content = NULL;
+       }
+}
+
+static void _del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+       void *event_info __UNUSED__)
+{
+       struct Internal_Data *wd = evas_object_data_get(obj, data_key);
+
+       if (!wd)
+               return;
+       if (wd->rotation_event_handler)
+               ecore_event_handler_del(wd->rotation_event_handler);
+       evas_object_data_set(data, data_key, NULL);
+       free(wd);
+}
+
+#ifdef HAVE_X
+static void _update_window_hints(Evas_Object *obj)
+{
+       Ecore_X_Window xwin;
+       Ecore_X_Atom _notification_level_atom;
+       int level;
+
+       xwin = elm_win_xwindow_get(obj);
+       ecore_x_icccm_hints_set(xwin, 0, ECORE_X_WINDOW_STATE_HINT_NONE, 0, 0,
+               0, 0, 0);
+       ecore_x_netwm_opacity_set(xwin, 0);
+       /* Create atom for notification level */
+       _notification_level_atom = ecore_x_atom_get(
+               "_E_ILLUME_NOTIFICATION_LEVEL");
+
+       /* HIGH:150, NORMAL:100, LOW:50 */
+       level = 100;
+
+       /* Set notification level of the window */
+       ecore_x_window_prop_property_set(xwin, _notification_level_atom,
+               ECORE_X_ATOM_CARDINAL, 32, &level, 1);
+}
+
+static void _update_geometry_on_rotation(Evas_Object *obj, int angle,
+               int *x, int *y, int *w)
+{
+       Evas_Coord root_w, root_h;
+       struct Internal_Data *wd = evas_object_data_get(obj, data_key);
+
+       if (!wd)
+               return;
+
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w,
+               &root_h);
+
+       /* rotate window */
+       switch (angle) {
+       case 90:
+               *w = root_h;
+               if (wd->orient == NOTI_ORIENT_BOTTOM)
+                       *x = root_w - wd->h;
+               break;
+       case 270:
+               *w = root_h;
+               if (!(wd->orient == NOTI_ORIENT_BOTTOM))
+                       *x = root_w - wd->h;
+               break;
+       case 180:
+               *w = root_w;
+               if (!wd->orient == NOTI_ORIENT_BOTTOM)
+                       *y = root_h - wd->h;
+               break;
+       case 0:
+       default:
+               *w = root_w;
+               if (wd->orient == NOTI_ORIENT_BOTTOM)
+                       *y = root_h - wd->h;
+               break;
+       }
+}
+
+static void _win_rotated(Evas_Object *obj)
+{
+       int x = 0;
+       int y = 0;
+       int w = 0;
+       int angle = 0;
+       struct Internal_Data *wd =  evas_object_data_get(obj, data_key);
+
+       if (!wd)
+               return;
+       angle = elm_win_rotation_get(obj);
+       if (angle % 90)
+               return;
+       angle %= 360;
+       if (angle < 0)
+               angle += 360;
+       wd->angle = angle;
+
+       _update_geometry_on_rotation(obj, wd->angle, &x, &y, &w);
+
+       evas_object_move(obj, x, y);
+       wd->w = w;
+       evas_object_resize(obj, wd->w, wd->h);
+       _update_window_hints(obj);
+}
+
+static Eina_Bool _prop_change(void *data, int type __UNUSED__, void *event)
+{
+       Ecore_X_Event_Window_Property *ev;
+       struct Internal_Data *wd = evas_object_data_get(data, data_key);
+
+       if (!wd)
+               return ECORE_CALLBACK_PASS_ON;
+       ev = event;
+       if (ev->atom == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE)
+               if (ev->win == elm_win_xwindow_get(data))
+                       _win_rotated(data);
+       return ECORE_CALLBACK_PASS_ON;
+}
+#endif
+
+Evas_Object *noti_win_add(Evas_Object *parent)
+{
+       Evas_Object *win;
+       Evas_Object *bg;
+       struct Internal_Data *wd;
+       Evas_Coord w = 0;
+
+       win = elm_win_add(parent, "noti_win", ELM_WIN_NOTIFICATION);
+       if (!win)
+               return NULL;
+       elm_win_title_set(win, "noti_win");
+       elm_win_borderless_set(win, EINA_TRUE);
+       elm_win_autodel_set(win, EINA_TRUE);
+       elm_win_alpha_set(win, EINA_TRUE);
+       evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND,
+               EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(win, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       bg = elm_bg_add(win);
+       evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+               EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(win, bg);
+       evas_object_show(bg);
+
+#ifdef HAVE_X
+       /* set window at the top */
+       _update_window_hints(win);
+#endif
+       wd = (struct Internal_Data *) calloc(1, sizeof(struct Internal_Data));
+       if (!wd)
+               return NULL;
+       evas_object_data_set(win, data_key, wd);
+       wd->angle = 0;
+       wd->orient = NOTI_ORIENT_TOP;
+       evas_object_move(win, 0, 0);
+#ifdef HAVE_X
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, NULL);
+       evas_object_resize(win, w, NOTI_HEIGHT);
+       wd->rotation_event_handler = ecore_event_handler_add(
+               ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, win);
+#endif
+       wd->w = w;
+       wd->h = NOTI_HEIGHT;
+       evas_object_smart_callback_add(win, "sub-object-del", _sub_del, NULL);
+       evas_object_event_callback_add(win, EVAS_CALLBACK_SHOW, _show, NULL);
+       evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _del, NULL);
+       return win;
+}
+
+void noti_win_content_set(Evas_Object *obj, Evas_Object *content)
+{
+       Evas_Coord h;
+       struct Internal_Data *wd;
+
+       if (!obj)
+               return;
+       wd = evas_object_data_get(obj, data_key);
+       if (!wd)
+               return;
+       if (wd->content)
+               evas_object_del(content);
+       wd->content = content;
+       if (content) {
+               evas_object_size_hint_weight_set(wd->content, EVAS_HINT_EXPAND,
+                       EVAS_HINT_EXPAND);
+               elm_win_resize_object_add(obj, wd->content);
+               evas_object_size_hint_min_get(wd->content, NULL, &h);
+               if (h)
+                       wd->h = h;
+               evas_object_size_hint_min_set(wd->content, wd->w, wd->h);
+               evas_object_resize(obj, wd->w, wd->h);
+               evas_object_event_callback_add(wd->content, EVAS_CALLBACK_HIDE,
+                               _content_hide, obj);
+               evas_object_event_callback_add(wd->content,
+                               EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                               _content_changed_size_hints, obj);
+       }
+}
+
+void noti_win_orient_set(Evas_Object *obj, enum Noti_Orient orient)
+{
+#ifdef HAVE_X
+       Evas_Coord root_w, root_h;
+#endif
+       struct Internal_Data *wd = evas_object_data_get(obj, data_key);
+
+       if (!wd)
+               return;
+       if (orient >= NOTI_ORIENT_LAST)
+               return;
+#ifdef HAVE_X
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w,
+               &root_h);
+#endif
+       switch (orient) {
+       case NOTI_ORIENT_BOTTOM:
+#ifdef HAVE_X
+               evas_object_move(obj, 0, root_h - wd->h);
+#endif
+               wd->orient = NOTI_ORIENT_BOTTOM;
+               break;
+       case NOTI_ORIENT_TOP:
+       default:
+#ifdef HAVE_X
+               evas_object_move(obj, 0, 0);
+#endif
+               wd->orient = NOTI_ORIENT_TOP;
+               break;
+       }
+#ifdef HAVE_X
+       _update_window_hints(obj);
+#endif
+}
+
diff --git a/daemon/notifications/noti_win.h b/daemon/notifications/noti_win.h
new file mode 100644 (file)
index 0000000..0c0705a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __NOTI_WIN_H__
+#define __NOTI_WIN_H__
+#include <Evas.h>
+
+enum Noti_Orient {
+       NOTI_ORIENT_TOP = 0,
+       NOTI_ORIENT_BOTTOM,
+       NOTI_ORIENT_LAST
+       } ;
+
+/* Creates and return a new window (of widget type elm_win) of width equal to
+root window
+*/
+Evas_Object *noti_win_add(Evas_Object *parent);
+
+/* Sets an Evas Object as content of the notification window created using
+noti_win_add
+*/
+void noti_win_content_set(Evas_Object *obj, Evas_Object *content);
+
+/* Sets the orientation of the notification window, this can be of type
+Noti_Orient
+*/
+void noti_win_orient_set(Evas_Object *obj, enum Noti_Orient orient);
+#endif
diff --git a/daemon/notifications/ticker.c b/daemon/notifications/ticker.c
new file mode 100644 (file)
index 0000000..255fd04
--- /dev/null
@@ -0,0 +1,710 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <appcore-common.h>
+#include <vconf.h>
+#include <svi.h>
+#include <mm_sound.h>
+#include <aul.h>
+#include <notification.h>
+#include <time.h>
+
+#include "quickpanel-ui.h"
+#include "common.h"
+#include "noti_win.h"
+
+#define QP_TICKER_DURATION     5
+#define QP_TICKER_DETAIL_DURATION 6
+
+#define TICKER_MSG_LEN                         1024
+#define DEFAULT_ICON ICONDIR           "/quickpanel_icon_default.png"
+
+static Evas_Object *g_window = NULL;
+static Evas_Object *g_ticker = NULL;
+static Ecore_Timer *g_timer = NULL;
+static notification_list_h g_latest_noti_list = NULL;
+static int g_svi = 0;
+
+static int quickpanel_ticker_init(void *data);
+static int quickpanel_ticker_fini(void *data);
+static int quickpanel_ticker_enter_hib(void *data);
+static int quickpanel_ticker_leave_hib(void *data);
+
+QP_Module ticker = {
+       .name = "ticker",
+       .init = quickpanel_ticker_init,
+       .fini = quickpanel_ticker_fini,
+       .hib_enter = quickpanel_ticker_enter_hib,
+       .hib_leave = quickpanel_ticker_leave_hib,
+       .lang_changed = NULL
+};
+
+static int latest_inserted_time;
+
+/**************************************************************************************
+ *
+ * (Static) Util functions
+ *
+ *************************************************************************************/
+
+static int _quickpanel_ticker_check_setting_event_value(notification_h noti)
+{
+       char *pkgname = NULL;
+       char key[512] = { 0, };
+       int ret = 0;
+       int boolval = 0;
+
+       notification_get_application(noti, &pkgname);
+
+       if (pkgname == NULL) {
+               notification_get_pkgname(noti, &pkgname);
+       }
+
+       if (pkgname == NULL) {
+               return -1;      // Ticker is not displaying.
+       }
+
+       if (!strcmp(pkgname, "org.tizen.message")) {
+               ret =
+                   vconf_get_bool
+                   (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_MESSAGES_BOOL,
+                    &boolval);
+               if (ret == 0 && boolval == 0) {
+                       return -1;      // Ticker is not displaying.
+               }
+
+       } else if (!strcmp(pkgname, "org.tizen.email")) {
+               ret =
+                   vconf_get_bool
+                   (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_EMAIL_BOOL, &boolval);
+               if (ret == 0 && boolval == 0) {
+                       return -1;      // Ticker is not displaying.
+               }
+       } else if (!strcmp(pkgname, "org.tizen.download-provider")) {
+               ret =
+                   vconf_get_bool
+                   (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_FILE_TRAN_BOOL,
+                    &boolval);
+               if (ret == 0 && boolval == 0) {
+                       return -1;      // Ticker is not displaying.
+               }
+       }
+       // TODO: VCONFKEY_SETAPPL_STATE_TICKER_NOTI_VMAIL_BOOL, VCONFKEY_SETAPPL_STATE_TICKER_NOTI_SNS_BOOL
+
+       // Check 3rd App
+       snprintf(key, sizeof(key), "db/app-settings/noti-enabled/%s", pkgname);
+       ret = vconf_get_int(key, &boolval);
+       INFO("Key : %s == %d, ret : %d", key, boolval, ret);
+       if (ret == 0 && boolval == 0) {
+               return -1;      // Ticker is not displaying.
+       }
+
+       return 0;               // Displaying ticker!
+}
+
+static Eina_Bool _quickpanel_ticker_hide(void *data)
+{
+       INFO("_quickpanel_ticker_hide");
+       char *pkgname = NULL;
+       int applist = 0;
+       int priv_id = 0;
+
+       if (g_ticker) {
+               evas_object_hide(g_ticker);
+               evas_object_del(g_ticker);
+               g_ticker = NULL;
+       }
+
+       if (g_timer) {
+               g_timer = NULL;
+       }
+
+       if (g_latest_noti_list) {
+               // delete here only ticker noti display item
+               notification_h noti =
+                   notification_list_get_data(g_latest_noti_list);
+               notification_get_display_applist(noti, &applist);
+               if (applist & NOTIFICATION_DISPLAY_APP_TICKER) {
+                       if (applist &
+                           NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
+
+                       } else {
+                               //delete
+                               notification_get_pkgname(noti, &pkgname);
+                               notification_get_id(noti, NULL, &priv_id);
+                               INFO("hide : pkgname : %s, priv_id : %d",
+                                    pkgname, priv_id);
+                               notification_delete_by_priv_id(pkgname,
+                                                              NOTIFICATION_TYPE_NONE,
+                                                              priv_id);
+                       }
+               }
+
+               notification_free_list(g_latest_noti_list);
+               g_latest_noti_list = NULL;
+       }
+}
+
+static void _quickpanel_ticker_detail_hide_cb(void *data, Evas * e,
+                                             Evas_Object * obj,
+                                             void *event_info)
+{
+       INFO("_quickpanel_ticker_detail_hide_cb");
+       Evas_Object *tickernoti = (Evas_Object *) data;
+
+       if (g_timer) {
+               ecore_timer_del(g_timer);
+               g_timer = NULL;
+       }
+
+       evas_object_hide(tickernoti);
+       _quickpanel_ticker_hide(NULL);
+}
+
+static void _quickpanel_ticker_detail_show_cb(void *data, Evas * e,
+                                             Evas_Object * obj,
+                                             void *event_info)
+{
+       INFO("_quickpanel_ticker_detail_show_cb");
+       Evas_Object *tickernoti = (Evas_Object *) data;
+
+       if (g_timer) {
+               ecore_timer_delay(g_timer, QP_TICKER_DETAIL_DURATION);
+       }
+
+       evas_object_hide(tickernoti);
+
+       /* Use style "default" for detailview mode and "info" for text only mode */
+       elm_object_style_set(tickernoti,"default");
+       evas_object_show(tickernoti);
+}
+
+static void _quickpanel_ticker_clicked_cb(void *data, Evas_Object * obj,
+                                         void *event_info)
+{
+       INFO("_quickpanel_ticker_clicked_cb");
+       notification_h noti = (notification_h) data;
+       char *caller_pkgname = NULL;
+       char *pkgname = NULL;
+       bundle *args = NULL;
+       bundle *single_service_handle = NULL;
+       int group_id = 0;
+       int priv_id = 0;
+       int flags = 0;
+       int ret = 0;
+       int val = 0;
+       int flag_launch = 0;
+       int flag_delete = 0;
+       int type = NOTIFICATION_TYPE_NONE;
+
+       retif(noti == NULL,, "Invalid parameter!");
+
+       /* Check idle lock state */
+       ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val);
+       if(ret != 0 || val == VCONFKEY_IDLE_LOCK) {
+               /* If Lock state, there is not any action when clicked. */
+               return;
+       }
+
+       notification_get_pkgname(noti, &caller_pkgname);
+       notification_get_application(noti, &pkgname);
+       if (pkgname == NULL) {
+               pkgname = caller_pkgname;
+       }
+
+       notification_get_id(noti, &group_id, &priv_id);
+       notification_get_property(noti, &flags);
+
+       if (flags & NOTIFICATION_PROP_DISABLE_APP_LAUNCH) {
+               flag_launch = 0;
+       } else {
+               flag_launch = 1;
+       }
+
+       if (flags & NOTIFICATION_PROP_DISABLE_AUTO_DELETE) {
+               flag_delete = 0;
+       } else {
+               flag_delete = 1;
+       }
+
+
+       notification_get_execute_option(noti,
+                                       NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+                                       NULL, &single_service_handle);
+
+       if (flag_launch == 1) {
+               if (single_service_handle != NULL) {
+                       appsvc_run_service(single_service_handle, 0, NULL,
+                                          NULL);
+               } else {
+                       notification_get_args(noti, &args, NULL);
+                       aul_launch_app(pkgname, args);
+               }
+
+               // Hide quickpanel
+               Ecore_X_Window zone;
+               zone = ecore_x_e_illume_zone_get(elm_win_xwindow_get(g_window));
+               ecore_x_e_illume_quickpanel_state_send(zone,
+                                                          ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+       }
+
+       notification_get_type(noti, &type);
+       if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) {
+               notification_delete_group_by_priv_id(caller_pkgname,
+                                                        NOTIFICATION_TYPE_NOTI,
+                                                        priv_id);
+       }
+}
+
+static void _quickpanel_ticker_button_clicked_cb(void *data, Evas_Object * obj,
+                                                void *event_info)
+{
+       if (g_timer) {
+               ecore_timer_del(g_timer);
+               g_timer = NULL;
+       }
+
+       _quickpanel_ticker_hide(NULL);
+}
+
+static Evas_Object *_quickpanel_ticker_create_button(Evas_Object * parent,
+                                                    notification_h noti)
+{
+       Evas_Object *button = NULL;
+       int ret = 0;
+       int val = 0;
+
+       retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!");
+
+       /* Check idle lock state */
+       ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &val);
+       if(ret != 0 || val == VCONFKEY_IDLE_LOCK) {
+               /* If Lock state, button is diabled */
+               return NULL;
+       }
+
+       button = elm_button_add(parent);
+       elm_object_style_set(button, "tickernoti");
+       elm_object_text_set(button, _S("IDS_COM_BODY_CLOSE"));
+       evas_object_smart_callback_add(button, "clicked",
+                                      _quickpanel_ticker_button_clicked_cb,
+                                      noti);
+
+       return button;
+}
+
+static Evas_Object *_quickpanel_ticker_create_icon(Evas_Object * parent,
+                                                  notification_h noti)
+{
+       char *icon_path = NULL;
+       Evas_Object *icon = NULL;
+
+       retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!");
+
+       notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path);
+       icon = elm_icon_add(parent);
+
+       if (icon_path == NULL
+           || (elm_icon_file_set(icon, icon_path, NULL) == EINA_FALSE)) {
+               elm_icon_file_set(icon, DEFAULT_ICON, NULL);
+               elm_icon_resizable_set(icon, EINA_TRUE, EINA_TRUE);
+       }
+
+       return icon;
+}
+
+static char *_quickpanel_ticker_get_label(notification_h noti)
+{
+       char buf[TICKER_MSG_LEN] = { 0, };
+       int len = 0;
+       char *domain = NULL;
+       char *dir = NULL;
+       char *get_title = NULL;
+       char *get_content = NULL;
+       char *result_title = NULL;
+       char *result_content = NULL;
+       char *title_utf8 = NULL;
+       char *content_utf8 = NULL;
+       int ret = 0;
+       int boolval = 0;
+       char *pkgname = NULL;
+
+       retif(noti == NULL, NULL, "Invalid parameter!");
+
+       notification_get_text_domain(noti, &domain, &dir);
+       if (domain != NULL && dir != NULL)
+               bindtextdomain(domain, dir);
+
+       notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+                       &result_title);
+
+       ret = vconf_get_bool(
+               VCONFKEY_SETAPPL_STATE_TICKER_NOTI_DISPLAY_CONTENT_BOOL,
+               &boolval);
+
+       notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+                       &result_content);
+       if (result_title)
+               title_utf8 = elm_entry_utf8_to_markup(result_title);
+
+       if (result_content)
+               content_utf8 = elm_entry_utf8_to_markup(result_content);
+
+       if (title_utf8 && content_utf8) {
+               len = snprintf(buf, sizeof(buf),
+                       "<font_size=26><color=#BABABA>%s</color></font>"
+                       "<br><font_size=29><color=#F4F4F4>%s</color></font>",
+                       title_utf8, content_utf8);
+       } else if (title_utf8) {
+               len = snprintf(buf, sizeof(buf),
+                       "<font_size=29><color=#BABABA>%s</color></font>",
+                       title_utf8);
+       }
+
+       if (title_utf8)
+               free(title_utf8);
+
+       if (content_utf8)
+               free(content_utf8);
+
+       if (len > 0)
+               return strdup(buf);
+
+       return NULL;
+}
+
+static void _noti_hide_cb(void *data, Evas_Object *obj,
+       const char *emission, const char *source)
+{
+       if (g_timer) {
+               ecore_timer_del(g_timer);
+               g_timer = NULL;
+       }
+
+       _quickpanel_ticker_hide(NULL);
+}
+
+static Evas_Object *_quickpanel_ticker_create_tickernoti(void *data)
+{
+       notification_h noti = (notification_h) data;
+       Evas_Object *tickernoti = NULL;
+       Evas_Object *icon = NULL;
+       Evas_Object *detail = NULL;
+       Evas_Object *button = NULL;
+       char *buf = NULL;
+       const char *data_win_height = NULL;
+       int noti_height = 50;
+
+       retif(noti == NULL, NULL, "Invalid parameter!");
+
+       // tickernoti
+       tickernoti = noti_win_add(NULL);
+       retif(tickernoti == NULL, NULL, "Failed to add elm tickernoti.");
+
+       // detail view
+       detail = elm_layout_add(tickernoti);
+       if (!detail) {
+               ERR("Failed to get detailview.");
+               evas_object_del(tickernoti);
+               return NULL;
+       }
+       elm_layout_theme_set(detail, "tickernoti", "base", "default");
+       elm_object_signal_callback_add(detail, "request,hide", "", _noti_hide_cb, NULL);
+       data_win_height = (char *)elm_layout_data_get(detail, "height");
+       if (data_win_height != NULL && elm_config_scale_get() > 0.0)
+               noti_height = (int)(elm_config_scale_get() * atoi(data_win_height));
+       evas_object_size_hint_min_set(detail, 1, noti_height);
+       noti_win_content_set(tickernoti, detail);
+       // icon for detail view
+       icon = _quickpanel_ticker_create_icon(detail, noti);
+       if (icon != NULL)
+               elm_object_part_content_set(detail, "icon", icon);
+
+       // button for detail view
+       button = _quickpanel_ticker_create_button(detail, noti);
+       if (button != NULL)
+               elm_object_part_content_set(detail, "button", button);
+
+       // label
+       buf = _quickpanel_ticker_get_label(noti);
+       if (buf != NULL) {
+               elm_object_part_text_set(detail, "elm.text", buf);
+               free(buf);
+       }
+
+       /* Use style "default" for detailview mode and "info" for text only mode */
+       elm_object_style_set(tickernoti,"default");
+
+       return tickernoti;
+}
+
+static int _quickpanel_ticker_get_angle(void *data)
+{
+       struct appdata *ad = (struct appdata *)data;
+       Ecore_X_Window xwin, root;
+       int ret = 0, angle = 0, count = 0;
+       unsigned char *prop_data = NULL;
+
+       xwin = elm_win_xwindow_get(ad->noti.win);
+       root = ecore_x_window_root_get(xwin);
+
+       ret =
+           ecore_x_window_prop_property_get(root,
+                                            ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE,
+                                            ECORE_X_ATOM_CARDINAL, 32,
+                                            &prop_data, &count);
+
+       if (ret && prop_data) {
+               memcpy(&angle, prop_data, sizeof(int));
+
+               if (prop_data) {
+                       free(prop_data);
+               }
+
+               return angle;
+       } else {
+               ERR("Fail to get angle");
+               if (prop_data) {
+                       free(prop_data);
+               }
+
+               return -1;
+       }
+}
+
+void _quickpanel_ticker_noti_changed_cb(void *data, notification_type_e type)
+{
+       notification_list_h noti_list = NULL;
+       notification_h noti = NULL;
+       notification_h noti_prev = NULL;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+       int angle = 0;
+       int current_inserted_time = 0;
+       time_t insert_time;
+       int flags = 0;
+       int applist = NOTIFICATION_DISPLAY_APP_ALL;
+       int ret = 0;
+
+       INFO("_quickpanel_ticker_noti_changed_cb");
+
+       // Get latest item
+       noti_err = notification_get_grouping_list(type, 1, &noti_list);
+       if (noti_err != NOTIFICATION_ERROR_NONE) {
+               ERR("Fail to notification_get_grouping_list : %d", noti_err);
+               return;
+       }
+
+       noti = notification_list_get_data(noti_list);
+       if (noti == NULL) {
+               ERR("Fail to notification_list_get_data");
+               notification_free_list(noti_list);
+               return;
+       }
+
+       noti_err = notification_get_insert_time(noti, &insert_time);
+       if (noti_err != NOTIFICATION_ERROR_NONE) {
+               ERR("Fail to notification_get_insert_time(%d)", noti_err);
+               notification_free_list(noti_list);
+               return;
+       }
+
+       char *pkgname = NULL;
+       int priv_id = 0;
+       // Save latest item's inserted time
+       current_inserted_time = (int)insert_time;
+       if (latest_inserted_time >= current_inserted_time) {
+               // delete temporary here only ticker noti display item
+               notification_get_display_applist(noti, &applist);
+               if (applist & NOTIFICATION_DISPLAY_APP_TICKER) {
+                       if (applist &
+                           NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
+
+                       } else {
+                               //delete
+                               notification_get_pkgname(noti, &pkgname);
+                               notification_get_id(noti, NULL, &priv_id);
+                               notification_delete_by_priv_id(pkgname,
+                                                              NOTIFICATION_TYPE_NONE,
+                                                              priv_id);
+                       }
+               }
+
+               notification_free_list(noti_list);
+               return;
+       }
+       latest_inserted_time = current_inserted_time;
+
+       // Play sound
+       notification_sound_type_e nsound_type = NOTIFICATION_SOUND_TYPE_NONE;
+       const char *nsound_path = NULL;
+
+       notification_get_sound(noti, &nsound_type, &nsound_path);
+       DBG("Sound : %d, %s", nsound_type, nsound_path);
+       if (nsound_type > NOTIFICATION_SOUND_TYPE_NONE
+           || nsound_type < NOTIFICATION_SOUND_TYPE_MAX) {
+               if (g_svi == 0) {
+                       svi_init(&g_svi);
+               }
+
+               switch (nsound_type) {
+               case NOTIFICATION_SOUND_TYPE_DEFAULT:
+                       svi_play_sound(g_svi, SVI_SND_OPERATION_NEWCHAT);
+                       break;
+               case NOTIFICATION_SOUND_TYPE_USER_DATA:
+                       mm_sound_play_sound(nsound_path,
+                                           VOLUME_TYPE_NOTIFICATION, NULL,
+                                           NULL, NULL);
+                       break;
+               default:
+                       break;
+               }
+       }
+       // Play Vibration
+       notification_vibration_type_e nvibration_type =
+           NOTIFICATION_VIBRATION_TYPE_NONE;
+       const char *nvibration_path = NULL;
+
+       notification_get_vibration(noti, &nvibration_type, &nvibration_path);
+       DBG("Vibration : %d, %s", nvibration_type, nvibration_path);
+       if (nvibration_type > NOTIFICATION_VIBRATION_TYPE_NONE
+           || nvibration_type < NOTIFICATION_VIBRATION_TYPE_MAX) {
+               if (g_svi == 0) {
+                       svi_init(&g_svi);
+               }
+
+               switch (nvibration_type) {
+               case NOTIFICATION_SOUND_TYPE_DEFAULT:
+                       svi_play_vib(g_svi, SVI_VIB_OPERATION_NEWCHAT);
+                       break;
+               case NOTIFICATION_SOUND_TYPE_USER_DATA:
+                       break;
+               default:
+                       break;
+               }
+       }
+       // Skip if previous ticker is still shown
+       if (g_ticker) {
+               // delete temporary here only ticker noti display item
+               notification_get_display_applist(noti, &applist);
+               if (applist & NOTIFICATION_DISPLAY_APP_TICKER) {
+                       if (applist &
+                           NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
+
+                       } else {
+                               //delete
+                               notification_get_pkgname(noti, &pkgname);
+                               notification_get_id(noti, NULL, &priv_id);
+                               notification_delete_by_priv_id(pkgname,
+                                                              NOTIFICATION_TYPE_NONE,
+                                                              priv_id);
+                       }
+               }
+
+               notification_free_list(noti_list);
+               return;
+       }
+       // Check setting's event  notificcation
+       ret = _quickpanel_ticker_check_setting_event_value(noti);
+
+       // Check tickernoti flag
+       notification_get_property(noti, &flags);
+       notification_get_display_applist(noti, &applist);
+
+       if (flags & NOTIFICATION_PROP_DISABLE_TICKERNOTI || ret < 0) {
+               INFO("Disable tickernoti ret : %d", ret);
+       } else if (applist & NOTIFICATION_DISPLAY_APP_TICKER) {
+               // Display ticker
+               // Add timer
+               if (g_timer) {
+                       ecore_timer_del(g_timer);
+               }
+               g_timer =
+                   ecore_timer_add(QP_TICKER_DURATION, _quickpanel_ticker_hide,
+                                   NULL);
+
+               // Show ticker
+               g_ticker = _quickpanel_ticker_create_tickernoti(noti);
+               if (g_ticker == NULL) {
+                       ERR("Fail to create tickernoti");
+                       return;
+               }
+               // Set rotate
+               angle = _quickpanel_ticker_get_angle(data);
+               if (angle > 0) {
+                       elm_win_rotation_with_resize_set(g_ticker, angle);
+               }
+
+               evas_object_show(g_ticker);
+
+               evas_object_event_callback_add(g_ticker, EVAS_CALLBACK_SHOW,
+                                              _quickpanel_ticker_detail_show_cb,
+                                              g_ticker);
+               evas_object_event_callback_add(g_ticker, EVAS_CALLBACK_HIDE,
+                                              _quickpanel_ticker_detail_hide_cb,
+                                              g_ticker);
+
+               evas_object_smart_callback_add(g_ticker, "clicked",
+                                              _quickpanel_ticker_clicked_cb,
+                                              noti);
+       }
+
+       if (g_latest_noti_list) {
+               notification_free_list(g_latest_noti_list);
+       }
+       g_latest_noti_list = noti_list;
+}
+
+/**************************************************************************************
+ *
+ * Util functions
+ *
+ *************************************************************************************/
+static int quickpanel_ticker_init(void *data)
+{
+       struct appdata *ad = (struct appdata *)data;
+
+       latest_inserted_time = time(NULL);
+       g_window = ad->noti.win;
+
+       notification_resister_changed_cb(_quickpanel_ticker_noti_changed_cb,
+                                        data);
+
+       return QP_OK;
+}
+
+static int quickpanel_ticker_fini(void *data)
+{
+       _quickpanel_ticker_hide(NULL);
+
+       if (g_svi != 0) {
+               svi_fini(g_svi);
+               g_svi = 0;
+       }
+
+       return QP_OK;
+}
+
+static int quickpanel_ticker_enter_hib(void *data)
+{
+       return QP_OK;
+}
+
+static int quickpanel_ticker_leave_hib(void *data)
+{
+       return QP_OK;
+}
diff --git a/daemon/quickpanel-ui.c b/daemon/quickpanel-ui.c
new file mode 100644 (file)
index 0000000..f614946
--- /dev/null
@@ -0,0 +1,681 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <heynoti.h>
+#include <vconf.h>
+#include <aul.h>
+#include <unistd.h>
+#include <privilege-control.h>
+#include <iniparser.h>
+
+#include "common.h"
+#include "quickpanel-ui.h"
+#include "modules.h"
+#include "notifications/noti_display_app.h"
+
+#define HIBERNATION_ENTER_NOTI "HIBERNATION_ENTER"
+#define HIBERNATION_LEAVE_NOTI "HIBERNATION_LEAVE"
+
+/* HD base size */
+#define QP_NOTI_WINDOW_H       144
+#define QP_INDICATOR_H         50
+#define QP_HANDLE_H                    50
+
+/* heynoti handle */
+static int g_hdl_heynoti = 0;
+
+/* binary information */
+#define QP_EMUL_STR    "emul"
+#define QP_EMUL_STR_LEN        4
+#define QP_BIN_INFO_PATH       "/etc/info.ini"
+
+static int common_cache_flush(void *evas);
+
+/**********************************************************************************
+  *
+  * HIBERNATION
+  *
+  ********************************************************************************/
+static void _hibernation_enter_cb(void *data)
+{
+       struct appdata *ad = data;
+
+       INFO(" >>>>>>>>>>>>>>> ENTER HIBERNATION!! <<<<<<<<<<<<<<<< ");
+       hib_enter_modules(data);
+       if (ad) {
+               common_cache_flush(ad->noti.evas);
+       }
+}
+
+static void _hibernation_leave_cb(void *data)
+{
+       hib_leave_modules(data);
+       INFO(" >>>>>>>>>>>>>>> LEAVE HIBERNATION!! <<<<<<<<<<<<<<<< ");
+}
+
+/**********************************************************************************
+  *
+  * UI
+  *
+  ********************************************************************************/
+
+static Eina_Bool quickpanel_ui_refresh_cb(void *data)
+{
+       INFO(" >>>>>>>>>>>>>>> Refresh QP Setting modules!! <<<<<<<<<<<<<<<< ");
+
+       refresh_modules(data);
+
+       return EINA_FALSE;
+}
+
+static int quickpanel_ui_lang_changed_cb(void *data)
+{
+       retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+       INFO(" >>>>>>>>>>>>>>> LANGUAGE CHANGED!! <<<<<<<<<<<<<<<< ");
+       lang_change_modules(data);
+
+       return QP_OK;
+}
+
+static int common_cache_flush(void *evas)
+{
+       int file_cache;
+       int collection_cache;
+       int image_cache;
+       int font_cache;
+
+       retif(evas == NULL, QP_FAIL, "Evas is NULL\n");
+
+       file_cache = edje_file_cache_get();
+       collection_cache = edje_collection_cache_get();
+       image_cache = evas_image_cache_get(evas);
+       font_cache = evas_font_cache_get(evas);
+
+       edje_file_cache_set(file_cache);
+       edje_collection_cache_set(collection_cache);
+       evas_image_cache_set(evas, 0);
+       evas_font_cache_set(evas, 0);
+
+       evas_image_cache_flush(evas);
+       evas_render_idle_flush(evas);
+       evas_font_cache_flush(evas);
+
+       edje_file_cache_flush();
+       edje_collection_cache_flush();
+
+       edje_file_cache_set(file_cache);
+       edje_collection_cache_set(collection_cache);
+       evas_image_cache_set(evas, image_cache);
+       evas_font_cache_set(evas, font_cache);
+
+       return QP_OK;
+}
+
+static int quickpanel_ui_low_battery_cb(void *data)
+{
+       return QP_OK;
+}
+
+static int _quickpanel_get_mini_win_height(void *data, int angle)
+{
+       struct appdata *ad = data;
+       Ecore_X_Atom qp_list_atom;
+       Ecore_X_Window root;
+       Ecore_X_Window *qp_lists;
+       int num_qp_lists, i;
+       unsigned int width = 0;
+       unsigned int height = 0;
+       unsigned int border = 0;
+       unsigned int depth = 0;
+       int rel_x, rel_y;
+       Ecore_X_Display *dpy = NULL;
+       int ret_height = 0;
+       int ret_width = 0;
+       int ret_mini_height = 0;
+
+       root = ecore_x_window_root_first_get();
+
+       Ecore_X_Window noti_xwin = elm_win_xwindow_get(ad->noti.win);
+
+       qp_list_atom = ecore_x_atom_get("_E_ILLUME_QUICKPANEL_WINDOW_LIST");
+       if (!qp_list_atom) {
+               return 0;
+       }
+
+       num_qp_lists =
+           ecore_x_window_prop_window_list_get(root, qp_list_atom, &qp_lists);
+
+       if (num_qp_lists > 0) {
+               for (i = 0; i < num_qp_lists; i++) {
+                       dpy = ecore_x_display_get();
+
+                       ecore_x_window_size_get(qp_lists[i], &width, &height);
+                       if (noti_xwin == qp_lists[i]) {
+                               INFO("[%d] Notification window : (%d X %d)", i,
+                                    width, height);
+                       } else {
+                               INFO("[%d] Other window : (%d X %d)", i, width,
+                                    height);
+                               ret_height = ret_height + height;
+                               ret_width = ret_width + width;
+
+                               if (height > width) {
+                                       ret_mini_height += width;
+                               } else {
+                                       ret_mini_height += height;
+                               }
+                       }
+               }
+       }
+
+       if (qp_lists) {
+               free(qp_lists);
+       }
+
+       INFO("ret width : %d, ret height : %d, ret_mini_height : %d", ret_width,
+            ret_height, ret_mini_height);
+
+       return ret_mini_height;
+}
+
+static int _resize_noti_win(void *data, int new_angle)
+{
+       struct appdata *ad = (struct appdata *)data;
+       int w = 0, h = 0;
+       int diff = (ad->angle > new_angle) ?
+           (ad->angle - new_angle) : (new_angle - ad->angle);
+       int mini_height = 0;
+
+       mini_height = _quickpanel_get_mini_win_height(data, new_angle);
+
+       int tot_h = QP_HANDLE_H * ad->scale + mini_height;
+
+       /* get indicator height */
+       ecore_x_e_illume_indicator_geometry_get(ecore_x_window_root_first_get(),
+                                               NULL, NULL, NULL, &h);
+       if (h <= 0)
+               h = QP_INDICATOR_H;
+
+       tot_h += h;
+
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+       if (diff % 180 != 0) {
+               if (ad->angle % 180 == 0) {
+                       INFO("(2-1)Resize noti window to %d x %d diff : %d, angle : %d,  xwin(%dx%d), mini_h : %d", w - tot_h, h, diff, ad->angle, w, h, mini_height);
+                       evas_object_resize(ad->noti.win, w - tot_h, h);
+               } else {
+                       INFO("(2-2)Resize noti window to %d x %d diff : %d, angle : %d, xwin(%dx%d), mini_h : %d", h - tot_h, w, diff, ad->angle, w, h, mini_height);
+                       evas_object_resize(ad->noti.win, h - tot_h, w);
+               }
+       }
+       return 0;
+}
+
+static Eina_Bool quickpanel_ui_client_message_cb(void *data, int type,
+                                                void *event)
+{
+       struct appdata *ad = data;
+       Ecore_X_Event_Client_Message *ev =
+           (Ecore_X_Event_Client_Message *) event;
+       int new_angle;
+
+       retif(data == NULL
+             || event == NULL, ECORE_CALLBACK_RENEW, "Invalid parameter!");
+
+       if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE) {
+               new_angle = ev->data.l[0];
+               if (new_angle != ad->angle) {
+                       INFO("ROTATION: %d", new_angle);
+                       _resize_noti_win(ad, new_angle);
+                       elm_win_rotation_with_resize_set(ad->noti.win,
+                                                        new_angle);
+                       ad->angle = new_angle;
+               }
+
+               ecore_idler_add(quickpanel_ui_refresh_cb, ad);
+       }
+       return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool quickpanel_ui_window_property_cb(void *data, int type,
+                                                 void *event)
+{
+       Ecore_X_Event_Window_Property *e = event;
+       struct appdata *ad = data;
+       Ecore_X_Window root, mini_win;
+       Ecore_X_Atom qp_list_atom;
+       Ecore_X_Atom mini_atom;
+       int mini_height = 0, tot_h = 0, w = 0, h = 0;
+
+       if (e == NULL || ad == NULL)
+               return ECORE_CALLBACK_RENEW;
+
+       qp_list_atom = ecore_x_atom_get("_E_ILLUME_QUICKPANEL_WINDOW_LIST");
+
+       if (e->atom == qp_list_atom) {
+               INFO("QuickPanel Window ADDED!");
+
+               mini_height = _quickpanel_get_mini_win_height(data, ad->angle);
+               tot_h = QP_HANDLE_H * ad->scale + mini_height;
+
+               ecore_x_e_illume_indicator_geometry_get
+                   (ecore_x_window_root_first_get(), NULL, NULL, NULL, &h);
+               if (h <= 0) {
+                       h = QP_INDICATOR_H;
+               }
+
+               tot_h += h;
+
+               ecore_x_window_size_get(ecore_x_window_root_first_get(), &w,
+                                       &h);
+
+               if (ad->angle % 180 == 0) {
+                       INFO("(1)Resize noti window to %d x %d angle : %d,  xwin(%dx%d), mini_h : %d", w, h - tot_h, ad->angle, w, h, mini_height);
+                       evas_object_resize(ad->noti.win, w, h - tot_h);
+               } else {
+                       INFO("(2)Resize noti window to %d x %d angle : %d,  xwin(%dx%d), mini_h : %d", h, w - tot_h, ad->angle, w, h, mini_height);
+                       evas_object_resize(ad->noti.win, h, w - tot_h);
+               }
+       }
+       return ECORE_CALLBACK_RENEW;
+}
+
+static Evas_Object *_quickpanel_ui_window_add(const char *name, int prio)
+{
+       Evas_Object *eo = NULL;
+       Ecore_X_Window xwin;
+
+       eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (eo != NULL) {
+               elm_win_title_set(eo, name);
+               elm_win_borderless_set(eo, EINA_TRUE);
+               elm_win_autodel_set(eo, EINA_TRUE);
+               elm_win_alpha_set(eo, EINA_TRUE);
+
+               /* set this window as a quickpanel */
+               elm_win_quickpanel_set(eo, 1);
+               elm_win_quickpanel_priority_major_set(eo, prio);
+
+               /* icccm name class set */
+               xwin = elm_win_xwindow_get(eo);
+               ecore_x_icccm_name_class_set(xwin, "QUICKPANEL", "QUICKPANEL");
+               evas_object_show(eo);
+       }
+
+       return eo;
+}
+
+static Evas_Object *_quickpanel_ui_load_edj(Evas_Object * win, const char *file,
+                                           const char *group)
+{
+       Eina_Bool r;
+       Evas_Object *eo = NULL;
+
+       retif(win == NULL, NULL, "Invalid parameter!");
+
+       eo = elm_layout_add(win);
+       retif(eo == NULL, NULL, "Failed to add layout object!");
+
+       r = elm_layout_file_set(eo, file, group);
+       retif(r != EINA_TRUE, NULL, "Failed to set edje object file!");
+
+       evas_object_size_hint_weight_set(eo,
+                                        EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(win, eo);
+       evas_object_show(eo);
+
+       return eo;
+}
+
+static int _quickpanel_ui_create_noti(struct appdata *ad)
+{
+       char buf[1024] = { 0, };
+
+       /* create noti window */
+       ad->noti.win =
+           _quickpanel_ui_window_add("Quickpanel Noti Wiondow", QP_PRIO_NOTI);
+       if (ad->noti.win == NULL) {
+               ERR("ui create : failed to create noti window.");
+       }
+
+       /* load noti edje */
+       snprintf(buf, sizeof(buf), "%s/%s_noti.edj", EDJDIR, PACKAGE);
+
+       ad->noti.ly = _quickpanel_ui_load_edj(ad->noti.win, buf, GROUP_NOTI);
+       if (ad->noti.ly == NULL) {
+               INFO("ui create : failed to load %s", buf);
+               /* load default theme */
+               ad->noti.ly =
+                   _quickpanel_ui_load_edj(ad->noti.win, DEFAULT_NOTI_EDJ,
+                                           GROUP_NOTI);
+               if (ad->noti.ly == NULL) {
+                       ERR("ui create : failed to create noti theme.");
+               }
+       }
+
+       /* get noti evas */
+       ad->noti.evas = evas_object_evas_get(ad->noti.win);
+
+       return 0;
+}
+
+static int _quickpanel_ui_create_win(void *data)
+{
+       struct appdata *ad = data;
+       int w = 0;
+       int h = 0;
+       retif(data == NULL, QP_FAIL, "Invialid parameter!");
+
+       /* Get resolution and scale */
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+       ad->scale = elm_config_scale_get();
+       if (ad->scale < 0) {
+               ad->scale = 1.0;
+       }
+
+       /* Create window */
+       _quickpanel_ui_create_noti(ad);
+
+       /* Resize window */
+       if (ad->noti.win != NULL) {
+               ad->noti.h =
+                   h - ad->scale * (QP_INDICATOR_H + QP_HANDLE_H);
+               evas_object_resize(ad->noti.win, w, ad->noti.h);
+       }
+
+       return 0;
+}
+
+static int _quickpanel_ui_delete_win(void *data)
+{
+       struct appdata *ad = data;
+       retif(data == NULL, QP_FAIL, "Invialid parameter!");
+
+       /* delete noti window */
+       if (ad->noti.ly != NULL) {
+               evas_object_del(ad->noti.ly);
+               ad->noti.ly = NULL;
+       }
+       if (ad->noti.win != NULL) {
+               evas_object_del(ad->noti.win);
+               ad->noti.win = NULL;
+       }
+}
+
+static void _quickpanel_ui_init_heynoti(struct appdata *ad)
+{
+       int ret = 0;
+
+       /* init heynoti */
+       g_hdl_heynoti = heynoti_init();
+       if (g_hdl_heynoti == -1) {
+               ERR("ui init heynoti : fail to heynoti_init.");
+               g_hdl_heynoti = 0;
+               return;
+       }
+
+       /* subscribe hibernation */
+       heynoti_subscribe(g_hdl_heynoti, HIBERNATION_ENTER_NOTI,
+                         _hibernation_enter_cb, (void *)ad);
+       heynoti_subscribe(g_hdl_heynoti, HIBERNATION_LEAVE_NOTI,
+                         _hibernation_leave_cb, (void *)ad);
+
+       ret = heynoti_attach_handler(g_hdl_heynoti);
+       if (ret == -1) {
+               ERR("ui init heynoti : fail to heynoti_attach_handler.");
+               return;
+       }
+}
+
+static void _quickpanel_ui_fini_heynoti(void)
+{
+       if (g_hdl_heynoti != 0) {
+               /* unsubscribe hibernation */
+               heynoti_unsubscribe(g_hdl_heynoti, HIBERNATION_ENTER_NOTI,
+                                   _hibernation_enter_cb);
+               heynoti_unsubscribe(g_hdl_heynoti, HIBERNATION_LEAVE_NOTI,
+                                   _hibernation_leave_cb);
+
+               /* close heynoti */
+               heynoti_close(g_hdl_heynoti);
+               g_hdl_heynoti = 0;
+       }
+}
+
+static void _quickpanel_ui_init_ecore_event(struct appdata *ad)
+{
+       Ecore_Event_Handler *hdl = NULL;
+
+       /* Register window rotate event */
+       hdl =
+           ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
+                                   quickpanel_ui_client_message_cb, ad);
+       if (hdl == NULL) {
+               ERR("ui init ecore : failed to add handler(ECORE_X_EVENT_CLIENT_MESSAGE)");
+       }
+
+       ad->hdl_client_message = hdl;
+
+       /* Register quickpanel window list changed event */
+       hdl =
+           ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
+                                   quickpanel_ui_window_property_cb, ad);
+       if (hdl == NULL) {
+               ERR("ui init ecore : failed to add handler(ECORE_X_EVENT_WINDOW_PROPERTY)");
+       }
+
+       ad->hdl_win_property = hdl;
+}
+
+static void _quickpanel_ui_fini_ecore_event(struct appdata *ad)
+{
+       if (ad->hdl_client_message != NULL) {
+               ecore_event_handler_del(ad->hdl_client_message);
+               ad->hdl_client_message = NULL;
+       }
+
+       if (ad->hdl_win_property != NULL) {
+               ecore_event_handler_del(ad->hdl_win_property);
+               ad->hdl_win_property = NULL;
+       }
+}
+
+static void _quickpanel_ui_init_appcore_event(struct appdata *ad)
+{
+       /* Register language chagned event */
+       appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE,
+                                  quickpanel_ui_lang_changed_cb, ad);
+
+       /* Register low battery event */
+       appcore_set_event_callback(APPCORE_EVENT_LOW_BATTERY,
+                                  quickpanel_ui_low_battery_cb, ad);
+}
+
+static int _quickpanel_ui_check_emul(void)
+{
+       dictionary *dic = NULL;
+       const char *bin_ver = NULL;
+       char *str = NULL;
+       char *pos = NULL;
+       const char emul[QP_EMUL_STR_LEN + 1] = {0,};
+
+       dic = iniparser_load(QP_BIN_INFO_PATH);
+       if (dic == NULL) {
+               /* When failed to get the info, let's regard the binary as an emulator one */
+               return 1;
+       }
+
+       bin_ver = (const char*)iniparser_getstr(dic, "Version:Build");
+       if (bin_ver != NULL) {
+               str = strdup(bin_ver);
+               if (str != NULL) {
+                       pos = str;
+                       while (*pos++) {
+                               if ('_' == *pos) {
+                                       *pos = ' ';
+                               }
+                       }
+                       sscanf(str, "%*s %4s", emul);
+               }
+               free(str);
+       }
+
+       if (dic != NULL) {
+               iniparser_freedict(dic);
+               dic = NULL;
+       }
+
+       if (!strncmp(emul, QP_EMUL_STR, QP_EMUL_STR_LEN)) {
+               return 1;
+       }
+
+       return 0;
+}
+
+/**********************************************************************************
+  *
+  * Appcore interface
+  *
+  ********************************************************************************/
+
+static int app_create(void *data)
+{
+       pid_t pid;
+       int r;
+
+       pid = setsid();
+       if (pid < 0) {
+               fprintf(stderr, "[QUICKPANEL] Failed to set session id!\n");
+       }
+
+       r = control_privilege();
+       if (r != 0) {
+               fprintf(stderr, "[QUICKPANEL] Failed to control privilege!\n");
+               return -1;
+       }
+
+       r = nice(2);
+       if (r == -1)
+               fprintf(stderr, "[QUICKPANEL] Failed to set nice value!\n");
+
+       return 0;
+}
+
+static int app_terminate(void *data)
+{
+       struct appdata *ad = data;
+       retif(ad == NULL, QP_FAIL, "invalid data.");
+
+       /* fini quickpanel modules */
+       fini_modules(ad);
+
+       common_cache_flush(ad->noti.evas);
+
+       /* unregister system event callback */
+       _quickpanel_ui_fini_heynoti();
+
+       notification_daemon_shutdown();
+
+       _quickpanel_ui_fini_ecore_event(ad);
+
+       /* delete quickpanel window */
+       _quickpanel_ui_delete_win(ad);
+
+       INFO(" >>>>>>>>>>>>>>> QUICKPANEL IS TERMINATED!! <<<<<<<<<<<<<<<< ");
+       return 0;
+}
+
+static int app_pause(void *data)
+{
+       struct appdata *ad = data;
+       retif(ad == NULL, QP_FAIL, "invalid data.");
+
+       suspend_modules(ad);
+
+       common_cache_flush(ad->noti.evas);
+
+       return 0;
+}
+
+static int app_resume(void *data)
+{
+       resume_modules(data);
+
+       return 0;
+}
+
+static int app_reset(bundle * b, void *data)
+{
+       struct appdata *ad = data;
+       int ret = 0;
+
+       retif(ad == NULL, QP_FAIL, "Invialid parameter!");
+
+       INFO(" >>>>>>>>>>>>>>> QUICKPANEL IS STARTED!! <<<<<<<<<<<<<<<< ");
+       /* Check emulator */
+       ad->is_emul = _quickpanel_ui_check_emul();
+       INFO("quickpanel run in %s", ad->is_emul? "Emul":"Device");
+
+       /* create quickpanel window */
+       ret = _quickpanel_ui_create_win(ad);
+       retif(ret != QP_OK, QP_FAIL, "Failed to create window!");
+
+       /* init internationalization */
+       ret = appcore_set_i18n(PACKAGE, LOCALEDIR);
+       if (ret != 0) {
+               ERR("qp reset : fail to set i18n.");
+               return -1;
+       }
+       notification_daemon_win_set(ad->noti.win);
+       /* register system event callback */
+       _quickpanel_ui_init_appcore_event(ad);
+
+       _quickpanel_ui_init_ecore_event(ad);
+
+       _quickpanel_ui_init_heynoti(ad);
+
+       /* init quickpanel modules */
+       init_modules(ad);
+
+       ecore_idler_add(quickpanel_ui_refresh_cb, ad);
+
+       return 0;
+}
+
+int main(int argc, char *argv[])
+{
+       struct appdata ad;
+       struct appcore_ops ops = {
+               .create = app_create,
+               .terminate = app_terminate,
+               .pause = app_pause,
+               .resume = app_resume,
+               .reset = app_reset,
+       };
+
+       memset(&ad, 0x0, sizeof(struct appdata));
+       ops.data = &ad;
+       notification_daemon_init();
+
+       return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
diff --git a/daemon/quickpanel-ui.h b/daemon/quickpanel-ui.h
new file mode 100644 (file)
index 0000000..4f21234
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QUICKPANEL_UI_H__
+#define __QUICKPANEL_UI_H__
+
+#include <Elementary.h>
+
+#if !defined(PACKAGE)
+#  define PACKAGE                      "quickpanel"
+#endif
+
+#if !defined(LOCALEDIR)
+#  define LOCALEDIR                    "/opt/apps/org.tizen.quickpanel/res/locale"
+#endif
+
+#if !defined(EDJDIR)
+#  define EDJDIR                       "/opt/apps/org.tizen.quickpanel/res/edje"
+#endif
+
+/* EDJ theme */
+#define DEFAULT_NOTI_EDJ               EDJDIR"/"PACKAGE"_noti.edj"
+#define DEFAULT_CUSTOM_EDJ             EDJDIR"/"PACKAGE"_theme.edj"
+
+#define GROUP_NOTI             "quickpanel/noti"
+
+#define _EDJ(o) elm_layout_edje_get(o)
+#define _S(str)        dgettext("sys_string", str)
+
+#define QP_PRIO_NOTI           100
+
+#define QP_DEFAULT_WINDOW_H    1280    // Default is HD(720 X 1280)
+
+struct appdata {
+       struct {
+               Evas_Object *win;
+               Evas_Object *ly;
+               Evas *evas;
+               double h;
+       } noti;
+
+       int angle;
+       double scale;
+
+       int is_emul; // 0 : target, 1 : emul
+       Ecore_Event_Handler *hdl_client_message;
+       Ecore_Event_Handler *hdl_win_property;
+
+       Evas_Object *notilist;
+       Evas_Object *idletxtbox;
+
+       E_DBus_Connection *dbus_connection;
+       E_DBus_Signal_Handler *dbus_handler_size;
+       E_DBus_Signal_Handler *dbus_handler_progress;
+       E_DBus_Signal_Handler *dbus_handler_content;
+};
+
+typedef struct _QP_Module {
+       char *name;
+       /* func */
+       int (*init) (void *);
+       int (*fini) (void *);
+       int (*suspend) (void *);
+       int (*resume) (void *);
+       int (*hib_enter) (void *);
+       int (*hib_leave) (void *);
+       void (*lang_changed) (void *);
+       void (*refresh) (void *);
+
+       /* do not modify this area */
+       /* internal data */
+       Eina_Bool state;
+} QP_Module;
+
+#endif                         /* __QUICKPANEL_UI_H__ */
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..fb8d972
--- /dev/null
@@ -0,0 +1,7 @@
+CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.${PROJECT_NAME}.desktop)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.${PROJECT_NAME}.desktop DESTINATION ${DESKTOPDIR})
+
+CONFIGURE_FILE(${PROJECT_NAME}.sh.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} DESTINATION /etc/init.d/)
+
+ADD_SUBDIRECTORY(base)
diff --git a/data/base/CMakeLists.txt b/data/base/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..32a5965
--- /dev/null
@@ -0,0 +1,19 @@
+ADD_CUSTOM_TARGET(quickpanel_noti.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/image
+               ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_noti.edc
+               ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_noti.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_noti.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} quickpanel_noti.edj)
+
+ADD_CUSTOM_TARGET(quickpanel_theme.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/image
+               ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_theme.edc
+               ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_theme.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_theme.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} quickpanel_theme.edj)
+
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_noti.edj DESTINATION ${EDJDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_theme.edj DESTINATION ${EDJDIR})
+
diff --git a/data/base/image/RQ02_button_normal_center.png b/data/base/image/RQ02_button_normal_center.png
new file mode 100755 (executable)
index 0000000..2160f48
Binary files /dev/null and b/data/base/image/RQ02_button_normal_center.png differ
diff --git a/data/base/image/RQ02_button_normal_left.png b/data/base/image/RQ02_button_normal_left.png
new file mode 100755 (executable)
index 0000000..5ca9799
Binary files /dev/null and b/data/base/image/RQ02_button_normal_left.png differ
diff --git a/data/base/image/RQ02_button_normal_right.png b/data/base/image/RQ02_button_normal_right.png
new file mode 100755 (executable)
index 0000000..9a95c86
Binary files /dev/null and b/data/base/image/RQ02_button_normal_right.png differ
diff --git a/data/base/image/RQ02_button_press_center.png b/data/base/image/RQ02_button_press_center.png
new file mode 100755 (executable)
index 0000000..f791a13
Binary files /dev/null and b/data/base/image/RQ02_button_press_center.png differ
diff --git a/data/base/image/RQ02_button_press_left.png b/data/base/image/RQ02_button_press_left.png
new file mode 100755 (executable)
index 0000000..1d75e21
Binary files /dev/null and b/data/base/image/RQ02_button_press_left.png differ
diff --git a/data/base/image/RQ02_button_press_right.png b/data/base/image/RQ02_button_press_right.png
new file mode 100755 (executable)
index 0000000..21aae89
Binary files /dev/null and b/data/base/image/RQ02_button_press_right.png differ
diff --git a/data/base/quickpanel_noti.edc b/data/base/quickpanel_noti.edc
new file mode 100644 (file)
index 0000000..94fcc67
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "quickpanel_noti_def.h"
+
+collections {
+
+       group {
+               name: "quickpanel/noti";
+               parts {
+                       part {
+                               name: "background";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       color: QP_NOTI_BG_COLOR;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.padding.top";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 0;
+                                       fixed: 0 1;
+                                       rel2.relative: 1.0 0.0;
+                                       align: 0.5 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.padding.left";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 0;
+                                       fixed: 1 0;
+                                       rel2.relative: 0.0 1.0;
+                                       align: 0.0 0.5;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.padding.right";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 0;
+                                       fixed: 1 0;
+                                       rel1.relative: 1.0 0.0;
+                                       align: 1.0 0.5;
+                                       visible: 0;
+                               }
+                       }
+
+                       ///////////////////////////////////////////////////////////////////////////////////////
+                       //
+                       // NOTIFICATION LIST AREA
+                       //
+                       ///////////////////////////////////////////////////////////////////////////////////////
+
+                       part {
+                               name: "qp.noti.rect.noti";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to_x: "qp.noti.padding.left";
+                                               to_y: "qp.noti.padding.top";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 0.0;
+                                               to_x: "qp.noti.padding.right";
+                                               to_y: "qp.noti.rect.spn";
+                                       }
+                                       visible: 0;
+                               }
+                       }
+
+                       ////////////////////////////////////////////////////////////////////////////////
+                       //
+                       // LIST AREA
+                       //
+                       ///////////////////////////////////////////////////////////////////////////////
+
+                       part {
+                               name: "qp.noti.swallow.notilist";
+                               type: SWALLOW;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1.to: "qp.noti.rect.noti";
+                                       rel2.to: "qp.noti.rect.noti";
+                                       align: 0.5 0.0;
+                               }
+                       }
+
+                       ///////////////////////////////////////////////////////////////////////////////////////
+                       //
+                       // IDLE TEXT
+                       //
+                       ///////////////////////////////////////////////////////////////////////////////////////
+
+                       part {
+                               name: "qp.noti.spn.padding.left";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       rel2.relative: 0.0 1.0;
+                                       align: 0.0 0.5;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.spn.padding.right";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       rel1.relative: 1.0 0.0;
+                                       align: 1.0 0.5;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.rect.spn";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 44;
+                                       fixed: 0 1;
+                                       align: 0.5 1.0;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                               to: "qp.noti.padding.bottom";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 0.0;
+                                               to: "qp.noti.padding.bottom";
+                                       }
+                                       color: QP_NOTI_SPN_BG_COLOR;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.spn.padding.top";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 {
+                                               to_y: "qp.noti.swallow.spn";
+                                       }
+                                       rel2 {
+                                               to_y: "qp.noti.rect.spn";
+                                       }
+                                       color: QP_NOTI_SPN_BG_COLOR;
+                               }
+                       }
+
+                       part {
+                               name: "qp.noti.swallow.spn";
+                               type: SWALLOW;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 {
+                                               relative: 1.0 0.0;
+                                               to_x: "qp.noti.spn.padding.left";
+                                               to_y: "qp.noti.rect.spn";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                               to_x: "qp.noti.spn.padding.right";
+                                               to_y: "qp.noti.rect.spn";
+                                       }
+                                       align: 0.5 1.0;
+                               }
+                       }
+
+                       ///////////////////////////////////////////////////////////////////////////////////////
+                       //
+                       // BOTTOM PADDING
+                       //
+                       ///////////////////////////////////////////////////////////////////////////////////////
+                       part {
+                               name: "qp.noti.padding.bottom";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       fixed: 0 1;
+                                       min: 0 1;
+                                       align: 0.5 1.0;
+                                       rel1 { relative: 0.0 1.0; }
+                                       color: QP_NOTI_SPN_SEPERATOR_COLOR;
+                               }
+                       }
+               }
+
+
+       }
+
+}
diff --git a/data/base/quickpanel_noti_def.h b/data/base/quickpanel_noti_def.h
new file mode 100755 (executable)
index 0000000..db17ced
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QUICKPANEL_NOTI_DEF_H__
+#define __QUICKPANEL_NOTI_DEF_H__
+
+#define QP_NOTI_BG_COLOR       0 0 0 255
+#define QP_NOTI_SEPERATOR_COLOR        102 102 102 255
+
+#define QP_NOTI_SPN_BG_COLOR   25 25 25 255
+#define QP_NOTI_SPN_SEPERATOR_COLOR                    53 53 53 255
+#endif /*__QUICKPANEL_NOTI_DEF_H__*/
diff --git a/data/base/quickpanel_theme.edc b/data/base/quickpanel_theme.edc
new file mode 100755 (executable)
index 0000000..9a833f3
--- /dev/null
@@ -0,0 +1,803 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "quickpanel_theme_def.h"
+
+collections {
+       group { name: "elm/genlist/item/qp_group_title/default";
+               alias: "elm/genlist/item_odd/qp_group_title/default";
+               data.item: "stacking" "above";
+               data.item: "selectraise" "on";
+               data.item: "labels" "elm.text.text";
+               data.item: "icons" "elm.swallow.icon";
+               data.item: "treesize" "20";
+
+               parts {
+                       part { name: "rect";
+                               type: RECT;
+                               repeat_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 80;
+                                       color: QP_THEME_LIST_TITLE_BG_COLOR;
+                               }
+                       }
+
+                       part { name: "top_line";
+                               type: RECT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 1;
+                                       fixed: 0 1;
+                                       color: QP_THEME_LIST_TITLE_SEPERATOR_COLOR;
+                                       rel2 {
+                                               relative: 1.0 0.0;
+                                       }
+                               }
+                       }
+
+                       part { name: "elm.padding.left";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel2.relative: 0.0 1.0;
+                                       align: 0.0 0.5;
+                               }
+                       }
+                       part { name: "elm.padding.right";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel1.relative: 1.0 0.0;
+                                       align: 1.0 0.5;
+                               }
+                       }
+                       part { name: "elm.padding.top";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel2.relative: 1.0 0.0;
+                                       align: 0.5 0.0;
+                               }
+                       }
+                       part { name: "elm.padding.bottom";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 20;
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       rel1.relative: 0.0 1.0;
+                                       align: 0.5 1.0;
+                               }
+                       }
+
+                       part { name: "elm.text.text";
+                               type: TEXT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 30;
+                                       fixed: 0 1;
+                                       align: 0.0 1.0;
+                                       rel1 {
+                                               to_x: "elm.padding.left";
+                                               to_y: "elm.padding.bottom";
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to_x: "elm.swallow.icon";
+                                               to_y: "elm.padding.bottom";
+                                               relative: 0.0 0.0;
+                                       }
+                                       color: QP_THEME_LIST_TITLE_FONT_COLOR;
+                                       text {
+                                               font: QP_THEME_LIST_TITLE_FONT_NAME;
+                                               size: QP_THEME_LIST_TITLE_FONT_SIZE;
+                                               align: 0.0 1.0;
+                                       }
+                               }
+                       }
+
+                       part { name: "elm.icon.padding.top";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 15;
+                                       fixed: 0 1;
+                                       rel2.relative: 1.0 0.0;
+                                       align: 0.5 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part { name: "elm.icon.padding.bottom";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 15;
+                                       fixed: 0 1;
+                                       rel1.relative: 0.0 1.0;
+                                       align: 0.5 1.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part { name: "elm.swallow.icon";
+                               type: SWALLOW;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 180 50;
+                                       fixed: 1 1;
+                                       align: 1.0 0.5;
+                                       rel1 {
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.icon.padding.top";
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.icon.padding.bottom";
+                                               relative: 0.0 0.0;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       group { name: "elm/genlist/item/notification_item/default";
+               alias: "elm/genlist/item_odd/notification_item/default";
+
+               data.item: "stacking" "above";
+               data.item: "selectraise" "on";
+               data.item: "labels" "elm.text.title elm.text.content elm.text.badge elm.text.time";
+               data.item: "icons" "elm.swallow.icon elm.swallow.thumbnail elm.swallow.progress";
+               data.item: "states" "elm.text.content elm.text.time";
+
+               script {
+                       public ctnt_shown;
+                       public time_shown;
+               }
+
+               parts {
+                       part { name: "base";
+                               type: RECT;
+                               repeat_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 125;
+                                       color: QP_THEME_LIST_ITEM_BG_COLOR;
+                               }
+                       }
+
+                       part { name: "bg_image";
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       color: QP_THEME_LIST_ITEM_BG_COLOR;
+                               }
+                               description {
+                                       state: "selected" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: QP_THEME_LIST_ITEM_BG_COLOR;
+                               }
+                       }
+
+                       part { name: "top_line";
+                               type: RECT;
+                               clip_to: "disclip";
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 1;
+                                       fixed: 0 1;
+                                       visible: 1;
+                                       color: QP_THEME_LIST_ITEM_SEPERATOR_COLOR;
+                                       rel2 {
+                                               relative: 1.0 0.0;
+                                       }
+                               }
+                       }
+
+                       part { name: "elm.padding.top";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 8;
+                                       fixed: 0 1;
+                                       visible: 0;
+                                       rel2.relative: 1.0 0.0;
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part { name: "elm.padding.bottom";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 0 8;
+                                       fixed: 0 1;
+                                       visible: 0;
+                                       rel1.relative: 0.0 1.0;
+                                       align: 0.0 1.0;
+                               }
+                       }
+
+                       part { name: "elm.padding.left";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel2.relative: 0.0 1.0;
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part { name: "elm.padding.right";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 20 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel1.relative: 1.0 0.0;
+                                       align: 1.0 0.0;
+                               }
+                       }
+
+                       part { name: "elm.rect.thumbnail";
+                               clip_to: "disclip";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 105 105;
+                                       fixed: 1 1;
+                                       rel1 {
+                                               relative: 1.0 0.5;
+                                               to_x: "elm.padding.left";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 0.5;
+                                               to_x: "elm.padding.left";
+                                       }
+                                       align: 0.0 0.5;
+                                       color: QP_THEME_LIST_ITEM_THUMBNAIL_COLOR;
+                               }
+                       }
+
+                       part { name: "elm.swallow.thumbnail";
+                               clip_to: "disclip";
+                               type: SWALLOW;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       fixed: 1 1;
+                                       rel1 {
+                                               to: "elm.rect.thumbnail";
+                                       }
+                                       rel2 {
+                                               to: "elm.rect.thumbnail";
+                                       }
+                                       align: 0.5 0.5;
+                               }
+                       }
+
+                       part { name: "elm.swallow.icon";
+                               clip_to: "disclip";
+                               type: SWALLOW;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 54 54;
+                                       fixed: 1 1;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to: "elm.rect.thumbnail";
+                                       }
+                                       rel2 {
+                                               relative: 1.0 1.0;
+                                               to: "elm.rect.thumbnail";
+                                       }
+                                       align: 1.0 1.0;
+                               }
+                       }
+
+                       part { name: "elm.padding.icon.right";
+                               type: RECT;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 15 0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       rel1.to: "elm.rect.thumbnail";
+                                       rel1.relative: 1.0 0.0;
+                                       rel2.to: "elm.rect.thumbnail";
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part { name: "elm.text.title";
+                               clip_to: "disclip";
+                               type: TEXT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 0 32;
+                                       align: 0.0 0.0;
+                                       fixed: 1 1;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to_x: "elm.padding.icon.right";
+                                               to_y: "elm.padding.top";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.padding.top";
+                                       }
+                                       color: QP_THEME_LIST_ITEM_MAIN_FONT_COLOR;
+                                       text {
+                                               font: QP_THEME_LIST_ITEM_MAIN_FONT_NAME;
+                                               size: QP_THEME_LIST_ITEM_MAIN_FONT_SIZE;
+                                               align: 0.0 0.5;
+                                       }
+                               }
+                               description { state: "selected" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: QP_THEME_LIST_ITEM_MAIN_FONT_COLOR;
+                               }
+                       }
+
+                       part { name: "elm.text.time";
+                               clip_to: "disclip";
+                               type: TEXT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       align: 1.0 1.0;
+                                       fixed: 1 0;
+                                       rel1 {
+                                               relative: 0.0 0.0;
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.padding.bottom";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 0.0;
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.padding.bottom";
+                                       }
+                                       color: QP_THEME_LIST_ITEM_TIME_FONT_COLOR;
+                                       text {
+                                               font: QP_THEME_LIST_ITEM_TIME_FONT_NAME;
+                                               size: QP_THEME_LIST_ITEM_TIME_FONT_SIZE;
+                                               min: 1 0;
+                                               align: 1.0 1.0;
+                                       }
+                               }
+                               description { state: "selected" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: QP_THEME_LIST_ITEM_TIME_FONT_COLOR;
+                               }
+                       }
+
+                       part { name: "elm.text.content";
+                               clip_to: "disclip";
+                               type: TEXT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       align: 0.0 0.0;
+                                       min: 0 32;
+                                       fixed: 0 1;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to_x: "elm.padding.icon.right";
+                                               to_y: "elm.text.title";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.text.title";
+                                       }
+                                       color: QP_THEME_LIST_ITEM_SUB_FONT_COLOR;
+                                       text {
+                                               font: QP_THEME_LIST_ITEM_SUB_FONT_NAME;
+                                               size: QP_THEME_LIST_ITEM_SUB_FONT_SIZE;
+                                               align: 0.0 0.5;
+                                       }
+                               }
+                               description { state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       min: 0 32;
+                               }
+                               description { state: "selected" 0.0;
+                                       inherit: "default" 0.0;
+                                       min: 0 32;
+                                       color: QP_THEME_LIST_ITEM_SUB_FONT_COLOR;
+                               }
+                       }
+
+                       part { name: "elm.swallow.progress";
+                               clip_to: "disclip";
+                               type: SWALLOW;
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       min: 0 5;
+                                       fixed: 0 1;
+                                       rel1 {
+                                               relative: 1.0 1.0;
+                                               to_x: "elm.padding.icon.right";
+                                               to_y: "elm.text.content";
+                                       }
+                                       rel2 {
+                                               relative: 0.0 1.0;
+                                               to_x: "elm.padding.right";
+                                               to_y: "elm.text.content";
+                                       }
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part { name: "disclip";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                               }
+                               description {
+                                       state: "disabled" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 255 255 255 64;
+                               }
+                       }
+               }
+
+               programs {
+                       program { name: "show_content";
+                               signal: "elm,state,elm.text.content,active";
+                               source: "elm";
+                               script {
+                                       set_state(PART:"elm.text.content", "show", 0.0);
+                                       set_int(ctnt_shown, 1);
+                               }
+                       }
+                       program { name: "go_active";
+                               signal: "elm,state,selected";
+                               source: "elm";
+                               script {
+                                       set_state(PART:"bg_image", "selected", 0.0);
+                                       set_state(PART:"elm.text.title", "selected", 0.0);
+                                       set_state(PART:"elm.text.time", "selected", 0.0);
+                                       if (get_int(ctnt_shown) == 1)
+                                       set_state(PART:"elm.text.content", "selected", 0.0);
+                               }
+                       }
+                       program { name: "go_passive";
+                               signal: "elm,state,unselected";
+                               source: "elm";
+                               script {
+                                       set_state(PART:"bg_image", "default", 0.0);
+                                       set_state(PART:"elm.text.title", "default", 0.0);
+                                       set_state(PART:"elm.text.time", "show", 0.0);
+                                       if (get_int(ctnt_shown) == 1)
+                                       set_state(PART:"elm.text.content", "show", 0.0);
+                               }
+                       }
+                       program { name: "go_disabled";
+                               signal: "elm,state,disabled";
+                               source: "elm";
+                               action: STATE_SET "disabled" 0.0;
+                               target: "disclip";
+                       }
+                       program { name: "go_enabled";
+                               signal: "elm,state,enabled";
+                               source: "elm";
+                               action: STATE_SET "default" 0.0;
+                               target: "disclip";
+                       }
+               }
+       }
+
+///////////////////////////////////////////////////////////////////////////////////////
+
+#define NOTI_BUTTON_STATE_ENABLED 0
+#define NOTI_BUTTON_STATE_DISABLED 1
+
+       group { name: "elm/button/base/noticlear";
+               images {
+                       image: "RQ02_button_normal_left.png" COMP;
+                       image: "RQ02_button_normal_center.png" COMP;
+                       image: "RQ02_button_normal_right.png" COMP;
+                       image: "RQ02_button_press_left.png" COMP;
+                       image: "RQ02_button_press_center.png" COMP;
+                       image: "RQ02_button_press_right.png" COMP;
+               }
+
+               script {
+                       public button_state = NOTI_BUTTON_STATE_ENABLED;
+               }
+               parts {
+                       part { name: "button_image";
+                               type: IMAGE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1 { to_x: "padding.left"; to_y: "elm.text"; }
+                                       rel2 { to_x: "padding.right"; to_y: "elm.text"; }
+                                       min: 180 50;
+                                       image {
+                                               normal: "RQ02_button_normal_center.png";
+                                       }
+                               }
+                               description { state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "RQ02_button_press_center.png";
+                                       }
+                               }
+                               description { state: "disabled" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                               description { state: "focused" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                       }
+               part { name: "padding.left";
+                       type: IMAGE;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               visible: 0;
+                               min: 2 50;
+                               fixed: 1 0;
+                               image {
+                                               normal: "RQ02_button_normal_left.png";
+                               }
+                               rel1.relative: 0 0;
+                               rel2 { relative: 0.0 1.0; to_x: "elm.text"; }
+                               align: 1 0;
+                       }
+               }
+               part { name: "padding.right";
+                       type: IMAGE;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               visible: 0;
+                               min: 2 50;
+                               fixed: 1 0;
+                               image {
+                                               normal: "RQ02_button_normal_right.png";
+                               }
+                               rel1 { relative: 1.0 0.0; to_x: "elm.text"; }
+                               rel2.relative: 1.0 1.0;
+                               align: 0 0;
+                       }
+               }
+               part {   name: "elm.text";
+                       type: TEXT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               visible: 0;
+                               fixed: 1 1;
+                               align: 0.5 0.5;
+                               color: 249 249 249 255;
+                               text {
+                                       font: "SLP:style=Medium";
+                                       size: 26;
+                                       min: 1 1;
+                                       align: 0.5 0.5;
+                               }
+                       }
+                       description { state: "visible" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                               min: 1 1;
+                       }
+                       description { state: "clicked" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                               min: 1 1;
+                               //color: BUTTON_CONTACT_BUTTON_TEXT_PRESSED_COLOR_INC;
+                       }
+                       description { state: "disabled" 0.0;
+                               inherit: "default" 0.0;
+                               color: 0 0 0 128;
+                       }
+                       description { state: "disabled_visible" 0.0;
+                               inherit: "default" 0.0;
+                               //color: BUTTON_CONTACT_BUTTON_TEXT_DISABLED_COLOR_INC;
+                               visible: 1;
+                               min: 1 1;
+                       }
+                       description { state: "focused" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                               min: 1 1;
+                               //color: BUTTON_CONTACT_BUTTON_TEXT_FOCUSED_COLOR_INC;
+                       }
+               }
+               part { name: "over1";
+                       mouse_events: 0;
+                       description { state: "default" 0.0;
+                               rel2.relative: 1.0 0.5;
+                       }
+               }
+               part { name: "over2";
+                       mouse_events: 1;
+                       repeat_events: 1;
+                       ignore_flags: ON_HOLD;
+                       description { state: "default" 0.0;
+                               rel1.to: "button_image";
+                               rel2.to: "button_image";
+                       }
+               }
+               part { name: "over3";
+                       mouse_events: 1;
+                       repeat_events: 1;
+                       description { state: "default" 0.0;
+                               rel1.to: "button_image";
+                               rel2.to: "button_image";
+                               color: 0 0 0 0;
+                       }
+               }
+               part { name: "disabler";
+                       type: RECT;
+                       description { state: "default" 0.0;
+                               rel1.to: "button_image";
+                               rel2.to: "button_image";
+                               color: 0 0 0 0;
+                               visible: 0;
+                       }
+                       description { state: "disabled" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+               }
+       }
+       programs {
+               program { name: "button_click";
+                       signal: "mouse,down,1";
+                       source: "over2";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+                       after: "button_click_anim";
+               }
+               program { name: "button_click_anim";
+                       action: STATE_SET "clicked" 0.0;
+                       target: "button_image";
+                       target: "elm.text";
+               }
+               program { name: "button_unpress";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program { name: "button_mouseout_clicked";
+                       signal: "mouse,up,1";
+                       source: "over3";
+                       script {
+                               new st[31];
+                               new Float:vl;
+                               get_state(PART:"elm.text", st, 30, vl);
+                               if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
+                               {
+                                       emit("elm,action,default,text,set", "");
+                                       set_state(PART:"elm.text", "visible", 0.0);
+                               }
+                               if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
+                                       set_state(PART:"button_image", "default", 0.0);
+                       }
+                       after: button_unpress;
+               }
+               program { name: "button_unclick3";
+                       signal: "mouse,clicked,1";
+                       source: "over2";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program { name: "text_show";
+                       signal: "elm,state,text,visible";
+                       source: "elm";
+                       script {
+                               if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
+                                       set_state(PART:"elm.text", "visible", 0.0);
+                               else
+                                       set_state(PART:"elm.text", "disabled_visible", 0.0);
+                       }
+               }
+               program { name: "text_hide";
+                       signal: "elm,state,text,hidden";
+                       source: "elm";
+                       action: STATE_SET "default" 0.0;
+                       target: "elm.text";
+               }
+
+               program { name: "disable";
+                       signal: "elm,state,disabled";
+                       source: "elm";
+                       action: STATE_SET "disabled" 0.0;
+                       target: "button_image";
+                       target: "disabler";
+                       after: "disable_text";
+               }
+               program { name: "disable_text";
+                       script {
+                               new st[31];
+                               new Float:vl;
+                               get_state(PART:"elm.text", st, 30, vl);
+                               if (!strcmp(st, "visible"))
+                                       set_state(PART:"elm.text", "disabled_visible", 0.0);
+                               else
+                                       set_state(PART:"elm.text", "disabled", 0.0);
+                               set_int(button_state, NOTI_BUTTON_STATE_DISABLED);
+                       }
+               }
+               program { name: "enable";
+                       signal: "elm,state,enabled";
+                       source: "elm";
+                       action: STATE_SET "default" 0.0;
+                       target: "button_image";
+                       target: "disabler";
+                       after: "enable_text";
+               }
+               program { name: "enable_text";
+                       script {
+                               new st[31];
+                               new Float:vl;
+                               get_state(PART:"elm.text", st, 30, vl);
+                               if (!strcmp(st, "disabled_visible"))
+                                       set_state(PART:"elm.text", "visible", 0.0);
+                               else
+                                       set_state(PART:"elm.text", "default", 0.0);
+                               set_int(button_state, NOTI_BUTTON_STATE_ENABLED);
+                       }
+               }
+               program { name: "focused";
+                       //signal: "elm,action,focus";
+                       //source: "elm";
+                       action: STATE_SET "focused" 0.0;
+                       target: "button_image";
+                       target: "elm.text";
+               }
+               program { name: "unfocused";
+                       //signal: "elm,action,unfocus";
+                       //source: "elm";
+                       action: STATE_SET "default" 0.0;
+                       target: "button_image";
+                       action: STATE_SET "visible" 0.0;
+                       target: "elm.text";
+               }
+       }
+}
+
diff --git a/data/base/quickpanel_theme_def.h b/data/base/quickpanel_theme_def.h
new file mode 100755 (executable)
index 0000000..e28dbea
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QUICKPANEL_THEME_DEF_H__
+#define __QUICKPANEL_THEME_DEF_H__
+
+#define QP_THEME_LIST_TITLE_BG_COLOR                   25 25 25 255
+#define QP_THEME_LIST_TITLE_SEPERATOR_COLOR            102 102 102 255
+
+#define QP_THEME_LIST_TITLE_FONT_NAME                  "SLP:style=Medium"
+#define QP_THEME_LIST_TITLE_FONT_COLOR                 163 163 163 255
+#define QP_THEME_LIST_TITLE_FONT_SIZE                  28
+
+#define QP_THEME_LIST_ITEM_BG_COLOR                            0 0 0 255
+#define QP_THEME_LIST_ITEM_SEPERATOR_COLOR             102 102 102 255
+#define QP_THEME_LIST_ITEM_THUMBNAIL_COLOR             25 25 25 255
+
+#define QP_THEME_LIST_ITEM_MAIN_FONT_NAME              "SLP:style=Medium"
+#define QP_THEME_LIST_ITEM_MAIN_FONT_COLOR             249 249 249 255
+#define QP_THEME_LIST_ITEM_MAIN_FONT_SIZE              28
+
+#define QP_THEME_LIST_ITEM_SUB_FONT_NAME               "SLP:style=Roman"
+#define QP_THEME_LIST_ITEM_SUB_FONT_COLOR              153 153 153 255
+#define QP_THEME_LIST_ITEM_SUB_FONT_SIZE               28
+
+#define QP_THEME_LIST_ITEM_TIME_FONT_NAME              "SLP:style=Roman"
+#define QP_THEME_LIST_ITEM_TIME_FONT_COLOR             153 153 153 255
+#define QP_THEME_LIST_ITEM_TIME_FONT_SIZE              24
+
+#endif /*__QUICKPANEL_THEME_DEF_H__*/
diff --git a/data/quickpanel.desktop.in b/data/quickpanel.desktop.in
new file mode 100644 (file)
index 0000000..daae017
--- /dev/null
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@PROJECT_NAME@
+Comment=@PROJECT_NAME@
+Exec=@BINDIR@/@PROJECT_NAME@
+Terminal=false
+Type=Application
+Categories=Application;Utility;
+Version=0.1.0
+Nodisplay=True
+X-TIZEN-TaskManage=False
+X-TIZEN-Multiple=False
+X-TIZEN-Removable=False
diff --git a/data/quickpanel.sh.in b/data/quickpanel.sh.in
new file mode 100755 (executable)
index 0000000..cf77090
--- /dev/null
@@ -0,0 +1 @@
+@BINDIR@/@PROJECT_NAME@ &
diff --git a/debian/changelog b/debian/changelog
new file mode 100755 (executable)
index 0000000..f370e99
--- /dev/null
@@ -0,0 +1,8 @@
+quickpanel (0.1.1-112) unstable; urgency=low
+
+  * update boilerplate
+  * Git: pkgs/q/quickpanel
+  * Tag: quickpanel_0.1.1-112
+
+ -- Jeonghoon Park <jh1979.park@samsung.com>  Wed, 02 May 2012 17:45:20 +0900
+
diff --git a/debian/compat b/debian/compat
new file mode 100755 (executable)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..58806f9
--- /dev/null
@@ -0,0 +1,17 @@
+Source: quickpanel
+Section: devel
+Priority: extra
+Maintainer: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com> 
+Build-Depends: debhelper (>= 5), libnotification-dev, libaul-1-dev, libelm-dev, libappcore-efl-dev, libappcore-common-dev, dlog-dev, libslp-setting-dev, libheynoti-dev, libsvi-dev, libprivilege-control-dev, libecore-dev, libedbus-dev, libevas-dev, libedje-dev, libmm-sound-dev, libicu-dev, libappsvc-dev, iniparser-dev, syspopup-caller-dev
+Standards-Version: 3.7.2
+
+Package: org.tizen.quickpanel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libappcore-efl-0, libelm-bin, libaul-1, libnotification-0, libsvi-0, libicu
+Description: Quickpanel Application
+
+Package: org.tizen.quickpanel-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, org.tizen.quickpanel (= ${Source-Version})
+Description: Quickpanel Application
diff --git a/debian/org.tizen.quickpanel.install.in b/debian/org.tizen.quickpanel.install.in
new file mode 100755 (executable)
index 0000000..fb4746c
--- /dev/null
@@ -0,0 +1,6 @@
+@PREFIX@/bin/*
+@PREFIX@/res/locale/*
+@PREFIX@/res/edje/*
+@PREFIX@/data
+/opt/share/applications/*
+/etc/init.d/*
diff --git a/debian/org.tizen.quickpanel.postinst.in b/debian/org.tizen.quickpanel.postinst.in
new file mode 100755 (executable)
index 0000000..aabc3cb
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+
+if [ ${USER} = "root" ]
+then
+       chown -R 5000:5000 @PREFIX@/data
+fi
+
+chmod 755 /etc/init.d/quickpanel
+mkdir -p /etc/rc.d/rc5.d/
+mkdir -p /etc/rc.d/rc3.d/
+ln -s  /etc/init.d/quickpanel /etc/rc.d/rc5.d/S51quickpanel
+ln -s  /etc/init.d/quickpanel /etc/rc.d/rc3.d/S51quickpanel
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..b0c2d9f
--- /dev/null
@@ -0,0 +1,114 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+LDFLAGS ?=
+PREFIX ?= /opt/apps/org.tizen.quickpanel
+RESDIR ?= $(PREFIX)/res
+DATADIR ?= $(PREFIX)/data
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)"
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       rm -rf $(CMAKE_BUILD_DIR)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+#      dh_installchangelogs 
+#      dh_installdocs
+#      dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip --dbg-package=org.tizen.quickpanel-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/icons/quickpanel_icon_default.png b/icons/quickpanel_icon_default.png
new file mode 100644 (file)
index 0000000..ef74fd1
Binary files /dev/null and b/icons/quickpanel_icon_default.png differ
diff --git a/packaging/org.tizen.quickpanel.spec b/packaging/org.tizen.quickpanel.spec
new file mode 100644 (file)
index 0000000..453594a
--- /dev/null
@@ -0,0 +1,99 @@
+%define PREFIX "/opt/apps/org.tizen.quickpanel"
+%define RESDIR  "/opt/apps/org.tizen.quickpanel/res"
+%define DATADIR "/opt/apps/org.tizen.quickpanel/data"
+
+Name:       org.tizen.quickpanel
+Summary:    Quick Panel
+Version:    0.1.1
+Release:    1
+Group:      util
+License:    Flora Software License
+Source0:    %{name}-%{version}.tar.gz
+
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(appcore-common)
+BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(svi)
+BuildRequires: pkgconfig(libprivilege-control)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(edbus)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(mm-sound)
+BuildRequires: pkgconfig(iniparser)
+BuildRequires: pkgconfig(icu-i18n)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(syspopup-caller)
+       
+BuildRequires: gettext-tools
+BuildRequires: cmake
+BuildRequires: edje-tools
+
+Requires(post): /usr/bin/vconftool
+
+%description
+Quick Panel
+
+%prep
+%setup -q
+
+
+%build
+LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed";export LDFLAGS
+cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX}
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%post
+INHOUSE_ID="5000"
+
+change_dir_permission()
+{
+    chown $INHOUSE_ID:$INHOUSE_ID $@ 2>/dev/null
+    if [ $? -ne 0 ]; then
+        echo "Failed to change the owner of $@"
+    fi  
+    chmod 775 $@ 2>/dev/null
+    if [ $? -ne 0 ]; then
+        echo "Failed to change the perms of $@"
+    fi  
+}
+
+change_file_executable()
+{
+    chmod +x $@ 2>/dev/null
+    if [ $? -ne 0 ]; then
+        echo "Failed to change the perms of $@"
+    fi  
+}
+
+change_dir_permission %{DATADIR}
+change_file_executable /etc/init.d/quickpanel
+mkdir -p /etc/rc.d/rc5.d/
+mkdir -p /etc/rc.d/rc3.d/
+ln -s /etc/init.d/quickpanel /etc/rc.d/rc5.d/S51quickpanel
+ln -s /etc/init.d/quickpanel /etc/rc.d/rc3.d/S51quickpanel
+
+%postun
+/sbin/ldconfig
+rm -f /etc/rc.d/rc5.d/S51quickpanel
+rm -f /etc/rc.d/rc3.d/S51quickpanel
+
+%files
+%defattr(-,root,root,-)
+/etc/init.d/quickpanel
+/opt/apps/org.tizen.quickpanel/bin/*
+/opt/apps/org.tizen.quickpanel/res/*
+/opt/share/applications/org.tizen.quickpanel.desktop
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..73fbff2
--- /dev/null
@@ -0,0 +1,24 @@
+# for i18n
+
+SET(POFILES de_DE.po el_GR.po en.po es_ES.po fr_FR.po it_IT.po ja_JP.po ko_KR.po nl_NL.po pt_PT.po ru_RU.po tr_TR.po zh_CN.po zh_HK.po zh_TW.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+       SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+       MESSAGE("PO: ${pofile}")
+       GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+       GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+       SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+       ADD_CUSTOM_COMMAND(
+                       OUTPUT ${moFile}
+                       COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+                       DEPENDS ${absPofile}
+       )
+       INSTALL(FILES ${moFile}
+                       DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+       SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100644 (file)
index 0000000..653f2df
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Benachrichtigungen (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Massenspeichermodus"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Deaktiv."
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Aktivieren"
diff --git a/po/el_GR.po b/po/el_GR.po
new file mode 100644 (file)
index 0000000..41508e7
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Ειδοποιήσεις (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Λειτ. μαζικής αποθήκευσης"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Απενεργ."
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Ενεργό"
diff --git a/po/en.po b/po/en.po
new file mode 100644 (file)
index 0000000..3b79262
--- /dev/null
+++ b/po/en.po
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Notifications (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Mass storage mode"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Disable"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Enable"
diff --git a/po/es_ES.po b/po/es_ES.po
new file mode 100644 (file)
index 0000000..7fe974f
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Notificaciones (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Modo almacenam masivo"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Desactiv"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Habilitar"
diff --git a/po/fr_FR.po b/po/fr_FR.po
new file mode 100644 (file)
index 0000000..a7b971e
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Notifications (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Mode stockage de masse"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Désactiv." 
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Activer"
diff --git a/po/it_IT.po b/po/it_IT.po
new file mode 100644 (file)
index 0000000..3c10fe5
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Notifiche (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Modalità archiv. di massa"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Disattiva"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Attiva"
diff --git a/po/ja_JP.po b/po/ja_JP.po
new file mode 100644 (file)
index 0000000..3c8a496
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "通知​(%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "マスストレージモード"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "無効"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "有効"
diff --git a/po/ko_KR.po b/po/ko_KR.po
new file mode 100644 (file)
index 0000000..c067093
--- /dev/null
@@ -0,0 +1,10 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "알림(%d개)"
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "이동식 메모리 모드"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "해제"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "실행"
diff --git a/po/nl_NL.po b/po/nl_NL.po
new file mode 100644 (file)
index 0000000..6a4d236
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Meldingen (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Massaopslagmodus"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Uitzetten"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Aanzetten"
diff --git a/po/pt_PT.po b/po/pt_PT.po
new file mode 100644 (file)
index 0000000..28bafd4
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Notificações (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Modo armazenamento massa"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Desactivar"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Activar"
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100644 (file)
index 0000000..3fefa6f
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Уведомления (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Режим съемного устройства"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Выключить"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Включено"
diff --git a/po/tr_TR.po b/po/tr_TR.po
new file mode 100644 (file)
index 0000000..a913d28
--- /dev/null
@@ -0,0 +1,12 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "Bildirimler (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "Yığın depolama modu"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "Devre dışı"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "Etkin"
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644 (file)
index 0000000..44d318f
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "通知 (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "大容量存储模式"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "禁用"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "启动"
diff --git a/po/zh_HK.po b/po/zh_HK.po
new file mode 100644 (file)
index 0000000..fc59bcf
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "通知(%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "大容量儲存裝置模式"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "關閉"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "啟用"
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644 (file)
index 0000000..a0ca2f4
--- /dev/null
@@ -0,0 +1,11 @@
+msgid "IDS_QP_BODY_NOTIFICATIONS_HPD"
+msgstr "通知 (%d)"
+
+msgid "IDS_QP_BODY_MASS_STORAGE_MODE"
+msgstr "大容量儲存裝置模式"
+
+msgid "IDS_QP_BUTTON_DISABLE"
+msgstr "停用"
+
+msgid "IDS_QP_BUTTON_ENABLE"
+msgstr "啟用"
diff --git a/test/quickpanel_debug_util.c b/test/quickpanel_debug_util.c
new file mode 100755 (executable)
index 0000000..f46b872
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+
+#ifndef LOGFILE
+#define LOGFILE                DATADIR"/quickpanel.log"
+#endif
+
+#define MAXSIZE        (1 << 17)
+
+static char buf[512];
+
+void debug_printf(const char *msg, ...)
+{
+       int fd;
+       va_list arg_list;
+       int len;
+       struct tm ts;
+       time_t ctime;
+       int status;
+       struct stat buffer;
+
+       /* Set time */
+       ctime = time(NULL);
+       localtime_r(&ctime, &ts);
+
+       snprintf(buf, 64, "[%04d/%02d/%02d %02d:%02d:%02d] ",
+                ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday,
+                ts.tm_hour, ts.tm_min, ts.tm_sec);
+       len = strlen(buf);
+
+       va_start(arg_list, msg);
+
+       fd = open(LOGFILE, O_WRONLY | O_CREAT | O_APPEND,
+                 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+       if (fd == -1) {
+               fprintf(stderr, msg, arg_list);
+               return;
+       }
+
+       status = fstat(fd, &buffer);
+       if (!status && (buffer.st_size > MAXSIZE)) {
+               ftruncate(fd, 0);
+       }
+
+       len = vsnprintf(&buf[len], 511, msg, arg_list);
+       /* fix for flawfinder warnings: check string length */
+       if (len < 0) {
+               return;
+       }
+
+       write(fd, buf, strlen(buf));
+
+       close(fd);
+       va_end(arg_list);
+}
diff --git a/test/quickpanel_debug_util.h b/test/quickpanel_debug_util.h
new file mode 100755 (executable)
index 0000000..b018b6e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __QUICKPANEL_DEBUG_UTIL_H_
+#define __QUICKPANEL_DEBUG_UTIL_H_
+
+extern void debug_printf(const char *msg, ...);
+
+#endif                         /* __QUICKPANEL_DEBUG_UTIL_H_ */