int is_slave;
union _updated {
struct _slave {
- int (*dbox)(const char *pkgname, const char *id, int w, int h);
- int (*gbar)(const char *pkgname, const char *id, const char *descfile);
+ int (*dbox)(const char *pkgname, const char *id, int x, int y, int w, int h);
+ int (*gbar)(const char *pkgname, const char *id, const char *descfile, int x, int y, int w, int h);
} slave;
struct _app {
- int (*dbox)(const char *id, int w, int h);
- int (*gbar)(const char *id);
+ int (*dbox)(const char *id, int x, int y, int w, int h);
+ int (*gbar)(const char *id, int x, int y, int w, int h);
} app;
} updated;
.conf = NULL,
};
-static int send_dbox_updated(const char *pkgname, const char *id, int w, int h)
+static int send_dbox_updated(const char *pkgname, const char *id, int x, int y, int w, int h)
{
int ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
}
if (s_info.is_slave == 0) {
- ret = s_info.updated.app.dbox(id, w, h);
+ ret = s_info.updated.app.dbox(id, x, y, w, h);
} else if (s_info.is_slave == 1) {
- ret = s_info.updated.slave.dbox(pkgname, id, w, h);
+ ret = s_info.updated.slave.dbox(pkgname, id, x, y, w, h);
} else {
- ret = dynamicbox_provider_send_updated(pkgname, id, w, h);
+ dynamicbox_damage_region_t region = {
+ .x = x,
+ .y = y,
+ .w = w,
+ .h = h,
+ };
+ ret = dynamicbox_provider_send_updated(pkgname, id, ®ion);
}
return ret;
}
-static int send_gbar_updated(const char *pkgname, const char *id, const char *descfile)
+static int send_gbar_updated(const char *pkgname, const char *id, const char *descfile, int x, int y, int w, int h)
{
int ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
}
if (s_info.is_slave == 0) {
- ret = s_info.updated.app.gbar(id);
+ ret = s_info.updated.app.gbar(id, x, y, w, h);
} else if (s_info.is_slave == 1) {
- ret = s_info.updated.slave.gbar(pkgname, id, descfile);
+ ret = s_info.updated.slave.gbar(pkgname, id, descfile, x, y, w, h);
} else {
- ret = dynamicbox_provider_send_desc_updated(pkgname, id, descfile);
+ dynamicbox_damage_region_t region = {
+ .x = x,
+ .y = y,
+ .w = w,
+ .h = h,
+ };
+ ret = dynamicbox_provider_send_desc_updated(pkgname, id, descfile, ®ion);
}
return ret;
struct dynamicbox_buffer_data *user_data;
const char *pkgname;
const char *id;
+ int w;
+ int h;
+ int pixel_size;
if (!handle) {
return DBOX_STATUS_ERROR_INVALID_PARAMETER;
(void)dynamicbox_provider_buffer_sync(handle);
+ if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
+ ErrPrint("Failed to get size (%s)\n", id);
+ }
+
+ /**
+ * @todo
+ * manipulate the damaged region, so send update event only for the damaged region.
+ * to make more efficient updates
+ */
+
if (user_data->is_gbar == 1) {
- if (send_gbar_updated(pkgname, id, NULL) < 0) {
+ if (send_gbar_updated(pkgname, id, NULL, 0, 0, w, h) < 0) {
ErrPrint("Failed to send PD updated (%s)\n", id);
}
} else {
- int w;
- int h;
- int pixel_size;
-
- if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
- ErrPrint("Failed to get size (%s)\n", id);
- }
-
- if (send_dbox_updated(pkgname, id, w, h) < 0) {
+ if (send_dbox_updated(pkgname, id, 0, 0, w, h) < 0) {
ErrPrint("Failed to send updated (%s)\n", id);
}
}
const char *pkgname;
const char *id;
struct dynamicbox_buffer_data *user_data;
+ int w;
+ int h;
+ int pixel_size;
if (!handle) {
return DBOX_STATUS_ERROR_INVALID_PARAMETER;
return ret;
}
+ if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
+ ErrPrint("Failed to get size (%s)\n", id);
+ }
+
+ /**
+ * @todo
+ * manipulate the damaged region, so send update event only for the damaged region.
+ * to make more efficient updates
+ */
+
if (user_data->is_gbar == 1) {
- if (send_gbar_updated(pkgname, id, NULL) < 0) {
+ if (send_gbar_updated(pkgname, id, NULL, 0, 0, w, h) < 0) {
ErrPrint("Failed to send PD updated (%s)\n", id);
}
} else {
- int w;
- int h;
- int pixel_size;
-
- if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
- ErrPrint("Failed to get size (%s)\n", id);
- }
-
- if (send_dbox_updated(pkgname, id, w, h) < 0) {
+ if (send_dbox_updated(pkgname, id, 0, 0, w, h) < 0) {
ErrPrint("Failed to send updated (%s)\n", id);
}
}