return WIDGET_ERROR_INVALID_PARAMETER;
}
- packet = packet_create_noack((const char *)&cmd, "ssdiii", package_name(pkg), instance_id(inst), event_info->tv, event_info->x, event_info->y, (int)event_info->source);
+ packet = packet_create_noack((const char *)&cmd, "ssdiiidd", package_name(pkg), instance_id(inst), event_info->tv, event_info->x, event_info->y, (int)event_info->source, event_info->ratio_w, event_info->ratio_h);
if (!packet) {
return WIDGET_ERROR_FAULT;
}
*/
switch (state) {
case EVENT_STATE_ACTIVATE:
- script_handler_update_pointer(script, event_info->x, event_info->y, 1);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 1);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
break;
case EVENT_STATE_ACTIVATED:
- script_handler_update_pointer(script, event_info->x, event_info->y, -1);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, -1);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
break;
case EVENT_STATE_DEACTIVATE:
- script_handler_update_pointer(script, event_info->x, event_info->y, 0);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 0);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
break;
default:
return WIDGET_ERROR_INVALID_PARAMETER;
}
- packet = packet_create_noack((const char *)&cmd, "ssdiii", package_name(pkg), instance_id(inst), event_info->tv, event_info->x, event_info->y, (int)event_info->source);
+ packet = packet_create_noack((const char *)&cmd, "ssdiiidd", package_name(pkg), instance_id(inst), event_info->tv, event_info->x, event_info->y, (int)event_info->source, event_info->ratio_w, event_info->ratio_h);
if (!packet) {
return WIDGET_ERROR_FAULT;
}
switch (state) {
case EVENT_STATE_ACTIVATE:
- script_handler_update_pointer(script, event_info->x, event_info->y, 1);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 1);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
break;
case EVENT_STATE_ACTIVATED:
- script_handler_update_pointer(script, event_info->x, event_info->y, -1);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, -1);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
break;
case EVENT_STATE_DEACTIVATE:
- script_handler_update_pointer(script, event_info->x, event_info->y, 0);
+ script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 0);
(void)script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
break;
default:
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Invalid parameter\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_IN, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OUT, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, 1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, 0);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 0);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
ret = 0;
} else {
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_activate(0, 0, key_event_gbar_route_cb, inst);
+ ret = event_activate(0, 0, 1.0f, 1.0f, key_event_gbar_route_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
}
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
- ret = event_activate(0, 0, key_event_gbar_consume_cb, inst);
+ ret = event_activate(0, 0, 1.0f, 1.0f, key_event_gbar_consume_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_activate(0, 0, key_event_widget_route_cb, inst);
+ ret = event_activate(0, 0, 1.0f, 1.0f, key_event_widget_route_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
}
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
- ret = event_activate(0, 0, key_event_widget_consume_cb, inst);
+ ret = event_activate(0, 0, 1.0f, 1.0f, key_event_widget_consume_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
int y;
struct inst_info *inst;
const struct pkg_info *pkg;
+ int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
- if (ret != 5) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0 || packet_set_fd((struct packet *)packet, event_input_fd()) < 0) {
- ret = event_activate(x, y, mouse_event_widget_route_cb, inst);
+ ret = event_activate(x, y, ratio_w, ratio_h, mouse_event_widget_route_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
}
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
- ret = event_activate(x, y, mouse_event_widget_consume_cb, inst);
+ ret = event_activate(x, y, ratio_w, ratio_h, mouse_event_widget_consume_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
int y;
struct inst_info *inst;
const struct pkg_info *pkg;
+ int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
- if (ret != 5) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, timestamp);
+ event_set_mouse_xy(x * ratio_w, y * ratio_h, timestamp);
ret = event_deactivate(mouse_event_widget_route_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, timestamp);
+ event_set_mouse_xy(x * ratio_w, y * ratio_h, timestamp);
ret = event_deactivate(mouse_event_widget_consume_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
int y;
struct inst_info *inst;
const struct pkg_info *pkg;
+ int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
- if (ret != 5) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
if (package_gbar_type(pkg) == GBAR_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0 || packet_set_fd((struct packet *)packet, event_input_fd()) < 0) {
- ret = event_activate(x, y, mouse_event_gbar_route_cb, inst);
+ ret = event_activate(x, y, ratio_w, ratio_h, mouse_event_gbar_route_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
}
}
} else if (package_gbar_type(pkg) == GBAR_TYPE_SCRIPT) {
- ret = event_activate(x, y, mouse_event_gbar_consume_cb, inst);
+ ret = event_activate(x, y, ratio_w, ratio_h, mouse_event_gbar_consume_cb, inst);
if (ret == WIDGET_ERROR_NONE) {
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_ON);
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_SCROLL, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_SCROLL, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_HOLD, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_HOLD, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_SCROLL, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_SCROLL, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_HOLD, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_HOLD, timestamp);
ret = 0;
} else {
int y;
struct inst_info *inst;
const struct pkg_info *pkg;
+ int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
- if (ret != 5) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
if (package_gbar_type(pkg) == GBAR_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, timestamp);
+ event_set_mouse_xy(x * ratio_w, y * ratio_h, timestamp);
ret = event_deactivate(mouse_event_gbar_route_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
/*
* This delete callback will be removed when the instance will be destroyed.
if (ret == 0) {
- instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, mouse_event_gbar_route_cb);
+ instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, mouse_event_gbar_route_cb);
}
*/
} else {
}
} else if (package_gbar_type(pkg) == GBAR_TYPE_SCRIPT) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, timestamp);
+ event_set_mouse_xy(x * ratio_w, y * ratio_h, timestamp);
ret = event_deactivate(mouse_event_gbar_consume_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
/*
* This delete callback will be removed when the instance will be destroyed.
if (ret == 0) {
- instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, mouse_event_gbar_consume_cb);
+ instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, mouse_event_gbar_consume_cb);
}
*/
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_IN, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OUT, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, 1);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
ret = 0;
} else {
struct inst_info *inst;
const struct pkg_info *pkg;
int source;
+ double ratio_w;
+ double ratio_h;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiii", &pkgname, &id, ×tamp, &x, &y, &source);
- if (ret != 6) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
+ if (ret != 8) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x, y, 0);
+ script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 0);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
ret = 0;
} else {