} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
goto out;
}
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_in(e, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct packet *packet)
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_out(e, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, id, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, timestamp + 0.01f, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 0);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ evas_event_feed_mouse_up(e, 1, EVAS_BUTTON_NONE, timestamp + 0.1f, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * Reuse the packet.
+ packet = packet_create_noack("pd_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("lb_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("lb_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_in(e, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ evas_event_feed_mouse_out(e, timestamp, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("lb_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, timestamp + 0.01f, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Parameter is not matched\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ //struct packet *packet;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("lb_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 0);
+ evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+ evas_event_feed_mouse_up(e, 1, EVAS_BUTTON_NONE, timestamp + 0.1f, NULL);
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_access_read(pid_t pid, int handle, const struct packet *packet)
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Invalid parameter\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ /*!
+ * \TODO: Push up the ACCESS_READ event
+ */
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const struct packet *packet)
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Invalid parameter\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, -1);
+ /*!
+ * \TODO: Push up the ACCESS_READ_PREV event
+ */
+ ret = 0;
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = -EINVAL;
+ }
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_pd_access_read_next(pid_t pid, int handle, const struct packet *packet)
+{
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ int w;
+ int h;
+ double timestamp;
+ double x;
+ double y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
+ if (ret != 7) {
+ ErrPrint("Invalid parameter\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = -EFAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = -EFAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /*
packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_in(e, timestamp, NULL);
+ /*!
+ * \TODO: Push up the ACCESS_READ_NEXT event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct packet *packet)
+static struct packet *client_pd_access_activate(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
if (ret != 7) {
- ErrPrint("Parameter is not matched\n");
+ ErrPrint("Invalid parameter\n");
ret = -EINVAL;
goto out;
}
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("pd_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_out(e, timestamp, NULL);
+ /*!
+ * \TODO: Push up the ACCESS_READ_ACTIVATE event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, id, width, height, timestamp, x, y, ret */
+static struct packet *client_pd_key_down(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
if (ret != 7) {
- ErrPrint("Parameter is not matched\n");
+ ErrPrint("Invalid parameter\n");
ret = -EINVAL;
goto out;
}
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("pd_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
goto out;
}
- script_handler_update_pointer(script, x, y, 1);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
- evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, timestamp + 0.01f, NULL);
+ script_handler_update_pointer(script, x, y, -1);
+ /*!
+ * \TODO: Push up the KEY_DOWN event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
ret = packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, ×tamp, &x, &y);
if (ret != 7) {
- ErrPrint("Parameter is not matched\n");
+ ErrPrint("Invalid parameter\n");
ret = -EINVAL;
goto out;
}
pkg = instance_package(inst);
if (!pkg) {
- ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ErrPrint("Package[%s] info is not found\n", pkgname);
ret = -EFAULT;
goto out;
}
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("pd_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
goto out;
}
- script_handler_update_pointer(script, x, y, 0);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
- evas_event_feed_mouse_up(e, 1, EVAS_BUTTON_NONE, timestamp + 0.1f, NULL);
+ script_handler_update_pointer(script, x, y, -1);
+ /*!
+ * \TODO: Push up the KEY_UP event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_access_read(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
*/
DbgPrint("Package[%s] is faulted\n", pkgname);
ret = -EFAULT;
- } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
//struct packet *packet;
- buffer = instance_pd_buffer(inst);
+ buffer = instance_lb_buffer(inst);
if (!buffer) {
ErrPrint("Instance[%s] has no buffer\n", id);
ret = -EFAULT;
goto out;
}
- /*!
- * Reuse the packet.
- packet = packet_create_noack("pd_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
- */
+ */
+
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
- } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
- script = instance_pd_script(inst);
+ script = instance_lb_script(inst);
if (!script) {
ret = -EFAULT;
goto out;
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+
+ /*!
+ * \TODO: Feed up this ACCESS_READ event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
}
/*
- packet = packet_create_noack("lb_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
*/
+
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
+
+ /*!
+ * \TODO: Feed up this ACCESS_READ_PREV event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_access_read_next(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("lb_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_in(e, timestamp, NULL);
+
+ /*!
+ * \TODO: Feed up this ACCESS_READ_NEXT event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_access_activate(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
goto out;
}
+ /*
packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
}
script_handler_update_pointer(script, x, y, -1);
- evas_event_feed_mouse_out(e, timestamp, NULL);
+
+ /*!
+ * \TODO: Feed up this ACCESS_ACTIVATE event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_key_down(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("lb_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
goto out;
}
- script_handler_update_pointer(script, x, y, 1);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
- evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, timestamp + 0.01f, NULL);
+ script_handler_update_pointer(script, x, y, -1);
+
+ /*!
+ * \TODO: Feed up this KEY_DOWN event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
return NULL;
}
-static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, width, height, timestamp, x, y, ret */
+static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packet *packet)
{
struct client_node *client;
const char *pkgname;
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- struct packet *packet;
+ //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
goto out;
}
- packet = packet_create_noack("lb_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ /*
+ packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to create a packet[%s]\n", pkgname);
ret = -EFAULT;
goto out;
}
+ */
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
Evas *e;
goto out;
}
- script_handler_update_pointer(script, x, y, 0);
- evas_event_feed_mouse_move(e, x * w, y * h, timestamp, NULL);
- evas_event_feed_mouse_up(e, 1, EVAS_BUTTON_NONE, timestamp + 0.1f, NULL);
+ script_handler_update_pointer(script, x, y, -1);
+
+ /*!
+ * \TODO: Feed up this KEY_UP event
+ */
ret = 0;
} else {
ErrPrint("Unsupported package\n");
if (!fp)
goto out;
- fprintf(fp, "----------------------------------------------------------------------[Slave List]------------------------------------------------------------------------------\n");
- fprintf(fp, " pid slave name package name abi secured refcnt fault state inst pkg ttl \n");
- fprintf(fp, "----------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
list = (Eina_List *)slave_list();
EINA_LIST_FOREACH(list, l, slave) {
fprintf(fp, " %7d %20s %39s %7s %7s %6d %5d %21s %4d %3d %3.4lf \n",
slave_ttl(slave)
);
}
+ fprintf(fp, "EOD\n");
liveinfo_close_fifo(info);
out:
if (package_slave(pkg) == slave)
fprintf(fp, "%s, ", package_name(pkg));
}
- fprintf(fp, "}\n");
+ fprintf(fp, "}\nEOD\n");
liveinfo_close_fifo(info);
goto out;
}
- fprintf(fp, "-----------------------------------------------[Instance List]---------------------------------------\n");
- fprintf(fp, " ID | Cluster ID | Sub cluster ID | Period | Visibility | Width | Height \n");
- fprintf(fp, "-----------------------------------------------------------------------------------------------------\n");
-
inst_list = package_instance_list(pkg);
EINA_LIST_FOREACH(inst_list, l, inst) {
fprintf(fp, " %18s %18s %18s %3.3lf %10s %5d %6d\n",
instance_lb_height(inst));
}
+ fprintf(fp, "EOD\n");
liveinfo_close_fifo(info);
out:
if (!fp)
goto out;
- fprintf(fp, "+----------------------------------------------[Package List]------------------------------------------------+\n");
- fprintf(fp, " pid slave name package name abi refcnt fault inst \n");
- fprintf(fp, "+------------------------------------------------------------------------------------------------------------+\n");
list = (Eina_List *)package_list();
EINA_LIST_FOREACH(list, l, pkg) {
slave = package_slave(pkg);
eina_list_count(inst_list)
);
}
+ fprintf(fp, "EOD\n");
liveinfo_close_fifo(info);
out:
return NULL;
}
+static struct packet *liveinfo_toggle_debug(pid_t pid, int handle, const struct packet *packet)
+{
+ double timestamp;
+ struct liveinfo *info;
+ FILE *fp;
+
+ if (packet_get(packet, "d", ×tamp) != 1) {
+ ErrPrint("Invalid argument\n");
+ goto out;
+ }
+
+ info = liveinfo_find_by_pid(pid);
+ if (!info) {
+ ErrPrint("Invalid request\n");
+ goto out;
+ }
+
+ liveinfo_open_fifo(info);
+ fp = liveinfo_fifo(info);
+ if (!fp)
+ goto out;
+
+ g_conf.debug_mode = !g_conf.debug_mode;
+ fprintf(fp, "Debug mode is %s\nEOD\n", g_conf.debug_mode ? "enabled" : "disabled");
+ liveinfo_close_fifo(info);
+
+out:
+ return NULL;
+}
+
static struct method s_info_table[] = {
{
.cmd = "liveinfo_hello",
.handler = liveinfo_pkg_ctrl,
},
{
+ .cmd = "toggle_debug",
+ .handler = liveinfo_toggle_debug,
+ },
+ {
.cmd = NULL,
.handler = NULL,
},
.cmd = "refresh_group",
.handler = client_refresh_group,
},
+
+ {
+ .cmd = "pd_access_read",
+ .handler = client_pd_access_read,
+ },
+ {
+ .cmd = "pd_access_read_prev",
+ .handler = client_pd_access_read_prev,
+ },
+ {
+ .cmd = "pd_access_read_next",
+ .handler = client_pd_access_read_next,
+ },
+ {
+ .cmd = "pd_access_activate",
+ .handler = client_pd_access_activate,
+ },
+
+ {
+ .cmd = "lb_access_read",
+ .handler = client_lb_access_read,
+ },
+ {
+ .cmd = "lb_access_read_prev",
+ .handler = client_lb_access_read_prev,
+ },
+ {
+ .cmd = "lb_access_read_next",
+ .handler = client_lb_access_read_next,
+ },
+ {
+ .cmd = "lb_access_activate",
+ .handler = client_lb_access_activate,
+ },
+
+ {
+ .cmd = "lb_key_down",
+ .handler = client_lb_key_down,
+ },
+ {
+ .cmd = "lb_key_up",
+ .handler = client_lb_key_up,
+ },
+
+ {
+ .cmd = "pd_key_down",
+ .handler = client_pd_key_down,
+ },
+ {
+ .cmd = "pd_key_up",
+ .handler = client_pd_key_up,
+ },
+
{
.cmd = NULL,
.handler = NULL,