Tizen 2.4.0 rev3 SDK Public Release
authorjk7744.park <jk7744.park@samsung.com>
Sun, 21 Feb 2016 05:51:41 +0000 (14:51 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sun, 21 Feb 2016 05:51:41 +0000 (14:51 +0900)
daemon/minictrl/minictrl.c
daemon/minictrl/minictrl.h [changed mode: 0644->0755]
daemon/notifications/noti_util.c [changed mode: 0644->0755]
daemon/notifications/noti_util.h [changed mode: 0644->0755]
daemon/notifications/noti_view_listype.c
daemon/notifications/noti_view_ongoing.c
daemon/quickpanel-ui.c [changed mode: 0644->0755]

index 6474287..28bb3cc 100755 (executable)
@@ -88,6 +88,8 @@ static struct _info {
        .prov_table = NULL,
 };
 
+void _minictrl_sendview_rotation_event(const char* name, int angle);
+
 static int _viewer_check(const char *name)
 {
        char *pos_start = NULL;
@@ -580,7 +582,7 @@ static void _minictrl_add(const char *name, unsigned int width, unsigned int hei
        g_hash_table_insert(s_info.prov_table, g_strdup(name), vit);
 
        DBG("success to add minicontrol %s", name);
-       quickpanel_minictrl_rotation_report(vit->name, ad->angle);
+       _minictrl_sendview_rotation_event(vit->name, ad->angle);
 }
 
 static void _anim_init_resize(void *data)
@@ -987,7 +989,7 @@ static void _mctrl_viewer_event_cb(minicontrol_event_e event, const char *name,
                case MINICONTROL_EVENT_REQUEST_ANGLE:
                        if (ad->list != NULL) {
                                SERR("need to broadcasting angle by %s ", name, event);
-                               quickpanel_minictrl_rotation_report(name, ad->angle);
+                               _minictrl_sendview_rotation_event(name, ad->angle);
                        }
                        break;
                default:
@@ -1070,7 +1072,37 @@ static int _resume(void *data)
        return QP_OK;
 }
 
-HAPI void quickpanel_minictrl_rotation_report(const char* name, int angle)
+HAPI void quickpanel_minictrl_rotation_report(int angle)
+{
+       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;
 
@@ -1079,8 +1111,6 @@ HAPI void quickpanel_minictrl_rotation_report(const char* name, int angle)
                return;
        }
 
-       SINFO("minicontrol name:%s rotation:%d", name, angle);
-
        if (s_info.prov_table == NULL) {
                return;
        }
@@ -1089,6 +1119,7 @@ HAPI void quickpanel_minictrl_rotation_report(const char* name, int angle)
                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, };
@@ -1100,7 +1131,6 @@ HAPI void quickpanel_minictrl_rotation_report(const char* name, int angle)
        }
 }
 
-
 static void _minictrl_send_view_event_cb(gpointer key, gpointer value, gpointer user_data)
 {
        if (!key) {
old mode 100644 (file)
new mode 100755 (executable)
index 33b1755..a95fa6a
@@ -19,6 +19,6 @@
 #ifndef _QP_MINICONTROL_DEF_
 #define _QP_MINICONTROL_DEF_
 
-extern void quickpanel_minictrl_rotation_report(const char* name, int angle);
+extern void quickpanel_minictrl_rotation_report(int angle);
 
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index 870cb98..9b859af
@@ -295,3 +295,29 @@ err:
 
        return ret <= 0 ? NULL : buf;
 }
+
+
+HAPI char *quickpanel_noti_util_get_text(notification_h noti, notification_text_type_e text_type)
+{
+       time_t time = 0;
+       char *text = NULL;
+       char buf[128] = {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));
+                       text = buf;
+               }
+       } else {
+               notification_get_text(noti, text_type, &text);
+       }
+
+       DBG("text : %s", text);
+
+       if (text != NULL) {
+               return elm_entry_utf8_to_markup(text);
+       }
+
+       return NULL;
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index b49b680..05bda12
@@ -22,5 +22,6 @@
 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);
+extern char *quickpanel_noti_util_get_text(notification_h noti, notification_text_type_e text_type);
 
 #endif
index f282cbb..e1b0268 100755 (executable)
@@ -248,11 +248,9 @@ static void _set_text(Evas_Object *item, notification_h noti)
 #endif
 
        /* Get pkgname & id */
-       noti_err = notification_get_text(noti,
-                       NOTIFICATION_TEXT_TYPE_TITLE,
-                       &text);
 
-       if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) {
+       text = quickpanel_noti_util_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE);
+       if (text != NULL) {
                quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE);
                _set_text_to_part(item, "elm.text.title", text);
 #ifdef QP_SCREENREADER_ENABLE
@@ -260,10 +258,7 @@ static void _set_text(Evas_Object *item, notification_h noti)
 #endif
        }
 
-       noti_err = notification_get_text(noti,
-                       NOTIFICATION_TEXT_TYPE_EVENT_COUNT,
-                       &text);
-
+       noti_err = notification_get_text(noti, 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);
@@ -277,10 +272,8 @@ static void _set_text(Evas_Object *item, notification_h noti)
 #endif
        }
 
-       noti_err = notification_get_text(noti,
-                       NOTIFICATION_TEXT_TYPE_CONTENT,
-                       &text);
-       if (noti_err == NOTIFICATION_ERROR_NONE && text != NULL) {
+       text = quickpanel_noti_util_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT);
+       if (text != NULL) {
                quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE);
                _set_text_to_part(item, "elm.text.content", text);
 #ifdef QP_SCREENREADER_ENABLE
index 7ffef42..b7fe833 100755 (executable)
@@ -427,7 +427,7 @@ static void _set_text(Evas_Object *item, notification_h noti)
 
        SDBG("percentage:%f size:%f", percentage, size);
 
-       ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
+       text = quickpanel_noti_util_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE);
        if (ret == NOTIFICATION_ERROR_NONE && text != NULL) {
                quickpanel_common_util_char_replace(text, _NEWLINE, _SPACE);
                _set_text_to_part(item, "elm.text.title", text);
@@ -436,8 +436,8 @@ static void _set_text(Evas_Object *item, notification_h noti)
 #endif
        }
 
-       ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &text);
-       if (ret == NOTIFICATION_ERROR_NONE && text != NULL) {
+       text = quickpanel_noti_util_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT);
+       if (text != NULL) {
                if (layout == NOTIFICATION_LY_ONGOING_EVENT) {
                        text_utf8 = elm_entry_utf8_to_markup(text);
                        if (text_utf8 != NULL) {
old mode 100644 (file)
new mode 100755 (executable)
index 77b4b8f..33a1618
@@ -282,6 +282,8 @@ static void _ui_rotation_wm_cb(void *data, Evas_Object *obj, void *event)
 
        DBG("ROTATE:%d", angle);
 
+       quickpanel_minictrl_rotation_report(angle);
+
        _ui_rotate(ad, angle);
 }