int nodisplay;
int mouse_event; /* Mouse event processing option for livebox */
+ int default_touch_effect;
+ int default_need_frame;
+
enum lb_type lb_type;
xmlChar *lb_src;
xmlChar *lb_group;
int size_list; /* 1x1, 2x1, 2x2, 4x1, 4x2, 4x3, 4x4 */
- xmlChar *preview[11];
- int touch_effect[11]; /* Touch effect of a livebox */
- int need_frame[11]; /* Box needs frame which should be cared by viewer */
+ xmlChar *preview[NR_OF_SIZE_LIST];
+ int touch_effect[NR_OF_SIZE_LIST]; /* Touch effect of a livebox */
+ int need_frame[NR_OF_SIZE_LIST]; /* Box needs frame which should be cared by viewer */
enum pd_type pd_type;
xmlChar *pd_src;
xmlFree(livebox->preview[4]); /* 4x2 */
xmlFree(livebox->preview[5]); /* 4x3 */
xmlFree(livebox->preview[6]); /* 4x4 */
- xmlFree(livebox->preview[7]); /* 21x21 */
- xmlFree(livebox->preview[8]); /* 23x21 */
- xmlFree(livebox->preview[9]); /* 23x23 */
- xmlFree(livebox->preview[10]); /* 0x0 */
+ xmlFree(livebox->preview[7]); /* 4x5 */
+ xmlFree(livebox->preview[8]); /* 4x6 */
+ xmlFree(livebox->preview[9]); /* easy 1x1 */
+ xmlFree(livebox->preview[10]); /* easy 3x1 */
+ xmlFree(livebox->preview[11]); /* easy 3x3 */
+ xmlFree(livebox->preview[12]); /* full */
dlist_foreach_safe(livebox->i18n_list, l, n, i18n) {
livebox->i18n_list = dlist_remove(livebox->i18n_list, l);
livebox->need_frame[idx] = !xmlStrcasecmp(need_frame, (const xmlChar *)"true");
xmlFree(need_frame);
} else {
- livebox->need_frame[idx] = 0;
+ livebox->need_frame[idx] = livebox->default_need_frame;
}
} else {
- livebox->need_frame[idx] = 0;
+ livebox->need_frame[idx] = livebox->default_need_frame;
}
if (xmlHasProp(node, (const xmlChar *)"touch_effect")) {
livebox->touch_effect[idx] = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
xmlFree(touch_effect);
} else {
- livebox->touch_effect[idx] = 1;
+ livebox->touch_effect[idx] = livebox->default_touch_effect;
}
} else {
- livebox->touch_effect[idx] = 1;
+ livebox->touch_effect[idx] = livebox->default_touch_effect;
}
}
}
}
+ if (!xmlHasProp(node, (const xmlChar *)"touch_effect")) {
+ livebox->default_touch_effect = 1;
+ } else {
+ xmlChar *touch_effect;
+
+ touch_effect = xmlGetProp(node, (const xmlChar *)"touch_effect");
+ if (!touch_effect) {
+ ErrPrint("default touch_effect is NIL\n");
+ livebox->default_touch_effect = 1;
+ } else {
+ livebox->default_touch_effect = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
+ xmlFree(touch_effect);
+ }
+ }
+
+ if (!xmlHasProp(node, (const xmlChar *)"need_frame")) {
+ livebox->default_need_frame = 0;
+ } else {
+ xmlChar *need_frame;
+
+ need_frame = xmlGetProp(node, (const xmlChar *)"need_frame");
+ if (!need_frame) {
+ ErrPrint("default need_frame is NIL\n");
+ livebox->default_need_frame = 0;
+ } else {
+ livebox->default_need_frame = !xmlStrcasecmp(need_frame, (const xmlChar *)"true");
+ xmlFree(need_frame);
+ }
+ }
+
for (node = node->children; node; node = node->next) {
if (!xmlStrcasecmp(node->name, (const xmlChar *)"size")) {
xmlChar *size;
if (!xmlStrcasecmp(size, (const xmlChar *)"1x1")) {
if (is_easy) {
livebox->size_list |= LB_SIZE_TYPE_EASY_1x1;
- update_size_info(livebox, 7, node);
+ update_size_info(livebox, 9, node);
} else {
livebox->size_list |= LB_SIZE_TYPE_1x1;
update_size_info(livebox, 0, node);
} else if (!xmlStrcasecmp(size, (const xmlChar *)"3x1")) {
if (is_easy) {
livebox->size_list |= LB_SIZE_TYPE_EASY_3x1;
- update_size_info(livebox, 8, node);
+ update_size_info(livebox, 10, node);
} else {
ErrPrint("Invalid size tag (%s)\n", size);
}
} else if (!xmlStrcasecmp(size, (const xmlChar *)"3x3")) {
if (is_easy) {
livebox->size_list |= LB_SIZE_TYPE_EASY_3x3;
- update_size_info(livebox, 9, node);
+ update_size_info(livebox, 11, node);
} else {
ErrPrint("Invalid size tag (%s)\n", size);
}
} else if (!xmlStrcasecmp(size, (const xmlChar *)"4x4")) {
livebox->size_list |= LB_SIZE_TYPE_4x4;
update_size_info(livebox, 6, node);
+ } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x5")) {
+ livebox->size_list |= LB_SIZE_TYPE_4x5;
+ update_size_info(livebox, 7, node);
+ } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x6")) {
+ livebox->size_list |= LB_SIZE_TYPE_4x6;
+ update_size_info(livebox, 8, node);
} else if (!xmlStrcasecmp(size, (const xmlChar *)"21x21")) {
livebox->size_list |= LB_SIZE_TYPE_EASY_1x1;
- update_size_info(livebox, 7, node);
+ update_size_info(livebox, 9, node);
} else if (!xmlStrcasecmp(size, (const xmlChar *)"23x21")) {
livebox->size_list |= LB_SIZE_TYPE_EASY_3x1;
- update_size_info(livebox, 8, node);
+ update_size_info(livebox, 10, node);
} else if (!xmlStrcasecmp(size, (const xmlChar *)"23x23")) {
livebox->size_list |= LB_SIZE_TYPE_EASY_3x3;
- update_size_info(livebox, 9, node);
+ update_size_info(livebox, 11, node);
} else if (!xmlStrcasecmp(size, (const xmlChar *)"0x0")) {
livebox->size_list |= LB_SIZE_TYPE_0x0;
- update_size_info(livebox, 10, node);
+ update_size_info(livebox, 12, node);
} else {
ErrPrint("Invalid size tag (%s)\n", size);
}
goto errout;
}
+ if (livebox->size_list & LB_SIZE_TYPE_4x5) {
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x5, (char *)livebox->preview[7], livebox->touch_effect[7], livebox->need_frame[7]);
+ if (ret < 0)
+ goto errout;
+ }
+
+ if (livebox->size_list & LB_SIZE_TYPE_4x6) {
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x6, (char *)livebox->preview[8], livebox->touch_effect[8], livebox->need_frame[8]);
+ if (ret < 0)
+ goto errout;
+ }
+
if (livebox->size_list & LB_SIZE_TYPE_EASY_1x1) {
- ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_1x1, (char *)livebox->preview[7], livebox->touch_effect[7], livebox->need_frame[7]);
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_1x1, (char *)livebox->preview[9], livebox->touch_effect[9], livebox->need_frame[9]);
if (ret < 0)
goto errout;
}
if (livebox->size_list & LB_SIZE_TYPE_EASY_3x1) {
- ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x1, (char *)livebox->preview[8], livebox->touch_effect[8], livebox->need_frame[8]);
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x1, (char *)livebox->preview[10], livebox->touch_effect[10], livebox->need_frame[10]);
if (ret < 0)
goto errout;
}
if (livebox->size_list & LB_SIZE_TYPE_EASY_3x3) {
- ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x3, (char *)livebox->preview[9], livebox->touch_effect[9], livebox->need_frame[9]);
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x3, (char *)livebox->preview[11], livebox->touch_effect[11], livebox->need_frame[11]);
if (ret < 0)
goto errout;
}
if (livebox->size_list & LB_SIZE_TYPE_0x0) {
- ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_0x0, (char *)livebox->preview[10], livebox->touch_effect[10], livebox->need_frame[10]);
+ ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_0x0, (char *)livebox->preview[12], livebox->touch_effect[12], livebox->need_frame[12]);
if (ret < 0)
goto errout;
}
return result;
}
-static struct packet *client_pd_access_scroll(pid_t pid, int handle, const struct packet *packet)
+static struct packet *client_pd_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ int x;
+ int 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 = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid parameter\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ 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 = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ 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 = LB_STATUS_ERROR_FAULT;
+ } 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 = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = LB_STATUS_ERROR_INVALID;
+ 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 = LB_STATUS_ERROR_FAULT;
+ 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 = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
+static struct packet *client_pd_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
struct client_node *client;
return result;
}
+static struct packet *client_pd_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ int x;
+ int 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 = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid parameter\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ 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 = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ 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 = LB_STATUS_ERROR_FAULT;
+ } 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 = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = LB_STATUS_ERROR_INVALID;
+ 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 = LB_STATUS_ERROR_FAULT;
+ 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 = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 0);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
static struct packet *client_pd_access_unhighlight(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
return result;
}
-static struct packet *client_lb_access_scroll(pid_t pid, int handle, const struct packet *packet)
+static struct packet *client_lb_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+ int x;
+ int y;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exist\n", pid);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Parameter is not matched\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ ret = LB_STATUS_ERROR_FAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Slave is not exists\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ /*!
+ * Enen if it fails to send packet,
+ * The packet will be unref'd
+ * So we don't need to check the ret value.
+ */
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ErrPrint("Instance has no script\n");
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ErrPrint("Instance has no evas\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
+static struct packet *client_lb_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
struct client_node *client;
return result;
}
+static struct packet *client_lb_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+ int x;
+ int y;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exist\n", pid);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Parameter is not matched\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ ret = LB_STATUS_ERROR_FAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Slave is not exists\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ /*!
+ * Enen if it fails to send packet,
+ * The packet will be unref'd
+ * So we don't need to check the ret value.
+ */
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ErrPrint("Instance has no script\n");
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ErrPrint("Instance has no evas\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 0);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
static struct packet *client_lb_access_activate(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
.handler = client_pd_access_value_change,
},
{
- .cmd = "pd_access_scroll",
- .handler = client_pd_access_scroll,
- },
- {
.cmd = "pd_access_unhighlight",
.handler = client_pd_access_unhighlight,
},
+ {
+ .cmd = "pd_access_scroll_down",
+ .handler = client_pd_access_scroll_down,
+ },
+ {
+ .cmd = "pd_access_scroll_move",
+ .handler = client_pd_access_scroll_move,
+ },
+ {
+ .cmd = "pd_access_scroll_up",
+ .handler = client_pd_access_scroll_up,
+ },
{
.cmd = "lb_access_hl",
.handler = client_lb_access_value_change,
},
{
- .cmd = "lb_access_scroll",
- .handler = client_lb_access_scroll,
- },
- {
.cmd = "lb_access_unhighlight",
.handler = client_lb_access_unhighlight,
},
+ {
+ .cmd = "lb_access_scroll_down",
+ .handler = client_lb_access_scroll_down,
+ },
+ {
+ .cmd = "lb_access_scroll_move",
+ .handler = client_lb_access_scroll_move,
+ },
+ {
+ .cmd = "lb_access_scroll_up",
+ .handler = client_lb_access_scroll_up,
+ },
{
.cmd = "lb_key_down",