X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fclient.c;h=265189d7f86e0dd56bf8e7e8dfb918a8ae3cd560;hb=ee66d255c33d3cb90a739c3a848c5f6f3dda88a3;hp=119ec5576450a682161757b4f84b03a5c9316bb2;hpb=99fae6c259e2516f2dabc277831e9a51746cd084;p=platform%2Fframework%2Fweb%2Flivebox-viewer.git diff --git a/src/client.c b/src/client.c index 119ec55..265189d 100644 --- a/src/client.c +++ b/src/client.c @@ -428,6 +428,65 @@ out: return NULL; } +static struct packet *master_size_changed(pid_t pid, int handle, const struct packet *packet) +{ + struct livebox *handler; + const char *pkgname; + const char *id; + int status; + int ret; + int w; + int h; + int is_pd; + + ret = packet_get(packet, "ssiiii", &pkgname, &id, &is_pd, &w, &h, &status); + if (ret != 6) { + ErrPrint("Invalid argument\n"); + ret = EINVAL; + goto out; + } + + handler = lb_find_livebox(pkgname, id); + if (!handler) { + ErrPrint("Livebox(%s - %s) is not found\n", pkgname, id); + ret = -ENOENT; + goto out; + } + + if (handler->state != CREATE) { + ret = -EPERM; + goto out; + } + + if (is_pd) { + /*! + * \NOTE + * PD is not able to resized by the client. + * PD is only can be managed by the provider. + * So the PD has no private resized event handler. + * Notify it via global event handler. + */ + lb_invoke_event_handler(handler, LB_EVENT_PD_SIZE_CHANGED); + if (status != 0) + ErrPrint("This is not possible. PD Size is changed but the return value is not ZERO\n"); + } else { + if (status == 0) + lb_set_size(handler, w, h); + + if (handler->size_changed_cb) { + handler->size_changed_cb(handler, status, handler->size_cbdata); + + handler->size_changed_cb = NULL; + handler->size_cbdata = NULL; + } else { + lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED); + } + } + +out: + return NULL; +} + static struct packet *master_period_changed(pid_t pid, int handle, const struct packet *packet) { struct livebox *handler; @@ -765,6 +824,10 @@ static struct method s_table[] = { .handler = master_period_changed, }, { + .cmd = "size_changed", + .handler = master_size_changed, + }, + { .cmd = "pinup", .handler = master_pinup, },