return converted_provider_pkgname;
}
+ if (!provider_pkgname) {
+ DbgPrint("provider_pkgname is NULL (%s)\n", pid_pkgname);
+ return NULL;
+ }
+
if (!strcmp(abi_pkgname, pid_pkgname)) {
/*!
* This request is comes from predefined service provider.
* In this case, we should believe its request.
*/
+ DbgPrint("Provider pkgname[%s]\n", provider_pkgname);
return strdup(provider_pkgname);
} else if (WIDGET_CONF_DEBUG_MODE || g_conf.debug_mode) {
DbgPrint("Debug mode is enabled, use the %s as a widget_id\n", provider_pkgname);
- return provider_pkgname ? strdup(provider_pkgname) : NULL;
+ return strdup(provider_pkgname);
}
/*!
return WIDGET_ERROR_INVALID_PARAMETER;
}
- packet = packet_create_noack((const char *)&cmd, "ssdi", package_name(pkg), instance_id(inst), event_info->tv, event_info->keycode);
+ packet = packet_create_noack((const char *)&cmd, "ssdii", package_name(pkg), instance_id(inst), event_info->tv, event_info->keycode, event_info->slot);
if (!packet) {
return WIDGET_ERROR_FAULT;
}
return WIDGET_ERROR_INVALID_PARAMETER;
}
- 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);
+ packet = packet_create_noack((const char *)&cmd, "ssdiiiddi", 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, event_info->slot);
if (!packet) {
return WIDGET_ERROR_FAULT;
}
*/
switch (state) {
case EVENT_STATE_ACTIVATE:
- script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 1);
+ script_handler_update_pointer(script, event_info->slot, 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->ratio_w, event_info->y * event_info->ratio_h, -1);
+ script_handler_update_pointer(script, event_info->slot, 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->ratio_w, event_info->y * event_info->ratio_h, 0);
+ script_handler_update_pointer(script, event_info->slot, 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, "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);
+ packet = packet_create_noack((const char *)&cmd, "ssdiiiddi", 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, event_info->slot);
if (!packet) {
return WIDGET_ERROR_FAULT;
}
switch (state) {
case EVENT_STATE_ACTIVATE:
- script_handler_update_pointer(script, event_info->x * event_info->ratio_w, event_info->y * event_info->ratio_h, 1);
+ script_handler_update_pointer(script, event_info->slot, 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->ratio_w, event_info->y * event_info->ratio_h, -1);
+ script_handler_update_pointer(script, event_info->slot, 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->ratio_w, event_info->y * event_info->ratio_h, 0);
+ script_handler_update_pointer(script, event_info->slot, 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:
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Invalid parameter\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_IN, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OUT, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, 1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 0);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, 0);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_MOVE, timestamp);
ret = 0;
} else {
* It will calls event callbacks.
* And the event callbacks will try to access the "inst"
*/
- (void)event_deactivate(data, inst);
+ (void)event_deactivate(-1, data, inst);
/* Reset callback data to prevent accessing inst from event callback */
ret = event_reset_cbdata(data, inst, NULL);
struct inst_info *inst;
const struct pkg_info *pkg;
struct packet *result;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdi", &pkgname, &id, ×tamp, &keycode);
- if (ret != 4) {
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &keycode, &device);
+ if (ret != 5) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_activate(0, 0, 1.0f, 1.0f, key_event_gbar_route_cb, inst);
+ ret = event_activate(device, 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, 1.0f, 1.0f, key_event_gbar_consume_cb, inst);
+ ret = event_activate(device, 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);
struct inst_info *inst;
const struct pkg_info *pkg;
struct packet *result;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdi", &pkgname, &id, ×tamp, &keycode);
- if (ret != 4) {
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &keycode, &device);
+ if (ret != 5) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_deactivate(key_event_gbar_route_cb, inst);
+ ret = event_deactivate(device, key_event_gbar_route_cb, inst);
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_OFF);
}
}
*/
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
- ret = event_deactivate(key_event_gbar_consume_cb, inst);
+ ret = event_deactivate(device, key_event_gbar_consume_cb, inst);
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_OFF);
}
struct inst_info *inst;
const struct pkg_info *pkg;
struct packet *result;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdi", &pkgname, &id, ×tamp, &keycode);
- if (ret != 4) {
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &keycode, &device);
+ if (ret != 5) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_activate(0, 0, 1.0f, 1.0f, key_event_widget_route_cb, inst);
+ ret = event_activate(device, 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, 1.0f, 1.0f, key_event_widget_consume_cb, inst);
+ ret = event_activate(device, 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);
struct inst_info *inst;
const struct pkg_info *pkg;
struct packet *result;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdi", &pkgname, &id, ×tamp, &keycode);
- if (ret != 4) {
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &keycode, &device);
+ if (ret != 5) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
- ret = event_deactivate(key_event_widget_route_cb, inst);
+ ret = event_deactivate(device, key_event_widget_route_cb, inst);
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_OFF);
}
}
*/
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
- ret = event_deactivate(key_event_widget_consume_cb, inst);
+ ret = event_deactivate(device, key_event_widget_consume_cb, inst);
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_OFF);
}
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
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, ratio_w, ratio_h, mouse_event_widget_route_cb, inst);
+ ret = event_activate(device, 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, ratio_w, ratio_h, mouse_event_widget_consume_cb, inst);
+ ret = event_activate(device, 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 source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
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, ratio_w, ratio_h, timestamp);
+ event_set_mouse_xy(device, x, y, ratio_w, ratio_h, timestamp);
- ret = event_deactivate(mouse_event_widget_route_cb, inst);
+ ret = event_deactivate(device, mouse_event_widget_route_cb, inst);
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_OFF);
}
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, ratio_w, ratio_h, timestamp);
+ event_set_mouse_xy(device, x, y, ratio_w, ratio_h, timestamp);
- ret = event_deactivate(mouse_event_widget_consume_cb, inst);
+ ret = event_deactivate(device, mouse_event_widget_consume_cb, inst);
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_OFF);
}
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
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, ratio_w, ratio_h, mouse_event_gbar_route_cb, inst);
+ ret = event_activate(device, 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, ratio_w, ratio_h, mouse_event_gbar_consume_cb, inst);
+ ret = event_activate(device, 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);
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_SCROLL, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_SCROLL, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_HOLD, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_HOLD, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_SCROLL, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_SCROLL, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_ON_HOLD, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OFF_HOLD, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
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, ratio_w, ratio_h, timestamp);
+ event_set_mouse_xy(device, x, y, ratio_w, ratio_h, timestamp);
- ret = event_deactivate(mouse_event_gbar_route_cb, inst);
+ ret = event_deactivate(device, mouse_event_gbar_route_cb, inst);
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_OFF);
}
}
} else if (package_gbar_type(pkg) == GBAR_TYPE_SCRIPT) {
/* Forcely update the X,Y position using viewer's */
- event_set_mouse_xy(x, y, ratio_w, ratio_h, timestamp);
+ event_set_mouse_xy(device, x, y, ratio_w, ratio_h, timestamp);
- ret = event_deactivate(mouse_event_gbar_consume_cb, inst);
+ ret = event_deactivate(device, mouse_event_gbar_consume_cb, inst);
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_OFF);
}
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_IN, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, -1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, -1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_OUT, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 1);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, 1);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_DOWN, timestamp);
ret = 0;
} else {
int source;
double ratio_w;
double ratio_h;
+ int device;
client = client_find_by_rpc_handle(handle);
if (!client) {
goto out;
}
- ret = packet_get(packet, "ssdiiidd", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h);
- if (ret != 8) {
+ ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, ×tamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+ if (ret != 9) {
ErrPrint("Parameter is not matched\n");
ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
goto out;
}
- script_handler_update_pointer(script, x * ratio_w, y * ratio_h, 0);
+ script_handler_update_pointer(script, device, x * ratio_w, y * ratio_h, 0);
script_handler_feed_event(script, WIDGET_SCRIPT_MOUSE_UP, timestamp);
ret = 0;
} else {
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_ACTION, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_SCROLL, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_VALUE_CHANGE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_MOUSE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_BACK, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_OVER, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_READ, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
type = (event.type == 0) ? WIDGET_SCRIPT_ACCESS_DISABLE : WIDGET_SCRIPT_ACCESS_ENABLE;
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, type, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, type, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_ACTIVATE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, type, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_ACTION, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_SCROLL, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_VALUE_CHANGE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_MOUSE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_BACK, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_OVER, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_READ, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
type = (event.type == 0) ? WIDGET_SCRIPT_ACCESS_DISABLE : WIDGET_SCRIPT_ACCESS_ENABLE;
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, type, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
goto out;
}
- script_handler_update_pointer(script, event.x, event.y, event.type);
+ script_handler_update_pointer(script, 0, event.x, event.y, event.type);
ret = script_handler_feed_event(script, WIDGET_SCRIPT_ACCESS_ACTIVATE, timestamp);
if (ret >= 0) {
ret = send_delayed_access_status(inst, ret);
instance_slave_set_gbar_pos(inst, x, y);
ix = x * instance_gbar_width(inst);
iy = y * instance_gbar_height(inst);
- script_handler_update_pointer(instance_gbar_script(inst), ix, iy, 0);
+ script_handler_update_pointer(instance_gbar_script(inst), 0, ix, iy, 0);
ret = instance_signal_emit(inst, "pd,move", instance_id(inst), 0.0, 0.0, 0.0, 0.0, x, y, 0);
} else {
ErrPrint("Invalid GBAR type\n");
ix = x * instance_gbar_width(inst);
iy = y * instance_gbar_height(inst);
- script_handler_update_pointer(instance_gbar_script(inst), ix, iy, 0);
+ script_handler_update_pointer(instance_gbar_script(inst), 0, ix, iy, 0);
ret = instance_slave_open_gbar(inst, client);
if (ret == (int)WIDGET_ERROR_NONE) {
handle = item->handle;
- if (dead_callback_del(handle, delete_ctx_cb) != item) {
+ if (dead_callback_del(handle, delete_ctx_cb, item) != item) {
ErrPrint("Dead callback is not valid\n");
}
return NULL;
}
- if (is_valid_service_requestor(pid, widget_id)) {
+ if (is_valid_service_requestor(pid, widget_id) == 0) {
ErrPrint("Invalid service requestor: %d %s\n", pid, widget_id);
- return NULL;
+ result = packet_create_reply(packet, "is", WIDGET_ERROR_PERMISSION_DENIED, "?");
+ return result;
}
inst = package_find_instance_by_id(widget_id, inst_id);
if (is_valid_service_requestor(pid, widget_id) == 0) {
ErrPrint("Invalid requestor: %d %s\n", pid, widget_id);
- return NULL;
+ result = packet_create_reply(packet, "iis", WIDGET_ERROR_PERMISSION_DENIED, 0, NULL);
+ return result;
}
pkg = package_find(widget_id);
static struct packet *widget_mgr_slave_ctrl(pid_t pid, int handle, const struct packet *packet)
{
+ char *pkgname;
+ char *id;
+ int cmd;
+ int value;
+ int packet_cmd;
+ struct widget_mgr *mgr;
+ struct inst_info *inst;
+ struct pkg_info *info;
+ struct packet *ctrl_packet;
+
+ if (packet_get(packet, "ssii", &pkgname, &id, &cmd, &value) != 4) {
+ ErrPrint("Invalid argument\n");
+ goto out;
+ }
+
+ mgr = widget_mgr_find_by_pid(pid);
+ if (!mgr) {
+ ErrPrint("Invalid request\n");
+ goto out;
+ }
+
+ switch (cmd) {
+ case WIDGET_CTRL_MODE_DUMP_FRAME:
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance not found: %s\n", id);
+ goto out;
+ }
+
+ info = instance_package(inst);
+ if (!info) {
+ ErrPrint("Unable to get pkginfo\n");
+ goto out;
+ }
+
+ packet_cmd = CMD_CTRL_MODE;
+ ctrl_packet = packet_create_noack((const char *)&packet_cmd, "ssii", pkgname, id, cmd, value);
+ if (ctrl_packet) {
+ if (slave_rpc_request_only(package_slave(info), package_name(info), ctrl_packet, 0) < 0) {
+ ErrPrint("Failed to send request\n");
+ }
+ }
+
+ DbgPrint("Dump frames: %d\n", value);
+ break;
+ default:
+ ErrPrint("Unknown command\n");
+ break;
+ }
+
+out:
return NULL;
}