{
Evas_Object *canvas;
- canvas = evas_object_image_filled_add(evas_object_evas_get(parent));
+ canvas = evas_object_image_add(evas_object_evas_get(parent));
if (!canvas)
return NULL;
evas_object_image_content_hint_set(canvas, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
-// evas_object_image_colorspace_set(canvas, EVAS_COLORSPACE_ARGB8888);
-// evas_object_image_alpha_set(canvas, EINA_TRUE);
+ evas_object_image_colorspace_set(canvas, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_alpha_set(canvas, EINA_TRUE);
evas_object_move(canvas, 0, 0);
return canvas;
}
static int update_pd_canvas(struct livebox *handle, Evas_Object *image)
{
+ Evas_Native_Surface surface;
int w;
int h;
- Evas_Native_Surface surface;
- switch (livebox_pd_type(handle)) {
- case PD_TYPE_BUFFER:
- evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
- evas_object_image_alpha_set(image, EINA_TRUE);
+ DbgPrint("Updated\n");
- livebox_get_pdsize(handle, &w, &h);
- if (w > 0 && h > 0) {
- void *data;
- data = livebox_acquire_pdfb(handle);
- if (data) {
- evas_object_image_size_set(image, w, h);
- evas_object_image_data_copy_set(image, data);
- livebox_release_pdfb(data);
- }
- evas_object_resize(image, w, h);
- //evas_object_size_hint_min_set(image, w, h);
- evas_object_size_hint_max_set(image, w, h);
- }
- break;
+ switch (livebox_pd_type(handle)) {
case PD_TYPE_PIXMAP:
h = w = 0;
livebox_get_pdsize(handle, &w, &h);
if (w <= 0 || h <= 0)
break;
+ //evas_object_image_size_set(image, w, h);
+
DbgPrint("Update: %dx%d\n", w, h);
surface.version = EVAS_NATIVE_SURFACE_VERSION;
surface.type = EVAS_NATIVE_SURFACE_X11;
surface.data.x11.pixmap = livebox_pd_pixmap(handle);
- surface.data.x11.visual = NULL; //ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
+ surface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
evas_object_image_native_surface_set(image, &surface);
- evas_object_image_size_set(image, w, h);
- evas_object_resize(image, w, h);
+ evas_object_image_data_update_add(image, 0, 0, w, h);
evas_object_size_hint_max_set(image, w, h);
+ evas_object_resize(image, w, h);
evas_object_show(image);
break;
+ case PD_TYPE_BUFFER:
+ livebox_get_pdsize(handle, &w, &h);
+ if (w > 0 && h > 0) {
+ void *data;
+
+ data = livebox_acquire_pdfb(handle);
+ if (data) {
+ evas_object_image_data_set(image, NULL);
+ evas_object_image_colorspace_set(canvas, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_alpha_set(image, EINA_TRUE);
+ evas_object_image_size_set(image, w, h);
+ evas_object_image_smooth_scale_set(image, EINA_TRUE);
+ evas_object_image_data_copy_set(image, data);
+ evas_object_image_data_update_add(image, 0, 0, w, h);
+ livebox_release_pdfb(data);
+ }
+ evas_object_resize(image, w, h);
+ //evas_object_size_hint_min_set(image, w, h);
+ evas_object_size_hint_max_set(image, w, h);
+ }
+ break;
case PD_TYPE_TEXT:
default:
break;
int h;
int type;
+ DbgPrint("Updated\n");
+
switch (livebox_lb_type(handle)) {
case LB_TYPE_PIXMAP:
w = h = 0;
DbgPrint("Update: %dx%d\n", w, h);
+ //evas_object_image_size_set(image, w, h);
+
surface.version = EVAS_NATIVE_SURFACE_VERSION;
surface.type = EVAS_NATIVE_SURFACE_X11;
surface.data.x11.pixmap = livebox_lb_pixmap(handle);
- surface.data.x11.visual = NULL; //ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
+ surface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
evas_object_image_native_surface_set(image, &surface);
- evas_object_image_size_set(image, w, h);
+ evas_object_image_data_update_add(image, 0, 0, w, h);
+
evas_object_resize(image, w, h);
evas_object_size_hint_min_set(image, w, h);
evas_object_size_hint_max_set(image, w, h);
evas_object_show(image);
break;
case LB_TYPE_BUFFER:
- evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
- evas_object_image_alpha_set(image, EINA_TRUE);
-
w = h = 0;
type = livebox_size(handle);
livebox_service_get_size(type, &w, &h);
void *data;
data = livebox_acquire_fb(handle);
if (data) {
+ evas_object_image_data_set(image, NULL);
+ evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_alpha_set(image, EINA_TRUE);
evas_object_image_size_set(image, w, h);
+ evas_object_image_smooth_scale_set(image, EINA_TRUE);
evas_object_image_data_copy_set(image, data);
+ evas_object_image_data_update_add(image, 0, 0, w, h);
livebox_release_fb(data);
}
evas_object_resize(image, w, h);
int h;
int is_pd;
+ if (!packet) {
+ ErrPrint("Invalid packet\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
ret = packet_get(packet, "ssiiii", &pkgname, &id, &is_pd, &w, &h, &status);
if (ret != 6) {
ErrPrint("Invalid argument\n");
- ret = EINVAL;
+ ret = -EINVAL;
goto out;
}
+ DbgPrint("Size is changed: %dx%d (%s)\n", w, h, id);
+
handler = lb_find_livebox(pkgname, id);
if (!handler) {
ErrPrint("Livebox(%s - %s) is not found\n", pkgname, id);
}
if (handler->state != CREATE) {
+ ErrPrint("Hander is not created yet\n");
ret = -EPERM;
goto out;
}
if (is_pd) {
+ DbgPrint("PD is resized\n");
/*!
* \NOTE
* PD is not able to resized by the client.
* 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)
+ if (status == 0) {
+ lb_set_pdsize(handler, w, h);
+ lb_invoke_event_handler(handler, LB_EVENT_PD_SIZE_CHANGED);
+ } else {
ErrPrint("This is not possible. PD Size is changed but the return value is not ZERO\n");
+ }
} else {
- if (status == 0)
+ DbgPrint("LB is resized\n");
+ if (status == 0) {
+ DbgPrint("Livebox size is updated (%dx%d)\n", w, h);
lb_set_size(handler, w, h);
- if (handler->size_changed_cb) {
- handler->size_changed_cb(handler, status, handler->size_cbdata);
+ if (handler->size_changed_cb) {
+ DbgPrint("Call the size changed callback\n");
+ handler->size_changed_cb(handler, status, handler->size_cbdata);
- handler->size_changed_cb = NULL;
- handler->size_cbdata = NULL;
+ handler->size_changed_cb = NULL;
+ handler->size_cbdata = NULL;
+ } else {
+ DbgPrint("Call the global size changed callback\n");
+ lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED);
+ DbgPrint("Size changed callback done\n");
+ }
} else {
- lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED);
+ DbgPrint("Livebox size is not changed: %dx%d, %d\n", w, h, status);
}
}
* after this request.
*/
if (ret == 0) {
+ DbgPrint("Resize request is done, prepare the size changed event\n");
handler->size_changed_cb = cb;
handler->size_cbdata = cbdata;
} else {
+ DbgPrint("Resize request is failed: %d\n", ret);
cb(handler, ret, cbdata);
}
}
return NULL;
}
- if (livebox_service_is_enabled(pkgname) == 0) {
- DbgPrint("Livebox [%s] is disabled package\n", pkgname);
- return NULL;
- }
-
if (type != LB_SIZE_TYPE_UNKNOWN)
livebox_service_get_size(type, &width, &height);
return NULL;
}
+ if (livebox_service_is_enabled(handler->pkgname) == 0) {
+ DbgPrint("Livebox [%s](%s) is disabled package\n", handler->pkgname, pkgname);
+ free(handler->pkgname);
+ free(handler);
+ return NULL;
+ }
+
if (content) {
handler->content = strdup(content);
if (!handler->content) {
return -EALREADY;
}
+ if (handler->period_changed_cb)
+ DbgPrint("Already requested\n");
+
packet = packet_create("set_period", "ssd", handler->pkgname, handler->id, period);
if (!packet) {
ErrPrint("Failed to build a packet %s\n", handler->pkgname);
return -EALREADY;
}
+ if (handler->size_changed_cb)
+ DbgPrint("Already pended\n");
+
packet = packet_create("resize", "ssii", handler->pkgname, handler->id, w, h);
if (!packet) {
ErrPrint("Failed to build param\n");
return -EALREADY;
}
+ if (handler->group_changed_cb)
+ DbgPrint("Already sent\n");
+
packet = packet_create("change_group", "ssss", handler->pkgname, handler->id, cluster, category);
if (!packet) {
ErrPrint("Failed to build a param\n");
return -EALREADY;
}
+ if (handler->pinup_cb)
+ DbgPrint("Already sent\n");
+
packet = packet_create("pinup_changed", "ssi", handler->pkgname, handler->id, flag);
if (!packet) {
ErrPrint("Failed to build a param\n");
return master_rpc_async_request(handler, packet, 0, del_ret_cb, create_cb_info(cb, data));
}
+EAPI int livebox_client_paused(void)
+{
+ struct packet *packet;
+
+ packet = packet_create_noack("client_paused", "d", util_timestamp());
+ if (!packet) {
+ ErrPrint("Failed to create a pause packet\n");
+ return -EFAULT;
+ }
+
+ return master_rpc_request_only(NULL, packet);
+}
+
+EAPI int livebox_client_resumed(void)
+{
+ struct packet *packet;
+
+ packet = packet_create_noack("client_resumed", "d", util_timestamp());
+ if (!packet) {
+ ErrPrint("Failed to create a resume packet\n");
+ return -EFAULT;
+ }
+
+ return master_rpc_request_only(NULL, packet);
+}
+
/* End of a file */