diff options
author | jin0.kim <jin0.kim@samsung.com> | 2015-11-11 15:47:34 +0830 |
---|---|---|
committer | jin0.kim <jin0.kim@samsung.com> | 2015-11-13 11:19:30 +0830 |
commit | 1543e8c05cf943f166d68f00f6d6a656b79a9061 (patch) | |
tree | 2ee819a0dfb0336402bbea9d43a77be6a9edfcc0 | |
parent | 19a60f468528fc76cfd8ac0ecf5b852933fe1c0e (diff) | |
download | quickpanel-1543e8c05cf943f166d68f00f6d6a656b79a9061.tar.gz quickpanel-1543e8c05cf943f166d68f00f6d6a656b79a9061.tar.bz2 quickpanel-1543e8c05cf943f166d68f00f6d6a656b79a9061.zip |
[Tizen 3.0] 2.4 source code merge
Change-Id: Id543ba142712a6ab4be9e16d2fe7dffdc6e3bfad
320 files changed, 5322 insertions, 4132 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7664bb4..5d67ba3 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,93 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(quickpanel C) -SET(VENDOR "org.tizen") +AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS) + +IF(${WINSYS} STREQUAL "x11") +SET(EXTRA_SRCS + daemon/service/keyboard_x.c +) +ELSE (${WINSYS} STREQUAL "x11") +SET(EXTRA_SRCS +) +ENDIF (${WINSYS} STREQUAL "x11") + +SET(SRCS + daemon/modules.c + daemon/dbus_utility.c + daemon/accessibility.c + daemon/voice_control.c + daemon/media.c + daemon/datetime/util-time.c + daemon/datetime/datetime.c + daemon/sim_controller.c + daemon/minictrl/minictrl.c + daemon/preference.c + daemon/notifications/noti_list_item.c + daemon/notifications/animated_image.c + daemon/notifications/activenoti.c + daemon/notifications/noti_view_listype.c + daemon/notifications/noti_box.c + daemon/notifications/noti_node.c + daemon/notifications/noti_section.c + daemon/notifications/noti_view_ongoing.c + daemon/notifications/noti_gridbox.c + daemon/notifications/noti_win.c + daemon/notifications/noti_view_boxtype.c + daemon/notifications/noti_listbox.c + daemon/notifications/noti_util.c + daemon/notifications/noti_view.c + daemon/notifications/noti.c + daemon/device/brightness.c + daemon/settings/modules/rotate-lock.c + daemon/settings/modules/ultra_power_saving.c + daemon/settings/modules/assistive_light.c + daemon/settings/modules/bluetooth.c + daemon/settings/modules/gps.c + daemon/settings/modules/wifi.c + daemon/settings/modules/tethering.c + daemon/settings/modules/mobile_data.c + daemon/settings/modules/sound-profile.c + daemon/settings/modules/flightmode.c + daemon/settings/settings_view_all.c + daemon/settings/settings_icon_common.c + daemon/settings/settings_gridbox.c + daemon/settings/settings_view_featured.c + daemon/settings/settings_ipc.c + daemon/settings/setting_module_api.c + daemon/settings/settings.c + daemon/settings/setting_utils.c + daemon/vi/vi_manager.c + daemon/common_uic.c + daemon/handler_controller.c + daemon/service/animated_icon.c + daemon/service/emergency_mode.c + daemon/service/uninstall.c + daemon/service/reminder.c + daemon/service/keyboard.c + daemon/service/noti_led.c + daemon/service/smart_alert.c + daemon/page/pager.c + daemon/page/page_base.c + daemon/page/pager_common.c + daemon/page/page_setting_all.c + daemon/page/page_edit.c + daemon/quickpanel-ui.c + daemon/common.c + daemon/list_util.c + ${EXTRA_SRCS} + ${TEST_SRCS} +) + SET(PACKAGE ${PROJECT_NAME}) -SET(PKGNAME "${VENDOR}.${PACKAGE}") -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(PREFIX "${CMAKE_INSTALL_PREFIX}/apps/${PKGNAME}") 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(DATADIR_RW "${PREFIX_RW}/data") +SET(DATADIR_RW "/opt/usr/apps/${PKGNAME}/data") SET(DESKTOPDIR "/usr/share/applications") SET(MANIFESTXMLDIR "/usr/share/packages") SET(SHARED_DIR "${PREFIX}/shared/res") @@ -36,28 +112,12 @@ INCLUDE_DIRECTORIES( ) INCLUDE(FindPkgConfig) - -IF(X11_SUPPORT) -pkg_check_modules(extra_pkgs REQUIRED - ecore-x - x11 - xi - utilX - inputproto -) -ENDIF(X11_SUPPORT) - -IF(WAYLAND_SUPPORT) -pkg_check_modules(extra_pkgs REQUIRED - ecore-wayland -) -ENDIF(WAYLAND_SUPPORT) - pkg_check_modules(pkgs REQUIRED capi-appfw-application capi-system-runtime-info capi-system-info capi-system-device + capi-location-manager capi-network-tethering capi-network-bluetooth capi-network-connection @@ -82,7 +142,6 @@ pkg_check_modules(pkgs REQUIRED ecore-input icu-i18n elementary - efl-assist dlog syspopup-caller minicontrol-viewer @@ -91,13 +150,25 @@ pkg_check_modules(pkgs REQUIRED pkgmgr-info iniparser alarm-service + voice-control-setting + tzsh-quickpanel-service ) -FOREACH(flag ${pkgs_CFLAGS} ${extra_pkgs_CFLAGS}) +IF(${WINSYS} STREQUAL "x11") +pkg_check_modules(x11_pkgs REQUIRED + ecore-x + utilX + inputproto + xi +) +ENDIF(${WINSYS} STREQUAL "x11") + + +FOREACH(flag ${pkgs_CFLAGS} ${x11_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -g -O2 -fpie") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -g -O2 -fpie -Werror") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") SET(CMAKE_C_FLAGS_RELEASE "-O2") @@ -108,20 +179,21 @@ IF("${ARCH}" STREQUAL "arm") MESSAGE("add -DTARGET") ENDIF("${ARCH}" STREQUAL "arm") -IF("${VENDOR}" STREQUAL "org.tizen") - ADD_DEFINITIONS("-DQP_SETTING_ENABLE") - ADD_DEFINITIONS("-DQP_BRIGHTNESS_ENABLE") - ADD_DEFINITIONS("-DQP_MINICTRL_ENABLE") - ADD_DEFINITIONS("-DQP_SCREENREADER_ENABLE") - ADD_DEFINITIONS("-DQP_SMART_ALERT_ENABLE") - ADD_DEFINITIONS("-DQP_SERVICE_NOTI_LED_ENABLE") - ADD_DEFINITIONS("-DQP_ANIMATED_IMAGE_ENABLE") - ADD_DEFINITIONS("-DQP_REMINDER_ENABLE") - ADD_DEFINITIONS("-DQP_EMERGENCY_MODE_ENABLE") -ENDIF("${VENDOR}" STREQUAL "org.tizen") -MESSAGE("##### VENDOR: ${VENDOR}") - -ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"") +IF(${WINSYS} STREQUAL "x11") +ADD_DEFINITIONS("-DWINSYS_X11=1") +ENDIF(${WINSYS} STREQUAL "x11") + +ADD_DEFINITIONS("-DQP_SETTING_ENABLE") +ADD_DEFINITIONS("-DQP_BRIGHTNESS_ENABLE") +ADD_DEFINITIONS("-DQP_MINICTRL_ENABLE") +ADD_DEFINITIONS("-DQP_SCREENREADER_ENABLE") +ADD_DEFINITIONS("-DQP_SMART_ALERT_ENABLE") +ADD_DEFINITIONS("-DQP_SERVICE_NOTI_LED_ENABLE") +ADD_DEFINITIONS("-DQP_ANIMATED_IMAGE_ENABLE") +ADD_DEFINITIONS("-DQP_REMINDER_ENABLE") +ADD_DEFINITIONS("-DQP_EMERGENCY_MODE_ENABLE") +ADD_DEFINITIONS("-DQP_VOICE_CONTROL_ENABLE") + ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"") ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") @@ -132,111 +204,23 @@ ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"") ADD_DEFINITIONS("-DDATADIR_RW=\"${DATADIR_RW}\"") ADD_DEFINITIONS("-DSHARED_DIR=\"${SHARED_DIR}\"") + #ADD_DEFINITIONS("-DFILE_DEBUG") ADD_DEFINITIONS("-D_DLOG_USED") - -SET(BUILD_COMMON_SOURCE - ${BUILD_COMMON_SOURCE} - daemon/accessibility.c - daemon/common.c - daemon/datetime/datetime.c - daemon/datetime/util-time.c - daemon/dbus_utility.c - daemon/device/brightness.c - daemon/handler_controller.c - daemon/list_util.c - daemon/media.c - daemon/minictrl/minictrl.c - daemon/modules.c - daemon/notifications/activenoti.c - daemon/notifications/animated_image.c - daemon/notifications/noti_box.c - daemon/notifications/noti.c - daemon/notifications/noti_gridbox.c - daemon/notifications/noti_listbox.c - daemon/notifications/noti_list_item.c - daemon/notifications/noti_node.c - daemon/notifications/noti_section.c - daemon/notifications/noti_util.c - daemon/notifications/noti_view_boxtype.c - daemon/notifications/noti_view.c - daemon/notifications/noti_view_listype.c - daemon/notifications/noti_view_ongoing.c - daemon/page/page_base.c - daemon/page/page_edit.c - daemon/page/pager.c - daemon/page/page_setting_all.c - daemon/preference.c - daemon/service/animated_icon.c - daemon/service/configuration.c - daemon/service/emergency_mode.c - daemon/service/keyboard.c - daemon/service/noti_led.c - daemon/service/reminder.c - daemon/service/smart_alert.c - daemon/service/uninstall.c - daemon/settings/modules/assistive_light.c - daemon/settings/modules/bluetooth.c - daemon/settings/modules/flightmode.c - daemon/settings/modules/gps.c - daemon/settings/modules/mobile_data.c - daemon/settings/modules/rotate-lock.c - daemon/settings/modules/sound-profile.c - daemon/settings/modules/tethering.c - daemon/settings/modules/ultra_power_saving.c - daemon/settings/modules/wifi.c - daemon/settings/setting_module_api.c - daemon/settings/settings.c - daemon/settings/settings_gridbox.c - daemon/settings/settings_icon_common.c - daemon/settings/settings_ipc.c - daemon/settings/settings_view_all.c - daemon/settings/settings_view_featured.c - daemon/sim_controller.c - daemon/vi/vi_manager.c -) - -IF(X11_SUPPORT) -ADD_DEFINITIONS("-DHAVE_X") -SET(BUILD_SOURCE - ${BUILD_SOURCE} - daemon/common_uic_x11.c - daemon/notifications/noti_win_x11.c - daemon/page/pager_common_x11.c - daemon/quickpanel-ui_x11.c - daemon/service/keyboard_x_x11.c - daemon/settings/setting_utils_x11.c -) -ENDIF(X11_SUPPORT) - -IF(WAYLAND_SUPPORT) -ADD_DEFINITIONS("-DHAVE_WAYLAND") -SET(BUILD_SOURCE - ${BUILD_SOURCE} - daemon/common_uic.c - daemon/notifications/noti_win.c - daemon/page/pager_common.c - daemon/quickpanel-ui.c - daemon/service/keyboard_x.c - daemon/settings/setting_utils.c -) -ENDIF(WAYLAND_SUPPORT) - -AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS) - -SET(SRCS ${BUILD_COMMON_SOURCE} ${BUILD_SOURCE} ${TEST_SRCS}) +#ADD_DEFINITIONS("-DHAVE_X") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${extra_pkgs_LDFLAGS} "-pie") -#-lefence +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${x11_pkgs_LDFLAGS} "-pie") INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) INSTALL(DIRECTORY DESTINATION ${DATADIR}) INSTALL(DIRECTORY DESTINATION ${DATADIR_RW}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/icons/quickpanel_icon_default.png DESTINATION ${RESDIR}) +IF(${WINSYS} STREQUAL "x11") +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.efl DESTINATION /etc/smack/accesses.d) +ENDIF(${WINSYS} STREQUAL "x11") # icon for setting INSTALL(FILES ${CMAKE_SOURCE_DIR}/icons/settings_noti_panel.png DESTINATION ${SHARED_DIR}/icons) diff --git a/daemon/accessibility.c b/daemon/accessibility.c index a85bebb..3434832 100644..100755 --- a/daemon/accessibility.c +++ b/daemon/accessibility.c @@ -17,12 +17,18 @@ #include <stdio.h> + +#include <Elementary.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "accessibility.h" -HAPI Evas_Object * -quickpanel_accessibility_screen_reader_object_get(void *obj, screen_reader_object_type_e type, const char *part, Evas_Object *parent) +HAPI Evas_Object *quickpanel_accessibility_screen_reader_object_get(void *obj, screen_reader_object_type_e type, const char *part, Evas_Object *parent) { Evas_Object *to = NULL; Evas_Object *ao = NULL; @@ -89,7 +95,11 @@ HAPI char *quickpanel_accessibility_info_cb_s(void *data, Evas_Object *obj) char *str = NULL; retif(data == NULL, NULL, "invalid parameter"); - // system string is not supported. data should be DID from application po files. + /** + * @note + * system string is not supported. + * data should be DID from application po files. + */ str = _(data); if (str != NULL) { return strdup(str); @@ -98,8 +108,7 @@ HAPI char *quickpanel_accessibility_info_cb_s(void *data, Evas_Object *obj) return NULL; } -HAPI void -quickpanel_accessibility_screen_reader_data_set(Evas_Object *view, const char *part, char *type, char *info) +HAPI void quickpanel_accessibility_screen_reader_data_set(Evas_Object *view, const char *part, char *type, char *info) { Evas_Object *ao = NULL; retif(view == NULL, , "invalid parameter"); diff --git a/daemon/accessibility.h b/daemon/accessibility.h index bf49a18..b2f1272 100644..100755 --- a/daemon/accessibility.h +++ b/daemon/accessibility.h @@ -25,11 +25,10 @@ typedef enum { SCREEN_READER_OBJ_TYPE_EDJ_OBJECT, } screen_reader_object_type_e; -Evas_Object * -quickpanel_accessibility_screen_reader_object_get(void *obj, screen_reader_object_type_e type, const char *part, Evas_Object *parent); -Evas_Object *quickpanel_accessibility_ui_get_focus_object(Evas_Object *parent); -char *quickpanel_accessibility_info_cb(void *data, Evas_Object *obj); -char *quickpanel_accessibility_info_cb_s(void *data, Evas_Object *obj); -void quickpanel_accessibility_screen_reader_data_set(Evas_Object *view, const char *part, char *type, char *info); +extern Evas_Object *quickpanel_accessibility_screen_reader_object_get(void *obj, screen_reader_object_type_e type, const char *part, Evas_Object *parent); +extern Evas_Object *quickpanel_accessibility_ui_get_focus_object(Evas_Object *parent); +extern char *quickpanel_accessibility_info_cb(void *data, Evas_Object *obj); +extern char *quickpanel_accessibility_info_cb_s(void *data, Evas_Object *obj); +extern void quickpanel_accessibility_screen_reader_data_set(Evas_Object *view, const char *part, char *type, char *info); #endif /* __ACCESSIBILITY_H__ */ diff --git a/daemon/common.c b/daemon/common.c index 40370b7..f806513 100755 --- a/daemon/common.c +++ b/daemon/common.c @@ -15,63 +15,73 @@ * */ +#include <stdio.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> + +#include <Elementary.h> #include <pkgmgr-info.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" -static inline int _is_space( char in ) +static inline int _is_space(char in) { - if ( ( in == _SPACE )) { + if ((in == _SPACE)) { return 1; - } else { + } else { return 0; - } + } } -static inline int _l_trim( char *in ) +static inline int _l_trim(char *in) { - int i, j; - short int done; + int i, j; + short int done; - i = 0; - done = 0; + i = 0; + done = 0; - while ( !done && in[i] != '\0') { - if ( _is_space( in[i] ) ) { + while (!done && in[i] != '\0') { + if (_is_space(in[i])) { i++; } else { done = 1; } - } + } - j = 0; - while ( in[i] != '\0' ) { + j = 0; + while (in[i] != '\0') { in[j++] = in[i++]; - } + } - in[j] = '\0'; + in[j] = '\0'; - return 0; + return 0; } -static inline int _r_trim( char *in ) +static inline int _r_trim(char *in) { - int i; - short int done; + int i; + short int done; - i = strlen(in) - 1; - done = 0; + i = strlen(in) - 1; + done = 0; - while ( !done && !( i < 0 ) ) { - if ( _is_space( in[i] ) ) { + while (!done && !(i < 0)) { + if (_is_space(in[i])) { in[i--] = '\0'; } else { done = 1; } - } + } - return(0); + return(0); } HAPI void quickpanel_common_util_char_trim(char *text) @@ -187,9 +197,9 @@ HAPI int quickpanel_common_util_is_phone_number(const char *address) while (*pszOneChar) { if (!isdigit(*pszOneChar) - && (*pszOneChar != '*') && (*pszOneChar != '#') - && (*pszOneChar != ' ') - && !((*pszOneChar == '-') && digit_count >= 7)) { + && (*pszOneChar != '*') && (*pszOneChar != '#') + && (*pszOneChar != ' ') + && !((*pszOneChar == '-') && digit_count >= 7)) { return 0; } diff --git a/daemon/common.h b/daemon/common.h index 5749c17..3b9a541 100755 --- a/daemon/common.h +++ b/daemon/common.h @@ -19,11 +19,6 @@ #ifndef __QP_COMMON_H_ #define __QP_COMMON_H_ -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -#include <Elementary.h> -#include "quickpanel_debug_util.h" #define QP_OK (0) #define QP_FAIL (-1) @@ -76,25 +71,25 @@ #define DBG(fmt , args...) \ do { \ debug_printf("[D]%s : %d] "fmt"\n", \ - __func__, __LINE__, ##args); \ + __func__, __LINE__, ##args); \ } while (0) #define INFO(fmt , args...) \ do { \ debug_printf("[I][%s : %d] "fmt"\n",\ - __func__, __LINE__, ##args); \ + __func__, __LINE__, ##args); \ } while (0) #define WARN(fmt , args...) \ do { \ debug_printf("[W][%s : %d] "fmt"\n", \ - __func__, __LINE__, ##args); \ + __func__, __LINE__, ##args); \ } while (0) #define ERR(fmt , args...) \ do { \ debug_printf("[E][%s : %d] "fmt"\n", \ - __func__, __LINE__, ##args); \ + __func__, __LINE__, ##args); \ } while (0) #else /*_DLOG_USED*/ @@ -145,17 +140,16 @@ } \ } while (0); - -void quickpanel_common_util_char_trim(char *text); -void quickpanel_common_util_char_replace(char *text, char s, char t); -void quickpanel_common_util_add_char_to_each_charactor(char *dst, const char *src, char t); -int quickpanel_common_util_is_phone_number(const char *address); -void quickpanel_common_util_phone_number_tts_make(char *dst, const char *src, int size); -void quickpanel_common_ui_set_current_popup(Evas_Object *popup, Evas_Smart_Cb func_close); -void quickpanel_common_ui_del_current_popup(void); -void *quickpanel_common_ui_get_buffer_from_image(const char *file_path, size_t *memfile_size, char *ext, int ext_size); -char *quickpanel_common_ui_get_pkginfo_icon(const char *pkgid); -char *quickpanel_common_ui_get_pkginfo_label(const char *pkgid); -int quickpanel_common_ui_is_package_exist(const char *pkgid); +extern void quickpanel_common_util_char_trim(char *text); +extern void quickpanel_common_util_char_replace(char *text, char s, char t); +extern void quickpanel_common_util_add_char_to_each_charactor(char *dst, const char *src, char t); +extern int quickpanel_common_util_is_phone_number(const char *address); +extern void quickpanel_common_util_phone_number_tts_make(char *dst, const char *src, int size); +extern void quickpanel_common_ui_set_current_popup(Evas_Object *popup, Evas_Smart_Cb func_close); +extern void quickpanel_common_ui_del_current_popup(void); +extern void *quickpanel_common_ui_get_buffer_from_image(const char *file_path, size_t *memfile_size, char *ext, int ext_size); +extern char *quickpanel_common_ui_get_pkginfo_icon(const char *pkgid); +extern char *quickpanel_common_ui_get_pkginfo_label(const char *pkgid); +extern int quickpanel_common_ui_is_package_exist(const char *pkgid); #endif /* __QP_COMMON_H_ */ diff --git a/daemon/common_uic.c b/daemon/common_uic.c index 54596dd..155ed0f 100644..100755 --- a/daemon/common_uic.c +++ b/daemon/common_uic.c @@ -16,17 +16,28 @@ */ -#include <app.h> +#include <Elementary.h> #include <sys/utsname.h> -#ifdef HAVE_X -#include <X11/Xlib.h> -#include <utilX.h> -#endif #include <Ecore_Input.h> + +#include <app.h> #include <vconf.h> #include <notification.h> #include <app_control_internal.h> #include <bundle_internal.h> +#include <system_info.h> +#include <common_uic.h> + +#if defined(WINSYS_X11) +#include <Ecore_X.h> +#include <X11/Xlib.h> +#include <utilX.h> +#endif + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" @@ -46,8 +57,7 @@ static void _quickpanel_move_data_to_service(const char *key, const char *val, v app_control_add_extra_data(service, key, val); } -HAPI Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, - const char *group, int is_just_load) +HAPI Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, const char *group, int is_just_load) { Eina_Bool r; Evas_Object *eo = NULL; @@ -58,13 +68,10 @@ HAPI Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file 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[%s-%s]!", file, group); + retif(r != EINA_TRUE, NULL, "Failed to set edje object file[%s-%s]!", file, group); - evas_object_size_hint_weight_set(eo, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(eo, - EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL); if (is_just_load == 1) { elm_win_resize_object_add(parent, eo); @@ -94,6 +101,7 @@ HAPI int quickpanel_uic_is_emul(void) { int is_emul = 0; char *info = NULL; + if (system_info_get_platform_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) { if (info == NULL) { return 0; @@ -103,7 +111,7 @@ HAPI int quickpanel_uic_is_emul(void) } } - if (info != NULL) free(info); + free(info); return is_emul; } @@ -237,17 +245,16 @@ HAPI void quickpanel_uic_launch_app_inform_result(const char *pkgname, int retco HAPI void quickpanel_uic_open_quickpanel(int reason) { -#ifdef HAVE_X - Ecore_X_Window xwin; - Ecore_X_Window zone; -#endif struct appdata *ad = quickpanel_get_app_data(); DBG("reason:%d", reason); retif(ad == NULL, , "Invalid parameter!"); retif(ad->win == NULL, , "Invalid parameter!"); -#ifdef HAVE_X + +#if defined(WINSYS_X11) + Ecore_X_Window xwin; + Ecore_X_Window zone; xwin = elm_win_xwindow_get(ad->win); if (xwin != 0) { if ((zone = ecore_x_e_illume_zone_get(xwin)) != 0) { @@ -261,6 +268,8 @@ HAPI void quickpanel_uic_open_quickpanel(int reason) } else { ERR("failed to get xwin"); } +#else + ERR("Not yet implemented"); #endif } @@ -282,17 +291,18 @@ HAPI int quickpanel_uic_opened_reason_get(void) static void _quickpanel_close(void) { -#ifdef HAVE_X - Ecore_X_Window xwin; - Ecore_X_Window zone; -#endif struct appdata *ad = quickpanel_get_app_data(); DBG(""); - retif(ad == NULL, , "Invalid parameter!"); - retif(ad->win == NULL, , "Invalid parameter!"); -#ifdef HAVE_X + if (!ad || !ad->win) { + ERR("Invalid parameter"); + return; + } + +#if defined(WINSYS_X11) + Ecore_X_Window xwin; + Ecore_X_Window zone; xwin = elm_win_xwindow_get(ad->win); if (xwin != 0) { if ((zone = ecore_x_e_illume_zone_get(xwin)) != 0) { @@ -305,12 +315,14 @@ static void _quickpanel_close(void) } else { ERR("failed to get xwin"); } +#else + ERR("Not yet implemented"); #endif } static Eina_Bool _quickpanel_close_timer_cb(void *data) { - if( _close_timer != NULL ) { + if (_close_timer != NULL) { _close_timer = NULL; } _quickpanel_close(); @@ -346,19 +358,22 @@ HAPI void quickpanel_uic_close_quickpanel(bool is_check_lock, int is_delay_neede HAPI void quickpanel_uic_toggle_openning_quickpanel(void) { -#ifdef HAVE_X +#if defined(WINSYS_X11) + Ecore_X_Window xwin; Ecore_X_Window zone; -#endif struct appdata *ad = quickpanel_get_app_data(); DBG(""); - retif(ad == NULL, , "Invalid parameter!"); - retif(ad->win == NULL, , "Invalid parameter!"); -#ifdef HAVE_X + if (!ad || !ad->win) { + ERR("Invalid parameters"); + return; + } + xwin = elm_win_xwindow_get(ad->win); if (xwin != 0) { + if ((zone = ecore_x_e_illume_zone_get(xwin)) != 0) { if (ecore_x_e_illume_quickpanel_state_get(zone) == ECORE_X_ILLUME_QUICKPANEL_STATE_ON) { ecore_x_e_illume_quickpanel_state_send(zone, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF); @@ -371,5 +386,6 @@ HAPI void quickpanel_uic_toggle_openning_quickpanel(void) } else { ERR("failed to get xwin"); } + #endif } diff --git a/daemon/common_uic.h b/daemon/common_uic.h index 882163d..2191b25 100644..100755 --- a/daemon/common_uic.h +++ b/daemon/common_uic.h @@ -25,19 +25,18 @@ typedef enum { OPENED_BY_CMD_SHOW_SETTINGS = 2, } qp_open_reason; -Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, - const char *group, int is_just_load); -int quickpanel_uic_launch_app(char *app_id, void *data); -int quickpanel_uic_launch_ug_by_appcontrol(const char *package, void *data); -int quickpanel_uic_is_emul(void); -int quickpanel_uic_is_suspended(void); -int quickpanel_uic_is_opened(void); -void quickpanel_uic_launch_app_inform_result(const char *pkgname, int retcode); -void quickpanel_uic_initial_resize(Evas_Object *obj, int height); -void quickpanel_uic_close_quickpanel(bool is_check_lock, int is_delay_needed); -void quickpanel_uic_open_quickpanel(int reason); -void quickpanel_uic_toggle_openning_quickpanel(void); -void quickpanel_uic_opened_reason_set(int reason); -int quickpanel_uic_opened_reason_get(void); +extern Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, const char *group, int is_just_load); +extern int quickpanel_uic_launch_app(char *app_id, void *data); +extern int quickpanel_uic_launch_ug_by_appcontrol(const char *package, void *data); +extern int quickpanel_uic_is_emul(void); +extern int quickpanel_uic_is_suspended(void); +extern int quickpanel_uic_is_opened(void); +extern void quickpanel_uic_launch_app_inform_result(const char *pkgname, int retcode); +extern void quickpanel_uic_initial_resize(Evas_Object *obj, int height); +extern void quickpanel_uic_close_quickpanel(bool is_check_lock, int is_delay_needed); +extern void quickpanel_uic_open_quickpanel(int reason); +extern void quickpanel_uic_toggle_openning_quickpanel(void); +extern void quickpanel_uic_opened_reason_set(int reason); +extern int quickpanel_uic_opened_reason_get(void); #endif /* __QP_COMMON_UIC_H_ */ diff --git a/daemon/datetime/datetime.c b/daemon/datetime/datetime.c index e87197f..2fe645c 100644..100755 --- a/daemon/datetime/datetime.c +++ b/daemon/datetime/datetime.c @@ -15,23 +15,34 @@ * */ - -#include <app.h> #include <glib.h> #include <string.h> +#include <Elementary.h> + +#include <app.h> #include <vconf.h> +#include <notification.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <sound_manager.h> +#include <E_DBus.h> + #include "common.h" +#include "common_uic.h" #include "quickpanel-ui.h" #include "list_util.h" #include "quickpanel_def.h" +#include "modules.h" +#include "util-time.h" +#include "media.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif -#include "modules.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "util-time.h" static int _init(void *data); static int _fini(void *data); @@ -58,7 +69,7 @@ static void _flag_set(Evas_Object *container, const char *key, int value) retif(container == NULL, , "invalid parameter"); retif(key == NULL, , "invalid parameter"); - evas_object_data_set(container, key, (void *)value); + evas_object_data_set(container, key, (void *)(long)(value)); } static int _flag_get(Evas_Object *container, const char *key) @@ -66,7 +77,7 @@ static int _flag_get(Evas_Object *container, const char *key) retif(container == NULL, 0, "invalid parameter"); retif(key == NULL, 0, "invalid parameter"); - return (int)evas_object_data_get(container, key); + return (int)(long)evas_object_data_get(container, key); } static void _set_text_to_part(Evas_Object *obj, const char *part, const char *text) @@ -173,7 +184,7 @@ static Evas_Object *_datetime_view_get(void) { retif(ad->view_root == NULL, NULL, "invalid argument"); return elm_object_part_content_get(ad->view_root - , "qp.base.datetime.swallow"); + , "qp.base.datetime.swallow"); } static void _datetime_view_attach(void *data) @@ -341,6 +352,6 @@ HAPI void quickpanel_datetime_view_update(char *date, char *time, char *meridiem eina_strbuf_free(strbuf_access); quickpanel_accessibility_screen_reader_data_set(view - , "focus.setting", "", _NOT_LOCALIZED("Settings")); + , "focus.setting", "", _NOT_LOCALIZED("Settings")); } diff --git a/daemon/datetime/datetime.h b/daemon/datetime/datetime.h index a570bca..f17fe11 100644..100755 --- a/daemon/datetime/datetime.h +++ b/daemon/datetime/datetime.h @@ -19,8 +19,8 @@ #ifndef __DATETIME_H__ #define __DATETIME_H__ -void quickpanel_datetime_datentime_event_set(int is_clickable); -void quickpanel_datetime_editing_icon_visibility_set(int is_visible); -void quickpanel_datetime_view_update(char *date, char *time, char *meridiem, int meridiem_type); +extern void quickpanel_datetime_datentime_event_set(int is_clickable); +extern void quickpanel_datetime_editing_icon_visibility_set(int is_visible); +extern void quickpanel_datetime_view_update(char *date, char *time, char *meridiem, int meridiem_type); #endif /* __DATETIME_H__ */ diff --git a/daemon/datetime/util-time.c b/daemon/datetime/util-time.c index 484b3fe..50b35e7 100644..100755 --- a/daemon/datetime/util-time.c +++ b/daemon/datetime/util-time.c @@ -16,14 +16,9 @@ */ -#include <appcore-common.h> -#include <vconf.h> -#include <vconf-keys.h> -#include <dlog.h> -#include <app_control.h> +#include <Elementary.h> #include <ctype.h> -#include <system_settings.h> -#include <utils_i18n.h> +#include <glib.h> #include <unicode/utypes.h> #include <unicode/putil.h> @@ -32,10 +27,24 @@ #include <unicode/udatpg.h> #include <unicode/ustring.h> +#include <appcore-common.h> +#include <app_control.h> +#include <vconf.h> +#include <vconf-keys.h> +#include <dlog.h> +#include <system_settings.h> +#include <utils_i18n.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <E_DBus.h> + #include "common.h" + #include "quickpanel-ui.h" #include "util-time.h" #include "datetime.h" +#include "noti_node.h" #include "noti.h" #define TIME_ZONEINFO_PATH "/usr/share/zoneinfo/" @@ -89,12 +98,6 @@ static struct info { .is_pre_meridiem = EINA_FALSE, }; -static int _get_formatted_time_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, int time_format, void *data); -static int _get_formatted_ampm_from_utc_time(time_t intime, char *buf, int buf_len, int *ampm_len, const char *timezone, void *data); -static int _get_formatted_date_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, void *data, const char *format); -static int _get_simple_formatted_date_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, void *data); - - static Eina_Bool _timer_cb(void *data); static UChar *uastrcpy(const char *chars) @@ -115,13 +118,14 @@ static void ICU_set_timezone(const char *timezone) DBG("ICU_set_timezone = %s ", timezone); UErrorCode ec = U_ZERO_ERROR; UChar *str = uastrcpy(timezone); + retif(str == NULL, , "uastrcpy error!"); ucal_setDefaultTimeZone(str, &ec); if (U_SUCCESS(ec)) { DBG("ucal_setDefaultTimeZone() SUCCESS "); } else { ERR("ucal_setDefaultTimeZone() FAILED : %s ", - u_errorName(ec)); + u_errorName(ec)); } free(str); } @@ -132,10 +136,8 @@ static char *_get_locale(void) char *locale = NULL; //vconf_get_str(VCONFKEY_REGIONFORMAT); int ret = 0; -#ifdef HAVE_X ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &locale); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY) : %d", ret); -#endif if (locale == NULL) { ERR("vconf_get_str() failed : region format"); @@ -162,323 +164,19 @@ static char *_get_locale(void) } /*static char *_get_locale_for_date(void) -{ - char *locale = vconf_get_str(VCONFKEY_REGIONFORMAT); - if (locale == NULL) { - ERR("vconf_get_str() failed : region format"); - return strdup("en_GB.UTF8"); - } - - if (strlen(locale) > 0) { - return locale; - } - - return strdup("en_GB.UTF8"); -}*/ - -static UDateFormat *_get_formatter_time(void *data, int time_format, const char *timezone) -{ - UErrorCode status = U_ZERO_ERROR; - char buf[BUF_FORMATTER] = {0,}; - char *locale = NULL; - UChar u_pattern[BUF_FORMATTER] = {0,}; - UChar u_timezone[BUF_FORMATTER] = {0,}; - UDateFormat *formatter = NULL; - struct appdata *ad = data; - retif_nomsg(ad == NULL, NULL); - - UDateTimePatternGenerator *generator = NULL; - UChar u_best_pattern[BUF_FORMATTER] = {0,}; - int32_t u_best_pattern_capacity; - -#ifdef HAVE___SECURE_GETENV - uloc_setDefault(__secure_getenv("LC_TIME"), &status); -#elif defined HAVE_SECURE_GETENV - uloc_setDefault(secure_getenv("LC_TIME"), &status); -#else - uloc_setDefault(getenv("LC_TIME"), &status); -#endif - if (U_FAILURE(status)) { - ERR("uloc_setDefault() is failed."); - return NULL; - } - - if (time_format == APPCORE_TIME_FORMAT_24) { - snprintf(buf, sizeof(buf)-1, "%s", "HH:mm"); - } else { - /* set time format 12 */ - snprintf(buf, sizeof(buf)-1, "%s", "h:mm"); - } - if (u_uastrncpy(u_pattern, buf, sizeof(u_pattern)) == NULL) { - ERR("u_uastrncpy() is failed."); - return NULL; - } - - locale = _get_locale(); - - if (time_format == APPCORE_TIME_FORMAT_12) { - generator = udatpg_open(locale, &status); - if (U_FAILURE(status)) { - ERR("udatpg_open() failed"); - generator = NULL; - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - u_best_pattern_capacity = - (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); - - udatpg_getBestPattern(generator, u_pattern, u_strlen(u_pattern), - u_best_pattern, u_best_pattern_capacity, &status); - if (U_FAILURE(status)) { - ERR("udatpg_getBestPattern() failed"); - if (locale) { - free(locale); - locale = NULL; - } - } - - /* remove am/pm of best pattern */ - char a_best_pattern[BUF_FORMATTER] = {0.}; - u_austrcpy(a_best_pattern, u_best_pattern); - char *a_best_pattern_fixed = strtok(a_best_pattern, "a"); - a_best_pattern_fixed = strtok(a_best_pattern_fixed, " "); - if (a_best_pattern_fixed) { - u_uastrcpy(u_best_pattern, a_best_pattern_fixed); - } - u_strncpy(u_pattern, u_best_pattern, sizeof(u_pattern)); - } - - if (timezone) { - u_uastrncpy(u_timezone, timezone, sizeof(u_timezone)); - formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, u_timezone, -1, - u_pattern, -1, &status); - } else { - formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, - u_pattern, -1, &status); - } - if (U_FAILURE(status)) { - ERR("udat_open() is failed."); - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - if (locale) { - free(locale); - locale = NULL; - } - - if (generator) { - udat_close(generator); - generator = NULL; - } - - if (formatter) { - return formatter; - } else { - return NULL; - } -} - -static UDateFormat *_get_formatter_ampm(void *data, const char *timezone) -{ - UErrorCode status = U_ZERO_ERROR; - - char a_best_pattern[BUF_FORMATTER] = {0.}; - char *locale = NULL; - - UChar u_timezone[BUF_FORMATTER] = {0,}; - UChar u_skeleton[BUF_FORMATTER] = {0,}; - int skeleton_len = 0; - - UDateFormat *formatter = NULL; - UDateTimePatternGenerator *generator = NULL; - - UChar u_best_pattern[BUF_FORMATTER] = {0,}; - int32_t u_best_pattern_capacity; - - struct appdata *ad = data; - retif_nomsg(ad == NULL, NULL); - -#ifdef HAVE___SECURE_GETENV - uloc_setDefault(__secure_getenv("LC_TIME"), &status); -#elif defined HAVE_SECURE_GETENV - uloc_setDefault(secure_getenv("LC_TIME"), &status); -#else - uloc_setDefault(getenv("LC_TIME"), &status); -#endif - if (U_FAILURE(status)) { - ERR("uloc_setDefault() is failed."); - return NULL; - } - - locale = _get_locale(); - - u_uastrncpy(u_skeleton, "hhmm", strlen("hhmm")); - skeleton_len = u_strlen(u_skeleton); - - generator = udatpg_open(locale, &status); - if (U_FAILURE(status)) { - ERR("udatpg_open() failed"); - generator = NULL; - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - u_best_pattern_capacity = - (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); - - udatpg_getBestPattern(generator, u_skeleton, skeleton_len, - u_best_pattern, u_best_pattern_capacity, &status); - if (U_FAILURE(status)) { - ERR("udatpg_getBestPattern() failed"); - if (locale) { - free(locale); - locale = NULL; - } - } - - u_austrcpy(a_best_pattern, u_best_pattern); - u_uastrcpy(u_best_pattern, "a"); - - if (a_best_pattern[0] == 'a') { - s_info.is_pre_meridiem = EINA_TRUE; - } else { - s_info.is_pre_meridiem = EINA_FALSE; - } - - if (timezone != NULL) { - u_uastrncpy(u_timezone, timezone, sizeof(u_timezone)); - formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, u_timezone, -1, - u_best_pattern, -1, &status); - } else { - formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, - u_best_pattern, -1, &status); - } - - if (U_FAILURE(status)) { - ERR("udat_open() failed"); - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - if (locale) { - free(locale); - locale = NULL; - } - - if (generator) { - udat_close(generator); - generator = NULL; - } - - return formatter; -} - -//static int _get_formatter_date(void *data, const char *timezone, Eina_Bool is_info, const char *skeleton) -static UDateFormat *_get_formatter_date(void *data, const char *timezone, Eina_Bool is_info, const char *skeleton) -{ - UErrorCode status = U_ZERO_ERROR; - UChar u_timezone[BUF_FORMATTER] = {0,}; - UChar u_skeleton[BUF_FORMATTER] = {0,}; - int skeleton_len = 0; - char *locale = NULL; - - UDateFormat *formatter = NULL; - UDateTimePatternGenerator *generator = NULL; - - UChar u_best_pattern[BUF_FORMATTER] = {0,}; - int32_t u_best_pattern_capacity; - - struct appdata *ad = data; - retif_nomsg(ad == NULL, NULL); - -#ifdef HAVE___SECURE_GETENV - uloc_setDefault(__secure_getenv("LC_TIME"), &status); -#elif defined HAVE_SECURE_GETENV - uloc_setDefault(secure_getenv("LC_TIME"), &status); -#else - uloc_setDefault(getenv("LC_TIME"), &status); -#endif - if (U_FAILURE(status)) { - ERR("uloc_setDefault() is failed."); - return NULL; - } - - locale = _get_locale(); - if (locale == NULL) { - ERR("vconf_get_str() failed : region format"); - locale = strdup("en_GB.UTF-8"); - } - - u_uastrncpy(u_skeleton, skeleton, strlen(skeleton)); - skeleton_len = u_strlen(u_skeleton); - - generator = udatpg_open(locale, &status); - if (U_FAILURE(status)) { - ERR("udatpg_open() failed"); - generator = NULL; - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - u_best_pattern_capacity = - (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); - - (void)udatpg_getBestPattern(generator, u_skeleton, skeleton_len, - u_best_pattern, u_best_pattern_capacity, &status); - if (U_FAILURE(status)) { - ERR("udatpg_getBestPattern() failed"); - if (locale) { - free(locale); - locale = NULL; - } - } - - if (timezone) { - u_uastrncpy(u_timezone, timezone, sizeof(u_timezone)); - formatter = udat_open(UDAT_IGNORE, UDAT_DEFAULT, locale, u_timezone, -1, - u_best_pattern, u_strlen(u_best_pattern), &status); - } else { - formatter = udat_open(UDAT_IGNORE, UDAT_DEFAULT, locale, NULL, -1, - u_best_pattern, u_strlen(u_best_pattern), &status); - } - if (U_FAILURE(status)) { - ERR("udat_open() is failed."); - if (locale) { - free(locale); - locale = NULL; - } - return NULL; - } - - if (locale) { - free(locale); - locale = NULL; - } + { + char *locale = vconf_get_str(VCONFKEY_REGIONFORMAT); + if (locale == NULL) { + ERR("vconf_get_str() failed : region format"); + return strdup("en_GB.UTF8"); + } - if (generator) { - udat_close(generator); - generator = NULL; - } + if (strlen(locale) > 0) { + return locale; + } - return formatter; -} + return strdup("en_GB.UTF8"); + }*/ static inline char *_extend_heap(char *buffer, int *sz, int incsz) { @@ -559,9 +257,9 @@ static char *_string_replacer(char *src, const char *pattern, const char *replac case STATE_CHECK: if (!pattern[idx]) { /*! - * If there is no space for copying the replacement, - * Extend size of the return buffer. - */ + * If there is no space for copying the replacement, + * Extend size of the return buffer. + */ if (out_sz - out_idx < strlen(replace) + 1) { tmp = _extend_heap(ret, &out_sz, strlen(replace) + 1); if (!tmp) { @@ -606,206 +304,6 @@ static char *_string_replacer(char *src, const char *pattern, const char *replac return ret; } -static int _get_formatted_time_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, int time_format, void *data) -{ - struct appdata *ad = data; - retif_nomsg(ad == NULL, -1); - - UDate u_time = (UDate)intime * 1000; - UChar u_formatted_str[BUF_FORMATTER] = {0,}; - int32_t u_formatted_str_capacity; - - UErrorCode status = U_ZERO_ERROR; - - UDateFormat *formatter = _get_formatter_time(ad, time_format, timezone); - if (formatter == NULL) { - ERR("_get_formatter_time() failed"); - return -1; - } - - /* calculate formatted string capacity */ - u_formatted_str_capacity = - (int32_t)(sizeof(u_formatted_str) / sizeof((u_formatted_str)[0])); - - /* fomatting date using formatter */ - (void)udat_format(formatter, u_time, u_formatted_str, u_formatted_str_capacity, - NULL, &status); - if (U_FAILURE(status)) { - ERR("udat_format() failed"); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return -1; - } - - buf = u_austrncpy(buf, u_formatted_str, buf_len); - DBG("time : %s %d", buf, intime); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return 0; -} - -static int _get_formatted_ampm_from_utc_time(time_t intime, char *buf, int buf_len, int *ampm_len, const char *timezone, void *data) -{ - struct appdata *ad = data; - retif_nomsg(ad == NULL, -1); - - UDate u_time = (UDate)intime * 1000; - UChar u_formatted_str[BUF_FORMATTER] = {0,}; - int32_t u_formatted_str_capacity; - - UErrorCode status = U_ZERO_ERROR; - - UDateFormat *formatter = _get_formatter_ampm(ad, timezone); - - if (formatter == NULL){ - ERR("_get_formatter_ampm() failed"); - return -1; - } - - u_formatted_str_capacity = - (int32_t)(sizeof(u_formatted_str) / sizeof((u_formatted_str)[0])); - - (void)udat_format(formatter, u_time, u_formatted_str, u_formatted_str_capacity, - NULL, &status); - - if (U_FAILURE(status)) { - ERR("udat_format() failed"); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return -1; - } - - (*ampm_len) = u_strlen(u_formatted_str); - - buf = u_austrncpy(buf, u_formatted_str, buf_len); - DBG("ampm : %s %d", buf, intime); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return 0; -} - -static int _get_formatted_date_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, void *data, const char *format) -{ - struct appdata *ad = data; - retif_nomsg(ad == NULL, -1); - - UDate u_time = (UDate)intime *1000; - UChar u_formatted_str[BUF_FORMATTER] = {0,}; - int32_t u_formatted_str_capacity; - UErrorCode status = U_ZERO_ERROR; - - UDateFormat *formatter = NULL; - - if (format) { - formatter = _get_formatter_date(ad, timezone, EINA_TRUE, format); - } else { - formatter = _get_formatter_date(ad, timezone, EINA_TRUE, "MMMEd"); - } - if (formatter == NULL) { - ERR("_get_formatter_time() failed"); - return -1; - } - - u_formatted_str_capacity = - (int32_t)(sizeof(u_formatted_str) / sizeof((u_formatted_str)[0])); - - (void)udat_format(formatter, u_time, u_formatted_str, u_formatted_str_capacity, - NULL, &status); - if (U_FAILURE(status)) { - ERR("udat_format() failed"); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return -1; - } - - buf = u_austrncpy(buf, u_formatted_str, buf_len); - DBG("time : %s %d", buf, intime); - if (formatter) { - udat_close(formatter); - formatter = NULL; - } - return 0; -} - -static int _get_simple_formatted_date_from_utc_time(time_t intime, char *buf, int buf_len, const char *timezone, void *data) -{ - struct appdata *ad = data; - retif_nomsg(ad == NULL, -1); - - time_t today; - struct tm loc_time; - - 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); - - localtime_r(&intime, &loc_time); - - char time_buf[BUF_FORMATTER] = {0, }; - int time_buf_len = sizeof(time_buf); - char ampm_buf[BUF_FORMATTER] = {0, }; - int ampm_buf_len = sizeof(ampm_buf); - int ampm_dst_len = 0; - int r = 0; - enum appcore_time_format timeformat = APPCORE_TIME_FORMAT_UNKNOWN; - - if (intime < today) { - /* show only simple date */ - _get_formatted_date_from_utc_time(intime, buf, buf_len, timezone, ad, UDAT_ABBR_MONTH_DAY); - } else { - - /* ampm format */ - if (s_info.timeformat == APPCORE_TIME_FORMAT_UNKNOWN) { - r = appcore_get_timeformat(&timeformat); - if (r == 0) { - s_info.timeformat = timeformat; - } else { - s_info.timeformat = APPCORE_TIME_FORMAT_UNKNOWN; - } - } - - /* show time */ - if (s_info.timeformat == APPCORE_TIME_FORMAT_24) { - _get_formatted_time_from_utc_time(intime, buf, buf_len, timezone, APPCORE_TIME_FORMAT_24, ad); - } else { - _get_formatted_time_from_utc_time(intime, time_buf, time_buf_len, timezone, APPCORE_TIME_FORMAT_12, ad); - _get_formatted_ampm_from_utc_time(intime, ampm_buf, ampm_buf_len, &m_dst_len, timezone, ad); - if (ampm_dst_len > 4) { - if (loc_time.tm_hour > 12) { - snprintf(ampm_buf, sizeof(ampm_buf)-1, "%s", "PM"); - } else { - snprintf(ampm_buf, sizeof(ampm_buf)-1, "%s", "AM"); - } - } - if (strlen(ampm_buf) + strlen(time_buf) < buf_len - 1) { - if (s_info.is_pre_meridiem) { - snprintf(buf, buf_len-1, "%s %s", ampm_buf, time_buf); - } else { - snprintf(buf, buf_len-1, "%s %s", time_buf, ampm_buf); - } - } else { - snprintf(buf, buf_len-1, "%s", time_buf); - } - } - } - DBG("%s %d", buf, intime); - return 0; -} - static UDateTimePatternGenerator *__util_time_generator_get(void *data) { UErrorCode status = U_ZERO_ERROR; @@ -861,10 +359,10 @@ static UDateFormat *__util_time_date_formatter_get(void *data, const char *timez skeleton_len = u_strlen(u_skeleton); u_best_pattern_capacity = - (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); + (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); udatpg_getBestPattern(s_info.date_generator, u_skeleton, skeleton_len, - u_best_pattern, u_best_pattern_capacity, &status); + u_best_pattern, u_best_pattern_capacity, &status); if (U_FAILURE(status)) { ERR("udatpg_getBestPattern() failed"); return NULL; @@ -874,11 +372,11 @@ static UDateFormat *__util_time_date_formatter_get(void *data, const char *timez if (timezone_id == NULL) { u_uastrncpy(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.dateregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } else { u_uastrncpy(u_timezone_id, timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.dateregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } if (U_FAILURE(status)) { ERR("udat_open() failed"); @@ -907,11 +405,11 @@ static UDateFormat *__util_time_ampm_formatter_get(void *data, const char *timez if (timezone_id == NULL) { u_uastrncpy(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.timeregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } else { u_uastrncpy(u_timezone_id, timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.timeregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } if (U_FAILURE(status)) { ERR("udat_open() failed"); @@ -952,10 +450,10 @@ static UDateFormat *__util_time_time_formatter_get(void *data, int time_format, } u_best_pattern_capacity = - (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); + (int32_t) (sizeof(u_best_pattern) / sizeof((u_best_pattern)[0])); udatpg_getBestPattern(s_info.generator, u_pattern, u_strlen(u_pattern), - u_best_pattern, u_best_pattern_capacity, &status); + u_best_pattern, u_best_pattern_capacity, &status); if (U_FAILURE(status)) { ERR("udatpg_getBestPattern() failed"); return NULL; @@ -969,21 +467,17 @@ static UDateFormat *__util_time_time_formatter_get(void *data, int time_format, s_info.is_pre_meridiem = EINA_FALSE; } - char *a_best_pattern_fixed = strtok(a_best_pattern, "a"); - a_best_pattern_fixed = strtok(a_best_pattern_fixed, " "); - if (a_best_pattern_fixed) { - u_uastrcpy(u_best_pattern, a_best_pattern_fixed); - } + u_uastrcpy(u_best_pattern, buf); UChar u_timezone_id[BUF_FORMATTER] = {0,}; if (timezone_id == NULL) { u_uastrncpy(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.timeregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } else { u_uastrncpy(u_timezone_id, timezone_id, sizeof(u_timezone_id)); formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, s_info.timeregion_format, u_timezone_id, -1, - u_best_pattern, -1, &status); + u_best_pattern, -1, &status); } if (U_FAILURE(status)) { ERR("udat_open() failed"); @@ -1090,7 +584,6 @@ static char *_util_time_timezone_id_get(void) return strdup(buf + 20); } - static int _util_time_formatted_time_get(UDateFormat *formatter, time_t tt, char *buf, int buf_len) { i18n_udate u_time = (i18n_udate)(tt) * 1000; @@ -1100,7 +593,7 @@ static int _util_time_formatted_time_get(UDateFormat *formatter, time_t tt, char int status = I18N_ERROR_INVALID_PARAMETER; u_formatted_str_capacity = - (int32_t)(sizeof(u_formatted_str) / sizeof((u_formatted_str)[0])); + (int32_t)(sizeof(u_formatted_str) / sizeof((u_formatted_str)[0])); status = i18n_udate_format_date(formatter, u_time, u_formatted_str, u_formatted_str_capacity, NULL, &formatted_str_len); if (status != I18N_ERROR_NONE) { @@ -1118,7 +611,6 @@ static int _util_time_formatted_time_get(UDateFormat *formatter, time_t tt, char return (int)u_strlen(u_formatted_str); } - static void _formatter_create(void *data) { int ret = 0; @@ -1126,10 +618,8 @@ static void _formatter_create(void *data) retif_nomsg(ad == NULL, ); bool status = false; -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &status); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR) : %d", ret); -#endif if (status == true){ s_info.timeformat = APPCORE_TIME_FORMAT_24; @@ -1180,6 +670,19 @@ static void _formatter_destory(void *data) s_info.is_initialized = 0; } +static void _util_time_setting_changed_cb(system_settings_key_e key, void *data) +{ + struct appdata *ad = data; + + _formatter_destory(ad); + _formatter_create(ad); + + _util_time_heartbeat_do(); + + //upate noti time information. + quickpanel_noti_update_by_system_time_changed_setting_cb(key, ad); +} + static void _util_time_vconf_changed_cb(keynode_t *key, void *data) { struct appdata *ad = data; @@ -1190,7 +693,7 @@ static void _util_time_vconf_changed_cb(keynode_t *key, void *data) _util_time_heartbeat_do(); //upate noti time information. - quickpanel_noti_update_by_system_time_changed_cb(key,ad); + quickpanel_noti_update_by_system_time_changed_vconf_cb(key, ad); } static void _time_event_deattach(void *data) @@ -1206,14 +709,13 @@ static void _time_event_deattach(void *data) msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _util_time_vconf_changed_cb); msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); -#ifdef HAVE_X + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_TIME_CHANGED, ret); ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, ret); ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ret); -#endif } static void _time_event_attach(void *data) @@ -1229,14 +731,14 @@ static void _time_event_attach(void *data) msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _util_time_vconf_changed_cb, data); msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); -#ifdef HAVE_X - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED, _util_time_vconf_changed_cb, data); + + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED, _util_time_setting_changed_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_TIME_CHANGED, ret); - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, _util_time_vconf_changed_cb, data); + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, _util_time_setting_changed_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, ret); - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, _util_time_vconf_changed_cb, data); + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, _util_time_setting_changed_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to set key(%d) : %d", SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ret); -#endif + } static void _util_time_get(int is_current_time, time_t tt_a, char **str_date, char **str_time, char **str_meridiem) @@ -1274,7 +776,11 @@ static void _util_time_get(int is_current_time, time_t tt_a, char **str_date, ch } } - convert_formatted_str = _string_replacer(buf_time, colon, ratio); + if (strstr(s_info.timeregion_format, "ar_")) { + convert_formatted_str = strdup(buf_time); + } else { + convert_formatted_str = _string_replacer(buf_time, colon, ratio); + } if (str_date != NULL) { *str_date = strdup(buf_date); diff --git a/daemon/datetime/util-time.h b/daemon/datetime/util-time.h index 7b3e7aa..5f43381 100644..100755 --- a/daemon/datetime/util-time.h +++ b/daemon/datetime/util-time.h @@ -23,6 +23,6 @@ #define UTIL_TIME_MERIDIEM_TYPE_PRE 1 #define UTIL_TIME_MERIDIEM_TYPE_POST 2 -void quickpanel_util_time_timer_enable_set(int is_enable); +extern void quickpanel_util_time_timer_enable_set(int is_enable); #endif /* __UTIL_TIME_H__ */ diff --git a/daemon/dbus_utility.c b/daemon/dbus_utility.c index e23236e..e8e3969 100644..100755 --- a/daemon/dbus_utility.c +++ b/daemon/dbus_utility.c @@ -16,7 +16,13 @@ */ +#include <Elementary.h> #include <glib.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" @@ -40,9 +46,9 @@ HAPI void quickpanel_dbus_activenoti_visibility_send(int is_visible) member = QP_DBUS_ACTIVENOTI_MEMBER_HIDE; } signal = - dbus_message_new_signal(QP_DBUS_ACTIVENOTI_PATH - , QP_DBUS_ACTIVENOTI_NAME - , member); + dbus_message_new_signal(QP_DBUS_ACTIVENOTI_PATH + , QP_DBUS_ACTIVENOTI_NAME + , member); if (signal == NULL) { ERR("Fail to dbus_message_new_signal"); return; diff --git a/daemon/dbus_utility.h b/daemon/dbus_utility.h index 02ffdb6..42d890a 100644..100755 --- a/daemon/dbus_utility.h +++ b/daemon/dbus_utility.h @@ -18,6 +18,6 @@ #ifndef __QP_DBUS_UTILITY_H__ #define __QP_DBUS_UTILITY_H__ -void quickpanel_dbus_activenoti_visibility_send(int is_visible); +extern void quickpanel_dbus_activenoti_visibility_send(int is_visible); -#endif
\ No newline at end of file +#endif diff --git a/daemon/device/brightness.c b/daemon/device/brightness.c index cf14a55..9084666 100755 --- a/daemon/device/brightness.c +++ b/daemon/device/brightness.c @@ -16,26 +16,35 @@ */ +#include <Elementary.h> #include <glib.h> #include <string.h> + +#include <notification.h> #include <vconf.h> #include <device/display.h> #include <app_control.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "common.h" #include "quickpanel-ui.h" #include "list_util.h" #include "quickpanel_def.h" +#include "settings_view_featured.h" +#include "preference.h" +#include "setting_utils.h" +#include "page_setting_all.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif -#include "preference.h" -#include "setting_utils.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "page_setting_all.h" -#include "settings_view_featured.h" + #define BRIGHTNESS_MIN 1 #define BRIGHTNESS_MAX 100 @@ -146,23 +155,6 @@ static void _set_slider_accessiblity_state(Evas_Object *obj) } #endif -static void _set_text_to_part(Evas_Object *obj, const char *part, const char *text) -{ - const char *old_text = NULL; - retif(obj == NULL, , "Invalid parameter!"); - retif(part == NULL, , "Invalid parameter!"); - retif(text == NULL, , "Invalid parameter!"); - - old_text = elm_object_part_text_get(obj, part); - if (old_text != NULL) { - if (strcmp(old_text, text) == 0) { - return; - } - } - - elm_object_part_text_set(obj, part, text); -} - static Evas_Object *_check_duplicated_loading(Evas_Object *obj, const char *part) { Evas_Object *old_content = NULL; @@ -225,7 +217,6 @@ Evas_Object *_slider_get(Evas_Object *view, brightness_ctrl_obj *ctrl_obj) { } } - static void _slider_changed_job_cb(void *data) { int value = 0; @@ -258,18 +249,14 @@ static void _slider_changed_job_cb(void *data) } -static void -_brightness_ctrl_slider_changed_cb(void *data, - Evas_Object *obj, - void *event_info) +static void _brightness_ctrl_slider_changed_cb(void *data, Evas_Object *obj, void *event_info) { - int pos_new = (int)event_info; + int pos_new = (long)event_info; LOGI("SLIDER_NEW_POS: %d", pos_new); _slider_changed_job_cb(data); } - static void _brightness_ctrl_overheat_check(Evas_Object *slider, void *data, int is_display_popup) { int value = 0; @@ -289,7 +276,7 @@ static void _brightness_ctrl_overheat_check(Evas_Object *slider, void *data, int if (is_display_popup == 1) { if (ad->popup == NULL) { quickpanel_setting_create_timeout_popup(ad->win, - _("IDS_ST_POP_UNABLE_TO_INCREASE_BRIGHTNESS_FURTHER_BECAUSE_OF_PHONE_OVERHEATING")); + _("IDS_ST_POP_UNABLE_TO_INCREASE_BRIGHTNESS_FURTHER_BECAUSE_OF_PHONE_OVERHEATING")); } } elm_slider_value_set(slider, (double)max_brightness); @@ -317,34 +304,23 @@ static void _slider_delayed_changed_job_cb(void *data) } } -static void -_brightness_ctrl_slider_delayed_changed_cb(void *data, - Evas_Object *obj, - void *event_info) +static void _brightness_ctrl_slider_delayed_changed_cb(void *data, Evas_Object *obj, void *event_info) { LOGI(""); ecore_job_add(_slider_delayed_changed_job_cb, data); } -static void -_brightness_slider_drag_start_cb(void *data, - Evas_Object *obj, - void *event_info) +static void _brightness_slider_drag_start_cb(void *data, Evas_Object *obj, void *event_info) { is_sliding = EINA_TRUE; slider_drag_start = _brightness_get_level(); } -static void -_brightness_slider_drag_stop_cb(void *data, - Evas_Object *obj, - void *event_info) +static void _brightness_slider_drag_stop_cb(void *data, Evas_Object *obj, void *event_info) { - brightness_ctrl_obj *ctrl_obj = data; is_sliding = EINA_FALSE; } - /*! * workaround to avoid focus jump to other pages */ @@ -358,19 +334,18 @@ static void _frame_unfocused(void *data, Evas_Object * obj, void *event_info) quickpanel_page_setting_all_focus_allow_set(EINA_TRUE); } - static void _brightness_view_pos_set() { struct appdata *ad = quickpanel_get_app_data(); Evas_Coord base_y; -// Evas_Coord settings_y; + // Evas_Coord settings_y; Evas_Coord brightness_y; Eina_Bool ret = EINA_FALSE; edje_object_part_geometry_get(_EDJ(ad->view_root), "qp.root.swallow", NULL, &base_y, NULL, NULL); -// edje_object_part_geometry_get(ad->ly, QP_SETTING_BASE_PART, NULL, &settings_y, NULL, NULL); + // edje_object_part_geometry_get(ad->ly, QP_SETTING_BASE_PART, NULL, &settings_y, NULL, NULL); Evas_Object *settings_swallow = quickpanel_setting_layout_get(ad->ly, QP_SETTING_BASE_PART); ret = edje_object_part_geometry_get(_EDJ(settings_swallow), QP_SETTING_BRIGHTNESS_PART_WVGA, NULL, &brightness_y, NULL, NULL); @@ -426,16 +401,14 @@ static Evas_Object *_brightness_view_create(Evas_Object *list) return view_wrapper; } - static void _brightness_set_image(int level) { - int old_brightness_type = -1; - int mapped_level = 0; - char buf[128] = {0,}; - Evas_Object *view = _controller_view_get(); - brightness_ctrl_obj *ctrl_obj = g_ctrl_obj; - retif(ctrl_obj == NULL, , "Invalid parameter!"); - retif(view == NULL, , "Invalid parameter!"); + int mapped_level; + + if (!g_ctrl_obj) { + ERR("Ctrl Obj is not defined"); + return; + } if (level <= 1) { mapped_level = 0; @@ -447,10 +420,14 @@ static void _brightness_set_image(int level) mapped_level = (level / 10); } - if (ctrl_obj->level_before != mapped_level ) { + if (g_ctrl_obj->level_before != mapped_level ) { + char buf[128] = {0,}; + Evas_Object *view; + + view = _controller_view_get(); snprintf(buf, sizeof(buf) - 1, "icon.state.%d", mapped_level); elm_object_signal_emit(view, buf, "prog"); - ctrl_obj->level_before = mapped_level; + g_ctrl_obj->level_before = mapped_level; } } @@ -473,18 +450,10 @@ static void _brightness_set_slider(void) evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5); elm_slider_min_max_set(slider, ctrl_obj->min_level, ctrl_obj->max_level); - evas_object_smart_callback_add(slider, "changed", - _brightness_ctrl_slider_changed_cb, ctrl_obj); - evas_object_smart_callback_add(slider, "delay,changed", - _brightness_ctrl_slider_delayed_changed_cb, ctrl_obj); - - evas_object_smart_callback_add(slider, "slider,drag,start", - _brightness_slider_drag_start_cb, ctrl_obj); - - - evas_object_smart_callback_add(slider, "slider,drag,stop", - _brightness_slider_drag_stop_cb, ctrl_obj); - + evas_object_smart_callback_add(slider, "changed", _brightness_ctrl_slider_changed_cb, ctrl_obj); + evas_object_smart_callback_add(slider, "delay,changed", _brightness_ctrl_slider_delayed_changed_cb, ctrl_obj); + evas_object_smart_callback_add(slider, "slider,drag,start", _brightness_slider_drag_start_cb, ctrl_obj); + evas_object_smart_callback_add(slider, "slider,drag,stop", _brightness_slider_drag_stop_cb, ctrl_obj); elm_object_part_content_set(view, "elm.swallow.slider", slider); } else { ERR("failed to create slider"); diff --git a/daemon/handler_controller.c b/daemon/handler_controller.c index 526fe9f..8ad2401 100644..100755 --- a/daemon/handler_controller.c +++ b/daemon/handler_controller.c @@ -16,7 +16,7 @@ */ -#include "handler_controller.h" +#include <Elementary.h> #include <dlog.h> #include <vconf.h> @@ -25,8 +25,13 @@ #include <ITapiSim.h> #include <TelCall.h> #include <ITapiCall.h> -#include "setting_utils.h" +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "handler_controller.h" +#include "setting_utils.h" #include "list_util.h" #include "quickpanel-ui.h" #include "common.h" diff --git a/daemon/handler_controller.h b/daemon/handler_controller.h index 5ae5963..eec2530 100644..100755 --- a/daemon/handler_controller.h +++ b/daemon/handler_controller.h @@ -19,13 +19,7 @@ #ifndef HANDLER_CONTROLLER_H_ #define HANDLER_CONTROLLER_H_ -#include <stdio.h> -#include <stdlib.h> -#include <Evas.h> -#include <Elementary.h> -#include <Eina.h> - -void quickpanel_handler_text_set(char *text); -void quickpanel_handler_set_visibility(Eina_Bool visible); +extern void quickpanel_handler_text_set(char *text); +extern void quickpanel_handler_set_visibility(Eina_Bool visible); #endif /* HANDLER_CONTROLLER_H_ */ diff --git a/daemon/list_util.c b/daemon/list_util.c index 986cd17..ad40a9e 100755 --- a/daemon/list_util.c +++ b/daemon/list_util.c @@ -19,6 +19,11 @@ #include <Elementary.h> #include <stdlib.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" #include "common.h" #include "list_util.h" #include "vi_manager.h" @@ -60,9 +65,9 @@ static void _viewer_unfreeze(Evas_Object *viewer) HAPI qp_item_data *quickpanel_list_util_item_new(qp_item_type_e type, void *data) { - qp_item_data *qid = NULL; + qp_item_data *qid; - qid = malloc(sizeof(struct _qp_item_data)); + qid = malloc(sizeof(*qid)); if (!qid) { ERR("fail to alloc qid"); return NULL; @@ -74,6 +79,11 @@ HAPI qp_item_data *quickpanel_list_util_item_new(qp_item_type_e type, void *data return qid; } +HAPI void quickpanel_list_util_item_del(qp_item_data *qid) +{ + free(qid); +} + HAPI void quickpanel_list_util_item_set_tag(Evas_Object *item, qp_item_data *qid) { retif(item == NULL, , "invalid parameter"); @@ -193,8 +203,7 @@ static int _item_compare(const void *data1, const void *data2) return diff; } -static void _list_util_layout_get_coord(Evas_Object *container, Evas_Object *first, - int *coord_x, int *coord_y) +static void _list_util_layout_get_coord(Evas_Object *container, Evas_Object *first, int *coord_x, int *coord_y) { int x = 0; int y = 0; @@ -216,7 +225,7 @@ static void _list_util_layout_get_coord(Evas_Object *container, Evas_Object *fir if (obj != NULL) { item_type = quickpanel_list_util_item_type_get(obj); if (item_type == QP_ITEM_TYPE_ONGOING_NOTI - || item_type == QP_ITEM_TYPE_NOTI) { + || item_type == QP_ITEM_TYPE_NOTI) { list_tmp = elm_box_children_get(obj); if (list_tmp != NULL) { if (eina_list_count(list_tmp) != 0 ) { @@ -253,8 +262,7 @@ static void _list_util_layout_get_coord(Evas_Object *container, Evas_Object *fir } } -Evas_Object *_list_util_get_first(Evas_Object *list, - Evas_Object *new_obj) +Evas_Object *_list_util_get_first(Evas_Object *list, Evas_Object *new_obj) { Eina_List *l; Eina_List *l_next; @@ -300,8 +308,7 @@ HAPI qp_item_type_e quickpanel_list_util_item_type_get(Evas_Object *item) return QP_ITEM_TYPE_NONE; } -HAPI void quickpanel_list_util_item_unpack_by_object(Evas_Object *list - , Evas_Object *item, int is_unpack_only, int is_hide) +HAPI void quickpanel_list_util_item_unpack_by_object(Evas_Object *list , Evas_Object *item, int is_unpack_only, int is_hide) { QP_VI *vi = NULL; qp_item_data *qid = NULL; @@ -325,8 +332,7 @@ HAPI void quickpanel_list_util_item_unpack_by_object(Evas_Object *list quickpanel_vi_start(vi); } -HAPI void quickpanel_list_util_sort_insert(Evas_Object *list, - Evas_Object *new_obj) +HAPI void quickpanel_list_util_sort_insert(Evas_Object *list, Evas_Object *new_obj) { QP_VI *vi = NULL; diff --git a/daemon/list_util.h b/daemon/list_util.h index 8ddb165..342e365 100755 --- a/daemon/list_util.h +++ b/daemon/list_util.h @@ -19,20 +19,16 @@ #ifndef _QP_LIST_UTIL_DEF_ #define _QP_LIST_UTIL_DEF_ -#include <Elementary.h> - typedef enum { QP_ITEM_TYPE_NONE = -1, QP_ITEM_TYPE_SETTING = 0, QP_ITEM_TYPE_BRIGHTNESS, - QP_ITEM_TYPE_DUAL_SIM, + QP_ITEM_TYPE_VOICE_CONTOL, QP_ITEM_TYPE_FACTORY, QP_ITEM_TYPE_MULTIWINDOW, QP_ITEM_TYPE_EARJACK, QP_ITEM_TYPE_MINICTRL_ONGOING, - QP_ITEM_TYPE_MINICTRL_TOP, QP_ITEM_TYPE_MINICTRL_MIDDLE, - QP_ITEM_TYPE_MINICTRL_LOW, QP_ITEM_TYPE_ONGOING_NOTI_GROUP, QP_ITEM_TYPE_ONGOING_NOTI, QP_ITEM_TYPE_NOTI_GROUP, @@ -49,25 +45,21 @@ typedef struct _qp_item_count { int minicontrol; } qp_item_count; +extern qp_item_data *quickpanel_list_util_item_new(qp_item_type_e type, void *data); +extern void quickpanel_list_util_item_del(qp_item_data *qid); +extern void quickpanel_list_util_item_set_tag(Evas_Object *item, qp_item_data *qid); +extern void quickpanel_list_util_item_del_tag(Evas_Object *item); -qp_item_data *quickpanel_list_util_item_new(qp_item_type_e type, void *data); -void quickpanel_list_util_item_set_tag(Evas_Object *item, qp_item_data *qid); -void quickpanel_list_util_item_del_tag(Evas_Object *item); - -void *quickpanel_list_util_item_get_data(qp_item_data *qid); -void quickpanel_list_util_item_set_data(qp_item_data *qid, void *data); -int quickpanel_list_util_item_compare(const void *data1, const void *data2); -qp_item_type_e quickpanel_list_util_item_type_get(Evas_Object *item); - -void quickpanel_list_util_item_unpack_by_object(Evas_Object *list - , Evas_Object *item, int is_unpack_only, int is_hide); +extern void *quickpanel_list_util_item_get_data(qp_item_data *qid); +extern void quickpanel_list_util_item_set_data(qp_item_data *qid, void *data); +extern int quickpanel_list_util_item_compare(const void *data1, const void *data2); +extern qp_item_type_e quickpanel_list_util_item_type_get(Evas_Object *item); -void quickpanel_list_util_sort_insert(Evas_Object *list, - Evas_Object *new_obj); +extern void quickpanel_list_util_item_unpack_by_object(Evas_Object *list , Evas_Object *item, int is_unpack_only, int is_hide); +extern void quickpanel_list_util_sort_insert(Evas_Object *list, Evas_Object *new_obj); -Elm_Transit *quickpanel_list_util_get_reorder_transit(Evas_Object *item, - Elm_Transit *transit, int distance); -void quickpanel_list_util_scroll_freeze_set(Eina_Bool is_freeze); +extern Elm_Transit *quickpanel_list_util_get_reorder_transit(Evas_Object *item, Elm_Transit *transit, int distance); +extern void quickpanel_list_util_scroll_freeze_set(Eina_Bool is_freeze); #endif /* _QP_LIST_UTIL_DEF_ */ diff --git a/daemon/media.c b/daemon/media.c index 982b581..d61e79e 100755 --- a/daemon/media.c +++ b/daemon/media.c @@ -16,11 +16,23 @@ */ #include <stdio.h> +#include <unistd.h> #include <glib.h> +#include <unistd.h> + +#include <Elementary.h> + #include <vconf.h> #include <metadata_extractor.h> +#include <feedback.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <player.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" +#include "media.h" #define NEED_TO_DEBUG_LOCKUP_ISSUE @@ -38,8 +50,7 @@ static struct info { static void _quickpanel_player_free(player_h *sound_player); -static void -_quickpanel_player_del_timeout_timer(void) +static void _quickpanel_player_del_timeout_timer(void) { if (s_info.playing_timer) { ecore_timer_del(s_info.playing_timer); @@ -118,8 +129,7 @@ static void _quickpanel_player_start_job_cb(void *data) #endif } -static void -_quickpanel_player_completed_cb(void *user_data) +static void _quickpanel_player_completed_cb(void *user_data) { retif(user_data == NULL, , "invalid parameter"); player_h *sound_player = user_data; @@ -130,8 +140,7 @@ _quickpanel_player_completed_cb(void *user_data) _quickpanel_player_free(sound_player); } -static void -_quickpanel_player_interrupted_cb(player_interrupted_code_e code, void *user_data) +static void _quickpanel_player_interrupted_cb(player_interrupted_code_e code, void *user_data) { retif(user_data == NULL, , "invalid parameter"); player_h *sound_player = user_data; @@ -142,8 +151,7 @@ _quickpanel_player_interrupted_cb(player_interrupted_code_e code, void *user_dat _quickpanel_player_free(sound_player); } -static void -_quickpanel_player_error_cb(int error_code, void *user_data) +static void _quickpanel_player_error_cb(int error_code, void *user_data) { retif(user_data == NULL, , "invalid parameter"); player_h *sound_player = user_data; @@ -157,9 +165,9 @@ _quickpanel_player_error_cb(int error_code, void *user_data) HAPI int quickpanel_media_player_is_drm_error(int error_code) { if (error_code == PLAYER_ERROR_DRM_EXPIRED - || error_code == PLAYER_ERROR_DRM_NO_LICENSE - || error_code == PLAYER_ERROR_DRM_FUTURE_USE - || error_code == PLAYER_ERROR_DRM_NOT_PERMITTED) { + || error_code == PLAYER_ERROR_DRM_NO_LICENSE + || error_code == PLAYER_ERROR_DRM_FUTURE_USE + || error_code == PLAYER_ERROR_DRM_NOT_PERMITTED) { return 1; } @@ -311,9 +319,8 @@ static Eina_Bool _playable_check(const char *file_path) ret = EINA_TRUE; } - if (value != NULL) { - free(value); - } + free(value); + DBG("%s :: playable[%d]", file_path, ret); metadata_extractor_destroy(metadata); return ret; diff --git a/daemon/media.h b/daemon/media.h index 3365e78..ae011c3 100755 --- a/daemon/media.h +++ b/daemon/media.h @@ -18,23 +18,19 @@ #ifndef __QUICKPANEL_MEDIA_H__ #define __QUICKPANEL_MEDIA_H__ -#include <player.h> -#include <sound_manager.h> -#include <feedback.h> - #define QP_PLAY_DURATION_LIMIT 15 -int quickpanel_media_player_play(sound_type_e sound_type, const char *sound_file); -void quickpanel_media_player_stop(void); -int quickpanel_media_is_sound_enabled(void); -int quickpanel_media_is_vib_enabled(void); -void quickpanel_media_play_feedback(void); -int quickpanel_media_set_mute_toggle(void); -void quickpanel_media_player_id_set(int id); -int quickpanel_media_player_id_get(void); -Eina_Bool quickpanel_media_playable_check(const char *file_path); -int quickpanel_media_player_is_drm_error(int error_code); -void quickpanel_media_init(void); -void quickpanel_media_fini(void); +extern int quickpanel_media_player_play(sound_type_e sound_type, const char *sound_file); +extern void quickpanel_media_player_stop(void); +extern int quickpanel_media_is_sound_enabled(void); +extern int quickpanel_media_is_vib_enabled(void); +extern void quickpanel_media_play_feedback(void); +extern int quickpanel_media_set_mute_toggle(void); +extern void quickpanel_media_player_id_set(int id); +extern int quickpanel_media_player_id_get(void); +extern Eina_Bool quickpanel_media_playable_check(const char *file_path); +extern int quickpanel_media_player_is_drm_error(int error_code); +extern void quickpanel_media_init(void); +extern void quickpanel_media_fini(void); #endif diff --git a/daemon/minictrl/minictrl.c b/daemon/minictrl/minictrl.c index 8242ba6..7a42c17 100755 --- a/daemon/minictrl/minictrl.c +++ b/daemon/minictrl/minictrl.c @@ -16,65 +16,89 @@ */ +#include <Elementary.h> #include <glib.h> -#include <minicontrol-viewer.h> -#include <minicontrol-monitor.h> #include <string.h> +#include <stdbool.h> + +#include <minicontrol-viewer.h> +#include <minicontrol-internal.h> +#include <bundle.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" +#include "common_uic.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" #include "list_util.h" #include "quickpanel_debug_util.h" +#include "minictrl.h" +#include "vi_manager.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif -#include "minictrl.h" -#include "vi_manager.h" #define MINICONTROL_TYPE_STR_VIEWER "::[viewer=" #define MINICONTROL_TYPE_STR_QUICKPANEL "QUICKPANEL" #define MINICONTROL_TYPE_STR_LOCKSCREEN "LOCKSCREEN" #define MINICONTROL_TYPE_STR_ONGOING "_ongoing]" +#define MINICONTROL_VIEW_DATA "MINICONTROL_VIEW_DATA" -static Eina_Bool _anim_init_cb(void *data); -static Eina_Bool _anim_job_cb(void *data); -static Eina_Bool _anim_done_cb(void *data); -static int _init(void *data); -static int _fini(void *data); -static int _suspend(void *data); -static int _resume(void *data); +#define THRESHOLD_DELETE_START 30 +#define THRESHOLD_DELETE_START_Y_LIMIT 60 +#define THRESHOLD_DISTANCE (200) +#define THRESHOLD_DISTANCE_LOCK (500) -QP_Module minictrl = { - .name = "minictrl", - .init = _init, - .fini = _fini, - .suspend = _suspend, - .resume = _resume, - .hib_enter = NULL, - .hib_leave = NULL, - .lang_changed = NULL, - .refresh = NULL, - .get_height = NULL, -}; +#define MINICONTROL_BUNDLE_KEY_WIDTH "width" +#define MINICONTROL_BUNDLE_KEY_HEIGHT "height" + +#define BUNDLE_BUFFER_LENGTH 100 + +typedef enum _gesture_state_type { + STATE_NORMAL = 0, + STATE_GESTURE_WAIT, + STATE_GESTURE_CANCELED, + STATE_DELETED, +} gesture_state_type; struct _viewer_item { char *name; unsigned int width; unsigned int height; - minicontrol_priority_e priority; Evas_Object *viewer; void *data; + + //for flick gesture + QP_VI *vi; + int obj_w; + int obj_h; + int press_x; + int press_y; + int distance; + int need_to_cancel_press; + gesture_state_type state; + int deletable; }; -static void _minictrl_resize_vi(Evas_Object *list, - struct _viewer_item *item, int to_w, int to_h); +static struct _info { + GHashTable *prov_table; +} s_info = { + .prov_table = NULL, +}; -GHashTable *g_prov_table; +void _minictrl_sendview_rotation_event(const char* name, int angle); static int _viewer_check(const char *name) { char *pos_start = NULL; - retif(!name, 0, "name is NULL"); + + if (!name) { + ERR("Name is NULL"); + return 0; + } if ((pos_start = strstr(name, MINICONTROL_TYPE_STR_VIEWER)) != NULL) { if (strstr(pos_start, MINICONTROL_TYPE_STR_QUICKPANEL) != NULL) { @@ -89,22 +113,14 @@ static int _viewer_check(const char *name) return 1; } -static void _viewer_freeze(Evas_Object *viewer) -{ - int freezed_count = 0; - retif(viewer == NULL, , "Invalid parameter!"); - - freezed_count = elm_object_scroll_freeze_get(viewer); - - if (freezed_count <= 0) { - elm_object_scroll_freeze_push(viewer); - } -} - static void _viewer_unfreeze(Evas_Object *viewer) { int i = 0, freezed_count = 0; - retif(viewer == NULL, , "Invalid parameter!"); + + if (!viewer) { + ERR("Invalid parameter"); + return; + } freezed_count = elm_object_scroll_freeze_get(viewer); @@ -115,36 +131,49 @@ static void _viewer_unfreeze(Evas_Object *viewer) static Evas_Object *_get_minictrl_obj(Evas_Object *layout) { - retif(layout == NULL, NULL, "Invalid parameter!"); + if (!layout) { + ERR("Invalid parameter"); + return NULL; + } return elm_object_part_content_get(layout, "elm.icon"); } static void _viewer_set_size(Evas_Object *layout, void *data, int width, int height) { - Evas_Object *viewer = NULL; - retif(layout == NULL, , "Invalid parameter!"); - retif(data == NULL, , "Invalid parameter!"); - retif(width < 0, , "Invalid parameter!"); - retif(height < 0, , "Invalid parameter!"); - struct appdata *ad = data; - int max_width = 0; - int resized_width = 0; - int is_landscape = 0; + Evas_Object *viewer; + struct appdata *ad; + int max_width; + int resized_width; + int is_landscape; + + if (!layout || !data || width < 0 || height < 0) { + ERR("Invalid parameters (%p, %p, %d, %d)", layout, data, width, height); + return; + } viewer = _get_minictrl_obj(layout); - retif(viewer == NULL, , "Invalid parameter!"); + if (!viewer) { + ERR("Unable to get the 'viewer'"); + return; + } - is_landscape = (width > ad->win_width) ? 1 : 0; + ad = data; - if (is_landscape) { - max_width = (ad->scale * ad->win_height); + if (ad->angle == 0 || ad->angle == 180) { + is_landscape = 0; } else { - max_width = (ad->scale * ad->win_width); + is_landscape = 1; } + + if (width > ad->win_width) { + ERR("MC Size is not valid. it is larger than window size: %dx%d (%dx%d) %d", width, height, ad->win_width, ad->win_height, ad->angle); + } + + max_width = is_landscape ? ad->win_height : ad->win_width; resized_width = (width > max_width) ? max_width : width; - SERR("minicontroller view is resized to w:%d(%d) h:%d Landscape[%d]", resized_width, width, height, is_landscape); + SERR("minicontroller view is resized to w:%d/%d(%d) h:%d Landscape[%d]", resized_width, max_width, width, height, is_landscape); evas_object_size_hint_min_set(viewer, resized_width, height); evas_object_size_hint_max_set(viewer, resized_width, height); @@ -152,65 +181,301 @@ static void _viewer_set_size(Evas_Object *layout, void *data, int width, int hei static void _viewer_item_free(struct _viewer_item *item) { - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); - retif(ad->list == NULL, , "Invalid parameter!"); - retif(item == NULL, , "Invalid parameter!"); + struct appdata *ad; - if (item->name) { - free(item->name); + ad = quickpanel_get_app_data(); + if (!ad || !ad->list || !item) { + ERR("Invalid paramter %p, %p, %p", ad, ad ? ad->list : NULL, item); + return; } + free(item->name); + if (item->viewer) { quickpanel_list_util_item_unpack_by_object(ad->list, item->viewer, 0, 0); quickpanel_list_util_item_del_tag(item->viewer); - if (item->viewer != NULL) { - evas_object_del(item->viewer); - item->viewer = NULL; - } + evas_object_del(item->viewer); } free(item); } +static bool _check_deletable(Evas_Object *obj) +{ + struct _viewer_item *vit; + + vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA); + if (vit) { + return vit->deletable; + } + + return TRUE; +} + +static void _mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev; + struct _viewer_item *vit; + + vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA); + ev = (Evas_Event_Mouse_Down *)event_info; + + if (!ev || !vit) { + ERR("ev %p, vit %p"); + return; + } + + evas_object_geometry_get(obj, NULL, NULL, &vit->obj_w, &vit->obj_h); + + vit->press_x = ev->canvas.x; + vit->press_y = ev->canvas.y; + vit->state = STATE_NORMAL; + + SDBG("mouse down:%d %d %d", vit->obj_w, vit->obj_h, vit->state); + + if (vit->vi != NULL) { + quickpanel_vi_user_event_del(vit->vi); + vit->vi = NULL; + } + + vit->need_to_cancel_press = 0; +} + +static void _mouse_move_cb(void* data, Evas* e, Evas_Object* obj, void* event_info) +{ + static int vi_start_x = 0; + static int delta_prev = -1; + int delta_x; + int x; + int y; + int w; + int h; + Evas_Event_Mouse_Move* ev; + struct _viewer_item *vit; + struct appdata *ad; + + ad = data; + ev = event_info; + vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA); + if (!ev || !vit || !ad) { + ERR("ev: %p, vit: %p, ad: %p", ev, vit, ad); + return; + } + + if (vit->state == STATE_GESTURE_CANCELED) { + DBG("deletion has been canceled"); + return; + } + + if (!_check_deletable(obj)) { + DBG("vit->deletable is false"); + return; + } + + evas_object_geometry_get(obj, &x, &y, &w, &h); + delta_x = (ev->cur.output.x - vit->press_x) / 2; + + switch (vit->state) { + case STATE_NORMAL: + if (abs(delta_x) >= THRESHOLD_DELETE_START) { + QP_VI *vi; + + DBG("start a deletion"); + vit->state = STATE_GESTURE_WAIT; + + vi_start_x = delta_x; + + vi = quickpanel_vi_new_with_data( + VI_OP_DELETE, + QP_ITEM_TYPE_NOTI, + NULL, + obj, + NULL, + NULL, + NULL, + NULL, /* _drag_cancel_cb, */ + NULL, /* vi == null */ + NULL, + 0, + 0); + + if (vi) { + vit->vi = vi; + quickpanel_vi_user_event_add(vi); + } else { + ERR("Unable to create a 'vi'"); + } + + vit->need_to_cancel_press = 1; + } + break; + case STATE_GESTURE_WAIT: + if (delta_prev != delta_x) { + Evas_Map *map; + + map = evas_map_new(4); + if (map != NULL) { + evas_map_util_points_populate_from_object(map, obj); + evas_map_util_points_populate_from_geometry(map, x + delta_x - vi_start_x, y, w, h, 0); + evas_object_map_enable_set(obj, EINA_TRUE); + evas_object_map_set(obj, map); + evas_map_free(map); + _viewer_unfreeze(ad->scroller); + } + delta_prev = delta_x; + } + break; + default: + break; + } + + vit->distance = delta_x; +} + +static void _minictrl_remove(const char *name, void *data) +{ + DBG("_minictrl_remove [%s]", name); + + minicontrol_viewer_send_event(name, MINICONTROL_EVENT_REQUEST_HIDE, NULL); + + if (s_info.prov_table) { + if (g_hash_table_remove(s_info.prov_table, name)) { + DBG("success to remove %s", name); + if (!data) { + ERR("data is NULL"); + /** + * @todo + * Oh, this function doesn't handles "data". + * Why does this has to check its existence?? + */ + return; + } + } else { + WARN("unknown provider name : %s", name); + } + } +} + +static void _mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + struct _viewer_item *vit; + struct appdata *ad; + int swipe_distance; + + ad = data; + vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA); + if (!vit || !ad) { + ERR("vit: %p, ad: %p", vit, ad); + return; + } + + _viewer_unfreeze(ad->scroller); + + if (!_check_deletable(obj)) { + swipe_distance = THRESHOLD_DISTANCE_LOCK; + } else { + swipe_distance = THRESHOLD_DISTANCE; + } + + switch (vit->state) { + case STATE_GESTURE_WAIT: + if (abs(vit->distance) >= (swipe_distance - 10)) { + Elm_Transit *transit_flick; + int x; + + x = abs(vit->distance) - THRESHOLD_DELETE_START; + + if (vit->distance > 0) { + evas_object_map_set(obj, NULL); + transit_flick = elm_transit_add(); + if (transit_flick != NULL) { + elm_transit_effect_translation_add(transit_flick, x, 0, 480, 0); + elm_transit_object_add(transit_flick, obj); + elm_transit_duration_set(transit_flick, 0.25 * (480 - x ) / 480); + elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); + elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); + elm_transit_go(transit_flick); + _minictrl_remove(vit->name, vit->data); + } + } else if (vit->distance < 0) { + evas_object_map_set(obj, NULL); + transit_flick = elm_transit_add(); + if (transit_flick != NULL) { + elm_transit_effect_translation_add(transit_flick, -x, 0, -480, 0); + elm_transit_object_add(transit_flick, obj); + elm_transit_duration_set(transit_flick, 0.25 * ( 480 - x ) / 480); + elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); + elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); + elm_transit_go(transit_flick); + _minictrl_remove(vit->name, vit->data); + } + } + } else { + evas_object_map_enable_set(obj, EINA_FALSE); + } + + if (vit->vi != NULL) { + quickpanel_vi_user_event_del(vit->vi); + vit->vi = NULL; + } + break; + case STATE_GESTURE_CANCELED: + evas_object_map_enable_set(obj, EINA_FALSE); + + if (vit->vi != NULL) { + quickpanel_vi_user_event_del(vit->vi); + vit->vi = NULL; + } + break; + default: + break; + } + + vit->state = STATE_NORMAL; +} + static Evas_Object *_minictrl_create_view(struct appdata *ad, const char *name) { - retif(ad == NULL, NULL, "Invalid parameter!"); - retif(ad->list == NULL, NULL, "Invalid parameter!"); - retif(name == NULL, NULL, "Invalid parameter!"); + Evas_Object *layout; + Evas_Object *viewer; + Evas_Object *focus; - Evas_Object *layout = NULL; + if (!ad || !ad->list || !name) { + ERR("Invalid parameters: %p %p %p", ad, ad ? ad->list : NULL, name); + return NULL; + } layout = elm_layout_add(ad->list); + if (!layout) { + ERR("Unable to create a layout"); + return NULL; + } - elm_layout_file_set(layout, DEFAULT_EDJ, - "quickpanel/minictrl/default"); - + elm_layout_file_set(layout, DEFAULT_EDJ, "quickpanel/minictrl/default"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(layout); - Evas_Object *viewer = minicontrol_viewer_add(layout, name); + viewer = minicontrol_viewer_add(layout, name); if (!viewer) { ERR("fail to add viewer - %s", name); - if (layout) { - evas_object_del(layout); - } + evas_object_del(layout); return NULL; } elm_object_focus_allow_set(viewer, EINA_TRUE); elm_object_part_content_set(layout, "elm.icon", viewer); - Evas_Object *focus = quickpanel_accessibility_ui_get_focus_object(layout); - elm_object_part_content_set(layout, "focus", focus); + evas_object_event_callback_add(viewer, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, ad); + evas_object_event_callback_add(viewer, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, ad); + evas_object_event_callback_add(viewer, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, ad); + focus = quickpanel_accessibility_ui_get_focus_object(layout); + elm_object_part_content_set(layout, "focus", focus); #ifdef QP_SCREENREADER_ENABLE - Evas_Object *ao = quickpanel_accessibility_screen_reader_object_get(layout, - SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus", layout); - + Evas_Object *ao; + ao = quickpanel_accessibility_screen_reader_object_get(layout, SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus", layout); if (ao != NULL) { - elm_access_info_cb_set(ao, ELM_ACCESS_TYPE, quickpanel_accessibility_info_cb, - _NOT_LOCALIZED("Mini controller")); + elm_access_info_cb_set(ao, ELM_ACCESS_TYPE, quickpanel_accessibility_info_cb, _NOT_LOCALIZED("Mini controller")); } #endif @@ -230,40 +495,7 @@ static int _minictrl_is_ongoing(const char *str) } } -static qp_item_type_e _minictrl_priority_to_type(minicontrol_priority_e priority) -{ - qp_item_type_e type; - - switch (priority) { - case MINICONTROL_PRIORITY_TOP: - type = QP_ITEM_TYPE_MINICTRL_TOP; - break; - case MINICONTROL_PRIORITY_MIDDLE: - type = QP_ITEM_TYPE_MINICTRL_MIDDLE; - break; - case MINICONTROL_PRIORITY_LOW: - default: - type = QP_ITEM_TYPE_MINICTRL_LOW; - break; - } - - return type; -} - -static void _minictrl_release_cb(void *data, Evas *e, - Evas_Object *obj, void *event_info) -{ - struct appdata *ad; - retif(!data, , "data is NULL"); - ad = data; - - _viewer_unfreeze(ad->scroller); -} - -static void _minictrl_add(const char *name, unsigned int width, - unsigned int height, - minicontrol_priority_e priority, - void *data) +static void _minictrl_add(const char *name, unsigned int width, unsigned int height, void *data) { qp_item_data *qid = NULL; struct _viewer_item *vit = NULL; @@ -271,22 +503,27 @@ static void _minictrl_add(const char *name, unsigned int width, struct appdata *ad; Evas_Object *viewer = NULL; - retif(!name, , "name is NULL"); - retif(!data, , "data is NULL"); + if (!name || !data) { + ERR("name: %p, data: %p", name, data); + return; + } ad = data; - retif(!ad->list, , "list is NULL"); + if (!ad->list) { + ERR("List is null"); + return; + } - if (g_prov_table) { - struct _viewer_item *found = NULL; - found = g_hash_table_lookup(g_prov_table, name); + if (s_info.prov_table) { + struct _viewer_item *found; + found = g_hash_table_lookup(s_info.prov_table, name); if (found) { ERR("already have it : %s", name); return; } } else { - ERR("g_prov_table is NULL"); + ERR("s_info.prov_table is NULL"); return; } @@ -299,230 +536,155 @@ static void _minictrl_add(const char *name, unsigned int width, ERR("Failed to create view[%s]", name); return; } + _viewer_set_size(viewer, ad, width, height); quickpanel_uic_initial_resize(viewer, (height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) ? height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); - evas_object_event_callback_add(_get_minictrl_obj(viewer), EVAS_CALLBACK_MOUSE_UP, - _minictrl_release_cb, ad); - - vit = malloc(sizeof(struct _viewer_item)); + vit = malloc(sizeof(*vit)); if (!vit) { ERR("fail to alloc vit"); - if (viewer != NULL) { - evas_object_del(viewer); - viewer = NULL; - } + evas_object_del(viewer); return; } if (_minictrl_is_ongoing(name) == 1) { type = QP_ITEM_TYPE_MINICTRL_ONGOING; } else { - type = _minictrl_priority_to_type(priority); + type = QP_ITEM_TYPE_MINICTRL_MIDDLE; } + qid = quickpanel_list_util_item_new(type, vit); if (!qid) { ERR("fail to alloc vit"); - if (viewer != NULL) { - evas_object_del(viewer); - viewer = NULL; - } + evas_object_del(viewer); free(vit); return; } + vit->name = strdup(name); + if (!vit->name) { + ERR("strdup: %d", errno); + quickpanel_list_util_item_del(qid); + evas_object_del(viewer); + free(vit); + return; + } vit->width = width; vit->height = height; - vit->priority = priority; vit->viewer = viewer; vit->data = data; + vit->deletable = 1; quickpanel_list_util_item_set_tag(vit->viewer, qid); quickpanel_list_util_sort_insert(ad->list, vit->viewer); + evas_object_data_set(_get_minictrl_obj(viewer), MINICONTROL_VIEW_DATA, vit); - g_hash_table_insert(g_prov_table, g_strdup(name), vit); + g_hash_table_insert(s_info.prov_table, g_strdup(name), vit); DBG("success to add minicontrol %s", name); - quickpanel_minictrl_rotation_report(ad->angle); + _minictrl_sendview_rotation_event(vit->name, ad->angle); } -static void _minictrl_remove(const char *name, void *data) +static void _anim_init_resize(void *data) { - if (g_prov_table) { - if (g_hash_table_remove(g_prov_table, name)) { - DBG("success to remove %s", name); + QP_VI *vi; + Evas_Object *item; - retif(data == NULL, , "data is NULL"); - } else { - WARN("unknown provider name : %s", name); - } + vi = data; + if (!vi) { + ERR("Invalid parameter"); + return; } -} -static void _minictrl_update(const char *name, unsigned int width, - unsigned int height, void *data) -{ - int old_h = 0; - struct appdata *ad = data; - struct _viewer_item *found = NULL; - - retif(!g_prov_table, , "data is NULL"); - retif(!ad, , "data is NULL"); - - found = g_hash_table_lookup(g_prov_table, name); - - if (!found) { - WARN("unknown provider name : %s", name); + item = vi->target; + if (!item) { + ERR("Invalid target"); return; } - old_h = found->height; - - if (found->viewer) { - if (old_h != height) { - _minictrl_resize_vi(ad->list, - found, width, height); - } else { - _viewer_set_size(found->viewer, ad, width, height); - quickpanel_uic_initial_resize(found->viewer, - (height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) - ? height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); - } - } + evas_object_color_set(item, 0, 0, 0, 0); } -static void _minictrl_request(const char *name, int action, int value, void *data) +static Eina_Bool _anim_init_cb(void *data) { - struct appdata *ad = data; - retif(!name, , "name is NULL"); - retif(!ad, , "data is NULL"); - - SDBG("%s %d %d", name, action, value); - - if (action == MINICONTROL_REQ_HIDE_VIEWER) { - quickpanel_uic_close_quickpanel(true, 0); - } else if (action == MINICONTROL_REQ_FREEZE_SCROLL_VIEWER) { - if (ad->list != NULL) { - ERR("freezed by %s", name); - _viewer_freeze(ad->scroller); - } - } else if (action == MINICONTROL_REQ_UNFREEZE_SCROLL_VIEWER) { - if (ad->list != NULL) { - ERR("unfreezed by %s", name); - _viewer_unfreeze(ad->scroller); - } - } -#ifdef HAVE_X - else if (action == MINICONTROL_REQ_REPORT_VIEWER_ANGLE) { - if (ad->list != NULL) { - SERR("need to broadcasting angle by %s %d", name, action); - quickpanel_minictrl_rotation_report(ad->angle); - } + QP_VI *vi; + int i; + static qp_vi_op_table anim_init_table[] = { + { + .op_type = VI_OP_RESIZE, + .handler = _anim_init_resize, + }, + { + .op_type = VI_OP_NONE, + .handler = NULL, + }, + }; + + vi = data; + if (!vi) { + ERR("Invalid parameter"); + return EINA_FALSE; } -#endif -} - -static void _mctrl_monitor_cb(minicontrol_action_e action, - const char *name, unsigned int width, - unsigned int height, - minicontrol_priority_e priority, - void *data) -{ - retif(!data, , "data is NULL"); - retif(!name, , "name is NULL"); - if (_viewer_check(name) == 0) { - ERR("%s: ignored", name); - return; - } + for (i = 0; anim_init_table[i].op_type != VI_OP_NONE; i++) { + if (anim_init_table[i].op_type != vi->op_type) { + continue; + } - switch (action) { - case MINICONTROL_ACTION_START: - _minictrl_add(name, width, height, priority, data); - break; - case MINICONTROL_ACTION_RESIZE: - _minictrl_update(name, width, height, data); - break; - case MINICONTROL_ACTION_STOP: - _minictrl_remove(name, data); - break; - case MINICONTROL_ACTION_REQUEST: - _minictrl_request(name, width, height, data); - break; - default: + anim_init_table[i].handler(vi); break; } -} -static void _minictrl_resize_vi(Evas_Object *list, - struct _viewer_item *item, int to_w, int to_h) -{ - QP_VI *vi = NULL; - retif(list == NULL, , "invalid parameter"); - retif(item == NULL, , "invalid parameter"); - - vi = quickpanel_vi_new_with_data( - VI_OP_RESIZE, - QP_ITEM_TYPE_MINICTRL_MIDDLE, - list, - item->viewer, - _anim_init_cb, - _anim_job_cb, - _anim_done_cb, - _anim_done_cb, - vi, - item, - to_w, - to_h); - quickpanel_vi_start(vi); -} - -static void _anim_init_resize(void *data) -{ - QP_VI *vi = data; - retif(vi == NULL, , "invalid parameter"); - retif(vi->target == NULL, , "invalid parameter"); - - Evas_Object *item = vi->target; - evas_object_color_set(item, 0, 0, 0, 0); + return EINA_TRUE; } static void _reorder_transit_del_cb(void *data, Elm_Transit *transit) { - QP_VI *vi = data; - int to_w = 0, to_h = 0; - Evas_Object *item = NULL; - retif(vi == NULL, , "data is NULL"); - retif(vi->target == NULL, , "invalid parameter"); + QP_VI *vi; + Evas_Object *item; + struct appdata *ad; + + vi = data; + if (!vi) { + ERR("vi is null"); + return; + } item = vi->target; - to_w = vi->extra_flag_1; - to_h = vi->extra_flag_2; + if (!item) { + ERR("Target is null"); + return; + } - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); + ad = quickpanel_get_app_data(); + if (!ad) { + ERR("ad is null"); + return; + } - _viewer_set_size(item, ad, to_w, to_h); + _viewer_set_size(item, ad, vi->extra_flag_1, vi->extra_flag_2); quickpanel_uic_initial_resize(item, - (to_h > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) - ? to_h : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); + (vi->extra_flag_2 > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) + ? vi->extra_flag_2 : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); } static void _anim_job_resize(void *data) { - QP_VI *vi = data; - int to_w = 0, to_h = 0; - Elm_Transit *transit_layout_parent = NULL; - Elm_Transit *transit_fadein = NULL; - Evas_Object *item = NULL; - struct _viewer_item *viewer_item = NULL; - - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); - retif(vi == NULL, , "invalid parameter"); - retif(vi->target == NULL, , "invalid parameter"); - retif(vi->extra_data_2 == NULL, , "invalid parameter"); + Elm_Transit *transit_layout_parent; + struct _viewer_item *viewer_item; + Elm_Transit *transit_fadein; + struct appdata *ad; + Evas_Object *item; + int to_w, to_h; + QP_VI *vi; + + vi = data; + ad = quickpanel_get_app_data(); + if (!ad || !vi || !vi->target || !vi->extra_data_2) { + ERR("Invalid parameters: %p %p %p %p", ad, vi, vi ? vi->target : NULL, vi ? vi->extra_data_2 : NULL); + return; + } item = vi->target; to_w = vi->extra_flag_1; @@ -544,8 +706,7 @@ static void _anim_job_resize(void *data) elm_transit_object_add(transit_fadein, item); elm_transit_effect_color_add(transit_fadein, 0, 0, 0, 0, 255, 255, 255, 255); elm_transit_duration_set(transit_fadein, 0.35); - elm_transit_tween_mode_set(transit_fadein, - quickpanel_vim_get_tweenmode(VI_OP_INSERT)); + elm_transit_tween_mode_set(transit_fadein, quickpanel_vim_get_tweenmode(VI_OP_INSERT)); elm_transit_del_cb_set(transit_fadein, quickpanel_vi_done_cb_for_transit, vi); elm_transit_objects_final_state_keep_set(transit_fadein, EINA_TRUE); @@ -561,37 +722,14 @@ static void _anim_job_resize(void *data) } } -static void _anim_done_resize(void *data) -{ - QP_VI *vi = data; - struct _viewer_item *viewer_item = NULL; - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); - retif(vi == NULL, , "invalid parameter"); - retif(vi->target == NULL, , "invalid parameter"); - - Evas_Object *item = vi->target; - viewer_item = vi->extra_data_2; - - viewer_item->width = vi->extra_flag_1; - viewer_item->height = vi->extra_flag_2; - - _viewer_set_size(item, ad, viewer_item->width, viewer_item->height); - quickpanel_uic_initial_resize(item, - (viewer_item->height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) - ? viewer_item->height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); - evas_object_color_set(item, 255, 255, 255, 255); -} - -static Eina_Bool _anim_init_cb(void *data) +static Eina_Bool _anim_job_cb(void *data) { - QP_VI *vi = data; - retif(vi == NULL, EINA_FALSE, "invalid parameter"); - - static qp_vi_op_table anim_init_table[] = { + QP_VI *vi; + int i; + static qp_vi_op_table anim_job_table[] = { { .op_type = VI_OP_RESIZE, - .handler = _anim_init_resize, + .handler = _anim_job_resize, }, { .op_type = VI_OP_NONE, @@ -599,53 +737,69 @@ static Eina_Bool _anim_init_cb(void *data) }, }; - int i = 0; - for (i = 0; anim_init_table[i].op_type != VI_OP_NONE; i++) { - if (anim_init_table[i].op_type != vi->op_type) { + vi = data; + if (!vi) { + ERR("Invalid parameter"); + return EINA_FALSE; + } + + for (i = 0; anim_job_table[i].op_type != VI_OP_NONE; i++) { + if (anim_job_table[i].op_type != vi->op_type) { continue; } - anim_init_table[i].handler(vi); + anim_job_table[i].handler(vi); break; } return EINA_TRUE; } -static Eina_Bool _anim_job_cb(void *data) +static void _anim_done_resize(void *data) { - QP_VI *vi = data; - retif(vi == NULL, EINA_FALSE, "invalid parameter"); + QP_VI *vi; + struct _viewer_item *viewer_item; + struct appdata *ad; + Evas_Object *item; - static qp_vi_op_table anim_job_table[] = { - { - .op_type = VI_OP_RESIZE, - .handler = _anim_job_resize, - }, - { - .op_type = VI_OP_NONE, - .handler = NULL, - }, - }; + vi = data; + if (!vi) { + ERR("Invalid parameter"); + return; + } - int i = 0; - for (i = 0; anim_job_table[i].op_type != VI_OP_NONE; i++) { - if (anim_job_table[i].op_type != vi->op_type) { - continue; - } + ad = quickpanel_get_app_data(); + if (!ad) { + ERR("Invalid ad"); + return; + } - anim_job_table[i].handler(vi); - break; + item = vi->target; + if (!item) { + ERR("Invalid target"); + return; } - return EINA_TRUE; + viewer_item = vi->extra_data_2; + if (!viewer_item) { + ERR("viewer_item is null"); + return; + } + + viewer_item->width = vi->extra_flag_1; + viewer_item->height = vi->extra_flag_2; + + _viewer_set_size(item, ad, viewer_item->width, viewer_item->height); + quickpanel_uic_initial_resize(item, + (viewer_item->height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) + ? viewer_item->height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); + evas_object_color_set(item, 255, 255, 255, 255); } static Eina_Bool _anim_done_cb(void *data) { - QP_VI *vi = data; - retif(vi == NULL, EINA_FALSE, "invalid parameter"); - + QP_VI *vi; + int i; static qp_vi_op_table anim_done_table[] = { { .op_type = VI_OP_RESIZE, @@ -657,7 +811,12 @@ static Eina_Bool _anim_done_cb(void *data) }, }; - int i = 0; + vi = data; + if (!vi) { + ERR("Invalid parameter"); + return EINA_FALSE; + } + for (i = 0; anim_done_table[i].op_type != VI_OP_NONE; i++) { if (anim_done_table[i].op_type != vi->op_type) { continue; @@ -670,19 +829,199 @@ static Eina_Bool _anim_done_cb(void *data) return EINA_TRUE; } +static void _minictrl_resize_vi(Evas_Object *list, struct _viewer_item *item, int to_w, int to_h) +{ + QP_VI *vi; + + if (!list || !item) { + ERR("Invalid parameter: list: %p, item: %p", list, item); + return; + } + + vi = quickpanel_vi_new_with_data( + VI_OP_RESIZE, + QP_ITEM_TYPE_MINICTRL_MIDDLE, + list, + item->viewer, + _anim_init_cb, + _anim_job_cb, + _anim_done_cb, + _anim_done_cb, + NULL, /* vi == NULL */ + item, + to_w, + to_h); + + if (vi) { + quickpanel_vi_start(vi); + } else { + ERR("Unable to create 'vi'"); + } +} + +static void _minictrl_update(const char *name, unsigned int width, unsigned int height, void *data) +{ + struct appdata *ad = data; + struct _viewer_item *found = NULL; + + if (!s_info.prov_table || !ad) { + ERR("name: %s, table: %p, ad: %p", name, s_info.prov_table, ad); + return; + } + + found = g_hash_table_lookup(s_info.prov_table, name); + if (!found) { + WARN("unknown provider name : %s", name); + return; + } + + if (found->viewer) { + if (found->height != height || found->width != width) { + _minictrl_resize_vi(ad->list, found, width, height); + } else { + _viewer_set_size(found->viewer, ad, width, height); + quickpanel_uic_initial_resize(found->viewer, + (height > QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT) + ? height : QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); + } + } +} + +#if defined(WINSYS_X11) +static void _minictrl_lock(const char *name) +{ + struct _viewer_item *found; + + if (!s_info.prov_table) { + ERR("table is empty: %s", name); + return; + } + + DBG("minictrl_lock %s", name); + found = g_hash_table_lookup(s_info.prov_table, name); + if (!found) { + WARN("unknown provider name : %s", name); + return; + } + + if (found->viewer) { + struct _viewer_item *vit; + + vit = evas_object_data_del(_get_minictrl_obj(found->viewer), MINICONTROL_VIEW_DATA); + if (vit) { + vit->deletable = 0; + evas_object_data_set(_get_minictrl_obj(found->viewer), MINICONTROL_VIEW_DATA, vit); + } else { + WARN("vit is NULL"); + } + } +} +#endif + +static void _mctrl_viewer_event_cb(minicontrol_event_e event, const char *name, bundle *event_arg, void *data) +{ + struct appdata *ad; + int ret; + int *width; + int *height; + int _width; + int _height; + size_t bundle_size; + + if (!data || !name) { + ERR("Invalid parameter"); + return; + } + + ad = data; + + if (_viewer_check(name) == 0) { + ERR("%s: ignored", name); + return; + } + +#if defined(WINSYS_X11) + + if ((int)event == MINICONTROL_EVENT_REQUEST_LOCK) { + /** + * This event type is extra one. not in the enumeration list. + */ + _minictrl_lock(name); + } else { +#endif + switch (event) { + case MINICONTROL_EVENT_START: + ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_WIDTH, (void **)&width, &bundle_size); + if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) { + ERR("Failed to get bundle value(width) %d : %d", ret, bundle_size); + _width = 0; + width = &_width; + } + + ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_HEIGHT, (void **)&height, &bundle_size); + if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) { + ERR("Failed to get bundle value(height) : %d", ret); + _height = 0; + height = &_height; + } + + DBG("Name: %s, Size: %dx%d", name, *width, *height); + _minictrl_add(name, *width, *height, data); + break; + case MINICONTROL_EVENT_RESIZE: + ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_WIDTH, (void **)&width, &bundle_size); + if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) { + ERR("Failed to get bundle value(width) %d : %d", ret, bundle_size); + _width = 0; + width = &_width; + } + + ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_HEIGHT, (void **)&height, &bundle_size); + if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) { + ERR("Failed to get bundle value(height) : %d", ret); + _height = 0; + height = &_height; + } + + DBG("Name: %s, Size: %dx%d", name, *width, *height); + _minictrl_update(name, *width, *height, data); + break; + case MINICONTROL_EVENT_STOP: + _minictrl_remove(name, data); + break; + case MINICONTROL_EVENT_REQUEST_HIDE: + quickpanel_uic_close_quickpanel(true, 0); + break; + case MINICONTROL_EVENT_REQUEST_ANGLE: + if (ad->list != NULL) { + SERR("need to broadcasting angle by %s ", name, event); + _minictrl_sendview_rotation_event(name, ad->angle); + } + break; + default: + break; + } +#if defined(WINSYS_X11) + } +#endif +} + static int _init(void *data) { minicontrol_error_e ret; - retif(!data, QP_FAIL, "Invalid parameter!"); + if (!data) { + ERR("Invalid parameter"); + return QP_FAIL; + } - g_prov_table = g_hash_table_new_full(g_str_hash, g_str_equal, - (GDestroyNotify)g_free, - (GDestroyNotify)_viewer_item_free); + s_info.prov_table = g_hash_table_new_full(g_str_hash, g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)_viewer_item_free); - ret = minicontrol_monitor_start(_mctrl_monitor_cb, data); + ret = minicontrol_viewer_set_event_cb(_mctrl_viewer_event_cb, data); if (ret != MINICONTROL_ERROR_NONE) { - ERR("fail to minicontrol_monitor_start()- %d", ret); + ERR("fail to minicontrol_viewer_set_event_cb()- %d", ret); return QP_FAIL; } @@ -692,14 +1031,16 @@ static int _init(void *data) static int _fini(void *data) { minicontrol_error_e ret; - ret = minicontrol_monitor_stop(); + + ret = minicontrol_viewer_unset_event_cb(); + if (ret != MINICONTROL_ERROR_NONE) { - ERR("fail to minicontrol_monitor_stop()- %d", ret); + ERR("fail to minicontrol_viewer_unset_event_cb()- %d", ret); } - if (g_prov_table) { - g_hash_table_remove_all(g_prov_table); - g_prov_table = NULL; + if (s_info.prov_table) { + g_hash_table_destroy(s_info.prov_table); + s_info.prov_table = NULL; } return QP_OK; @@ -707,8 +1048,13 @@ static int _fini(void *data) static int _suspend(void *data) { - struct appdata *ad = data; - retif(ad == NULL, QP_FAIL, "Invalid parameter!"); + struct appdata *ad; + + ad = data; + if (!ad) { + ERR("Invalid parameter"); + return QP_FAIL; + } if (ad->list != NULL) { _viewer_unfreeze(ad->scroller); @@ -719,8 +1065,13 @@ static int _suspend(void *data) static int _resume(void *data) { - struct appdata *ad = data; - retif(ad == NULL, QP_FAIL, "Invalid parameter!"); + struct appdata *ad; + + ad = data; + if (!ad) { + ERR("Invalid parameter"); + return QP_FAIL; + } if (ad->list != NULL) { _viewer_unfreeze(ad->scroller); @@ -731,13 +1082,113 @@ static int _resume(void *data) HAPI void quickpanel_minictrl_rotation_report(int angle) { - if (g_prov_table != NULL) { - if (g_hash_table_size(g_prov_table) > 0) { - SINFO("minicontrol rotation:%d", angle); -#ifdef HAVE_X - minicontrol_viewer_request(QP_PKG_QUICKPANEL, - MINICONTROL_REQ_ROTATE_PROVIDER, angle); -#endif + bundle *event_arg_bundle; + + if (s_info.prov_table == NULL) { + return; + } + + if (g_hash_table_size(s_info.prov_table) <= 0) { + return; + } + + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, s_info.prov_table); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + SINFO("minicontrol name:%s rotation:%d", key, angle); + event_arg_bundle = bundle_create(); + if (event_arg_bundle) { + char bundle_value_buffer[BUNDLE_BUFFER_LENGTH] = { 0, }; + snprintf(bundle_value_buffer, sizeof(bundle_value_buffer) - 1, "%d", angle); + bundle_add_str(event_arg_bundle, "angle", bundle_value_buffer); + minicontrol_viewer_send_event(key, MINICONTROL_EVENT_REPORT_ANGLE, event_arg_bundle); + bundle_free(event_arg_bundle); } } } + +void _minictrl_sendview_rotation_event(const char* name, int angle) +{ + bundle *event_arg_bundle; + + if (!name) { + ERR("Invalid parameter"); + return; + } + + if (s_info.prov_table == NULL) { + return; + } + + if (g_hash_table_size(s_info.prov_table) <= 0) { + return; + } + + SINFO("minicontrol name:%s rotation:%d", name, angle); + event_arg_bundle = bundle_create(); + if (event_arg_bundle) { + char bundle_value_buffer[BUNDLE_BUFFER_LENGTH] = { 0, }; + + snprintf(bundle_value_buffer, sizeof(bundle_value_buffer) - 1, "%d", angle); + bundle_add_str(event_arg_bundle, "angle", bundle_value_buffer); + minicontrol_viewer_send_event(name, MINICONTROL_EVENT_REPORT_ANGLE, event_arg_bundle); + bundle_free(event_arg_bundle); + } +} + +#if defined(WINSYS_X11) +static void _minictrl_send_view_event_cb(gpointer key, gpointer value, gpointer user_data) +{ + if (!key) { + ERR("Key is null"); + return; + } + + bundle *event_arg_bundle; + + event_arg_bundle = bundle_create(); + if (event_arg_bundle) { + minicontrol_viewer_event_e event; + + event = (minicontrol_viewer_event_e)user_data; + minicontrol_viewer_send_event(key, event, event_arg_bundle); + bundle_free(event_arg_bundle); + } +} +#endif + +static void _minictrl_opened(void *data) +{ + DBG(""); +#if defined(WINSYS_X11) + g_hash_table_foreach(s_info.prov_table, _minictrl_send_view_event_cb, (gpointer)MINICONTROL_VIEWER_EVENT_SHOW); +#endif +} + +static void _minictrl_closed(void *data) +{ + DBG(""); +#if defined(WINSYS_X11) + g_hash_table_foreach(s_info.prov_table, _minictrl_send_view_event_cb, (gpointer)MINICONTROL_VIEWER_EVENT_HIDE); +#endif +} + +QP_Module minictrl = { + .name = "minictrl", + .init = _init, + .fini = _fini, + .suspend = _suspend, + .resume = _resume, + .hib_enter = NULL, + .hib_leave = NULL, + .lang_changed = NULL, + .refresh = NULL, + .get_height = NULL, + .qp_opened = _minictrl_opened, + .qp_closed = _minictrl_closed, +}; + +/* End of a file */ diff --git a/daemon/minictrl/minictrl.h b/daemon/minictrl/minictrl.h index 6387f2c..a95fa6a 100644..100755 --- a/daemon/minictrl/minictrl.h +++ b/daemon/minictrl/minictrl.h @@ -19,6 +19,6 @@ #ifndef _QP_MINICONTROL_DEF_ #define _QP_MINICONTROL_DEF_ -void quickpanel_minictrl_rotation_report(int angle); +extern void quickpanel_minictrl_rotation_report(int angle); #endif diff --git a/daemon/modules.c b/daemon/modules.c index efeefe0..0b43a61 100755 --- a/daemon/modules.c +++ b/daemon/modules.c @@ -15,15 +15,21 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" +#include "quickpanel-ui.h" #include "modules.h" /******************************************************************* - * - * MODULES - * - *****************************************************************/ + * + * MODULES + * + *****************************************************************/ #ifdef QP_SETTING_ENABLE /* setting */ @@ -54,6 +60,11 @@ extern QP_Module activenoti; extern QP_Module qp_datetime_controller; extern QP_Module qp_datetime_view; +/* voice control */ +#ifdef QP_VOICE_CONTROL_ENABLE +extern QP_Module voice_control; +#endif + /* do not change the order of modules, result may be changed up to order */ static QP_Module *modules[] = { &vi_manager, @@ -76,6 +87,9 @@ static QP_Module *modules[] = { #ifdef QP_ANIMATED_IMAGE_ENABLE &animated_image, #endif +#ifdef QP_VOICE_CONTROL_ENABLE + &voice_control, +#endif }; HAPI int quickpanel_modules_init(void *data) @@ -173,10 +187,10 @@ HAPI int quickpanel_modules_hib_leave(void *data) } /****************************************************************** - * - * LANGUAGE - * - ****************************************************************/ + * + * LANGUAGE + * + ****************************************************************/ HAPI void quickpanel_modules_lang_change(void *data) { @@ -203,10 +217,10 @@ HAPI void quickpanel_modules_refresh(void *data) } /****************************************************************** - * - * Quickpanel open/close Events - * - ****************************************************************/ + * + * Quickpanel open/close Events + * + ****************************************************************/ HAPI int quickpanel_modules_opened(void *data) { int i; diff --git a/daemon/modules.h b/daemon/modules.h index 4480fe5..1ce0180 100755 --- a/daemon/modules.h +++ b/daemon/modules.h @@ -19,9 +19,6 @@ #ifndef __QP_MODULES_H__ #define __QP_MODULES_H__ -#include <stdlib.h> -#include "quickpanel-ui.h" - extern int quickpanel_modules_init(void *data); extern int quickpanel_modules_fini(void *data); extern int quickpanel_modules_suspend(void *data); diff --git a/daemon/notifications/activenoti.c b/daemon/notifications/activenoti.c index dc9ff3d..64ef6df 100644..100755 --- a/daemon/notifications/activenoti.c +++ b/daemon/notifications/activenoti.c @@ -17,24 +17,35 @@ #include <Elementary.h> +#include <glib.h> + #include <appcore-common.h> #include <vconf.h> #include <app_control.h> #include <notification.h> #include <feedback.h> #include <system_settings.h> -#ifdef HAVE_X -#include <utilX.h> -#endif +#include <notification_internal.h> +#include <notification_setting_internal.h> +#include <notification_text_domain.h> +#include <player.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" +#include "media.h" +#include "noti_node.h" #include "noti.h" #include "noti_win.h" #include "noti_util.h" +#include "animated_icon.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "animated_icon.h" #define QP_ACTIVENOTI_DURATION 3 #define QP_ACTIVENOTI_DETAIL_DURATION 6 @@ -42,13 +53,12 @@ #define ACTIVENOTI_MSG_LEN 100 #define DEFAULT_ICON RESDIR"/quickpanel_icon_default.png" -#define E_DATA_ICON "E_DATA_ICON" -#define E_DATA_BADGE "E_DATA_BADGE" -#define E_DATA_NOTI "E_DATA_NOTI" -#define E_DATA_BTN_IMAGE "E_DATA_BTN_IMAGE" -#define E_DATA_BG_IMAGE "E_DATA_BG_IMAGE" -#define DELAY_TIMER_VALUE 0.480 +#define DELAY_TIMER_VALUE 0.480 #define DEL_TIMER_VALUE 8.0 +#define SHOW_MIN_TIMER_VALUE 1.0 +#define RELEASE_TIME 8.0 + +#define NOTI_START_Y ELM_SCALE_SIZE(36) static struct info { Evas_Object *activenoti; @@ -57,6 +67,12 @@ static struct info { Evas_Object *gesture; Ecore_Timer *delay_timer; Ecore_Timer *close_timer; + Ecore_Timer *show_min_timer; + + Eina_List *auto_remove_list; + Eina_List *non_auto_remove_list; + notification_h current_noti; + } s_info = { .activenoti = NULL, .layout = NULL, @@ -64,19 +80,37 @@ static struct info { .gesture = NULL, .delay_timer = NULL, .close_timer = NULL, + .show_min_timer = NULL, + .auto_remove_list = NULL, + .non_auto_remove_list = NULL, + .current_noti = NULL, }; +struct noti_info { + notification_h noti; + Ecore_Timer *timer; +}; + +static inline char *_get_text(notification_h noti, notification_text_type_e text_type); static int _activenoti_init(void *data); static int _activenoti_fini(void *data); static int _activenoti_enter_hib(void *data); static int _activenoti_leave_hib(void *data); static void _activenoti_reflesh(void *data); -static void _activenoti_create_activenoti(void *data); +static void _activenoti_qp_opened(void *data); + +static void _activenoti_update_activenoti(); +static void _activenoti_create_activenoti(); static void _activenoti_win_rotated(void *data, int need_hide); -static void _activenoti_hide(void *data, int delay); -static void _activenoti_destroy_activenoti(); +static void _activenoti_destroy_activenoti(); +static void _media_feedback_sound(notification_h noti); +static notification_h _activenoti_get_in_list(); +static bool _activenoti_remove_in_list(notification_h noti); +static void _activenoti_delete_current_noti(void); +static bool _activenoti_has_pending_noti(void); +static void _activenoti_hide(void *data, int delay); QP_Module activenoti = { .name = "activenoti", @@ -85,9 +119,19 @@ QP_Module activenoti = { .hib_enter = _activenoti_enter_hib, .hib_leave = _activenoti_leave_hib, .lang_changed = NULL, + .qp_opened = _activenoti_qp_opened, + .qp_closed = NULL, .refresh = _activenoti_reflesh }; +static void _app_control_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + if (data) { + DBG("_app_control_del_cb %p", data); + app_control_destroy(data); + } +} + static inline int _is_text_exist(const char *text) { if (text != NULL) { @@ -95,18 +139,19 @@ static inline int _is_text_exist(const char *text) return 1; } } - return 0; } -static int _is_sound_playable(void) { +static int _is_sound_playable(void) +{ int status = 0, ret = 0; ret = vconf_get_int(VCONFKEY_CAMERA_STATE, &status); - if (ret == 0 && status == VCONFKEY_CAMERA_STATE_RECORDING) { + if (ret == VCONF_OK && status == VCONFKEY_CAMERA_STATE_RECORDING) { ERR("camcorder is working, don't play notification sound %d %d", ret, status); return 0; } + return 1; } @@ -114,7 +159,6 @@ static int _is_security_lockscreen_launched(void) { int ret = 0; int is_idle_lock = 0; - int lock_type = 0; ret = vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &is_idle_lock); retif(ret != 0, 0,"failed to get VCONFKEY_IDLE_LOCK_STATE %d %d", ret, is_idle_lock); @@ -122,43 +166,84 @@ static int _is_security_lockscreen_launched(void) if (is_idle_lock == VCONFKEY_IDLE_LOCK ) { DBG("Lock screen is launched"); return 1; //don't show on lock screen - /* - ret = vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type); - retif(ret != 0, 0,"failed to get VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT %d %d", ret, lock_type); - if (lock_type != SETTING_SCREEN_LOCK_TYPE_NONE && lock_type != SETTING_SCREEN_LOCK_TYPE_SWIPE) { - return 1; - } - */ } return 0; } -static Evas_Event_Flags __flick_end_cb(void *data, void *event_info) +static Eina_Bool _activenoti_hide_timer_cb(void *data) { DBG(""); - Elm_Gesture_Line_Info *line_info = (Elm_Gesture_Line_Info *) event_info; + + s_info.delay_timer = NULL; + + _activenoti_hide(data, 0); + return ECORE_CALLBACK_CANCEL; +} + +static void _activenoti_hide(void *data, int delay) +{ + DBG("delay : %d", delay); + if (delay == 1) { + if (s_info.delay_timer == NULL) { + s_info.delay_timer = ecore_timer_add(DELAY_TIMER_VALUE, _activenoti_hide_timer_cb, NULL); + if (!s_info.delay_timer) { + ERR("Failed to create a new timer for hide activenoti"); + } + } + } else { + _activenoti_delete_current_noti(); + + if (s_info.delay_timer != NULL) { + ecore_timer_del(s_info.delay_timer); + s_info.delay_timer = NULL; + } + + if (s_info.close_timer != NULL) { + ecore_timer_del(s_info.close_timer); + s_info.close_timer = NULL; + } + + if (s_info.activenoti) { + if (_activenoti_has_pending_noti()) { + _activenoti_update_activenoti(); + } else { + DBG("pending noti is null. called evas_object_hide"); + evas_object_hide(s_info.activenoti); + } + } + } + DBG(""); +} + +static Evas_Event_Flags __flick_end_cb(void *data, void *event_info) +{ + Elm_Gesture_Line_Info *line_info = (Elm_Gesture_Line_Info *)event_info; DBG("line_info->momentum.my : %d", line_info->momentum.my); /* Flick Up */ - if (line_info->momentum.my < 0) - { - _activenoti_hide(NULL,0); + if (line_info->momentum.my < 0) { + DBG("HIDE ACTIVE NOTI"); + if (_activenoti_has_pending_noti() == false) { + _activenoti_hide(NULL, 0); + } else { + _activenoti_delete_current_noti(); + _activenoti_update_activenoti(); + } + } else { + DBG("HOLD ACTIVE NOTI"); } - return EVAS_EVENT_FLAG_ON_HOLD; } - static Evas_Object *_gesture_create(Evas_Object *layout) { Evas_Object *gesture_layer = NULL; - INFO("gesture create"); - gesture_layer = elm_gesture_layer_add(layout); retif(!gesture_layer, NULL,); + elm_gesture_layer_attach(gesture_layer, layout); evas_object_show(gesture_layer); @@ -169,17 +254,69 @@ static Evas_Object *_gesture_create(Evas_Object *layout) static int _check_sound_off(notification_h noti) { + notification_system_setting_h system_setting = NULL; + notification_setting_h setting = NULL; char *pkgname = NULL; + bool do_not_disturb = false; + bool do_not_disturb_except = false; + int err = NOTIFICATION_ERROR_NONE; + int ret = 0; - notification_get_pkgname(noti, &pkgname); + retif(noti == NULL, 0, "Invalid parameter!"); - //to do + err = notification_system_setting_load_system_setting(&system_setting); + if (err != NOTIFICATION_ERROR_NONE || system_setting == NULL) { + DBG("notification_system_setting_load_system_setting failed [%d]\n", err); + goto out; + } - return 0; -} + err = notification_system_setting_get_do_not_disturb(system_setting, &do_not_disturb); + if (err != NOTIFICATION_ERROR_NONE) { + DBG("notification_system_setting_get_do_not_disturb failed [%d]", err); + goto out; + } + + DBG("do_not_disturb [%d]\n", do_not_disturb); + + if (do_not_disturb) { + err = notification_get_pkgname(noti, &pkgname); + if (err != NOTIFICATION_ERROR_NONE || pkgname == NULL) { + DBG("notification_get_pkgname failed [%d]", err); + goto out; + } + + err = notification_setting_get_setting_by_package_name(pkgname, &setting); + if (err != NOTIFICATION_ERROR_NONE || setting == NULL) { + DBG("notification_setting_get_setting_by_package_name failed [%d]", err); + goto out; + } + + notification_setting_get_do_not_disturb_except(setting, &do_not_disturb_except); + if (err != NOTIFICATION_ERROR_NONE) { + DBG("notification_setting_get_do_not_disturb_except failed [%d]", err); + goto out; + } + + if (do_not_disturb_except) { + ret = 0; + } else { + ret = 1; + } + } + +out: + if (system_setting) { + notification_system_setting_free_system_setting(system_setting); + } + + if (setting) { + notification_setting_free_notification(setting); + } + return ret; +} -static void _gesture_destroy() +static void _gesture_destroy(void) { if (s_info.gesture) { evas_object_del(s_info.gesture); @@ -191,207 +328,430 @@ static void _gesture_destroy() static inline void _activenoti_only_noti_del(notification_h noti) { + retif(noti == NULL, ,"Invalid parameter!"); int applist = NOTIFICATION_DISPLAY_APP_ALL; - retif(noti == NULL, ,"noti is null"); - notification_get_display_applist(noti, &applist); -#ifdef HAVE_X - if (applist & NOTIFICATION_DISPLAY_APP_HEADS_UP) -#endif - { + if (applist & NOTIFICATION_DISPLAY_APP_ACTIVE) { if (!(applist & NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY)) { char *pkgname = NULL; int priv_id = 0; notification_get_pkgname(noti, &pkgname); notification_get_id(noti, NULL, &priv_id); - notification_delete_by_priv_id(pkgname, - NOTIFICATION_TYPE_NONE, - priv_id); + notification_delete_by_priv_id(pkgname, NOTIFICATION_TYPE_NONE, priv_id); } } } - -static Eina_Bool _activenoti_hide_timer_cb(void *data) +static Eina_Bool _activenoti_close_timer_cb(void *data) { - _activenoti_hide(NULL,0); + DBG("%d", _activenoti_has_pending_noti()); + s_info.close_timer = NULL; - if (s_info.delay_timer != NULL) { - ecore_timer_del(s_info.delay_timer); - s_info.delay_timer = NULL; - } + _activenoti_hide(data, 0); return ECORE_CALLBACK_CANCEL; } +static void _activenoti_delete_current_noti(void) +{ + if (!s_info.current_noti) { + DBG("There is no displaying notification"); + return; + } + DBG(""); + notification_free(s_info.current_noti); + s_info.current_noti = NULL; +} -static void _activenoti_hide(void *data, int delay) +static Evas_Object *_activenoti_create_badge(Evas_Object *parent, notification_h noti) { - if (delay == 1) { - if (s_info.delay_timer == NULL) { - s_info.delay_timer = ecore_timer_add(DELAY_TIMER_VALUE, _activenoti_hide_timer_cb, NULL); - } - } else { - if (s_info.delay_timer != NULL) { - ecore_timer_del(s_info.delay_timer); - s_info.delay_timer = NULL; - } + DBG(""); + retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); - if (s_info.close_timer != NULL) { - ecore_timer_del(s_info.close_timer); - s_info.close_timer = NULL; - } + char *icon_path = NULL; + Evas_Object *icon = NULL; + int ret = NOTIFICATION_ERROR_NONE; - if (s_info.activenoti) { - evas_object_hide(s_info.activenoti); - } + ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB, &icon_path); + if (ret != NOTIFICATION_ERROR_NONE || icon_path == NULL) { + DBG("notification_get_image failed [%d]", ret);; + return NULL; + } + + DBG("NOTIFICATION_IMAGE_TYPE_ICON_SUB : %s", icon_path); + + icon = elm_image_add(parent); + if (icon == NULL) { + // free(icon_path); + DBG("icon error"); + return NULL; + } + + elm_image_resizable_set(icon, EINA_FALSE, EINA_TRUE); + + ret = elm_image_file_set(icon, icon_path, NULL); + //free(icon_path); + + if (ret == EINA_FALSE) { + evas_object_del(icon); + return NULL; } + + return icon; } +static void _image_press_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + DBG(""); + app_control_h app_control = data; + + if (app_control) { + int ret = APP_CONTROL_ERROR_NONE; + ret = app_control_send_launch_request(app_control, NULL, NULL); + DBG("app_control_send_launch_request return [%d]", ret); + } + _activenoti_hide(NULL, 1); +} -static void _activenoti_detail_show_cb(void *data, Evas *e, - Evas_Object *obj, - void *event_info) +static Eina_Bool _delete_timer_cb(void *data) { DBG(""); + struct noti_info *noti = data; + + s_info.auto_remove_list = eina_list_remove(s_info.auto_remove_list, noti); + notification_free(noti->noti); + free(noti); + + return ECORE_CALLBACK_CANCEL; } -static Evas_Object *_activenoti_create_badge(Evas_Object *parent, - notification_h noti) +static int _compare_noti_time(notification_h noti1, notification_h noti2) { - char *pkgname = NULL; - char *icon_path = NULL; - char *icon_default = NULL; - Evas_Object *icon = NULL; - int ret = NOTIFICATION_ERROR_NONE; + time_t noti_time1 = 0; + time_t noti_time2 = 0; + int ret; - retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); + ret = notification_get_time(noti1, ¬i_time1); + if (ret != NOTIFICATION_ERROR_NONE || noti_time1 == 0) { + notification_get_insert_time(noti1, ¬i_time1); + } - ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB, &icon_path); + ret = notification_get_time(noti2, ¬i_time2); + if (ret != NOTIFICATION_ERROR_NONE || noti_time2 == 0) { + notification_get_insert_time(noti2, ¬i_time2); + } - if (ret == NOTIFICATION_ERROR_NONE && icon_path != NULL) { - DBG("icon_path : %s", icon_path); - icon = elm_image_add(parent); - elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE); - if ( elm_image_file_set(icon, icon_path, NULL) == EINA_FALSE) { - ERR("fail to set file[%s]", icon_path); - evas_object_del(icon); - icon = NULL; - free(icon_path); - return NULL; - } - } else { - /* - notification_get_pkgname(noti, &pkgname); - if (pkgname != NULL) { - INFO("pkgname : %s", pkgname); - icon_default = quickpanel_common_ui_get_pkginfo_icon(pkgname); - if (icon_default != NULL) { - elm_image_file_set(icon, icon_default, NULL); - free(icon_default); - } else { - return NULL; + DBG("not_time1 : %d noti_time2 : %d", noti_time1, noti_time2); + + return (int)(noti_time1 - noti_time2); +} + +static int _compare_time_cb(const void *data1, const void *data2) +{ + struct noti_info *info1 = (struct noti_info *)data1; + struct noti_info *info2 = (struct noti_info *)data2; + + return _compare_noti_time(info1->noti, info2->noti); +} + +static void _activenoti_remove_list(void) +{ + struct noti_info *info; + char *tmp; + + EINA_LIST_FREE(s_info.auto_remove_list, info) { + /** + * For debugging + */ + tmp = _get_text(info->noti, NOTIFICATION_TEXT_TYPE_TITLE); + DBG("auto remove %s", tmp); + free(tmp); + + free(info->noti); + free(info->timer); + } + + EINA_LIST_FREE(s_info.non_auto_remove_list, info) { + /** + * For debugging + */ + tmp = _get_text(info->noti, NOTIFICATION_TEXT_TYPE_TITLE); + DBG("nont auto remove %s", tmp); + free(tmp); + + free(info->noti); + } +} + +static bool _activenoti_add_in_list(notification_h noti) +{ + DBG(""); + bool auto_remove; + struct noti_info *info; + int ret; + time_t noti_time = 0; + + ret = notification_get_auto_remove( noti, &auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%d]", ret); + return false; + } + + info = malloc(sizeof(*info)); + if (!info) { + DBG("malloc error, can't make noti_info"); + return false; + } + + ret = notification_clone(noti, &info->noti); + if (ret != NOTIFICATION_ERROR_NONE || !info->noti) { + free(info); + ERR("failed to create a cloned notification"); + return false; + } + + if (auto_remove == true) { + ret = notification_get_time(info->noti, ¬i_time); + if (ret!=NOTIFICATION_ERROR_NONE || noti_time == 0) { + ret = notification_get_insert_time(info->noti, ¬i_time); + if (ret != NOTIFICATION_ERROR_NONE || noti_time == 0) { + DBG("notification_get_insert_time failed. time is 0 ret %d", ret); } + } + + noti_time -= time(NULL); + + if (noti_time > 8.0f) { + DBG("remove noti"); + info->timer = NULL; + _delete_timer_cb(info); } else { - return NULL; + info->timer = ecore_timer_add(8.0f - noti_time, _delete_timer_cb, info); + DBG("timer add"); + if(!info->timer) { + DBG("ecore_timer_add failed"); + } + /** + * @todo + * Revise this. + * Do we need to replace this with eina_list_prepend? + */ + s_info.auto_remove_list = eina_list_sorted_insert(s_info.auto_remove_list, _compare_time_cb, info); } - */ - return NULL; + } else { + info->timer = NULL; + s_info.non_auto_remove_list = eina_list_sorted_insert(s_info.non_auto_remove_list, _compare_time_cb, info); } - free(icon_path); - return icon; + return 1; } -static void _image_press_cb(void *data, Evas_Object *obj, - const char *emission, const char *source) +static bool _activenoti_has_pending_noti(void) +{ + + return s_info.non_auto_remove_list || s_info.auto_remove_list; +} + +static bool _activenoti_remove_in_list(notification_h noti) { DBG(""); - app_control_h app_control = data; - int ret = APP_CONTROL_ERROR_NONE; + bool auto_remove; + int ret; + Eina_List *l; + Eina_List *n; + struct noti_info *info; + + ret = notification_get_auto_remove(noti, &auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%d]", ret); + return false; + } + + if (auto_remove) { + DBG("remove in auto remove list"); + EINA_LIST_FOREACH_SAFE(s_info.auto_remove_list, l, n, info) { + if (info->noti != noti) { + int priv_id_from_list; + int priv_id_from_arg; + + notification_get_id(info->noti, NULL, &priv_id_from_list); + notification_get_id(noti, NULL, &priv_id_from_arg); + if (priv_id_from_list != priv_id_from_arg) { + continue; + } + } + s_info.auto_remove_list = eina_list_remove(s_info.auto_remove_list, info); + ecore_timer_del(info->timer); + notification_free(info->noti); + free(info); + break; + } + } else { + DBG("remove in non auto remove list"); + EINA_LIST_FOREACH_SAFE(s_info.non_auto_remove_list, l, n, info) { + if (info->noti != noti) { + int priv_id_from_list; + int priv_id_from_arg; + + notification_get_id(info->noti, NULL, &priv_id_from_list); + notification_get_id(noti, NULL, &priv_id_from_arg); + + if (priv_id_from_list != priv_id_from_arg) { + continue; + } + } + s_info.non_auto_remove_list = eina_list_remove(s_info.non_auto_remove_list, info); + notification_free(info->noti); + free(info); + break; + } + } + return 1; +} + +static notification_h _activenoti_get_in_list(notification_h cur_noti) +{ DBG(""); - if (app_control) { - char *app_id = NULL; - ret = app_control_get_app_id(app_control, &app_id); - - DBG("app_id : %s",app_id); - if (ret == APP_CONTROL_ERROR_NONE && app_id != NULL) { - ret = app_control_send_launch_request(app_control, NULL, NULL); - DBG("ret [%s]", ret); - free(app_id); + notification_h noti = NULL; + struct noti_info *info; + bool auto_remove = true; + int ret; + + if (cur_noti != NULL) { + ret = notification_get_auto_remove(cur_noti, &auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%d]", ret); + return NULL; } + } - } else { - ERR("app_control is NULL"); + info = eina_list_nth(s_info.non_auto_remove_list, 0); + if (info) { + if (!auto_remove) { + ret = _compare_noti_time(cur_noti, info->noti); + + if (ret > 0) { + return NULL; + } + } + s_info.non_auto_remove_list = eina_list_remove(s_info.non_auto_remove_list, info); + // ..... + noti = info->noti; + free(info); + return noti; } - _activenoti_hide(NULL, 1); -} + if (auto_remove == false) { + return noti; + } + + info = eina_list_nth(s_info.auto_remove_list, 0); + if (info) { + s_info.auto_remove_list = eina_list_remove(s_info.auto_remove_list, info); + // ..... + noti = info->noti; + ecore_timer_del(info->timer); + free(info); + return noti; + } + return noti; +} static Evas_Object *_activenoti_create_icon(Evas_Object *parent, notification_h noti) { - char *pkgname = NULL; - char *icon_path = NULL; - char *thumb_path = NULL; - char *icon_default = NULL; - Evas_Object *icon = NULL; - retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); + DBG(""); + retif(noti == NULL || parent == NULL , NULL, "Invalid parameter!"); - notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path); - notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, &thumb_path); + char *icon_path; + char *tmp; + Evas_Object *icon; + int ret; + app_control_h app_control; - icon = elm_image_add(parent); - elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE); + retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); + + tmp = NULL; + ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &tmp); + if (ret == NOTIFICATION_ERROR_NONE && tmp != NULL) { + icon_path = strdup(tmp); + if (!icon_path) { + ERR("strdup: %s", tmp); + } - if (icon_path == NULL - || (icon_path != NULL && elm_image_file_set(icon, icon_path, NULL) == EINA_FALSE)) { - DBG("icon_path : %s", icon_path); + app_control = NULL; + ret = notification_get_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_ICON, &app_control); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to get handler"); + } - if (thumb_path == NULL - || (thumb_path != NULL && elm_image_file_set(icon, thumb_path, NULL) == EINA_FALSE)) { - DBG("thumb_path : %s", thumb_path); + DBG("icon_path : %s app_control = %p", icon_path, app_control); + } else { + tmp = NULL; + ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, &tmp); + if (ret == NOTIFICATION_ERROR_NONE && tmp != NULL) { + icon_path = strdup(tmp); + if (!icon_path) { + ERR("strdup: %s", tmp); + } - int ret = notification_get_pkgname(noti, &pkgname); - if (ret == NOTIFICATION_ERROR_NONE && pkgname != NULL) { - DBG("pkgname : %s", icon_default); + app_control = NULL; + ret = notification_get_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_THUMBNAIL, &app_control); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Failed to get handler"); + } - icon_default = quickpanel_common_ui_get_pkginfo_icon(pkgname); - DBG("icon_default : %s", icon_default); + DBG("thumb_path : %s app_control = %p", icon_path, app_control); + } else { + char *pkgname; - if (icon_default == NULL - || ( icon_default != NULL && elm_image_file_set(icon, icon_default, NULL) == EINA_FALSE)) { - DBG("DEFAULT_ICON : %s", DEFAULT_ICON); + icon_path = NULL; + pkgname = NULL; + ret = notification_get_pkgname(noti, &pkgname); + if (ret == NOTIFICATION_ERROR_NONE && pkgname != NULL) { + icon_path = quickpanel_common_ui_get_pkginfo_icon(pkgname); + DBG("default_pkgicon_path : %s", icon_path); + } - if( elm_image_file_set(icon, DEFAULT_ICON, NULL) == EINA_FALSE) { - evas_object_del(icon); - icon = NULL; - } - } - } else { - if ( elm_image_file_set(icon, DEFAULT_ICON, NULL) == EINA_FALSE) { - evas_object_del(icon); - icon = NULL; - } + if (!icon_path) { + icon_path = strdup(DEFAULT_ICON); + DBG("default_path : %s", icon_path); } + + app_control = NULL; } } - if (icon != NULL) { - elm_object_signal_callback_add(parent, "image_press" , "", _image_press_cb, noti); + icon = elm_image_add(parent); + if (!icon) { + ERR("Failed to create an image object"); + free(icon_path); + if (app_control) { + app_control_destroy(app_control); + } + return NULL; } + ret = elm_image_file_set(icon, icon_path, NULL); free(icon_path); - free(thumb_path); - free(pkgname); - free(icon_default); + if (ret == EINA_FALSE) { + evas_object_del(icon); + if (app_control) { + app_control_destroy(app_control); + } + return NULL; + } + elm_image_resizable_set(icon, EINA_FALSE, EINA_TRUE); + + elm_object_signal_callback_add(icon, "image_press" , "", _image_press_cb, app_control); + evas_object_event_callback_add(icon, EVAS_CALLBACK_DEL, _app_control_del_cb, app_control); return icon; } @@ -401,6 +761,7 @@ static inline char *_get_text(notification_h noti, notification_text_type_e text time_t time = 0; char *text = NULL; char buf[ACTIVENOTI_MSG_LEN] = {0,}; + if (notification_get_time_from_text(noti, text_type, &time) == NOTIFICATION_ERROR_NONE) { if ((int)time > 0) { quickpanel_noti_util_get_time(time, buf, sizeof(buf)); @@ -416,7 +777,6 @@ static inline char *_get_text(notification_h noti, notification_text_type_e text return elm_entry_utf8_to_markup(text); } - return NULL; } @@ -450,80 +810,58 @@ static inline void _check_and_add_to_buffer(Eina_Strbuf *str_buf, char *text, in } } -static char *_activenoti_get_label_layout_default(notification_h noti, int is_screenreader, char **subtitle, char **title, char **content) +static void _activenoti_set_text(notification_h noti, int is_screenreader) { - int len = 0; char *domain = NULL; char *dir = NULL; - const char *tmp = NULL; - char buf[ACTIVENOTI_MSG_LEN] = { 0, }; - - retif(noti == NULL, NULL, "Invalid parameter!"); + char *tmp; + int ret; - notification_get_text_domain(noti, &domain, &dir); - if (domain != NULL && dir != NULL) { - bindtextdomain(domain, dir); + if (!noti) { + ERR("Invalid parameter"); + return; } - if ( title != NULL ) { - *title = _get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE); + ret = notification_get_text_domain(noti, &domain, &dir); + if (ret == NOTIFICATION_ERROR_NONE && domain != NULL && dir != NULL) { + bindtextdomain(domain, dir); } - if ( content != NULL ) { - *content = _get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT); + tmp = _get_text(noti, NOTIFICATION_TEXT_TYPE_INFO_1); + if (tmp != NULL) { + elm_object_part_text_set(s_info.layout, "subtitle_text", tmp); + free(tmp); + elm_object_signal_emit(s_info.layout, "sub_show", "subtitle_text"); + } else { + elm_object_signal_emit(s_info.layout, "sub_hide", "subtitle_text"); } - if ( subtitle != NULL ) { - *subtitle = _get_text(noti, NOTIFICATION_TEXT_TYPE_INFO_1); + tmp = _get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE); + if (tmp != NULL) { + elm_object_part_text_set(s_info.layout, "title_text", tmp); + free(tmp); + } else { + elm_object_part_text_set(s_info.layout, "title_text", ""); } - if (is_screenreader == 1) { - if (title == NULL && content == NULL) { - len = 0; - } else { - Eina_Strbuf *strbuf = eina_strbuf_new(); - if (strbuf != NULL) { - eina_strbuf_append(strbuf, _("IDS_QP_BUTTON_NOTIFICATION")); - eina_strbuf_append_char(strbuf, '\n'); - _check_and_add_to_buffer(strbuf, title, 1); - _check_and_add_to_buffer(strbuf, content, 1); - - if (eina_strbuf_length_get(strbuf) > 0) { - len = snprintf(buf, sizeof(buf) - 1, "%s", eina_strbuf_string_get(strbuf)); - } - eina_strbuf_free(strbuf); - } - } - - if (len > 0) { - return strdup(buf); - } + tmp = _get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT); + if (tmp != NULL) { + elm_object_part_text_set(s_info.layout, "content_text", tmp); + free(tmp); + } else { + elm_object_part_text_set(s_info.layout, "content_text", ""); } - - return NULL; -} - - -static char *_activenoti_get_text(notification_h noti, int is_screenreader, char **subtitle, char **title, char **content) -{ - char *result = NULL; - result = _activenoti_get_label_layout_default(noti, is_screenreader, subtitle, title, content); - - return result; } -static void _noti_hide_cb(void *data, Evas_Object *obj, - const char *emission, const char *source) +static void _handle_press_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { + DBG(""); _activenoti_hide(data, 0); } -static void _noti_press_cb(void *data, Evas_Object *obj, - const char *emission, const char *source) +static void _noti_press_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { DBG(""); - - notification_h noti = (notification_h) data; int ret = APP_CONTROL_ERROR_NONE; char *caller_pkgname = NULL; bundle *responding_service_handle = NULL; @@ -531,9 +869,12 @@ static void _noti_press_cb(void *data, Evas_Object *obj, bundle *multi_service_handle = NULL; int flags = 0, group_id = 0, priv_id = 0, count = 0, flag_launch = 0; notification_type_e type = NOTIFICATION_TYPE_NONE; + notification_h noti = NULL; - retif(noti == NULL, , "Invalid parameter!"); + retif(s_info.activenoti == NULL, , "Invalid parameter!"); + retif(s_info.current_noti == NULL, , "Invalid parameter!"); + noti = s_info.current_noti; notification_get_pkgname(noti, &caller_pkgname); notification_get_id(noti, &group_id, &priv_id); notification_get_property(noti, &flags); @@ -545,9 +886,20 @@ static void _noti_press_cb(void *data, Evas_Object *obj, flag_launch = 1; } - notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_RESPONDING, NULL, &responding_service_handle); - 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); + ret = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_RESPONDING, NULL, &responding_service_handle); + if (ret != NOTIFICATION_ERROR_NONE || responding_service_handle == NULL) { + DBG("NOTIFICATION_EXECUTE_TYPE_RESPONDING failed [%d]", ret); + } + + ret = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, &single_service_handle); + if (ret != NOTIFICATION_ERROR_NONE || single_service_handle == NULL) { + DBG("NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH failed [%d]", ret); + } + + ret = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, NULL, &multi_service_handle); + if (ret != NOTIFICATION_ERROR_NONE || multi_service_handle == NULL) { + DBG("NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH failed [%d]", ret); + } if (responding_service_handle != NULL) { DBG("responding_service_handle : %s", responding_service_handle); @@ -563,13 +915,10 @@ static void _noti_press_cb(void *data, Evas_Object *obj, } if (single_service_handle != NULL && multi_service_handle == NULL) { - DBG(""); ret = quickpanel_uic_launch_app(NULL, single_service_handle); } else if (single_service_handle == NULL && multi_service_handle != NULL) { - DBG(""); ret = quickpanel_uic_launch_app(NULL, multi_service_handle); } else if (single_service_handle != NULL && multi_service_handle != NULL) { - DBG(""); if (count <= 1) { ret = quickpanel_uic_launch_app(NULL, single_service_handle); } else { @@ -585,128 +934,96 @@ static void _noti_press_cb(void *data, Evas_Object *obj, } - -static void _button_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - DBG(""); - app_control_h app_control = data; - Evas_Object *btn_img; - - msgif(app_control == NULL, , "Invalid parameter!"); - - btn_img = evas_object_data_get(obj, E_DATA_BTN_IMAGE); - - if (btn_img) { - evas_object_del(btn_img); - btn_img = NULL; - } - - if (app_control) { - app_control_destroy(app_control); - } -} - - static void _button_press_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { app_control_h app_control = data; int ret = APP_CONTROL_ERROR_NONE; - if (app_control) { - char *app_id = NULL; - ret = app_control_get_app_id(app_control, &app_id); - - DBG("app_id : %s",app_id); - if (ret == APP_CONTROL_ERROR_NONE && app_id != NULL) { - ret = app_control_send_launch_request(app_control, NULL, NULL); - DBG("ret [%s]", ret); - free(app_id); - } - - } else { - ERR("app_control is NULL"); - } + ret = app_control_send_launch_request(app_control, NULL, NULL); + DBG("app_control_send_launch_request return [%s]", ret); _activenoti_hide(NULL, 1); } - static Evas_Object *_get_btn_img(Evas_Object *parent, notification_h noti, int btn_num) { - char *btn_path = NULL; - Evas_Object *btn_img = NULL; retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); -#ifdef HAVE_X - notification_get_image(noti, btn_num + NOTIFICATION_IMAGE_TYPE_BUTTON_1, &btn_path); -#endif + char *btn_path = NULL; + Evas_Object *btn_img = NULL; + int ret; - if (btn_path == NULL ){ + ret = notification_get_image(noti, btn_num + NOTIFICATION_IMAGE_TYPE_BUTTON_1, &btn_path); + if (ret != NOTIFICATION_ERROR_NONE || btn_path == NULL) { + DBG("notification_get_image return [%d]", ret); return NULL; } btn_img = elm_image_add(parent); + if (!btn_img) { + //free(btn_path); + return NULL; + } + evas_object_size_hint_weight_set(btn_img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn_img, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_image_resizable_set(btn_img, EINA_TRUE, EINA_TRUE); - if (btn_img) { - elm_image_resizable_set(btn_img, EINA_TRUE, EINA_TRUE); - if( elm_image_file_set(btn_img, btn_path, NULL) == EINA_FALSE) { - evas_object_del(btn_img); - btn_img = NULL; - return NULL; - } - } else { + ret = elm_image_file_set(btn_img, btn_path, NULL); + //free(btn_path); + if (ret == EINA_FALSE) { + evas_object_del(btn_img); return NULL; } - free(btn_path); - return btn_img; } - static Evas_Object *_get_bg_img(Evas_Object *parent, notification_h noti) { char *bg_path = NULL; Evas_Object *bg_img = NULL; - retif(noti == NULL || parent == NULL, NULL, "Invalid parameter!"); + int ret; - notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_BACKGROUND, &bg_path); + if (!parent || !noti) { + ERR("Invalid parameters %p %p", parent, noti); + return NULL; + } - if (bg_path == NULL ){ + ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_BACKGROUND, &bg_path); + if (ret != NOTIFICATION_ERROR_NONE || bg_path == NULL) { + DBG("bg_path is null ret = %d", ret); return NULL; } bg_img = elm_image_add(parent); + if (!bg_img) { + return NULL; + } + evas_object_size_hint_weight_set(bg_img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bg_img, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_image_resizable_set(bg_img, EINA_TRUE, EINA_TRUE); - if (bg_img) { - elm_image_resizable_set(bg_img, EINA_TRUE, EINA_TRUE); - if( elm_image_file_set(bg_img, bg_path, NULL) == EINA_FALSE) { - evas_object_del(bg_img); - bg_img = NULL; - return NULL; - } - } else { + ret = elm_image_file_set(bg_img, bg_path, NULL); + if (ret == EINA_FALSE) { + evas_object_del(bg_img); return NULL; } - free(bg_path); - return bg_img; } - static int _activenoti_create_button(Evas_Object *obj, notification_h noti) { - int btn_cnt= 0; - int ret = APP_CONTROL_ERROR_NONE; - app_control_h app_control = NULL; + int btn_cnt; + int ret; + app_control_h app_control; - retif(obj == NULL, 0, "obj is NULL!"); - retif(noti == NULL, 0, "noti is NULL!"); + if (!obj || !noti) { + ERR("Invalid parameters"); + return 0; + } if (s_info.btnbox) { //if exist, delete and create evas_object_del(s_info.btnbox); @@ -727,23 +1044,29 @@ static int _activenoti_create_button(Evas_Object *obj, notification_h noti) evas_object_show(box); s_info.btnbox = box; - for( btn_cnt = 0 ; btn_cnt <= 2 ; btn_cnt++) { - retif(ret != APP_CONTROL_ERROR_NONE, 0, "noapp_control_createti is failed!"); -#ifdef HAVE_X + for (btn_cnt = 0; btn_cnt < 3; btn_cnt++) { + app_control = NULL; ret = notification_get_event_handler(noti, btn_cnt + NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, &app_control); -#endif + DBG("appcontrol %p", app_control); if(ret != NOTIFICATION_ERROR_NONE || app_control == NULL) { INFO("no more button, button count is %d", btn_cnt); INFO("ret is %d", ret); + + /** + * @note + * In this case, + * The app_control is not used and no one cares it. + * So we have to release it from here if it is allocated. + */ + if (app_control) { + app_control_destroy(app_control); + } + if (btn_cnt == 0) { // noti doesn't have button - if (app_control) { - app_control_destroy(app_control); - } evas_object_del(s_info.btnbox); s_info.btnbox = NULL; return 0; } - break; } else { Evas_Object *bt_layout; char *btn_text; @@ -752,10 +1075,8 @@ static int _activenoti_create_button(Evas_Object *obj, notification_h noti) bt_layout = elm_layout_add(s_info.btnbox); if(bt_layout == NULL) { ERR("bt_layout is null"); - if (app_control) { - app_control_destroy(app_control); - } evas_object_del(s_info.btnbox); + app_control_destroy(app_control); s_info.btnbox = NULL; return 0; } @@ -764,255 +1085,225 @@ static int _activenoti_create_button(Evas_Object *obj, notification_h noti) evas_object_size_hint_weight_set (bt_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - image = _get_btn_img(bt_layout , noti, btn_cnt); + image = _get_btn_img(bt_layout, noti, btn_cnt); if (image != NULL) { elm_object_part_content_set(bt_layout, "content.button.image", image); - evas_object_data_set(bt_layout, E_DATA_BTN_IMAGE, image); } - -#ifdef HAVE_X + btn_text = _get_text(noti, btn_cnt + NOTIFICATION_TEXT_TYPE_BUTTON_1); -#endif if (btn_text != NULL) { - DBG("btn_text :%s", btn_text); elm_object_part_text_set(bt_layout, "content.button.text", btn_text); free(btn_text); } - elm_object_signal_callback_add(bt_layout, "button_clicked" , "", _button_press_cb, app_control); - evas_object_event_callback_add(bt_layout, EVAS_CALLBACK_DEL, _button_del_cb, app_control); + evas_object_event_callback_add(bt_layout, EVAS_CALLBACK_DEL, _app_control_del_cb, app_control); + evas_object_show(bt_layout); elm_box_pack_end(s_info.btnbox,bt_layout); } } + elm_object_part_content_set(obj, "button.swallow", s_info.btnbox); return btn_cnt; } -static void _activenoti_update_activenoti(void *data) +static void _activenoti_create_activenoti(void) { DBG(""); Eina_Bool ret = EINA_FALSE; - notification_h noti = (notification_h) data; - Evas_Object *icon = NULL; - Evas_Object *badge = NULL; - - Evas_Object *textblock = NULL; - char *title = NULL; - char *subtitle = NULL; - char *content = NULL; - int btn_cnt = 0; - - retif(noti == NULL, , "Invalid parameter!"); + Evas_Object *base = NULL; + int w, h; - if (s_info.activenoti == NULL) { - ERR("Active notification doesn't exist"); + if (s_info.activenoti != NULL) { + ERR("Instant notification exists"); return; } - btn_cnt = _activenoti_create_button(s_info.layout, noti); - - if (btn_cnt == 0) { //no button - elm_object_signal_emit(s_info.layout, "btn_hide", "button.space"); - } else { - elm_object_signal_emit(s_info.layout, "btn_show", "button.space"); - } + s_info.activenoti = quickpanel_noti_win_add(NULL); + retif(s_info.activenoti == NULL, , "Failed to add elm activenoti."); - icon = elm_object_part_content_get(s_info.layout, "icon_big"); - if(icon != NULL) { - evas_object_del(icon); - icon = NULL; + s_info.layout = elm_layout_add(s_info.activenoti); + if (!s_info.layout) { + ERR("Failed to get detailview."); + _activenoti_destroy_activenoti(); + return; } - icon = _activenoti_create_icon(s_info.layout, noti); - if (icon != NULL) { - elm_object_part_content_set(s_info.layout, "icon_big", icon); + ret = elm_layout_file_set(s_info.layout, ACTIVENOTI_EDJ, "headsup/base"); + retif(ret == EINA_FALSE, , "failed to load layout"); - badge = elm_object_part_content_get(s_info.layout, "icon_badge"); - if(badge != NULL) { - evas_object_del(badge); - badge = NULL; - } + elm_object_signal_callback_add(s_info.layout, "noti_press" , "", _noti_press_cb, NULL); + elm_object_signal_callback_add(s_info.layout, "del" , "", _handle_press_cb, NULL); - badge = _activenoti_create_badge(s_info.layout, noti); - if (badge != NULL) { - elm_object_part_content_set(s_info.layout, "icon_badge", badge); - } else { - INFO("badge is NULL"); - } - } else { - INFO("icon is NULL"); - } - _activenoti_get_text(noti, 0, &subtitle, &title, &content); + evas_object_geometry_get(s_info.activenoti, NULL, NULL, &w, &h); + DBG("evas_object_geometry_get x %d y %d", w, h); - if (title != NULL) { - Eina_Strbuf *bufferT = eina_strbuf_new(); - eina_strbuf_append(bufferT, title); - eina_strbuf_append(bufferT, "<b/>"); - elm_object_part_text_set(s_info.layout, "title_text", eina_strbuf_string_get(bufferT)); - free(title); - eina_strbuf_free(bufferT); - } + elm_win_resize_object_add(s_info.activenoti, s_info.layout); + evas_object_show(s_info.layout); - if (subtitle != NULL) { - Eina_Strbuf *bufferST = eina_strbuf_new(); - eina_strbuf_append(bufferST, subtitle); - elm_object_part_text_set(s_info.layout, "subtitle_text", eina_strbuf_string_get(bufferST)); - free(subtitle); - eina_strbuf_free(bufferST); - elm_object_signal_emit(s_info.layout, "sub_show", "subtitle_text"); - } else { - elm_object_signal_emit(s_info.layout, "sub_hide", "subtitle_text"); + /* create base rectangle */ + base = evas_object_rectangle_add(evas_object_evas_get(s_info.layout)); + if (!base) { + ERR("Failed to get detailview."); + _activenoti_destroy_activenoti(); + return; } - if (content != NULL) { - Eina_Strbuf *bufferC = eina_strbuf_new(); - eina_strbuf_append(bufferC, content); - elm_object_part_text_set(s_info.layout, "content_text", eina_strbuf_string_get(bufferC)); - free(content); - eina_strbuf_free(bufferC); - } + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_color_set(base, 0, 165, 198, 255); + elm_object_part_content_set(s_info.layout, "background", base); - if (s_info.close_timer != NULL) { - ecore_timer_del(s_info.close_timer); - s_info.close_timer = NULL; - } + quickpanel_noti_win_content_set(s_info.activenoti, s_info.layout); - s_info.close_timer = ecore_timer_add(DEL_TIMER_VALUE, _activenoti_hide_timer_cb, NULL); - evas_object_show(s_info.activenoti); + s_info.gesture = _gesture_create(s_info.layout); - SERR("activenoti noti is updated"); + _activenoti_win_rotated(quickpanel_get_app_data(), 0); } -static void _activenoti_create_activenoti(void *data) +static void _activenoti_update_activenoti(void) { - DBG(""); + ERR(""); Eina_Bool ret = EINA_FALSE; - notification_h noti = (notification_h) data; + notification_h noti; Evas_Object *icon = NULL; Evas_Object *badge = NULL; Evas_Object *bg_img = NULL; - - - Evas_Object *textblock = NULL; - char *title = NULL; - char *subtitle = NULL; - char *content = NULL; - int *is_activenoti_executed = NULL; int btn_cnt = 0; + bool auto_remove = true; + bool current_auto_remove = true; - retif(noti == NULL, , "Invalid parameter!"); + if (s_info.activenoti == NULL) { + ERR("Active notification doesn't exist"); + return; + } - if (s_info.activenoti != NULL) { - ERR("Instant notification exists"); + if (s_info.layout == NULL) { + ERR("Active notification doesn't exist"); return; } - s_info.activenoti = quickpanel_noti_win_add(NULL); - retif(s_info.activenoti == NULL, , "Failed to add elm activenoti."); - evas_object_data_set(s_info.activenoti, E_DATA_NOTI, noti); + if (s_info.delay_timer != NULL) { + ERR("s_info.delay_timer"); + ecore_timer_del(s_info.delay_timer); + s_info.delay_timer = NULL; + } - s_info.layout = elm_layout_add(s_info.activenoti); - if (!s_info.layout) { - ERR("Failed to get detailview."); - _activenoti_hide(s_info.activenoti, 0); + if (s_info.close_timer != NULL) { + ERR("s_info.close_timer"); + ecore_timer_del(s_info.close_timer); + s_info.close_timer = NULL; + } + + noti = _activenoti_get_in_list(s_info.current_noti); + if (noti == NULL) { + DBG("noti is null"); return; } - ret = elm_layout_file_set(s_info.layout, ACTIVENOTI_EDJ, "headsup/base"); - retif(ret == EINA_FALSE, , "failed to load layout"); - evas_object_show(s_info.layout); + if (s_info.current_noti) { + ret = notification_get_auto_remove(s_info.current_noti, ¤t_auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%s] from current_noti", ret); + return; + } + if (!current_auto_remove) { + DBG("!auto_remove"); + ret = notification_get_auto_remove(noti, &auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%s] from new noti", ret); + return; + } + + if (auto_remove) { + DBG("auto_remove"); + _activenoti_add_in_list(noti); // timer + return; // check!!! + } else { + DBG("!auto_remove"); + _activenoti_add_in_list(s_info.current_noti); + } + } + } else { + ret = notification_get_auto_remove(noti, ¤t_auto_remove); + if (ret != NOTIFICATION_ERROR_NONE) { + DBG("notification_get_auto_remove return [%s] from current_noti", ret); + return; + } + } + + s_info.current_noti = noti; + + if (current_auto_remove == true) { + time_t noti_time = 0; + ret = notification_get_time(s_info.current_noti, ¬i_time); + if (ret != NOTIFICATION_ERROR_NONE || noti_time == 0) { + notification_get_insert_time(s_info.current_noti, ¬i_time); + } + noti_time = time(NULL) - noti_time; + s_info.close_timer = ecore_timer_add(DEL_TIMER_VALUE - noti_time, _activenoti_close_timer_cb, NULL); + } - elm_object_signal_callback_add(s_info.layout, "noti_press" , "", _noti_press_cb, noti); - elm_object_signal_callback_add(s_info.layout, "del" , "", _noti_hide_cb, noti); + bg_img = elm_object_part_content_unset(s_info.layout, "bg_img"); + DBG("bg_img %p", bg_img); + if(bg_img != NULL) { + evas_object_del(bg_img); + bg_img = NULL; + } - bg_img = _get_bg_img(s_info.layout , noti); + bg_img = _get_bg_img(s_info.layout , s_info.current_noti); if (bg_img != NULL) { elm_object_part_content_set(s_info.layout, "bg_img", bg_img); - evas_object_data_set(s_info.activenoti, E_DATA_BG_IMAGE, bg_img); } - btn_cnt = _activenoti_create_button(s_info.layout, noti); - + btn_cnt = _activenoti_create_button(s_info.layout, s_info.current_noti); if (btn_cnt == 0) { //no button elm_object_signal_emit(s_info.layout, "btn_hide", "button.space"); + } else { + elm_object_signal_emit(s_info.layout, "btn_show", "button.space"); } - quickpanel_noti_win_content_set(s_info.activenoti, s_info.layout, btn_cnt); + icon = elm_object_part_content_unset(s_info.layout, "icon_big"); + DBG("icon %p", icon); + if(icon != NULL) { + evas_object_del(icon); + icon = NULL; + } - icon = _activenoti_create_icon(s_info.layout, noti); + icon = _activenoti_create_icon(s_info.layout, s_info.current_noti); if (icon != NULL) { elm_object_part_content_set(s_info.layout, "icon_big", icon); - evas_object_data_set(s_info.activenoti, E_DATA_ICON, icon); - badge = _activenoti_create_badge(s_info.layout, noti); + badge = elm_object_part_content_unset(s_info.layout, "icon_badge"); + DBG("badget %p", badge); + if(badge != NULL) { + evas_object_del(badge); + } + + badge = _activenoti_create_badge(s_info.layout, s_info.current_noti); if (badge != NULL) { elm_object_part_content_set(s_info.layout, "icon_badge", badge); - evas_object_data_set(s_info.activenoti, E_DATA_BADGE, icon); } else { INFO("badge is NULL"); } + DBG(""); } else { INFO("icon is NULL"); } - _activenoti_get_text(noti, 0, &subtitle, &title, &content); - - if (title != NULL) { - Eina_Strbuf *bufferT = eina_strbuf_new(); - eina_strbuf_append(bufferT, title); - elm_object_part_text_set(s_info.layout, "title_text", eina_strbuf_string_get(bufferT)); - free(title); - eina_strbuf_free(bufferT); - } - - - if (subtitle != NULL) { - Eina_Strbuf *bufferST = eina_strbuf_new(); - eina_strbuf_append(bufferST, subtitle); - elm_object_part_text_set(s_info.layout, "subtitle_text", eina_strbuf_string_get(bufferST)); - free(subtitle); - eina_strbuf_free(bufferST); - elm_object_signal_emit(s_info.layout, "subtext_show", "subtitle_text"); - } - - if (content != NULL) { - Eina_Strbuf *bufferC = eina_strbuf_new(); - eina_strbuf_append(bufferC, content); - elm_object_part_text_set(s_info.layout, "content_text", eina_strbuf_string_get(bufferC)); - free(content); - eina_strbuf_free(bufferC); - } - - SERR("activenoti noti is created"); - - s_info.gesture = _gesture_create(s_info.layout); - _activenoti_win_rotated(data, 0); - - if (s_info.close_timer != NULL) { - ecore_timer_del(s_info.close_timer); - s_info.close_timer = NULL; - } - s_info.close_timer = ecore_timer_add(DEL_TIMER_VALUE, _activenoti_hide_timer_cb, NULL); + _activenoti_set_text(noti, 0); evas_object_show(s_info.activenoti); - SERR("show activenoti noti"); + + SERR("activenoti noti is updated"); } -static void _activenoti_destroy_activenoti() +static void _activenoti_destroy_activenoti(void) { - Evas_Object *bg; - Evas_Object *icon; - Evas_Object *badge; - notification_h noti; - retif(!s_info.activenoti,,"s_info->activenoti is null"); _gesture_destroy(); - DBG("_activenoti_destroy_activenoti"); - if (s_info.delay_timer != NULL) { ecore_timer_del(s_info.delay_timer); s_info.delay_timer = NULL; @@ -1023,21 +1314,6 @@ static void _activenoti_destroy_activenoti() s_info.close_timer = NULL; } - bg = evas_object_data_del(s_info.activenoti, E_DATA_BG_IMAGE); - if (bg) { - evas_object_del(bg); - } - - icon = evas_object_data_del(s_info.activenoti, E_DATA_ICON); - if (icon) { - evas_object_del(icon); - } - - badge = evas_object_data_del(s_info.activenoti, E_DATA_BADGE); - if (badge) { - evas_object_del(badge); - } - if (s_info.btnbox) { evas_object_del(s_info.btnbox); s_info.btnbox = NULL; @@ -1048,21 +1324,16 @@ static void _activenoti_destroy_activenoti() s_info.layout = NULL; } - noti = evas_object_data_del(s_info.activenoti, E_DATA_NOTI); - if (noti) { - _activenoti_only_noti_del(noti); - notification_free(noti); - } if (s_info.activenoti) { - evas_object_hide(s_info.activenoti); + evas_object_del(s_info.activenoti); s_info.activenoti = NULL; } } static void _activenoti_win_rotated(void *data, int need_hide) { - int angle = 0; retif(data == NULL, ,"data is NULL"); + int angle = 0; struct appdata *ad = data; if (s_info.activenoti != NULL) { @@ -1079,83 +1350,80 @@ static void _activenoti_win_rotated(void *data, int need_hide) static void _media_feedback_sound(notification_h noti) { + retif(noti == NULL, ,"op_list is NULL"); int ret = 0, priv_id = 0; const char *nsound_path = NULL; notification_sound_type_e nsound_type = NOTIFICATION_SOUND_TYPE_NONE; char *default_msg_tone = NULL; - retif(noti == NULL, ,"op_list is NULL"); notification_get_id(noti, NULL, &priv_id); notification_get_sound(noti, &nsound_type, &nsound_path); SDBG("notification sound: %d, %s", nsound_type, nsound_path); switch (nsound_type) { - case NOTIFICATION_SOUND_TYPE_USER_DATA: - /* - * if user data file isn't playable, play the default ringtone - */ - if (nsound_path != NULL) { - if (quickpanel_media_playable_check(nsound_path) == EINA_TRUE) { - ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, nsound_path); - if (quickpanel_media_player_is_drm_error(ret) == 1) { - ERR("failed to play notification sound due to DRM problem"); -#ifdef HAVE_X - ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &default_msg_tone); - msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to get key(%s) : %d", SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, ret); -#endif - - - if (default_msg_tone != NULL) { - SDBG("setting sound[%s]", default_msg_tone); - ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, default_msg_tone); - free(default_msg_tone); - } - } - if (ret == PLAYER_ERROR_NONE) { - quickpanel_media_player_id_set(priv_id); - } else { - ERR("failed to play notification sound"); + case NOTIFICATION_SOUND_TYPE_USER_DATA: + /* + * if user data file isn't playable, play the default ringtone + */ + if (nsound_path != NULL) { + if (quickpanel_media_playable_check(nsound_path) == EINA_TRUE) { + ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, nsound_path); + if (quickpanel_media_player_is_drm_error(ret) == 1) { + ERR("failed to play notification sound due to DRM problem"); + ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &default_msg_tone); + msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to get key(%s) : %d", SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, ret); + + + if (default_msg_tone != NULL) { + SDBG("setting sound[%s]", default_msg_tone); + ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, default_msg_tone); + free(default_msg_tone); } - break; - } else { - ERR("playable false, So unlock tone"); - feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_UNLOCK); } - } else { - ERR("sound path null"); - } - - break; - case NOTIFICATION_SOUND_TYPE_DEFAULT: -#ifdef HAVE_X - ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &default_msg_tone); - msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to get key(%s) : %d", SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, ret); -#endif - if (default_msg_tone != NULL) { - SDBG("Reminded setting sound[%s]", default_msg_tone); - ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, default_msg_tone); - free(default_msg_tone); if (ret == PLAYER_ERROR_NONE) { quickpanel_media_player_id_set(priv_id); } else { - ERR("failed to play notification sound(default)"); + ERR("failed to play notification sound"); } + break; + } else { + ERR("playable false, So unlock tone"); + feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_UNLOCK); } - break; - case NOTIFICATION_SOUND_TYPE_MAX: - case NOTIFICATION_SOUND_TYPE_NONE: - ERR("None type: No sound"); - break; + } else { + ERR("sound path null"); + } - default: - ERR("UnKnown type[%d]", (int)nsound_type); - break; + break; + case NOTIFICATION_SOUND_TYPE_DEFAULT: + ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &default_msg_tone); + msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to get key(%s) : %d", SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, ret); + + if (default_msg_tone != NULL) { + SDBG("Reminded setting sound[%s]", default_msg_tone); + ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, default_msg_tone); + free(default_msg_tone); + if (ret == PLAYER_ERROR_NONE) { + quickpanel_media_player_id_set(priv_id); + } else { + ERR("failed to play notification sound(default)"); + } + } + break; + case NOTIFICATION_SOUND_TYPE_MAX: + case NOTIFICATION_SOUND_TYPE_NONE: + ERR("None type: No sound"); + break; + + default: + ERR("UnKnown type[%d]", (int)nsound_type); + break; } } static void _media_feedback_vibration(notification_h noti) { - retif(noti == NULL, ,"op_list is NULL"); + retif(noti == NULL, , "Invalid parameter!"); /* Play Vibration */ notification_vibration_type_e nvibration_type = NOTIFICATION_VIBRATION_TYPE_NONE; @@ -1164,59 +1432,55 @@ static void _media_feedback_vibration(notification_h noti) notification_get_vibration(noti, &nvibration_type, &nvibration_path); DBG("notification vibration: %d, %s", nvibration_type, nvibration_path); switch (nvibration_type) { - case NOTIFICATION_VIBRATION_TYPE_USER_DATA: - case NOTIFICATION_VIBRATION_TYPE_DEFAULT: - feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_MESSAGE); - break; - case NOTIFICATION_VIBRATION_TYPE_MAX: - case NOTIFICATION_VIBRATION_TYPE_NONE: - break; + case NOTIFICATION_VIBRATION_TYPE_USER_DATA: + case NOTIFICATION_VIBRATION_TYPE_DEFAULT: + feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_MESSAGE); + break; + case NOTIFICATION_VIBRATION_TYPE_MAX: + case NOTIFICATION_VIBRATION_TYPE_NONE: + break; } } static void _activenoti_noti_detailed_changed_cb(void *data, notification_type_e type, notification_op *op_list, int num_op) { + DBG(""); + retif(op_list == NULL, ,"op_list is NULL"); + notification_h noti = NULL; - notification_h noti_from_master = NULL; int flags = 0; int applist = NOTIFICATION_DISPLAY_APP_ALL; - int ret = 0; int op_type = 0; int priv_id = 0; - DBG("_quickpanel_activenoti_noti_changed_cb"); + notification_op_get_data(op_list, NOTIFICATION_OP_DATA_TYPE, &op_type); + notification_op_get_data(op_list, NOTIFICATION_OP_DATA_PRIV_ID, &priv_id); + notification_op_get_data(op_list, NOTIFICATION_OP_DATA_NOTI, ¬i); - retif(op_list == NULL, ,"op_list is NULL"); + DBG("op_type:%d", op_type); + DBG("op_priv_id:%d", priv_id); + DBG("noti:%p", noti); - if (num_op == 1) { - notification_op_get_data(op_list, NOTIFICATION_OP_DATA_TYPE, &op_type); - notification_op_get_data(op_list, NOTIFICATION_OP_DATA_PRIV_ID, &priv_id); - notification_op_get_data(op_list, NOTIFICATION_OP_DATA_NOTI, ¬i_from_master); - DBG("op_type:%d", op_type); - DBG("op_priv_id:%d", priv_id); - DBG("noti:%p", noti_from_master); + if( op_type == NOTIFICATION_OP_DELETE) { + DBG("NOTIFICATION_OP_DELETE"); + int priv_id_current = 0; - if (op_type != NOTIFICATION_OP_INSERT && - op_type != NOTIFICATION_OP_UPDATE) { - return; - } - if (noti_from_master == NULL) { - ERR("failed to get a notification from master"); - return; - } - if (notification_clone(noti_from_master, ¬i) != NOTIFICATION_ERROR_NONE) { - ERR("failed to create a cloned notification"); - return; - } -#ifdef QP_EMERGENCY_MODE_ENABLE - if (quickpanel_emergency_mode_is_on()) { - if (quickpanel_emergency_mode_notification_filter(noti, 1)) { - DBG("notification filtered"); - notification_free(noti); + if (s_info.current_noti) { + notification_get_id(s_info.current_noti, NULL, &priv_id_current); + if (s_info.current_noti == noti || priv_id_current == priv_id) { + _activenoti_hide(NULL, 0); return; } } -#endif + + _activenoti_remove_in_list(noti); + + return; + } else if (op_type == NOTIFICATION_OP_DELETE_ALL) { + if(s_info.current_noti) { + _activenoti_hide(NULL, 0); + } + _activenoti_remove_list(); } retif(noti == NULL, ,"noti is NULL"); @@ -1224,54 +1488,45 @@ static void _activenoti_noti_detailed_changed_cb(void *data, notification_type_e if (op_type == NOTIFICATION_OP_INSERT || op_type == NOTIFICATION_OP_UPDATE) { if (_is_sound_playable() == 1) { if (_check_sound_off(noti) == 0) { - DBG("try to play notification sound"); + DBG("try to play notification sound %x", pthread_self()); _media_feedback_sound(noti); + if (quickpanel_media_is_vib_enabled() == 1 + || quickpanel_media_is_sound_enabled() == 1) { + _media_feedback_vibration(noti); + } } - if (quickpanel_media_is_vib_enabled() == 1 - || quickpanel_media_is_sound_enabled() == 1) { - _media_feedback_vibration(noti); - } + } } notification_get_display_applist(noti, &applist); + DBG("applist : %x" ,applist); /* Check activenoti flag */ notification_get_property(noti, &flags); - DBG("applist : %x" ,applist); - -#ifdef HAVE_X - if (applist & NOTIFICATION_DISPLAY_APP_HEADS_UP) -#endif - { - if (_is_security_lockscreen_launched()) { - notification_free(noti); + if (applist & NOTIFICATION_DISPLAY_APP_ACTIVE) { + if (_is_security_lockscreen_launched() || _check_sound_off(noti) == 1 ) { INFO("lock screen is launched"); return; } - if (quickpanel_uic_is_opened()) { + if (quickpanel_uic_is_opened() && (applist & NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) ) { ERR("quickpanel is opened, activenoti will be not displayed"); - notification_free(noti); - INFO("quickpanel has opened"); return; } /* wait if s_info.activenoti is not NULL */ - if (s_info.activenoti == NULL) { - _activenoti_create_activenoti(noti); - } else { - INFO("s_info.activenoti is not NULL"); - _activenoti_update_activenoti(noti); - } + _activenoti_add_in_list(noti); + _activenoti_create_activenoti(); if (s_info.activenoti == NULL) { ERR("Fail to create activenoti"); _activenoti_only_noti_del(noti); - notification_free(noti); return; } + + _activenoti_update_activenoti(); } } @@ -1301,7 +1556,7 @@ static int _activenoti_init(void *data) static int _activenoti_fini(void *data) { - struct appdata *ad = (struct appdata *)data; + // struct appdata *ad = (struct appdata *)data; _activenoti_destroy_activenoti(); @@ -1326,3 +1581,16 @@ static void _activenoti_reflesh(void *data) _activenoti_win_rotated(data, 1); } } + +static void _activenoti_qp_opened(void *data) +{ + DBG(""); + struct appdata *ad = data; + retif(ad == NULL, , "Invalid parameter!"); + + if (_activenoti_has_pending_noti()) { + _activenoti_remove_list(); + } + _activenoti_hide(NULL, 0); +} + diff --git a/daemon/notifications/animated_image.c b/daemon/notifications/animated_image.c index a8b8c98..4d30401 100755 --- a/daemon/notifications/animated_image.c +++ b/daemon/notifications/animated_image.c @@ -15,8 +15,16 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "common.h" +#include "common_uic.h" #include "animated_image.h" +#include "quickpanel-ui.h" static int _init(void *data); static int _fini(void *data); @@ -98,10 +106,10 @@ HAPI char *quickpanel_animated_image_get_groupname(const char *path) if (path != NULL) { if (strstr(path, "gif") != NULL || strstr(path, "GIF") != NULL) { - snprintf(g_animated_image_group_name, sizeof(g_animated_image_group_name), - "%d:EVAS", s_image_index++); + snprintf(g_animated_image_group_name, sizeof(g_animated_image_group_name), + "%d:EVAS", s_image_index++); - return g_animated_image_group_name; + return g_animated_image_group_name; } } diff --git a/daemon/notifications/animated_image.h b/daemon/notifications/animated_image.h index bfdadea..50a458e 100755 --- a/daemon/notifications/animated_image.h +++ b/daemon/notifications/animated_image.h @@ -20,10 +20,7 @@ #ifndef __QUICKPANEL_ANIMATED_IMAGE_H__ #define __QUICKPANEL_ANIMATED_IMAGE_H__ -#include "quickpanel-ui.h" -#include "common.h" - -void quickpanel_animated_image_add(Evas_Object *image); -char *quickpanel_animated_image_get_groupname(const char *path); +extern void quickpanel_animated_image_add(Evas_Object *image); +extern char *quickpanel_animated_image_get_groupname(const char *path); #endif diff --git a/daemon/notifications/noti.c b/daemon/notifications/noti.c index 92ee4d6..413ac1d 100755 --- a/daemon/notifications/noti.c +++ b/daemon/notifications/noti.c @@ -15,20 +15,33 @@ * */ +#include <Elementary.h> +#include <glib.h> #include <time.h> + #include <vconf.h> #include <appcore-common.h> #include <app_control.h> #include <notification.h> +#include <notification_internal.h> +#include <notification_list.h> +#include <notification_ongoing_flag.h> #include <system_settings.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <sound_manager.h> +#include <E_DBus.h> +#include "media.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" +#include "common_uic.h" #include "common.h" #include "list_util.h" #include "noti_node.h" #include "noti_gridbox.h" +#include "vi_manager.h" #include "noti_box.h" #include "noti_listbox.h" #include "noti_list_item.h" @@ -36,19 +49,22 @@ #include "noti_view.h" #include "noti.h" #include "list_util.h" + #ifdef QP_SMART_ALERT_ENABLE #include "smart_alert.h" #endif + #ifdef QP_SERVICE_NOTI_LED_ENABLE #include "noti_led.h" #endif + #ifdef QP_REMINDER_ENABLE #include "reminder.h" #endif + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "vi_manager.h" #define QP_NOTI_ONGOING_DBUS_PATH "/dbus/signal" #define QP_NOTI_ONGOING_DBUS_INTERFACE "notification.ongoing" @@ -83,37 +99,9 @@ static struct _info { .last_time.tm_year = 0, }; -static int _init(void *data); -static int _fini(void *data); -static int _suspend(void *data); -static int _resume(void *data); -static void _lang_changed(void *data); -static void _refresh(void *data); - -static void _ongoing_noti_section_add(void); -static void _opened(void *data); -//static void _quickpanel_ongoing_noti_section_remove(void); +static void _ongoing_noti_section_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _noti_time_init(void *data); -static void _noti_time_fini(void *data); - -QP_Module noti = { - .name = "noti", - .init = _init, - .fini = _fini, - .suspend = _suspend, - .resume = _resume, - .lang_changed = _lang_changed, - .hib_enter = NULL, - .hib_leave = NULL, - .refresh = _refresh, - .get_height = NULL, - .qp_opened = _opened, -}; - -static notification_h _update_item_progress(const char *pkgname, - int priv_id, - double progress) +static notification_h _update_item_progress(const char *pkgname, int priv_id, double progress) { char *noti_pkgname = NULL; int noti_priv_id = 0; @@ -128,8 +116,7 @@ static notification_h _update_item_progress(const char *pkgname, return NULL; } - if (!strcmp(noti_pkgname, pkgname) - && priv_id == noti_priv_id) { + if (!strcmp(noti_pkgname, pkgname) && priv_id == noti_priv_id) { if (notification_set_progress(node->noti, progress) != NOTIFICATION_ERROR_NONE) { ERR("fail to set progress"); @@ -141,9 +128,7 @@ static notification_h _update_item_progress(const char *pkgname, return NULL; } -static notification_h _update_item_size(const char *pkgname, - int priv_id, - double size) +static notification_h _update_item_size(const char *pkgname, int priv_id, double size) { char *noti_pkgname = NULL; int noti_priv_id = 0; @@ -159,7 +144,7 @@ static notification_h _update_item_size(const char *pkgname, } if (!strcmp(noti_pkgname, pkgname) - && priv_id == noti_priv_id) { + && priv_id == noti_priv_id) { notification_set_size(node->noti, size); return node->noti; } @@ -168,9 +153,7 @@ static notification_h _update_item_size(const char *pkgname, return NULL; } -static notification_h _update_item_content(const char *pkgname, - int priv_id, - char *content) +static notification_h _update_item_content(const char *pkgname, int priv_id, char *content) { char *noti_pkgname = NULL; int noti_priv_id = 0; @@ -199,8 +182,7 @@ static notification_h _update_item_content(const char *pkgname, return NULL; } -static void _update_progressbar(void *data, - notification_h update_noti) +static void _update_progressbar(void *data, notification_h update_noti) { int priv_id = 0; struct appdata *ad = data; @@ -217,8 +199,7 @@ static void _update_progressbar(void *data, quickpanel_noti_listbox_update_item(ad->list, node->view); } -static void _item_progress_update_cb(void *data, - DBusMessage *msg) +static void _item_progress_update_cb(void *data, DBusMessage *msg) { DBusError err; char *pkgname = 0; @@ -247,12 +228,10 @@ static void _item_progress_update_cb(void *data, } /* check item on the list */ - noti = _update_item_progress(pkgname, - priv_id, progress); + noti = _update_item_progress(pkgname, priv_id, progress); retif(noti == NULL, , "Can not found noti data."); - SDBG("pkgname[%s], priv_id[%d], progress[%lf]", - pkgname, priv_id, progress); + SDBG("pkgname[%s], priv_id[%d], progress[%lf]", pkgname, priv_id, progress); _update_progressbar(data, noti); } @@ -287,13 +266,12 @@ static void _item_size_update_cb(void *data, DBusMessage * msg) retif(noti == NULL, , "Can not found noti data."); SDBG("pkgname[%s], priv_id[%d], progress[%lf]", - pkgname, priv_id, size); + pkgname, priv_id, size); _update_progressbar(data, noti); } -static void _item_content_update_cb(void *data, - DBusMessage *msg) +static void _item_content_update_cb(void *data, DBusMessage *msg) { DBusError err; char *pkgname = NULL; @@ -325,7 +303,7 @@ static void _item_content_update_cb(void *data, } SDBG("pkgname[%s], priv_id[%d], content[%s]", - pkgname, priv_id, content); + pkgname, priv_id, content); /* check item on the list */ noti = _update_item_content(pkgname, priv_id, content); @@ -334,6 +312,24 @@ static void _item_content_update_cb(void *data, _update_progressbar(data, noti); } +static int _is_item_deletable(notification_h noti) +{ + notification_type_e type = NOTIFICATION_TYPE_NONE; + notification_ly_type_e ly_type = NOTIFICATION_LY_NONE; + bool ongoing_flag = false; + + notification_get_type(noti, &type); + notification_get_layout(noti, &ly_type); + notification_get_ongoing_flag(noti, &ongoing_flag); + + if( (type == NOTIFICATION_TYPE_ONGOING && ongoing_flag) || + (type == NOTIFICATION_TYPE_ONGOING && ly_type == NOTIFICATION_LY_ONGOING_PROGRESS)) { + return 0; + } + + return 1; +} + static int _do_noti_delete(notification_h noti) { char *pkgname = NULL; @@ -347,7 +343,7 @@ static int _do_noti_delete(notification_h noti) retif(noti == NULL, NOTIFICATION_ERROR_INVALID_PARAMETER, "Invalid parameter!"); notification_get_pkgname(noti, &caller_pkgname); -// notification_get_application(noti, &pkgname); + // notification_get_application(noti, &pkgname); if (pkgname == NULL) { pkgname = caller_pkgname; } @@ -362,7 +358,7 @@ static int _do_noti_delete(notification_h noti) flag_delete = 1; } - if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) { + if (flag_delete == 1 && ( type == NOTIFICATION_TYPE_NOTI || _is_item_deletable(noti)) ) { ret = notification_delete_by_priv_id(caller_pkgname, NOTIFICATION_TYPE_NOTI, priv_id); } @@ -381,7 +377,7 @@ static void _do_noti_press(notification_h noti, int pressed_area) 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; + flag_delete = 0; notification_type_e type = NOTIFICATION_TYPE_NONE; quickpanel_media_play_feedback(); @@ -389,7 +385,7 @@ static void _do_noti_press(notification_h noti, int pressed_area) retif(noti == NULL, , "Invalid parameter!"); notification_get_pkgname(noti, &caller_pkgname); -// notification_get_application(noti, &pkgname); + // notification_get_application(noti, &pkgname); if (pkgname == NULL) { pkgname = caller_pkgname; } @@ -412,13 +408,13 @@ static void _do_noti_press(notification_h noti, int pressed_area) notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_RESPONDING, - NULL, &responding_service_handle); + NULL, &responding_service_handle); notification_get_execute_option(noti, - NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, - NULL, &single_service_handle); + NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, + NULL, &single_service_handle); notification_get_execute_option(noti, - NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, - NULL, &multi_service_handle); + NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, + NULL, &multi_service_handle); if (pressed_area == NOTI_PRESS_BUTTON_1 && responding_service_handle != NULL) { DBG(""); @@ -554,8 +550,7 @@ static inline void _ongoing_comp_n_copy(notification_h old, notification_h new) if (insert_time == new_insert_time) { char *content = NULL; - notification_get_text(old, - NOTIFICATION_TEXT_TYPE_CONTENT, &content); + notification_get_text(old, NOTIFICATION_TEXT_TYPE_CONTENT, &content); ret = notification_set_text(new, NOTIFICATION_TEXT_TYPE_CONTENT, content, NULL, NOTIFICATION_VARIABLE_TYPE_NONE); if (ret != NOTIFICATION_ERROR_NONE) { ERR("Failed to set text[%d]", ret); @@ -589,7 +584,8 @@ static void _noti_clear_list_all(void) } } -static void _ongoing_noti_section_icon_state_set(int is_closed) { +static void _ongoing_noti_section_icon_state_set(int is_closed) +{ if (s_info.ongoing_noti_section_view != NULL) { if (is_closed == 1) { elm_object_signal_emit(s_info.ongoing_noti_section_view, "button,opened", "prog"); @@ -599,41 +595,38 @@ static void _ongoing_noti_section_icon_state_set(int is_closed) { } } -static void _ongoing_noti_section_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void _ongoing_noti_section_add(void) { - DBG(""); - struct appdata *ad = data; - s_info.ongoing_noti_section_view = NULL; - DBG("VIM ongoing noti_section deleted"); + int noti_count; + struct appdata *ad; - if (quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_NONE) > 0) { - _ongoing_noti_section_add(); + ad = quickpanel_get_app_data(); + if (!ad) { + ERR("Invalid parameter"); + return; } - quickpanel_noti_listbox_remove_item(ad->list, s_info.noti_section_view, 1); - s_info.noti_section_view = NULL; -} - -static void _ongoing_noti_section_add(void) -{ - int noti_count = 0; - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); - retif(ad->list == NULL, , "Invalid parameter!"); + if (!ad->list) { + ERR("Invalid list"); + return; + } if (s_info.noti_node) { noti_count = quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_NONE); + } else { + noti_count = 0; } DBG("[%d] ", noti_count); - if (s_info.ongoing_noti_section_view == NULL) { + if (!s_info.ongoing_noti_section_view) { s_info.ongoing_noti_section_view = quickpanel_noti_section_create(ad->list, QP_ITEM_TYPE_ONGOING_NOTI_GROUP); - if (s_info.ongoing_noti_section_view != NULL) { + if (s_info.ongoing_noti_section_view) { quickpanel_noti_section_set_deleted_cb(s_info.ongoing_noti_section_view, _ongoing_noti_section_deleted_cb, ad); quickpanel_noti_section_update(s_info.ongoing_noti_section_view, noti_count); if (s_info.is_ongoing_hided == 1) { + DBG("Hide NOTI.SECTION"); _ongoing_noti_section_icon_state_set(0); } } @@ -644,6 +637,21 @@ static void _ongoing_noti_section_add(void) } } +static void _ongoing_noti_section_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + DBG(""); + struct appdata *ad = data; + s_info.ongoing_noti_section_view = NULL; + DBG("VIM ongoing noti_section deleted"); + + if (quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_NONE) > 0) { + _ongoing_noti_section_add(); + } + + quickpanel_noti_listbox_remove_item(ad->list, s_info.noti_section_view, 1); + s_info.noti_section_view = NULL; +} + static void _noti_ongoing_add(Evas_Object *list, void *data, int is_prepend) { Evas_Object *noti_list_item = NULL; @@ -658,6 +666,7 @@ static void _noti_ongoing_add(Evas_Object *list, void *data, int is_prepend) if (item != NULL) { quickpanel_noti_list_item_node_set(noti_list_item, item); quickpanel_noti_list_item_set_item_selected_cb(noti_list_item, _noti_listitem_select_cb); + quickpanel_noti_list_item_set_item_deleted_cb(noti_list_item, _notibox_delete_cb); if (s_info.ongoing_noti_section_view == NULL) { _ongoing_noti_section_add(); @@ -730,7 +739,7 @@ static void _update_notilist(struct appdata *ad) notification_get_display_applist(noti, &applist); if (applist & - NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) { + NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) { notification_clone(noti, ¬i_save); _noti_ongoing_add(list, noti_save, LISTBOX_APPEND); } @@ -748,7 +757,7 @@ static void _update_notilist(struct appdata *ad) notification_get_display_applist(noti, &applist); if (applist & - NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) { + NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) { notification_clone(noti, ¬i_save); _noti_add(list, noti_save, LISTBOX_APPEND); } @@ -764,7 +773,8 @@ static void _update_notilist(struct appdata *ad) } } -inline static void _print_debuginfo_from_noti(notification_h noti) { +static inline void _print_debuginfo_from_noti(notification_h noti) +{ retif(noti == NULL, , "Invalid parameter!"); char *noti_pkgname = NULL; @@ -808,6 +818,7 @@ static void _detailed_changed_cb(void *data, notification_type_e type, notificat switch(op_type) { case NOTIFICATION_OP_INSERT: + DBG("NOTIFICATION_OP_INSERT"); if (noti_from_master == NULL) { ERR("failed to get a notification from master"); continue; @@ -863,6 +874,7 @@ static void _detailed_changed_cb(void *data, notification_type_e type, notificat case NOTIFICATION_OP_DELETE: { + DBG("NOTIFICATION_OP_DELETE"); noti_node_item *node = quickpanel_noti_node_get(s_info.noti_node, priv_id); if (node != NULL && node->noti != NULL) { @@ -901,6 +913,7 @@ static void _detailed_changed_cb(void *data, notification_type_e type, notificat case NOTIFICATION_OP_UPDATE: { + DBG("NOTIFICATION_OP_UPDATE"); noti_node_item *node = quickpanel_noti_node_get(s_info.noti_node, priv_id); notification_h old_noti = NULL; @@ -1046,38 +1059,36 @@ static int _register_event_handler(struct appdata *ad) s_info.dbus_handler_size = e_dbus_signal_handler_add(ad->dbus_connection, NULL, - QP_NOTI_ONGOING_DBUS_PATH, - QP_NOTI_ONGOING_DBUS_INTERFACE, "update_progress", - _item_progress_update_cb, - ad); + QP_NOTI_ONGOING_DBUS_PATH, + QP_NOTI_ONGOING_DBUS_INTERFACE, "update_progress", + _item_progress_update_cb, + ad); if (s_info.dbus_handler_size == NULL) { ERR("fail to add size signal"); } s_info.dbus_handler_progress = e_dbus_signal_handler_add(ad->dbus_connection, NULL, - QP_NOTI_ONGOING_DBUS_PATH, - QP_NOTI_ONGOING_DBUS_INTERFACE, "update_size", - _item_size_update_cb, - ad); + QP_NOTI_ONGOING_DBUS_PATH, + QP_NOTI_ONGOING_DBUS_INTERFACE, "update_size", + _item_size_update_cb, + ad); if (s_info.dbus_handler_progress == NULL) { ERR("fail to add progress signal"); } s_info.dbus_handler_content = e_dbus_signal_handler_add(ad->dbus_connection, NULL, - QP_NOTI_ONGOING_DBUS_PATH, - QP_NOTI_ONGOING_DBUS_INTERFACE, "update_content", - _item_content_update_cb, - ad); + QP_NOTI_ONGOING_DBUS_PATH, + QP_NOTI_ONGOING_DBUS_INTERFACE, "update_content", + _item_content_update_cb, + ad); if (s_info.dbus_handler_content == NULL) { ERR("fail to add content signal"); } /* Notify vconf key */ - ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, - _update_sim_status_cb, - (void *)ad); + ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, _update_sim_status_cb, (void *)ad); if (ret != 0) { ERR("Failed to register SIM_SLOT change callback!"); } @@ -1097,26 +1108,22 @@ static int _unregister_event_handler(struct appdata *ad) /* Unregister notification changed cb */ notification_unregister_detailed_changed_cb(_detailed_changed_cb, (void *)ad); - ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, - _update_sim_status_cb); + ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, _update_sim_status_cb); if (ret != 0) { ERR("Failed to ignore SIM_SLOT change callback!"); } /* Delete dbus signal */ if (s_info.dbus_handler_size != NULL) { - e_dbus_signal_handler_del(ad->dbus_connection, - s_info.dbus_handler_size); + e_dbus_signal_handler_del(ad->dbus_connection, s_info.dbus_handler_size); s_info.dbus_handler_size = NULL; } if (s_info.dbus_handler_progress != NULL) { - e_dbus_signal_handler_del(ad->dbus_connection, - s_info.dbus_handler_progress); + e_dbus_signal_handler_del(ad->dbus_connection, s_info.dbus_handler_progress); s_info.dbus_handler_progress = NULL; } if (s_info.dbus_handler_content != NULL) { - e_dbus_signal_handler_del(ad->dbus_connection, - s_info.dbus_handler_content); + e_dbus_signal_handler_del(ad->dbus_connection, s_info.dbus_handler_content); s_info.dbus_handler_content = NULL; } @@ -1124,35 +1131,76 @@ static int _unregister_event_handler(struct appdata *ad) } /*static void _quickpanel_noti_init(void *data) -{ - struct appdata *ad = NULL; + { + struct appdata *ad = NULL; - retif(data == NULL, , "Invalid parameter!"); - ad = data; + retif(data == NULL, , "Invalid parameter!"); + ad = data; + + retif(ad->list == NULL, , "Invalid parameter!"); + + DBG("wr"); + + if (s_info.noti_box == NULL) { + s_info.noti_box = quickpanel_noti_listbox_create(ad->list + , quickpanel_get_app_data(), QP_ITEM_TYPE_ONGOING_NOTI); + quickpanel_noti_listbox_set_item_deleted_cb(s_info.noti_box, _quickpanel_list_box_deleted_cb); + quickpanel_list_util_sort_insert(ad->list, s_info.noti_box); + } + } + + static void _quickpanel_noti_fini(void *data) + { + struct appdata *ad = NULL; - retif(ad->list == NULL, , "Invalid parameter!"); + retif(data == NULL, , "Invalid parameter!"); + ad = data; - DBG("wr"); + retif(ad->list == NULL, , "Invalid parameter!"); - if (s_info.noti_box == NULL) { - s_info.noti_box = quickpanel_noti_listbox_create(ad->list - , quickpanel_get_app_data(), QP_ITEM_TYPE_ONGOING_NOTI); - quickpanel_noti_listbox_set_item_deleted_cb(s_info.noti_box, _quickpanel_list_box_deleted_cb); - quickpanel_list_util_sort_insert(ad->list, s_info.noti_box); + DBG("dr"); + }*/ + +static void _on_time_changed(keynode_t *key, void *data) +{ + struct appdata *ad = data; + time_t current_time; + struct tm loc_time; + + if (!key) { + /** + * @todo + * Todo something for this case. + */ + } + + current_time = time(NULL); + localtime_r(¤t_time, &loc_time); + + if (loc_time.tm_yday != s_info.last_time.tm_yday || loc_time.tm_year != s_info.last_time.tm_year) { + _update_notilist(ad); } + + s_info.last_time = loc_time; } -static void _quickpanel_noti_fini(void *data) +static void _noti_time_init(void *data) { - struct appdata *ad = NULL; - - retif(data == NULL, , "Invalid parameter!"); - ad = data; + int ret = 0; + struct appdata *ad = data; + retif_nomsg(ad == NULL, ); + time_t current_time; - retif(ad->list == NULL, , "Invalid parameter!"); + current_time = time(NULL); + localtime_r(¤t_time, &s_info.last_time); - DBG("dr"); -}*/ + ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_INT, _on_time_changed, data); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_INT, ret); + ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _on_time_changed, data); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); + ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, _on_time_changed, data); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); +} static int _init(void *data) { @@ -1171,6 +1219,20 @@ static int _init(void *data) return QP_OK; } +static void _noti_time_fini(void *data) +{ + int ret = 0; + struct appdata *ad = data; + retif_nomsg(ad == NULL, ); + + ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_INT, _on_time_changed); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_INT, ret); + ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, _on_time_changed); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); + ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _on_time_changed); + msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); +} + static int _fini(void *data) { struct appdata *ad = data; @@ -1288,8 +1350,7 @@ HAPI int quickpanel_noti_get_geometry(int *limit_h, int *limit_partial_h, int *l retif(limit_partial_w == NULL, 0, "invalid parameter"); struct appdata *ad = quickpanel_get_app_data(); - return quickpanel_noti_listbox_get_geometry(ad->list, - limit_h, limit_partial_h, limit_partial_w); + return quickpanel_noti_listbox_get_geometry(ad->list, limit_h, limit_partial_h, limit_partial_w); } HAPI noti_node_item *quickpanel_noti_node_get_by_priv_id(int priv_id) @@ -1352,19 +1413,39 @@ static void _opened(void *data) HAPI void quickpanel_noti_set_clear_all_status() { - struct appdata *ad = quickpanel_get_app_data(); - if ((quickpanel_noti_listbox_get_item_count(ad->list) >= 0 - || quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_ONGOING) >= 0) - && quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_NOTI) <= 0) { + notification_h noti; + notification_list_h list_head; + notification_list_h list_traverse; + bool ongoing_cnt = false; + int ret; + + list_head = NULL; + ret = notification_get_list(NOTIFICATION_TYPE_ONGOING, -1, &list_head); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get the list of notification"); + return; + } + + list_traverse = list_head; + while (list_traverse != NULL) { + noti = notification_list_get_data(list_traverse); + if (_is_item_deletable(noti)) { + ongoing_cnt++; + } + list_traverse = notification_list_get_next(list_traverse); + } + + if (list_head != NULL) { + notification_free_list(list_head); + } + + if (ongoing_cnt == 0 && quickpanel_noti_node_get_item_count(s_info.noti_node, NOTIFICATION_TYPE_NOTI) <= 0) { INFO("NOTI SECTION CLEAR ALL HIDE"); - elm_object_signal_emit(s_info.ongoing_noti_section_view , - "notifaction,section,clear_all,hide", "base"); + elm_object_signal_emit(s_info.ongoing_noti_section_view, "notifaction,section,clear_all,hide", "base"); } else { INFO("NOTI SECTION CLEAR ALL SHOW"); - elm_object_signal_emit(s_info.ongoing_noti_section_view, - "notifaction,section,clear_all,show", "base"); + elm_object_signal_emit(s_info.ongoing_noti_section_view, "notifaction,section,clear_all,show", "base"); } - } HAPI void quickpanel_noti_on_clear_all_clicked(void *data, Evas_Object *obj, void *info) @@ -1373,37 +1454,52 @@ HAPI void quickpanel_noti_on_clear_all_clicked(void *data, Evas_Object *obj, voi LOGI("NOTI CLEAR ALL CLICKED"); DBG(""); - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, , "Invalid parameter!"); - retif(ad->list == NULL, , "Invalid parameter!"); + notification_h noti; + notification_list_h list_head; + notification_list_h list_traverse; + int ret; quickpanel_noti_closing_trigger_set(); -#ifdef HAVE_X notification_clear(NOTIFICATION_TYPE_NOTI); -#endif - quickpanel_uic_close_quickpanel(EINA_FALSE, EINA_FALSE); - /*if (s_info.noti_node->n_ongoing == 0) - { - _ongoing_noti_section_remove(); - }*/ -} + list_head = NULL; + ret = notification_get_list(NOTIFICATION_TYPE_ONGOING, -1, &list_head); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get the list of notifications"); + return; + } -// TIME REACTION + list_traverse = list_head; + while (list_traverse != NULL) { + noti = notification_list_get_data(list_traverse); + if (_is_item_deletable(noti)) { + char *caller_pkgname; + int priv_id; -static void _on_time_changed(keynode_t *key, void *data) -{ - struct appdata *ad = data; + ret = notification_get_id(noti, NULL, &priv_id); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get ID from noti object: %p", noti); + priv_id = 0; + } + ret = notification_get_pkgname(noti, &caller_pkgname); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get caller package name: %p", noti); + caller_pkgname = NULL; + } - time_t current_time = time(NULL); - struct tm loc_time; - localtime_r(¤t_time, &loc_time); + notification_delete_by_priv_id(caller_pkgname, NOTIFICATION_TYPE_NOTI, priv_id); + } - if (loc_time.tm_yday != s_info.last_time.tm_yday || loc_time.tm_year != s_info.last_time.tm_year) { - _update_notilist(ad); + list_traverse = notification_list_get_next(list_traverse); } - s_info.last_time = loc_time; + if (list_head != NULL) { + notification_free_list(list_head); + list_head = NULL; + } + + quickpanel_uic_close_quickpanel(EINA_FALSE, EINA_FALSE); + } static Eina_Bool _notification_time_format_changed_cb(void *data) @@ -1415,52 +1511,20 @@ static Eina_Bool _notification_time_format_changed_cb(void *data) return ECORE_CALLBACK_CANCEL; } -static void _noti_time_init(void *data) -{ - int ret = 0; - struct appdata *ad = data; - retif_nomsg(ad == NULL, ); - - time_t current_time = time(NULL); - localtime_r(¤t_time, &s_info.last_time); - - ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_INT, _on_time_changed, data); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_INT, ret); - ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _on_time_changed, data); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); - ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, _on_time_changed, data); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); -} - -static void _noti_time_fini(void *data) -{ - int ret = 0; - struct appdata *ad = data; - retif_nomsg(ad == NULL, ); - - ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_INT, _on_time_changed); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_INT, ret); - ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, _on_time_changed); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_SETAPPL_TIMEZONE_ID, ret); - ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, _on_time_changed); - msgif(ret != 0, "failed to set key(%s) : %d", VCONFKEY_TELEPHONY_SVC_ROAM, ret); -} - -HAPI void quickpanel_noti_update_by_system_time_changed_cb(system_settings_key_e *key, void *data) +HAPI void quickpanel_noti_update_by_system_time_changed_setting_cb(system_settings_key_e key, void *data) { - struct appdata *ad = data; - -#ifdef HAVE_X - if (key == SYSTEM_SETTINGS_KEY_TIME_CHANGED - ||key == SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY ){ - _on_time_changed(key,data); - } else -#endif - { //key == SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR + // struct appdata *ad = data; + if (key == SYSTEM_SETTINGS_KEY_TIME_CHANGED || key == SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY) { + _on_time_changed(NULL, data); + } else { //key == SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR _notification_time_format_changed_cb(data); } } +HAPI void quickpanel_noti_update_by_system_time_changed_vconf_cb(keynode_t *key, void *data) +{ + _notification_time_format_changed_cb(data); +} HAPI void quickpanel_noti_init_noti_section(void) { @@ -1468,3 +1532,19 @@ HAPI void quickpanel_noti_init_noti_section(void) _ongoing_noti_section_add(); } } + +QP_Module noti = { + .name = "noti", + .init = _init, + .fini = _fini, + .suspend = _suspend, + .resume = _resume, + .lang_changed = _lang_changed, + .hib_enter = NULL, + .hib_leave = NULL, + .refresh = _refresh, + .get_height = NULL, + .qp_opened = _opened, +}; + +/* End of a file */ diff --git a/daemon/notifications/noti.h b/daemon/notifications/noti.h index 7c4cda2..13d5e3c 100755 --- a/daemon/notifications/noti.h +++ b/daemon/notifications/noti.h @@ -19,27 +19,24 @@ #ifndef __NOTI_H__ #define __NOTI_H__ -#include "quickpanel-ui.h" -#include "noti_node.h" -#include <system_settings.h> - #define NOTI_PRESS_BG 0 #define NOTI_PRESS_BUTTON_1 1 #define QP_PRELOAD_NOTI_ICON_PATH "/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" -int quickpanel_noti_get_count(void); -int quickpanel_noti_get_geometry(int *limit_h, int *limit_partial_h, int *limit_partial_w); -void quickpanel_noti_closing_trigger_set(void); +extern int quickpanel_noti_get_count(void); +extern int quickpanel_noti_get_geometry(int *limit_h, int *limit_partial_h, int *limit_partial_w); +extern void quickpanel_noti_closing_trigger_set(void); -noti_node_item *quickpanel_noti_node_get_by_priv_id(int priv_id); -noti_node_item *quickpanel_noti_node_get_first_noti(void); +extern noti_node_item *quickpanel_noti_node_get_by_priv_id(int priv_id); +extern noti_node_item *quickpanel_noti_node_get_first_noti(void); -void quickpanel_noti_set_clear_all_status(); +extern void quickpanel_noti_set_clear_all_status(); -void quickpanel_noti_on_clear_all_clicked(void *data, Evas_Object *obj, void *info); -int quickpanel_noti_get_type_count(notification_type_e noti_type); -void quickpanel_noti_init_noti_section(void); -void quickpanel_noti_update_by_system_time_changed_cb(system_settings_key_e *key, void *data); +extern void quickpanel_noti_on_clear_all_clicked(void *data, Evas_Object *obj, void *info); +extern int quickpanel_noti_get_type_count(notification_type_e noti_type); +extern void quickpanel_noti_init_noti_section(void); +extern void quickpanel_noti_update_by_system_time_changed_setting_cb(system_settings_key_e key, void *data); +extern void quickpanel_noti_update_by_system_time_changed_vconf_cb(keynode_t *key, void *data); #endif diff --git a/daemon/notifications/noti_box.c b/daemon/notifications/noti_box.c index 00cd204..9b15a4e 100755 --- a/daemon/notifications/noti_box.c +++ b/daemon/notifications/noti_box.c @@ -15,25 +15,37 @@ * */ - +#include <Elementary.h> #include <string.h> +#include <glib.h> + +#include <vconf.h> #include <notification.h> +#include <notification_text_domain.h> +#include <notification_internal.h> +#include <system_settings.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" +#include "vi_manager.h" #include "noti_box.h" #include "noti_node.h" #include "noti.h" #include "noti_util.h" +#include "animated_icon.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" #define IMAGE_NO_RESIZE 0 #define IMAGE_RESIZE 1 @@ -216,8 +228,7 @@ static void _signal_cb(void *data, Evas_Object *o, const char *emission, const c } #ifdef QP_SCREENREADER_ENABLE -static inline void _check_and_add_to_buffer(notification_h noti, - notification_text_type_e text_type, Eina_Strbuf *str_buf) +static inline void _check_and_add_to_buffer(notification_h noti, notification_text_type_e text_type, Eina_Strbuf *str_buf) { char buf[256] = { 0, }; char buf_number[QP_UTIL_PHONE_NUMBER_MAX_LEN * 2] = { 0, }; @@ -249,8 +260,7 @@ static inline void _check_and_add_to_buffer(notification_h noti, } } -static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, notification_h noti) { Evas_Object *ao = NULL; Eina_Strbuf *str_buf = NULL; @@ -284,8 +294,7 @@ static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, } } -static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, notification_h noti) { DBG(""); @@ -321,8 +330,7 @@ static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, } } -static void _noti_box_set_rs_layout_thumbnail(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_thumbnail(Evas_Object *noti_box, notification_h noti) { DBG(""); @@ -468,7 +476,7 @@ static void _mouse_move_cb(void* data, Evas* e, Evas_Object* obj, void* event_in delta_x = (delta_x <= 0) ? 1 : delta_x; zoom_ratio = (1.0 - LIMIT_ZOOM_RATIO) * (1.0 - (double)delta_x / (double)THRESHOLD_DISTANCE); color_ratio = LIMIT_FADEOUT_RATIO + - ((1.0 - LIMIT_FADEOUT_RATIO) * (1.0 - ((double)delta_x / (double)(THRESHOLD_DISTANCE)))); + ((1.0 - LIMIT_FADEOUT_RATIO) * (1.0 - ((double)delta_x / (double)(THRESHOLD_DISTANCE)))); map = evas_map_new(4); if (map != NULL) { @@ -562,7 +570,7 @@ HAPI Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_l "edje", _signal_cb, parent - ); + ); //add event elm_object_signal_callback_add(box, @@ -570,7 +578,7 @@ HAPI Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_l "edje", _signal_cb, parent - ); + ); //add event elm_object_signal_callback_add(box, @@ -578,7 +586,7 @@ HAPI Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_l "edje", _signal_cb, parent - ); + ); evas_object_event_callback_add(box, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, NULL); evas_object_event_callback_add(box, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, NULL); @@ -587,8 +595,7 @@ HAPI Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_l return box; } -static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char *image_path, - notification_image_type_e image_type, const char *part, int is_stretch, int is_use_buffer) +static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char *image_path, notification_image_type_e image_type, const char *part, int is_stretch, int is_use_buffer) { Evas_Object *content = NULL; char *image = NULL; @@ -612,7 +619,7 @@ static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char if (memfile != NULL && memfile_size > 0) { _attach_memfile(noti_box, image_type, memfile); if (elm_image_memfile_set(content, memfile, memfile_size, ext, - quickpanel_animated_image_get_groupname(image)) == EINA_FALSE) { + quickpanel_animated_image_get_groupname(image)) == EINA_FALSE) { ERR("failed to set memfile set"); elm_image_file_set(content, image, quickpanel_animated_image_get_groupname(image)); @@ -658,8 +665,7 @@ static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char return content; } -static int _set_text(Evas_Object *noti_box, notification_h noti, - notification_text_type_e text_type, const char *part, char *str, int is_need_effect, int is_support_cr) +static int _set_text(Evas_Object *noti_box, notification_h noti, notification_text_type_e text_type, const char *part, char *str, int is_need_effect, int is_support_cr) { char buf[128] = { 0, }; @@ -707,8 +713,7 @@ static int _set_text(Evas_Object *noti_box, notification_h noti, return 0; } -static int _check_text_null(notification_h noti, - notification_text_type_e text_type) +static int _check_text_null(notification_h noti, notification_text_type_e text_type) { char *text = NULL; @@ -721,8 +726,7 @@ static int _check_text_null(notification_h noti, return 0; } -static int _check_image_null(notification_h noti, - notification_image_type_e image_type) +static int _check_image_null(notification_h noti, notification_image_type_e image_type) { char *image = NULL; @@ -739,8 +743,7 @@ static int _check_image_null(notification_h noti, return 0; } -static void _noti_box_set_layout_single(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_single(Evas_Object *noti_box, notification_h noti) { char *dir = NULL; char *domain = NULL; @@ -757,23 +760,23 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_contents_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_sub_info_1_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 - || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 + || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { is_contents_and_sub_info_2 = 1; } @@ -802,7 +805,7 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1) { @@ -862,8 +865,8 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -873,8 +876,7 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout_multi(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_multi(Evas_Object *noti_box, notification_h noti) { char *pkgname = NULL; char *icon_path = NULL; @@ -891,25 +893,25 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_contents_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_sub_info_1_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 - || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 + || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { is_contents_and_sub_info_2 = 1; } @@ -925,16 +927,16 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, "object.text.title", NULL, is_need_effect, TEXT_CR); if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, "object.text.count", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); } else { if (is_contents_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents.multiline", NULL, is_need_effect, TEXT_CR); } else if (is_contents_and_sub_info_2 == 1) { - _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, - "object.text.contents.multiline.short", NULL, is_need_effect, TEXT_NO_CR); + _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, + "object.text.contents.multiline.short", NULL, is_need_effect, TEXT_NO_CR); } else { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); @@ -943,7 +945,7 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1) { @@ -1011,8 +1013,8 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -1022,8 +1024,7 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, notification_h noti) { char *pkgname = NULL; char *icon_path = NULL; @@ -1041,15 +1042,15 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1) { is_sub_info_1_only = 1; } if (_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_1)!= 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_2) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_3) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_4) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_5) == 1) { + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_2) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_3) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_4) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_5) == 1) { is_show_info = 1; } @@ -1063,9 +1064,9 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, "object.text.title", NULL, is_need_effect, TEXT_CR); if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, "object.text.count", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); } else { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); @@ -1074,15 +1075,15 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, if (is_show_info == 1) { if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1", NULL, is_need_effect, TEXT_NO_CR); + "object.text.info.1", NULL, is_need_effect, TEXT_NO_CR); } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_2, - "object.text.info.2", NULL, is_need_effect, TEXT_NO_CR); + "object.text.info.2", NULL, is_need_effect, TEXT_NO_CR); } } } @@ -1144,8 +1145,8 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -1155,8 +1156,7 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout(Evas_Object *noti_box, notification_h noti, - notification_ly_type_e layout) +static void _noti_box_set_layout(Evas_Object *noti_box, notification_h noti, notification_ly_type_e layout) { DBG("notification box layout:%d", layout); @@ -1235,8 +1235,7 @@ HAPI void *quickpanel_noti_box_node_get(Evas_Object *noti_box) } #ifdef QP_SCREENREADER_ENABLE -static void -_noti_box_focus_selected_cb(void *data, Evas_Object *obj, void *event_info) +static void _noti_box_focus_selected_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *noti_box = data; retif(noti_box == NULL, , "invalid parameter"); @@ -1246,8 +1245,7 @@ _noti_box_focus_selected_cb(void *data, Evas_Object *obj, void *event_info) } #endif -HAPI void quickpanel_noti_box_set_item_selected_cb(Evas_Object *noti_box, - void(*selected_cb)(void *data, Evas_Object *obj)) +HAPI void quickpanel_noti_box_set_item_selected_cb(Evas_Object *noti_box, void(*selected_cb)(void *data, Evas_Object *obj)) { retif(noti_box == NULL, , "invalid parameter"); retif(selected_cb == NULL, , "invalid parameter"); @@ -1264,8 +1262,7 @@ HAPI void quickpanel_noti_box_set_item_selected_cb(Evas_Object *noti_box, #endif } -HAPI void quickpanel_noti_box_set_item_button_1_cb(Evas_Object *noti_box, - void(*button_1_cb)(void *data, Evas_Object *obj)) +HAPI void quickpanel_noti_box_set_item_button_1_cb(Evas_Object *noti_box, void(*button_1_cb)(void *data, Evas_Object *obj)) { retif(noti_box == NULL, , "invalid parameter"); retif(button_1_cb == NULL, , "invalid parameter"); @@ -1273,8 +1270,7 @@ HAPI void quickpanel_noti_box_set_item_button_1_cb(Evas_Object *noti_box, evas_object_data_set(noti_box, E_DATA_CB_BUTTON_1, button_1_cb); } -HAPI void quickpanel_noti_box_set_item_deleted_cb(Evas_Object *noti_box, - void(*deleted_cb)(void *data, Evas_Object *obj)) +HAPI void quickpanel_noti_box_set_item_deleted_cb(Evas_Object *noti_box, void(*deleted_cb)(void *data, Evas_Object *obj)) { retif(noti_box == NULL, , "invalid parameter"); retif(deleted_cb == NULL, , "invalid parameter"); diff --git a/daemon/notifications/noti_box.h b/daemon/notifications/noti_box.h index a745d58..d2a343b 100755 --- a/daemon/notifications/noti_box.h +++ b/daemon/notifications/noti_box.h @@ -19,9 +19,6 @@ #ifndef __QUICKPANEL_NOTI_BOX_H__ #define __QUICKPANEL_NOTI_BOX_H__ -#include <notification.h> -#include "vi_manager.h" - #define E_DATA_NOTI_BOX_H "noti_box" #define E_DATA_CB_SELECTED_ITEM "noti_box_cb_selected" #define E_DATA_CB_BUTTON_1 "noti_box_cb_button_1" @@ -53,16 +50,13 @@ typedef struct _noti_box_h { qp_notibox_state_type state; } noti_box_h; -Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_ly_type_e layout); -void quickpanel_noti_box_node_set(Evas_Object *noti_box, void *noti_node); -void *quickpanel_noti_box_node_get(Evas_Object *noti_box); -void quickpanel_noti_box_remove(Evas_Object *noti_box); -void quickpanel_noti_box_set_item_selected_cb(Evas_Object *noti_box, - void(*selected_cb)(void *data, Evas_Object *obj)); -void quickpanel_noti_box_set_item_button_1_cb(Evas_Object *noti_box, - void(*button_1_cb)(void *data, Evas_Object *obj)); -void quickpanel_noti_box_set_item_deleted_cb(Evas_Object *noti_box, - void(*deleted_cb)(void *data, Evas_Object *obj)); -void quickpanel_noti_box_item_dragging_cancel(Evas_Object *noti_box); -void quickpanel_noti_box_item_update(Evas_Object *noti_box); +extern Evas_Object *quickpanel_noti_box_create(Evas_Object *parent, notification_ly_type_e layout); +extern void quickpanel_noti_box_node_set(Evas_Object *noti_box, void *noti_node); +extern void *quickpanel_noti_box_node_get(Evas_Object *noti_box); +extern void quickpanel_noti_box_remove(Evas_Object *noti_box); +extern void quickpanel_noti_box_set_item_selected_cb(Evas_Object *noti_box, void(*selected_cb)(void *data, Evas_Object *obj)); +extern void quickpanel_noti_box_set_item_button_1_cb(Evas_Object *noti_box, void(*button_1_cb)(void *data, Evas_Object *obj)); +extern void quickpanel_noti_box_set_item_deleted_cb(Evas_Object *noti_box, void(*deleted_cb)(void *data, Evas_Object *obj)); +extern void quickpanel_noti_box_item_dragging_cancel(Evas_Object *noti_box); +extern void quickpanel_noti_box_item_update(Evas_Object *noti_box); #endif diff --git a/daemon/notifications/noti_gridbox.c b/daemon/notifications/noti_gridbox.c index 3253bdd..9f98d15 100755 --- a/daemon/notifications/noti_gridbox.c +++ b/daemon/notifications/noti_gridbox.c @@ -15,14 +15,21 @@ * */ +#include <Elementary.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <E_DBus.h> #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" #include "noti_gridbox.h" -#include "noti_box.h" #include "vi_manager.h" +#include "noti_box.h" #define E_DATA_LAYOUT_PORTRAIT "layout_portrait" #define E_DATA_LAYOUT_LANDSCAPE "layout_landscape" @@ -75,10 +82,10 @@ static void _gridbox_layout_get_pos(int order, int *x, int *y, void *data) int column = (order - 1) - (row * n_per_row); int row_x = info_layout->padding_left - + ((info_layout->child_w + info_layout->padding_between) * column); + + ((info_layout->child_w + info_layout->padding_between) * column); int row_y = info_layout->padding_top - + ((info_layout->child_h + info_layout->padding_between) * row); + + ((info_layout->child_h + info_layout->padding_between) * row); if (x != NULL) { *x = row_x; @@ -89,8 +96,7 @@ static void _gridbox_layout_get_pos(int order, int *x, int *y, void *data) } } -static void _gridbox_layout_get_coord(Evas_Object *gridbox, int num_child, int index, - void *layout_data, int *coord_x, int *coord_y) +static void _gridbox_layout_get_coord(Evas_Object *gridbox, int num_child, int index, void *layout_data, int *coord_x, int *coord_y) { int x, y, w, h; int off_x = 0, off_y = 0; @@ -130,8 +136,7 @@ static void _gridbox_layout_get_coord(Evas_Object *gridbox, int num_child, int i } } -static void _gridbox_layout(Evas_Object *o, Evas_Object_Box_Data *priv, - void *data) +static void _gridbox_layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) { int n_children; int x, y; @@ -267,8 +272,7 @@ HAPI void quickpanel_noti_gridbox_remove(Evas_Object *gridbox) } } -HAPI void quickpanel_noti_gridbox_set_item_deleted_cb(Evas_Object *gridbox, - void(*deleted_cb)(void *data, Evas_Object *obj)) +HAPI void quickpanel_noti_gridbox_set_item_deleted_cb(Evas_Object *gridbox, void(*deleted_cb)(void *data, Evas_Object *obj)) { retif(gridbox == NULL, , "invalid parameter"); retif(deleted_cb == NULL, , "invalid parameter"); @@ -276,9 +280,8 @@ HAPI void quickpanel_noti_gridbox_set_item_deleted_cb(Evas_Object *gridbox, evas_object_data_set(gridbox, E_DATA_CB_DELETE_ITEM, deleted_cb); } -static void _gridbox_call_item_deleted_cb(Evas_Object *gridbox, void *data, - Evas_Object *obj) - { +static void _gridbox_call_item_deleted_cb(Evas_Object *gridbox, void *data, Evas_Object *obj) +{ retif(gridbox == NULL, , "invalid parameter"); void (*deleted_cb)(void *data, Evas_Object *obj) = NULL; @@ -704,9 +707,7 @@ HAPI void quickpanel_noti_gridbox_update_item(Evas_Object *gridbox, Evas_Object quickpanel_vi_start(vi); } -HAPI void quickpanel_noti_gridbox_remove_and_add_item(Evas_Object *gridbox, Evas_Object *item - ,void (*update_cb)(Evas_Object *list, void *data, int is_prepend) - ,void *container, void *data, int pos) +HAPI void quickpanel_noti_gridbox_remove_and_add_item(Evas_Object *gridbox, Evas_Object *item ,void (*update_cb)(Evas_Object *list, void *data, int is_prepend) ,void *container, void *data, int pos) { QP_VI *vi = NULL; retif(gridbox == NULL, , "invalid parameter"); @@ -922,8 +923,7 @@ static Eina_Bool _anim_done_cb(void *data) return EINA_TRUE; } -HAPI int quickpanel_noti_gridbox_get_geometry(Evas_Object *gridbox, - int *limit_h, int *limit_partial_h, int *limit_partial_w) +HAPI int quickpanel_noti_gridbox_get_geometry(Evas_Object *gridbox, int *limit_h, int *limit_partial_h, int *limit_partial_w) { int count = 0; diff --git a/daemon/notifications/noti_gridbox.h b/daemon/notifications/noti_gridbox.h index 5e697a4..ea36e65 100755 --- a/daemon/notifications/noti_gridbox.h +++ b/daemon/notifications/noti_gridbox.h @@ -22,21 +22,17 @@ #define GRIDBOX_PREPEND 1 #define GRIDBOX_APPEND 0 -Evas_Object *quickpanel_noti_gridbox_create(Evas_Object *parent, void *data); -void quickpanel_noti_gridbox_remove(Evas_Object *gridbox); -void quickpanel_noti_gridbox_add_item(Evas_Object *gridbox, Evas_Object *item, int is_prepend); -void quickpanel_noti_gridbox_remove_item(Evas_Object *gridbox, Evas_Object *item, int with_animation); -void quickpanel_noti_gridbox_rotation(Evas_Object *gridbox, int angle); -void quickpanel_noti_gridbox_remove_and_add_item(Evas_Object *gridbox, Evas_Object *item - ,void (*update_cb)(Evas_Object *list, void *data, int is_prepend) - ,void *container, void *data, int pos); -void quickpanel_noti_gridbox_remove_all_item(Evas_Object *gridbox, int with_animation); -void quickpanel_noti_gridbox_set_item_deleted_cb(Evas_Object *gridbox, - void(*deleted_cb)(void *data, Evas_Object *obj)); -int quickpanel_noti_gridbox_get_item_count(Evas_Object *gridbox); -int quickpanel_noti_gridbox_get_geometry(Evas_Object *gridbox, - int *limit_h, int *limit_partial_h, int *limit_partial_w); -void quickpanel_noti_gridbox_update_item(Evas_Object *gridbox, Evas_Object *item); -void quickpanel_noti_gridbox_closing_trigger_set(Evas_Object *gridbox); -int quickpanel_noti_gridbox_get_item_exist(Evas_Object *gridbox, Evas_Object *box); +extern Evas_Object *quickpanel_noti_gridbox_create(Evas_Object *parent, void *data); +extern void quickpanel_noti_gridbox_remove(Evas_Object *gridbox); +extern void quickpanel_noti_gridbox_add_item(Evas_Object *gridbox, Evas_Object *item, int is_prepend); +extern void quickpanel_noti_gridbox_remove_item(Evas_Object *gridbox, Evas_Object *item, int with_animation); +extern void quickpanel_noti_gridbox_rotation(Evas_Object *gridbox, int angle); +extern void quickpanel_noti_gridbox_remove_and_add_item(Evas_Object *gridbox, Evas_Object *item ,void (*update_cb)(Evas_Object *list, void *data, int is_prepend) ,void *container, void *data, int pos); +extern void quickpanel_noti_gridbox_remove_all_item(Evas_Object *gridbox, int with_animation); +extern void quickpanel_noti_gridbox_set_item_deleted_cb(Evas_Object *gridbox, void(*deleted_cb)(void *data, Evas_Object *obj)); +extern int quickpanel_noti_gridbox_get_item_count(Evas_Object *gridbox); +extern int quickpanel_noti_gridbox_get_geometry(Evas_Object *gridbox, int *limit_h, int *limit_partial_h, int *limit_partial_w); +extern void quickpanel_noti_gridbox_update_item(Evas_Object *gridbox, Evas_Object *item); +extern void quickpanel_noti_gridbox_closing_trigger_set(Evas_Object *gridbox); +extern int quickpanel_noti_gridbox_get_item_exist(Evas_Object *gridbox, Evas_Object *box); #endif diff --git a/daemon/notifications/noti_list_item.c b/daemon/notifications/noti_list_item.c index 5eaf40d..9bd2009 100755 --- a/daemon/notifications/noti_list_item.c +++ b/daemon/notifications/noti_list_item.c @@ -16,24 +16,37 @@ */ +#include <Elementary.h> #include <string.h> +#include <glib.h> + +#include <vconf.h> #include <notification.h> +#include <notification_internal.h> +#include <notification_ongoing_flag.h> +#include <system_settings.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" -#include "noti_list_item.h" +#include "vi_manager.h" #include "noti_node.h" +#include "noti_list_item.h" #include "noti.h" #include "noti_util.h" +#include "animated_icon.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" extern Noti_View_H noti_view_h; extern Noti_View_H ongoing_noti_view_h; @@ -64,18 +77,25 @@ static struct _info { static int _is_item_deletable_by_gesture(noti_list_item_h *handler) { notification_type_e type = NOTIFICATION_TYPE_NONE; + notification_ly_type_e ly_type = NOTIFICATION_LY_NONE; + retif(handler == NULL, 0, "Invalid parameter!"); retif(handler->noti_node == NULL, 0, "Invalid parameter!"); retif(handler->noti_node->noti == NULL, 0, "Invalid parameter!"); + bool ongoing_flag = false; notification_h noti = handler->noti_node->noti; + notification_get_type(noti, &type); + notification_get_layout(noti, &ly_type); + notification_get_ongoing_flag(noti, &ongoing_flag); - if (type == NOTIFICATION_TYPE_NOTI) { - return 1; + if( (type == NOTIFICATION_TYPE_ONGOING && ongoing_flag) || + (type == NOTIFICATION_TYPE_ONGOING && ly_type == NOTIFICATION_LY_ONGOING_PROGRESS)) { + return 0; } - return 0; + return 1; } static void _item_handler_set(Evas_Object *item, noti_list_item_h *handler) @@ -163,26 +183,6 @@ static void _signal_cb(void *data, Evas_Object *o, const char *emission, const c _response_callback_call(o, emission); } -static Eina_Bool _drag_cancel_cb(void *data) { - QP_VI *vi = data; - noti_list_item_h *handler = NULL; - retif(vi == NULL, EINA_FALSE, "invalid parameter"); - - if (vi->target != NULL) { - DBG("Canceling dragging"); - - handler = _item_handler_get(vi->target); - retif(handler == NULL, EINA_FALSE, "handler is NULL"); - - handler->state = NOTILISTITEM_STATE_GETSTURE_CANCELED; - evas_object_map_enable_set(vi->target, EINA_FALSE); - - handler->vi = NULL; - } - - return EINA_TRUE; -} - void static _mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { int w = 0, h = 0; @@ -256,7 +256,7 @@ static void _mouse_move_cb(void* data, Evas* e, Evas_Object* obj, void* event_in NULL, NULL, NULL, - NULL, //_drag_cancel_cb, + NULL, vi, NULL, 0, @@ -286,9 +286,8 @@ static void _mouse_move_cb(void* data, Evas* e, Evas_Object* obj, void* event_in static void _mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { int x = 0; - noti_list_item_h *handler = NULL; - Elm_Transit *transit_flick = NULL; - //double scale = elm_config_scale_get(); + noti_list_item_h *handler; + handler = _item_handler_get(obj); retif(handler == NULL, , "handler is NULL"); @@ -300,17 +299,18 @@ static void _mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info } if (handler->state == NOTILISTITEM_STATE_GETSTURE_WAIT) { - if (abs(handler->distance) >= (THRESHOLD_DISTANCE - 10) - && _is_item_deletable_by_gesture(handler) == 1) { + if (abs(handler->distance) >= (THRESHOLD_DISTANCE - 10) && _is_item_deletable_by_gesture(handler) == 1) { x = abs(handler->distance) - THRESHOLD_DELETE_START; if (handler->distance > 0) { + Elm_Transit *transit_flick; + evas_object_map_set(obj, NULL); transit_flick = elm_transit_add(); if (transit_flick != NULL) { elm_transit_effect_translation_add(transit_flick, x, 0, 480, 0); elm_transit_object_add(transit_flick, obj); - elm_transit_duration_set(transit_flick, 0.25 * (480 - x ) / 480); + elm_transit_duration_set(transit_flick, 0.25 * (480 - x ) / 480); elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); elm_transit_go(transit_flick); @@ -318,12 +318,14 @@ static void _mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info _response_callback_call(obj, "deleted"); } } else if (handler->distance < 0) { + Elm_Transit *transit_flick; + evas_object_map_set(obj, NULL); transit_flick = elm_transit_add(); if (transit_flick != NULL) { elm_transit_effect_translation_add(transit_flick, -x, 0, -480, 0); elm_transit_object_add(transit_flick, obj); - elm_transit_duration_set(transit_flick, 0.25 * ( 480 - x ) / 480); + elm_transit_duration_set(transit_flick, 0.25 * ( 480 - x ) / 480); elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); elm_transit_go(transit_flick); @@ -351,15 +353,13 @@ static void _mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info handler->state = NOTILISTITEM_STATE_NORMAL; } -static Evas_Event_Flags -_flick_end_cb(void *data, void *event_info) +static Evas_Event_Flags _flick_end_cb(void *data, void *event_info) { int x = 0; noti_list_item_h *handler = NULL; Evas_Object *view = NULL; Elm_Transit *transit_flick = NULL; Elm_Gesture_Momentum_Info *info = (Elm_Gesture_Momentum_Info *)event_info; - //double scale = elm_config_scale_get(); view = (Evas_Object *)data; handler = _item_handler_get(view); @@ -381,7 +381,7 @@ _flick_end_cb(void *data, void *event_info) if (transit_flick != NULL) { elm_transit_effect_translation_add(transit_flick, x, 0, 480, 0); elm_transit_object_add(transit_flick, view); - elm_transit_duration_set(transit_flick, 0.25 * (480 - x ) /480); + elm_transit_duration_set(transit_flick, 0.25 * (480 - x ) /480); elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); elm_transit_go(transit_flick); @@ -395,7 +395,7 @@ _flick_end_cb(void *data, void *event_info) if (transit_flick != NULL) { elm_transit_effect_translation_add(transit_flick, -x, 0, -480, 0); elm_transit_object_add(transit_flick, view); - elm_transit_duration_set(transit_flick, 0.25 * ( 480 - x ) / 480); + elm_transit_duration_set(transit_flick, 0.25 * ( 480 - x ) / 480); elm_transit_tween_mode_set(transit_flick, ELM_TRANSIT_TWEEN_MODE_LINEAR); elm_transit_objects_final_state_keep_set(transit_flick, EINA_TRUE); elm_transit_go(transit_flick); @@ -441,7 +441,7 @@ HAPI Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notifica "edje", _signal_cb, parent - ); + ); //add event elm_object_signal_callback_add(view, @@ -449,7 +449,7 @@ HAPI Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notifica "edje", _signal_cb, parent - ); + ); //add event elm_object_signal_callback_add(view, @@ -457,7 +457,7 @@ HAPI Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notifica "edje", _signal_cb, parent - ); + ); DBG("created box:%p", view); @@ -472,7 +472,7 @@ HAPI Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notifica elm_gesture_layer_cb_set(gl, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, _flick_end_cb, view); } else { ERR("failed to create notification view(%s)" - , s_info.view_handlers[layout]->name); + , s_info.view_handlers[layout]->name); } return view; @@ -499,7 +499,7 @@ HAPI void quickpanel_noti_list_item_remove(Evas_Object *item) noti_list_item_h *handler = _item_handler_get(item); if (handler != NULL) { retif(s_info.view_handlers[handler->layout] == NULL, , "invalid parameter"); - + if (s_info.view_handlers[handler->layout] != NULL) { if (s_info.view_handlers[handler->layout]->remove != NULL) { noti_node_item *noti_node = _get_noti_node(item); diff --git a/daemon/notifications/noti_list_item.h b/daemon/notifications/noti_list_item.h index 6573c0a..616579b 100755 --- a/daemon/notifications/noti_list_item.h +++ b/daemon/notifications/noti_list_item.h @@ -19,10 +19,6 @@ #ifndef __QUICKPANEL_NOTI_LIST_ITEM_H__ #define __QUICKPANEL_NOTI_LIST_ITEM_H__ -#include <notification.h> -#include "noti_node.h" -#include "vi_manager.h" - #define STATE_NORMAL 1 #define STATE_DELETING 0 @@ -70,18 +66,18 @@ typedef struct _noti_list_item_h { qp_notilistitem_state_type state; } noti_list_item_h; -Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notification_h noti); -void quickpanel_noti_list_item_update(Evas_Object *item); -void quickpanel_noti_list_item_remove(Evas_Object *item); +extern Evas_Object *quickpanel_noti_list_item_create(Evas_Object *parent, notification_h noti); +extern void quickpanel_noti_list_item_update(Evas_Object *item); +extern void quickpanel_noti_list_item_remove(Evas_Object *item); -void quickpanel_noti_list_item_node_set(Evas_Object *item, noti_node_item *noti_node); -void *quickpanel_noti_list_item_node_get(Evas_Object *item); -int quickpanel_noti_list_item_get_status(Evas_Object *item); -void quickpanel_noti_list_item_set_status(Evas_Object *item, int status); +extern void quickpanel_noti_list_item_node_set(Evas_Object *item, noti_node_item *noti_node); +extern void *quickpanel_noti_list_item_node_get(Evas_Object *item); +extern int quickpanel_noti_list_item_get_status(Evas_Object *item); +extern void quickpanel_noti_list_item_set_status(Evas_Object *item, int status); -void quickpanel_noti_list_item_set_item_selected_cb(Evas_Object *item, response_cb selected_cb); -void quickpanel_noti_list_item_set_item_button_1_cb(Evas_Object *item, response_cb callback); -void quickpanel_noti_list_item_set_item_deleted_cb(Evas_Object *item, response_cb callback); +extern void quickpanel_noti_list_item_set_item_selected_cb(Evas_Object *item, response_cb selected_cb); +extern void quickpanel_noti_list_item_set_item_button_1_cb(Evas_Object *item, response_cb callback); +extern void quickpanel_noti_list_item_set_item_deleted_cb(Evas_Object *item, response_cb callback); -noti_list_item_h *quickpanel_noti_list_item_handler_get(Evas_Object *item); +extern noti_list_item_h *quickpanel_noti_list_item_handler_get(Evas_Object *item); #endif diff --git a/daemon/notifications/noti_listbox.c b/daemon/notifications/noti_listbox.c index 9066fd4..9c9fdee 100755 --- a/daemon/notifications/noti_listbox.c +++ b/daemon/notifications/noti_listbox.c @@ -15,14 +15,25 @@ * */ +#include <Elementary.h> +#include <glib.h> + +#include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <system_settings.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" +#include "common_uic.h" #include "list_util.h" #include "quickpanel_def.h" #include "noti_listbox.h" -#include "noti_list_item.h" #include "vi_manager.h" +#include "noti_node.h" +#include "noti_list_item.h" #include "noti.h" #define E_DATA_LAYOUT_PORTRAIT "layout_portrait" @@ -41,7 +52,7 @@ static void _listbox_flag_set(Evas_Object *container, const char *key, int value retif(container == NULL, , "invalid parameter"); retif(key == NULL, , "invalid parameter"); - evas_object_data_set(container, key, (void *)value); + evas_object_data_set(container, key, (void *)(long)value); } static int _listbox_flag_get(Evas_Object *container, const char *key) @@ -49,7 +60,7 @@ static int _listbox_flag_get(Evas_Object *container, const char *key) retif(container == NULL, 0, "invalid parameter"); retif(key == NULL, 0, "invalid parameter"); - return (int)evas_object_data_get(container, key); + return (int)(long)evas_object_data_get(container, key); } static int _listbox_layout_item_valid(Evas_Object *container, Evas_Object *item) @@ -69,8 +80,7 @@ static int _listbox_layout_item_valid(Evas_Object *container, Evas_Object *item) return ret; } -static void _listbox_layout_get_coord(Evas_Object *container, int insert_position, - int *coord_x, int *coord_y, Evas_Object *noti_section) +static void _listbox_layout_get_coord(Evas_Object *container, int insert_position, int *coord_x, int *coord_y, Evas_Object *noti_section) { int x, y, h; int off_y = 0; @@ -211,8 +221,7 @@ HAPI void quickpanel_noti_listbox_remove(Evas_Object *listbox) listbox = NULL; } -HAPI void quickpanel_noti_listbox_set_item_deleted_cb(Evas_Object *listbox, - void(*deleted_cb)(void *data, Evas_Object *obj)) +HAPI void quickpanel_noti_listbox_set_item_deleted_cb(Evas_Object *listbox, void(*deleted_cb)(void *data, Evas_Object *obj)) { retif(listbox == NULL, , "invalid parameter"); retif(deleted_cb == NULL, , "invalid parameter"); @@ -220,8 +229,7 @@ HAPI void quickpanel_noti_listbox_set_item_deleted_cb(Evas_Object *listbox, evas_object_data_set(listbox, E_DATA_CB_DELETE_ITEM, deleted_cb); } -static void _listbox_call_item_deleted_cb(Evas_Object *listbox, void *data, - Evas_Object *obj) +static void _listbox_call_item_deleted_cb(Evas_Object *listbox, void *data, Evas_Object *obj) { retif(listbox == NULL, , "invalid parameter"); @@ -731,13 +739,13 @@ static void _anim_job_delete(void *data) if (transit_layout_parent != NULL) { elm_transit_del_cb_set(transit_layout_parent, quickpanel_vi_done_cb_for_transit, - vi); + vi); } else if (transit_layout != NULL) { elm_transit_del_cb_set(transit_layout, quickpanel_vi_done_cb_for_transit, - vi); + vi); } else if (transit_fadeout != NULL) { elm_transit_del_cb_set(transit_fadeout, quickpanel_vi_done_cb_for_transit, - vi); + vi); } else { ERR("Failed to create all the transit"); quickpanel_vi_done(vi); @@ -869,8 +877,7 @@ static Eina_Bool _anim_done_cb(void *data) return EINA_TRUE; } -HAPI int quickpanel_noti_listbox_get_geometry(Evas_Object *listbox, - int *limit_h, int *limit_partial_h, int *limit_partial_w) +HAPI int quickpanel_noti_listbox_get_geometry(Evas_Object *listbox, int *limit_h, int *limit_partial_h, int *limit_partial_w) { int x = 0, y = 0, w = 0, h = 0; diff --git a/daemon/notifications/noti_listbox.h b/daemon/notifications/noti_listbox.h index 8f414e8..608213f 100755 --- a/daemon/notifications/noti_listbox.h +++ b/daemon/notifications/noti_listbox.h @@ -19,26 +19,22 @@ #ifndef __QUICKPANEL_NOTI_LISTBOX_H__ #define __QUICKPANEL_NOTI_LISTBOX_H__ -#include "list_util.h" - #define LISTBOX_INSERT_AFTER -1 #define LISTBOX_PREPEND 1 #define LISTBOX_APPEND 0 -Evas_Object *quickpanel_noti_listbox_create(Evas_Object *parent, void *data, qp_item_type_e item_type); -void quickpanel_noti_listbox_remove(Evas_Object *listbox); -void quickpanel_noti_listbox_add_item(Evas_Object *listbox, Evas_Object *item, int is_prepend, Evas_Object *noti_section); -void quickpanel_noti_listbox_remove_item(Evas_Object *listbox, Evas_Object *item, int with_animation); -void quickpanel_noti_listbox_rotation(Evas_Object *listbox, int angle); -void quickpanel_noti_listbox_remove_all_item(Evas_Object *listbox, int with_animation); -void quickpanel_noti_listbox_set_item_deleted_cb(Evas_Object *listbox, - void(*deleted_cb)(void *data, Evas_Object *obj)); -void quickpanel_noti_listbox_update(Evas_Object *listbox); -void quickpanel_noti_listbox_update_item(Evas_Object *listbox, Evas_Object *item); -int quickpanel_noti_listbox_get_item_count(Evas_Object *listbox); -void quickpanel_noti_listbox_items_visibility_set(Evas_Object *listbox, int is_visible); -int quickpanel_noti_listbox_get_geometry(Evas_Object *listbox, - int *limit_h, int *limit_partial_h, int *limit_partial_w); -void quickpanel_noti_listbox_closing_trigger_set(Evas_Object *listbox); +extern Evas_Object *quickpanel_noti_listbox_create(Evas_Object *parent, void *data, qp_item_type_e item_type); +extern void quickpanel_noti_listbox_remove(Evas_Object *listbox); +extern void quickpanel_noti_listbox_add_item(Evas_Object *listbox, Evas_Object *item, int is_prepend, Evas_Object *noti_section); +extern void quickpanel_noti_listbox_remove_item(Evas_Object *listbox, Evas_Object *item, int with_animation); +extern void quickpanel_noti_listbox_rotation(Evas_Object *listbox, int angle); +extern void quickpanel_noti_listbox_remove_all_item(Evas_Object *listbox, int with_animation); +extern void quickpanel_noti_listbox_set_item_deleted_cb(Evas_Object *listbox, void(*deleted_cb)(void *data, Evas_Object *obj)); +extern void quickpanel_noti_listbox_update(Evas_Object *listbox); +extern void quickpanel_noti_listbox_update_item(Evas_Object *listbox, Evas_Object *item); +extern int quickpanel_noti_listbox_get_item_count(Evas_Object *listbox); +extern void quickpanel_noti_listbox_items_visibility_set(Evas_Object *listbox, int is_visible); +extern int quickpanel_noti_listbox_get_geometry(Evas_Object *listbox, int *limit_h, int *limit_partial_h, int *limit_partial_w); +extern void quickpanel_noti_listbox_closing_trigger_set(Evas_Object *listbox); #endif diff --git a/daemon/notifications/noti_node.c b/daemon/notifications/noti_node.c index 763d6a8..89ad802 100755 --- a/daemon/notifications/noti_node.c +++ b/daemon/notifications/noti_node.c @@ -15,6 +15,14 @@ * */ +#include <Elementary.h> +#include <glib.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <notification_internal.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" @@ -30,10 +38,7 @@ HAPI void quickpanel_noti_node_create(noti_node **handle) *handle = (noti_node *)malloc(sizeof(noti_node)); if (*handle != NULL) { - (*handle)->table = g_hash_table_new_full(g_direct_hash, g_direct_equal, - NULL, - (GDestroyNotify)_noti_node_free); - + (*handle)->table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)_noti_node_free); (*handle)->n_ongoing = 0; (*handle)->n_noti = 0; } else { @@ -135,8 +140,7 @@ HAPI noti_node_item *quickpanel_noti_node_get(noti_node *handle, int priv_id) retif(handle == NULL, NULL, "Invalid parameter!"); retif(handle->table == NULL, NULL, "Invalid parameter!"); - return (noti_node_item *)g_hash_table_lookup - (handle->table, GINT_TO_POINTER(priv_id)); + return (noti_node_item *)g_hash_table_lookup(handle->table, GINT_TO_POINTER(priv_id)); } HAPI int quickpanel_noti_node_get_item_count(noti_node *handle, notification_type_e noti_type) diff --git a/daemon/notifications/noti_node.h b/daemon/notifications/noti_node.h index 9ebdce6..ffa11c3 100755 --- a/daemon/notifications/noti_node.h +++ b/daemon/notifications/noti_node.h @@ -19,9 +19,6 @@ #ifndef __QUICKPANEL_NOTI_NODE_H__ #define __QUICKPANEL_NOTI_NODE_H__ -#include <glib.h> -#include <notification.h> - typedef struct _noti_node { GHashTable *table; int n_ongoing; @@ -33,12 +30,13 @@ typedef struct _noti_node_item { void *view; } noti_node_item; -void quickpanel_quickpanel_noti_node_create(noti_node **handle); -void quickpanel_noti_node_destroy(noti_node **handle); -noti_node_item *quickpanel_noti_node_add(noti_node *handle, notification_h noti, void *view); -void quickpanel_noti_node_remove(noti_node *handle, int priv_id); -void quickpanel_noti_node_remove_all(noti_node *handle); -noti_node_item *quickpanel_noti_node_get(noti_node *handle, int priv_id); -int quickpanel_noti_node_get_item_count(noti_node *handle, notification_type_e noti_type); +extern void quickpanel_quickpanel_noti_node_create(noti_node **handle); +extern void quickpanel_noti_node_destroy(noti_node **handle); +extern noti_node_item *quickpanel_noti_node_add(noti_node *handle, notification_h noti, void *view); +extern void quickpanel_noti_node_remove(noti_node *handle, int priv_id); +extern void quickpanel_noti_node_remove_all(noti_node *handle); +extern noti_node_item *quickpanel_noti_node_get(noti_node *handle, int priv_id); +extern int quickpanel_noti_node_get_item_count(noti_node *handle, notification_type_e noti_type); +extern void quickpanel_noti_node_create(noti_node **handle); #endif diff --git a/daemon/notifications/noti_section.c b/daemon/notifications/noti_section.c index 64fe30a..8738a14 100755 --- a/daemon/notifications/noti_section.c +++ b/daemon/notifications/noti_section.c @@ -16,36 +16,46 @@ */ +#include <Elementary.h> +#include <glib.h> + +#include <vconf.h> #include <notification.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <system_settings.h> +#include <E_DBus.h> + #include "quickpanel-ui.h" #include "quickpanel_def.h" +#include "common_uic.h" #include "common.h" +#include "noti_node.h" #include "noti.h" -#include "noti_section.h" #include "list_util.h" +#include "noti_section.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif - #define NOTI_CLEAR_ALL_SECTION "quickpanel/notisection/clear_all" - #define NOTI_DEFAULT_SECTION "quickpanel/notisection/default" +#define NOTI_CLEAR_ALL_SECTION "quickpanel/notisection/clear_all" +#define NOTI_DEFAULT_SECTION "quickpanel/notisection/default" static void _noti_section_set_text(Evas_Object *noti_section, int count) { -#ifdef QP_SCREENREADER_ENABLE - Evas_Object *ao = NULL; -#endif - - DBG("count is : %d ", count); + char text[128] = { 0, }; + char *format; + const char *old_text; - char text[128] = {0,}; - char *format = NULL; - const char *old_text = NULL; - - retif(noti_section == NULL, , "invalid parameter"); + if (!noti_section) { + ERR("Invalid parameter"); + return; + } + DBG("count is : %d ", count); format = _("IDS_QP_HEADER_NOTIFICATIONS_HPD_ABB"); - snprintf(text, sizeof(text), format, count); + snprintf(text, sizeof(text) - 1, format, count); old_text = elm_object_part_text_get(noti_section, "elm.text.notifications_number"); if (old_text != NULL) { @@ -55,9 +65,9 @@ static void _noti_section_set_text(Evas_Object *noti_section, int count) } #ifdef QP_SCREENREADER_ENABLE - ao = quickpanel_accessibility_screen_reader_object_get(noti_section, - SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus.label", noti_section); + Evas_Object *ao; + ao = quickpanel_accessibility_screen_reader_object_get(noti_section, SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus.label", noti_section); if (ao != NULL) { elm_access_info_set(ao, ELM_ACCESS_TYPE, ""); elm_access_info_set(ao, ELM_ACCESS_INFO, text); @@ -65,47 +75,56 @@ static void _noti_section_set_text(Evas_Object *noti_section, int count) #endif DBG("Trying to set text :%s ", text); - elm_object_part_text_set(noti_section, "elm.text.notifications_number", text); elm_object_part_text_set(noti_section, "text.button.clear_all", _("IDS_QP_HEADER_CLEAR_ALL_ABB")); } HAPI Evas_Object *quickpanel_noti_section_create(Evas_Object *parent, qp_item_type_e type) { - Eina_Bool ret = EINA_FALSE; - Evas_Object *section = NULL; - - struct appdata *ad = quickpanel_get_app_data(); - retif(ad == NULL, NULL, "invalid parameter"); - retif(parent == NULL, NULL, "invalid parameter"); + Evas_Object *section; + Evas_Object *focus; + struct appdata *ad; + qp_item_data *qid; + Eina_Bool ret; + + ad = quickpanel_get_app_data(); + if (!ad || !parent) { + ERR("Invalid parameter"); + return NULL; + } section = elm_layout_add(parent); - if (type == QP_ITEM_TYPE_ONGOING_NOTI_GROUP) { - ret = elm_layout_file_set(section, DEFAULT_EDJ, - NOTI_CLEAR_ALL_SECTION); - } else { //in higgs there is only one type of notifications - ret = elm_layout_file_set(section, DEFAULT_EDJ, - NOTI_CLEAR_ALL_SECTION); + ret = elm_layout_file_set(section, DEFAULT_EDJ, NOTI_CLEAR_ALL_SECTION); + if (ret == EINA_FALSE) { + ERR("Failed to set a file"); + evas_object_del(section); + return NULL; } - retif(ret == EINA_FALSE, NULL, "failed to load layout"); evas_object_size_hint_weight_set(section, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(section, EVAS_HINT_FILL, EVAS_HINT_FILL); quickpanel_uic_initial_resize(section, QP_THEME_LIST_ITEM_NOTI_SECTION_HEIGHT); evas_object_show(section); - qp_item_data *qid - = quickpanel_list_util_item_new(type, NULL); + qid = quickpanel_list_util_item_new(type, NULL); + if (!qid) { + ERR("Unable to create a qid"); + evas_object_del(section); + return NULL; + } quickpanel_list_util_item_set_tag(section, qid); quickpanel_list_util_sort_insert(ad->list, section); - Evas_Object *focus = quickpanel_accessibility_ui_get_focus_object(section); + focus = quickpanel_accessibility_ui_get_focus_object(section); + if (!focus) { + ERR("Unable to get the focus object"); + quickpanel_list_util_item_del(qid); + evas_object_del(section); + return NULL; + } elm_object_part_content_set(section, "focus", focus); evas_object_smart_callback_add(focus, "clicked", quickpanel_noti_on_clear_all_clicked, NULL); - focus = quickpanel_accessibility_ui_get_focus_object(section); - elm_object_part_content_set(section, "focus.label", focus); - return section; } diff --git a/daemon/notifications/noti_section.h b/daemon/notifications/noti_section.h index cf0c60e..b9beec9 100755 --- a/daemon/notifications/noti_section.h +++ b/daemon/notifications/noti_section.h @@ -18,12 +18,9 @@ #ifndef __QUICKPANEL_NOTI_SECTION_H__ #define __QUICKPANEL_NOTI_SECTION_H__ -#include "list_util.h" +extern Evas_Object *quickpanel_noti_section_create(Evas_Object *parent, qp_item_type_e type); +extern void quickpanel_noti_section_update(Evas_Object *noti_section, int noti_count); +extern void quickpanel_noti_section_remove(Evas_Object *noti_section) ; +extern void quickpanel_noti_section_set_deleted_cb(Evas_Object *noti_section, Evas_Object_Event_Cb func, void *data); -Evas_Object *quickpanel_noti_section_create(Evas_Object *parent, qp_item_type_e type); -void quickpanel_noti_section_update(Evas_Object *noti_section, int noti_count); -void quickpanel_noti_section_remove(Evas_Object *noti_section) ; -void quickpanel_noti_section_set_deleted_cb(Evas_Object *noti_section, - Evas_Object_Event_Cb func, void *data); - -#endif
\ No newline at end of file +#endif diff --git a/daemon/notifications/noti_util.c b/daemon/notifications/noti_util.c index b9ed40e..a41da37 100755 --- a/daemon/notifications/noti_util.c +++ b/daemon/notifications/noti_util.c @@ -1,5 +1,4 @@ -/* - * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved +/* * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +14,26 @@ * */ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#include <Elementary.h> +#include <E_DBus.h> #include <unicode/uloc.h> #include <unicode/udat.h> #include <unicode/udatpg.h> #include <unicode/ustring.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> #include <runtime_info.h> #include <vconf.h> #include <system_settings.h> +#include <notification_list.h> +#include <E_DBus.h> + #include "quickpanel-ui.h" #include "common.h" #include "noti_util.h" @@ -70,10 +81,9 @@ static char* _get_locale(void) char *locale = NULL; int ret = 0; -#ifdef HAVE_X ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &locale); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to set key(%s) : %d", SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ret); -#endif + if (locale == NULL) { ERR("vconf_get_str() failed : region format"); @@ -167,9 +177,8 @@ HAPI char *quickpanel_noti_util_get_time(time_t t, char *buf, int buf_len) skeletonLength = strlen(UDAT_ABBR_MONTH_DAY); is_show_time = 0; } else { -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &is_24hour_enabled); -#endif + if (ret == SYSTEM_SETTINGS_ERROR_NONE && is_24hour_enabled == true) { /* ascii to unicode for input skeleton */ u_uastrcpy(skeleton, "HHmm"); @@ -227,12 +236,12 @@ HAPI char *quickpanel_noti_util_get_time(time_t t, char *buf, int buf_len) /* get best pattern using skeleton */ patternLength = udatpg_getBestPattern(generator, skeleton, skeletonLength, - pattern, patternCapacity, &status); + pattern, patternCapacity, &status); /* open datetime formatter using best pattern */ formatter = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, - pattern, patternLength, &status); + pattern, patternLength, &status); if (formatter == NULL) { ret = 0; goto err; @@ -264,26 +273,26 @@ HAPI char *quickpanel_noti_util_get_time(time_t t, char *buf, int buf_len) } } - err: - if (timezone) { - free(timezone); - timezone = NULL; - } +err: + if (timezone) { + free(timezone); + timezone = NULL; + } - if (locale) { - free(locale); - locale = NULL; - } + if (locale) { + free(locale); + locale = NULL; + } - if (generator) { - udatpg_close(generator); - generator = NULL; - } + if (generator) { + udatpg_close(generator); + generator = NULL; + } - if (formatter) { - udat_close(formatter); - formatter = NULL; - } + if (formatter) { + udat_close(formatter); + formatter = NULL; + } return ret <= 0 ? NULL : buf; } diff --git a/daemon/notifications/noti_util.h b/daemon/notifications/noti_util.h index 5aca4f9..b49b680 100755 --- a/daemon/notifications/noti_util.h +++ b/daemon/notifications/noti_util.h @@ -19,10 +19,8 @@ #ifndef _QP_NOTI_UTIL_DEF_ #define _QP_NOTI_UTIL_DEF_ -#include <notification.h> - -HAPI int quickpanel_noti_util_get_event_count_from_noti(notification_h noti); -int quickpanel_noti_util_get_event_count_by_pkgname(const char *pkgname); -char *quickpanel_noti_util_get_time(time_t t, char *buf, int buf_len); +extern int quickpanel_noti_util_get_event_count_from_noti(notification_h noti); +extern int quickpanel_noti_util_get_event_count_by_pkgname(const char *pkgname); +extern char *quickpanel_noti_util_get_time(time_t t, char *buf, int buf_len); #endif diff --git a/daemon/notifications/noti_view.c b/daemon/notifications/noti_view.c index b62366e..8ddbf58 100644..100755 --- a/daemon/notifications/noti_view.c +++ b/daemon/notifications/noti_view.c @@ -15,26 +15,36 @@ * */ +#include <Elementary.h> +#include <glib.h> #include <string.h> +#include <vconf.h> #include <notification.h> +#include <system_settings.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" -#include "noti_list_item.h" +#include "vi_manager.h" #include "noti_node.h" +#include "noti_list_item.h" #include "noti.h" #include "noti_util.h" +#include "animated_icon.h" +#include "noti_list_item.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" -#include "noti_list_item.h" #define NOTI_LAYOUT_LISTTYPE 0 #define NOTI_LAYOUT_BOXTYPE 1 @@ -194,7 +204,6 @@ HAPI int quickpanel_noti_view_is_view_handler_changed(Evas_Object *item, notific Noti_View_H noti_view_h = { .name = "noti_view", - .create = _create, .update = _update, .remove = _remove, diff --git a/daemon/notifications/noti_view.h b/daemon/notifications/noti_view.h index 2e6b07c..7c8507a 100644..100755 --- a/daemon/notifications/noti_view.h +++ b/daemon/notifications/noti_view.h @@ -19,8 +19,6 @@ #ifndef _QP_NOTI_VIEW_H_ #define _QP_NOTI_VIEW_H_ -#include <notification.h> - -int quickpanel_noti_view_is_view_handler_changed(Evas_Object *item, notification_h noti); +extern int quickpanel_noti_view_is_view_handler_changed(Evas_Object *item, notification_h noti); #endif diff --git a/daemon/notifications/noti_view_boxtype.c b/daemon/notifications/noti_view_boxtype.c index f4c8de5..c651fe2 100644..100755 --- a/daemon/notifications/noti_view_boxtype.c +++ b/daemon/notifications/noti_view_boxtype.c @@ -15,26 +15,40 @@ * */ +#include <Elementary.h> +#include <glib.h> #include <string.h> #include <notification.h> +#include <notification_text_domain.h> +#include <notification_internal.h> +#include <system_settings.h> +#include <vconf.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" +#include "vi_manager.h" #include "noti_box.h" #include "noti_node.h" #include "noti.h" #include "noti_util.h" #include "noti_list_item.h" +#include "animated_icon.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" #define IMAGE_NO_RESIZE 0 #define IMAGE_RESIZE 1 @@ -141,8 +155,7 @@ static void _text_clean_all(Evas_Object *noti_box) } #ifdef QP_SCREENREADER_ENABLE -static inline void _check_and_add_to_buffer(notification_h noti, - notification_text_type_e text_type, Eina_Strbuf *str_buf) +static inline void _check_and_add_to_buffer(notification_h noti, notification_text_type_e text_type, Eina_Strbuf *str_buf) { char buf[256] = { 0, }; char buf_number[QP_UTIL_PHONE_NUMBER_MAX_LEN * 2] = { 0, }; @@ -174,8 +187,7 @@ static inline void _check_and_add_to_buffer(notification_h noti, } } -static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, notification_h noti) { Evas_Object *ao = NULL; Eina_Strbuf *str_buf = NULL; @@ -220,8 +232,7 @@ static void _noti_box_set_rs_layout_single(Evas_Object *noti_box, } } -static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, notification_h noti) { DBG(""); @@ -268,8 +279,7 @@ static void _noti_box_set_rs_layout_multi(Evas_Object *noti_box, } } -static void _noti_box_set_rs_layout_thumbnail(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_rs_layout_thumbnail(Evas_Object *noti_box, notification_h noti) { DBG(""); @@ -314,8 +324,7 @@ static void _noti_box_set_rs_layout_thumbnail(Evas_Object *noti_box, } #endif -static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char *image_path, - notification_image_type_e image_type, const char *part, int is_stretch, int is_use_buffer) +static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char *image_path, notification_image_type_e image_type, const char *part, int is_stretch, int is_use_buffer) { Evas_Object *content = NULL; char *image = NULL; @@ -339,7 +348,7 @@ static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char if (memfile != NULL && memfile_size > 0) { _attach_memfile(noti_box, image_type, memfile); if (elm_image_memfile_set(content, memfile, memfile_size, ext, - quickpanel_animated_image_get_groupname(image)) == EINA_FALSE) { + quickpanel_animated_image_get_groupname(image)) == EINA_FALSE) { ERR("failed to set memfile set"); elm_image_file_set(content, image, quickpanel_animated_image_get_groupname(image)); @@ -385,8 +394,7 @@ static Evas_Object *_set_image(Evas_Object *noti_box, notification_h noti, char return content; } -static int _set_text(Evas_Object *noti_box, notification_h noti, - notification_text_type_e text_type, const char *part, char *str, int is_need_effect, int is_support_cr) +static int _set_text(Evas_Object *noti_box, notification_h noti, notification_text_type_e text_type, const char *part, char *str, int is_need_effect, int is_support_cr) { char buf[128] = { 0, }; @@ -434,8 +442,7 @@ static int _set_text(Evas_Object *noti_box, notification_h noti, return 0; } -static int _check_text_null(notification_h noti, - notification_text_type_e text_type) +static int _check_text_null(notification_h noti, notification_text_type_e text_type) { char *text = NULL; @@ -448,8 +455,7 @@ static int _check_text_null(notification_h noti, return 0; } -static int _check_image_null(notification_h noti, - notification_image_type_e image_type) +static int _check_image_null(notification_h noti, notification_image_type_e image_type) { char *image = NULL; @@ -466,8 +472,7 @@ static int _check_image_null(notification_h noti, return 0; } -static void _noti_box_set_layout_single(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_single(Evas_Object *noti_box, notification_h noti) { char *dir = NULL; char *domain = NULL; @@ -484,23 +489,23 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_contents_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_sub_info_1_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 - || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 + || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { is_contents_and_sub_info_2 = 1; } @@ -522,14 +527,11 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, if (is_contents_and_sub_info_2 == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); - } else { - _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, - "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); } if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1) { @@ -599,8 +601,8 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -610,8 +612,7 @@ static void _noti_box_set_layout_single(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout_multi(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_multi(Evas_Object *noti_box, notification_h noti) { char *pkgname = NULL; char *icon_path = NULL; @@ -628,25 +629,25 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_contents_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) == 1) { is_sub_info_1_only = 1; } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 - && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 - || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 1 + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1 + && (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) != 1 + || _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_2) != 1)) { is_contents_and_sub_info_2 = 1; } @@ -662,16 +663,16 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, "object.text.title", NULL, is_need_effect, TEXT_CR); if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, "object.text.count", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); } else { if (is_contents_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_CR); } else if (is_contents_and_sub_info_2 == 1) { - _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, - "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); + _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, + "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); } else { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); @@ -691,7 +692,7 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_SUB_1) == 1) { @@ -759,8 +760,8 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -770,8 +771,7 @@ static void _noti_box_set_layout_multi(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, - notification_h noti) +static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, notification_h noti) { char *pkgname = NULL; char *icon_path = NULL; @@ -789,15 +789,15 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) != 1 - && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1) { + && _check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 1) { is_sub_info_1_only = 1; } if (_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_1)!= 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_2) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_3) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_4) == 1 - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_5) == 1) { + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_2) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_3) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_4) == 1 + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_LIST_5) == 1) { is_show_info = 1; } @@ -811,9 +811,9 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, "object.text.title", NULL, is_need_effect, TEXT_CR); if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, "object.text.count", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, - is_need_effect, TEXT_NO_CR); + is_need_effect, TEXT_NO_CR); } else { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_CONTENT, "object.text.contents", NULL, is_need_effect, TEXT_NO_CR); @@ -832,15 +832,15 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, if (is_show_info == 1) { if (is_sub_info_1_only == 1) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); + "object.text.info.1.multiline", NULL, is_need_effect, TEXT_CR); } else { if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_1) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_1, - "object.text.info.1", NULL, is_need_effect, TEXT_NO_CR); + "object.text.info.1", NULL, is_need_effect, TEXT_NO_CR); } if (_check_text_null(noti, NOTIFICATION_TEXT_TYPE_INFO_2) == 0) { _set_text(noti_box, noti, NOTIFICATION_TEXT_TYPE_INFO_2, - "object.text.info.2", NULL, is_need_effect, TEXT_NO_CR); + "object.text.info.2", NULL, is_need_effect, TEXT_NO_CR); } } } @@ -902,8 +902,8 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, elm_object_signal_emit(noti_box, "box.title.without.icon", "box.prog"); } if (((_check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON) == 0 - || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) - && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { + || _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL) == 0) + && _check_image_null(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB) == 0)) { elm_object_signal_emit(noti_box, "box.show.sub.bg", "box.prog"); } } @@ -913,8 +913,7 @@ static void _noti_box_set_layout_thumbnail(Evas_Object *noti_box, #endif } -static void _noti_box_set_layout(Evas_Object *noti_box, notification_h noti, - notification_ly_type_e layout) +static void _noti_box_set_layout(Evas_Object *noti_box, notification_h noti, notification_ly_type_e layout) { DBG("notification box layout:%d", layout); @@ -967,8 +966,7 @@ static Evas_Object *_create(notification_h noti, Evas_Object *parent) evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); - quickpanel_uic_initial_resize(box, QP_THEME_LIST_ITEM_NOTIFICATION_LEGACY_SINGLE_MULTI_HEIGHT - + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); + quickpanel_uic_initial_resize(box, QP_THEME_LIST_ITEM_NOTIFICATION_LEGACY_SINGLE_MULTI_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT); evas_object_show(box); Evas_Object *focus = quickpanel_accessibility_ui_get_focus_object(box); diff --git a/daemon/notifications/noti_view_listype.c b/daemon/notifications/noti_view_listype.c index a9dac2f..d773c77 100644..100755 --- a/daemon/notifications/noti_view_listype.c +++ b/daemon/notifications/noti_view_listype.c @@ -16,24 +16,37 @@ */ +#include <Elementary.h> #include <string.h> -#include <efl_assist.h> +#include <glib.h> + +#include <notification.h> +#include <notification_text_domain.h> +#include <system_settings.h> +#include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" -#include "noti_list_item.h" +#include "vi_manager.h" #include "noti_node.h" +#include "noti_list_item.h" #include "noti.h" #include "noti_util.h" +#include "animated_icon.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" #define LEN_UNIT_TEXTBLOCK 560 #define QP_DEFAULT_ICON RESDIR"/quickpanel_icon_default.png" @@ -125,7 +138,7 @@ static void _set_icon(Evas_Object *item, notification_h noti) notification_get_pkgname(noti, &pkgname); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, - &thumbnail_path); + &thumbnail_path); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB, &icon_sub_path); @@ -160,7 +173,9 @@ static void _set_icon(Evas_Object *item, notification_h noti) if (!strncmp(main_icon_path, QP_PRELOAD_NOTI_ICON_PATH, strlen(QP_PRELOAD_NOTI_ICON_PATH))) { DBG("Apply color theme [%s]", main_icon_path); - evas_object_color_set(ic, 0,0,0,255); + evas_object_color_set(ic, 155, 216, 226, 255); + } else { + elm_image_aspect_fixed_set(ic, EINA_TRUE); } } elm_object_part_content_set(item, "elm.swallow.thumbnail", ic); @@ -235,8 +250,8 @@ static void _set_text(Evas_Object *item, notification_h noti) /* Get pkgname & id */ noti_err = notification_get_text(noti, - NOTIFICATION_TEXT_TYPE_TITLE, - &text); + NOTIFICATION_TEXT_TYPE_TITLE, + &text); if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) { quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE); @@ -247,8 +262,9 @@ static void _set_text(Evas_Object *item, notification_h noti) } noti_err = notification_get_text(noti, - NOTIFICATION_TEXT_TYPE_EVENT_COUNT, - &text); + NOTIFICATION_TEXT_TYPE_EVENT_COUNT, + &text); + if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) { quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE); int count = atoi(text); @@ -264,7 +280,7 @@ static void _set_text(Evas_Object *item, notification_h noti) noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, - &text); + &text); if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) { quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE); _set_text_to_part(item, "elm.text.content", text); @@ -286,11 +302,11 @@ static void _set_text(Evas_Object *item, notification_h noti) } if (elm_object_part_text_get(item, "elm.text.count") != NULL) { - elm_object_signal_emit(item, "title.short", "prog"); + elm_object_signal_emit(item, "content.short", "prog"); elm_object_signal_emit(item, "count.show", "prog"); } if (elm_object_part_text_get(item, "elm.text.time") != NULL) { - elm_object_signal_emit(item, "content.short", "prog"); + elm_object_signal_emit(item, "title.short", "prog"); } const char *get_content = elm_object_part_text_get(item, "elm.text.content"); @@ -299,10 +315,12 @@ static void _set_text(Evas_Object *item, notification_h noti) elm_object_signal_emit(item, "title.move.center", "prog"); if (elm_object_part_text_get(item, "elm.text.time") != NULL) { elm_object_signal_emit(item, "title.short.center", "prog"); + elm_object_signal_emit(item, "time.move.center", "prog"); } } else { elm_object_signal_emit(item, "title.move.default", "prog"); - if (elm_object_part_text_get(item, "elm.text.count") != NULL) { + if (elm_object_part_text_get(item, "elm.text.time") != NULL) { + elm_object_signal_emit(item, "time.move.default", "prog"); elm_object_signal_emit(item, "title.short", "prog"); } else { elm_object_signal_emit(item, "title.text.default", "prog"); @@ -355,7 +373,6 @@ static void _update(noti_node_item *noti_node, notification_ly_type_e layout, Ev Noti_View_H noti_view_listtype_h = { .name = "noti_view_listtype", - .create = _create, .update = _update, .remove = NULL, diff --git a/daemon/notifications/noti_view_ongoing.c b/daemon/notifications/noti_view_ongoing.c index 9b044e0..5885d37 100644..100755 --- a/daemon/notifications/noti_view_ongoing.c +++ b/daemon/notifications/noti_view_ongoing.c @@ -15,25 +15,40 @@ * */ - +#include <stdio.h> #include <string.h> -#include <efl_assist.h> +#include <glib.h> + +#include <Elementary.h> + +#include <vconf.h> +#include <notification.h> +#include <notification_internal.h> +#include <notification_text_domain.h> +#include <system_settings.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" #include "list_util.h" #include "quickpanel_def.h" -#include "noti_list_item.h" +#include <vi_manager.h> #include "noti_node.h" +#include "noti_list_item.h" #include "noti.h" #include "noti_util.h" +#include "animated_icon.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif + #ifdef QP_ANIMATED_IMAGE_ENABLE #include "animated_image.h" #endif -#include "animated_icon.h" #define LEN_UNIT_TEXTBLOCK 555 #define QP_DEFAULT_ICON RESDIR"/quickpanel_icon_default.png" @@ -73,8 +88,9 @@ static Evas_Object *_check_duplicated_progress_loading(Evas_Object *obj, const c if (old_content != NULL) { old_style_name = elm_object_style_get(old_content); if (old_style_name != NULL) { - if (strcmp(old_style_name, style_name) == 0) + if (strcmp(old_style_name, style_name) == 0) { return old_content; + } elm_object_part_content_unset(obj, part); evas_object_del(old_content); @@ -117,11 +133,12 @@ static Evas_Object *_check_duplicated_image_loading(Evas_Object *obj, const char static void _set_text_to_part(Evas_Object *obj, const char *part, const char *text) { - const char *old_text = NULL; + const char *old_text; - retif(obj == NULL, , "Invalid parameter!"); - retif(part == NULL, , "Invalid parameter!"); - retif(text == NULL, , "Invalid parameter!"); + if (!obj || !part || !text) { + ERR("Invalid parameters"); + return; + } old_text = elm_object_part_text_get(obj, part); if (old_text != NULL) { @@ -158,19 +175,19 @@ static char *_noti_get_progress(notification_h noti, char *buf, int buf_len) } else if (size > 0 && percentage == 0) { if (size > (1 << 30)) { if (snprintf(buf, buf_len, "%.1lfGB", - size / 1000000000.0) <= 0) + size / 1000000000.0) <= 0) return NULL; return buf; } else if (size > (1 << 20)) { if (snprintf(buf, buf_len, "%.1lfMB", - size / 1000000.0) <= 0) + size / 1000000.0) <= 0) return NULL; return buf; } else if (size > (1 << 10)) { if (snprintf(buf, buf_len, "%.1lfKB", - size / 1000.0) <= 0) + size / 1000.0) <= 0) return NULL; return buf; @@ -205,10 +222,10 @@ static void _set_progressbar(Evas_Object *item, notification_h noti) if (layout != NOTIFICATION_LY_ONGOING_EVENT) { if (percentage > 0.0 && percentage <= 1.0) { - old_ic = _check_duplicated_progress_loading(item, - "elm.swallow.progress", "quickpanel/list_progress"); + old_ic = _check_duplicated_progress_loading(item, "elm.swallow.progress", "list_progress"); if (old_ic == NULL) { ic = elm_progressbar_add(item); + elm_progressbar_unit_format_set(ic, "%0.0f%%"); if (ic == NULL) return; elm_object_style_set(ic, "list_progress"); @@ -220,10 +237,10 @@ static void _set_progressbar(Evas_Object *item, notification_h noti) elm_progressbar_horizontal_set(ic, EINA_TRUE); elm_progressbar_pulse(ic, EINA_FALSE); } else if ((size >= 0.0 && percentage == 0.0) || ((size < 0.0 && percentage == 0.0)|| (size == 0.0 && percentage < 0.0))) { - old_ic = _check_duplicated_progress_loading(item, - "elm.swallow.progress", "quickpanel/pending_list"); + old_ic = _check_duplicated_progress_loading(item, "elm.swallow.progress", "pending"); if (old_ic == NULL) { ic = elm_progressbar_add(item); + elm_progressbar_unit_format_set(ic, "%0.0f%%"); if (ic == NULL) return; elm_object_style_set(ic, "pending"); @@ -259,7 +276,7 @@ static void _set_icon(Evas_Object *item, notification_h noti) notification_get_pkgname(noti, &pkgname); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL, - &thumbnail_path); + &thumbnail_path); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path); notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON_SUB, &icon_sub_path); @@ -293,7 +310,9 @@ static void _set_icon(Evas_Object *item, notification_h noti) #endif if (!strncmp(main_icon_path, QP_PRELOAD_NOTI_ICON_PATH, strlen(QP_PRELOAD_NOTI_ICON_PATH))) { DBG("Apply color theme [%s]", main_icon_path); - evas_object_color_set(ic, 0,0,0,255); + evas_object_color_set(ic, 155, 216, 226, 255); + } else { + elm_image_aspect_fixed_set(ic, EINA_TRUE); } } elm_object_part_content_set(item, "elm.swallow.thumbnail", ic); @@ -335,13 +354,12 @@ static void _set_icon(Evas_Object *item, notification_h noti) static void _set_text(Evas_Object *item, notification_h noti) { - int noti_err = NOTIFICATION_ERROR_NONE; char *text = NULL; char *text_utf8 = NULL; char *domain = NULL; char *dir = NULL; char *pkgname = NULL; -// char *caller_pkgname = NULL; + // char *caller_pkgname = NULL; int group_id = 0, priv_id = 0; char buf[128] = { 0, }; notification_type_e type = NOTIFICATION_TYPE_NONE; @@ -355,19 +373,22 @@ static void _set_text(Evas_Object *item, notification_h noti) Evas_Object *textblock = NULL; int len_w = 0, num_line = 1, view_height = 0; struct appdata *ad = quickpanel_get_app_data(); + char *text_count = NULL; + int ret; - retif(ad == NULL, , "Invalid parameter!"); - retif(item == NULL, , "Invalid parameter!"); - retif(noti == NULL, , "noti is NULL"); + if (!ad || !item || !noti) { + ERR("Invalid parameters: %p %p %p", ad, item, noti); + return; + } /* Set text domain */ notification_get_text_domain(noti, &domain, &dir); - if (domain != NULL && dir != NULL) + if (domain != NULL && dir != NULL) { bindtextdomain(domain, dir); + } #ifdef QP_SCREENREADER_ENABLE - ao = quickpanel_accessibility_screen_reader_object_get(item, - SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus", item); + ao = quickpanel_accessibility_screen_reader_object_get(item, SCREEN_READER_OBJ_TYPE_ELM_OBJECT, "focus", item); if (ao != NULL) { str_buf = eina_strbuf_new(); elm_access_info_set(ao, ELM_ACCESS_TYPE, _("IDS_QP_BUTTON_NOTIFICATION")); @@ -375,21 +396,40 @@ static void _set_text(Evas_Object *item, notification_h noti) #endif /* 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); - notification_get_size(noti, &size); - notification_get_progress(noti, &percentage); - notification_get_layout(noti, &layout); + ret = notification_get_pkgname(noti, &pkgname); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get the pkgname"); + } + // notification_get_application(noti, &caller_pkgname); + ret = notification_get_id(noti, &group_id, &priv_id); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get id"); + } + ret = notification_get_type(noti, &type); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get type"); + } + ret = notification_get_size(noti, &size); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get size"); + } + ret = notification_get_progress(noti, &percentage); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get progress"); + } + ret = notification_get_layout(noti, &layout); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get layout"); + } + ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, &text_count); + if (ret != NOTIFICATION_ERROR_NONE) { + ERR("Unable to get event_count"); + } SDBG("percentage:%f size:%f", percentage, size); - noti_err = notification_get_text(noti, - NOTIFICATION_TEXT_TYPE_TITLE, - &text); - - if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) { + ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text); + if (ret == NOTIFICATION_ERROR_NONE && text != NULL) { quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE); _set_text_to_part(item, "elm.text.title", text); #ifdef QP_SCREENREADER_ENABLE @@ -397,8 +437,8 @@ static void _set_text(Evas_Object *item, notification_h noti) #endif } - noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &text); - if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) { + ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &text); + if (ret == NOTIFICATION_ERROR_NONE && text != NULL) { if (layout == NOTIFICATION_LY_ONGOING_EVENT) { text_utf8 = elm_entry_utf8_to_markup(text); if (text_utf8 != NULL) { @@ -420,7 +460,7 @@ static void _set_text(Evas_Object *item, notification_h noti) } /*else { elm_object_signal_emit(item, "line3.set", "prog"); view_height = QP_THEME_LIST_ITEM_ONGOING_EVENT_LINE3_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT; - }*/ + }*/ quickpanel_uic_initial_resize(item, view_height); #ifdef QP_SCREENREADER_ENABLE _check_and_add_to_buffer(str_buf, text); @@ -438,7 +478,6 @@ static void _set_text(Evas_Object *item, notification_h noti) text = _noti_get_progress(noti, buf, sizeof(buf)); if (text != NULL) { quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE); - _set_text_to_part(item, "elm.text.time", text); #ifdef QP_SCREENREADER_ENABLE _check_and_add_to_buffer(str_buf, text); #endif @@ -446,13 +485,23 @@ static void _set_text(Evas_Object *item, notification_h noti) _set_text_to_part(item, "elm.text.time", ""); } } else { - const char *get_content = elm_object_part_text_get(item, "elm.text.content"); + const char *get_content; + + get_content = elm_object_part_text_get(item, "elm.text.content"); if (get_content == NULL || strlen(get_content) == 0) { // if there is no content, move title to vertical center. elm_object_signal_emit(item, "title.move.center", "prog"); } } + if (layout == NOTIFICATION_LY_ONGOING_PROGRESS && text_count != NULL) { + _set_text_to_part(item, "elm.text.count", text_count); + if (elm_object_part_text_get(item, "elm.text.count") != NULL) { + elm_object_signal_emit(item, "content.short", "prog"); + elm_object_signal_emit(item, "count.show", "prog"); + } + } + #ifdef QP_SCREENREADER_ENABLE if (ao != NULL && str_buf != NULL) { elm_access_info_set(ao, ELM_ACCESS_INFO, eina_strbuf_string_get(str_buf)); @@ -506,7 +555,6 @@ static void _update(noti_node_item *noti_node, notification_ly_type_e layout, Ev Noti_View_H ongoing_noti_view_h = { .name = "ongoing_noti_view", - .create = _create, .update = _update, .remove = NULL, diff --git a/daemon/notifications/noti_win.c b/daemon/notifications/noti_win.c index 66c0a81..ba9456a 100755 --- a/daemon/notifications/noti_win.c +++ b/daemon/notifications/noti_win.c @@ -16,24 +16,23 @@ */ #include <Elementary.h> -#ifdef HAVE_X +#if defined(WINSYS_X11) #include <utilX.h> +#include <Ecore_X.h> #endif #include <efl_util.h> -#define NOTI_HEIGHT 200 -#define NOTI_BTN_HEIGHT 80 +#define NOTI_HEIGHT ELM_SCALE_SIZE(260) +#define NOTI_START_Y ELM_SCALE_SIZE(36) + #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 -*/ + rotation handling are implemented for X based platform + */ -#ifdef HAVE_X -#include <Ecore_X.h> -#endif #include "common.h" #include "noti_win.h" #include "dbus_utility.h" @@ -41,32 +40,35 @@ rotation handling are implemented for X based platform struct Internal_Data { Evas_Object *content; Ecore_Event_Handler *rotation_event_handler; + Evas_Coord scr_w; + Evas_Coord scr_h; Evas_Coord w; Evas_Coord h; int angle; enum Noti_Orient orient; }; -static const char *data_key = "_data"; +#define E_DATA_KEY "E_DATA_KEY" +#define E_DATA_BASE_RECT "E_DATA_BASE_RECT" -static void _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, - void *event_info __UNUSED__) +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); + struct Internal_Data *wd = evas_object_data_get(obj, E_DATA_KEY); if (!wd) { return; } + if (wd->content) { evas_object_show(wd->content); } + } -static void _content_changed_size_hints(void *data, Evas *e __UNUSED__, - Evas_Object *obj, void *event_info __UNUSED__) +static void _content_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Evas_Coord h = 0; - struct Internal_Data *wd = evas_object_data_get(data, data_key); + struct Internal_Data *wd = evas_object_data_get(data, E_DATA_KEY); if (!wd) { return; @@ -74,40 +76,20 @@ static void _content_changed_size_hints(void *data, Evas *e __UNUSED__, 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_CHANGED_SIZE_HINTS, - _content_changed_size_hints); - wd->content = NULL; - } -} - -static void _resized(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, - void *event_info __UNUSED__) +static void _resized(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { evas_object_show(obj); } -static void _del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, - void *event_info __UNUSED__) +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); + struct Internal_Data *wd = evas_object_data_get(obj, E_DATA_KEY); if (wd) { if (wd->rotation_event_handler) { @@ -116,80 +98,49 @@ static void _del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, free(wd); } - evas_object_data_set(data, data_key, NULL); - + evas_object_data_set(data, E_DATA_KEY, NULL); } -#ifdef HAVE_X -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); - - 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; - } -} -#endif - 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); + struct Internal_Data *wd = evas_object_data_get(obj, E_DATA_KEY); if (!wd) { return; } + angle = elm_win_rotation_get(obj); if (angle % 90) { return; } + angle %= 360; - if (angle < 0) + if (angle < 0) { angle += 360; + } wd->angle = angle; -#ifdef HAVE_X - _update_geometry_on_rotation(obj, wd->angle, &x, &y, &w); -#endif - - evas_object_move(obj, x, y); - wd->w = w; - evas_object_resize(obj, wd->w, wd->h); + switch (angle) { + case 0: + case 180: + evas_object_size_hint_min_set(obj, wd->scr_w, wd->h); + evas_object_resize(obj, wd->scr_w, wd->h); + evas_object_move(obj, 0, NOTI_START_Y); + break; + case 90: + evas_object_size_hint_min_set(obj, wd->scr_h, wd->h); + evas_object_resize(obj, wd->scr_h, wd->h); + evas_object_move(obj, NOTI_START_Y, 0); + break; + case 270: + evas_object_size_hint_min_set(obj, wd->scr_h, wd->h); + evas_object_resize(obj, wd->scr_h, wd->h); + evas_object_move(obj, wd->scr_w - wd->h - NOTI_START_Y, 0); + break; + default: + ERR("cannot reach here"); + } } static void _ui_rotation_wm_cb(void *data, Evas_Object *obj, void *event) @@ -202,44 +153,58 @@ static void _ui_rotation_wm_cb(void *data, Evas_Object *obj, void *event) _win_rotated(obj); } +static void _resize_cb (void *data, Evas *e, Evas_Object *eo, void *event_info) +{ + int x, y, w, h; + evas_object_geometry_get(eo, &x, &y, &w, &h); + DBG("%s: %d:%d:%d:%d\n", data, x, y, w, h); +} + HAPI Evas_Object *quickpanel_noti_win_add(Evas_Object *parent) { Evas_Object *win; - Evas_Object *bg; struct Internal_Data *wd; Evas_Coord w = 0, h = 0; + Evas *e = NULL; + Ecore_Evas *ee = NULL; win = elm_win_add(parent, "noti_win", ELM_WIN_NOTIFICATION); if (!win) { return NULL; } - elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW); + e = evas_object_evas_get(win); + if (!e) { + evas_object_del(win); + return NULL; + } + + ee = ecore_evas_ecore_evas_get(e); + if (!ee) { + evas_object_del(win); + return NULL; + } + + ecore_evas_name_class_set(ee, "APP_POPUP", "APP_POPUP"); + elm_win_alpha_set(win, EINA_FALSE); -#ifdef HAVE_X - elm_win_indicator_type_set(win,ELM_WIN_INDICATOR_TYPE_1); -#endif + elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_HIDE); elm_win_title_set(win, "noti_win"); elm_win_borderless_set(win, EINA_TRUE); elm_win_autodel_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); -#ifdef HAVE_X - efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); - elm_win_aux_hint_add(win, "wm.policy.win.user.geometry", "1"); -#endif + efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); elm_win_prop_focus_skip_set(win, EINA_TRUE); - - 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); + elm_win_aux_hint_add(win, "wm.policy.win.user.geometry", "1"); if (elm_win_wm_rotation_supported_get(win)) { int rots[4] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(win, rots, 4); } evas_object_smart_callback_add(win, "wm,rotation,changed", _ui_rotation_wm_cb, NULL); + evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _resize_cb, "win"); wd = (struct Internal_Data *) calloc(1, sizeof(struct Internal_Data)); if (!wd) { @@ -248,12 +213,14 @@ HAPI Evas_Object *quickpanel_noti_win_add(Evas_Object *parent) } return NULL; } - evas_object_data_set(win, data_key, wd); + evas_object_data_set(win, E_DATA_KEY, wd); wd->angle = 0; wd->orient = NOTI_ORIENT_TOP; - evas_object_move(win, 0, 0); + evas_object_move(win, 0, NOTI_START_Y); elm_win_screen_size_get(win, NULL, NULL, &w, &h); + wd->scr_w = w; + wd->scr_h = h; wd->w = w; wd->h = NOTI_HEIGHT; @@ -265,58 +232,72 @@ HAPI Evas_Object *quickpanel_noti_win_add(Evas_Object *parent) return win; } -HAPI void quickpanel_noti_win_content_set(Evas_Object *obj, Evas_Object *content, int btn_cnt) +HAPI void quickpanel_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); + + wd = evas_object_data_get(obj, E_DATA_KEY); if (!wd) { return; } + if (wd->content && content != NULL) { - evas_object_del(content); - content = NULL; + evas_object_del(wd->content); + wd->content = NULL; } + wd->content = content; - if (btn_cnt > 0) { - wd->h += NOTI_BTN_HEIGHT; + if (!content) { + return; + } + + evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_resize(obj, wd->w, wd->h); + elm_win_resize_object_add(obj, content); + evas_object_size_hint_min_set(content, wd->w, wd->h); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _content_changed_size_hints, obj); +} + +HAPI void quickpanel_noti_win_resize(Evas_Object *obj, int btn_cnt) +{ + struct Internal_Data *wd; + + if (!obj) { + return; } - 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_set(wd->content, wd->w, wd->h); - evas_object_resize(obj, wd->w, wd->h); - evas_object_event_callback_add(wd->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _content_changed_size_hints, obj); + + wd = evas_object_data_get(obj, E_DATA_KEY); + if (!wd) { + return; } + + evas_object_resize(obj, wd->w, wd->h); } HAPI void quickpanel_noti_win_orient_set(Evas_Object *obj, enum Noti_Orient orient) { - Evas_Coord root_w, root_h; - struct Internal_Data *wd = evas_object_data_get(obj, data_key); + struct Internal_Data *wd = evas_object_data_get(obj, E_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: - evas_object_move(obj, 0, root_h - wd->h); + evas_object_move(obj, 0, wd->scr_h - wd->h); wd->orient = NOTI_ORIENT_BOTTOM; break; case NOTI_ORIENT_TOP: default: - evas_object_move(obj, 0, 0); + evas_object_move(obj, 0, NOTI_START_Y); wd->orient = NOTI_ORIENT_TOP; break; } diff --git a/daemon/notifications/noti_win.h b/daemon/notifications/noti_win.h index c7dd25b..91373a3 100755 --- a/daemon/notifications/noti_win.h +++ b/daemon/notifications/noti_win.h @@ -18,26 +18,28 @@ #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 *quickpanel_noti_win_add(Evas_Object *parent); + root window + */ +extern Evas_Object *quickpanel_noti_win_add(Evas_Object *parent); /* Sets an Evas Object as content of the notification window created using -noti_win_add -*/ -void quickpanel_noti_win_content_set(Evas_Object *obj, Evas_Object *content, int btn_cnt); + noti_win_add + */ +extern void quickpanel_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 quickpanel_noti_win_orient_set(Evas_Object *obj, enum Noti_Orient orient); + Noti_Orient + */ +extern void quickpanel_noti_win_orient_set(Evas_Object *obj, enum Noti_Orient orient); + +extern void quickpanel_noti_win_resize(Evas_Object *obj, int btn_cnt); + #endif diff --git a/daemon/page/page_base.c b/daemon/page/page_base.c index 59d6ab1..cab5729 100644..100755 --- a/daemon/page/page_base.c +++ b/daemon/page/page_base.c @@ -15,17 +15,33 @@ * */ +#include <Elementary.h> +#include <stdbool.h> +#include <glib.h> + +#include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <system_settings.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" +#include "common.h" +#include "common_uic.h" #include "pager.h" #include "pager_common.h" +#include "list_util.h" +#include "noti_node.h" #include "vi_manager.h" #include "setting_utils.h" -#include "list_util.h" #include "settings.h" #include "settings_view_featured.h" +#include "noti.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "noti.h" #define FICKUP_TIME_LIMIT 150 #define FICKUP_DISTANCE_LIMIT 160 @@ -266,8 +282,8 @@ HAPI Evas_Object *quickpanel_page_base_create(Evas_Object *parent, void *data) Evas_Object *bg_touch = elm_bg_add(view); if (bg_touch != NULL) { - //evas_object_color_set(bg_touch, 255, 255, 255, 250); - evas_object_color_set(bg_touch, 0, 0, 0, 0); + evas_object_color_set(bg_touch, 255, 255, 255, 250); + //evas_object_color_set(bg_touch, 0, 0, 0, 0); evas_object_event_callback_add(bg_touch, EVAS_CALLBACK_MOUSE_DOWN, _flick_mouse_down_cb, NULL); evas_object_event_callback_add(bg_touch, diff --git a/daemon/page/page_base.h b/daemon/page/page_base.h index d2b1278..589acfe 100644..100755 --- a/daemon/page/page_base.h +++ b/daemon/page/page_base.h @@ -19,11 +19,8 @@ #ifndef __QUICKPANEL_PAGE_BASE_H__ #define __QUICKPANEL_PAGE_BASE_H__ -#include "quickpanel-ui.h" -#include "common.h" - -Evas_Object *quickpanel_page_base_create(Evas_Object *parent, void *data); -Evas_Object *quickpanel_page_base_view_get(const char *view_name); -void quickpanel_page_base_focus_allow_set(Eina_Bool is_enable); +extern Evas_Object *quickpanel_page_base_create(Evas_Object *parent, void *data); +extern Evas_Object *quickpanel_page_base_view_get(const char *view_name); +extern void quickpanel_page_base_focus_allow_set(Eina_Bool is_enable); #endif diff --git a/daemon/page/page_edit.c b/daemon/page/page_edit.c index d83a740..95f4e7e 100644..100755 --- a/daemon/page/page_edit.c +++ b/daemon/page/page_edit.c @@ -15,9 +15,18 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" +#include "common_uic.h" +#include "common.h" #include "pager.h" #include "pager_common.h" +#include "list_util.h" #include "vi_manager.h" #include "settings_gridbox.h" #include "quickpanel_def.h" diff --git a/daemon/page/page_edit.h b/daemon/page/page_edit.h index eb6d64f..83fb44b 100644..100755 --- a/daemon/page/page_edit.h +++ b/daemon/page/page_edit.h @@ -19,13 +19,10 @@ #ifndef __QUICKPANEL_PAGE_EDIT_H__ #define __QUICKPANEL_PAGE_EDIT_H__ -#include "quickpanel-ui.h" -#include "common.h" - -Evas_Object *quickpanel_page_edit_create(Evas_Object *parent, void *data); -Evas_Object *quickpanel_page_edit_view_get(const char *view_name); -void quickpanel_page_edit_view_set(const char *view_name, Evas_Object *view); -void quickpanel_page_edit_freeze_set(Eina_Bool is_freeze); -Eina_Bool quickpanel_page_edit_is_page_showed(void); +extern Evas_Object *quickpanel_page_edit_create(Evas_Object *parent, void *data); +extern Evas_Object *quickpanel_page_edit_view_get(const char *view_name); +extern void quickpanel_page_edit_view_set(const char *view_name, Evas_Object *view); +extern void quickpanel_page_edit_freeze_set(Eina_Bool is_freeze); +extern Eina_Bool quickpanel_page_edit_is_page_showed(void); #endif diff --git a/daemon/page/page_setting_all.c b/daemon/page/page_setting_all.c index 841ea1f..408b4c4 100644..100755 --- a/daemon/page/page_setting_all.c +++ b/daemon/page/page_setting_all.c @@ -15,9 +15,18 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" +#include "common_uic.h" +#include "common.h" #include "pager.h" #include "pager_common.h" +#include "list_util.h" #include "vi_manager.h" #include "settings_gridbox.h" #include "settings_view_all.h" diff --git a/daemon/page/page_setting_all.h b/daemon/page/page_setting_all.h index 9096ef0..b3c7a70 100644..100755 --- a/daemon/page/page_setting_all.h +++ b/daemon/page/page_setting_all.h @@ -19,14 +19,12 @@ #ifndef __QUICKPANEL_PAGE_SETTING_ALL_H__ #define __QUICKPANEL_PAGE_SETTING_ALL_H__ -#include "quickpanel-ui.h" -#include "common.h" -Evas_Object *quickpanel_page_setting_all_create(Evas_Object *parent, void *data); -Evas_Object *quickpanel_page_setting_all_view_get(const char *view_name); -void quickpanel_page_setting_all_view_set(const char *view_name, Evas_Object *view); -void quickpanel_page_setting_all_freeze_set(Eina_Bool is_freeze); -Eina_Bool quickpanel_page_setting_all_is_page_showed(void); -void quickpanel_page_setting_all_focus_allow_set(Eina_Bool is_enable); +extern Evas_Object *quickpanel_page_setting_all_create(Evas_Object *parent, void *data); +extern Evas_Object *quickpanel_page_setting_all_view_get(const char *view_name); +extern void quickpanel_page_setting_all_view_set(const char *view_name, Evas_Object *view); +extern void quickpanel_page_setting_all_freeze_set(Eina_Bool is_freeze); +extern Eina_Bool quickpanel_page_setting_all_is_page_showed(void); +extern void quickpanel_page_setting_all_focus_allow_set(Eina_Bool is_enable); #endif diff --git a/daemon/page/pager.c b/daemon/page/pager.c index 7ce9540..8be4093 100644..100755 --- a/daemon/page/pager.c +++ b/daemon/page/pager.c @@ -15,9 +15,16 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "common.h" #include "pager.h" #include "pager_common.h" +#include "quickpanel-ui.h" #include "quickpanel_def.h" static int _init(void *data); @@ -455,7 +462,7 @@ static void _refresh(void *data) { } static void _scroller_resized_cb(void *data, Evas * e, - Evas_Object * obj, void *event_info) + Evas_Object * obj, void *event_info) { _page_show(PAGE_IDX_MAIN); evas_object_event_callback_del(s_info.view_scroller, EVAS_CALLBACK_RESIZE, _scroller_resized_cb); diff --git a/daemon/page/pager.h b/daemon/page/pager.h index 67de49b..3034348 100644..100755 --- a/daemon/page/pager.h +++ b/daemon/page/pager.h @@ -19,21 +19,19 @@ #ifndef __QUICKPANEL_PAGER_H__ #define __QUICKPANEL_PAGER_H__ -#include "quickpanel-ui.h" -#include "common.h" typedef struct _QP_Page_Handler { int status; char *name; /* func */ - void (*content_resize) (int width, int height, const char *signal); - void (*mapbuf_enable_set) (Eina_Bool is_enable); - int (*down_cb) (void *, void *); - int (*move_cb) (void *, void *); - int (*up_cb) (void *, void *); - int (*scroll_start_cb) (void *, void *); - int (*scroll_done_cb) (void *, void *); - int (*page_changed_cb) (void *, void *); + void (*content_resize)(int width, int height, const char *signal); + void (*mapbuf_enable_set)(Eina_Bool is_enable); + int (*down_cb)(void *, void *); + int (*move_cb)(void *, void *); + int (*up_cb)(void *, void *); + int (*scroll_start_cb)(void *, void *); + int (*scroll_done_cb)(void *, void *); + int (*page_changed_cb)(void *, void *); } QP_Page_Handler; typedef enum _qp_pager_page_type { @@ -41,11 +39,11 @@ typedef enum _qp_pager_page_type { PAGE_IDX_EDITING, // Not supported } qp_pager_page_type; -Evas_Object *quickpanel_pager_new(Evas_Object *parent, void *data); -void quickpanel_pager_destroy(void); -Evas_Object *quickpanel_pager_view_get(const char *view_name); -int quickpanel_pager_current_page_get(void); -void quickpanel_pager_page_set(int page_index, int need_resize); -void quickpanel_pager_mapbuf_set(int is_enable); +extern Evas_Object *quickpanel_pager_new(Evas_Object *parent, void *data); +extern void quickpanel_pager_destroy(void); +extern Evas_Object *quickpanel_pager_view_get(const char *view_name); +extern int quickpanel_pager_current_page_get(void); +extern void quickpanel_pager_page_set(int page_index, int need_resize); +extern void quickpanel_pager_mapbuf_set(int is_enable); #endif diff --git a/daemon/page/pager_common.c b/daemon/page/pager_common.c index 1c2bfff..a624816 100644..100755 --- a/daemon/page/pager_common.c +++ b/daemon/page/pager_common.c @@ -15,6 +15,18 @@ * */ +#include <Elementary.h> + +#if defined(WINSYS_X11) +#include <Ecore_X.h> +#endif + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" +#include "common.h" #include "pager.h" #include "datetime.h" @@ -117,9 +129,8 @@ HAPI void quickpanel_page_get_recoordinated_pos(int local_x, int local_y, int *x struct appdata *ad = quickpanel_get_app_data(); retif(ad == NULL, , "invalid parameter"); - //ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height); elm_win_screen_size_get(ad->win, NULL, NULL, &width, &height); - + switch (ad->angle) { case 0: rot_x = local_x; @@ -160,9 +171,11 @@ HAPI void quickpanel_page_get_touched_pos(int *x, int *y) struct appdata *ad = quickpanel_get_app_data(); retif(ad == NULL, , "invalid parameter"); -#ifdef HAVE_X + +#if defined(WINSYS_X11) ecore_x_pointer_last_xy_get(&local_x, &local_y); #endif + quickpanel_page_get_recoordinated_pos(local_x, local_y, &rot_x, &rot_y); if (x != NULL) { @@ -177,7 +190,9 @@ HAPI void quickpanel_page_get_touched_pos(int *x, int *y) HAPI void quickpanel_page_editing_icon_visible_status_update(void) { int is_visible = 0; - struct appdata *ad = quickpanel_get_app_data(); + struct appdata *ad; + + ad = quickpanel_get_app_data(); retif(ad == NULL, , "invalid parameter"); if (quickpanel_pager_current_page_get() == PAGE_IDX_EDITING) { @@ -187,4 +202,4 @@ HAPI void quickpanel_page_editing_icon_visible_status_update(void) } quickpanel_datetime_editing_icon_visibility_set(is_visible); -}
\ No newline at end of file +} diff --git a/daemon/page/pager_common.h b/daemon/page/pager_common.h index 51cb7b0..fcae57f 100644..100755 --- a/daemon/page/pager_common.h +++ b/daemon/page/pager_common.h @@ -19,16 +19,12 @@ #ifndef __QUICKPANEL_PAGER_COMMON_H__ #define __QUICKPANEL_PAGER_COMMON_H__ -#include "quickpanel-ui.h" -#include "common.h" -#include "pager.h" - -void quickpanel_page_handler_set(Evas_Object *page, QP_Page_Handler *handler); -QP_Page_Handler *quickpanel_page_handler_get(Evas_Object *page); -void quickpanel_page_scroll_hold_set(Eina_Bool is_freeze); -void quickpanel_page_scroll_freeze_set(Eina_Bool is_freeze); -void quickpanel_page_get_touched_pos(int *x, int *y); -void quickpanel_page_get_recoordinated_pos(int local_x, int local_y, int *x, int *y); -void quickpanel_page_editing_icon_visible_status_update(void); +extern void quickpanel_page_handler_set(Evas_Object *page, QP_Page_Handler *handler); +extern QP_Page_Handler *quickpanel_page_handler_get(Evas_Object *page); +extern void quickpanel_page_scroll_hold_set(Eina_Bool is_freeze); +extern void quickpanel_page_scroll_freeze_set(Eina_Bool is_freeze); +extern void quickpanel_page_get_touched_pos(int *x, int *y); +extern void quickpanel_page_get_recoordinated_pos(int local_x, int local_y, int *x, int *y); +extern void quickpanel_page_editing_icon_visible_status_update(void); #endif diff --git a/daemon/preference.c b/daemon/preference.c index b6461b9..b0d0f5d 100644..100755 --- a/daemon/preference.c +++ b/daemon/preference.c @@ -19,9 +19,18 @@ #include <stdio.h> #include <fcntl.h> #include <unistd.h> + #include <iniparser.h> +#include <Elementary.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "preference.h" #include "common.h" + + #include "quickpanel-ui.h" #define FILE_PREFERENCE DATADIR_RW"/preference.ini" @@ -93,7 +102,7 @@ static void _default_file_create(void) , PREF_QUICKSETTING_FEATURED_NUM_KEY, _default_preference_get(PREF_QUICKSETTING_FEATURED_NUM) , PREF_SHORTCUT_ENABLE_KEY, _default_preference_get(PREF_SHORTCUT_ENABLE) , PREF_SHORTCUT_EARPHONE_ORDER_KEY, _default_preference_get(PREF_SHORTCUT_EARPHONE_ORDER) - ); + ); fclose(fp); } @@ -114,9 +123,8 @@ HAPI int quickpanel_preference_get(const char *key, char *value) goto END; } -#ifdef HAVE_X +#if defined(WINSYS_X11) value_r = iniparser_getstr(ini, key); -#endif if (value_r == NULL) { value_r = _default_preference_get(key); if (_key_validation_check(key) == 1) { @@ -126,6 +134,7 @@ HAPI int quickpanel_preference_get(const char *key, char *value) } else { DBG("get:[%s]", value_r); } +#endif END: if (value_r != NULL) { @@ -134,9 +143,7 @@ END: } if (ini != NULL) { -#ifdef HAVE_X iniparser_freedict(ini); -#endif } return ret; @@ -163,7 +170,8 @@ HAPI int quickpanel_preference_set(const char *key, char *value) ini = iniparser_load(FILE_PREFERENCE); retif(ini == NULL, QP_FAIL, "failed to load ini file"); -#ifdef HAVE_X + +#if defined(WINSYS_X11) if (iniparser_setstr(ini, (char *)key, value) == 0) { ret = QP_OK; } else { diff --git a/daemon/preference.h b/daemon/preference.h index 717fdc2..ba26de6 100644..100755 --- a/daemon/preference.h +++ b/daemon/preference.h @@ -34,8 +34,8 @@ #define PREF_SHORTCUT_ENABLE PREF_SECTION":"PREF_SHORTCUT_ENABLE_KEY #define PREF_SHORTCUT_EARPHONE_ORDER PREF_SECTION":"PREF_SHORTCUT_EARPHONE_ORDER_KEY -int quickpanel_preference_get(const char *key, char *value); -const char *quickpanel_preference_default_get(const char *key); -int quickpanel_preference_set(const char *key, char *value); +extern int quickpanel_preference_get(const char *key, char *value); +extern const char *quickpanel_preference_default_get(const char *key); +extern int quickpanel_preference_set(const char *key, char *value); #endif diff --git a/daemon/quickpanel-ui.c b/daemon/quickpanel-ui.c index 0891952..c277ae3 100755 --- a/daemon/quickpanel-ui.c +++ b/daemon/quickpanel-ui.c @@ -18,24 +18,38 @@ #include <stdio.h> #include <signal.h> -#include <app.h> #include <sys/utsname.h> -#ifdef HAVE_X -#include <X11/Xlib.h> -#include <utilX.h> -#endif +#include <Elementary.h> #include <Ecore_Input.h> -#include <vconf.h> #include <unistd.h> #include <malloc.h> + +#include <app.h> +#include <vconf.h> +#include <E_DBus.h> +#include <tapi_common.h> +#include <ITapiSim.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <sound_manager.h> +#include <media.h> +#include <system_settings.h> + +#if defined(WINSYS_X11) +#include <X11/Xlib.h> +#include <utilX.h> +#include <Ecore_X.h> +#endif #include <privilege-control.h> /* quickpanel basics */ #include "common.h" +#include "common_uic.h" #include "quickpanel-ui.h" #include "modules.h" #include "quickpanel_def.h" #include "list_util.h" +#include "noti_node.h" #include "vi_manager.h" #include "pager.h" #include "page_base.h" @@ -47,7 +61,7 @@ #include "sim_controller.h" #include "noti.h" - + /* services */ #include "keyboard.h" #include "keyboard_x.h" @@ -58,19 +72,14 @@ #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "configuration.h" #include "minictrl.h" #include "util-time.h" -#include <tapi_common.h> -#include <ITapiSim.h> - - #define QP_WINDOW_PRIO 300 static struct appdata *g_app_data = NULL; -#ifdef HAVE_X +#if defined(WINSYS_X11) static Ecore_X_Atom E_ILLUME_ATOM_MV_QUICKPANEL_STATE; #endif @@ -85,10 +94,10 @@ HAPI void *quickpanel_get_app_data(void) } /****************************************************************************** - * - * UI - * - ****************************************************************************/ + * + * UI + * + ****************************************************************************/ static void _ui_efl_cache_flush(void *evas) { int file_cache; @@ -97,7 +106,6 @@ static void _ui_efl_cache_flush(void *evas) int font_cache; retif(evas == NULL, , "Evas is NULL\n"); - file_cache = edje_file_cache_get(); collection_cache = edje_collection_cache_get(); image_cache = evas_image_cache_get(evas); @@ -127,7 +135,7 @@ static void _ui_efl_cache_flush(void *evas) static void _ui_handler_input_region_set(void *data, int contents_height) { struct appdata *ad = NULL; -#ifdef HAVE_X +#if defined(WINSYS_X11) Ecore_X_Window xwin; Ecore_X_Atom atom_window_input_region = 0; #endif @@ -135,8 +143,8 @@ static void _ui_handler_input_region_set(void *data, int contents_height) retif(data == NULL, , "Invialid parameter!"); ad = data; - -#ifdef HAVE_X + +#if defined(WINSYS_X11) xwin = elm_win_xwindow_get(ad->win); #endif @@ -171,10 +179,12 @@ static void _ui_handler_input_region_set(void *data, int contents_height) ,window_input_region[0] ,window_input_region[1] ,window_input_region[2] - ,window_input_region[3] - ); -#ifdef HAVE_X + ,window_input_region[3] + ); + +#if 0//defined(WINSYS_X11) atom_window_input_region = ecore_x_atom_get(STR_ATOM_WINDOW_INPUT_REGION); + ecore_x_window_prop_card32_set(xwin, atom_window_input_region, window_input_region, 4); #endif } @@ -182,7 +192,8 @@ static void _ui_handler_input_region_set(void *data, int contents_height) static void _ui_handler_content_region_set(void *data, int contents_height) { struct appdata *ad = NULL; -#ifdef HAVE_X + +#if defined(WINSYS_X11) Ecore_X_Window xwin; Ecore_X_Atom atom_window_contents_region = 0; #endif @@ -191,7 +202,7 @@ static void _ui_handler_content_region_set(void *data, int contents_height) retif(data == NULL, , "Invialid parameter!"); ad = data; -#ifdef HAVE_X +#if defined(WINSYS_X11) xwin = elm_win_xwindow_get(ad->win); #endif @@ -226,11 +237,12 @@ static void _ui_handler_content_region_set(void *data, int contents_height) ,window_contents_region[0] ,window_contents_region[1] ,window_contents_region[2] - ,window_contents_region[3] - ); -#ifdef HAVE_X - atom_window_contents_region = ecore_x_atom_get(STR_ATOM_WINDOW_CONTENTS_REGION); - ecore_x_window_prop_card32_set(xwin, atom_window_contents_region, window_contents_region, 4); + ,window_contents_region[3] + ); + +#if 0//defined(WINSYS_X11) + atom_window_contents_region = ecore_x_atom_get(STR_ATOM_WINDOW_CONTENTS_REGION); + ecore_x_window_prop_card32_set(xwin, atom_window_contents_region, window_contents_region, 4); #endif } @@ -271,10 +283,10 @@ static void _ui_geometry_info_set(void *data) } /***************************************************************************** - * - * ui rotation functions - * - ****************************************************************************/ + * + * ui rotation functions + * + ****************************************************************************/ static void _ui_rotation_wm_cb(void *data, Evas_Object *obj, void *event) { int angle = 0; @@ -349,16 +361,62 @@ static void _ui_rotate(void *data, int new_angle) } } } +#if 1 +static int _tzsh_set(Evas_Object *win) +{ + tzsh_h tzsh = NULL; + tzsh_quickpanel_service_h quickpanel_service = NULL; + tzsh_window tz_win; + + retif(!win, QP_FAIL, "Invialid parameter!"); + + tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL); + retif(!tzsh, QP_FAIL, "tzsh_create ERROR!"); + + struct appdata *ad = quickpanel_get_app_data(); + + ad->tzsh = tzsh; + + tz_win = elm_win_window_id_get(win); + if (!tz_win) { + tzsh_destroy(tzsh); + return QP_FAIL; + } + + quickpanel_service = tzsh_quickpanel_service_create(tzsh, tz_win); + if (!quickpanel_service) { + tzsh_destroy(tzsh); + return QP_FAIL; + } + ad->quickpanel_service = quickpanel_service; + + return QP_OK; +} + +static void _tzsh_unset(void) +{ + struct appdata *ad = quickpanel_get_app_data(); + + if (ad->quickpanel_service) { + tzsh_quickpanel_service_destroy(ad->quickpanel_service); + ad->quickpanel_service = NULL; + } + + if (ad->tzsh) { + tzsh_destroy(ad->tzsh); + ad->tzsh = NULL; + } +} +#endif /***************************************************************************** - * - * ui creation/deletion functions - * - ****************************************************************************/ + * + * ui creation/deletion functions + * + ****************************************************************************/ static Evas_Object *_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); @@ -379,15 +437,10 @@ static Evas_Object *_ui_window_add(const char *name, int prio) elm_win_wm_rotation_available_rotations_set(eo, rots, 4); } - /* icccm name class set */ -#ifdef HAVE_X - xwin = elm_win_xwindow_get(eo); - ecore_x_icccm_name_class_set(xwin, "QUICKPANEL", "QUICKPANEL"); + if( QP_OK != _tzsh_set(eo)) { + ERR("Failed to set tzsh"); + } - unsigned int val = 1; - ecore_x_window_prop_card32_set - (xwin, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1); -#endif evas_object_show(eo); } @@ -404,18 +457,18 @@ static int _ui_gui_create(void *data) retif(data == NULL, QP_FAIL, "Invialid parameter!"); ad->win = _ui_window_add("Quickpanel Window", - QP_WINDOW_PRIO); + QP_WINDOW_PRIO); retif(ad->win == NULL, QP_FAIL, "Failed to create main window"); //build error //elm_win_focus_allow_set(ad->win, EINA_TRUE); evas_object_smart_callback_add(ad->win, "wm,rotation,changed", - _ui_rotation_wm_cb, ad); + _ui_rotation_wm_cb, ad); ad->background = elm_bg_add(ad->win); if (ad->background != NULL) { evas_object_size_hint_weight_set(ad->background, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(ad->win, ad->background); evas_object_show(ad->background); } else { @@ -423,7 +476,7 @@ static int _ui_gui_create(void *data) } ad->view_root = quickpanel_uic_load_edj(ad->background, - DEFAULT_EDJ, "quickpanel/root", 0); + DEFAULT_EDJ, "quickpanel/root", 0); retif(ad->view_root == NULL, QP_FAIL, "Failed to create main page"); Evas_Object *pager_scroller = quickpanel_pager_new(ad->view_root, NULL); @@ -486,6 +539,8 @@ static int _ui_gui_destroy(void *data) ad->win = NULL; } + _tzsh_unset(); + return QP_OK; } @@ -495,15 +550,16 @@ static void _ui_setting_visibility_set(struct appdata *ad, int show) retif(ad->ly == NULL, , "data is NULL"); elm_object_signal_emit(ad->ly, "quickpanel.setting.show", - "quickpanel.prog"); + "quickpanel.prog"); } /***************************************************************************** - * - * event handler initialization functions - * - ****************************************************************************/ -static void _vconf_event_powerff_cb(keynode_t *node, void *data) + * + * event handler initialization functions + * + ****************************************************************************/ +static void _vconf_event_powerff_cb(keynode_t *node, + void *data) { int val; if (vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val) == 0 && @@ -512,7 +568,8 @@ static void _vconf_event_powerff_cb(keynode_t *node, void *data) } } -static void _vconf_event_lcdoff_cb(keynode_t *node, void *data) +static void _vconf_event_lcdoff_cb(keynode_t *node, + void *data) { int ret = 0; int pm_state = VCONFKEY_PM_STATE_NORMAL; @@ -524,14 +581,16 @@ static void _vconf_event_lcdoff_cb(keynode_t *node, void *data) } } -static Eina_Bool _ecore_event_client_message_cb(void *data, int type, void *event) +#if defined(WINSYS_X11) +static Eina_Bool _ecore_event_client_message_cb(void *data, int type, + void *event) { struct appdata *ad = data; -#ifdef HAVE_X + Ecore_X_Event_Client_Message *ev = event; retif(data == NULL || event == NULL, - ECORE_CALLBACK_RENEW, "Invalid parameter!"); + ECORE_CALLBACK_RENEW, "Invalid parameter!"); if (ev->message_type == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) { if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF) { @@ -568,9 +627,9 @@ static Eina_Bool _ecore_event_client_message_cb(void *data, int type, void *even _ui_handler_enable_set(EINA_FALSE); } } -#endif return ECORE_CALLBACK_RENEW; } +#endif static void _vconf_init(struct appdata *ad) { @@ -626,18 +685,19 @@ static void _edbus_fini(struct appdata *ad) static void _ecore_event_init(struct appdata *ad) { +#if defined(WINSYS_X11) + Ecore_Event_Handler *hdl = NULL; /* Register window rotate event */ -#ifdef HAVE_X hdl = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _ecore_event_client_message_cb, ad); -#endif if (hdl == NULL) { ERR("failed to add handler(ECORE_X_EVENT_CLIENT_MESSAGE)"); } ad->hdl_client_message = hdl; +#endif } static void _ecore_event_fini(struct appdata *ad) @@ -650,15 +710,15 @@ static void _ecore_event_fini(struct appdata *ad) static void _x_atom_init(void) { -#ifdef HAVE_X +#if defined(WINSYS_X11) E_ILLUME_ATOM_MV_QUICKPANEL_STATE = ecore_x_atom_get("_E_MOVE_QUICKPANEL_STATE"); #endif } /***************************************************************************** - * - * App efl main interface - * - ****************************************************************************/ + * + * App efl main interface + * + ****************************************************************************/ static void _sigaction_terminate_handler(int signum, siginfo_t *info, void *unused) { ERR("quickpanel going to be terminated"); @@ -753,12 +813,7 @@ static void _quickpanel_initialize(void *data) INFO("quickpanel run in %s", ad->is_emul ? "Emul" : "Device"); int w, h; -#ifdef HAVE_X - Ecore_X_Screen *screen = ecore_x_default_screen_get(); - //ecore_x_screen_size_get(screen, &w, &h); - elm_win_screen_size_get(screen, NULL, NULL, &w, &h); -#endif - + elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); ad->scale = elm_config_scale_get(); if (ad->scale < 0) { ad->scale = 1.0; @@ -785,9 +840,10 @@ static void _quickpanel_initialize(void *data) #ifdef QP_EMERGENCY_MODE_ENABLE quickpanel_emergency_mode_init(ad); #endif - quickpanel_conf_init(ad); quickpanel_keyboard_init(ad); +#if defined(WINSYS_X11) quickpanel_keyboard_x_init(ad); +#endif #ifdef QP_REMINDER_ENABLE quickpanel_reminder_init(ad); #endif @@ -806,9 +862,9 @@ static void _quickpanel_initialize(void *data) static bool _app_create_cb(void *data) { ERR(""); - +#if defined(WINSYS_X11) elm_config_engine_set("opengl_x11"); - +#endif elm_app_base_scale_set(1.8); pid_t pid; @@ -873,7 +929,9 @@ static void _app_terminate_cb(void *data) _ecore_event_fini(ad); quickpanel_keyboard_fini(ad); +#if defined(WINSYS_X11) quickpanel_keyboard_x_fini(ad); +#endif quickpanel_uninstall_fini(ad); #ifdef QP_REMINDER_ENABLE quickpanel_reminder_fini(ad); @@ -881,7 +939,6 @@ static void _app_terminate_cb(void *data) #ifdef QP_EMERGENCY_MODE_ENABLE quickpanel_emergency_mode_fini(ad); #endif - quickpanel_conf_fini(ad); /* delete quickpanel window */ _ui_gui_destroy(ad); @@ -946,10 +1003,12 @@ int main(int argc, char *argv[]) ERR("quickpanel is forked"); - ret = control_privilege(); +#if defined(WINSYS_X11) + ret = perm_app_set_privilege("org.tizen.", NULL, NULL); if (ret != 0) { WARN("Failed to control privilege!"); } +#endif event_callback.create = _app_create_cb; event_callback.terminate = _app_terminate_cb; @@ -957,9 +1016,9 @@ int main(int argc, char *argv[]) event_callback.resume = _app_resume_cb; event_callback.app_control = _app_service_cb; - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL); - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, NULL, NULL); - ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL); +// ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL); +// ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, NULL, NULL); +// ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL); ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _app_language_changed_cb, &ad); ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, _app_region_format_changed_cb, &ad); diff --git a/daemon/quickpanel-ui.h b/daemon/quickpanel-ui.h index 5fad73b..260bd70 100755 --- a/daemon/quickpanel-ui.h +++ b/daemon/quickpanel-ui.h @@ -19,15 +19,6 @@ #ifndef __QUICKPANEL_UI_H__ #define __QUICKPANEL_UI_H__ -#include <Elementary.h> -#include <E_DBus.h> -#ifdef HAVE_X -#include <Ecore_X.h> -#include <X11/Xatom.h> -#endif -#include "media.h" -#include "common_uic.h" - #if !defined(PACKAGE) # define PACKAGE "quickpanel" #endif @@ -86,6 +77,8 @@ struct appdata { Evas_Object *win; + tzsh_h tzsh; + tzsh_quickpanel_service_h quickpanel_service; Evas_Object *background; Evas_Object *view_root; @@ -143,6 +136,6 @@ typedef struct _QP_Module { Eina_Bool state; } QP_Module; -void *quickpanel_get_app_data(void); +extern void *quickpanel_get_app_data(void); #endif /* __QUICKPANEL_UI_H__ */ diff --git a/daemon/quickpanel-ui_x11.c b/daemon/quickpanel-ui_x11.c index 16af363..16af363 100644..100755 --- a/daemon/quickpanel-ui_x11.c +++ b/daemon/quickpanel-ui_x11.c diff --git a/daemon/service/animated_icon.c b/daemon/service/animated_icon.c index 352ca76..3fcdb4c 100644..100755 --- a/daemon/service/animated_icon.c +++ b/daemon/service/animated_icon.c @@ -15,7 +15,10 @@ * */ - +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" diff --git a/daemon/service/animated_icon.h b/daemon/service/animated_icon.h index 20f3890..0c970a7 100644..100755 --- a/daemon/service/animated_icon.h +++ b/daemon/service/animated_icon.h @@ -20,7 +20,6 @@ #ifndef _QP_SERVICE_ANIMATED_ICON_DEF_ #define _QP_SERVICE_ANIMATED_ICON_DEF_ -#include "quickpanel-ui.h" typedef enum _qp_animated_icon_type { QP_ANIMATED_ICON_NONE = -1, @@ -29,7 +28,7 @@ typedef enum _qp_animated_icon_type { QP_ANIMATED_ICON_INSTALL, } qp_animated_icon_type; -Evas_Object *quickpanel_animated_icon_get(Evas_Object *parent, const char *path); -int quickpanel_animated_icon_is_same_icon(Evas_Object *view, const char *path); +extern Evas_Object *quickpanel_animated_icon_get(Evas_Object *parent, const char *path); +extern int quickpanel_animated_icon_is_same_icon(Evas_Object *view, const char *path); #endif diff --git a/daemon/service/emergency_mode.c b/daemon/service/emergency_mode.c index 520b0d2..5752ff6 100644..100755 --- a/daemon/service/emergency_mode.c +++ b/daemon/service/emergency_mode.c @@ -15,17 +15,25 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <syspopup_caller.h> #include <pkgmgr-info.h> -#include <Eina.h> #include <bundle_internal.h> +#include <notification.h> +#include <notification_internal.h> +#include <notification_list.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "modules.h" #include "datetime.h" #include "emergency_mode.h" - +#include "quickpanel-ui.h" #ifdef QP_SETTING_ENABLE extern QP_Module settings_view_featured; @@ -65,7 +73,7 @@ static void _delete_unpermitted_app(void) list_traverse = notification_list_get_next(list_traverse); } - + if (noti_list != NULL) { notification_free_list(noti_list); noti_list = NULL; @@ -172,14 +180,14 @@ static int _register_permitted_apps(void) if (ret != PMINFO_R_OK) { return -1; } - -#ifdef HAVE_X + +#if defined(WINSYS_X11) ret = pkgmgrinfo_appinfo_filter_add_int(handle, PMINFO_APPINFO_PROP_APP_SUPPORT_MODE, 1); -#endif if (ret != PMINFO_R_OK) { pkgmgrinfo_appinfo_filter_destroy(handle); return -1; } +#endif ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, _app_list_cb, NULL); if (ret != PMINFO_R_OK) { @@ -280,9 +288,7 @@ HAPI int quickpanel_emergency_mode_notification_filter(notification_h noti, int DBG("Emergency mode filter is called: %s", pkgname); if (!quickpanel_emergency_mode_is_permitted_app(pkgname)) { if (is_delete) { - notification_delete_by_priv_id(pkgname, - NOTIFICATION_TYPE_NONE, - priv_id); + notification_delete_by_priv_id(pkgname, NOTIFICATION_TYPE_NONE, priv_id); } return 1; } diff --git a/daemon/service/emergency_mode.h b/daemon/service/emergency_mode.h index e0655fe..6ca6290 100644..100755 --- a/daemon/service/emergency_mode.h +++ b/daemon/service/emergency_mode.h @@ -15,18 +15,17 @@ * */ -#include <notification.h> #ifndef _QP_EMERGENCY_MODE_DEF_ #define _QP_EMERGENCY_MODE_DEF_ #define PACKAGE_EMERGENCY_MODE_SETTING "setting-emergency-efl" -void quickpanel_emergency_mode_init(void *data); -void quickpanel_emergency_mode_fini(void *data); -int quickpanel_emergency_mode_is_permitted_app(const char *appid); -int quickpanel_emergency_mode_is_on(void); -int quickpanel_emergency_mode_notification_filter(notification_h noti, int is_delete); -int quickpanel_emergency_mode_syspopup_launch(void); +extern void quickpanel_emergency_mode_init(void *data); +extern void quickpanel_emergency_mode_fini(void *data); +extern int quickpanel_emergency_mode_is_permitted_app(const char *appid); +extern int quickpanel_emergency_mode_is_on(void); +extern int quickpanel_emergency_mode_notification_filter(notification_h noti, int is_delete); +extern int quickpanel_emergency_mode_syspopup_launch(void); #endif diff --git a/daemon/service/keyboard.c b/daemon/service/keyboard.c index 94882ea..946cc79 100644..100755 --- a/daemon/service/keyboard.c +++ b/daemon/service/keyboard.c @@ -15,13 +15,23 @@ * */ +#include <Elementary.h> #include <vconf.h> -#ifdef HAVE_X -#include <utilX.h> -#include <X11/Xlib.h> -#endif #include <Ecore_Input.h> #include <feedback.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> + +#if defined(WINSYS_X11) +#include <Ecore_X.h> +#include <X11/Xlib.h> +#include <utilX.h> +#endif +#include <E_DBus.h> + +#include "quickpanel-ui.h" // appdata +#include "common_uic.h" #include "common.h" #include "noti_util.h" #include "keyboard.h" @@ -84,9 +94,11 @@ HAPI void quickpanel_keyboard_init(void *data) Ecore_Event_Handler *hdl_key_up = NULL; retif(ad == NULL, , "Invalid parameter!"); - if (elm_win_keygrab_set(elm_win_xwindow_get(ad->win), KEY_QUICKPANEL, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED) != 0) { +#if defined(WINSYS_X11) + if (utilx_grab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_QUICKPANEL, SHARED_GRAB) != 0) { ERR("failed to grab KEY_QUICKPANEL"); } +#endif hdl_key_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _service_hardkey_down_cb, ad); if (hdl_key_down == NULL) { @@ -117,10 +129,11 @@ HAPI void quickpanel_keyboard_fini(void *data) ad->hdl_hardkey_down = NULL; } - if (elm_win_keygrab_unset(elm_win_xwindow_get(ad->win), KEY_QUICKPANEL, 0, 0) != 0) { +#if defined(WINSYS_X11) + if (utilx_ungrab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_QUICKPANEL) != 0) { ERR("failed to ungrab KEY_QUICKPANEL"); } - +#endif } HAPI void quickpanel_keyboard_openning_init(void *data) @@ -128,17 +141,19 @@ HAPI void quickpanel_keyboard_openning_init(void *data) struct appdata *ad = data; retif(ad == NULL, , "Invalid parameter!"); - if (elm_win_keygrab_set(elm_win_xwindow_get(ad->win), KEY_BACK, 0, 0, 0, ELM_WIN_KEYGRAB_EXCLUSIVE ) != 0) { +#if defined(WINSYS_X11) + if (utilx_grab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_BACK, EXCLUSIVE_GRAB) != 0) { ERR("failed to grab KEY_BACK"); } - if (elm_win_keygrab_set(elm_win_xwindow_get(ad->win), KEY_MENU, 0, 0, 0, ELM_WIN_KEYGRAB_EXCLUSIVE ) != 0) { + if (utilx_grab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_MENU, EXCLUSIVE_GRAB) != 0) { ERR("failed to grab KEY_MENU"); } - if (elm_win_keygrab_set(elm_win_xwindow_get(ad->win), KEY_HOME, 0, 0, 0, ELM_WIN_KEYGRAB_SHARED) != 0) { + if (utilx_grab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_HOME, SHARED_GRAB) != 0) { ERR("failed to grab KEY_HOME"); } +#endif } HAPI void quickpanel_keyboard_closing_fini(void *data) @@ -146,15 +161,17 @@ HAPI void quickpanel_keyboard_closing_fini(void *data) struct appdata *ad = data; retif(ad == NULL, , "Invalid parameter!"); - if (elm_win_keygrab_unset(elm_win_xwindow_get(ad->win), KEY_BACK ,0 ,0) != 0) { +#if defined(WINSYS_X11) + if (utilx_ungrab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_BACK) != 0) { ERR("failed to ungrab KEY_BACK"); } - if (elm_win_keygrab_unset(elm_win_xwindow_get(ad->win), KEY_MENU ,0 ,0) != 0) { + if (utilx_ungrab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_MENU) != 0) { ERR("failed to ungrab KEY_MENU"); } - if (elm_win_keygrab_unset(elm_win_xwindow_get(ad->win), KEY_HOME ,0 ,0) != 0) { + if (utilx_ungrab_key(ecore_x_display_get(), elm_win_xwindow_get(ad->win), KEY_HOME) != 0) { ERR("failed to ungrab KEY_HOME"); } +#endif } diff --git a/daemon/service/keyboard.h b/daemon/service/keyboard.h index 6d6de63..15f8a3b 100644..100755 --- a/daemon/service/keyboard.h +++ b/daemon/service/keyboard.h @@ -19,11 +19,10 @@ #ifndef _QP_SERVICE_KEYBOARD_DEF_ #define _QP_SERVICE_KEYBOARD_DEF_ -#include "quickpanel-ui.h" -void quickpanel_keyboard_init(void *data); -void quickpanel_keyboard_fini(void *data); -void quickpanel_keyboard_openning_init(void *data); -void quickpanel_keyboard_closing_fini(void *data); +extern void quickpanel_keyboard_init(void *data); +extern void quickpanel_keyboard_fini(void *data); +extern void quickpanel_keyboard_openning_init(void *data); +extern void quickpanel_keyboard_closing_fini(void *data); #endif diff --git a/daemon/service/keyboard_x.c b/daemon/service/keyboard_x.c index 4dc749b..89ad342 100644..100755 --- a/daemon/service/keyboard_x.c +++ b/daemon/service/keyboard_x.c @@ -15,16 +15,22 @@ * */ - -#include <vconf.h> -#ifdef HAVE_X -#include <utilX.h> +#include <Elementary.h> +#include <Ecore_X.h> +#include <Ecore_Input.h> #include <X11/Xlib.h> #include <X11/extensions/XInput.h> #include <X11/extensions/XInput2.h> -#endif -#include <Ecore_Input.h> + +#include <vconf.h> +#include <utilX.h> #include <feedback.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" #include "common.h" #include "noti_util.h" #include "keyboard_x.h" @@ -50,26 +56,24 @@ typedef struct _key_info { } key_info; key_info key_infos[] = { - {TAB, "Tab", "Tab", "\t", "\t"}, - {RETURN, "Return", "Return", "\n", "\n"}, - {ARROW_UP, "Up", "Up", NULL, NULL}, - {ARROW_KP_UP, "Up", "Up", NULL, NULL}, - {ARROW_DOWN, "Down", "Down", NULL, NULL}, - {ARROW_KP_DOWN, "Down", "Down", NULL, NULL}, - {ARROW_LEFT, "Left", "Left", NULL, NULL}, - {ARROW_KP_LEFT, "Left", "Left", NULL, NULL}, - {ARROW_RIGHT, "Right", "Right", NULL, NULL}, - {ARROW_KP_RIGHT, "Right", "Right", NULL, NULL}, - {SHIFT, "Shift", "Shift", NULL, NULL}, + { TAB, "Tab", "Tab", "\t", "\t" }, + { RETURN, "Return", "Return", "\n", "\n" }, + { ARROW_UP, "Up", "Up", NULL, NULL }, + { ARROW_KP_UP, "Up", "Up", NULL, NULL }, + { ARROW_DOWN, "Down", "Down", NULL, NULL }, + { ARROW_KP_DOWN, "Down", "Down", NULL, NULL }, + { ARROW_LEFT, "Left", "Left", NULL, NULL }, + { ARROW_KP_LEFT, "Left", "Left", NULL, NULL }, + { ARROW_RIGHT, "Right", "Right", NULL, NULL }, + { ARROW_KP_RIGHT, "Right", "Right", NULL, NULL }, + { SHIFT, "Shift", "Shift", NULL, NULL }, }; static int _cb_event_generic(void *data, int ev_type, void *event); static Eina_Bool _xinput_init(void); static void _key_event_select(void); -#ifdef HAVE_X static void _focus_ui_process_press(XIRawEvent *raw_event); static void _focus_ui_process_release(XIRawEvent *raw_event); -#endif static struct _s_info { int xi2_opcode; @@ -99,71 +103,70 @@ static int _key_event_validation_check(int keycode) static void _key_event_select(void) { int rc; -#ifdef HAVE_X XIEventMask mask; - Ecore_X_Display *d = NULL; + Ecore_X_Display *d; - d = ecore_x_display_get(); - if (d == NULL) { - ERR("failed to get ecore-display"); - return; - } + d = ecore_x_display_get(); + if (d == NULL) { + ERR("failed to get ecore-display"); + return; + } mask.mask_len = XIMaskLen(XI_LASTEVENT); mask.deviceid = XIAllDevices; - mask.mask = calloc(mask.mask_len, sizeof(char)); - if (mask.mask == NULL) { - ERR("failed to get ecore-display"); - return; - } - memset(mask.mask, 0, mask.mask_len); - - XISetMask(mask.mask, XI_RawKeyPress); - XISetMask(mask.mask, XI_RawKeyRelease); - - rc = XISelectEvents(d, ecore_x_window_root_first_get(), &mask, 1); - if (Success != rc) { - ERR("Failed to select XInput extension events"); - } - if (mask.mask) { + mask.mask = calloc(mask.mask_len, sizeof(char)); + if (mask.mask == NULL) { + ERR("failed to get ecore-display"); + return; + } + memset(mask.mask, 0, mask.mask_len); + + XISetMask(mask.mask, XI_RawKeyPress); + XISetMask(mask.mask, XI_RawKeyRelease); + + rc = XISelectEvents(d, ecore_x_window_root_first_get(), &mask, 1); + if (Success != rc) { + ERR("Failed to select XInput extension events"); + } + if (mask.mask) { free( mask.mask); } - ecore_x_sync(); -#endif + ecore_x_sync(); } static Eina_Bool _xinput_init(void) { -#ifdef HAVE_X - int event, error; + int event, error; - if (!XQueryExtension(ecore_x_display_get(), "XInputExtension", - &s_info.xi2_opcode, &event, &error)) { - s_info.xi2_opcode = -1; + if (!XQueryExtension(ecore_x_display_get(), "XInputExtension", &s_info.xi2_opcode, &event, &error)) { + s_info.xi2_opcode = -1; - SERR("failed to initialize key event receiver"); - return EINA_FALSE; - } -#endif - _key_event_select(); + SERR("failed to initialize key event receiver"); + return EINA_FALSE; + } + + _key_event_select(); - return EINA_TRUE; + return EINA_TRUE; } static int _cb_event_generic(void *data, int ev_type, void *event) { -#ifdef HAVE_X - Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)event; - XIDeviceEvent *evData = (XIDeviceEvent *)(e->data); + Ecore_X_Event_Generic *e; + XIDeviceEvent *evData; - if ( e->extension != s_info.xi2_opcode ) { + e = (Ecore_X_Event_Generic *)event; + evData = (XIDeviceEvent *)(e->data); + + if (e->extension != s_info.xi2_opcode) { return ECORE_CALLBACK_PASS_ON; } - if ( !evData || evData->send_event ) { + + if (!evData || evData->send_event) { return ECORE_CALLBACK_PASS_ON; } - switch( e->evtype ) { + switch (e->evtype) { case XI_RawKeyPress: if (evData->deviceid == 3) { break; @@ -179,17 +182,17 @@ static int _cb_event_generic(void *data, int ev_type, void *event) default: break; } -#endif return ECORE_CALLBACK_PASS_ON; } -#ifdef HAVE_X static void _focus_ui_process_press(XIRawEvent *raw_event) { XEvent xev; + Ecore_X_Display *d; + struct appdata *ad; - struct appdata *ad = quickpanel_get_app_data(); + ad = quickpanel_get_app_data(); retif(ad == NULL, , "invalid data."); retif(raw_event == NULL, , "invalid data."); @@ -201,11 +204,11 @@ static void _focus_ui_process_press(XIRawEvent *raw_event) return; } - Ecore_X_Display *d = ecore_x_display_get(); - if (d == NULL) { - ERR("failed to get ecore-display"); - return; - } + d = ecore_x_display_get(); + if (d == NULL) { + ERR("failed to get ecore-display"); + return; + } memset(&xev, 0, sizeof(XEvent)); xev.xany.display = ecore_x_display_get(); @@ -221,16 +224,17 @@ static void _focus_ui_process_press(XIRawEvent *raw_event) xev.xkey.subwindow = None; xev.xkey.type = KeyPress; xev.xkey.window = elm_win_xwindow_get(ad->win); - XSendEvent(d, elm_win_xwindow_get(ad->win) - , False, NoEventMask, &xev); + XSendEvent(d, elm_win_xwindow_get(ad->win) , False, NoEventMask, &xev); DBG("keypressed:%d", raw_event->detail); } static void _focus_ui_process_release(XIRawEvent *raw_event) { XEvent xev; + Ecore_X_Display *d; + struct appdata *ad; - struct appdata *ad = quickpanel_get_app_data(); + ad = quickpanel_get_app_data(); retif(ad == NULL, , "invalid data."); retif(raw_event == NULL, , "invalid data."); @@ -238,15 +242,16 @@ static void _focus_ui_process_release(XIRawEvent *raw_event) s_info.is_shift_pressed = 0; return; } + if (_key_event_validation_check(raw_event->detail) == 0) { return; } - Ecore_X_Display *d = ecore_x_display_get(); - if (d == NULL) { - ERR("failed to get ecore-display"); - return; - } + d = ecore_x_display_get(); + if (d == NULL) { + ERR("failed to get ecore-display"); + return; + } memset(&xev, 0, sizeof(XEvent)); xev.xany.display = d; @@ -262,11 +267,9 @@ static void _focus_ui_process_release(XIRawEvent *raw_event) xev.xkey.subwindow = None; xev.xkey.type = KeyRelease; xev.xkey.window = elm_win_xwindow_get(ad->win); - XSendEvent(d, elm_win_xwindow_get(ad->win) - , False, NoEventMask, &xev); + XSendEvent(d, elm_win_xwindow_get(ad->win) , False, NoEventMask, &xev); DBG("keyrelease:%d", raw_event->detail); } -#endif static void _focus_cleanup(void *data) { @@ -292,7 +295,9 @@ HAPI void quickpanel_keyboard_x_init(void *data) HAPI void quickpanel_keyboard_x_fini(void *data) { - struct appdata *ad = data; + struct appdata *ad; + + ad = data; retif(ad == NULL, , "Invalid parameter!"); if (s_info.hdl_key_event != NULL) { @@ -305,21 +310,23 @@ HAPI void quickpanel_keyboard_x_fini(void *data) HAPI void quickpanel_keyboard_x_openning_init(void *data) { - struct appdata *ad = data; + struct appdata *ad; + + ad = data; retif(ad == NULL, , "Invalid parameter!"); if (s_info.hdl_key_event != NULL) { ecore_event_handler_del(s_info.hdl_key_event); s_info.hdl_key_event = NULL; } -#ifdef HAVE_X s_info.hdl_key_event = ecore_event_handler_add(ECORE_X_EVENT_GENERIC, (Ecore_Event_Handler_Cb)_cb_event_generic, NULL); -#endif } HAPI void quickpanel_keyboard_x_closing_fini(void *data) { - struct appdata *ad = data; + struct appdata *ad; + + ad = data; retif(ad == NULL, , "Invalid parameter!"); if (s_info.hdl_key_event != NULL) { diff --git a/daemon/service/keyboard_x.h b/daemon/service/keyboard_x.h index 8af2dbf..8af2dbf 100644..100755 --- a/daemon/service/keyboard_x.h +++ b/daemon/service/keyboard_x.h diff --git a/daemon/service/keyboard_x_x11.c b/daemon/service/keyboard_x_x11.c index 24d7db3..2428009 100644..100755 --- a/daemon/service/keyboard_x_x11.c +++ b/daemon/service/keyboard_x_x11.c @@ -15,15 +15,22 @@ * */ - -#include <vconf.h> -#include <utilX.h> +#include <Elementary.h> +#include <Ecore_X.h> +#include <Ecore_Input.h> #include <X11/Xlib.h> #include <X11/extensions/XInput.h> #include <X11/extensions/XInput2.h> -#include <Ecore_Input.h> +#include <vconf.h> +#include <utilX.h> #include <feedback.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <notification.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" #include "common.h" #include "noti_util.h" #include "keyboard_x.h" diff --git a/daemon/service/noti_led.c b/daemon/service/noti_led.c index 9105043..c4568a2 100755 --- a/daemon/service/noti_led.c +++ b/daemon/service/noti_led.c @@ -15,8 +15,13 @@ * */ +#include <Elementary.h> +#include <glib.h> #include <vconf.h> +#include <notification.h> +#include <notification_internal.h> + #include "common.h" #include "noti_util.h" #include "noti_led.h" @@ -66,8 +71,7 @@ static void _led_entry_del(QP_LED_T *led_entry) free(led_entry); } -static int -_led_list_sort_cb(const void *data1, const void *data2) +static int _led_list_sort_cb(const void *data1, const void *data2) { QP_LED_T *entry_1 = (QP_LED_T *)data1; QP_LED_T *entry_2 = (QP_LED_T *)data2; @@ -148,9 +152,8 @@ static inline int _is_led_enabled(void) int ret = -1; int status = 1; -#ifdef HAVE_x ret = vconf_get_bool(VCONFKEY_SETAPPL_LED_INDICATOR_NOTIFICATIONS, &status); -#endif + if (ret == 0) { if (status == 0) { ERR("LED notification turned off"); @@ -345,12 +348,11 @@ HAPI void quickpanel_noti_led_init(void *data, void *nodes) struct appdata *ad = data; retif(ad == NULL, , "Invalid parameter!"); -#ifdef HAVE_X ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_LED_INDICATOR_NOTIFICATIONS,_led_option_vconf_cb, ad); -#endif + if (ret != 0) { ERR("failed to notify key[%s] : %d", - VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, ret); + VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, ret); } if (nodes != NULL) { @@ -363,12 +365,11 @@ HAPI void quickpanel_noti_led_fini(void *data) int ret = 0; struct appdata *ad = data; retif(ad == NULL, , "Invalid parameter!"); -#ifdef HAVE_X + ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_LED_INDICATOR_NOTIFICATIONS,_led_option_vconf_cb); if (ret != 0) { ERR("failed to ignore key[%s] : %d", VCONFKEY_SETAPPL_LED_INDICATOR_NOTIFICATIONS, ret); } -#endif _led_list_clean_up(); } diff --git a/daemon/service/noti_led.h b/daemon/service/noti_led.h index 63c3c69..f3593da 100755 --- a/daemon/service/noti_led.h +++ b/daemon/service/noti_led.h @@ -19,11 +19,8 @@ #ifndef _QP_NOTI_LED_DEF_ #define _QP_NOTI_LED_DEF_ -#include <notification.h> -#include "quickpanel-ui.h" - -void quickpanel_noti_led_init(void *data, void *noti_node); -void quickpanel_noti_led_fini(void *data); -void quickpanel_noti_led_proc(notification_h noti, int op_type); +extern void quickpanel_noti_led_init(void *data, void *noti_node); +extern void quickpanel_noti_led_fini(void *data); +extern void quickpanel_noti_led_proc(notification_h noti, int op_type); #endif diff --git a/daemon/service/reminder.c b/daemon/service/reminder.c index cd702d8..9a99639 100644..100755 --- a/daemon/service/reminder.c +++ b/daemon/service/reminder.c @@ -15,15 +15,26 @@ * */ +#include <Elementary.h> +#include <glib.h> #include <alarm.h> #include <time.h> #include <unistd.h> #include <vconf.h> #include <system_settings.h> +#include <notification.h> +#include <notification_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <feedback.h> +#include <player.h> +#include <E_DBus.h> #include "quickpanel-ui.h" +#include "common_uic.h" #include "common.h" +#include "noti_node.h" #include "media.h" #include "noti.h" @@ -84,11 +95,10 @@ static void _feedback_sound_play(void) if (is_play_default) { char *default_msg_tone = NULL; -#ifdef HAVE_X ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &default_msg_tone); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "ailed to set key(%s) : %d", SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, ret); SDBG("Reminded setting sound[%s]", default_msg_tone); -#endif + if (default_msg_tone != NULL) { ret = quickpanel_media_player_play(SOUND_TYPE_NOTIFICATION, default_msg_tone); free(default_msg_tone); @@ -114,15 +124,15 @@ static int _reminder_interval_get(void) retif(ret != 0, 0, "failed to get vconf VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT"); switch (key) { - case 1: - min = 2; - break; - case 2: - min = 5; - break; - case 3: - min = 10; - break; + case 1: + min = 2; + break; + case 2: + min = 5; + break; + case 3: + min = 10; + break; } DBG("interval:%d", min); diff --git a/daemon/service/reminder.h b/daemon/service/reminder.h index 2bdf7d0..56d44b3 100644..100755 --- a/daemon/service/reminder.h +++ b/daemon/service/reminder.h @@ -19,9 +19,9 @@ #ifndef _QP_REMINDER_DEF_ #define _QP_REMINDER_DEF_ -void quickpanel_reminder_init(void *data); -void quickpanel_reminder_fini(void *data); -void quickpanel_reminder_start(void *data); -void quickpanel_reminder_stop(void *data); +extern void quickpanel_reminder_init(void *data); +extern void quickpanel_reminder_fini(void *data); +extern void quickpanel_reminder_start(void *data); +extern void quickpanel_reminder_stop(void *data); #endif diff --git a/daemon/service/smart_alert.c b/daemon/service/smart_alert.c index 4d16f57..f60f4b9 100644..100755 --- a/daemon/service/smart_alert.c +++ b/daemon/service/smart_alert.c @@ -15,8 +15,11 @@ * */ +#include <Elementary.h> #include <vconf.h> +#include <notification_list.h> + #include "common.h" #include "noti_util.h" #include "smart_alert.h" @@ -69,17 +72,16 @@ HAPI void quickpanel_smart_alert_update_info(notification_h noti) if (noti == NULL) { event_count_call = quickpanel_noti_util_get_event_count_by_pkgname(SMART_ALARM_CALL_PKGNAME); event_count_vtcall = quickpanel_noti_util_get_event_count_by_pkgname(SMART_ALARM_VTCALL_PKGNAME); - ERR("call event set, count:%d", MAX(event_count_call, event_count_vtcall)); + ERR("call event set, count:%d, %d", event_count_call, event_count_vtcall); } else { notification_get_pkgname(noti, &pkgname); retif(pkgname == NULL, , "Invalid parameter!"); - if (strncmp(pkgname, SMART_ALARM_CALL_PKGNAME, strlen(pkgname)) == 0 - || strncmp(pkgname, SMART_ALARM_VTCALL_PKGNAME, strlen(pkgname)) == 0) { + if (strncmp(pkgname, SMART_ALARM_CALL_PKGNAME, strlen(pkgname)) == 0 || strncmp(pkgname, SMART_ALARM_VTCALL_PKGNAME, strlen(pkgname)) == 0) { event_count_call = quickpanel_noti_util_get_event_count_by_pkgname(SMART_ALARM_CALL_PKGNAME); event_count_vtcall = quickpanel_noti_util_get_event_count_by_pkgname(SMART_ALARM_VTCALL_PKGNAME); - ERR("call event set, count:%d", MAX(event_count_call, event_count_vtcall)); + ERR("call event set, count:%d, %d", event_count_call, event_count_vtcall); } } } diff --git a/daemon/service/smart_alert.h b/daemon/service/smart_alert.h index 0994627..397b1e0 100644..100755 --- a/daemon/service/smart_alert.h +++ b/daemon/service/smart_alert.h @@ -19,8 +19,6 @@ #ifndef _QP_SMART_ALERT_DEF_ #define _QP_SMART_ALERT_DEF_ -#include <notification.h> -#include "quickpanel-ui.h" #if !defined(VENDOR) #define SMART_ALARM_CALL_PKGNAME "org.tizen.call-notification" @@ -32,6 +30,6 @@ #define SMART_ALARM_MSG_PKGNAME VENDOR".message" #endif -void quickpanel_smart_alert_update_info(notification_h noti); +extern void quickpanel_smart_alert_update_info(notification_h noti); #endif diff --git a/daemon/service/uninstall.c b/daemon/service/uninstall.c index f520f7e..a72249b 100644..100755 --- a/daemon/service/uninstall.c +++ b/daemon/service/uninstall.c @@ -15,12 +15,16 @@ * */ +#include <Elementary.h> +#include <Eina.h> #include <vconf.h> #include <pkgmgr-info.h> #include <package-manager.h> #include <notification.h> +#include <notification_internal.h> #include <badge.h> + #include "common.h" #include "uninstall.h" @@ -75,42 +79,41 @@ static int _is_item_exist(const char *pkgid, int remove_if_exist) return ret; } -static int _pkgmgr_event_cb(int req_id, const char *pkg_type, const char *pkgid, - const char *key, const char *val, const void *pmsg, void *priv_data) +static int _pkgmgr_event_cb(int req_id, const char *pkg_type, const char *pkgid, const char *key, const char *val, const void *pmsg, void *priv_data) { - if (pkgid == NULL) { + if (pkgid == NULL) { return 0; } - SDBG("pkg:%s key:%s val:%s", pkgid, key, val); + SDBG("pkg:%s key:%s val:%s", pkgid, key, val); - if (key != NULL && val != NULL) { - if (strcasecmp(key, QP_PKGMGR_STR_START) == 0 && - strcasecmp(val, QP_PKGMGR_STR_UNINSTALL) == 0) { + if (key != NULL && val != NULL) { + if (strcasecmp(key, QP_PKGMGR_STR_START) == 0 && + strcasecmp(val, QP_PKGMGR_STR_UNINSTALL) == 0) { - ERR("Pkg:%s is being uninstalled", pkgid); + ERR("Pkg:%s is being uninstalled", pkgid); - Pkg_Event *event = calloc(1, sizeof(Pkg_Event)); - if (event != NULL) { - event->pkgname = strdup(pkgid); - s_info.event_list = eina_list_append(s_info.event_list, event); - } else { - ERR("failed to create event item"); - } + Pkg_Event *event = calloc(1, sizeof(Pkg_Event)); + if (event != NULL) { + event->pkgname = strdup(pkgid); + s_info.event_list = eina_list_append(s_info.event_list, event); + } else { + ERR("failed to create event item"); + } - return 0; - } else if (strcasecmp(key, QP_PKGMGR_STR_END) == 0 && - strcasecmp(val, QP_PKGMGR_STR_OK) == 0) { - if (_is_item_exist(pkgid, 1) == 1) { - ERR("Pkg:%s is uninstalled, delete related resource", pkgid); + return 0; + } else if (strcasecmp(key, QP_PKGMGR_STR_END) == 0 && + strcasecmp(val, QP_PKGMGR_STR_OK) == 0) { + if (_is_item_exist(pkgid, 1) == 1) { + ERR("Pkg:%s is uninstalled, delete related resource", pkgid); notification_delete_all_by_type(pkgid, NOTIFICATION_TYPE_NOTI); notification_delete_all_by_type(pkgid, NOTIFICATION_TYPE_ONGOING); badge_remove(pkgid); - } - } - } + } + } + } - return 0; + return 0; } HAPI void quickpanel_uninstall_init(void *data) @@ -119,7 +122,7 @@ HAPI void quickpanel_uninstall_init(void *data) pkgmgr_client *client = pkgmgr_client_new(PC_LISTENING); if (client != NULL) { - if ((ret = pkgmgr_client_listen_status(client, _pkgmgr_event_cb, data)) != PKGMGR_R_OK) { + if ((ret = pkgmgr_client_listen_status(client, (void*)_pkgmgr_event_cb, data)) != PKGMGR_R_OK) { ERR("Failed to listen pkgmgr event:%d", ret); } s_info.client = client; diff --git a/daemon/service/uninstall.h b/daemon/service/uninstall.h index 7e28d09..77bcf73 100644..100755 --- a/daemon/service/uninstall.h +++ b/daemon/service/uninstall.h @@ -19,9 +19,8 @@ #ifndef _QP_SERVICE_UNINSTALL_DEF_ #define _QP_SERVICE_UNINSTALL_DEF_ -#include "quickpanel-ui.h" -void quickpanel_uninstall_init(void *data); -void quickpanel_uninstall_fini(void *data); +extern void quickpanel_uninstall_init(void *data); +extern void quickpanel_uninstall_fini(void *data); #endif diff --git a/daemon/settings/modules/assistive_light.c b/daemon/settings/modules/assistive_light.c index 168b338..bfe5d32 100644..100755 --- a/daemon/settings/modules/assistive_light.c +++ b/daemon/settings/modules/assistive_light.c @@ -15,10 +15,14 @@ * */ +#include <Elementary.h> #include <app.h> #include <device/led.h> #include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "common.h" #include "quickpanel-ui.h" @@ -26,7 +30,6 @@ #include "setting_utils.h" #include "setting_module_api.h" - #define E_DATA_POPUP_MODULE_ITEM "mobule_item" #define BUTTON_LABEL _("IDS_ST_BUTTON2_TORCH_ABB") #define BUTTON_ICON_NORMAL "quick_icon_torch.png" @@ -46,11 +49,9 @@ static void _on_vconf_assetive_light_changed(keynode_t *node, void *user_data) ERR("node == NULL"); return; } - -#ifdef HAVE_X +#if defined(WINSYS_X11) mode = node->value.b; #endif - quickpanel_setting_module_icon_state_set(user_data, mode); _status_update(user_data, mode, FLAG_VALUE_VOID); } diff --git a/daemon/settings/modules/bluetooth.c b/daemon/settings/modules/bluetooth.c index 6b82217..eeefa95 100644..100755 --- a/daemon/settings/modules/bluetooth.c +++ b/daemon/settings/modules/bluetooth.c @@ -15,15 +15,21 @@ * */ +#include <Elementary.h> + #include <bluetooth.h> #include <vconf.h> #include <bluetooth_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_ST_BUTTON2_BLUETOOTH_ABB") #define BUTTON_ICON_NORMAL "quick_icon_bluetooth.png" @@ -110,8 +116,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret; int is_on = 0; @@ -142,9 +147,7 @@ static void _mouse_clicked_cb(void *data, quickpanel_setting_module_icon_timer_add(module); } -static void _bluetooth_status_changed_cb(int result, - bt_adapter_state_e adapter_state, - void *user_data) +static void _bluetooth_status_changed_cb(int result, bt_adapter_state_e adapter_state, void *user_data) { QP_Module_Setting *module = (QP_Module_Setting *)user_data; retif(module == NULL, , "Invalid parameter!"); diff --git a/daemon/settings/modules/flightmode.c b/daemon/settings/modules/flightmode.c index e878fd2..73a8558 100644..100755 --- a/daemon/settings/modules/flightmode.c +++ b/daemon/settings/modules/flightmode.c @@ -15,6 +15,7 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <syspopup_caller.h> @@ -24,12 +25,16 @@ #include <TapiUtility.h> #include <system_settings.h> #include <bundle_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" - +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_ST_BUTTON2_FLIGHT_NMODE") #define BUTTON_ICON_NORMAL "quick_icon_flightmode.png" @@ -114,15 +119,13 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag { LOGD(""); int ret = 0; - int status = 0; + bool status = false; retif(module == NULL, , "Invalid parameter!"); -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &status); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "fail to get VCONFKEY_TELEPHONY_FLIGHT_MODE:%d", ret); -#endif - if (status == 1) { + if (status == true) { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_ON); } else { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_OFF); @@ -131,9 +134,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag quickpanel_setting_module_progress_mode_set(module, FLAG_DISABLE, FLAG_TURN_OFF); quickpanel_setting_module_icon_timer_del(module); - quickpanel_setting_module_icon_view_update(module, - quickpanel_setting_module_icon_state_get(module), - FLAG_VALUE_VOID); + quickpanel_setting_module_icon_view_update(module, quickpanel_setting_module_icon_state_get(module), FLAG_VALUE_VOID); } static void _tapi_flight_mode_cb(TapiHandle *handle, int result, void *data, void *user_data) @@ -156,14 +157,14 @@ static int _tapi_flight_mode_set(int on, void *data) if (on == 1) { ret_t = tel_set_flight_mode(tapi_handle, - TAPI_POWER_FLIGHT_MODE_ENTER, _tapi_flight_mode_cb, data); + TAPI_POWER_FLIGHT_MODE_ENTER, _tapi_flight_mode_cb, data); if (ret_t != TAPI_API_SUCCESS) { ret = QP_FAIL; ERR("tel_set_flight_mode enter error:%d", ret_t); } } else { ret_t = tel_set_flight_mode(tapi_handle, - TAPI_POWER_FLIGHT_MODE_LEAVE, _tapi_flight_mode_cb, data); + TAPI_POWER_FLIGHT_MODE_LEAVE, _tapi_flight_mode_cb, data); if (ret_t != TAPI_API_SUCCESS) { ret = QP_FAIL; ERR("tel_set_flight_mode leave error:%d", ret_t); @@ -197,8 +198,7 @@ static void _turn_on(int is_on) timer = ecore_timer_add(1.0, _unlock_fly_icon, NULL); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { QP_Module_Setting *module = (QP_Module_Setting *)data; LOGD(""); @@ -223,7 +223,7 @@ static void _mouse_clicked_cb(void *data, } } -static void _tapi_flight_mode_vconf_cb(keynode_t *node, void *data) +static void _tapi_flight_mode_vconf_cb(system_settings_key_e key, void *data) { _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); } @@ -232,10 +232,8 @@ static int _register_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, _tapi_flight_mode_vconf_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE) : %d", ret); -#endif return QP_OK; } @@ -244,10 +242,8 @@ static int _unregister_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE) : %d", ret); -#endif return QP_OK; } diff --git a/daemon/settings/modules/gps.c b/daemon/settings/modules/gps.c index c964cd0..4fd33f6 100644..100755 --- a/daemon/settings/modules/gps.c +++ b/daemon/settings/modules/gps.c @@ -15,16 +15,23 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <syspopup_caller.h> #include <app_control.h> +#include <locations.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" + #define BUTTON_LABEL _("IDS_QP_BUTTON2_LOCATION_ABB") #define BUTTON_ICON_NORMAL "quick_icon_location.png" #define BUTTON_ICON_HIGHLIGHT NULL @@ -118,18 +125,16 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2) { int ret = 0; - int status = 0; + bool status = 0; retif(module == NULL, , "Invalid parameter!"); quickpanel_setting_module_progress_mode_set(module, FLAG_DISABLE, FLAG_TURN_OFF); quickpanel_setting_module_icon_timer_del(module); -#ifdef HAVE_X - ret = vconf_get_int(VCONFKEY_LOCATION_USE_MY_LOCATION, &status); - msgif(ret != 0, "fail to get VCONFKEY_LOCATION_USE_MY_LOCATION:%d", ret); -#endif + ret = location_manager_is_enabled_method(LOCATIONS_METHOD_HYBRID, &status); + msgif(ret != 0, "fail to get LOCATIONS_METHOD_HYBRID:%d", ret); - if (status == 1) { + if (status == true) { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_ON); } else { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_OFF); @@ -143,7 +148,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret = 0; - int enable = 0; + bool enable = 0; QP_Module_Setting *module = (QP_Module_Setting *)data; retif(module == NULL, , "Invalid parameter!"); @@ -155,41 +160,45 @@ static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission _syspopup_launch(quickpanel_setting_module_icon_state_get(module)); } else { // Use my location off -#ifdef HAVE_X - ret = vconf_get_int(VCONFKEY_LOCATION_USE_MY_LOCATION, &enable); -#endif - if (ret == 0) { - if (enable == 1) { -#ifdef HAVE_X - vconf_set_int(VCONFKEY_LOCATION_USE_MY_LOCATION, 0); -#endif + ret = location_manager_is_enabled_method(LOCATIONS_METHOD_HYBRID, &enable); + if (ret == false) { + if (enable == true) { + ret = location_manager_enable_method(LOCATIONS_METHOD_HYBRID, false); + if (ret != 0) { + ERR("Failed to set LOCATIONS_METHOD_HYBRID[%d]", ret); + } } } else { ERR("Failed to get Use my location[%d]", ret); } // GPS off - ret = vconf_get_int(VCONFKEY_LOCATION_ENABLED, &enable); - if (ret == 0) { - if (enable == 1) { - vconf_set_int(VCONFKEY_LOCATION_ENABLED, 0); + ret = location_manager_is_enabled_method(LOCATIONS_METHOD_GPS, &enable); + if (ret == false) { + if (enable == true) { + ret = location_manager_enable_method(LOCATIONS_METHOD_GPS, false); + if (ret != 0) { + ERR("Failed to set LOCATIONS_METHOD_GPS [%d]", ret); + } } } else { ERR("Failed to get GPS[%d]", ret); } // Wireless networks off - ret = vconf_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED, &enable); - if (ret == 0) { - if (enable == 1) { - vconf_set_int(VCONFKEY_LOCATION_NETWORK_ENABLED, 0); + ret = location_manager_is_enabled_method(LOCATIONS_METHOD_WPS, &enable); + if (ret == false) { + if (enable == true) { + ret = location_manager_enable_method(LOCATIONS_METHOD_WPS, false); + if (ret != 0) { + ERR("Failed to set LOCATIONS_METHOD_WPS [%d]", ret); + } } } else { - ERR("Failed to get GPS[%d]", ret); + ERR("Failed to get network[%d]", ret); } } } -static void _gps_vconf_cb(keynode_t *node, - void *data) +static void _gps_vconf_cb(keynode_t *node, void *data) { _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); } @@ -198,20 +207,21 @@ static int _register_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X - ret = vconf_notify_key_changed(VCONFKEY_LOCATION_USE_MY_LOCATION, _gps_vconf_cb, data); + ret = vconf_notify_key_changed(VCONFKEY_LOCATION_USE_MY_LOCATION, + _gps_vconf_cb, data); msgif(ret != 0, "failed to notify key(VCONFKEY_LOCATION_USE_MY_LOCATION) : %d", ret); -#endif + return QP_OK; } static int _unregister_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X - ret = vconf_ignore_key_changed(VCONFKEY_LOCATION_USE_MY_LOCATION, _gps_vconf_cb); + + ret = vconf_ignore_key_changed(VCONFKEY_LOCATION_USE_MY_LOCATION, + _gps_vconf_cb); msgif(ret != 0, "failed to ignore key(VCONFKEY_LOCATION_USE_MY_LOCATION) : %d", ret); -#endif + return QP_OK; } diff --git a/daemon/settings/modules/mobile_data.c b/daemon/settings/modules/mobile_data.c index 3c41fff..527e8f8 100644..100755 --- a/daemon/settings/modules/mobile_data.c +++ b/daemon/settings/modules/mobile_data.c @@ -15,17 +15,23 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <syspopup_caller.h> #include <system_settings.h> #include <bundle_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "common_uic.h" #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" - +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_ST_BUTTON2_MOBILE_NDATA") #define BUTTON_ICON_NORMAL "quick_icon_mobile_data.png" @@ -41,13 +47,10 @@ #define VCONFKEY_SETAPPL_MOBILE_DATA_OFF_REMINDER "db/setting/network/mobile_data_off_reminder" #endif - - static int _is_simcard_inserted(void); static int _is_in_flightmode(void); static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); - static const char *_label_get(void) { return BUTTON_LABEL; @@ -90,18 +93,17 @@ static void _long_press_cb(void *data) static int _need_display_popup(int is_on) { - int ret = -1, status = 0; + int ret = -1; + int status = 0; if (is_on == 1) { - ret = vconf_get_bool(VCONFKEY_SETAPPL_MOBILE_DATA_ON_REMINDER, - &status); + ret = vconf_get_bool(VCONFKEY_SETAPPL_MOBILE_DATA_ON_REMINDER, &status); msgif(ret != 0, "failed to get VCONFKEY_SETAPPL_MOBILE_DATA_ON_REMINDER %d %d", ret, is_on); - if (ret == 0 && status == 1) { + if (ret == 0 && status == true) { return 1; } } else { - ret = vconf_get_bool(VCONFKEY_SETAPPL_MOBILE_DATA_OFF_REMINDER, - &status); + ret = vconf_get_bool(VCONFKEY_SETAPPL_MOBILE_DATA_OFF_REMINDER, &status); msgif(ret != 0, "failed to get VCONFKEY_SETAPPL_MOBILE_DATA_OFF_REMINDER %d %d", ret, is_on); if (ret == 0 && status == 1) { return 1; @@ -168,7 +170,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state); } - static int _is_simcard_inserted(void) { int ret_1 = QP_FAIL; @@ -185,7 +186,7 @@ static int _is_simcard_inserted(void) INFO("MOBILE DATA SIM CARD: %d %d", sim_status_1, sim_status_2); if ((ret_1 == QP_OK && sim_status_1 == VCONFKEY_TELEPHONY_SIM_INSERTED) || - (ret_2 == QP_OK && sim_status_2 == VCONFKEY_TELEPHONY_SIM_INSERTED)) { + (ret_2 == QP_OK && sim_status_2 == VCONFKEY_TELEPHONY_SIM_INSERTED)) { return 1; } @@ -194,13 +195,12 @@ static int _is_simcard_inserted(void) static int _is_in_flightmode(void) { - int ret = QP_FAIL, flight_mode = 0; + int ret = QP_FAIL; + bool flight_mode = false; -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &flight_mode); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to get the SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE : %d", ret); -#endif - if (ret == QP_OK && flight_mode == 1) { + if (ret == QP_OK && flight_mode == true) { return 1; } @@ -210,23 +210,23 @@ static int _is_in_flightmode(void) static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2) { int ret = 0; - int status = 0; + bool status = false; retif(module == NULL, , "Invalid parameter!"); quickpanel_setting_module_icon_timer_del(module); if (quickpanel_uic_is_emul() == 1) { - status = 1; + status = true; } else if (_is_in_flightmode() == 1) { - status = 0; + status = false; } else if (_is_simcard_inserted() == 0) { - status = 0; + status = false; } else { ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, &status); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "fail to get SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED:%d", ret); } - if (status == 1) { + if (status == true) { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_ON); } else { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_OFF); @@ -237,8 +237,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { QP_Module_Setting *module = (QP_Module_Setting *)data; retif(module == NULL, , "Invalid parameter!"); @@ -282,8 +281,12 @@ static void _mouse_clicked_cb(void *data, } } -static void _mobiledata_vconf_cb(keynode_t *node, - void *data) +static void _mobiledata_vconf_cb(keynode_t *key, void *data) +{ + _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); +} + +static void _mobiledata_setting_cb(system_settings_key_e key, void *data) { _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); } @@ -292,15 +295,15 @@ static int _register_module_event_handler(void *data) { int ret = 0; - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, _mobiledata_vconf_cb, data); + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, _mobiledata_setting_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key(%s) : %d", SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, ret); - ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,_mobiledata_vconf_cb, data); + ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, _mobiledata_vconf_cb, data); msgif(ret != 0, "failed to notify key(%s) : %d", VCONFKEY_TELEPHONY_SIM_SLOT, ret); -#ifdef HAVE_X - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, _mobiledata_vconf_cb, data); + + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, _mobiledata_setting_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key(%s) : %d", SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, ret); -#endif + return QP_OK; } @@ -311,13 +314,12 @@ static int _unregister_module_event_handler(void *data) ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(%s) : %d", SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, ret); - ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,_mobiledata_vconf_cb); + ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, _mobiledata_vconf_cb); msgif(ret != 0, "failed to ignore key(%s) : %d", VCONFKEY_TELEPHONY_SIM_SLOT, ret); -#ifdef HAVE_X ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(%s) : %d", SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, ret); -#endif + return QP_OK; } diff --git a/daemon/settings/modules/rotate-lock.c b/daemon/settings/modules/rotate-lock.c index 4293d15..002d852 100644..100755 --- a/daemon/settings/modules/rotate-lock.c +++ b/daemon/settings/modules/rotate-lock.c @@ -15,16 +15,21 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <system_settings.h> #include <bundle_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" - +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_ST_BUTTON2_AUTO_NROTATE") #define BUTTON_ICON_NORMAL "quick_icon_auto_rotate.png" @@ -98,13 +103,11 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2) { int ret = 0; - int status = false; + bool status = false; retif(module == NULL, , "Invalid parameter!"); -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &status); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE , "failed to notify key SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO : %d", ret); -#endif if (status == true) { quickpanel_setting_module_icon_state_set(module, ICON_VIEW_STATE_ON); @@ -115,24 +118,19 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag quickpanel_setting_module_icon_view_update(module, quickpanel_setting_module_icon_state_get(module),FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret = 0; bool status = false; -#ifdef HAVE_X ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &status); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO : %d", ret); - + ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, !status ); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO : %d", ret); -#endif - } -static void _autorotation_vconf_cb(keynode_t *node, - void *data) +static void _autorotation_vconf_cb(system_settings_key_e key, void *data) { _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); } @@ -141,10 +139,8 @@ static int _register_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X - ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,_autorotation_vconf_cb, data); + ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, _autorotation_vconf_cb, data); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to notify key(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO) : %d", ret); -#endif return QP_OK; } @@ -152,10 +148,9 @@ static int _register_module_event_handler(void *data) static int _unregister_module_event_handler(void *data) { int ret = 0; -#ifdef HAVE_X + ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO); msgif(ret != SYSTEM_SETTINGS_ERROR_NONE, "failed to ignore key(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO) : %d", ret); -#endif return QP_OK; } diff --git a/daemon/settings/modules/sound-profile.c b/daemon/settings/modules/sound-profile.c index 640a0fe..eb04a54 100755 --- a/daemon/settings/modules/sound-profile.c +++ b/daemon/settings/modules/sound-profile.c @@ -15,13 +15,22 @@ * */ +#include <Elementary.h> + #include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <feedback.h> +#include <sound_manager.h> +#include <E_DBus.h> + +#include "common_uic.h" #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" -#include "sound_manager.h" +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_QP_BUTTON2_SOUND_ABB") #define BUTTON_ICON_SND_NORMAL "quick_icon_sn_vf.png" @@ -64,20 +73,16 @@ static void _long_press_cb(void *data) static void _play_snd_job_cb(void *data) { -#ifdef HAVE_X if (feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_SILENT_OFF) != FEEDBACK_ERROR_NONE) { ERR("failed to play a sound"); } -#endif } static void _play_vib_job_cb(void *data) { -#ifdef HAVE_X if (feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_VIBRATION_ON) != FEEDBACK_ERROR_NONE) { ERR("failed to play a vibration"); } -#endif } static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2) @@ -157,8 +162,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret = 0; int sound_status = 1; @@ -198,8 +202,7 @@ static void _mouse_clicked_cb(void *data, } } -static void _soundprofile_vconf_cb(keynode_t *node, - void *data) +static void _soundprofile_vconf_cb(keynode_t *node, void *data) { _status_update(data, FLAG_VALUE_VOID, FLAG_VALUE_VOID); } diff --git a/daemon/settings/modules/tethering.c b/daemon/settings/modules/tethering.c index 45a77ae..bd1fb53 100644..100755 --- a/daemon/settings/modules/tethering.c +++ b/daemon/settings/modules/tethering.c @@ -15,6 +15,7 @@ * */ +#include <Elementary.h> #include <vconf.h> #include <tethering.h> @@ -22,11 +23,16 @@ #include <bundle_internal.h> #include <net_connection.h> #include <syspopup_caller.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" +#include "settings_icon_common.h" #define MOBILE_AP_SYSPOPUP_NAME "mobileap-syspopup" #define BUTTON_LABEL _("IDS_ST_BUTTON2_WI_FI_NTETHERING") @@ -204,8 +210,7 @@ static int _tethering_enabled_set(void *data, Eina_Bool state) return QP_OK; } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret = 0; int is_on = 0; diff --git a/daemon/settings/modules/ultra_power_saving.c b/daemon/settings/modules/ultra_power_saving.c index c7ee5c8..89d4706 100644..100755 --- a/daemon/settings/modules/ultra_power_saving.c +++ b/daemon/settings/modules/ultra_power_saving.c @@ -16,16 +16,22 @@ */ +#include <Elementary.h> + #include <app.h> #include <vconf.h> #include <syspopup_caller.h> #include <bundle_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" - +#include "settings_icon_common.h" #define BUTTON_LABEL _("IDS_QP_BUTTON2_U_POWER_NSAVING_ABB") #define BUTTON_ICON_NORMAL "quick_icon_ultra_power_saving.png" @@ -98,20 +104,20 @@ static void _turn_on(int is_on) } } /*else - { - b = bundle_create(); - if (b != NULL) { - if (is_on) { - bundle_add(b, "_MODE_SYSTEM_POPUP_TYPE_", "POPUP_EMERGENCY_PSMODE_SETTING"); - } else { - bundle_add(b, "_MODE_SYSTEM_POPUP_TYPE_", "POPUP_NORMAL_PSMODE"); - } - syspopup_launch(SYSPOPUP_NAME, b); - bundle_free(b); - } else { - ERR("failed to create a bundle"); - } - }*/ + { + b = bundle_create(); + if (b != NULL) { + if (is_on) { + bundle_add(b, "_MODE_SYSTEM_POPUP_TYPE_", "POPUP_EMERGENCY_PSMODE_SETTING"); + } else { + bundle_add(b, "_MODE_SYSTEM_POPUP_TYPE_", "POPUP_NORMAL_PSMODE"); + } + syspopup_launch(SYSPOPUP_NAME, b); + bundle_free(b); + } else { + ERR("failed to create a bundle"); + } + }*/ } static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2) @@ -161,8 +167,7 @@ static void _status_update(QP_Module_Setting *module, int flag_extra_1, int flag FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { QP_Module_Setting *module = (QP_Module_Setting *)data; retif(module == NULL, , "Invalid parameter!"); diff --git a/daemon/settings/modules/wifi.c b/daemon/settings/modules/wifi.c index 5f65151..2b7c89c 100644..100755 --- a/daemon/settings/modules/wifi.c +++ b/daemon/settings/modules/wifi.c @@ -15,17 +15,23 @@ * */ +#include <Elementary.h> #include <app.h> #include <tethering.h> - #include <wifi.h> #include <vconf.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" +#include "settings_icon_common.h" #define E_DATA_POPUP_MODULE_ITEM "mobule_item" #define BUTTON_LABEL _("IDS_ST_BUTTON2_WI_FI_ABB") @@ -135,8 +141,7 @@ static void _status_update(QP_Module_Setting *module, int wifi_status, int flag_ FLAG_VALUE_VOID); } -static void _mouse_clicked_cb(void *data, - Evas_Object *obj, const char *emission, const char *source) +static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { int ret = 0; int is_on = 0; @@ -292,10 +297,6 @@ static bool _tethering_disable(tethering_type_e type, void *data) retif(module == NULL, false, "Invalid parameter!"); - if (quickpanel_setting_module_is_icon_clickable(module) == 0) { - return false; - } - /* disable wifi tethering */ ret = tethering_create(&th); if (ret != TETHERING_ERROR_NONE) { @@ -304,7 +305,7 @@ static bool _tethering_disable(tethering_type_e type, void *data) } ret = tethering_set_disabled_cb(th, type, - _tethering_disabled_cb, module); + _tethering_disabled_cb, module); if (ret != TETHERING_ERROR_NONE) { /* failed to set disabled callback */ tethering_destroy(th); @@ -386,10 +387,10 @@ static int _wifi_on(void *data, const char *popup_txt) retif(module == NULL, ret, "Invalid parameter!"); /* Check wifi tethering status */ - if (tethering_is_enabled(NULL, TETHERING_TYPE_WIFI) == TRUE) { + if (tethering_is_enabled(NULL, TETHERING_TYPE_WIFI)) { _tethering_off_popup(ad->win, data, TETHERING_TYPE_WIFI, popup_txt); return -1; - } else if (tethering_is_enabled(NULL, TETHERING_TYPE_RESERVED) == TRUE) { + } else if (tethering_is_enabled(NULL, TETHERING_TYPE_RESERVED)) { _tethering_off_popup(ad->win, data, TETHERING_TYPE_RESERVED, popup_txt); return -1; } @@ -430,9 +431,9 @@ static int _wifi_is_on(bool *is_on) } /* - Set Wi-Fi status changed callback - - needs to update your Wi-Fi status. -*/ + Set Wi-Fi status changed callback + - needs to update your Wi-Fi status. + */ static void _wifi_state_changed_cb(wifi_device_state_e state, void *user_data) { ERR("state:%d", state); diff --git a/daemon/settings/setting_module_api.c b/daemon/settings/setting_module_api.c index b7f1cfe..e4b2722 100644..100755 --- a/daemon/settings/setting_module_api.c +++ b/daemon/settings/setting_module_api.c @@ -15,29 +15,34 @@ * */ +#include <Elementary.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "common.h" #include "quickpanel_def.h" #include "quickpanel-ui.h" #include "settings.h" #include "setting_utils.h" +#include "setting_module_api.h" +#include "settings_icon_common.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif -#include "setting_module_api.h" #define E_DATA_CONTAINER_TYPE "container_type" -static qp_setting_icon_container_type -_icon_container_type_get(Evas_Object *view) +static qp_setting_icon_container_type _icon_container_type_get(Evas_Object *view) { retif(view == NULL, QP_SETTING_ICON_CONTAINER_NONE, "invalid parameter"); return (qp_setting_icon_container_type)evas_object_data_get(view, E_DATA_CONTAINER_TYPE); } -static void _icon_view_add(QP_Module_Setting *module, Evas_Object *view - ,qp_setting_icon_container_type container_type) +static void _icon_view_add(QP_Module_Setting *module, Evas_Object *view ,qp_setting_icon_container_type container_type) { retif(module == NULL, , "invalid parameter"); retif(view == NULL, , "invalid parameter"); @@ -86,14 +91,12 @@ HAPI QP_Module_Setting *quickpanel_setting_module_get_from_icon(Evas_Object *ico return evas_object_data_get(icon, E_DATA_MODULE_INFO); } -HAPI void quickpanel_setting_module_icon_add(QP_Module_Setting *module, Evas_Object *icon, - qp_setting_icon_container_type container_type) +HAPI void quickpanel_setting_module_icon_add(QP_Module_Setting *module, Evas_Object *icon, qp_setting_icon_container_type container_type) { _icon_view_add(module, icon, container_type); } -HAPI Evas_Object *quickpanel_setting_module_icon_get(QP_Module_Setting *module, - qp_setting_icon_container_type container_type) +HAPI Evas_Object *quickpanel_setting_module_icon_get(QP_Module_Setting *module, qp_setting_icon_container_type container_type) { Eina_List *l; Eina_List *l_next; @@ -222,6 +225,7 @@ static Evas_Object *_progressbar_get(Evas_Object *parent) Evas_Object *content = NULL; content = elm_progressbar_add(parent); + elm_progressbar_unit_format_set(content, "%0.0f%%"); retif(!content, NULL, "fail to elm_progressbar_add"); elm_object_style_set(content, "quickpanel_style"); diff --git a/daemon/settings/setting_module_api.h b/daemon/settings/setting_module_api.h index 39ae152..d634d89 100644..100755 --- a/daemon/settings/setting_module_api.h +++ b/daemon/settings/setting_module_api.h @@ -19,9 +19,6 @@ #ifndef __SETTING_MODULE_API_H__ #define __SETTING_MODULE_API_H__ -#include <Elementary.h> -#include "settings.h" - #define FLAG_VALUE_VOID 0xDEADDEAD #define FLAG_ENABLE 1 @@ -36,22 +33,21 @@ typedef enum _qp_setting_icon_container_type { QP_SETTING_ICON_CONTAINER_ALL_LIST, } qp_setting_icon_container_type; -Evas_Object *quickpanel_setting_module_icon_create(QP_Module_Setting *module, Evas_Object *parent); -void quickpanel_setting_module_icon_add(QP_Module_Setting *module, Evas_Object *icon, qp_setting_icon_container_type container_type); -void quickpanel_setting_module_icon_remove(QP_Module_Setting *module, Evas_Object *icon); -void quickpanel_setting_module_icon_state_set(QP_Module_Setting *module, int state); -int quickpanel_setting_module_icon_state_get(QP_Module_Setting *module); -Evas_Object *quickpanel_setting_module_icon_get(QP_Module_Setting *module, - qp_setting_icon_container_type container_type); -void quickpanel_setting_module_icon_view_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2); -void quickpanel_setting_module_icon_view_update_text(QP_Module_Setting *module); -void quickpanel_setting_module_icon_status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2); -int quickpanel_setting_module_is_icon_clickable(QP_Module_Setting *module); -void quickpanel_setting_module_icon_timer_add(QP_Module_Setting *module); -void quickpanel_setting_module_icon_timer_del(QP_Module_Setting *module); -void quickpanel_setting_module_progress_mode_set(QP_Module_Setting *module, int is_enable, int is_request_on); -void quickpanel_setting_module_icon_destroy(QP_Module_Setting *module, Evas_Object *icon); - -QP_Module_Setting *quickpanel_setting_module_get_from_icon(Evas_Object *icon); +extern Evas_Object *quickpanel_setting_module_icon_create(QP_Module_Setting *module, Evas_Object *parent); +extern void quickpanel_setting_module_icon_add(QP_Module_Setting *module, Evas_Object *icon, qp_setting_icon_container_type container_type); +extern void quickpanel_setting_module_icon_remove(QP_Module_Setting *module, Evas_Object *icon); +extern void quickpanel_setting_module_icon_state_set(QP_Module_Setting *module, int state); +extern int quickpanel_setting_module_icon_state_get(QP_Module_Setting *module); +extern Evas_Object *quickpanel_setting_module_icon_get(QP_Module_Setting *module, qp_setting_icon_container_type container_type); +extern void quickpanel_setting_module_icon_view_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2); +extern void quickpanel_setting_module_icon_view_update_text(QP_Module_Setting *module); +extern void quickpanel_setting_module_icon_status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2); +extern int quickpanel_setting_module_is_icon_clickable(QP_Module_Setting *module); +extern void quickpanel_setting_module_icon_timer_add(QP_Module_Setting *module); +extern void quickpanel_setting_module_icon_timer_del(QP_Module_Setting *module); +extern void quickpanel_setting_module_progress_mode_set(QP_Module_Setting *module, int is_enable, int is_request_on); +extern void quickpanel_setting_module_icon_destroy(QP_Module_Setting *module, Evas_Object *icon); + +extern QP_Module_Setting *quickpanel_setting_module_get_from_icon(Evas_Object *icon); #endif /* __SETTING_MODULE_API_H__ */ diff --git a/daemon/settings/setting_utils.c b/daemon/settings/setting_utils.c index e2ca27b..3d97851 100644..100755 --- a/daemon/settings/setting_utils.c +++ b/daemon/settings/setting_utils.c @@ -15,11 +15,19 @@ * */ - +#include <Elementary.h> #include <glib.h> -#include <efl_assist.h> + +#if defined(WINSYS_X11) +#include <Ecore_X.h> +#endif + #include <notification.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> +#include "settings.h" #include "common.h" #include "quickpanel_def.h" #include "quickpanel-ui.h" @@ -36,8 +44,7 @@ #define DIVIDER_MAGIC 0xCAFECAFE #define E_DATA_DIVIDER_MAGIC "divider_magic" -static inline void __escaped_text_set(Evas_Object *obj, - const char *part, const char *text) +static inline void __escaped_text_set(Evas_Object *obj, const char *part, const char *text) { char buf[256] = {0,}; char *ecaped = NULL; @@ -239,7 +246,7 @@ HAPI Evas_Object *quickpanel_setting_icon_image_new(Evas_Object *parent, const c return content; } -HAPI static Evas_Object *quickpanel_setting_container_get(Evas_Object *base) +static Evas_Object *quickpanel_setting_container_get(Evas_Object *base) { Evas_Object *container = NULL; retif(base == NULL, NULL, "invalid parameter"); @@ -281,7 +288,6 @@ HAPI Evas_Object *quickpanel_setting_box_get_from_scroller(Evas_Object *base) return box; } - HAPI Evas_Object *quickpanel_setting_box_get(Evas_Object *base) { Evas_Object *container = NULL; @@ -295,7 +301,6 @@ HAPI Evas_Object *quickpanel_setting_box_get(Evas_Object *base) return box; } - HAPI int quickpanel_setting_container_rotation_set(Evas_Object *base, int angle) { Evas_Object *container = NULL; @@ -455,12 +460,13 @@ HAPI int quickpanel_setting_set_scroll_page_width(void *data) Evas_Object *scroller = quickpanel_setting_scroller_get(ad->ly); int w, h; -#if HAVE_X +#if defined(WINSYS_X11) Ecore_X_Screen *screen = ecore_x_default_screen_get(); ecore_x_screen_size_get(screen, &w, &h); #else elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); #endif + elm_scroller_page_size_set(scroller, w / QP_SETTING_NUM_PORTRAIT_ICONS, 0); return 0; @@ -544,10 +550,10 @@ HAPI int quickpanel_setting_layout_remove(Evas_Object *base) } HAPI void quickpanel_setting_create_confirm_popup( - Evas_Object *parent, - char *title, - char *text, - Evas_Smart_Cb func) + Evas_Object *parent, + char *title, + char *text, + Evas_Smart_Cb func) { Evas_Object *popup = elm_popup_add(parent); Evas_Object *btn = NULL; @@ -557,7 +563,7 @@ HAPI void quickpanel_setting_create_confirm_popup( } evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); + EVAS_HINT_EXPAND); if (title) { elm_object_part_text_set(popup, "title,text", title); @@ -578,13 +584,13 @@ HAPI void quickpanel_setting_create_confirm_popup( } HAPI void quickpanel_setting_create_2button_confirm_popup( - Evas_Object *parent, - char *title, - char *text, - char *btn1_text, - Evas_Smart_Cb btn1_func, - char *btn2_text, - Evas_Smart_Cb btn2_func) + Evas_Object *parent, + char *title, + char *text, + char *btn1_text, + Evas_Smart_Cb btn1_func, + char *btn2_text, + Evas_Smart_Cb btn2_func) { Evas_Object *popup = elm_popup_add(parent); Evas_Object *btn = NULL; @@ -594,7 +600,7 @@ HAPI void quickpanel_setting_create_2button_confirm_popup( } evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); + EVAS_HINT_EXPAND); if (title) { elm_object_part_text_set(popup, "title,text", title); @@ -623,8 +629,7 @@ HAPI void quickpanel_setting_create_2button_confirm_popup( quickpanel_common_ui_set_current_popup(popup, btn1_func); } -HAPI void -quickpanel_setting_create_timeout_popup(Evas_Object *parent, char *msg) +HAPI void quickpanel_setting_create_timeout_popup(Evas_Object *parent, char *msg) { retif(msg == NULL, , "invalid parameter"); diff --git a/daemon/settings/setting_utils.h b/daemon/settings/setting_utils.h index 300c585..601d549 100644..100755 --- a/daemon/settings/setting_utils.h +++ b/daemon/settings/setting_utils.h @@ -19,8 +19,6 @@ #ifndef __SETTING_UTILS_H__ #define __SETTING_UTILS_H__ -#include <Elementary.h> -#include "settings.h" #define TIMER_CONTINUE 1 #define TIMER_STOP 0 @@ -33,41 +31,40 @@ #define QP_SETTING_BRIGHTNESS_PART_HD "brightness.container.swallow.hd" #define QP_SETTING_BRIGHTNESS_PART_WVGA "brightness.container.swallow.wvga" -int quickpanel_setting_start(Evas_Object *base); -int quickpanel_setting_stop(Evas_Object *base, int is_bring_in); +extern int quickpanel_setting_start(Evas_Object *base); +extern int quickpanel_setting_stop(Evas_Object *base, int is_bring_in); -Evas_Object *quickpanel_setting_scroller_get(Evas_Object *base); -int quickpanel_setting_set_scroll_page_width(void *data); -int quickpanel_setting_layout_set(Evas_Object *base, Evas_Object *setting); -Evas_Object *quickpanel_setting_layout_get(Evas_Object *base, const char *setting_part); +extern Evas_Object *quickpanel_setting_scroller_get(Evas_Object *base); +extern int quickpanel_setting_set_scroll_page_width(void *data); +extern int quickpanel_setting_layout_set(Evas_Object *base, Evas_Object *setting); +extern Evas_Object *quickpanel_setting_layout_get(Evas_Object *base, const char *setting_part); -int quickpanel_setting_layout_remove(Evas_Object *base); -int quickpanel_setting_icon_text_set(Evas_Object *icon, const char *text, int state); -void quickpanel_setting_icon_access_text_set(Evas_Object *icon, const char *text); -int quickpanel_setting_icon_content_set(Evas_Object *icon, Evas_Object *content); +extern int quickpanel_setting_layout_remove(Evas_Object *base); +extern int quickpanel_setting_icon_text_set(Evas_Object *icon, const char *text, int state); +extern void quickpanel_setting_icon_access_text_set(Evas_Object *icon, const char *text); +extern int quickpanel_setting_icon_content_set(Evas_Object *icon, Evas_Object *content); -Evas_Object *quickpanel_setting_box_get(Evas_Object *base); -Evas_Object *quickpanel_setting_icon_new(Evas_Object *parent); -Evas_Object *quickpanel_setting_icon_image_new(Evas_Object *parent, const char *img_path); -int quickpanel_setting_icon_pack(Evas_Object *box, Evas_Object *icon, int is_attach_divider); -void quickpanel_setting_icon_unpack_all(Evas_Object *box); -int quickpanel_setting_container_rotation_set(Evas_Object *base, int angle); -int quickpanel_setting_icons_rotation_set(Evas_Object *base, int angle); -int quickpanel_setting_icons_dragging_set(Evas_Object *icon, int is_on); -int quickpanel_setting_icons_screen_mode_set(Evas_Object *icon, int screen_mode); -void quickpanel_setting_icons_emit_sig(Evas_Object *icon, const char *signal); -Evas_Object *quickpanel_setting_icon_content_get(Evas_Object *icon); -int quickpanel_setting_icon_content_set(Evas_Object *icon, Evas_Object *content); +extern Evas_Object *quickpanel_setting_box_get(Evas_Object *base); +extern Evas_Object *quickpanel_setting_icon_new(Evas_Object *parent); +extern Evas_Object *quickpanel_setting_icon_image_new(Evas_Object *parent, const char *img_path); +extern int quickpanel_setting_icon_pack(Evas_Object *box, Evas_Object *icon, int is_attach_divider); +extern void quickpanel_setting_icon_unpack_all(Evas_Object *box); +extern int quickpanel_setting_container_rotation_set(Evas_Object *base, int angle); +extern int quickpanel_setting_icons_rotation_set(Evas_Object *base, int angle); +extern int quickpanel_setting_icons_dragging_set(Evas_Object *icon, int is_on); +extern int quickpanel_setting_icons_screen_mode_set(Evas_Object *icon, int screen_mode); +extern void quickpanel_setting_icons_emit_sig(Evas_Object *icon, const char *signal); +extern Evas_Object *quickpanel_setting_icon_content_get(Evas_Object *icon); +extern int quickpanel_setting_icon_content_set(Evas_Object *icon, Evas_Object *content); -int quickpanel_setting_icon_state_set(Evas_Object *icon, int is_on); -int quickpanel_setting_icon_state_progress_set(Evas_Object *icon); +extern int quickpanel_setting_icon_state_set(Evas_Object *icon, int is_on); +extern int quickpanel_setting_icon_state_progress_set(Evas_Object *icon); // Do not use full window popup in quickpanel -void quickpanel_setting_create_confirm_popup(Evas_Object *parent, char *title, char *text, Evas_Smart_Cb func); -void quickpanel_setting_create_2button_confirm_popup(Evas_Object *parent, char *title, char *text, - char *btn1_text, Evas_Smart_Cb btn1_func, char *btn2_text, Evas_Smart_Cb btn2_func); -void quickpanel_setting_create_timeout_popup(Evas_Object *parent, char *msg); +extern void quickpanel_setting_create_confirm_popup(Evas_Object *parent, char *title, char *text, Evas_Smart_Cb func); +extern void quickpanel_setting_create_2button_confirm_popup(Evas_Object *parent, char *title, char *text, char *btn1_text, Evas_Smart_Cb btn1_func, char *btn2_text, Evas_Smart_Cb btn2_func); +extern void quickpanel_setting_create_timeout_popup(Evas_Object *parent, char *msg); -int quickpanel_setting_scroll_page_get(void *data); +extern int quickpanel_setting_scroll_page_get(void *data); #endif /* __SETTING_UTILS_H__ */ diff --git a/daemon/settings/settings.c b/daemon/settings/settings.c index 5f67c01..ad9c209 100644..100755 --- a/daemon/settings/settings.c +++ b/daemon/settings/settings.c @@ -18,7 +18,14 @@ #include <stdlib.h> #include <glib.h> +#include <Elementary.h> + #include <vconf.h> +#include <notification.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" @@ -26,15 +33,17 @@ #include "settings.h" #include "setting_utils.h" #include "settings_ipc.h" +#include "pager.h" #include "pager_common.h" +#include "preference.h" + #ifdef QP_SCREENREADER_ENABLE #include "accessibility.h" #endif -#include "preference.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif -#include "configuration.h" static int quickpanel_settings_init(void *data); static int quickpanel_settings_fini(void *data); @@ -146,28 +155,6 @@ static char *_preference_get(const char *key) return NULL; } -static void _reservied_list_get_with_active_list(Eina_List **list) -{ - int i = 0, module_count = 0; - Eina_List *list_featured = NULL; - retif(list == NULL, , "invalid data."); - - quickpanel_settings_featured_list_get(&list_featured); - retif(list_featured == NULL, , "failed to get default active list"); - - module_count = _module_count_get(); - - for (i = 0; i < module_count; i++) { - if (eina_list_data_find(list_featured, s_info.modules[i]) == NULL){ - if (_module_is_enabled(s_info.modules[i]) == EINA_TRUE) { - *list = eina_list_append (*list, s_info.modules[i]); - } - } - } - - eina_list_free(list_featured); -} - static int quickpanel_settings_init(void *data) { int i; @@ -182,8 +169,8 @@ static int quickpanel_settings_init(void *data) s_info.module_table = NULL; } s_info.module_table = g_hash_table_new_full(g_str_hash, g_str_equal, - (GDestroyNotify)g_free, - NULL); + (GDestroyNotify)g_free, + NULL); if (s_info.module_table != NULL) { for (i = 0; i < mod_count; i++) { if (s_info.modules[i]->supported_get != NULL) { diff --git a/daemon/settings/settings.h b/daemon/settings/settings.h index 6694617..98b0dbd 100644..100755 --- a/daemon/settings/settings.h +++ b/daemon/settings/settings.h @@ -18,11 +18,6 @@ #ifndef __SETTING_H__ #define __SETTING_H__ -#include <Elementary.h> -#include "quickpanel_def.h" -#include "quickpanel-ui.h" -#include "settings_icon_common.h" - #define MODULE_BLANK "blank" #define FILE_QP_BUTTON_ORDER_INI DATADIR_RW"/qp_setting_order.ini" #define E_DATA_MODULE_INFO "module_info" @@ -102,12 +97,12 @@ struct _QP_Setting_Loaded_Item { void *extra_handler_1; }; -void quickpanel_setting_save_list_to_file(Eina_List *list, int num_featured); -int quickpanel_settings_featured_list_validation_check(char *order); -void quickpanel_settings_featured_list_get(Eina_List **list); -void quickpanel_settings_all_list_get(Eina_List **list); +extern void quickpanel_setting_save_list_to_file(Eina_List *list, int num_featured); +extern int quickpanel_settings_featured_list_validation_check(char *order); +extern void quickpanel_settings_featured_list_get(Eina_List **list); +extern void quickpanel_settings_all_list_get(Eina_List **list); -QP_Module_Setting *quickpanel_settings_module_get_by_name(const char *name); -int quickpanel_settings_module_count_get(void); +extern QP_Module_Setting *quickpanel_settings_module_get_by_name(const char *name); +extern int quickpanel_settings_module_count_get(void); #endif diff --git a/daemon/settings/settings_gridbox.c b/daemon/settings/settings_gridbox.c index 1c81624..fde946c 100644..100755 --- a/daemon/settings/settings_gridbox.c +++ b/daemon/settings/settings_gridbox.c @@ -15,6 +15,11 @@ * */ +#include <Elementary.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> #include "quickpanel-ui.h" #include "common.h" @@ -147,10 +152,10 @@ static void _item_pos_get(int order, int *x, int *y, void *data) int column = (order - 1) - (row * n_per_row); int row_x = info_layout->padding_left - + ((info_layout->child_w + info_layout->padding_between_h) * column); + + ((info_layout->child_w + info_layout->padding_between_h) * column); int row_y = info_layout->padding_top - + ((info_layout->child_h + info_layout->padding_between_v) * row); + + ((info_layout->child_h + info_layout->padding_between_v) * row); if (x != NULL) { *x = row_x; @@ -223,7 +228,7 @@ static void _layout_cb(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) info_layout->child_w, info_layout->child_h); order_children++; list_pos_info = - _position_info_add(list_pos_info, 1, order_obj, off_x, off_y, info_layout->child_w, info_layout->child_h); + _position_info_add(list_pos_info, 1, order_obj, off_x, off_y, info_layout->child_w, info_layout->child_h); if (btn_previous != NULL && opt->obj != NULL) { elm_object_focus_next_object_set(opt->obj, btn_previous, ELM_FOCUS_LEFT); elm_object_focus_next_object_set(btn_previous, opt->obj, ELM_FOCUS_RIGHT); @@ -240,8 +245,8 @@ static void _layout_cb(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) } order_divider++; list_pos_info = - _position_info_add(list_pos_info, 0, order_obj, off_x + info_layout->child_w, off_y, - info_layout->padding_between_h, info_layout->child_h); + _position_info_add(list_pos_info, 0, order_obj, off_x + info_layout->child_w, off_y, + info_layout->padding_between_h, info_layout->child_h); } order_obj++; } diff --git a/daemon/settings/settings_gridbox.h b/daemon/settings/settings_gridbox.h index 3550e88..eaad6a8 100644..100755 --- a/daemon/settings/settings_gridbox.h +++ b/daemon/settings/settings_gridbox.h @@ -24,13 +24,14 @@ #define SETTINGS_GRIDBOX_ITEM_ICON "item_icon" #define SETTINGS_GRIDBOX_ITEM_DIVIDER "item_divider" -Evas_Object *quickpanel_settings_gridbox_create(Evas_Object *parent, void *data); -void quickpanel_settings_gridbox_remove(Evas_Object *gridbox); -void quickpanel_settings_gridbox_item_add(Evas_Object *gridbox, Evas_Object *item, const char *item_type, int is_prepend); -void quickpanel_settings_gridbox_item_remove(Evas_Object *gridbox, Evas_Object *item); -void quickpanel_settings_gridbox_item_remove_all(Evas_Object *gridbox); -void quickpanel_settings_gridbox_rotation(Evas_Object *gridbox, int angle); -int quickpanel_settings_gridbox_item_count_get(Evas_Object *gridbox); -int quickpanel_settings_gridbox_item_index_get(Evas_Object *gridbox, int touch_x, int touch_y); -void quickpanel_settings_gridbox_unpack_all(Evas_Object *gridbox); +extern Evas_Object *quickpanel_settings_gridbox_create(Evas_Object *parent, void *data); +extern void quickpanel_settings_gridbox_remove(Evas_Object *gridbox); +extern void quickpanel_settings_gridbox_item_add(Evas_Object *gridbox, Evas_Object *item, const char *item_type, int is_prepend); +extern void quickpanel_settings_gridbox_item_remove(Evas_Object *gridbox, Evas_Object *item); +extern void quickpanel_settings_gridbox_item_remove_all(Evas_Object *gridbox); +extern void quickpanel_settings_gridbox_rotation(Evas_Object *gridbox, int angle); +extern int quickpanel_settings_gridbox_item_count_get(Evas_Object *gridbox); +extern int quickpanel_settings_gridbox_item_index_get(Evas_Object *gridbox, int touch_x, int touch_y); +extern void quickpanel_settings_gridbox_unpack_all(Evas_Object *gridbox); + #endif diff --git a/daemon/settings/settings_icon_common.c b/daemon/settings/settings_icon_common.c index a29b7fa..c6e8ef1 100644..100755 --- a/daemon/settings/settings_icon_common.c +++ b/daemon/settings/settings_icon_common.c @@ -15,21 +15,31 @@ * */ +#include <Elementary.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <sound_manager.h> +#include <E_DBus.h> + +#include "media.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" +#include "common_uic.h" #include "common.h" #include "modules.h" #include "settings.h" #include "setting_utils.h" #include "setting_module_api.h" #include "accessibility.h" -#include "configuration.h" +#include "pager.h" #include "pager_common.h" #define E_DATA_ICON_CLICKED_CB "clicked_cb" #define E_DATA_ICON_ORIGINAL_OBJ "original_obj" +#define TAP_AND_DELAY_LONG 1.000 + static struct _info { int down_x; Eina_Bool is_longpressed; @@ -71,8 +81,7 @@ static Eina_Bool _icon_handler_longpress(void *data) return ECORE_CALLBACK_CANCEL; } -static void _icon_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, - void *event_info) +static void _icon_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { int down_x = 0; retif(obj == NULL, , "invalid argument"); @@ -87,8 +96,7 @@ static void _icon_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, } } -static void _icon_mouse_up_cb(void *data, Evas_Object *obj, - const char *emission, const char *source) +static void _icon_mouse_up_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { retif(obj == NULL, , "invalid argument"); @@ -99,11 +107,10 @@ static void _icon_mouse_up_cb(void *data, Evas_Object *obj, } evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, - _icon_mouse_move_cb); + _icon_mouse_move_cb); } -static void _icon_mouse_down_cb(void *data, Evas_Object *obj, - const char *emission, const char *source) +static void _icon_mouse_down_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { retif(obj == NULL, , "invalid argument"); @@ -115,17 +122,14 @@ static void _icon_mouse_down_cb(void *data, Evas_Object *obj, quickpanel_page_get_touched_pos(&(s_info.down_x), NULL); s_info.is_longpressed = EINA_FALSE; - s_info.timer_longpress = ecore_timer_add( - quickpanel_conf_longpress_time_get(), - _icon_handler_longpress, obj); + s_info.timer_longpress = ecore_timer_add(TAP_AND_DELAY_LONG,_icon_handler_longpress, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, _icon_mouse_move_cb, NULL); } #ifdef QP_SCREENREADER_ENABLE -static void -_icon_focus_clicked_cb(void *data, Evas_Object *obj, void *event_info) +static void _icon_focus_clicked_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *icon = NULL; Edje_Signal_Cb func = NULL; @@ -153,8 +157,7 @@ _icon_focus_clicked_cb(void *data, Evas_Object *obj, void *event_info) } } -static void -_icon_focus_clicked_cb_without_feedback(void *data, Evas_Object *obj, void *event_info) +static void _icon_focus_clicked_cb_without_feedback(void *data, Evas_Object *obj, void *event_info) { Evas_Object *icon = NULL; Edje_Signal_Cb func = NULL; @@ -177,10 +180,8 @@ _icon_focus_clicked_cb_without_feedback(void *data, Evas_Object *obj, void *even } } } -#endif -HAPI int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, - Edje_Signal_Cb func, void *data) +HAPI int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, Edje_Signal_Cb func, void *data) { retif(icon == NULL, QP_FAIL, "invalid parameter"); retif(func == NULL, QP_FAIL, "invalid parameter"); @@ -207,8 +208,7 @@ HAPI int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, return 0; } -HAPI int quickpanel_setting_icon_click_cb_without_feedback_add(Evas_Object *icon, - Edje_Signal_Cb func, void *data) +HAPI int quickpanel_setting_icon_click_cb_without_feedback_add(Evas_Object *icon, Edje_Signal_Cb func, void *data) { retif(icon == NULL, QP_FAIL, "invalid parameter"); retif(func == NULL, QP_FAIL, "invalid parameter"); @@ -256,4 +256,5 @@ HAPI void quickpanel_setting_icon_handler_longpress(const char *pkgname, void *d quickpanel_uic_launch_app_inform_result(pkgname, ret); quickpanel_uic_close_quickpanel(true, 1); } +#endif diff --git a/daemon/settings/settings_icon_common.h b/daemon/settings/settings_icon_common.h index f9ed1ee..7b16e93 100644..100755 --- a/daemon/settings/settings_icon_common.h +++ b/daemon/settings/settings_icon_common.h @@ -19,11 +19,9 @@ #ifndef __SETTING_ICON_COMMON_H__ #define __SETTING_ICON_COMMON_H__ -int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, - Edje_Signal_Cb func, void *data); -int quickpanel_setting_icon_click_cb_without_feedback_add(Evas_Object *icon, - Edje_Signal_Cb func, void *data); -int quickpanel_setting_icon_click_cb_del(Evas_Object *icon, Edje_Signal_Cb func); -void quickpanel_setting_icon_handler_longpress(const char *pkgname, void *data); +extern int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, Edje_Signal_Cb func, void *data); +extern int quickpanel_setting_icon_click_cb_without_feedback_add(Evas_Object *icon, Edje_Signal_Cb func, void *data); +extern int quickpanel_setting_icon_click_cb_del(Evas_Object *icon, Edje_Signal_Cb func); +extern void quickpanel_setting_icon_handler_longpress(const char *pkgname, void *data); #endif /* __SETTING_ICON_COMMON_H__ */ diff --git a/daemon/settings/settings_ipc.c b/daemon/settings/settings_ipc.c index 3cf0f8b..552f120 100644..100755 --- a/daemon/settings/settings_ipc.c +++ b/daemon/settings/settings_ipc.c @@ -15,8 +15,14 @@ * */ - +#include <Elementary.h> +#include <E_DBus.h> #include <glib.h> + +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "quickpanel-ui.h" #include "quickpanel_def.h" #include "common.h" @@ -126,9 +132,9 @@ static void _handler_editing(void *data, DBusMessage *msg) if (is_error == 0) { if (list_active != NULL) { quickpanel_setting_view_featured_reload(list_active, num_featured); - quickpanel_setting_view_all_reload(list_active); - quickpanel_setting_save_list_to_file(list_active, num_featured); - eina_list_free(list_active); + quickpanel_setting_view_all_reload(list_active); + quickpanel_setting_save_list_to_file(list_active, num_featured); + eina_list_free(list_active); } } g_strfreev(order_split); @@ -181,7 +187,6 @@ static void _settings_ipc_fini(void *data) } } - /***************************************************************************** * * Util functions diff --git a/daemon/settings/settings_ipc.h b/daemon/settings/settings_ipc.h index e496cab..d958345 100644..100755 --- a/daemon/settings/settings_ipc.h +++ b/daemon/settings/settings_ipc.h @@ -19,7 +19,7 @@ #ifndef __SETTING_IPC_H__ #define __SETTING_IPC_H__ -int quickpanel_settings_ipc_init(void *data); -int quickpanel_settings_ipc_fini(void *data); +extern int quickpanel_settings_ipc_init(void *data); +extern int quickpanel_settings_ipc_fini(void *data); #endif /* __SETTING_IPC_H__ */ diff --git a/daemon/settings/settings_view_all.c b/daemon/settings/settings_view_all.c index 2138f1d..f1e4c00 100644..100755 --- a/daemon/settings/settings_view_all.c +++ b/daemon/settings/settings_view_all.c @@ -15,10 +15,16 @@ * */ - +#include <Elementary.h> #include <glib.h> + #include <notification.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" +#include "common_uic.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" #include "modules.h" @@ -27,10 +33,12 @@ #include "setting_utils.h" #include "settings_gridbox.h" #include "setting_module_api.h" +#include "settings_view_all.h" +#include "pager.h" #include "pager_common.h" #include "page_setting_all.h" #include "accessibility.h" -#include "configuration.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif @@ -125,7 +133,7 @@ static void _icon_pack(Evas_Object *gridbox, Evas_Object *icon, int need_divider } } -static void _view_icons_add() +static void _view_icons_add(void) { int index = 0, total = 0; Eina_List *l; @@ -211,7 +219,7 @@ static int _init(void *data) struct appdata *ad = (struct appdata *)data; retif(ad == NULL, QP_FAIL, "Invalid parameter!"); - _view_create(data); + _view_create(data); return QP_OK; } @@ -272,7 +280,7 @@ HAPI void quickpanel_setting_view_all_reload(Eina_List *list_all_module) DBG("total:%d", total); EINA_LIST_FOREACH_SAFE(list_all_module, l, l_next, module) { if ((icon = quickpanel_setting_module_icon_get(module, - QP_SETTING_ICON_CONTAINER_ALL_LIST)) == NULL) { + QP_SETTING_ICON_CONTAINER_ALL_LIST)) == NULL) { icon = _icon_create(module, gridbox); } if (icon != NULL) { diff --git a/daemon/settings/settings_view_all.h b/daemon/settings/settings_view_all.h index 7232a7f..62d7272 100644..100755 --- a/daemon/settings/settings_view_all.h +++ b/daemon/settings/settings_view_all.h @@ -19,6 +19,7 @@ #ifndef __SETTING_VIEW_ALL_H__ #define __SETTING_VIEW_ALL_H__ -void qp_setting_view_all_reload(Eina_List *list_all_module); +extern void qp_setting_view_all_reload(Eina_List *list_all_module); +extern void quickpanel_setting_view_all_reload(Eina_List *list_all_module); #endif /* __SETTING_VIEW_ALL_H__ */ diff --git a/daemon/settings/settings_view_featured.c b/daemon/settings/settings_view_featured.c index 16f8b89..03f0732 100644..100755 --- a/daemon/settings/settings_view_featured.c +++ b/daemon/settings/settings_view_featured.c @@ -15,11 +15,16 @@ * */ - +#include <Elementary.h> #include <glib.h> + #include <notification.h> -#include <efl_assist.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "common.h" +#include "common_uic.h" #include "quickpanel-ui.h" #include "quickpanel_def.h" #include "modules.h" @@ -29,9 +34,10 @@ #include "settings_gridbox.h" #include "setting_module_api.h" #include "settings_view_featured.h" +#include "pager.h" #include "pager_common.h" #include "accessibility.h" -#include "configuration.h" + #ifdef QP_EMERGENCY_MODE_ENABLE #include "emergency_mode.h" #endif @@ -57,54 +63,6 @@ QP_Module settings_view_featured = { .lang_changed = _lang_changed, }; -static void _view_layout_create_with_scroller(void *data) -{ - Evas_Object *scroller = NULL; - Evas_Object *box = NULL; - Evas_Object *container = NULL; - struct appdata *ad = data; - retif(!ad->ly, , "layout is NULL!"); - - container = quickpanel_uic_load_edj(ad->ly, DEFAULT_EDJ, "quickpanel/setting_container_wvga", 0); - - retif(container == NULL, , "failed to load container"); - - scroller = elm_scroller_add(container); - retif(!scroller, , "fail to add scroller"); - elm_object_style_set(scroller, "effect"); - elm_scroller_bounce_set(scroller, EINA_TRUE, EINA_FALSE); - elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_movement_block_set(scroller, ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL); - - box = elm_box_add(scroller); - if (!box) { - ERR("fail to add box"); - if (scroller != NULL) { - evas_object_del(scroller); - scroller = NULL; - } - if (container != NULL) { - evas_object_del(container); - container = NULL; - } - return; - } - - elm_object_style_set(box, "effect"); - - evas_object_size_hint_weight_set(box, 0.0 , EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_horizontal_set(box, EINA_TRUE); - evas_object_show(box); - - elm_object_content_set(scroller, box); - - elm_object_part_content_set(container, QP_SETTING_SCROLLER_PART_WVGA, scroller); - - quickpanel_setting_layout_set(ad->ly, container); -} - - static void _view_layout_create(void *data) { Evas_Object *box = NULL; @@ -207,8 +165,8 @@ static int _init(void *data) } #endif - _view_layout_create(data); - _view_icons_add(data); + _view_layout_create(data); + _view_icons_add(data); elm_object_signal_emit(ad->ly, "quickpanel.setting.show", "quickpanel.prog"); @@ -322,7 +280,7 @@ HAPI void quickpanel_setting_view_featured_reload(Eina_List *list_all_module, in EINA_LIST_FOREACH_SAFE(list_all_module, l, l_next, module) { if (index < num_featured) { if ((icon = quickpanel_setting_module_icon_get(module, - QP_SETTING_ICON_CONTAINER_FEATURED)) == NULL) { + QP_SETTING_ICON_CONTAINER_FEATURED)) == NULL) { icon = quickpanel_setting_module_icon_create(module, box); } if (icon != NULL) { @@ -333,7 +291,7 @@ HAPI void quickpanel_setting_view_featured_reload(Eina_List *list_all_module, in DBG("all list:%s", module->name); } else { if ((icon = quickpanel_setting_module_icon_get(module, - QP_SETTING_ICON_CONTAINER_FEATURED)) != NULL) { + QP_SETTING_ICON_CONTAINER_FEATURED)) != NULL) { quickpanel_setting_module_icon_remove(module, icon); evas_object_del(icon); icon = NULL; diff --git a/daemon/settings/settings_view_featured.h b/daemon/settings/settings_view_featured.h index e1b5c3c..b68cd18 100644..100755 --- a/daemon/settings/settings_view_featured.h +++ b/daemon/settings/settings_view_featured.h @@ -19,9 +19,9 @@ #ifndef __SETTING_VIEW_FEATURED_H__ #define __SETTING_VIEW_FEATURED_H__ -Eina_Bool quickpanel_settings_is_in_left_edge(void); -void quickpanel_setting_view_featured_reload(Eina_List *list_all_module, int num_featured); -void quickpanel_setting_view_featured_initial_focus_set(void); -void quickpanel_setting_view_featured_brightness_init(Evas_Object *brightness_view); +extern Eina_Bool quickpanel_settings_is_in_left_edge(void); +extern void quickpanel_setting_view_featured_reload(Eina_List *list_all_module, int num_featured); +extern void quickpanel_setting_view_featured_initial_focus_set(void); +extern void quickpanel_setting_view_featured_brightness_init(Evas_Object *brightness_view); #endif /* __SETTING_VIEW_FEATURED_H__ */ diff --git a/daemon/sim_controller.c b/daemon/sim_controller.c index 8302b45..9f43f6a 100644..100755 --- a/daemon/sim_controller.c +++ b/daemon/sim_controller.c @@ -16,19 +16,23 @@ */ +#include <Elementary.h> #include <stdio.h> #include <stdlib.h> -#include <Evas.h> -#include <Elementary.h> -#include <Eina.h> -#include <dlog.h> -#include <vconf.h> +#include <E_DBus.h> #include <tapi_common.h> #include <ITapiSim.h> #include <TelCall.h> #include <ITapiCall.h> #include <TelNetwork.h> + +#include <dlog.h> +#include <vconf.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + #include "setting_utils.h" #include "list_util.h" @@ -50,52 +54,18 @@ static struct } sim_state_info = { - .handle[0] = NULL, - .handle[1] = NULL, - .handle[2] = NULL, - .sim_card_ready[0] = EINA_FALSE, - .sim_card_ready[1] = EINA_FALSE, - .layout = NULL, - .call_state = 0, + .handle[0] = NULL, + .handle[1] = NULL, + .handle[2] = NULL, + .sim_card_ready[0] = EINA_FALSE, + .sim_card_ready[1] = EINA_FALSE, + .layout = NULL, + .call_state = 0, }; -static int _sim_controller_get_call_state(void); - static void register_sim_callbacks(); static void unregister_sim_callbacks(); -static void __sim_controller_call_state_changed_cb(keynode_t *key, void *data) -{ - int call_state = _sim_controller_get_call_state(); - - if (sim_state_info.call_state != call_state) - { - DBG("Call state changed[%d]", call_state); - sim_state_info.call_state = call_state; - } -} - -static int _sim_controller_get_call_state(void) -{ - int value = 0; - int ret = 0; - - ret = vconf_get_int(VCONFKEY_CALL_STATE, &value); - if (ret != 0) - { - ERR("Failed to get call state"); - return 0; - } - - if (value == VCONFKEY_CALL_OFF) - { - return 0; - } - - DBG("Call status[%d]", value); - return 1; -} - static char *get_sim_plmn(TapiHandle *handle) { int ret; @@ -106,13 +76,13 @@ static char *get_sim_plmn(TapiHandle *handle) TAPI_PROP_NETWORK_NETWORK_NAME, &network_name); if(ret == TAPI_API_SUCCESS) { - /* ‘network_name’ contains valid Network name based on Display condition */ + /* ‘network_name’ contains valid Network name based on Display condition */ return network_name; } else { ERR("Sim = %p PLMN = ERROR[%d]", handle, ret); - /* get property failed */ + /* get property failed */ } return NULL; @@ -129,13 +99,13 @@ static char *get_sim_spn(TapiHandle *handle) TAPI_PROP_NETWORK_SPN_NAME, &spn_name); if(ret == TAPI_API_SUCCESS) { - /* ‘spn_name’ contains valid Service provider name */ + /* ‘spn_name’ contains valid Service provider name */ return spn_name; } else { ERR("Sim = %p SPN = ERROR[%d]", handle, ret); - /* get property failed */ + /* get property failed */ return NULL; } } @@ -151,34 +121,28 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) // get service type ret = tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &service_type); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to get service type[%d]", ret); } - if (service_type >= TAPI_NETWORK_SERVICE_TYPE_2G) - { + if (service_type >= TAPI_NETWORK_SERVICE_TYPE_2G) { // get network name option ret = tel_get_property_int(handle, TAPI_PROP_NETWORK_NAME_OPTION, &name_option); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to get name option[%d]", ret); } - switch (name_option) - { + switch (name_option) { case TAPI_NETWORK_DISP_SPN: spn = get_sim_spn(handle); - if (spn != NULL && spn[0] != 0) - { + if (spn != NULL && spn[0] != 0) { INFO("PLMN/SPN - Sim %p using SPN: %s", handle, spn); snprintf(buf, sizeof(buf), "%s", spn); } break; case TAPI_NETWORK_DISP_PLMN: plmn = get_sim_plmn(handle); - if (plmn != NULL && plmn[0] != 0) - { + if (plmn != NULL && plmn[0] != 0) { INFO("PLMN/SPN - Sim %p using PLMN: %s", handle, plmn); snprintf(buf, sizeof(buf), "%s", plmn); } @@ -186,18 +150,13 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) case TAPI_NETWORK_DISP_SPN_PLMN: spn = get_sim_spn(handle); plmn = get_sim_plmn(handle); - if (spn != NULL && spn[0] != 0 && plmn != NULL && plmn[0] != 0) - { + if (spn != NULL && spn[0] != 0 && plmn != NULL && plmn[0] != 0) { INFO("PLMN/SPN - Sim %p using SPN: %s, PLMN: %s", handle, spn, plmn); snprintf(buf, sizeof(buf), "%s - %s", plmn, spn); - } - else if (spn != NULL && spn[0] != 0) - { + } else if (spn != NULL && spn[0] != 0) { INFO("PLMN/SPN - Sim %p using SPN: %s", handle, spn); snprintf(buf, sizeof(buf), "%s", spn); - } - else if (plmn != NULL && plmn[0] != 0) - { + } else if (plmn != NULL && plmn[0] != 0) { INFO("PLMN/SPN - Sim %p using PLMN: %s", handle, plmn); snprintf(buf, sizeof(buf), "%s", plmn); } @@ -205,18 +164,14 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) default: ERR("Invalid name option[%d]", name_option); plmn = get_sim_plmn(handle); - if (plmn != NULL && plmn[0] != 0) - { + if (plmn != NULL && plmn[0] != 0) { INFO("PLMN/SPN - Sim %p using PLMN: %s", handle, plmn); snprintf(buf, sizeof(buf), "%s", plmn); } break; } - } - else - { - switch (service_type) - { + } else { + switch (service_type) { case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE: snprintf(buf, sizeof(buf), "%s", _("IDS_IDLE_BODY_NO_SERVICE")); break; @@ -229,8 +184,7 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) default: ERR("invalid service type[%d]", service_type); plmn = get_sim_plmn(handle); - if (plmn != NULL && plmn[0] != 0) - { + if (plmn != NULL && plmn[0] != 0) { INFO("PLMN/SPN - Sim %p using PLMN: %s", handle, plmn); snprintf(buf, sizeof(buf), "%s", plmn); } @@ -240,33 +194,22 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) DBG("handle[%d][%p] service_type[%d], name_option[%d] >> [%s]", handle_num, handle, service_type, name_option, buf); - if (strlen(buf) == 0) - { + if (strlen(buf) == 0) { ERR("Empty string"); snprintf(buf, sizeof(buf), "%s", _("IDS_IDLE_BODY_NO_SERVICE")); - } - else if (strncasecmp(buf, "No Service", strlen("No Service")) == 0) - { + } else if (strncasecmp(buf, "No Service", strlen("No Service")) == 0) { ERR("USING SPECIAL NETWORK NAME: %s in handle: %d", _("IDS_IDLE_BODY_NO_SERVICE"), handle_num); return strdup(_("IDS_IDLE_BODY_NO_SERVICE")); - } - else if (strncasecmp(buf, "EMERGENCY", strlen("EMERGENCY")) == 0) - { + } else if (strncasecmp(buf, "EMERGENCY", strlen("EMERGENCY")) == 0) { ERR("USING SPECIAL NETWORK NAME: %s in handle: %d", _("IDS_IDLE_MBODY_EMERGENCY_CALLS_ONLY"), handle_num); return strdup(_("IDS_IDLE_MBODY_EMERGENCY_CALLS_ONLY")); - } - else if (strncasecmp(buf, "Searching", strlen("Searching")) == 0) - { + } else if (strncasecmp(buf, "Searching", strlen("Searching")) == 0) { ERR("USING SPECIAL NETWORK NAME: %s in handle: %d", _("IDS_COM_BODY_SEARCHING"), handle_num); return strdup(_("IDS_COM_BODY_SEARCHING")); - } - else if (strncasecmp(buf, "SIM Error", strlen("SIM Error")) == 0) - { + } else if (strncasecmp(buf, "SIM Error", strlen("SIM Error")) == 0) { ERR("USING SPECIAL NETWORK NAME: %s in handle: %d", _("IDS_IDLE_BODY_INVALID_SIM_CARD"), handle_num); return strdup(_("IDS_IDLE_BODY_INVALID_SIM_CARD")); - } - else if (strncasecmp(buf, "NO SIM", strlen("NO SIM")) == 0) - { + } else if (strncasecmp(buf, "NO SIM", strlen("NO SIM")) == 0) { ERR("USING SPECIAL NETWORK NAME: %s in handle: %d", _("IDS_IDLE_MBODY_EMERGENCY_CALLS_ONLY"), handle_num); return strdup(_("IDS_IDLE_MBODY_EMERGENCY_CALLS_ONLY")); } @@ -277,70 +220,69 @@ static char *get_plmn_spn_network(int handle_num, TapiHandle *handle) // -------------------------------------------------------------------------------------------- static void print_sim_status(TelSimCardStatus_t sim_status, int card_changed) { - switch(sim_status) - { - case TAPI_SIM_STATUS_CARD_ERROR : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_ERROR"); + switch(sim_status) { + case TAPI_SIM_STATUS_CARD_ERROR: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_ERROR"); break; - case TAPI_SIM_STATUS_CARD_NOT_PRESENT : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_NOT_PRESENT"); + case TAPI_SIM_STATUS_CARD_NOT_PRESENT: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_NOT_PRESENT"); break; - case TAPI_SIM_STATUS_SIM_INITIALIZING : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_INITIALIZING"); + case TAPI_SIM_STATUS_SIM_INITIALIZING: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_INITIALIZING"); break; - case TAPI_SIM_STATUS_SIM_INIT_COMPLETED: - INFO("Sim card status: TAPI_SIM_STATUS_SIM_INIT_COMPLETED"); + case TAPI_SIM_STATUS_SIM_INIT_COMPLETED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_INIT_COMPLETED"); break; - case TAPI_SIM_STATUS_SIM_PIN_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_PIN_REQUIRED"); + case TAPI_SIM_STATUS_SIM_PIN_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_PIN_REQUIRED"); break; - case TAPI_SIM_STATUS_SIM_PUK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_PUK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_PUK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_PUK_REQUIRED"); break; - case TAPI_SIM_STATUS_CARD_BLOCKED : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_BLOCKED"); + case TAPI_SIM_STATUS_CARD_BLOCKED: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_BLOCKED"); break; - case TAPI_SIM_STATUS_SIM_NCK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_NCK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_NCK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_NCK_REQUIRED"); break; - case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_NSCK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_NSCK_REQUIRED"); break; - case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_SPCK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_SPCK_REQUIRED"); break; - case TAPI_SIM_STATUS_SIM_CCK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_CCK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_CCK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_CCK_REQUIRED"); break; - case TAPI_SIM_STATUS_CARD_REMOVED : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_REMOVED"); + case TAPI_SIM_STATUS_CARD_REMOVED: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_REMOVED"); break; - case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED : - INFO("Sim card status: TAPI_SIM_STATUS_SIM_LOCK_REQUIRED"); + case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED: + INFO("Sim card status: TAPI_SIM_STATUS_SIM_LOCK_REQUIRED"); break; - case TAPI_SIM_STATUS_CARD_CRASHED : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_CRASHED"); + case TAPI_SIM_STATUS_CARD_CRASHED: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_CRASHED"); break; - case TAPI_SIM_STATUS_CARD_POWEROFF : - INFO("Sim card status: TAPI_SIM_STATUS_CARD_POWEROFF"); + case TAPI_SIM_STATUS_CARD_POWEROFF: + INFO("Sim card status: TAPI_SIM_STATUS_CARD_POWEROFF"); break; - case TAPI_SIM_STATUS_UNKNOWN : - INFO("Sim card status: TAPI_SIM_STATUS_UNKNOWN"); + case TAPI_SIM_STATUS_UNKNOWN: + INFO("Sim card status: TAPI_SIM_STATUS_UNKNOWN"); break; } @@ -354,70 +296,48 @@ static void get_sim_status() TelSimCardStatus_t sim_status; int card_changed; - for(i = 0; i < TAPI_HANDLE_MAX + 1; ++i) - { - if(sim_state_info.handle[i]) - { + for (i = 0; i < TAPI_HANDLE_MAX + 1; ++i) { + if (sim_state_info.handle[i]) { ret = tel_get_sim_init_info (sim_state_info.handle[i], &sim_status, &card_changed); - if(ret == 0) - { + if(ret == 0) { print_sim_status(sim_status, card_changed); - if(sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || - sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) - { - if (i < TAPI_HANDLE_MAX) - { + if(sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) { + if (i < TAPI_HANDLE_MAX) { sim_state_info.sim_card_ready[i] = EINA_TRUE; } - } - else - { + } else { ERR("SIM[%d] is not completed initialization [%d]", i, sim_status); } - } - else - { + } else { ERR("Could not get sim[%d] status[%d]", i, ret); - } - } - } + } // if ret == 0 + } // if sim_state_info + } // for } static void sim_handler_text_set(Eina_Bool flight_mode) { - if (flight_mode) - { + if (flight_mode) { // if flight mode, No service quickpanel_handler_text_set(_("IDS_IDLE_BODY_NO_SERVICE")); - } - else if (sim_state_info.sim_card_ready[0] && sim_state_info.sim_card_ready[1]) - { + } else if (sim_state_info.sim_card_ready[0] && sim_state_info.sim_card_ready[1]) { quickpanel_handler_text_set(NULL); - } - else if(sim_state_info.sim_card_ready[0]) - { + } else if(sim_state_info.sim_card_ready[0]) { char *plmn_spn1 = get_plmn_spn_network(0, sim_state_info.handle[0]); quickpanel_handler_text_set(plmn_spn1); - if (plmn_spn1) - { + if (plmn_spn1) { free(plmn_spn1); } - } - else if(sim_state_info.sim_card_ready[1]) - { + } else if(sim_state_info.sim_card_ready[1]) { char *plmn_spn1 = get_plmn_spn_network(1, sim_state_info.handle[1]); quickpanel_handler_text_set(plmn_spn1); - if (plmn_spn1) - { + if (plmn_spn1) { free(plmn_spn1); } - } - else - { + } else { quickpanel_handler_text_set(_("IDS_IDLE_MBODY_EMERGENCY_CALLS_ONLY")); } - } static void init_view() @@ -425,16 +345,14 @@ static void init_view() struct appdata *ad = NULL; ad = quickpanel_get_app_data(); - if (ad == NULL) - { + if (ad == NULL) { ERR("invalid data"); return; } int flight_mode_state = EINA_FALSE; int ret = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode_state); - if(ret != 0) - { + if(ret != 0) { ERR("Could not get 'VCONFKEY_TELEPHONY_FLIGHT_MODE' value"); } @@ -450,20 +368,18 @@ static void _init_tel() /* Get CP name list – cp_list */ cp_list = tel_get_cp_name_list(); - if(cp_list == NULL) - { + if(cp_list == NULL) { ERR("Could not get the cp_name_list"); return; } - while (cp_list[modem_num]) - { + while (cp_list[modem_num]) { /* Initialize TAPI handle */ sim_state_info.handle[modem_num] = tel_init(cp_list[modem_num]); - if(cp_list[modem_num]) - ERR("sim_state_info.handle[%d] = %s; ptr = %p", modem_num, - cp_list[modem_num], sim_state_info.handle[modem_num]); + if (cp_list[modem_num]) { + ERR("sim_state_info.handle[%d] = %s; ptr = %p", modem_num, cp_list[modem_num], sim_state_info.handle[modem_num]); + } /* Move to next CP Name in cp_list */ modem_num++; @@ -479,8 +395,7 @@ static void _init_tel() static void _deinit_tel() { int i = 0; - while (sim_state_info.handle[i]) - { + while (sim_state_info.handle[i]) { /* De-initialize TAPI handle */ tel_deinit(sim_state_info.handle[i]); sim_state_info.handle[i] = NULL; @@ -497,17 +412,14 @@ void tel_ready_cb(keynode_t *key, void *data) status = vconf_keynode_get_bool(key); - if (status == TRUE) - { /* Telephony State - READY */ + if (status == TRUE) { /* Telephony State - READY */ DBG("tel status[%d]", status); _init_tel(); register_sim_callbacks(); get_sim_status(); init_view(); - } - else - { /* Telephony State – NOT READY */ + } else { /* Telephony State – NOT READY */ /* De-initialization is optional here (ONLY if required) */ ERR("tel status[%d]", status); _deinit_tel(); @@ -529,18 +441,21 @@ static void tel_flight_mode_cb(keynode_t *key, void *data) // -------------------------------------------------------------------------------------------- static void on_sim_card_status_changed(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - int handle_num = (int)user_data; + int handle_num; int *sim_status = data; + /** + * @note + * Casting the pointer to "long" first for 64 bits architecture. + * And then convert it to "int" + */ + handle_num = (int)((long)user_data); + ERR("SIM[%p][%d] status[%d], [%d][%d]", handle, handle_num, *sim_status, sim_state_info.sim_card_ready[0], sim_state_info.sim_card_ready[1]); - if(*sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || - *sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) - { + if(*sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || *sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) { sim_state_info.sim_card_ready[handle_num] = EINA_TRUE; - } - else - { + } else { sim_state_info.sim_card_ready[handle_num] = EINA_FALSE; } @@ -550,16 +465,14 @@ static void on_sim_card_status_changed(TapiHandle *handle, const char *noti_id, static void on_plmn_spn_changed(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - if(!handle) - { + if (!handle) { ERR("handle == NULL"); return; } - int flight_mode_state = EINA_FALSE; + int flight_mode_state = EINA_FALSE; int ret = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode_state); - if(ret != 0) - { + if (ret != 0) { ERR("Could not get the 'VCONFKEY_TELEPHONY_FLIGHT_MODE' value"); } sim_handler_text_set(flight_mode_state); @@ -567,52 +480,38 @@ static void on_plmn_spn_changed(TapiHandle *handle, const char *noti_id, static void register_sim_callbacks() { - int i; + long i; int ret; - for(i = 0; i < TAPI_HANDLE_MAX; ++i) - { - if(sim_state_info.handle[i]) - { - ret = tel_register_noti_event (sim_state_info.handle[i], - TAPI_NOTI_SIM_STATUS, on_sim_card_status_changed, (void*)i); - if (ret != TAPI_API_SUCCESS) - { + for (i = 0; i < TAPI_HANDLE_MAX; ++i) { + if (sim_state_info.handle[i]) { + ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_NOTI_SIM_STATUS, on_sim_card_status_changed, (void *)i); + if (ret != TAPI_API_SUCCESS) { ERR("Failed to register 'on_sim_card_status_changed' callback to handle[%d][%d]", i, ret); - } - else - { + } else { ERR("SIM card status changed event registered"); } - ret = tel_register_noti_event(sim_state_info.handle[i], - TAPI_PROP_NETWORK_SPN_NAME, on_plmn_spn_changed, (void*)i); - if (ret != TAPI_API_SUCCESS) - { + ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_SPN_NAME, on_plmn_spn_changed, (void *)i); + if (ret != TAPI_API_SUCCESS) { ERR("Failed to register 'on_plmn_spn_changed' callback to handle[%d][%d]", i, ret); } - ret = tel_register_noti_event(sim_state_info.handle[i], - TAPI_PROP_NETWORK_NETWORK_NAME, on_plmn_spn_changed, (void*)i); - if (ret != TAPI_API_SUCCESS) - { + ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_NETWORK_NAME, on_plmn_spn_changed, (void *)i); + if (ret != TAPI_API_SUCCESS) { ERR("Failed to register 'on_plmn_spn_changed' callback to handle: %i", i); } - ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE, on_plmn_spn_changed, (void*) i); - if (ret != TAPI_API_SUCCESS) - { + ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE, on_plmn_spn_changed, (void *)i); + if (ret != TAPI_API_SUCCESS) { ERR("Failed to register network service type[%d][%d]", ret, i); } - ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_NAME_OPTION, on_plmn_spn_changed, (void*) i); - if (ret != TAPI_API_SUCCESS) - { + ret = tel_register_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_NAME_OPTION, on_plmn_spn_changed, (void *)i); + if (ret != TAPI_API_SUCCESS) { ERR("Failed to register network name option[%d][%d]", ret, i); } - } - else - { + } else { ERR("No handle [%d]", i); } } @@ -622,57 +521,45 @@ static void unregister_sim_callbacks() { int i; int ret; - for(i = 0; i < TAPI_HANDLE_MAX; ++i) - { - if(sim_state_info.handle[i]) - { + for(i = 0; i < TAPI_HANDLE_MAX; ++i) { + if(sim_state_info.handle[i]) { ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_NOTI_SIM_STATUS); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to dereregister TAPI_NOTI_SIM_STATUS callback from handle: %i", i); - } - else - { + } else { DBG("SIM status changed event deregistered"); } ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_NETWORK_NAME); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to dereregister TAPI_PROP_NETWORK_PLMN callback from handle: %i", i); } ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_SPN_NAME); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to dereregister TAPI_PROP_NETWORK_SPN_NAME callback from handle: %i", i); } ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to deregister network service type[%d][%d]", ret, i); } ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_PROP_NETWORK_NAME_OPTION); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to deregister network name option[%d][%d]", ret, i); } - if(i == 0) - { + if(i == 0) { ret = tel_deregister_noti_event(sim_state_info.handle[i], TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION); - if (ret != TAPI_API_SUCCESS) - { + if (ret != TAPI_API_SUCCESS) { ERR("Failed to dereregister callback to handle: %d", i); } } } - } + } // for } - void sim_controller_init(Evas_Object *master_layout) { int state = EINA_FALSE; @@ -682,8 +569,8 @@ void sim_controller_init(Evas_Object *master_layout) DBG("VCONFKEY_TELEPHONY_READY == %d", state); - if (ret != -1 && state == TRUE) - { /* Telephony State - READY */ + if (ret != -1 && state == TRUE) { + /* Telephony State - READY */ /* Initialize TAPI handles */ _init_tel(); @@ -691,25 +578,19 @@ void sim_controller_init(Evas_Object *master_layout) get_sim_status(); init_view(); - } - else - { /* Telephony State – NOT READY, register for change in state */ + } else { /* Telephony State – NOT READY, register for change in state */ DBG("Telephony state: [NOT Ready]"); } /* Register for Telephony state change */ ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_READY, tel_ready_cb, master_layout); - if(ret != 0) + if(ret != 0) { ERR("Failed to register VCONFKEY_TELEPHONY_READY key changed callback"); + } ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, tel_flight_mode_cb, master_layout); - if(ret != 0) + if(ret != 0) { ERR("Failed to register VCONFKEY_TELEPHONY_FLIGHT_MODE key changed callback"); - - ret = vconf_notify_key_changed(VCONFKEY_CALL_STATE, __sim_controller_call_state_changed_cb, NULL); - if (ret != 0) - { - ERR("Failed to notify call state[%d]", ret); } } @@ -722,29 +603,21 @@ void sim_controller_resume() int card_changed; ret = vconf_get_bool(VCONFKEY_TELEPHONY_READY, &state); - if (ret != 0 || state == FALSE) - { + if (ret != 0 || state == FALSE) { ERR("Failed to get telephony state[%d][%d]", state, ret); return; } - for (i = 0; i < TAPI_HANDLE_MAX; ++i) - { - if (sim_state_info.handle[i]) - { + for (i = 0; i < TAPI_HANDLE_MAX; ++i) { + if (sim_state_info.handle[i]) { ret = tel_get_sim_init_info(sim_state_info.handle[i], &sim_status, &card_changed); DBG("SIM[%d] info[%d][%d][%d]", i, ret, sim_status, card_changed); - if (sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || - sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) - { - if (sim_state_info.sim_card_ready[i] != EINA_TRUE) - { + if (sim_status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED || sim_status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) { + if (sim_state_info.sim_card_ready[i] != EINA_TRUE) { ERR("SIM[%d] is init completed but local value is not ture", i); } } - } - else - { + } else { ERR("No handle[%d]", i); } } @@ -755,12 +628,10 @@ void sim_controller_on_language_change() on_plmn_spn_changed(sim_state_info.handle[0], "SELF", NULL, (void*) 0); on_plmn_spn_changed(sim_state_info.handle[1], "SELF", NULL, (void*) 1); - if (sim_state_info.handle[0] == NULL && sim_state_info.handle[1] == NULL) - { + if (sim_state_info.handle[0] == NULL && sim_state_info.handle[1] == NULL) { int flight_mode = EINA_FALSE; int ret = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode); - if (ret != 0) - { + if (ret != 0) { ERR("Failed to get flight mode[%d]", ret); } diff --git a/daemon/sim_controller.h b/daemon/sim_controller.h index 008f4ac..54940de 100644..100755 --- a/daemon/sim_controller.h +++ b/daemon/sim_controller.h @@ -19,11 +19,9 @@ #ifndef __SIM_CONTROL_H__ #define __SIM_CONTROL_H__ -#include <Elementary.h> -#include <Evas.h> -void sim_controller_init(Evas_Object *master_layout); -void sim_controller_resume(); -void sim_controller_on_language_change(); +extern void sim_controller_init(Evas_Object *master_layout); +extern void sim_controller_resume(); +extern void sim_controller_on_language_change(); -#endif // __SIM_CONTROL_H__
\ No newline at end of file +#endif // __SIM_CONTROL_H__ diff --git a/daemon/vi/vi_manager.c b/daemon/vi/vi_manager.c index eeca062..9635c0f 100644..100755 --- a/daemon/vi/vi_manager.c +++ b/daemon/vi/vi_manager.c @@ -15,9 +15,17 @@ * */ +#include <Elementary.h> -#include "vi_manager.h" +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "quickpanel-ui.h" +#include "common_uic.h" +#include "common.h" #include "list_util.h" +#include "vi_manager.h" #include "pager.h" static int _init(void *data); @@ -173,18 +181,7 @@ HAPI QP_VI *quickpanel_vi_new(void) return vi; } -HAPI QP_VI *quickpanel_vi_new_with_data(qp_vi_op_type op_type, - qp_item_type_e item_type, - void *container, - void *target, - vi_cb init_cb, - vi_cb job_cb, - vi_cb done_cb, - vi_cb interrupt_cb, - void *extra_data_1, - void *extra_data_2, - int extra_flag_1, - int extra_flag_2) +HAPI QP_VI *quickpanel_vi_new_with_data(qp_vi_op_type op_type, qp_item_type_e item_type, void *container, void *target, vi_cb init_cb, vi_cb job_cb, vi_cb done_cb, vi_cb interrupt_cb, void *extra_data_1, void *extra_data_2, int extra_flag_1, int extra_flag_2) { QP_VI *vi = (QP_VI *)calloc(1, sizeof(QP_VI)); @@ -376,21 +373,21 @@ HAPI Elm_Transit_Tween_Mode quickpanel_vim_get_tweenmode(qp_vi_op_type op_type) Elm_Transit_Tween_Mode mode = ELM_TRANSIT_TWEEN_MODE_LINEAR; switch (op_type) { - case VI_OP_INSERT: - mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE; - break; - case VI_OP_UPDATE: - mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE; - break; - case VI_OP_DELETE: - mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE; - break; - case VI_OP_REORDER: - mode = ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL; - break; - default : - mode = ELM_TRANSIT_TWEEN_MODE_LINEAR; - break; + case VI_OP_INSERT: + mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE; + break; + case VI_OP_UPDATE: + mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE; + break; + case VI_OP_DELETE: + mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE; + break; + case VI_OP_REORDER: + mode = ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL; + break; + default : + mode = ELM_TRANSIT_TWEEN_MODE_LINEAR; + break; } return mode; diff --git a/daemon/vi/vi_manager.h b/daemon/vi/vi_manager.h index b2713f9..ace6afd 100644..100755 --- a/daemon/vi/vi_manager.h +++ b/daemon/vi/vi_manager.h @@ -19,9 +19,6 @@ #ifndef __QUICKPANEL_VI_MANAGER_H__ #define __QUICKPANEL_VI_MANAGER_H__ -#include "quickpanel-ui.h" -#include "common.h" -#include "list_util.h" typedef Eina_Bool (*vi_cb)(void *data); @@ -74,30 +71,19 @@ typedef struct _qp_vi_op_table { void (*handler)(void *data); } qp_vi_op_table; -QP_VI *quickpanel_vi_new(void); -QP_VI *quickpanel_vi_new_with_data( qp_vi_op_type op_type, - qp_item_type_e item_type, - void *container, - void *target, - vi_cb init_cb, - vi_cb job_cb, - vi_cb done_cb, - vi_cb interrupt_cb, - void *extra_data_1, - void *extra_data_2, - int extra_flag_1, - int extra_flag_2); -void quickpanel_vi_start(QP_VI *vi); -void quickpanel_vi_interrupt(QP_VI *vi); -void quickpanel_vi_done(QP_VI *vi); -void quickpanel_vim_set_state_ready(void); -void quickpanel_vim_set_state_suspend(void); -double quickpanel_vim_get_duration(qp_vi_op_type op_type); -void quickpanel_vi_done_cb_for_transit(void *data, Elm_Transit *transit); -Elm_Transit_Tween_Mode quickpanel_vim_get_tweenmode(qp_vi_op_type op_type); +extern QP_VI *quickpanel_vi_new(void); +extern QP_VI *quickpanel_vi_new_with_data(qp_vi_op_type op_type, qp_item_type_e item_type, void *container, void *target, vi_cb init_cb, vi_cb job_cb, vi_cb done_cb, vi_cb interrupt_cb, void *extra_data_1, void *extra_data_2, int extra_flag_1, int extra_flag_2); +extern void quickpanel_vi_start(QP_VI *vi); +extern void quickpanel_vi_interrupt(QP_VI *vi); +extern void quickpanel_vi_done(QP_VI *vi); +extern void quickpanel_vim_set_state_ready(void); +extern void quickpanel_vim_set_state_suspend(void); +extern double quickpanel_vim_get_duration(qp_vi_op_type op_type); +extern void quickpanel_vi_done_cb_for_transit(void *data, Elm_Transit *transit); +extern Elm_Transit_Tween_Mode quickpanel_vim_get_tweenmode(qp_vi_op_type op_type); -void quickpanel_vi_user_event_add(QP_VI *vi); -void quickpanel_vi_user_event_del(QP_VI *vi); -void quickpanel_vi_object_event_freeze_set(Evas_Object *obj, Eina_Bool freeze); +extern void quickpanel_vi_user_event_add(QP_VI *vi); +extern void quickpanel_vi_user_event_del(QP_VI *vi); +extern void quickpanel_vi_object_event_freeze_set(Evas_Object *obj, Eina_Bool freeze); #endif diff --git a/daemon/voice_control.c b/daemon/voice_control.c new file mode 100755 index 0000000..56f95c4 --- /dev/null +++ b/daemon/voice_control.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#include <Elementary.h> + +#include <voice_control_setting.h> +#include <app_control_internal.h> +#include <tzsh.h> +#include <tzsh_quickpanel_service.h> +#include <E_DBus.h> + +#include "common.h" +#include "common_uic.h" +#include "voice_control.h" +#include "quickpanel-ui.h" +#include "list_util.h" + + +static int _init(void *data); +static int _fini(void *data); +Evas_Object* _voice_control_view_create(void *data); +static void _voice_control_register_event(void *data); +static bool _check_voice_control_enabled(void); + +QP_Module voice_control = { + .name = "voice_control", + .init = _init, + .fini = _fini, + .suspend = NULL, + .resume = NULL, + .hib_enter = NULL, + .hib_leave = NULL, + .lang_changed = NULL, + .refresh = NULL, + .get_height = NULL, + .qp_opened = NULL, + .qp_closed = NULL, +}; + +static Evas_Object *g_layout = NULL; + +static void _voice_control_view_destroy(void *data) +{ + DBG("_voice_control_view_destroy"); + struct appdata *ad = data; + + if (ad == NULL) + { + ERR("invalid data"); + return; + } + + if (g_layout == NULL) + { + ERR("g_layout is not exist"); + return; + } + + quickpanel_list_util_item_unpack_by_object(ad->list, g_layout, 0, 0); + quickpanel_list_util_item_del_tag(g_layout); + elm_object_signal_emit(ad->ly, "voice_icon.hide", "quickpanel.prog"); + + if (g_layout != NULL) { + evas_object_del(g_layout); + g_layout = NULL; + } +} + +static int _init(void *data) +{ + struct appdata *ad = (struct appdata *)data; + + if (0 != vc_setting_initialize()) { + ERR("Fail to init"); + return QP_FAIL; + } + + _voice_control_register_event(data); + + if (_check_voice_control_enabled()) { //when module restart + _voice_control_view_create(ad); + } + + return QP_OK; +} + +static int _fini(void *data) +{ + struct appdata *ad = (struct appdata *)data; + + if (0 != vc_setting_deinitialize()) { + ERR("Fail to vc_setting_deinitialize"); + } + + _voice_control_view_destroy(ad); + + return QP_OK; +} + +static void _vc_enabled_changed_cb(bool enabled, void* user_data) +{ + DBG("_vc_enabled_changed_cb"); + struct appdata *ad = user_data; + + if( !enabled ) { //deactivated voice controller + _voice_control_view_destroy(ad); + } else { + _voice_control_view_create(ad); + } +} + +static void _voice_control_register_event(void *data) +{ + DBG("_voice_control_register_event"); + if (0 != vc_setting_set_enabled_changed_cb(_vc_enabled_changed_cb, data)) { + ERR("Fail to set enabled cb"); + return; + } +} + +static bool _check_voice_control_enabled(void) +{ + bool enabled = false; + + if (0 != vc_setting_get_enabled(&enabled)) { + ERR("Fail to get enabled"); + } + DBG("_check_voice_control_enabled enabled %d",enabled); + + return enabled; +} + +static void _button_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + DBG("_button_clicked_cb"); + int ret = 0; + quickpanel_uic_launch_ug_by_appcontrol(VOICE_CONTOL_REF_APP, NULL); + quickpanel_uic_launch_app_inform_result(VOICE_CONTOL_REF_APP, ret); + quickpanel_uic_close_quickpanel(true, 1); + +} + +Evas_Object* _voice_control_view_create(void *data) +{ + DBG("_voice_control_view_create"); + struct appdata *ad = data; + Evas_Object *layout = NULL; + Eina_Bool ret = EINA_FALSE; + + if (!_check_voice_control_enabled()) { + ERR("voice control is not enabled."); + return layout; + } + if (ad->win == NULL) + { + ERR("invalid parent"); + return layout; + } + + if (g_layout) + { + ERR("voice control view is already created."); + return g_layout; + } + + layout = elm_layout_add(ad->win); + if (layout == NULL) + { + ERR("Failed to create voice control layout"); + return layout; + } + + g_layout = layout; + + ret = elm_layout_file_set(layout, VOICE_CONTOL_EDJ, "quickpanel/voice_control/default"); + if (ret == EINA_FALSE) + { + ERR("Failed to set layout file[%d]", ret); + evas_object_del(layout); + return NULL; + } + + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(layout); + + elm_object_signal_callback_add(layout, "button_clicked" , "", _button_clicked_cb, ad); + elm_object_signal_emit(ad->ly, "voice_icon.show", "quickpanel.prog"); + + // attach to list + qp_item_data *qid = quickpanel_list_util_item_new(QP_ITEM_TYPE_VOICE_CONTOL, layout); + quickpanel_list_util_item_set_tag(layout, qid); + quickpanel_list_util_sort_insert(ad->list, layout); + quickpanel_uic_initial_resize(layout, QP_VOICE_CONTOL_HEIGHT); + + return layout; +} + diff --git a/daemon/voice_control.h b/daemon/voice_control.h new file mode 100755 index 0000000..d1ef423 --- /dev/null +++ b/daemon/voice_control.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#ifndef VOICE_CONTROL_VIEW_H_ +#define VOICE_CONTROL_VIEW_H_ + + +#define EDJE_DIR "/usr/apps/org.tizen.quickpanel/res/edje/" +#define VOICE_CONTOL_EDJ EDJE_DIR"/quickpanel_voice_control.edj" + +#define QP_VOICE_CONTOL_HEIGHT 80 +#define VOICE_CONTOL_REF_APP "org.tizen.voice-control-panel" + + +#endif /* VOICE_CONTROL_VIEW_H_ */ + diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index c7aa941..6e3471d 100644..100755 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -3,16 +3,11 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons DESTINATION ${RESDIR} FILES_ #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.${PROJECT_NAME}.desktop DESTINATION ${DESKTOPDIR}) CONFIGURE_FILE(${PROJECT_NAME}.xml.in ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.${PROJECT_NAME}.xml) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.${PROJECT_NAME}.xml DESTINATION ${MANIFESTXMLDIR}) - CONFIGURE_FILE(${PROJECT_NAME}.sh.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} DESTINATION /etc/init.d/) -#CONFIGURE_FILE(${PROJECT_NAME}.png ${CMAKE_CURRENT_BINARY_DIR}/${VENDOR}.${PROJECT_NAME}.png COPYONLY) -#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${VENDOR}.${PROJECT_NAME}.png DESTINATION "/usr/share/icons/default/small") - MESSAGE("EDJE_CC CUSTOM FLAG : ${EDJEFLAGS}") - ADD_CUSTOM_TARGET(quickpanel.edj COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images_icon -id ${CMAKE_CURRENT_SOURCE_DIR}/images "${EDJEFLAGS}" ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel.edc @@ -29,6 +24,16 @@ ADD_CUSTOM_TARGET(quickpanel_activenoti.edj ) ADD_DEPENDENCIES(${PROJECT_NAME} quickpanel_activenoti.edj) +ADD_CUSTOM_TARGET(quickpanel_voice_control.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images_icon -id ${CMAKE_CURRENT_SOURCE_DIR}/images "${EDJEFLAGS}" + ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_voice_control.edc + ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_voice_control.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_voice_control.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} quickpanel_voice_control.edj) + + + ADD_CUSTOM_TARGET(quickpanel_theme.edj COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images_icon -id ${CMAKE_CURRENT_SOURCE_DIR}/images "${EDJEFLAGS}" ${CMAKE_CURRENT_SOURCE_DIR}/quickpanel_theme.edc @@ -39,6 +44,7 @@ ADD_DEPENDENCIES(${PROJECT_NAME} quickpanel_theme.edj) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel.edj DESTINATION ${EDJDIR}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_activenoti.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_voice_control.edj DESTINATION ${EDJDIR}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/quickpanel_theme.edj DESTINATION ${EDJDIR}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons DESTINATION ${RESDIR} FILES_MATCHING PATTERN "*.png") diff --git a/data/color_classes.edc b/data/color_classes.edc index d9c2d6e..537d513 100644..100755 --- a/data/color_classes.edc +++ b/data/color_classes.edc @@ -376,4 +376,32 @@ color_classes { name: "AO008_STATUS"; color: 18 75 107 255; } + color_class { + name: "A03O003L1"; + color: 61 185 204 255; + } + color_class { + name: "ATO012"; + color: 128 128 128 255; + } + color_class { + name: "F043P"; + color: 31 92 102 255; + } + color_class { + name: "T023"; + color: 72 72 72 255; + } + color_class { + name: "B011"; + color: 20 107 147 127; + } + color_class { + name: "B0517"; + color: 147 147 147 255; + } + color_class { + name: "W0661"; + color: 155 216 226 255; + } } diff --git a/data/images_icon/voice_control_icon_mic.png b/data/images_icon/voice_control_icon_mic.png Binary files differnew file mode 100755 index 0000000..0e3a54e --- /dev/null +++ b/data/images_icon/voice_control_icon_mic.png diff --git a/data/images_noti_icons/Account/noti_account_samsung.png b/data/images_noti_icons/Account/noti_account_samsung.png Binary files differindex 274c505..9b4efd7 100644..100755 --- a/data/images_noti_icons/Account/noti_account_samsung.png +++ b/data/images_noti_icons/Account/noti_account_samsung.png diff --git a/data/images_noti_icons/Account/noti_account_tizen.png b/data/images_noti_icons/Account/noti_account_tizen.png Binary files differindex aef42af..c13186d 100644..100755 --- a/data/images_noti_icons/Account/noti_account_tizen.png +++ b/data/images_noti_icons/Account/noti_account_tizen.png diff --git a/data/images_noti_icons/Bluetooth/noti_bluetooth.png b/data/images_noti_icons/Bluetooth/noti_bluetooth.png Binary files differindex 2c445af..f14c8b9 100644..100755 --- a/data/images_noti_icons/Bluetooth/noti_bluetooth.png +++ b/data/images_noti_icons/Bluetooth/noti_bluetooth.png diff --git a/data/images_noti_icons/Bluetooth/noti_bluetooth_activated.png b/data/images_noti_icons/Bluetooth/noti_bluetooth_activated.png Binary files differindex 171e2f5..059897b 100644..100755 --- a/data/images_noti_icons/Bluetooth/noti_bluetooth_activated.png +++ b/data/images_noti_icons/Bluetooth/noti_bluetooth_activated.png diff --git a/data/images_noti_icons/Bluetooth/noti_bluetooth_fail.png b/data/images_noti_icons/Bluetooth/noti_bluetooth_fail.png Binary files differindex 77be75f..9439c19 100644..100755 --- a/data/images_noti_icons/Bluetooth/noti_bluetooth_fail.png +++ b/data/images_noti_icons/Bluetooth/noti_bluetooth_fail.png diff --git a/data/images_noti_icons/Bluetooth/noti_bluetooth_not_connected.png b/data/images_noti_icons/Bluetooth/noti_bluetooth_not_connected.png Binary files differindex 2574dbc..2574dbc 100644..100755 --- a/data/images_noti_icons/Bluetooth/noti_bluetooth_not_connected.png +++ b/data/images_noti_icons/Bluetooth/noti_bluetooth_not_connected.png diff --git a/data/images_noti_icons/Calendar/noti_calendar.png b/data/images_noti_icons/Calendar/noti_calendar.png Binary files differindex 84333ab..ffed971 100644..100755 --- a/data/images_noti_icons/Calendar/noti_calendar.png +++ b/data/images_noti_icons/Calendar/noti_calendar.png diff --git a/data/images_noti_icons/Calendar/noti_calendar_02.png b/data/images_noti_icons/Calendar/noti_calendar_02.png Binary files differnew file mode 100755 index 0000000..e537aa9 --- /dev/null +++ b/data/images_noti_icons/Calendar/noti_calendar_02.png diff --git a/data/images_noti_icons/Calendar/noti_calendar_alarm.png b/data/images_noti_icons/Calendar/noti_calendar_alarm.png Binary files differindex 32c4017..a6244a9 100644..100755 --- a/data/images_noti_icons/Calendar/noti_calendar_alarm.png +++ b/data/images_noti_icons/Calendar/noti_calendar_alarm.png diff --git a/data/images_noti_icons/Clock/noti_clock_snooze.png b/data/images_noti_icons/Clock/noti_clock_snooze.png Binary files differindex fe0d331..8e07360 100644..100755 --- a/data/images_noti_icons/Clock/noti_clock_snooze.png +++ b/data/images_noti_icons/Clock/noti_clock_snooze.png diff --git a/data/images_noti_icons/Common/noti_download_01.png b/data/images_noti_icons/Common/noti_download_01.png Binary files differindex 1347662..e753be2 100644..100755 --- a/data/images_noti_icons/Common/noti_download_01.png +++ b/data/images_noti_icons/Common/noti_download_01.png diff --git a/data/images_noti_icons/Common/noti_download_02.png b/data/images_noti_icons/Common/noti_download_02.png Binary files differindex 52848ca..e221d38 100644..100755 --- a/data/images_noti_icons/Common/noti_download_02.png +++ b/data/images_noti_icons/Common/noti_download_02.png diff --git a/data/images_noti_icons/Common/noti_download_03.png b/data/images_noti_icons/Common/noti_download_03.png Binary files differindex ef20442..942b51e 100644..100755 --- a/data/images_noti_icons/Common/noti_download_03.png +++ b/data/images_noti_icons/Common/noti_download_03.png diff --git a/data/images_noti_icons/Common/noti_download_04.png b/data/images_noti_icons/Common/noti_download_04.png Binary files differindex b609329..c3b6e70 100644..100755 --- a/data/images_noti_icons/Common/noti_download_04.png +++ b/data/images_noti_icons/Common/noti_download_04.png diff --git a/data/images_noti_icons/Common/noti_download_05.png b/data/images_noti_icons/Common/noti_download_05.png Binary files differindex bab9835..7730941 100644..100755 --- a/data/images_noti_icons/Common/noti_download_05.png +++ b/data/images_noti_icons/Common/noti_download_05.png diff --git a/data/images_noti_icons/Common/noti_download_complete.png b/data/images_noti_icons/Common/noti_download_complete.png Binary files differindex 9e35143..771bc4e 100644..100755 --- a/data/images_noti_icons/Common/noti_download_complete.png +++ b/data/images_noti_icons/Common/noti_download_complete.png diff --git a/data/images_noti_icons/Common/noti_download_failed.png b/data/images_noti_icons/Common/noti_download_failed.png Binary files differindex 650311f..012df7b 100644..100755 --- a/data/images_noti_icons/Common/noti_download_failed.png +++ b/data/images_noti_icons/Common/noti_download_failed.png diff --git a/data/images_noti_icons/Common/noti_syncing.png b/data/images_noti_icons/Common/noti_syncing.png Binary files differindex fa69a14..a87d011 100644..100755 --- a/data/images_noti_icons/Common/noti_syncing.png +++ b/data/images_noti_icons/Common/noti_syncing.png diff --git a/data/images_noti_icons/Common/noti_upload_01.png b/data/images_noti_icons/Common/noti_upload_01.png Binary files differindex 6445da8..208dc94 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_01.png +++ b/data/images_noti_icons/Common/noti_upload_01.png diff --git a/data/images_noti_icons/Common/noti_upload_02.png b/data/images_noti_icons/Common/noti_upload_02.png Binary files differindex bf230fd..2f79bbc 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_02.png +++ b/data/images_noti_icons/Common/noti_upload_02.png diff --git a/data/images_noti_icons/Common/noti_upload_03.png b/data/images_noti_icons/Common/noti_upload_03.png Binary files differindex 306a258..39b85c9 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_03.png +++ b/data/images_noti_icons/Common/noti_upload_03.png diff --git a/data/images_noti_icons/Common/noti_upload_04.png b/data/images_noti_icons/Common/noti_upload_04.png Binary files differindex 50c0e9d..ee51d0c 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_04.png +++ b/data/images_noti_icons/Common/noti_upload_04.png diff --git a/data/images_noti_icons/Common/noti_upload_05.png b/data/images_noti_icons/Common/noti_upload_05.png Binary files differindex fb49ad8..06dacdc 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_05.png +++ b/data/images_noti_icons/Common/noti_upload_05.png diff --git a/data/images_noti_icons/Common/noti_upload_complete.png b/data/images_noti_icons/Common/noti_upload_complete.png Binary files differindex 2ee11d8..dc173e1 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_complete.png +++ b/data/images_noti_icons/Common/noti_upload_complete.png diff --git a/data/images_noti_icons/Common/noti_upload_failed.png b/data/images_noti_icons/Common/noti_upload_failed.png Binary files differindex ef239c5..7c612ec 100644..100755 --- a/data/images_noti_icons/Common/noti_upload_failed.png +++ b/data/images_noti_icons/Common/noti_upload_failed.png diff --git a/data/images_noti_icons/Contact/noti_contact_default.png b/data/images_noti_icons/Contact/noti_contact_default.png Binary files differindex 45b6a70..95ba822 100644..100755 --- a/data/images_noti_icons/Contact/noti_contact_default.png +++ b/data/images_noti_icons/Contact/noti_contact_default.png diff --git a/data/images_noti_icons/Contact/noti_icon_missed.png b/data/images_noti_icons/Contact/noti_icon_missed.png Binary files differnew file mode 100755 index 0000000..f9510ac --- /dev/null +++ b/data/images_noti_icons/Contact/noti_icon_missed.png diff --git a/data/images_noti_icons/Drop box/moti_dropbox.png b/data/images_noti_icons/Drop box/moti_dropbox.png Binary files differindex 829fa20..be05743 100644..100755 --- a/data/images_noti_icons/Drop box/moti_dropbox.png +++ b/data/images_noti_icons/Drop box/moti_dropbox.png diff --git a/data/images_noti_icons/E-mail/noti_email.png b/data/images_noti_icons/E-mail/noti_email.png Binary files differindex fd3cfde..58baaaf 100644..100755 --- a/data/images_noti_icons/E-mail/noti_email.png +++ b/data/images_noti_icons/E-mail/noti_email.png diff --git a/data/images_noti_icons/E-mail/noti_email_delivery_report.png b/data/images_noti_icons/E-mail/noti_email_delivery_report.png Binary files differindex 2af411f..b2237ff 100644..100755 --- a/data/images_noti_icons/E-mail/noti_email_delivery_report.png +++ b/data/images_noti_icons/E-mail/noti_email_delivery_report.png diff --git a/data/images_noti_icons/E-mail/noti_email_read_report.png b/data/images_noti_icons/E-mail/noti_email_read_report.png Binary files differindex 9c85489..cc1ac9d 100644..100755 --- a/data/images_noti_icons/E-mail/noti_email_read_report.png +++ b/data/images_noti_icons/E-mail/noti_email_read_report.png diff --git a/data/images_noti_icons/E-mail/noti_email_scheduled.png b/data/images_noti_icons/E-mail/noti_email_scheduled.png Binary files differindex 167b2e1..59fea6b 100644..100755 --- a/data/images_noti_icons/E-mail/noti_email_scheduled.png +++ b/data/images_noti_icons/E-mail/noti_email_scheduled.png diff --git a/data/images_noti_icons/E-mail/noti_email_sent.png b/data/images_noti_icons/E-mail/noti_email_sent.png Binary files differindex 488a904..a81c959 100644..100755 --- a/data/images_noti_icons/E-mail/noti_email_sent.png +++ b/data/images_noti_icons/E-mail/noti_email_sent.png diff --git a/data/images_noti_icons/Etc/Icon_tethering_unknown_usb_fail.png b/data/images_noti_icons/Etc/Icon_tethering_unknown_usb_fail.png Binary files differindex 2482af9..d856d54 100644..100755 --- a/data/images_noti_icons/Etc/Icon_tethering_unknown_usb_fail.png +++ b/data/images_noti_icons/Etc/Icon_tethering_unknown_usb_fail.png diff --git a/data/images_noti_icons/Etc/noti_accessory_connected.png b/data/images_noti_icons/Etc/noti_accessory_connected.png Binary files differindex dabd9ab..11452da 100644..100755 --- a/data/images_noti_icons/Etc/noti_accessory_connected.png +++ b/data/images_noti_icons/Etc/noti_accessory_connected.png diff --git a/data/images_noti_icons/Etc/noti_all_connected.png b/data/images_noti_icons/Etc/noti_all_connected.png Binary files differindex 81533ce..e1aef25 100644..100755 --- a/data/images_noti_icons/Etc/noti_all_connected.png +++ b/data/images_noti_icons/Etc/noti_all_connected.png diff --git a/data/images_noti_icons/Etc/noti_auto_rejected.png b/data/images_noti_icons/Etc/noti_auto_rejected.png Binary files differindex 38d25d2..53277aa 100644..100755 --- a/data/images_noti_icons/Etc/noti_auto_rejected.png +++ b/data/images_noti_icons/Etc/noti_auto_rejected.png diff --git a/data/images_noti_icons/Etc/noti_backup.png b/data/images_noti_icons/Etc/noti_backup.png Binary files differindex 283a859..f66b841 100644..100755 --- a/data/images_noti_icons/Etc/noti_backup.png +++ b/data/images_noti_icons/Etc/noti_backup.png diff --git a/data/images_noti_icons/Etc/noti_battery_charge.png b/data/images_noti_icons/Etc/noti_battery_charge.png Binary files differindex b7f01db..6bb9883 100644..100755 --- a/data/images_noti_icons/Etc/noti_battery_charge.png +++ b/data/images_noti_icons/Etc/noti_battery_charge.png diff --git a/data/images_noti_icons/Etc/noti_battery_loading.png b/data/images_noti_icons/Etc/noti_battery_loading.png Binary files differindex 4a2955e..30d9280 100644..100755 --- a/data/images_noti_icons/Etc/noti_battery_loading.png +++ b/data/images_noti_icons/Etc/noti_battery_loading.png diff --git a/data/images_noti_icons/Etc/noti_bluetooth_download.png b/data/images_noti_icons/Etc/noti_bluetooth_download.png Binary files differindex 53a3384..9c0146b 100644..100755 --- a/data/images_noti_icons/Etc/noti_bluetooth_download.png +++ b/data/images_noti_icons/Etc/noti_bluetooth_download.png diff --git a/data/images_noti_icons/Etc/noti_camera_connected.png b/data/images_noti_icons/Etc/noti_camera_connected.png Binary files differindex cadf0de..cadf0de 100644..100755 --- a/data/images_noti_icons/Etc/noti_camera_connected.png +++ b/data/images_noti_icons/Etc/noti_camera_connected.png diff --git a/data/images_noti_icons/Etc/noti_chat.png b/data/images_noti_icons/Etc/noti_chat.png Binary files differindex d3e0665..d3e0665 100644..100755 --- a/data/images_noti_icons/Etc/noti_chat.png +++ b/data/images_noti_icons/Etc/noti_chat.png diff --git a/data/images_noti_icons/Etc/noti_data_usage_warning.png b/data/images_noti_icons/Etc/noti_data_usage_warning.png Binary files differindex 328e3e4..328e3e4 100644..100755 --- a/data/images_noti_icons/Etc/noti_data_usage_warning.png +++ b/data/images_noti_icons/Etc/noti_data_usage_warning.png diff --git a/data/images_noti_icons/Etc/noti_desktop_mode.png b/data/images_noti_icons/Etc/noti_desktop_mode.png Binary files differindex 40e63b9..3343b95 100644..100755 --- a/data/images_noti_icons/Etc/noti_desktop_mode.png +++ b/data/images_noti_icons/Etc/noti_desktop_mode.png diff --git a/data/images_noti_icons/Etc/noti_dormant_mode.png b/data/images_noti_icons/Etc/noti_dormant_mode.png Binary files differindex 6c503f8..6c503f8 100644..100755 --- a/data/images_noti_icons/Etc/noti_dormant_mode.png +++ b/data/images_noti_icons/Etc/noti_dormant_mode.png diff --git a/data/images_noti_icons/Etc/noti_download_booster.png b/data/images_noti_icons/Etc/noti_download_booster.png Binary files differindex 3f6fd6f..0dad1b5 100644..100755 --- a/data/images_noti_icons/Etc/noti_download_booster.png +++ b/data/images_noti_icons/Etc/noti_download_booster.png diff --git a/data/images_noti_icons/Etc/noti_ecb_mode.png b/data/images_noti_icons/Etc/noti_ecb_mode.png Binary files differindex cfaeb11..cfaeb11 100644..100755 --- a/data/images_noti_icons/Etc/noti_ecb_mode.png +++ b/data/images_noti_icons/Etc/noti_ecb_mode.png diff --git a/data/images_noti_icons/Etc/noti_error.png b/data/images_noti_icons/Etc/noti_error.png Binary files differindex 79e287e..1cd8e43 100644..100755 --- a/data/images_noti_icons/Etc/noti_error.png +++ b/data/images_noti_icons/Etc/noti_error.png diff --git a/data/images_noti_icons/Etc/noti_firewall_activated.png b/data/images_noti_icons/Etc/noti_firewall_activated.png Binary files differindex 3e2ec47..3e2ec47 100644..100755 --- a/data/images_noti_icons/Etc/noti_firewall_activated.png +++ b/data/images_noti_icons/Etc/noti_firewall_activated.png diff --git a/data/images_noti_icons/Etc/noti_fm_radio.png b/data/images_noti_icons/Etc/noti_fm_radio.png Binary files differindex a35c79f..de1fef5 100644..100755 --- a/data/images_noti_icons/Etc/noti_fm_radio.png +++ b/data/images_noti_icons/Etc/noti_fm_radio.png diff --git a/data/images_noti_icons/Etc/noti_fota.png b/data/images_noti_icons/Etc/noti_fota.png Binary files differindex 7980d1d..7980d1d 100644..100755 --- a/data/images_noti_icons/Etc/noti_fota.png +++ b/data/images_noti_icons/Etc/noti_fota.png diff --git a/data/images_noti_icons/Etc/noti_fota_completion.png b/data/images_noti_icons/Etc/noti_fota_completion.png Binary files differindex 42b4615..42b4615 100644..100755 --- a/data/images_noti_icons/Etc/noti_fota_completion.png +++ b/data/images_noti_icons/Etc/noti_fota_completion.png diff --git a/data/images_noti_icons/Etc/noti_fota_postpone.png b/data/images_noti_icons/Etc/noti_fota_postpone.png Binary files differindex 90a752c..90a752c 100644..100755 --- a/data/images_noti_icons/Etc/noti_fota_postpone.png +++ b/data/images_noti_icons/Etc/noti_fota_postpone.png diff --git a/data/images_noti_icons/Etc/noti_gqs_on.png b/data/images_noti_icons/Etc/noti_gqs_on.png Binary files differindex d380339..d380339 100644..100755 --- a/data/images_noti_icons/Etc/noti_gqs_on.png +++ b/data/images_noti_icons/Etc/noti_gqs_on.png diff --git a/data/images_noti_icons/Etc/noti_gqs_searching.png b/data/images_noti_icons/Etc/noti_gqs_searching.png Binary files differindex d380339..d380339 100644..100755 --- a/data/images_noti_icons/Etc/noti_gqs_searching.png +++ b/data/images_noti_icons/Etc/noti_gqs_searching.png diff --git a/data/images_noti_icons/Etc/noti_im.png b/data/images_noti_icons/Etc/noti_im.png Binary files differindex 6700fed..7a2ba11 100644..100755 --- a/data/images_noti_icons/Etc/noti_im.png +++ b/data/images_noti_icons/Etc/noti_im.png diff --git a/data/images_noti_icons/Etc/noti_install_01.png b/data/images_noti_icons/Etc/noti_install_01.png Binary files differindex ced3bdd..ced3bdd 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_01.png +++ b/data/images_noti_icons/Etc/noti_install_01.png diff --git a/data/images_noti_icons/Etc/noti_install_02.png b/data/images_noti_icons/Etc/noti_install_02.png Binary files differindex 481ff3f..481ff3f 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_02.png +++ b/data/images_noti_icons/Etc/noti_install_02.png diff --git a/data/images_noti_icons/Etc/noti_install_03.png b/data/images_noti_icons/Etc/noti_install_03.png Binary files differindex 2d04ca0..2d04ca0 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_03.png +++ b/data/images_noti_icons/Etc/noti_install_03.png diff --git a/data/images_noti_icons/Etc/noti_install_04.png b/data/images_noti_icons/Etc/noti_install_04.png Binary files differindex 16fa161..16fa161 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_04.png +++ b/data/images_noti_icons/Etc/noti_install_04.png diff --git a/data/images_noti_icons/Etc/noti_install_05.png b/data/images_noti_icons/Etc/noti_install_05.png Binary files differindex a33c76c..a33c76c 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_05.png +++ b/data/images_noti_icons/Etc/noti_install_05.png diff --git a/data/images_noti_icons/Etc/noti_install_complete.png b/data/images_noti_icons/Etc/noti_install_complete.png Binary files differindex b9bd97c..b9bd97c 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_complete.png +++ b/data/images_noti_icons/Etc/noti_install_complete.png diff --git a/data/images_noti_icons/Etc/noti_install_failed.png b/data/images_noti_icons/Etc/noti_install_failed.png Binary files differindex 25a8290..25a8290 100644..100755 --- a/data/images_noti_icons/Etc/noti_install_failed.png +++ b/data/images_noti_icons/Etc/noti_install_failed.png diff --git a/data/images_noti_icons/Etc/noti_keyboard.png b/data/images_noti_icons/Etc/noti_keyboard.png Binary files differindex d527bec..d45dfb7 100644..100755 --- a/data/images_noti_icons/Etc/noti_keyboard.png +++ b/data/images_noti_icons/Etc/noti_keyboard.png diff --git a/data/images_noti_icons/Etc/noti_keyboard_connected.png b/data/images_noti_icons/Etc/noti_keyboard_connected.png Binary files differindex cbac392..cbac392 100644..100755 --- a/data/images_noti_icons/Etc/noti_keyboard_connected.png +++ b/data/images_noti_icons/Etc/noti_keyboard_connected.png diff --git a/data/images_noti_icons/Etc/noti_mms_delivery_report.png b/data/images_noti_icons/Etc/noti_mms_delivery_report.png Binary files differindex ee4ddeb..bafdb6f 100644..100755 --- a/data/images_noti_icons/Etc/noti_mms_delivery_report.png +++ b/data/images_noti_icons/Etc/noti_mms_delivery_report.png diff --git a/data/images_noti_icons/Etc/noti_mms_failed.png b/data/images_noti_icons/Etc/noti_mms_failed.png Binary files differindex 467a8ac..146264c 100644..100755 --- a/data/images_noti_icons/Etc/noti_mms_failed.png +++ b/data/images_noti_icons/Etc/noti_mms_failed.png diff --git a/data/images_noti_icons/Etc/noti_mms_problem.png b/data/images_noti_icons/Etc/noti_mms_problem.png Binary files differindex 47cb544..1d569bb 100644..100755 --- a/data/images_noti_icons/Etc/noti_mms_problem.png +++ b/data/images_noti_icons/Etc/noti_mms_problem.png diff --git a/data/images_noti_icons/Etc/noti_multi_email.png b/data/images_noti_icons/Etc/noti_multi_email.png Binary files differindex 55d4493..dcbee96 100644..100755 --- a/data/images_noti_icons/Etc/noti_multi_email.png +++ b/data/images_noti_icons/Etc/noti_multi_email.png diff --git a/data/images_noti_icons/Etc/noti_multi_window.png b/data/images_noti_icons/Etc/noti_multi_window.png Binary files differindex 0fa8b7d..e5bac16 100644..100755 --- a/data/images_noti_icons/Etc/noti_multi_window.png +++ b/data/images_noti_icons/Etc/noti_multi_window.png diff --git a/data/images_noti_icons/Etc/noti_multiple_devices_connected.png b/data/images_noti_icons/Etc/noti_multiple_devices_connected.png Binary files differindex 3536fc8..3536fc8 100644..100755 --- a/data/images_noti_icons/Etc/noti_multiple_devices_connected.png +++ b/data/images_noti_icons/Etc/noti_multiple_devices_connected.png diff --git a/data/images_noti_icons/Etc/noti_near_by_device.png b/data/images_noti_icons/Etc/noti_near_by_device.png Binary files differindex 2a1d22b..2a1d22b 100644..100755 --- a/data/images_noti_icons/Etc/noti_near_by_device.png +++ b/data/images_noti_icons/Etc/noti_near_by_device.png diff --git a/data/images_noti_icons/Etc/noti_no_sim_full.png b/data/images_noti_icons/Etc/noti_no_sim_full.png Binary files differindex a6278c2..a6278c2 100644..100755 --- a/data/images_noti_icons/Etc/noti_no_sim_full.png +++ b/data/images_noti_icons/Etc/noti_no_sim_full.png diff --git a/data/images_noti_icons/Etc/noti_print.png b/data/images_noti_icons/Etc/noti_print.png Binary files differindex c78749a..f60e8cb 100644..100755 --- a/data/images_noti_icons/Etc/noti_print.png +++ b/data/images_noti_icons/Etc/noti_print.png diff --git a/data/images_noti_icons/Etc/noti_print_waiting.png b/data/images_noti_icons/Etc/noti_print_waiting.png Binary files differindex db23666..a29fc39 100644..100755 --- a/data/images_noti_icons/Etc/noti_print_waiting.png +++ b/data/images_noti_icons/Etc/noti_print_waiting.png diff --git a/data/images_noti_icons/Etc/noti_rcs_chat.png b/data/images_noti_icons/Etc/noti_rcs_chat.png Binary files differindex 502ca27..d692be8 100644..100755 --- a/data/images_noti_icons/Etc/noti_rcs_chat.png +++ b/data/images_noti_icons/Etc/noti_rcs_chat.png diff --git a/data/images_noti_icons/Etc/noti_rcs_file_transfer.png b/data/images_noti_icons/Etc/noti_rcs_file_transfer.png Binary files differindex db8dd12..1acd33f 100644..100755 --- a/data/images_noti_icons/Etc/noti_rcs_file_transfer.png +++ b/data/images_noti_icons/Etc/noti_rcs_file_transfer.png diff --git a/data/images_noti_icons/Etc/noti_safe_mode.png b/data/images_noti_icons/Etc/noti_safe_mode.png Binary files differindex 5617cf2..1f70bd5 100644..100755 --- a/data/images_noti_icons/Etc/noti_safe_mode.png +++ b/data/images_noti_icons/Etc/noti_safe_mode.png diff --git a/data/images_noti_icons/Etc/noti_screen_recorder.png b/data/images_noti_icons/Etc/noti_screen_recorder.png Binary files differindex 2e641c7..2b2a5b6 100644..100755 --- a/data/images_noti_icons/Etc/noti_screen_recorder.png +++ b/data/images_noti_icons/Etc/noti_screen_recorder.png diff --git a/data/images_noti_icons/Etc/noti_screen_recorder_dim.png b/data/images_noti_icons/Etc/noti_screen_recorder_dim.png Binary files differindex 7fcc69f..367f26f 100644..100755 --- a/data/images_noti_icons/Etc/noti_screen_recorder_dim.png +++ b/data/images_noti_icons/Etc/noti_screen_recorder_dim.png diff --git a/data/images_noti_icons/Etc/noti_sd_card.png b/data/images_noti_icons/Etc/noti_sd_card.png Binary files differindex 5edbf0b..30fac67 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card.png +++ b/data/images_noti_icons/Etc/noti_sd_card.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_decryption.png b/data/images_noti_icons/Etc/noti_sd_card_decryption.png Binary files differindex 5fc7cab..5fc7cab 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_decryption.png +++ b/data/images_noti_icons/Etc/noti_sd_card_decryption.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_encryption.png b/data/images_noti_icons/Etc/noti_sd_card_encryption.png Binary files differindex f8ff9a5..f8ff9a5 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_encryption.png +++ b/data/images_noti_icons/Etc/noti_sd_card_encryption.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_encryption_error.png b/data/images_noti_icons/Etc/noti_sd_card_encryption_error.png Binary files differindex 80f6e41..80f6e41 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_encryption_error.png +++ b/data/images_noti_icons/Etc/noti_sd_card_encryption_error.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_error.png b/data/images_noti_icons/Etc/noti_sd_card_error.png Binary files differindex 9dafe97..9dafe97 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_error.png +++ b/data/images_noti_icons/Etc/noti_sd_card_error.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_prepare.png b/data/images_noti_icons/Etc/noti_sd_card_prepare.png Binary files differindex 9ba26d0..9ba26d0 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_prepare.png +++ b/data/images_noti_icons/Etc/noti_sd_card_prepare.png diff --git a/data/images_noti_icons/Etc/noti_sd_card_removed.png b/data/images_noti_icons/Etc/noti_sd_card_removed.png Binary files differindex d0b15e1..7ce44e0 100644..100755 --- a/data/images_noti_icons/Etc/noti_sd_card_removed.png +++ b/data/images_noti_icons/Etc/noti_sd_card_removed.png diff --git a/data/images_noti_icons/Etc/noti_shareshot_receive.png b/data/images_noti_icons/Etc/noti_shareshot_receive.png Binary files differindex fa36026..fa36026 100644..100755 --- a/data/images_noti_icons/Etc/noti_shareshot_receive.png +++ b/data/images_noti_icons/Etc/noti_shareshot_receive.png diff --git a/data/images_noti_icons/Etc/noti_shareshot_receive_problem.png b/data/images_noti_icons/Etc/noti_shareshot_receive_problem.png Binary files differindex f8969de..f8969de 100644..100755 --- a/data/images_noti_icons/Etc/noti_shareshot_receive_problem.png +++ b/data/images_noti_icons/Etc/noti_shareshot_receive_problem.png diff --git a/data/images_noti_icons/Etc/noti_shareshot_send.png b/data/images_noti_icons/Etc/noti_shareshot_send.png Binary files differindex 42bb2d4..42bb2d4 100644..100755 --- a/data/images_noti_icons/Etc/noti_shareshot_send.png +++ b/data/images_noti_icons/Etc/noti_shareshot_send.png diff --git a/data/images_noti_icons/Etc/noti_shareshot_send_problem.png b/data/images_noti_icons/Etc/noti_shareshot_send_problem.png Binary files differindex 3908b91..3908b91 100644..100755 --- a/data/images_noti_icons/Etc/noti_shareshot_send_problem.png +++ b/data/images_noti_icons/Etc/noti_shareshot_send_problem.png diff --git a/data/images_noti_icons/Etc/noti_side_sync.png b/data/images_noti_icons/Etc/noti_side_sync.png Binary files differindex d6d4116..d6d4116 100644..100755 --- a/data/images_noti_icons/Etc/noti_side_sync.png +++ b/data/images_noti_icons/Etc/noti_side_sync.png diff --git a/data/images_noti_icons/Etc/noti_sim_toolkit.png b/data/images_noti_icons/Etc/noti_sim_toolkit.png Binary files differindex c1a22c3..c1a22c3 100644..100755 --- a/data/images_noti_icons/Etc/noti_sim_toolkit.png +++ b/data/images_noti_icons/Etc/noti_sim_toolkit.png diff --git a/data/images_noti_icons/Etc/noti_smart_stay.png b/data/images_noti_icons/Etc/noti_smart_stay.png Binary files differindex 772e92f..a5d42bb 100644..100755 --- a/data/images_noti_icons/Etc/noti_smart_stay.png +++ b/data/images_noti_icons/Etc/noti_smart_stay.png diff --git a/data/images_noti_icons/Etc/noti_smemo_sync.png b/data/images_noti_icons/Etc/noti_smemo_sync.png Binary files differindex 86f9cc8..86f9cc8 100644..100755 --- a/data/images_noti_icons/Etc/noti_smemo_sync.png +++ b/data/images_noti_icons/Etc/noti_smemo_sync.png diff --git a/data/images_noti_icons/Etc/noti_spen.png b/data/images_noti_icons/Etc/noti_spen.png Binary files differindex 2714ad0..0ddd337 100644..100755 --- a/data/images_noti_icons/Etc/noti_spen.png +++ b/data/images_noti_icons/Etc/noti_spen.png diff --git a/data/images_noti_icons/Etc/noti_sync_error.png b/data/images_noti_icons/Etc/noti_sync_error.png Binary files differindex 7cfeb91..7cfeb91 100644..100755 --- a/data/images_noti_icons/Etc/noti_sync_error.png +++ b/data/images_noti_icons/Etc/noti_sync_error.png diff --git a/data/images_noti_icons/Etc/noti_tethering_usb_fail.png b/data/images_noti_icons/Etc/noti_tethering_usb_fail.png Binary files differindex ba88834..1613b05 100644..100755 --- a/data/images_noti_icons/Etc/noti_tethering_usb_fail.png +++ b/data/images_noti_icons/Etc/noti_tethering_usb_fail.png diff --git a/data/images_noti_icons/Etc/noti_tty_mode.png b/data/images_noti_icons/Etc/noti_tty_mode.png Binary files differindex da3e17d..da3e17d 100644..100755 --- a/data/images_noti_icons/Etc/noti_tty_mode.png +++ b/data/images_noti_icons/Etc/noti_tty_mode.png diff --git a/data/images_noti_icons/Etc/noti_tv.png b/data/images_noti_icons/Etc/noti_tv.png Binary files differindex cfa595d..e91bb25 100644..100755 --- a/data/images_noti_icons/Etc/noti_tv.png +++ b/data/images_noti_icons/Etc/noti_tv.png diff --git a/data/images_noti_icons/Etc/noti_updated_complete.png b/data/images_noti_icons/Etc/noti_updated_complete.png Binary files differindex 18ebb06..090db1f 100644..100755 --- a/data/images_noti_icons/Etc/noti_updated_complete.png +++ b/data/images_noti_icons/Etc/noti_updated_complete.png diff --git a/data/images_noti_icons/Etc/noti_updated_failed.png b/data/images_noti_icons/Etc/noti_updated_failed.png Binary files differindex 4b20c1f..4b20c1f 100644..100755 --- a/data/images_noti_icons/Etc/noti_updated_failed.png +++ b/data/images_noti_icons/Etc/noti_updated_failed.png diff --git a/data/images_noti_icons/Etc/noti_usb_connected.png b/data/images_noti_icons/Etc/noti_usb_connected.png Binary files differindex 0bb3bf5..ba90b5c 100644..100755 --- a/data/images_noti_icons/Etc/noti_usb_connected.png +++ b/data/images_noti_icons/Etc/noti_usb_connected.png diff --git a/data/images_noti_icons/Etc/noti_usb_fail.png b/data/images_noti_icons/Etc/noti_usb_fail.png Binary files differindex 46e39e9..46e39e9 100644..100755 --- a/data/images_noti_icons/Etc/noti_usb_fail.png +++ b/data/images_noti_icons/Etc/noti_usb_fail.png diff --git a/data/images_noti_icons/Etc/noti_usb_mass_storage_connected.png b/data/images_noti_icons/Etc/noti_usb_mass_storage_connected.png Binary files differindex 08c1259..55c5b54 100644..100755 --- a/data/images_noti_icons/Etc/noti_usb_mass_storage_connected.png +++ b/data/images_noti_icons/Etc/noti_usb_mass_storage_connected.png diff --git a/data/images_noti_icons/Etc/noti_usb_unknown_fail.png b/data/images_noti_icons/Etc/noti_usb_unknown_fail.png Binary files differindex 49cff79..49cff79 100644..100755 --- a/data/images_noti_icons/Etc/noti_usb_unknown_fail.png +++ b/data/images_noti_icons/Etc/noti_usb_unknown_fail.png diff --git a/data/images_noti_icons/Etc/noti_video.png b/data/images_noti_icons/Etc/noti_video.png Binary files differindex 62ddfc0..de05b7d 100644..100755 --- a/data/images_noti_icons/Etc/noti_video.png +++ b/data/images_noti_icons/Etc/noti_video.png diff --git a/data/images_noti_icons/Etc/noti_voice_mail.png b/data/images_noti_icons/Etc/noti_voice_mail.png Binary files differindex b832e62..64eba75 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_mail.png +++ b/data/images_noti_icons/Etc/noti_voice_mail.png diff --git a/data/images_noti_icons/Etc/noti_voice_mail_01.png b/data/images_noti_icons/Etc/noti_voice_mail_01.png Binary files differindex 594b099..ea8d328 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_mail_01.png +++ b/data/images_noti_icons/Etc/noti_voice_mail_01.png diff --git a/data/images_noti_icons/Etc/noti_voice_mail_02.png b/data/images_noti_icons/Etc/noti_voice_mail_02.png Binary files differindex 6ac61a1..e60b417 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_mail_02.png +++ b/data/images_noti_icons/Etc/noti_voice_mail_02.png diff --git a/data/images_noti_icons/Etc/noti_voice_mail_03.png b/data/images_noti_icons/Etc/noti_voice_mail_03.png Binary files differindex fcd6ab9..772159f 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_mail_03.png +++ b/data/images_noti_icons/Etc/noti_voice_mail_03.png diff --git a/data/images_noti_icons/Etc/noti_voice_memo.png b/data/images_noti_icons/Etc/noti_voice_memo.png Binary files differindex 26fad27..26fad27 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_memo.png +++ b/data/images_noti_icons/Etc/noti_voice_memo.png diff --git a/data/images_noti_icons/Etc/noti_voice_recorder_paused.png b/data/images_noti_icons/Etc/noti_voice_recorder_paused.png Binary files differindex 01429d8..854662e 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_recorder_paused.png +++ b/data/images_noti_icons/Etc/noti_voice_recorder_paused.png diff --git a/data/images_noti_icons/Etc/noti_voice_recorder_play.png b/data/images_noti_icons/Etc/noti_voice_recorder_play.png Binary files differindex 8dc8d2d..5356e18 100644..100755 --- a/data/images_noti_icons/Etc/noti_voice_recorder_play.png +++ b/data/images_noti_icons/Etc/noti_voice_recorder_play.png diff --git a/data/images_noti_icons/Etc/noti_wifi_translate.png b/data/images_noti_icons/Etc/noti_wifi_translate.png Binary files differindex 9939949..9939949 100644..100755 --- a/data/images_noti_icons/Etc/noti_wifi_translate.png +++ b/data/images_noti_icons/Etc/noti_wifi_translate.png diff --git a/data/images_noti_icons/FOTA/noti_fota.png b/data/images_noti_icons/FOTA/noti_fota.png Binary files differindex ba7d556..df041ce 100644..100755 --- a/data/images_noti_icons/FOTA/noti_fota.png +++ b/data/images_noti_icons/FOTA/noti_fota.png diff --git a/data/images_noti_icons/FOTA/noti_fota_completion.png b/data/images_noti_icons/FOTA/noti_fota_completion.png Binary files differindex 4853018..76ed4bd 100644..100755 --- a/data/images_noti_icons/FOTA/noti_fota_completion.png +++ b/data/images_noti_icons/FOTA/noti_fota_completion.png diff --git a/data/images_noti_icons/FOTA/noti_fota_diagmon.png b/data/images_noti_icons/FOTA/noti_fota_diagmon.png Binary files differindex 4744884..b9665be 100644..100755 --- a/data/images_noti_icons/FOTA/noti_fota_diagmon.png +++ b/data/images_noti_icons/FOTA/noti_fota_diagmon.png diff --git a/data/images_noti_icons/FOTA/noti_fota_diagmon_completion.png b/data/images_noti_icons/FOTA/noti_fota_diagmon_completion.png Binary files differindex 57fe5d5..577fa94 100644..100755 --- a/data/images_noti_icons/FOTA/noti_fota_diagmon_completion.png +++ b/data/images_noti_icons/FOTA/noti_fota_diagmon_completion.png diff --git a/data/images_noti_icons/FOTA/noti_fota_postpone.png b/data/images_noti_icons/FOTA/noti_fota_postpone.png Binary files differindex 70e09f8..cf08c4d 100644..100755 --- a/data/images_noti_icons/FOTA/noti_fota_postpone.png +++ b/data/images_noti_icons/FOTA/noti_fota_postpone.png diff --git a/data/images_noti_icons/Facebook/noti_facebook.png b/data/images_noti_icons/Facebook/noti_facebook.png Binary files differindex ab0a69a..d24776a 100644..100755 --- a/data/images_noti_icons/Facebook/noti_facebook.png +++ b/data/images_noti_icons/Facebook/noti_facebook.png diff --git a/data/images_noti_icons/Facebook/noti_facebook_female_default.png b/data/images_noti_icons/Facebook/noti_facebook_female_default.png Binary files differindex 0c6328c..32a5e7d 100644..100755 --- a/data/images_noti_icons/Facebook/noti_facebook_female_default.png +++ b/data/images_noti_icons/Facebook/noti_facebook_female_default.png diff --git a/data/images_noti_icons/Facebook/noti_facebook_male_default.png b/data/images_noti_icons/Facebook/noti_facebook_male_default.png Binary files differindex 9c5b794..9061b78 100644..100755 --- a/data/images_noti_icons/Facebook/noti_facebook_male_default.png +++ b/data/images_noti_icons/Facebook/noti_facebook_male_default.png diff --git a/data/images_noti_icons/Find my mobile/noti_FMM_call_log.png b/data/images_noti_icons/Find my mobile/noti_FMM_call_log.png Binary files differindex d7b7772..83e52b6 100644..100755 --- a/data/images_noti_icons/Find my mobile/noti_FMM_call_log.png +++ b/data/images_noti_icons/Find my mobile/noti_FMM_call_log.png diff --git a/data/images_noti_icons/Find my mobile/noti_FMM_device_located.png b/data/images_noti_icons/Find my mobile/noti_FMM_device_located.png Binary files differindex 0331427..f454a2b 100644..100755 --- a/data/images_noti_icons/Find my mobile/noti_FMM_device_located.png +++ b/data/images_noti_icons/Find my mobile/noti_FMM_device_located.png diff --git a/data/images_noti_icons/Find my mobile/noti_FMM_device_unlocked.png b/data/images_noti_icons/Find my mobile/noti_FMM_device_unlocked.png Binary files differindex 065a949..70060f0 100644..100755 --- a/data/images_noti_icons/Find my mobile/noti_FMM_device_unlocked.png +++ b/data/images_noti_icons/Find my mobile/noti_FMM_device_unlocked.png diff --git a/data/images_noti_icons/Gallery/noti_gallery_image.png b/data/images_noti_icons/Gallery/noti_gallery_image.png Binary files differindex 6dceae5..bfc9522 100644..100755 --- a/data/images_noti_icons/Gallery/noti_gallery_image.png +++ b/data/images_noti_icons/Gallery/noti_gallery_image.png diff --git a/data/images_noti_icons/Gallery/noti_gallery_image_error.png b/data/images_noti_icons/Gallery/noti_gallery_image_error.png Binary files differindex 3e5dffa..ec95669 100644..100755 --- a/data/images_noti_icons/Gallery/noti_gallery_image_error.png +++ b/data/images_noti_icons/Gallery/noti_gallery_image_error.png diff --git a/data/images_noti_icons/Internet/noti_internet_flightmode.png b/data/images_noti_icons/Internet/noti_internet_flightmode.png Binary files differindex bfd25ff..9f47133 100644..100755 --- a/data/images_noti_icons/Internet/noti_internet_flightmode.png +++ b/data/images_noti_icons/Internet/noti_internet_flightmode.png diff --git a/data/images_noti_icons/Lock screen/noti_message.png b/data/images_noti_icons/Lock screen/noti_message.png Binary files differindex 0fc91fa..2da638e 100644..100755 --- a/data/images_noti_icons/Lock screen/noti_message.png +++ b/data/images_noti_icons/Lock screen/noti_message.png diff --git a/data/images_noti_icons/Lock screen/noti_missed_call.png b/data/images_noti_icons/Lock screen/noti_missed_call.png Binary files differindex 383822c..1384e6f 100644..100755 --- a/data/images_noti_icons/Lock screen/noti_missed_call.png +++ b/data/images_noti_icons/Lock screen/noti_missed_call.png diff --git a/data/images_noti_icons/Low battery&charge/noti_battery_fully_charging.png b/data/images_noti_icons/Low battery&charge/noti_battery_fully_charging.png Binary files differindex edaa168..84b1b56 100644..100755 --- a/data/images_noti_icons/Low battery&charge/noti_battery_fully_charging.png +++ b/data/images_noti_icons/Low battery&charge/noti_battery_fully_charging.png diff --git a/data/images_noti_icons/Low battery&charge/noti_charging_battery_low.png b/data/images_noti_icons/Low battery&charge/noti_charging_battery_low.png Binary files differindex eb3bc8f..f2d3c78 100644..100755 --- a/data/images_noti_icons/Low battery&charge/noti_charging_battery_low.png +++ b/data/images_noti_icons/Low battery&charge/noti_charging_battery_low.png diff --git a/data/images_noti_icons/Low battery&charge/noti_charging_cable_disconnected.png b/data/images_noti_icons/Low battery&charge/noti_charging_cable_disconnected.png Binary files differindex d9f22c8..09b9e09 100644..100755 --- a/data/images_noti_icons/Low battery&charge/noti_charging_cable_disconnected.png +++ b/data/images_noti_icons/Low battery&charge/noti_charging_cable_disconnected.png diff --git a/data/images_noti_icons/Message/noti_message.png b/data/images_noti_icons/Message/noti_message.png Binary files differindex 0fc91fa..e2983d7 100644..100755 --- a/data/images_noti_icons/Message/noti_message.png +++ b/data/images_noti_icons/Message/noti_message.png diff --git a/data/images_noti_icons/Message/noti_message_OTA.png b/data/images_noti_icons/Message/noti_message_OTA.png Binary files differindex 9b0c275..4c2a6ba 100644..100755 --- a/data/images_noti_icons/Message/noti_message_OTA.png +++ b/data/images_noti_icons/Message/noti_message_OTA.png diff --git a/data/images_noti_icons/Message/noti_message_cb-msg.png b/data/images_noti_icons/Message/noti_message_cb-msg.png Binary files differindex 8d3b273..11a9029 100644..100755 --- a/data/images_noti_icons/Message/noti_message_cb-msg.png +++ b/data/images_noti_icons/Message/noti_message_cb-msg.png diff --git a/data/images_noti_icons/Message/noti_message_delivery_report.png b/data/images_noti_icons/Message/noti_message_delivery_report.png Binary files differindex 2ce76e5..9f35482 100644..100755 --- a/data/images_noti_icons/Message/noti_message_delivery_report.png +++ b/data/images_noti_icons/Message/noti_message_delivery_report.png diff --git a/data/images_noti_icons/Message/noti_message_failed.png b/data/images_noti_icons/Message/noti_message_failed.png Binary files differindex 86e9dee..cd7b0ab 100644..100755 --- a/data/images_noti_icons/Message/noti_message_failed.png +++ b/data/images_noti_icons/Message/noti_message_failed.png diff --git a/data/images_noti_icons/Message/noti_message_mms_failed.png b/data/images_noti_icons/Message/noti_message_mms_failed.png Binary files differindex 3ba33fb..6b9d46d 100644..100755 --- a/data/images_noti_icons/Message/noti_message_mms_failed.png +++ b/data/images_noti_icons/Message/noti_message_mms_failed.png diff --git a/data/images_noti_icons/Message/noti_message_mms_problem.png b/data/images_noti_icons/Message/noti_message_mms_problem.png Binary files differindex bc11c8b..2732355 100644..100755 --- a/data/images_noti_icons/Message/noti_message_mms_problem.png +++ b/data/images_noti_icons/Message/noti_message_mms_problem.png diff --git a/data/images_noti_icons/Message/noti_message_read_report.png b/data/images_noti_icons/Message/noti_message_read_report.png Binary files differindex 617e62f..ed7d6df 100644..100755 --- a/data/images_noti_icons/Message/noti_message_read_report.png +++ b/data/images_noti_icons/Message/noti_message_read_report.png diff --git a/data/images_noti_icons/Message/noti_message_reply.png b/data/images_noti_icons/Message/noti_message_reply.png Binary files differindex 2cb0c28..132964f 100644..100755 --- a/data/images_noti_icons/Message/noti_message_reply.png +++ b/data/images_noti_icons/Message/noti_message_reply.png diff --git a/data/images_noti_icons/Message/noti_message_scheduled.png b/data/images_noti_icons/Message/noti_message_scheduled.png Binary files differindex b88d640..271b598 100644..100755 --- a/data/images_noti_icons/Message/noti_message_scheduled.png +++ b/data/images_noti_icons/Message/noti_message_scheduled.png diff --git a/data/images_noti_icons/Message/noti_message_sending.png b/data/images_noti_icons/Message/noti_message_sending.png Binary files differindex 396c702..71afba0 100644..100755 --- a/data/images_noti_icons/Message/noti_message_sending.png +++ b/data/images_noti_icons/Message/noti_message_sending.png diff --git a/data/images_noti_icons/Message/noti_message_sim-card.png b/data/images_noti_icons/Message/noti_message_sim-card.png Binary files differindex d87fe51..2d079de 100644..100755 --- a/data/images_noti_icons/Message/noti_message_sim-card.png +++ b/data/images_noti_icons/Message/noti_message_sim-card.png diff --git a/data/images_noti_icons/Message/noti_mms.png b/data/images_noti_icons/Message/noti_mms.png Binary files differindex 9227ae4..501d72b 100644..100755 --- a/data/images_noti_icons/Message/noti_mms.png +++ b/data/images_noti_icons/Message/noti_mms.png diff --git a/data/images_noti_icons/Message/noti_voice_mail.png b/data/images_noti_icons/Message/noti_voice_mail.png Binary files differindex 43640f7..e795964 100644..100755 --- a/data/images_noti_icons/Message/noti_voice_mail.png +++ b/data/images_noti_icons/Message/noti_voice_mail.png diff --git a/data/images_noti_icons/Multi SIM/noti_no_sim.png b/data/images_noti_icons/Multi SIM/noti_no_sim.png Binary files differindex a058ab8..4ce3264 100644..100755 --- a/data/images_noti_icons/Multi SIM/noti_no_sim.png +++ b/data/images_noti_icons/Multi SIM/noti_no_sim.png diff --git a/data/images_noti_icons/Multi SIM/noti_sim_full.png b/data/images_noti_icons/Multi SIM/noti_sim_full.png Binary files differindex 2484469..5e73f19 100644..100755 --- a/data/images_noti_icons/Multi SIM/noti_sim_full.png +++ b/data/images_noti_icons/Multi SIM/noti_sim_full.png diff --git a/data/images_noti_icons/Patterns/noti_cooling_down.png b/data/images_noti_icons/Patterns/noti_cooling_down.png Binary files differindex 3337f0c..39f6bc9 100644..100755 --- a/data/images_noti_icons/Patterns/noti_cooling_down.png +++ b/data/images_noti_icons/Patterns/noti_cooling_down.png diff --git a/data/images_noti_icons/Patterns/noti_screen_captured.png b/data/images_noti_icons/Patterns/noti_screen_captured.png Binary files differindex df34e37..e11837f 100644..100755 --- a/data/images_noti_icons/Patterns/noti_screen_captured.png +++ b/data/images_noti_icons/Patterns/noti_screen_captured.png diff --git a/data/images_noti_icons/Private mode/noti_private_mode.png b/data/images_noti_icons/Private mode/noti_private_mode.png Binary files differindex d15c825..4b1e51b 100644..100755 --- a/data/images_noti_icons/Private mode/noti_private_mode.png +++ b/data/images_noti_icons/Private mode/noti_private_mode.png diff --git a/data/images_noti_icons/Send help messages/noti_icon_emergency.png b/data/images_noti_icons/Send help messages/noti_icon_emergency.png Binary files differindex cfe6030..8ca7153 100644..100755 --- a/data/images_noti_icons/Send help messages/noti_icon_emergency.png +++ b/data/images_noti_icons/Send help messages/noti_icon_emergency.png diff --git a/data/images_noti_icons/Send help messages/noti_send_emergency_msg.png b/data/images_noti_icons/Send help messages/noti_send_emergency_msg.png Binary files differindex 286b266..a162d25 100644..100755 --- a/data/images_noti_icons/Send help messages/noti_send_emergency_msg.png +++ b/data/images_noti_icons/Send help messages/noti_send_emergency_msg.png diff --git a/data/images_noti_icons/Share with contents/noti_icon_Id_default.png b/data/images_noti_icons/Share with contents/noti_icon_Id_default.png Binary files differindex 2733fff..0fd98f7 100644..100755 --- a/data/images_noti_icons/Share with contents/noti_icon_Id_default.png +++ b/data/images_noti_icons/Share with contents/noti_icon_Id_default.png diff --git a/data/images_noti_icons/Tethering/noti_tethering.png b/data/images_noti_icons/Tethering/noti_tethering.png Binary files differindex 8c1a266..c065f82 100644..100755 --- a/data/images_noti_icons/Tethering/noti_tethering.png +++ b/data/images_noti_icons/Tethering/noti_tethering.png diff --git a/data/images_noti_icons/Tethering/noti_tethering_all.png b/data/images_noti_icons/Tethering/noti_tethering_all.png Binary files differindex cdefd22..398ffd7 100644..100755 --- a/data/images_noti_icons/Tethering/noti_tethering_all.png +++ b/data/images_noti_icons/Tethering/noti_tethering_all.png diff --git a/data/images_noti_icons/Tethering/noti_tethering_bt.png b/data/images_noti_icons/Tethering/noti_tethering_bt.png Binary files differindex 0e7e87f..c51f6a5 100644..100755 --- a/data/images_noti_icons/Tethering/noti_tethering_bt.png +++ b/data/images_noti_icons/Tethering/noti_tethering_bt.png diff --git a/data/images_noti_icons/Tethering/noti_tethering_usb.png b/data/images_noti_icons/Tethering/noti_tethering_usb.png Binary files differindex 4c49de7..0062f02 100644..100755 --- a/data/images_noti_icons/Tethering/noti_tethering_usb.png +++ b/data/images_noti_icons/Tethering/noti_tethering_usb.png diff --git a/data/images_noti_icons/Tethering/noti_tethering_wifi.png b/data/images_noti_icons/Tethering/noti_tethering_wifi.png Binary files differindex 41f23b4..76eb00e 100644..100755 --- a/data/images_noti_icons/Tethering/noti_tethering_wifi.png +++ b/data/images_noti_icons/Tethering/noti_tethering_wifi.png diff --git a/data/images_noti_icons/Tizen store/noti_tizen_store.png b/data/images_noti_icons/Tizen store/noti_tizen_store.png Binary files differindex 9b65c0a..883ac2a 100644..100755 --- a/data/images_noti_icons/Tizen store/noti_tizen_store.png +++ b/data/images_noti_icons/Tizen store/noti_tizen_store.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi.png b/data/images_noti_icons/Wi-Fi/noti_wifi.png Binary files differindex f480fd0..f480fd0 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_availablility_check1.png b/data/images_noti_icons/Wi-Fi/noti_wifi_availablility_check1.png Binary files differindex 274cf15..274cf15 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_availablility_check1.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_availablility_check1.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_direct.png b/data/images_noti_icons/Wi-Fi/noti_wifi_direct.png Binary files differindex 5c1b553..5c1b553 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_direct.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_direct.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_direct_auto_off.png b/data/images_noti_icons/Wi-Fi/noti_wifi_direct_auto_off.png Binary files differindex 5c1b553..5c1b553 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_direct_auto_off.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_direct_auto_off.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_in_range.png b/data/images_noti_icons/Wi-Fi/noti_wifi_in_range.png Binary files differindex 1aac451..1aac451 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_in_range.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_in_range.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_network_available.png b/data/images_noti_icons/Wi-Fi/noti_wifi_network_available.png Binary files differindex f480fd0..f480fd0 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_network_available.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_network_available.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_no_detected.png b/data/images_noti_icons/Wi-Fi/noti_wifi_no_detected.png Binary files differindex 274cf15..274cf15 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_no_detected.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_no_detected.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_no_sign.png b/data/images_noti_icons/Wi-Fi/noti_wifi_no_sign.png Binary files differindex 1aac451..1aac451 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_no_sign.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_no_sign.png diff --git a/data/images_noti_icons/Wi-Fi/noti_wifi_translate.png b/data/images_noti_icons/Wi-Fi/noti_wifi_translate.png Binary files differindex 9939949..9939949 100644..100755 --- a/data/images_noti_icons/Wi-Fi/noti_wifi_translate.png +++ b/data/images_noti_icons/Wi-Fi/noti_wifi_translate.png diff --git a/data/quickpanel b/data/quickpanel index 9af4b47..9af4b47 100644..100755 --- a/data/quickpanel +++ b/data/quickpanel diff --git a/data/quickpanel.desktop.in b/data/quickpanel.desktop.in index 654043c..654043c 100644..100755 --- a/data/quickpanel.desktop.in +++ b/data/quickpanel.desktop.in diff --git a/data/quickpanel.edc b/data/quickpanel.edc index 72888f2..1c47429 100755 --- a/data/quickpanel.edc +++ b/data/quickpanel.edc @@ -25,6 +25,8 @@ #define QP_HANDLER_COLOR "AO010" #define QP_HANDLER_PRESS_COLOR "AO010S" + + #define QUICKPANEL_FOCUS_OBJECT(NAME, TO_1, TO_2)\ part {\ name: NAME;\ @@ -440,6 +442,15 @@ collections { } align: 0.0 0.0; } + description { + state: "enable_voice_icon" 0.0; + inherit: "default"; + rel1 { + to_y:"qp.base.setting.swallow"; + relative: 0.0 1.0; + offset : 0 110; + } + } } part { name: "qp.base.list.swallow"; @@ -494,6 +505,20 @@ collections { target: "qp.base.setting.swallow"; } program { + name: "voice_icon.show"; + action: STATE_SET "enable_voice_icon" 0.0; + signal: "voice_icon.show"; + source: "quickpanel.prog"; + target: "background.touch"; + } + program { + name: "voice_icon.hide"; + action: STATE_SET "default" 0.0; + signal: "voice_icon.hide"; + source: "quickpanel.prog"; + target: "background.touch"; + } + program { name: "background.touch"; action: SIGNAL_EMIT "close.quickpanel" ""; signal: "mouse,down,1"; diff --git a/data/quickpanel.sh.in b/data/quickpanel.sh.in index cf77090..cf77090 100644..100755 --- a/data/quickpanel.sh.in +++ b/data/quickpanel.sh.in diff --git a/data/quickpanel.xml.in b/data/quickpanel.xml.in index f47607b..94d9853 100755 --- a/data/quickpanel.xml.in +++ b/data/quickpanel.xml.in @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<manifest xmlns="http://tizen.org/ns/packages" package="@PKGNAME@" version="0.6.22" install-location="internal-only" api-version="2.3.1"> - <label>Quickpanel</label> +<manifest xmlns="http://tizen.org/ns/packages" package="@PKGNAME@" version="0.8.0" install-location="internal-only"> + <label>@PROJECT_NAME@</label> <author email="yjoo93.park@samsung.com" href="www.samsung.com">Youngjoo Park</author> - <author email="seungtaek.chung@samsung.com" href="www.samsung.com">seungtaek chung</author> - <author email="ys4610.ko@samsung.com" href="www.samsung.com">Youngsub Ko</author> + <author email="jin0.kim@samsung.com" href="www.samsung.com">Jinyoung Kim</author> <description>@PROJECT_NAME@</description> <ui-application appid="@PKGNAME@" exec="@BINDIR@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="false"> <label>@PROJECT_NAME@</label> </ui-application> + <privileges> + <privilege>http://tizen.org/privilege/appmanager.launch</privilege> + </privileges> </manifest> diff --git a/data/quickpanel_activenoti.edc b/data/quickpanel_activenoti.edc index ff7bf55..af4e638 100644..100755 --- a/data/quickpanel_activenoti.edc +++ b/data/quickpanel_activenoti.edc @@ -20,6 +20,11 @@ #define ACTIVENOTI_BG_COLOR "AO003" #define ACTIVENOTI_MAIN_TEXT_HEIGHT_INC 1 +#define BOX_ICON_SIZE_W 96 +#define BOX_ICON_SIZE_H 96 +#define BOX_ICON_BG_SIZE_W 96 +#define BOX_ICON_BG_SIZE_H 96 + images { image: "handler_btn_02.png" COMP; @@ -27,12 +32,6 @@ images image: "core_list_button_bg.#.png" COMP; } -#define NOTI_HEIGHT_NO_BUTTON 200 -#define NOTI_HEIGHT_WITH_BUTTON 300 - -#define WIDTH_MIN 480 -#define WIDTH_MAX 960 - collections { base_scale: 1.8; @@ -43,17 +42,21 @@ collections styles { style { name: "style_title_text"; - base: "font=Tizen:style=Bold font_size="42" color=#FFFFFFFF text_class=tizen wrap=mixed"; + base: "font=Tizen:style=Bold font_size="33" color=#FFFFFFFF text_class=tizen wrap=mixed ellipsis=1.0"; } } styles { style { name: "style_main_text"; - base: "font=Tizen:style=Regular font_size="38" color=#FFFFFFFF text_class=tizen wrap=mixed"; + base: "font=Tizen:style=Regular font_size="29" color=#FFFFFFFF text_class=tizen wrap=mixed ellipsis=1.0"; } } + images { + image: "quick_button_icon_bg.png" COMP; + } + parts { part { name: "background"; @@ -62,18 +65,6 @@ collections description { state: "default" 0.0; align: 0.0 0.0; - min: WIDTH_MIN NOTI_HEIGHT_WITH_BUTTON; - max: WIDTH_MAX NOTI_HEIGHT_WITH_BUTTON; - } - description { - state: "btn_hide" 0.0; - inherit: "default" 0.0; - min: WIDTH_MIN NOTI_HEIGHT_NO_BUTTON; - max: WIDTH_MAX NOTI_HEIGHT_NO_BUTTON; - } - description { - state: "btn_show" 0.0; - inherit: "default" 0.0; } } @@ -119,7 +110,7 @@ collections state: "default" 0.0; rel1 { - relative: 0.0 0.1; + relative: 0.0 0.05; to: "bg"; } rel2 { @@ -129,22 +120,6 @@ collections align: 0.0 0.0; visible: 0; } - description { - state: "btn_hide" 0.0; - inherit: "default" 0.0; - rel1 { - relative: 0.0 0.1; - to: "bg"; - } - rel2 { - relative: 1.0 0.9; - to: "bg"; - } - } - description { - state: "btn_show" 0.0; - inherit: "default" 0.0; - } } part{ @@ -162,23 +137,6 @@ collections to: "bg"; } } - description { - state: "btn_hide" 0.0; - inherit: "default" 0.0; - fixed: 0 1; - rel1 { - relative: 0.0 1.0; - to: "bg"; - } - rel2 { - relative: 1.0 1.0; - to: "bg"; - } - } - description { - state: "btn_show" 0.0; - inherit: "default" 0.0; - } } part{ @@ -194,6 +152,16 @@ collections relative: 1.0 1.0; to: "button.space"; } + visible: 1; + } + description { + state: "btn_hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "btn_show" 0.0; + inherit: "default" 0.0; } } @@ -241,6 +209,23 @@ collections } + part { + name: "elm.padding.image"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: 32 0; + fixed: 1 0; + rel1.to:"rect_main"; + rel2.to:"rect_main"; + rel1.relative: 1.0 0.0; + rel2.relative: 1.0 1.0; + align: 1.0 0.0; + } + } + + // Icon part { name: "icon_space"; @@ -251,11 +236,11 @@ collections state: "default" 0.0; align: 0.0 0.0; rel1 { - relative: 0.0 0.0; + relative: 0.03 0.1; to: "rect_main"; } rel2 { - relative: 0.2 0.5; + relative: 0.2 0.7; to: "rect_main"; } visible: 0; @@ -263,18 +248,42 @@ collections } part { + name: "masking"; + type: IMAGE; + precise_is_inside: 1; + description { + state: "default" 0.0; + min : BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_H; + fixed : 1 1; + rel1 { + relative: 0.5 0.5; + to: "icon_space"; + } + rel2 { + relative: 0.5 0.5; + to: "icon_space"; + } + image.normal: "quick_button_icon_bg.png"; + } + } + + part { name: "icon_big"; type: SWALLOW; + clip_to : "masking"; scale: 1; description { state: "default" 0.0; - align: 0.0 0.0; + align: 0.5 0.5; + min : BOX_ICON_SIZE_W BOX_ICON_SIZE_H; + max : BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_W; + fixed : 1 1; rel1 { - relative: 0.0 0.0; + relative: 0.5 0.5; to: "icon_space"; } rel2 { - relative: 1.0 1.0; + relative: 0.5 0.5; to: "icon_space"; } } @@ -285,9 +294,11 @@ collections type: SWALLOW; description { state: "default" 0.0; - align: 1.0 1.0; + align: 0.0 1.0; + fixed : 1 1; + min : 45 45; rel1 { - relative: 0.5 0.5; + relative: 0.6 0.6; to: "icon_big"; } rel2 { @@ -306,11 +317,11 @@ collections state: "default" 0.0; align: 0.0 0.5; rel1 { - relative: 0.2 0.0; + relative: 0.22 0.0; to: "rect_main"; } rel2 { - relative: 1.0 1.0; + relative: 0.98 0.89; to: "rect_main"; } visible: 0; @@ -320,6 +331,7 @@ collections part { name: "subtitle_text"; type: TEXTBLOCK; + scale: 1; description { state: "default" 0.0; align: 0.0 0.0; @@ -359,6 +371,7 @@ collections part { name: "title_text"; type: TEXTBLOCK; + scale: 1; description { state: "default" 0.0; align: 0.0 0.0; @@ -379,11 +392,11 @@ collections state: "sub_show" 0.0; inherit: "default" 0.0; rel1 { - relative: 0.0 0.25; + relative: 0.0 0.3; to: "text_space"; } rel2 { - relative: 1.0 0.55; + relative: 1.0 0.6; to: "text_space"; } @@ -397,6 +410,7 @@ collections part { name: "content_text"; type: TEXTBLOCK; + scale: 1; multiline: 1; description { state: "default" 0.0; @@ -406,11 +420,11 @@ collections align: 0.0 0.5; } rel1 { - relative: 0.0 0.35; + relative: 0.0 0.3; to: "text_space"; } rel2 { - relative: 1.0 1.0; + relative: 1.0 0.9; to: "text_space"; } } @@ -418,7 +432,7 @@ collections state: "sub_show" 0.0; inherit: "default" 0.0; rel1 { - relative: 0.0 0.55; + relative: 0.0 0.6; to: "text_space"; } rel2 { @@ -501,9 +515,7 @@ collections signal: "btn_hide"; source: "button.space"; action: STATE_SET "btn_hide" 0.0; - target: "button.space"; - target: "rect_main"; - target: "background"; + target: "button.swallow"; } program { @@ -511,9 +523,7 @@ collections signal: "btn_show"; source: "button.space"; action: STATE_SET "btn_show" 0.0; - target: "button.space"; - target: "rect_main"; - target: "background"; + target: "button.swallow"; } } } @@ -578,6 +588,7 @@ collections part { name: "content.button.text"; type: TEXT; + scale: 1; description { state: "default" 0.0; align: 0.5 0.5; diff --git a/data/quickpanel_animated_icon.edc b/data/quickpanel_animated_icon.edc index 1abefd7..1abefd7 100644..100755 --- a/data/quickpanel_animated_icon.edc +++ b/data/quickpanel_animated_icon.edc diff --git a/data/quickpanel_datetime.edc b/data/quickpanel_datetime.edc index f4e6086..2c15eaf 100644..100755 --- a/data/quickpanel_datetime.edc +++ b/data/quickpanel_datetime.edc @@ -26,14 +26,14 @@ images { styles { style { name: "font_time_am_pm_style"; - base: "font=Tizen:style=Regular font_size=26 valign=middle ellipsis=1.0 wrap=none"; + base: "font=Tizen:style=Regular font_size=22 valign=middle ellipsis=1.0 wrap=none"; tag: "time" "+ color=#FFFFFF "; tag: "ampm" "+ color=#FFFFFF "; } style { name: "font_date_style"; - base: "font=Tizen:style=Regular font_size=22 color=#FFFFFF valign=middle color_class=ATO009 ellipsis=1.0 wrap=none"; + base: "font=Tizen:style=Regular font_size=22 color=#FFFFFF valign=middle color_class=tizen ellipsis=1.0 wrap=none"; } } @@ -178,7 +178,7 @@ group { scale: 1; description { state: "default" 0.0; - min: 30 30; + min: 42 42; fixed: 1 1; align: 0.5 0.5; rel1 { @@ -205,7 +205,7 @@ group { fixed: 1 1; align: 0.5 0.5; rel1 { - relative: 0.0 0.5; + relative: 0.5 0.5; to: "space.divider"; } rel2 { @@ -215,7 +215,7 @@ group { image { normal: "line_indicator_divider.png"; } - color_class: "AO027"; + color_class: "AO003E1"; } } @@ -282,6 +282,7 @@ group { } } } + part { name: "date.top.padding"; type: SPACER; @@ -302,6 +303,25 @@ group { } } + part { name: "text.time.left.padding"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: 15 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { + //relative : 0.0 0.0; + to: "text.time"; + } + rel2 { + relative : 0.0 1.0; + to: "text.time"; + } + } + } + part { name: "text.date"; type: TEXTBLOCK; mouse_events: 0; @@ -318,12 +338,12 @@ group { } rel2 { relative : 0.0 1.0; - to_x: "text.time"; + to_x : "text.time.left.padding"; to_y: "space.datetime"; } text { style: "font_date_style"; - min: 1 0; + min: 0 0; max: 1 0; align: 0.0 0.5; } diff --git a/data/quickpanel_def.h b/data/quickpanel_def.h index 4ecd398..958df82 100755 --- a/data/quickpanel_def.h +++ b/data/quickpanel_def.h @@ -55,7 +55,7 @@ #define QP_SETTING_ICON_DRAGGING_BG_CORRECTION_W_L 0 #define QP_SETTING_ICON_DRAGGING_BG_MIN_H 72 #define QP_SETTING_ICON_DRAGGING_MARGIN 0 - + // WVGA #define QP_SETTING_ICON_MIN_WH_WVGA 66 #define QP_SETTING_ICON_BG_MIN_W_P_WVGA 96 @@ -99,12 +99,15 @@ #define BOX_PART_ICON "object.icon" #define BOX_PART_ICON_SUB "object.icon.sub" -#define BOX_ICON_BG_SIZE_W 46 -#define BOX_ICON_BG_SIZE_H 46 -#define BOX_ICON_SIZE_W 46 -#define BOX_ICON_SIZE_H 46 +#define BOX_ICON_BG_SIZE_W 96 +#define BOX_ICON_BG_SIZE_H 96 +#define BOX_ICON_SIZE_W 96 +#define BOX_ICON_SIZE_H 96 #define BOX_ICON_SUB_SIZE_W 29 //44 #define BOX_ICON_SUB_SIZE_H 29 //44 +#define BOX_TEXT_TOP_PADDING 15 +#define BOX_ICON_TOP_PADDING 20 + #define BOX_COLOR_BG QP_THEME_ITEM_BG_COLOR #define BOX_COLOR_BG_HIGHLIGHT QP_THEME_ITEM_BG_PRESS_COLOR diff --git a/data/quickpanel_images.edc b/data/quickpanel_images.edc index 8fcd36d..8fcd36d 100644..100755 --- a/data/quickpanel_images.edc +++ b/data/quickpanel_images.edc diff --git a/data/quickpanel_listitem_noti.edc b/data/quickpanel_listitem_noti.edc index 308a16d..ba7c66f 100644..100755 --- a/data/quickpanel_listitem_noti.edc +++ b/data/quickpanel_listitem_noti.edc @@ -22,10 +22,10 @@ #define QP_NOTI_LISTTYPE_TITLE_COLOR "T023" #define QP_NOTI_LISTTYPE_TITLE_PRESS_COLOR "T023P" -#define QP_NOTI_LISTTYPE_CONTENTS_COLOR "T024" +#define QP_NOTI_LISTTYPE_CONTENTS_COLOR "ATO012" #define QP_NOTI_LISTTYPE_COUNT_COLOR "T112" #define QP_NOTI_LISTTYPE_COUNT_BG_COLOR "B0517" -#define QP_NOTI_LISTTYPE_TIME_COLOR "T024" +#define QP_NOTI_LISTTYPE_TIME_COLOR "ATO012" #define QP_NOTI_LISTTYPE_TITLE_FONT_SIZE 30 #define QP_NOTI_LISTTYPE_CONTENTS_FONT_SIZE 24 @@ -41,6 +41,7 @@ images { image: "core_icon_badge_container.#.png" COMP; + image: "quick_button_icon_bg.png" COMP; } group { @@ -98,8 +99,8 @@ scale: 1; description { state: "default" 0.0; - min: 0 25; - fixed: 0 1; + //min: 0 BOX_ICON_TOP_PADDING; + //fixed: 0 1; rel1.to:"base"; rel2.to:"base"; rel1.relative: 0.0 0.0; @@ -128,7 +129,7 @@ scale: 1; description { state: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; fixed: 0 1; rel1.to:"base"; rel2.to:"base"; @@ -143,7 +144,7 @@ scale: 1; description { state: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; fixed: 0 1; rel1.to:"base"; rel2.to:"base"; @@ -158,7 +159,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -174,7 +175,7 @@ scale: 1; description { state: "default" 0.0; - min: 46 46; + min: BOX_ICON_SIZE_W BOX_ICON_SIZE_W; fixed: 1 1; rel1 { relative: 1.0 1.0; @@ -287,19 +288,41 @@ } } part { + name: "masking"; + type: IMAGE; + precise_is_inside: 1; + description { + state: "default" 0.0; + min: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_W; + fixed : 1 1; + rel1 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + rel2 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + image.normal: "quick_button_icon_bg.png"; + } + } + part { name: "elm.swallow.thumbnail"; type: SWALLOW; mouse_events: 0; scale: 1; + clip_to: "masking"; description { state: "default" 0.0; min: BOX_ICON_SIZE_W BOX_ICON_SIZE_H; max: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_H; fixed: 1 1; rel1 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } rel2 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } align: 0.5 0.5; @@ -360,7 +383,7 @@ } rel2 { relative: 0.0 1.0; - to_x: "elm.image.count.bg"; + to_x: "elm.padding.left.time"; to_y: "elm.rect.text.title"; offset: -15 0; } @@ -374,51 +397,15 @@ } rel2 { relative: 0.0 1.0; - to_x: "elm.text.time"; + to_x: "elm.padding.left.time"; to_y: "elm.rect.text.title"; offset: -15 0; } } } - part{ - name: "elm.image.count.bg"; - type:IMAGE; - scale: 1; - description { - state: "default" 0.0; - align: 1.0 0.5; - fixed: 1 1; - min: 32 32; - max: 68 32; - rel1 { - relative: 0.0 0.5; - to_x: "elm.padding.left.count"; - to_y: "elm.rect.text"; - } - rel2 { - relative: 1.0 0.5; - to_x: "elm.padding.right.count"; - to_y: "elm.rect.text"; - } - image { - normal:"core_icon_badge_container.#.png"; - } - color_class: QP_NOTI_LISTTYPE_COUNT_BG_COLOR; - visible:0; - } - description { - state: "show" 0.0; - inherit: "default" 0.0; - visible:1; - } - description { - state: "hide" 0.0; - inherit: "default" 0.0; - visible:0; - } - } + part { - name: "elm.padding.left.count"; + name: "elm.padding.left.time"; type: SPACER; mouse_events: 0; scale: 1; @@ -428,19 +415,19 @@ min: 10 0; rel1 { relative: 0.0 1.0; - to_x: "elm.text.count"; + to_x: "elm.text.time"; to_y: "elm.padding.top.text"; } rel2 { relative: 0.0 1.0; - to_x: "elm.text.count"; + to_x: "elm.text.time"; to_y: "elm.padding.top.text"; } align: 1.0 0.0; } } part { - name: "elm.padding.right.count"; + name: "elm.padding.right.time"; type: SPACER; mouse_events: 0; scale: 1; @@ -462,7 +449,7 @@ } } part { - name: "elm.text.count"; + name: "elm.text.time"; type: TEXT; mouse_events: 0; scale: 1; @@ -473,23 +460,38 @@ min: 0 38; rel1 { relative: 0.0 0.5; - to_x: "elm.padding.right.count"; + to_x: "elm.padding.right"; to_y: "elm.rect.text"; } rel2 { relative: 0.0 0.5; - to_x: "elm.padding.right.count"; + to_x: "elm.padding.right"; to_y: "elm.rect.text"; } - color_class: QP_NOTI_LISTTYPE_COUNT_COLOR; + color_class: QP_NOTI_LISTTYPE_TIME_COLOR; text { font: "Tizen:style=Regular"; text_class: "tizen"; - size: QP_NOTI_LISTTYPE_COUNT_FONT_SIZE; + size: QP_NOTI_LISTTYPE_TIME_FONT_SIZE; ellipsis: 0.0; align: 0.0 0.5; min: 1 0; } + + } + description { + state: "center" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "elm.rect.text"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "elm.rect.text"; + } } } part { @@ -530,14 +532,95 @@ } rel2 { relative: 0.0 1.0; - to_x: "elm.text.time"; + to_x: "elm.image.count.bg"; to_y: "elm.rect.text.content"; offset: -15 0; } } } + part{ + name: "elm.image.count.bg"; + type:IMAGE; + scale: 1; + description { + state: "default" 0.0; + align: 1.0 0.0; + fixed: 1 1; + min: 32 32; + max: 68 32; + rel1 { + relative: 0.0 1.0; + to_x: "elm.padding.left.count"; + to_y: "elm.rect.text"; + } + rel2 { + relative: 1.0 0.0; + to_x: "elm.padding.right.count"; + to_y: "elm.padding.bottom.text"; + } + image { + normal:"core_icon_badge_container.#.png"; + } + color_class: QP_NOTI_LISTTYPE_COUNT_BG_COLOR; + visible:0; + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible:1; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + visible:0; + } + } part { - name: "elm.text.time"; + name: "elm.padding.left.count"; + type: SPACER; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + fixed: 1 0; + min: 10 0; + rel1 { + relative: 0.0 1.0; + to_x: "elm.text.count"; + to_y: "elm.padding.bottom.text"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.text.count"; + to_y: "elm.padding.bottom.text"; + } + align: 1.0 0.0; + } + } + part { + name: "elm.padding.right.count"; + type: SPACER; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + fixed: 1 0; + min: 10 0; + rel1 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "elm.padding.bottom.text"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "elm.padding.bottom.text"; + } + align: 1.0 0.0; + } + } + part { + name: "elm.text.count"; type: TEXT; mouse_events: 0; scale: 1; @@ -548,19 +631,19 @@ min: 0 32; rel1 { relative: 0.0 1.0; - to_x: "elm.padding.right"; + to_x: "elm.padding.right.count"; to_y: "elm.rect.text"; } rel2 { - relative: 0.0 0.0; - to_x: "elm.padding.right"; - to_y: "elm.padding.bottom.text"; + relative: 0.0 1.0; + to_x: "elm.padding.right.count"; + to_y: "elm.rect.text"; } - color_class: QP_NOTI_LISTTYPE_TIME_COLOR; + color_class: QP_NOTI_LISTTYPE_COUNT_COLOR; text { font: "Tizen:style=Regular"; text_class: "tizen"; - size: QP_NOTI_LISTTYPE_TIME_FONT_SIZE; + size: QP_NOTI_LISTTYPE_COUNT_FONT_SIZE; ellipsis: 0.0; align: 0.0 0.5; min: 1 0; @@ -676,5 +759,19 @@ action: STATE_SET "default" 0.0; target: "elm.rect.text.title"; } + program { + name: "time.move.center"; + signal: "time.move.center"; + source: "prog"; + action: STATE_SET "center" 0.0; + target: "elm.text.time"; + } + program { + name: "time.move.default"; + signal: "time.move.default"; + source: "prog"; + action: STATE_SET "default" 0.0; + target: "elm.text.time"; + } } } diff --git a/data/quickpanel_listitem_noti_legacy.edc b/data/quickpanel_listitem_noti_legacy.edc index 12eb4fe..12eb4fe 100644..100755 --- a/data/quickpanel_listitem_noti_legacy.edc +++ b/data/quickpanel_listitem_noti_legacy.edc diff --git a/data/quickpanel_listitem_ongoing.edc b/data/quickpanel_listitem_ongoing.edc index e053f8e..c8f97ab 100644..100755 --- a/data/quickpanel_listitem_ongoing.edc +++ b/data/quickpanel_listitem_ongoing.edc @@ -21,8 +21,8 @@ #define QP_ONGOING_PROGRESS_TITLE_COLOR "T023" #define QP_ONGOING_PROGRESS_TITLE_PRESS_COLOR "T023P" -#define QP_ONGOING_PROGRESS_CONTENTS_COLOR "T024" -#define QP_ONGOING_PROGRESS_RATE_COLOR "T024L1" +#define QP_ONGOING_PROGRESS_CONTENTS_COLOR "ATO012" +#define QP_ONGOING_PROGRESS_RATE_COLOR "ATO012" #define QP_ONGOING_PROGRESS_TITLE_FONT_SIZE 30 #define QP_ONGOING_PROGRESS_CONTENTS_FONT_SIZE 24 @@ -178,8 +178,8 @@ scale: 1; description { state: "default" 0.0; - min: 0 25; - fixed: 0 1; + //min: 0 BOX_ICON_TOP_PADDING; + //fixed: 0 1; rel1.to:"base"; rel2.to:"base"; rel1.relative: 0.0 0.0; @@ -238,7 +238,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -253,7 +253,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -268,7 +268,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -298,7 +298,7 @@ mouse_events: 0; scale: 1; description { state: "default" 0.0; - min: 46 46; + min: BOX_ICON_SIZE_W BOX_ICON_SIZE_W; fixed: 1 1; rel1 { relative: 1.0 1.0; @@ -421,20 +421,44 @@ } } } + + part { + name: "masking"; + type: IMAGE; + precise_is_inside: 1; + description { + state: "default" 0.0; + min: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_W; + fixed : 1 1; + rel1 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + rel2 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + image.normal: "quick_button_icon_bg.png"; + } + } + part { name: "elm.swallow.thumbnail"; type: SWALLOW; mouse_events: 0; scale: 1; + clip_to: "masking"; description { state: "default" 0.0; fixed: 1 1; min: BOX_ICON_SIZE_W BOX_ICON_SIZE_H; max: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_H; rel1 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } rel2 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } align: 0.5 0.5; @@ -485,6 +509,60 @@ } } description { + state: "short" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.rect.text.content"; + to_y: "elm.rect.text.title"; + } + rel2 { + to: "elm.rect.text.content"; + to_y: "elm.rect.text.title"; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + } + } + + part { + name: "elm.text.count"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 1.0 0.5; + fixed: 0 1; + min: 0 38; + rel1 { + to:"elm.rect.text.title"; + } + rel2 { + to:"elm.rect.text.title"; + + } + color_class: QP_ONGOING_PROGRESS_RATE_COLOR; + text { + font: "Tizen:style=Regular"; + text_class: "tizen"; + size: QP_ONGOING_PROGRESS_RATE_FONT_SIZE; + ellipsis: 0.0; + align: 1.0 0.5; + } + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible:1; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + visible:0; + } + description { state: "selected" 0.0; inherit: "default" 0.0; } @@ -498,10 +576,10 @@ state: "default" 0.0; align: 1.0 0.5; rel1 { - to:"elm.rect.text.progress"; + to:"elm.rect.text.title"; } rel2 { - to:"elm.rect.text.progress"; + to:"elm.rect.text.title"; } color_class: QP_ONGOING_PROGRESS_RATE_COLOR; text { @@ -597,6 +675,36 @@ action: SIGNAL_EMIT "selected" "edje"; } #endif + + program{ + name: "content.long"; + signal: "content.long"; + source: "prog"; + action: STATE_SET "default" 0.0; + target: "elm.text.title"; + } + program{ + name: "content.short"; + signal: "content.short"; + source: "prog"; + action: STATE_SET "short" 0.0; + target: "elm.text.title"; + } + program{ + name: "count.show"; + signal: "count.show"; + source: "prog"; + action: STATE_SET "show" 0.0; + target: "elm.text.count"; + } + program{ + name: "count.hide"; + signal: "count.hide"; + source: "prog"; + action: STATE_SET "hide" 0.0; + target: "elm.text.count"; + } + } } @@ -784,8 +892,8 @@ scale: 1; description { state: "default" 0.0; - min: 0 25; - fixed: 0 1; + //min: 0 BOX_ICON_TOP_PADDING; + //fixed: 0 1; rel1.to:"base"; rel2.to:"base"; rel1.relative: 0.0 0.0; @@ -795,12 +903,12 @@ description { state: "line1" 0.0; inherit: "default" 0.0; - min: 0 25; + //min: 0 BOX_ICON_TOP_PADDING; } description { state: "line2" 0.0; inherit: "default" 0.0; - min: 0 25; + min: 0 2BOX_ICON_PADDING_H5; } description { state: "line3" 0.0; @@ -829,7 +937,7 @@ scale: 1; description { state: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; fixed: 0 1; rel1.to:"base"; rel2.to:"base"; @@ -840,7 +948,7 @@ description { state: "line1" 0.0; inherit: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; } description { state: "line2" 0.0; @@ -859,7 +967,7 @@ scale: 1; description { state: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; fixed: 0 1; rel1.to:"base"; rel2.to:"base"; @@ -870,7 +978,7 @@ description { state: "line1" 0.0; inherit: "default" 0.0; - min: 0 13; + min: 0 BOX_TEXT_TOP_PADDING; } description { state: "line2" 0.0; @@ -889,7 +997,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -903,7 +1011,7 @@ scale: 1; description { state: "default" 0.0; - min: (15 + 46 + 15) 0; + min: (15 + BOX_ICON_SIZE_W + 15) 0; fixed: 1 0; rel1.to:"base"; rel2.to:"base"; @@ -919,7 +1027,7 @@ scale: 1; description { state: "default" 0.0; - min: 46 46; + min: BOX_ICON_SIZE_W BOX_ICON_SIZE_W; fixed: 1 1; rel1 { relative: 1.0 1.0; @@ -1013,19 +1121,41 @@ } } part { + name: "masking"; + type: IMAGE; + precise_is_inside: 1; + description { + state: "default" 0.0; + min: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_W; + fixed : 1 1; + rel1 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + rel2 { + relative: 0.5 0.5; + to: "elm.rect.thumbnail"; + } + image.normal: "quick_button_icon_bg.png"; + } + } + part { name: "elm.swallow.thumbnail"; type: SWALLOW; mouse_events: 0; scale: 1; + clip_to: "masking"; description { state: "default" 0.0; min: BOX_ICON_SIZE_W BOX_ICON_SIZE_W; max: BOX_ICON_BG_SIZE_W BOX_ICON_BG_SIZE_W; fixed: 1 1; rel1 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } rel2 { + relative: 0.5 0.5; to: "elm.rect.thumbnail"; } align: 0.5 0.5; @@ -1038,7 +1168,7 @@ scale: 1; description { state: "default" 0.0; - min: 46 46; + min: BOX_ICON_SIZE_W BOX_ICON_SIZE_W; fixed: 1 1; rel1 { relative: 0.5 0.5; diff --git a/data/quickpanel_minictrl.edc b/data/quickpanel_minictrl.edc index e55fb0c..737a9ba 100755 --- a/data/quickpanel_minictrl.edc +++ b/data/quickpanel_minictrl.edc @@ -30,7 +30,6 @@ description { state: "default" 0.0; min: 480 QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT; - max: 800 QP_THEME_LIST_ITEM_MINICONTRL_HEIGHT + QP_THEME_LIST_ITEM_SEPERATOR_HEIGHT; fixed: 0 1; rel1 { relative: 0.0 0.0; @@ -145,7 +144,8 @@ } } QUICKPANEL_FOCUS_OBJECT("focus", "elm.content.bg", "elm.content.bg") - part { name: "elm.padding.left"; + part { + name: "elm.padding.left"; type: SPACER; scale: 1; description { @@ -182,8 +182,7 @@ description { state: "default" 0.0; align: 0.0 0.0; - min: 480 135; - max: 800 135; + min: 480 140; rel1 { to: "elm.content.bg"; } @@ -224,4 +223,4 @@ target: "elm.content.bg"; } } - }
\ No newline at end of file + } diff --git a/data/quickpanel_noti_section.edc b/data/quickpanel_noti_section.edc index c12ba52..92b9637 100755 --- a/data/quickpanel_noti_section.edc +++ b/data/quickpanel_noti_section.edc @@ -25,7 +25,7 @@ #define QP_THEME_LIST_TITLE_FONT_SIZE 27 #define QP_THEME_LIST_OPTION_FONT_COLOR "ATO006" -#define QP_THEME_LIST_OPTION_PRESS_FONT_COLOR "ATO006P" +#define QP_THEME_LIST_OPTION_PRESS_FONT_COLOR "ATO006P" #define QP_THEME_LIST_OPTION_FONT_SIZE 27 #define QP_THEME_LIST_OPTION_ICON_PRESS_COLOR "AO005" @@ -35,18 +35,20 @@ //Properties of "notifications (x) label in clear all notifications item" #define QP_CLEAR_ALL_NOTIFICATIONS_LABEL_FONT_NAME "Tizen:style=Regular" -#define QP_CLEAR_ALL_NOTIFICATIONS_LABEL_FONT_COLOR "T023" +//#define QP_CLEAR_ALL_NOTIFICATIONS_LABEL_FONT_COLOR "T023" +#define QP_CLEAR_ALL_NOTIFICATIONS_LABEL_FONT_COLOR "A03O003L1" #define QP_CLEAR_ALL_NOTIFICATIONS_LABEL_FONT_SIZE 27 #define QP_CLEAR_ALL_NOTIFICATIONS_STR_X_OFFSET 17 //x offset of "notifications(x)" string +#define QP_CLEAR_ALL_BASE_BG_COLOR "AO021" //Properties of clear all button #define QP_CLEAR_ALL_CLEAR_ALL_BTN_TEXT_FONT_NAME "Tizen:style=Regular" -#define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_COLOR "T023" +#define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_COLOR "T112" #define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_COLOR_PRESSED "ATO006P" #define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_COLOR_DIM "ATO006D" -#define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_SIZE 27 -#define QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR "W021L1" -#define QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR_PRESSED "AO021P" +#define QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_SIZE 20 +#define QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR "A03O003L1" +#define QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR_PRESSED "B0517P" //Properties of separator betwen notifiactions label and clear all button #define QP_NOTIFICATIONS_SEP_X_OFFSET -235 //separator between "notification(x) | Clear all" button @@ -56,6 +58,7 @@ images { image: "icon_arrow_up.png" COMP; image: "icon_arrow_down.png" COMP; + image: "core_icon_badge_container.#.png" COMP; } group { @@ -81,7 +84,6 @@ visible: QP_THEME_BG_VISIBILITY; } } - QUICKPANEL_FOCUS_OBJECT("focus.label", "base", "base") part { name: "elm.padding.left"; @@ -398,7 +400,6 @@ part { name: "base"; type: RECT; - repeat_events: 1; scale: 1; description { @@ -411,13 +412,10 @@ relative: 1.0 1.0; } align: 0.0 0.0; - color_class: QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR; + color_class: QP_CLEAR_ALL_BASE_BG_COLOR; visible: 1; } } - - QUICKPANEL_FOCUS_OBJECT("focus.label", "base", "base") - part { name: "notisection.padding.left"; type: SPACER; @@ -443,7 +441,7 @@ scale: 1; description { state: "default" 0.0; - min: 23 0; + min: 17 0; fixed: 1 0; align: 1.0 0.0; rel1 { @@ -460,7 +458,6 @@ part { name: "underline"; type: RECT; - repeat_events: 1; scale: 1; description { state: "default" 0.0; @@ -482,7 +479,6 @@ part { name: "noti.clear.all.separator"; type: RECT; - repeat_events: 1; scale: 1; description { state: "default"; @@ -502,7 +498,7 @@ } align: 1.0 0.5; - visible: 1; + visible: 0; } description { @@ -518,7 +514,7 @@ scale: 1; description { state: "default" 0.0; - min: 14 0; + min: 17 0; fixed: 1 0; align: 1.0 0.0; rel1 { @@ -563,24 +559,27 @@ } part { name: "rect.button.clear_all"; - type: RECT; + type: IMAGE; scale: 1; - mouse_events: 1; description { state: "default" 0.0; + min: 75 36; + max: 130 36; + fixed: 1 1; rel1 { - to: "clear_all.padding.left"; relative: 0.0 0.0; } rel2 { to_x: "notisection.padding.right"; to_y: "underline"; - relative: 1.0 0.0; + relative: 0.0 0.0; } + image { + normal:"core_icon_badge_container.#.png"; + } color_class: QP_CLEAR_ALL_CLEAR_ALL_BTN_BG_COLOR; - - align: 0.5 0.5; + align: 1.0 0.5; visible: 1; } description @@ -597,26 +596,25 @@ visible: 0; } } + part { name: "text.button.clear_all"; type: TEXT; - repeat_events: 1; scale: 1; description { state: "default" 0.0; - min: 98 36; - max: 160 36; + min: 75 36; + max: 130 36; fixed: 0 1; - align: 1.0 0.5; + align: 0.5 0.0; rel1 { - to_x: "base"; - to_y: "notisection.padding.right"; - relative: 0.5 0.5; + to: "rect.button.clear_all"; + relative: 0.0 0.0; } rel2 { to: "notisection.padding.right"; - relative: 0.0 0.5; + relative: 0.0 1.0; } color_class: QP_CLEAR_ALL_CLEAR_ALL_BTN_FONT_COLOR; text { @@ -654,7 +652,7 @@ scale: 1; description { state: "default" 0.0; - min: 14 0; + min: 17 0; fixed: 1 0; align: 1.0 0.0; rel1 { @@ -669,7 +667,6 @@ } } } - QUICKPANEL_FOCUS_OBJECT("focus", "rect.button.clear_all", "rect.button.clear_all") } programs @@ -746,4 +743,4 @@ } } } - }
\ No newline at end of file + } diff --git a/data/quickpanel_page_edit.edc b/data/quickpanel_page_edit.edc index e4de510..e4de510 100644..100755 --- a/data/quickpanel_page_edit.edc +++ b/data/quickpanel_page_edit.edc diff --git a/data/quickpanel_page_setting_all.edc b/data/quickpanel_page_setting_all.edc index 1d99df9..1d99df9 100644..100755 --- a/data/quickpanel_page_setting_all.edc +++ b/data/quickpanel_page_setting_all.edc diff --git a/data/quickpanel_setting.edc b/data/quickpanel_setting.edc index 14c5e9b..94bfcc9 100644..100755 --- a/data/quickpanel_setting.edc +++ b/data/quickpanel_setting.edc @@ -140,22 +140,6 @@ group { } align: 0.5 0.0; } - description { - state: "portrait" 0.0; - inherit: "default" 0.0; - } - description { - state: "landscape" 0.0; - inherit: "default" 0.0; - rel1 { - relative: 0.2 0.0; - to: "background"; - } - rel2 { - relative: 0.8 0.0; - to: "background"; - } - } } part { name: "brightness.container.swallow.wvga"; diff --git a/data/quickpanel_textblock_slide_style.edc b/data/quickpanel_textblock_slide_style.edc index 74f3fb9..74f3fb9 100644..100755 --- a/data/quickpanel_textblock_slide_style.edc +++ b/data/quickpanel_textblock_slide_style.edc diff --git a/data/quickpanel_theme_progressbar.edc b/data/quickpanel_theme_progressbar.edc index d2441f3..d2441f3 100644..100755 --- a/data/quickpanel_theme_progressbar.edc +++ b/data/quickpanel_theme_progressbar.edc diff --git a/data/quickpanel_theme_slider.edc b/data/quickpanel_theme_slider.edc index bff8a08..88af2e2 100644..100755 --- a/data/quickpanel_theme_slider.edc +++ b/data/quickpanel_theme_slider.edc @@ -20,7 +20,7 @@ #define SLIDER_BASE_HEIGHT_INC 6 #define SLIDER_INDICATOR_SIZE_INC 42 #define SLIDER_SWALLOWBAR_HEIGHT_INC 42 -#define SLIDER_LEFT_RIGHT_PADDING_SIZE_INC 15 0 +#define SLIDER_LEFT_RIGHT_PADDING_SIZE_INC 20 0 #define SLIDER_ICON_PADDING_SIZE_INC 5 0 #define SLIDER_CENTER_POINT_SIZE_INC 10 24 diff --git a/data/quickpanel_voice_control.edc b/data/quickpanel_voice_control.edc new file mode 100755 index 0000000..e403b7f --- /dev/null +++ b/data/quickpanel_voice_control.edc @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "color_classes.edc" +#include "quickpanel_def.h" + +#define QP_THEME_VOICE_CONTOL_BG_COLOR "B0211" +#define QP_VOICE_CONTOL_HEIGHT 80 + +images +{ + image: "voice_control_icon_mic.png" COMP; + image: "core_list_button_bg.#.png" COMP; +} + +collections +{ + base_scale: 1.8; + + group { + name: "quickpanel/voice_control/default"; + data.item: "bgcolor" QP_THEME_VOICE_CONTOL_BG_COLOR; + + parts { + part { + name: "base"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: 0 QP_VOICE_CONTOL_HEIGHT; + max: -1 QP_VOICE_CONTOL_HEIGHT; + } + } + part { + name: "bgcolor"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "base"; + relative: 0.0 0.0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + } + color_class: QP_THEME_VOICE_CONTOL_BG_COLOR; + visible: 0; + } + } + part { + name: "button_bg"; + type: IMAGE; + mouse_events: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { + to: "base"; + relative: 0.2 0.1; + } + rel2 { + to: "base"; + relative: 0.8 0.9; + } + image { + normal: "core_list_button_bg.#.png"; + } + color: 52 123 135 255; + } + description + { + state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "AO001L1P"; + } + } + part { + name: "button_img"; + type: IMAGE; + mouse_events: 1; + description { + state: "default" 0.0; + max: 50 50; + align: 0.5 0.5; + rel1 { + to: "button_bg"; + } + rel2 { + to: "button_bg"; + } + image { + normal: "voice_control_icon_mic.png"; + } + } + } + } + + programs { + + program { + name: "pressed_button"; + signal: "mouse,clicked,1"; + source: "button_bg"; + action: SIGNAL_EMIT "button_clicked" ""; + } + + program { + name: "pressed_button_img"; + signal: "mouse,clicked,1"; + source: "button_img"; + action: SIGNAL_EMIT "button_clicked" ""; + } + + program { + name: "pressed_button_bg"; + signal: "mouse,down,1"; + source: "button_bg"; + action: STATE_SET "pressed" 0.0; + target: "button_bg"; + } + + program { + name: "released_button_bg"; + signal: "mouse,up,1"; + source: "button_bg"; + action: STATE_SET "default" 0.0; + target: "button_bg"; + } + } + } +} + + + diff --git a/org.tizen.quickpanel.efl b/org.tizen.quickpanel.efl new file mode 100755 index 0000000..db51f96 --- /dev/null +++ b/org.tizen.quickpanel.efl @@ -0,0 +1,96 @@ +org.tizen.quickpanel systemd r----- ------ +org.tizen.quickpanel systemd r----- ------ +org.tizen.quickpanel syslogd -w---- ------ +org.tizen.quickpanel syslogd -w---- ------ +org.tizen.quickpanel system::use_internet r----- ------ +org.tizen.quickpanel secure-storage-client rw---- ------ +org.tizen.quickpanel secure-storage rw---- ------ +org.tizen.quickpanel secure-storage::tethering rw---- ------ +org.tizen.quickpanel tethering::dbus-access rw---- ------ +org.tizen.quickpanel mdm-server rwx--- ------ +org.tizen.quickpanel xorg rw---- ------ +org.tizen.quickpanel device::bklight rw---- ------ +org.tizen.quickpanel org.tizen.indicator rwx--- ------ +org.tizen.quickpanel crash-popup r-x--- ------ +org.tizen.quickpanel system-server rwx--- ------ +org.tizen.quickpanel immvibed rw---- ------ +org.tizen.quickpanel display_wd r-x--- ------ +org.tizen.quickpanel sound_server rwxa-- ------ +org.tizen.quickpanel dbus rwx--- ------ +org.tizen.quickpanel e17 rwx--- ------ +org.tizen.quickpanel e17::notification rwx--- ------ +org.tizen.quickpanel svi-data r-x--- ------ +org.tizen.quickpanel org.tizen.oma-dm r-x--- ------ +org.tizen.quickpanel isf rwx--- ------ +org.tizen.quickpanel media-server r-x--- ------ +org.tizen.quickpanel deviced rwx--- ------ +org.tizen.quickpanel deviced::display rw---- ------ +org.tizen.quickpanel deviced::led rw---- ------ +org.tizen.quickpanel deviced::haptic rw---- ------ +org.tizen.quickpanel csc-feature r----- ------ +org.tizen.quickpanel notification::db rw---- ------ +org.tizen.quickpanel data-provider-master rw---- ------ +org.tizen.quickpanel data-provider-master::notification rw---- ------ +org.tizen.quickpanel data-provider-master::notification.client rw---- ------ +org.tizen.quickpanel data-provider-master::badge rw---- ------ +org.tizen.quickpanel data-provider-master::badge.client -w---- ------ +org.tizen.quickpanel data-provider-master::badge.manager -w---- ------ +org.tizen.quickpanel org.tizen.setting::default-resources r-x--- ------ +org.tizen.quickpanel org.tizen.ready-to-share::state rw---- ------ +org.tizen.quickpanel oma-ds-agent::cfg r----- ------ +org.tizen.quickpanel oma-ds-agent::svc rw---- ------ +org.tizen.quickpanel nfc-manager rwx--- ------ +org.tizen.quickpanel tts-server r-x--- ------ +org.tizen.quickpanel pkgmgr::db rw---l ------ +org.tizen.quickpanel pkgmgr-client r-x--- ------ +org.tizen.quickpanel bt-service rw---- ------ +org.tizen.quickpanel bt-service::admin rw---- ------ +org.tizen.quickpanel bt-service::public r----- ------ +org.tizen.quickpanel bt-service::platform -w---- ------ +org.tizen.quickpanel syspopup::db rwx--- ------ +org.tizen.quickpanel connman rw---- ------ +org.tizen.quickpanel connman::set rw---- ------ +org.tizen.quickpanel connman::get rw---- ------ +org.tizen.quickpanel net-config rw---- ------ +org.tizen.quickpanel ug-setting-mobileap-efl r----l ------ +org.tizen.quickpanel aul::launch --x--- ------ +org.tizen.quickpanel alarm-manager::alarm rw---- ------ +org.tizen.quickpanel alarm-server::alarm -w---- ------ +org.tizen.quickpanel drmfw rw---- ------ +org.tizen.quickpanel app-svc --x--- ------ +org.tizen.quickpanel app-svc::db rw---l ------ +org.tizen.quickpanel trm -w---- ------ +org.tizen.quickpanel network::set rw---- ------ +org.tizen.quickpanel network::get rw---- ------ +org.tizen.quickpanel telephony_framework::api_ps_public rw---- ------ +org.tizen.quickpanel telephony_framework::api_call rw---- ------ +org.tizen.quickpanel telephony_framework::api_modem rw---- ------ +org.tizen.quickpanel telephony_framework::properties rw---- ------ +org.tizen.quickpanel telephony_framework::api_sim r----- ------ +org.tizen.quickpanel contacts-service::svc --x--- ------ +system org.tizen.quickpanel -w---- ------ +display_wd org.tizen.quickpanel -w---- ------ +dbus org.tizen.quickpanel rwx--- ------ +org.tizen.app-tray org.tizen.quickpanel r-x--- ------ +org.tizen.quickpanel system::homedir rwxat- ------ +org.tizen.quickpanel system::media rwxat- ------ +org.tizen.quickpanel system::share rwxat- ------ +org.tizen.quickpanel pulseaudio rwxat- ------ +e17 org.tizen.quickpanel -w---- ------ +org.tizen.quickpanel device::app_logging -w---- ------ +org.tizen.quickpanel sys-assert::core rwxat- ------ +org.tizen.quickpanel privacy-manager::db r----l ------ +org.tizen.quickpanel ecore::lock rwxat- ------ +org.tizen.quickpanel com.samsung.download-manager r-x--- ------ +org.tizen.quickpanel tizen::vconf::setting::admin rw---- ------ +org.tizen.quickpanel tizen::vconf::location::enable rw---l ------ +org.tizen.quickpanel tizen::vconf::tethering::admin r----l ------ +org.tizen.quickpanel tizen::vconf::platform::r rwx--l ------ +org.tizen.quickpanel tizen::vconf::platform::rw rwx--l ------ +org.tizen.quickpanel tizen::vconf::telephony::admin r----- ------ +org.tizen.quickpanel tizen::vconf::display r----l ------ +org.tizen.quickpanel vc-server rwx--- ------ +org.tizen.quickpanel tizen::vconf::public::admin r----l ------ +org.tizen.quickpanel notification r-x--- ------ +org.tizen.quickpanel org.tizen.volume rwx--- ------ +org.tizen.quickpanel security-server::api-permissions -w---- ------ diff --git a/org.tizen.quickpanel.manifest b/org.tizen.quickpanel.manifest deleted file mode 100644 index 6c61ae0..0000000 --- a/org.tizen.quickpanel.manifest +++ /dev/null @@ -1,5 +0,0 @@ -<manifest> - <request> - <domain name="_"/> - </request> -</manifest> diff --git a/packaging/2.4/quickpanel-system.service b/packaging/2.4/quickpanel-system.service new file mode 100755 index 0000000..c76a0e6 --- /dev/null +++ b/packaging/2.4/quickpanel-system.service @@ -0,0 +1,18 @@ +[Unit] +Description=Start the Quickpanel +After=check-mount.service connman.service + +[Service] +Type=simple +User=app +Group=app +SmackProcessLabel=org.tizen.quickpanel +EnvironmentFile=/run/tizen-mobile-env +ExecStart=/usr/apps/org.tizen.quickpanel/bin/quickpanel +Restart=always +RestartSec=0 +KillSignal=SIGKILL +OOMScoreAdjust=200 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/org.tizen.quickpanel.manifest.3.0 b/packaging/org.tizen.quickpanel.manifest.3.0 new file mode 100755 index 0000000..7438319 --- /dev/null +++ b/packaging/org.tizen.quickpanel.manifest.3.0 @@ -0,0 +1,8 @@ +<manifest> + <request> + <domain name="_" /> + </request> + <assign> + <filesystem path="/usr/apps/org.tizen.quickpanel/bin/quickpanel" exec_label="User::App::org.tizen.quickpanel" /> + </assign> +</manifest> diff --git a/packaging/org.tizen.quickpanel.spec b/packaging/org.tizen.quickpanel.spec index b772ef5..f25992a 100755 --- a/packaging/org.tizen.quickpanel.spec +++ b/packaging/org.tizen.quickpanel.spec @@ -1,19 +1,21 @@ %bcond_with wayland +%define __usrdir /usr/lib/systemd/user + +Name: org.tizen.quickpanel +Summary: Quick access panel for the notifications and various kinds of services. +Version: 0.8.0 +Release: 1 +Group: Applications/Core Applications +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source102: quickpanel-system.service +Source104: quickpanel-system.path -%define PKGNAME org.tizen.quickpanel -%define PREFIX /usr/apps/%{PKGNAME} -%define PREFIX_RW /opt/usr/apps/%{PKGNAME} -%define RESDIR %{PREFIX}/res -%define DATADIR %{PREFIX}/data - -Name: org.tizen.quickpanel -Summary: Quick Panel -Version: 0.6.23 -Release: 1 -Group: util -License: Apache-2.0 -Source0: %{name}-%{version}.tar.gz -Source102: quickpanel-system.service +%if %{with wayland} +Source103: org.tizen.quickpanel.manifest.3.0 +%else +Source103: org.tizen.quickpanel.manifest.2.4 +%endif %if "%{?tizen_profile_name}" == "wearable" ExcludeArch: %{arm} %ix86 x86_64 @@ -27,6 +29,7 @@ BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(capi-system-runtime-info) BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(capi-system-device) +BuildRequires: pkgconfig(capi-location-manager) BuildRequires: pkgconfig(capi-network-wifi) BuildRequires: pkgconfig(capi-network-bluetooth) BuildRequires: pkgconfig(capi-network-tethering) @@ -53,7 +56,6 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(syspopup-caller) BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(efl-assist) BuildRequires: pkgconfig(syspopup-caller) BuildRequires: pkgconfig(minicontrol-viewer) BuildRequires: pkgconfig(minicontrol-monitor) @@ -61,27 +63,28 @@ BuildRequires: pkgconfig(pkgmgr) BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(iniparser) BuildRequires: pkgconfig(alarm-service) -BuildRequires: gettext-tools -BuildRequires: cmake -BuildRequires: edje-tools - %if %{with wayland} BuildRequires: pkgconfig(ecore-wayland) %else -BuildRequires: pkgconfig(ecore-x) -BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(inputproto) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(utilX) -BuildRequires: pkgconfig(inputproto) +BuildRequires: pkgconfig(ecore-x) %endif - +BuildRequires: pkgconfig(voice-control-setting) +BuildRequires: pkgconfig(tzsh-quickpanel-service) +BuildRequires: gettext-tools +BuildRequires: cmake +BuildRequires: edje-tools Requires(post): /usr/bin/vconftool + %description Quick Panel %prep %setup -q +cp %SOURCE103 %{name}.manifest %build %if 0%{?tizen_build_binary_release_type_eng} @@ -95,17 +98,19 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" %endif +LDFLAGS+="-Wl,--rpath=%{name}/lib -Wl,--as-needed"; +export LDFLAGS + %if %{with wayland} +export WINSYS="wayland" export WAYLAND_SUPPORT=On export X11_SUPPORT=Off %else export WAYLAND_SUPPORT=Off export X11_SUPPORT=On +export WINSYS="x11" %endif - - -LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed";export LDFLAGS -LDFLAGS="$LDFLAGS" %cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX} -DPREFIX_RW=%{PREFIX_RW} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT} \ +%cmake . -DPKGNAME=%{name} -DWINSYS=${WINSYS} make %{?jobs:-j%jobs} @@ -113,30 +118,33 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants -install -m 0644 %SOURCE102 %{buildroot}%{_unitdir}/quickpanel.service -ln -s ../quickpanel.service %{buildroot}%{_unitdir}/multi-user.target.wants/quickpanel.service - -mkdir -p %{buildroot}/usr/share/license -cp -f LICENSE %{buildroot}/usr/share/license/%{PKGNAME} - +mkdir -p %{buildroot}%{__usrdir}/default.target.wants +mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ +install -m 0644 %SOURCE102 %{buildroot}%{__usrdir}/quickpanel.service +ln -s ../quickpanel.service %{buildroot}%{__usrdir}/default.target.wants/quickpanel.service +install -m 0644 %SOURCE104 %{buildroot}%{__usrdir}/quickpanel.path +ln -s ../quickpanel.path %{buildroot}%{__usrdir}/default.target.wants/quickpanel.path %post %files -%manifest %{PKGNAME}.manifest +%manifest %{name}.manifest %defattr(-,root,root,-) %attr(755,-,-) %{_sysconfdir}/init.d/quickpanel -%attr(775,app,app) %{DATADIR} -%attr(775,app,app) %{PREFIX_RW}/data -%{PREFIX_RW}/data -%{PREFIX}/bin/* -%{RESDIR}/* -/usr/share/packages/%{PKGNAME}.xml +%attr(775,app,app) /opt/%{_prefix}/apps/%{name}/ +%attr(775,app,app) /opt/%{_prefix}/apps/%{name}/data +/opt/%{_prefix}/apps/%{name}/data +%{_prefix}/apps/%{name} +%{_prefix}/share/packages/%{name}.xml %{_sysconfdir}/init.d/quickpanel -%{_unitdir}/quickpanel.service -%{_unitdir}/multi-user.target.wants/quickpanel.service -/usr/share/license/%{PKGNAME} -/usr/apps/%{PKGNAME}/shared/res/icons/* -/usr/apps/%{PKGNAME}/shared/res/noti_icons/* +%{__usrdir}/quickpanel.service +%{__usrdir}/quickpanel.path +%{__usrdir}/default.target.wants/quickpanel.service +%{__usrdir}/default.target.wants/quickpanel.path +%{_prefix}/share/license/%{name} +%if %{with wayland} +# Do not install the SMACK Rule file for Tizen 3.x +%else +%{_sysconfdir}/smack/accesses.d/%{name}.efl +%endif diff --git a/packaging/quickpanel-system.path b/packaging/quickpanel-system.path new file mode 100644 index 0000000..a177b60 --- /dev/null +++ b/packaging/quickpanel-system.path @@ -0,0 +1,5 @@ +[Unit] +Description=Start the "Quickpanel" program + +[Path] +PathExists=/run/.wm_ready diff --git a/packaging/quickpanel-system.service b/packaging/quickpanel-system.service index 219c206..9db42e5 100644..100755 --- a/packaging/quickpanel-system.service +++ b/packaging/quickpanel-system.service @@ -1,6 +1,6 @@ [Unit] Description=Start the Quickpanel -After=check-mount.service connman.service +After=connman.service [Service] Type=simple @@ -14,3 +14,4 @@ OOMScoreAdjust=200 [Install] WantedBy=multi-user.target +#WantedBy=default.target diff --git a/test/quickpanel_debug_util.c b/test/quickpanel_debug_util.c index 94d883b..859506d 100755 --- a/test/quickpanel_debug_util.c +++ b/test/quickpanel_debug_util.c @@ -25,6 +25,7 @@ #include <string.h> #include <stdio.h> #include <time.h> +#include <Elementary.h> #include <common.h> #include <glib.h> diff --git a/test/quickpanel_debug_util.h b/test/quickpanel_debug_util.h index ff22b00..f27853b 100755 --- a/test/quickpanel_debug_util.h +++ b/test/quickpanel_debug_util.h @@ -19,6 +19,6 @@ #ifndef __QUICKPANEL_DEBUG_UTIL_H_ #define __QUICKPANEL_DEBUG_UTIL_H_ -void debug_printf(char *fmt, ...); +extern void debug_printf(char *fmt, ...); #endif /* __QUICKPANEL_DEBUG_UTIL_H_ */ |