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")
)
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
ecore-input
icu-i18n
elementary
- efl-assist
dlog
syspopup-caller
minicontrol-viewer
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")
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}\"")
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)
#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;
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);
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");
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__ */
*
*/
+#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)
while (*pszOneChar) {
if (!isdigit(*pszOneChar)
- && (*pszOneChar != '*') && (*pszOneChar != '#')
- && (*pszOneChar != ' ')
- && !((*pszOneChar == '-') && digit_count >= 7)) {
+ && (*pszOneChar != '*') && (*pszOneChar != '#')
+ && (*pszOneChar != ' ')
+ && !((*pszOneChar == '-') && digit_count >= 7)) {
return 0;
}
#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)
#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*/
} \
} 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_ */
*/
-#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"
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;
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);
{
int is_emul = 0;
char *info = NULL;
+
if (system_info_get_platform_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) {
if (info == NULL) {
return 0;
}
}
- if (info != NULL) free(info);
+ free(info);
return is_emul;
}
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) {
} else {
ERR("failed to get xwin");
}
+#else
+ ERR("Not yet implemented");
#endif
}
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) {
} 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();
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);
} else {
ERR("failed to get xwin");
}
+
#endif
}
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_ */
*
*/
-
-#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);
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)
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)
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)
eina_strbuf_free(strbuf_access);
quickpanel_accessibility_screen_reader_data_set(view
- , "focus.setting", "", _NOT_LOCALIZED("Settings"));
+ , "focus.setting", "", _NOT_LOCALIZED("Settings"));
}
#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__ */
*/
-#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>
#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/"
.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)
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);
}
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");
}
/*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)
{
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) {
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;
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;
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");
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");
}
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;
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");
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;
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) {
return (int)u_strlen(u_formatted_str);
}
-
static void _formatter_create(void *data)
{
int ret = 0;
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;
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;
_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)
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)
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)
}
}
- 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);
#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__ */
*/
+#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"
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;
#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
*/
+#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
}
#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;
}
}
-
static void _slider_changed_job_cb(void *data)
{
int value = 0;
}
-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;
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);
}
}
-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
*/
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);
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;
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;
}
}
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");
*/
-#include "handler_controller.h"
+#include <Elementary.h>
#include <dlog.h>
#include <vconf.h>
#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"
#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_ */
#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"
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;
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");
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;
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 ) {
}
}
-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;
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;
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;
#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,
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_ */
*/
#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
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);
#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;
_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;
_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;
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;
}
ret = EINA_TRUE;
}
- if (value != NULL) {
- free(value);
- }
+ free(value);
+
DBG("%s :: playable[%d]", file_path, ret);
metadata_extractor_destroy(metadata);
return ret;
#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
*/
+#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) {
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);
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);
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
}
}
-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;
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;
}
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;
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);
}
}
-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,
},
};
- 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,
},
};
- 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;
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;
}
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;
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);
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);
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 */
#ifndef _QP_MINICONTROL_DEF_
#define _QP_MINICONTROL_DEF_
-void quickpanel_minictrl_rotation_report(int angle);
+extern void quickpanel_minictrl_rotation_report(int angle);
#endif
*
*/
+#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 */
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,
#ifdef QP_ANIMATED_IMAGE_ENABLE
&animated_image,
#endif
+#ifdef QP_VOICE_CONTROL_ENABLE
+ &voice_control,
+#endif
};
HAPI int quickpanel_modules_init(void *data)
}
/******************************************************************
- *
- * LANGUAGE
- *
- ****************************************************************/
+ *
+ * LANGUAGE
+ *
+ ****************************************************************/
HAPI void quickpanel_modules_lang_change(void *data)
{
}
/******************************************************************
- *
- * Quickpanel open/close Events
- *
- ****************************************************************/
+ *
+ * Quickpanel open/close Events
+ *
+ ****************************************************************/
HAPI int quickpanel_modules_opened(void *data)
{
int i;
#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);
#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
#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;
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,
.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",
.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) {
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;
}
{
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);
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("");
+
+ 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("");
- Elm_Gesture_Line_Info *line_info = (Elm_Gesture_Line_Info *) event_info;
+}
+
+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);
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);
-static void _gesture_destroy()
+ 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(void)
{
if (s_info.gesture) {
evas_object_del(s_info.gesture);
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;
+ }
+ }
+
+ 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;
+ }
- } else {
- ERR("app_control is NULL");
+ if (auto_remove == false) {
+ return noti;
}
- _activenoti_hide(NULL, 1);
-}
+ 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!");
- if (icon_path == NULL
- || (icon_path != NULL && elm_image_file_set(icon, icon_path, NULL) == EINA_FALSE)) {
- DBG("icon_path : %s", icon_path);
+ 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 (thumb_path == NULL
- || (thumb_path != NULL && elm_image_file_set(icon, thumb_path, NULL) == EINA_FALSE)) {
- DBG("thumb_path : %s", thumb_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");
+ }
- int ret = notification_get_pkgname(noti, &pkgname);
- if (ret == NOTIFICATION_ERROR_NONE && pkgname != NULL) {
- DBG("pkgname : %s", icon_default);
+ 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);
+ }
- icon_default = quickpanel_common_ui_get_pkginfo_icon(pkgname);
- DBG("icon_default : %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");
+ }
- if (icon_default == NULL
- || ( icon_default != NULL && elm_image_file_set(icon, icon_default, NULL) == EINA_FALSE)) {
- DBG("DEFAULT_ICON : %s", DEFAULT_ICON);
+ DBG("thumb_path : %s app_control = %p", icon_path, app_control);
+ } else {
+ char *pkgname;
- 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;
- }
+ 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 (!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;
}
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));
return elm_entry_utf8_to_markup(text);
}
-
return NULL;
}
}
}
-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, };
+ char *tmp;
+ int ret;
- retif(noti == NULL, NULL, "Invalid parameter!");
-
- 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;
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);
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);
}
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 {
_activenoti_hide(data , 1);
-}
-
-
-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);
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;
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;
}
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;
+ Evas_Object *base = NULL;
+ int w, h;
- retif(noti == NULL, , "Invalid parameter!");
-
- 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;
+ }
+ }
- 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);
+ s_info.current_noti = noti;
- bg_img = _get_bg_img(s_info.layout , 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);
+ }
+
+ 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 , 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;
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;
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) {
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;
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");
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();
}
}
static int _activenoti_fini(void *data)
{
- struct appdata *ad = (struct appdata *)data;
+ // struct appdata *ad = (struct appdata *)data;
_activenoti_destroy_activenoti();
_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);
+}
+
*
*/
+#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);
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;
}
}
#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
*
*/
+#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"
#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"
.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;
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");
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;
}
if (!strcmp(noti_pkgname, pkgname)
- && priv_id == noti_priv_id) {
+ && priv_id == noti_priv_id) {
notification_set_size(node->noti, size);
return node->noti;
}
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;
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;
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;
}
/* 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);
}
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;
}
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);
_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;
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;
}
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);
}
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();
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;
}
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("");
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);
}
}
-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");
}
}
-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);
}
}
}
}
+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;
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();
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);
}
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);
}
}
}
-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;
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;
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) {
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;
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!");
}
/* 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;
}
}
/*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)
{
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;
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)
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)
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)
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)
{
_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 */
#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
*
*/
-
+#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
}
#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, };
}
}
-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;
}
}
-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("");
}
}
-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("");
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) {
"edje",
_signal_cb,
parent
- );
+ );
//add event
elm_object_signal_callback_add(box,
"edje",
_signal_cb,
parent
- );
+ );
//add event
elm_object_signal_callback_add(box,
"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);
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;
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));
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, };
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;
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;
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;
}
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;
}
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) {
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");
}
}
#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;
}
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;
}
"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);
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) {
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");
}
}
#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;
}
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;
}
"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);
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);
}
}
}
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");
}
}
#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);
}
#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");
}
#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");
#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");
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");
#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"
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
*
*/
+#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"
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;
}
}
-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;
}
}
-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;
}
}
-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");
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;
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");
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;
#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
*/
+#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;
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)
_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;
NULL,
NULL,
NULL,
- NULL, //_drag_cancel_cb,
+ NULL,
vi,
NULL,
0,
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");
}
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);
_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);
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);
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);
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);
"edje",
_signal_cb,
parent
- );
+ );
//add event
elm_object_signal_callback_add(view,
"edje",
_signal_cb,
parent
- );
+ );
//add event
elm_object_signal_callback_add(view,
"edje",
_signal_cb,
parent
- );
+ );
DBG("created box:%p", view);
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;
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);
#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
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
*
*/
+#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"
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)
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)
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;
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");
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");
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);
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;
#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
*
*/
+#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"
*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 {
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)
#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;
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
*/
+#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) {
}
#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);
#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;
}
#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
-/*
- * 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.
*
*/
+#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"
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");
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");
/* 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;
}
}
- 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;
}
#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
*
*/
+#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
Noti_View_H noti_view_h = {
.name = "noti_view",
-
.create = _create,
.update = _update,
.remove = _remove,
#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
*
*/
+#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
}
#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, };
}
}
-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;
}
}
-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("");
}
}
-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("");
}
#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;
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));
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, };
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;
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;
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;
}
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;
}
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) {
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");
}
}
#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;
}
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;
}
"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);
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) {
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");
}
}
#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;
}
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;
}
"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);
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);
}
}
}
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");
}
}
#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);
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);
*/
+#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"
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);
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);
/* 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);
}
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);
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);
}
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");
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");
Noti_View_H noti_view_listtype_h = {
.name = "noti_view_listtype",
-
.create = _create,
.update = _update,
.remove = NULL,
*
*/
-
+#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"
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);
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) {
} 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;
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");
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");
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);
#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);
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;
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"));
#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
#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) {
} /*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);
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
_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));
Noti_View_H ongoing_noti_view_h = {
.name = "ongoing_noti_view",
-
.create = _create,
.update = _update,
.remove = NULL,
*/
#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"
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;
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) {
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)
_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) {
}
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;
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;
}
#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
*
*/
+#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
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,
#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
*
*/
+#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"
#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
*
*/
+#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"
#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
*
*/
+#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);
}
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);
#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 {
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
*
*/
+#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"
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;
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) {
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) {
}
quickpanel_datetime_editing_icon_visibility_set(is_visible);
-}
\ No newline at end of file
+}
#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
#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"
, 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);
}
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) {
} else {
DBG("get:[%s]", value_r);
}
+#endif
END:
if (value_r != NULL) {
}
if (ini != NULL) {
-#ifdef HAVE_X
iniparser_freedict(ini);
-#endif
}
return ret;
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 {
#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
#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"
#include "sim_controller.h"
#include "noti.h"
-
+
/* services */
#include "keyboard.h"
#include "keyboard_x.h"
#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
}
/******************************************************************************
- *
- * UI
- *
- ****************************************************************************/
+ *
+ * UI
+ *
+ ****************************************************************************/
static void _ui_efl_cache_flush(void *evas)
{
int file_cache;
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);
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
retif(data == NULL, , "Invialid parameter!");
ad = data;
-
-#ifdef HAVE_X
+
+#if defined(WINSYS_X11)
xwin = elm_win_xwindow_get(ad->win);
#endif
,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
}
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
retif(data == NULL, , "Invialid parameter!");
ad = data;
-#ifdef HAVE_X
+#if defined(WINSYS_X11)
xwin = elm_win_xwindow_get(ad->win);
#endif
,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
}
}
/*****************************************************************************
- *
- * ui rotation functions
- *
- ****************************************************************************/
+ *
+ * ui rotation functions
+ *
+ ****************************************************************************/
static void _ui_rotation_wm_cb(void *data, Evas_Object *obj, void *event)
{
int angle = 0;
}
}
}
+#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);
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);
}
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 {
}
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);
ad->win = NULL;
}
+ _tzsh_unset();
+
return QP_OK;
}
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 &&
}
}
-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;
}
}
-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) {
_ui_handler_enable_set(EINA_FALSE);
}
}
-#endif
return ECORE_CALLBACK_RENEW;
}
+#endif
static void _vconf_init(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)
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");
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;
#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
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;
_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);
#ifdef QP_EMERGENCY_MODE_ENABLE
quickpanel_emergency_mode_fini(ad);
#endif
- quickpanel_conf_fini(ad);
/* delete quickpanel window */
_ui_gui_destroy(ad);
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;
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);
#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
struct appdata {
Evas_Object *win;
+ tzsh_h tzsh;
+ tzsh_quickpanel_service_h quickpanel_service;
Evas_Object *background;
Evas_Object *view_root;
Eina_Bool state;
} QP_Module;
-void *quickpanel_get_app_data(void);
+extern void *quickpanel_get_app_data(void);
#endif /* __QUICKPANEL_UI_H__ */
*
*/
-
+#include <Elementary.h>
+#include <tzsh.h>
+#include <tzsh_quickpanel_service.h>
+#include <E_DBus.h>
#include "quickpanel-ui.h"
#include "common.h"
#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,
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
*
*/
+#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;
list_traverse = notification_list_get_next(list_traverse);
}
-
+
if (noti_list != NULL) {
notification_free_list(noti_list);
noti_list = NULL;
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) {
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;
}
*
*/
-#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
*
*/
+#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"
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) {
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)
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)
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
}
#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
*
*/
-
-#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"
} 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;
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;
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.");
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();
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.");
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;
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)
{
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) {
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) {
*
*/
-
-#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"
*
*/
+#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"
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;
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");
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) {
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();
}
#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
*
*/
+#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"
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);
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);
#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
*
*/
+#include <Elementary.h>
#include <vconf.h>
+#include <notification_list.h>
+
#include "common.h"
#include "noti_util.h"
#include "smart_alert.h"
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);
}
}
}
#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"
#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
*
*/
+#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"
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)
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;
#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
*
*/
+#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"
#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"
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);
}
*
*/
+#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"
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;
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!");
*
*/
+#include <Elementary.h>
#include <vconf.h>
#include <syspopup_caller.h>
#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"
{
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);
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)
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);
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("");
}
}
-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);
}
{
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;
}
{
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;
}
*
*/
+#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
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);
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!");
_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);
}
{
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;
}
*
*/
+#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"
#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;
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;
quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);
}
-
static int _is_simcard_inserted(void)
{
int ret_1 = QP_FAIL;
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;
}
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;
}
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);
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!");
}
}
-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);
}
{
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;
}
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;
}
*
*/
+#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"
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);
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);
}
{
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;
}
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;
}
*
*/
+#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"
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)
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;
}
}
-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);
}
*
*/
+#include <Elementary.h>
#include <vconf.h>
#include <tethering.h>
#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")
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;
*/
+#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"
}
}
/*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)
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!");
*
*/
+#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")
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;
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) {
}
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);
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;
}
}
/*
- 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);
*
*/
+#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");
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;
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");
#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
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__ */
*
*/
-
+#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"
#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;
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");
return box;
}
-
HAPI Evas_Object *quickpanel_setting_box_get(Evas_Object *base)
{
Evas_Object *container = NULL;
return box;
}
-
HAPI int quickpanel_setting_container_rotation_set(Evas_Object *base, int angle)
{
Evas_Object *container = NULL;
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;
}
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;
}
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);
}
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;
}
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);
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");
#ifndef __SETTING_UTILS_H__
#define __SETTING_UTILS_H__
-#include <Elementary.h>
-#include "settings.h"
#define TIMER_CONTINUE 1
#define TIMER_STOP 0
#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__ */
#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"
#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);
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;
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) {
#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"
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
*
*/
+#include <Elementary.h>
+
+#include <tzsh.h>
+#include <tzsh_quickpanel_service.h>
+#include <E_DBus.h>
#include "quickpanel-ui.h"
#include "common.h"
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;
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);
}
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++;
}
#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
*
*/
+#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;
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");
}
}
-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");
}
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");
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;
}
}
-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;
}
}
}
-#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");
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");
quickpanel_uic_launch_app_inform_result(pkgname, ret);
quickpanel_uic_close_quickpanel(true, 1);
}
+#endif
#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__ */
*
*/
-
+#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"
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);
}
}
-
/*****************************************************************************
*
* Util functions
#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__ */
*
*/
-
+#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"
#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
}
}
-static void _view_icons_add()
+static void _view_icons_add(void)
{
int index = 0, total = 0;
Eina_List *l;
struct appdata *ad = (struct appdata *)data;
retif(ad == NULL, QP_FAIL, "Invalid parameter!");
- _view_create(data);
+ _view_create(data);
return QP_OK;
}
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) {
#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__ */
*
*/
-
+#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"
#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
.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;
}
#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");
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) {
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;
#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__ */
*/
+#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"
}
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;
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;
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;
}
}
// 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);
}
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);
}
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;
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);
}
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"));
}
// --------------------------------------------------------------------------------------------
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;
}
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()
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");
}
/* 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++;
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;
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();
// --------------------------------------------------------------------------------------------
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;
}
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);
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);
}
}
{
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;
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();
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);
}
}
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);
}
}
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);
}
#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__
*
*/
+#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);
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));
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;
#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);
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
--- /dev/null
+/*
+ * 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;
+}
+
--- /dev/null
+/*
+ * 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_ */
+
#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
)
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
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")
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;
+ }
}
#define QP_HANDLER_COLOR "AO010"
#define QP_HANDLER_PRESS_COLOR "AO010S"
+
+
#define QUICKPANEL_FOCUS_OBJECT(NAME, TO_1, TO_2)\
part {\
name: NAME;\
}
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";
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";
<?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>
#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;
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;
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";
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;
}
}
state: "default" 0.0;
rel1
{
- relative: 0.0 0.1;
+ relative: 0.0 0.05;
to: "bg";
}
rel2 {
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{
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{
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;
}
}
}
+ 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";
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;
}
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";
}
}
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 {
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;
part {
name: "subtitle_text";
type: TEXTBLOCK;
+ scale: 1;
description {
state: "default" 0.0;
align: 0.0 0.0;
part {
name: "title_text";
type: TEXTBLOCK;
+ scale: 1;
description {
state: "default" 0.0;
align: 0.0 0.0;
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";
}
part {
name: "content_text";
type: TEXTBLOCK;
+ scale: 1;
multiline: 1;
description {
state: "default" 0.0;
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";
}
}
state: "sub_show" 0.0;
inherit: "default" 0.0;
rel1 {
- relative: 0.0 0.55;
+ relative: 0.0 0.6;
to: "text_space";
}
rel2 {
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 {
signal: "btn_show";
source: "button.space";
action: STATE_SET "btn_show" 0.0;
- target: "button.space";
- target: "rect_main";
- target: "background";
+ target: "button.swallow";
}
}
}
part {
name: "content.button.text";
type: TEXT;
+ scale: 1;
description {
state: "default" 0.0;
align: 0.5 0.5;
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";
}
}
scale: 1;
description {
state: "default" 0.0;
- min: 30 30;
+ min: 42 42;
fixed: 1 1;
align: 0.5 0.5;
rel1 {
fixed: 1 1;
align: 0.5 0.5;
rel1 {
- relative: 0.0 0.5;
+ relative: 0.5 0.5;
to: "space.divider";
}
rel2 {
image {
normal: "line_indicator_divider.png";
}
- color_class: "AO027";
+ color_class: "AO003E1";
}
}
}
}
}
+
part {
name: "date.top.padding";
type: SPACER;
}
}
+ 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;
}
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;
}
#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
#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
#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
images {
image: "core_icon_badge_container.#.png" COMP;
+ image: "quick_button_icon_bg.png" COMP;
}
group {
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;
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";
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";
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";
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;
}
}
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;
}
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;
}
}
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;
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;
}
}
part {
- name: "elm.text.count";
+ name: "elm.text.time";
type: TEXT;
mouse_events: 0;
scale: 1;
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 {
}
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;
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;
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";
+ }
}
}
#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
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;
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";
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";
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";
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;
}
}
}
+
+ 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;
}
}
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;
}
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 {
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";
+ }
+
}
}
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;
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;
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";
description {
state: "line1" 0.0;
inherit: "default" 0.0;
- min: 0 13;
+ min: 0 BOX_TEXT_TOP_PADDING;
}
description {
state: "line2" 0.0;
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";
description {
state: "line1" 0.0;
inherit: "default" 0.0;
- min: 0 13;
+ min: 0 BOX_TEXT_TOP_PADDING;
}
description {
state: "line2" 0.0;
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";
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";
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;
}
}
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;
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;
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;
}
}
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 {
description {
state: "default" 0.0;
align: 0.0 0.0;
- min: 480 135;
- max: 800 135;
+ min: 480 140;
rel1 {
to: "elm.content.bg";
}
target: "elm.content.bg";
}
}
- }
\ No newline at end of file
+ }
#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"
//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
images {
image: "icon_arrow_up.png" COMP;
image: "icon_arrow_down.png" COMP;
+ image: "core_icon_badge_container.#.png" COMP;
}
group {
visible: QP_THEME_BG_VISIBILITY;
}
}
-
QUICKPANEL_FOCUS_OBJECT("focus.label", "base", "base")
part {
name: "elm.padding.left";
part {
name: "base";
type: RECT;
- repeat_events: 1;
scale: 1;
description
{
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;
scale: 1;
description {
state: "default" 0.0;
- min: 23 0;
+ min: 17 0;
fixed: 1 0;
align: 1.0 0.0;
rel1 {
part {
name: "underline";
type: RECT;
- repeat_events: 1;
scale: 1;
description {
state: "default" 0.0;
part {
name: "noti.clear.all.separator";
type: RECT;
- repeat_events: 1;
scale: 1;
description {
state: "default";
}
align: 1.0 0.5;
- visible: 1;
+ visible: 0;
}
description
{
scale: 1;
description {
state: "default" 0.0;
- min: 14 0;
+ min: 17 0;
fixed: 1 0;
align: 1.0 0.0;
rel1 {
}
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
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 {
scale: 1;
description {
state: "default" 0.0;
- min: 14 0;
+ min: 17 0;
fixed: 1 0;
align: 1.0 0.0;
rel1 {
}
}
}
-
QUICKPANEL_FOCUS_OBJECT("focus", "rect.button.clear_all", "rect.button.clear_all")
}
programs
}
}
}
- }
\ No newline at end of file
+ }
}
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";
#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
--- /dev/null
+/*
+ * 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";
+ }
+ }
+ }
+}
+
+
+
--- /dev/null
+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---- ------
+++ /dev/null
-<manifest>
- <request>
- <domain name="_"/>
- </request>
-</manifest>
--- /dev/null
+[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
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+ <assign>
+ <filesystem path="/usr/apps/org.tizen.quickpanel/bin/quickpanel" exec_label="User::App::org.tizen.quickpanel" />
+ </assign>
+</manifest>
%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
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)
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)
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}
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}
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
--- /dev/null
+[Unit]
+Description=Start the "Quickpanel" program
+
+[Path]
+PathExists=/run/.wm_ready
[Unit]
Description=Start the Quickpanel
-After=check-mount.service connman.service
+After=connman.service
[Service]
Type=simple
[Install]
WantedBy=multi-user.target
+#WantedBy=default.target
#include <string.h>
#include <stdio.h>
#include <time.h>
+#include <Elementary.h>
#include <common.h>
#include <glib.h>
#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_ */