From ceb91db02867c507ff13f696641827e89a77bc51 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Wed, 6 Feb 2013 14:12:20 +0000 Subject: [PATCH 1/1] Add livebox update interface. To update a box individually, we need a new interface. Change-Id: I17b2669c0d226cf3964bc4f41105a0f5123ce857 --- include/livebox.h | 8 +++++++- live.viewer/src/lb.c | 4 ++-- packaging/liblivebox-viewer.spec | 2 +- src/livebox.c | 21 +++++++++++++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/include/livebox.h b/include/livebox.h index 55266e4..daaf920 100644 --- a/include/livebox.h +++ b/include/livebox.h @@ -89,7 +89,6 @@ enum content_event_type { PD_KEY_DOWN = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_DOWN, PD_KEY_UP = CONTENT_EVENT_PD_MASK | CONTENT_EVENT_KEY_MASK | CONTENT_EVENT_KEY_UP, - CONTENT_EVENT_MAX = 0xFFFFFFFF, }; @@ -607,6 +606,13 @@ extern int livebox_unsubscribe_group(const char *cluster, const char *category); extern int livebox_refresh_group(const char *cluster, const char *category); /*! + * \brief Refresh a livebox + * \param[in] handler + * \return int Success 0 or negative value + */ +extern int livebox_refresh(struct livebox *handler); + +/*! * \brief Pixmap Id of a livebox content * \param[in] handler * \return int diff --git a/live.viewer/src/lb.c b/live.viewer/src/lb.c index dfd31d2..92fda14 100644 --- a/live.viewer/src/lb.c +++ b/live.viewer/src/lb.c @@ -314,14 +314,14 @@ static void create_resize_controller(struct livebox *handle, Evas_Object *layout { Evas_Object *size_list; char buffer[256]; - int sizes[7]; + int sizes[NR_OF_SIZE_LIST]; int cnt; int i; int w; int h; size_list = elm_list_add(layout); - cnt = 7; + cnt = sizeof(sizes) / sizeof(sizes[0]); livebox_get_supported_sizes(handle, &cnt, sizes); for (i = 0; i < cnt; i++) { livebox_service_get_size(sizes[i], &w, &h); diff --git a/packaging/liblivebox-viewer.spec b/packaging/liblivebox-viewer.spec index 7c571d3..88b6cb3 100644 --- a/packaging/liblivebox-viewer.spec +++ b/packaging/liblivebox-viewer.spec @@ -1,6 +1,6 @@ Name: liblivebox-viewer Summary: Library for developing the application. -Version: 0.8.13 +Version: 0.9.0 Release: 1 Group: framework/livebox License: Flora License diff --git a/src/livebox.c b/src/livebox.c index 055778b..a3f9038 100644 --- a/src/livebox.c +++ b/src/livebox.c @@ -1957,6 +1957,27 @@ EAPI int livebox_unsubscribe_group(const char *cluster, const char *category) return master_rpc_request_only(NULL, packet); } +EAPI int livebox_refresh(struct livebox *handler) +{ + struct packet *packet; + + if (!handler) { + ErrPrint("Hnalder is NIL\n"); + return -EINVAL; + } + + if (handler->state != CREATE || !handler->id) + return -EINVAL; + + packet = packet_create_noack("update", "ss", handler->pkgname, handler->id); + if (!packet) { + ErrPrint("Failed to create a packet\n"); + return -EFAULT; + } + + return master_rpc_request_only(handler, packet); +} + EAPI int livebox_refresh_group(const char *cluster, const char *category) { struct packet *packet; -- 2.7.4