From 0762917d9036f8fde77a69d6e7b84e5d3ef24956 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Wed, 29 Oct 2014 13:50:26 +0900 Subject: [PATCH] Update send_updated function [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 | 3 +-- src/dbox.c | 59 +++++++--------------------------------------------------- 2 files changed, 8 insertions(+), 54 deletions(-) diff --git a/include/dbox.h b/include/dbox.h index 927305a..db7cc53 100644 --- a/include/dbox.h +++ b/include/dbox.h @@ -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 */ diff --git a/src/dbox.c b/src/dbox.c index 7960c41..c21c7d4 100644 --- a/src/dbox.c +++ b/src/dbox.c @@ -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, ®ion); + dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, ®ion, 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, ®ion); + dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, ®ion, 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, ®ion); + dynamicbox_provider_send_updated(item->inst->item->pkgname, item->inst->id, DBOX_PRIMARY_BUFFER, ®ion, 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, ®ion); - } else { - ret = dynamicbox_provider_send_updated(pkgname, id, ®ion); - } + if (item->direct_path) { + ret = dynamicbox_provider_send_direct_updated(connection_handle(item->direct_path), pkgname, id, idx, ®ion, gbar, descfile); } else { - if (item->direct_path) { - ret = dynamicbox_provider_send_extra_direct_updated(connection_handle(item->direct_path), pkgname, id, idx, ®ion); - } else { - ret = dynamicbox_provider_send_extra_updated(pkgname, id, idx, ®ion); - } - } - - 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, ®ion); - } else { - ret = dynamicbox_provider_send_desc_updated(pkgname, id, descfile, ®ion); - } - } else { - if (item->direct_path) { - ret = dynamicbox_provider_send_extra_direct_desc_updated(connection_handle(item->direct_path), pkgname, id, idx, ®ion); - } else { - ret = dynamicbox_provider_send_extra_desc_updated(pkgname, id, idx, ®ion); - } + ret = dynamicbox_provider_send_updated(pkgname, id, idx, ®ion, gbar, descfile); } break; -- 2.7.4