Update send_updated function
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 29 Oct 2014 04:50:26 +0000 (13:50 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 29 Oct 2014 05:00:19 +0000 (14:00 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Id418e33009f469575532e54df31026dfff6ccc35

include/dbox.h
src/dbox.c

index 927305a..db7cc53 100644 (file)
@@ -71,7 +71,6 @@ extern const char *dynamicbox_find_pkgname(const char *filename);
 extern int dynamicbox_request_update_by_id(const char *filename);
 extern int dynamicbox_trigger_update_monitor(const char *id, int is_gbar);
 extern int dynamicbox_update_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
-extern int dynamicbox_send_updated(const char *pkgname, const char *id, int idx, int x, int y, int w, int h);
-extern int dynamicbox_send_desc_updated(const char *pkgname, const char *id, int idx, const char *descfile, int x, int y, int w, int h);
+extern int dynamicbox_send_updated(const char *pkgname, const char *id, int idx, int x, int y, int w, int h, int gbar, const char *descfile);
 
 /* End of a file */
index 7960c41..c21c7d4 100644 (file)
@@ -892,7 +892,7 @@ static int desc_updated_cb(const char *filename, void *data, int over)
            .h = item->inst->h,
        };
 
-       dynamicbox_provider_send_desc_updated(item->inst->item->pkgname, item->inst->id, filename, &region);
+       dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, &region, 1, filename);
     } else {
        ErrPrint("But GBAR is not opened, Ignore this update (%s)\n", item->inst->id);
     }
@@ -1000,7 +1000,7 @@ static int file_updated_cb(const char *filename, void *data, int over)
         */
        dynamicbox_provider_send_extra_info(item->inst->item->pkgname, item->inst->id, item->inst->priority,
                content, title, item->inst->icon, item->inst->name);
-       dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, &region);
+       dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, &region, 0, NULL);
     } else {
        item->is_dbox_updated++;
     }
@@ -1033,7 +1033,7 @@ static void reset_dbox_updated_flag(struct item *item)
      */
     dynamicbox_provider_send_extra_info(item->inst->item->pkgname, item->inst->id, item->inst->priority,
            item->inst->content, item->inst->title, item->inst->icon, item->inst->name);
-    dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, &region);
+    dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, &region, 0, NULL);
 
     item->is_dbox_updated = 0;
 }
@@ -1291,7 +1291,7 @@ HAPI void dbox_fini(void)
  * \note
  * Exported API for each dynamicboxes.
  */
-int dynamicbox_send_updated(const char *pkgname, const char *id, int idx, int x, int y, int w, int h)
+int dynamicbox_send_updated(const char *pkgname, const char *id, int idx, int x, int y, int w, int h, int gbar, const char *descfile)
 {
     Eina_List *l;
     struct item *item;
@@ -1308,55 +1308,10 @@ int dynamicbox_send_updated(const char *pkgname, const char *id, int idx, int x,
            continue;
        }
 
-       if (idx == DBOX_PRIMARY_BUFFER) {
-           if (item->direct_path) {
-               ret = dynamicbox_provider_send_direct_updated(connection_handle(item->direct_path), pkgname, id, &region);
-           } else {
-               ret = dynamicbox_provider_send_updated(pkgname, id, &region);
-           }
+       if (item->direct_path) {
+           ret = dynamicbox_provider_send_direct_updated(connection_handle(item->direct_path), pkgname, id, idx, &region, gbar, descfile);
        } else {
-           if (item->direct_path) {
-               ret = dynamicbox_provider_send_extra_direct_updated(connection_handle(item->direct_path), pkgname, id, idx, &region);
-           } else {
-               ret = dynamicbox_provider_send_extra_updated(pkgname, id, idx, &region);
-           }
-       }
-
-       break;
-    }
-
-    return ret;
-}
-
-int dynamicbox_send_desc_updated(const char *pkgname, const char *id, int idx, const char *descfile, int x, int y, int w, int h)
-{
-    Eina_List *l;
-    struct item *item;
-    int ret = DBOX_STATUS_ERROR_NOT_EXIST;
-    dynamicbox_damage_region_t region = {
-       .x = x,
-       .y = y,
-       .w = w,
-       .h = h,
-    };
-
-    EINA_LIST_FOREACH(s_info.item_list, l, item) {
-       if (strcmp(item->inst->item->pkgname, pkgname) || strcmp(item->inst->id, id)) {
-           continue;
-       }
-
-       if (idx == DBOX_PRIMARY_BUFFER) {
-           if (item->direct_path) {
-               ret = dynamicbox_provider_send_direct_desc_updated(connection_handle(item->direct_path), pkgname, id, descfile, &region);
-           } else {
-               ret = dynamicbox_provider_send_desc_updated(pkgname, id, descfile, &region);
-           }
-       } else {
-           if (item->direct_path) {
-               ret = dynamicbox_provider_send_extra_direct_desc_updated(connection_handle(item->direct_path), pkgname, id, idx, &region);
-           } else {
-               ret = dynamicbox_provider_send_extra_desc_updated(pkgname, id, idx, &region);
-           }
+           ret = dynamicbox_provider_send_updated(pkgname, id, idx, &region, gbar, descfile);
        }
 
        break;