if (pd_type == PD_TYPE_SCRIPT && inst->pd.canvas.script && inst->pd.is_opened_for_reactivate) {
double x, y;
-
- instance_slave_get_pd_pos(inst, &x, &y);
-
/*!
* \note
* We should to send a request to open a PD to slave.
* To do that, send open request from here.
*/
ret = instance_slave_open_pd(inst, NULL);
+ instance_slave_get_pd_pos(inst, &x, &y);
/*!
* \note
{
int ret;
+ ret = script_handler_unload(instance_pd_script(inst), 1);
+ DbgPrint("Unload script: %d\n", ret);
+
ret = instance_slave_close_pd(inst, client);
DbgPrint("Forcely close the PD ret: %d\n", ret);
- ret = script_handler_unload(instance_pd_script(inst), 1);
return -1; /* Delete this callback */
}
return -EFAULT;
}
+ DbgPrint("Signal emit: %s(%s), %s(%s), %lf, %lf, %lf, %lf, %lfx%lf, %d\n", pkgname, id, signal, part, sx, sy, ex, ey, x, y, down);
ret = slave_rpc_request_only(slave, pkgname, packet, 0);
return ret;
}
}
inst->pd.owner = client;
+ DbgPrint("pd,show event is sent\n");
return ret;
}
break;
}
- inst->pd.need_to_send_close_event = 1;
+ inst->pd.need_to_send_close_event = (status == 0);
packet = packet_create_noack("pd_created", "sssiii",
package_name(inst->info), inst->id, buf_id,
ret = CLIENT_SEND_EVENT(inst, packet);
- if (inst->pd.pended_update_cnt) {
+ if (inst->pd.need_to_send_close_event && inst->pd.pended_update_cnt) {
DbgPrint("Apply pended desc(%d) - %s\n", inst->pd.pended_update_cnt, inst->pd.pended_update_desc);
instance_pd_updated_by_instance(inst, inst->pd.pended_update_desc);
inst->pd.pended_update_cnt = 0;
return -EFAULT;
}
info->loaded = 1;
+ script_signal_emit(e, util_uri_to_path(instance_id(info->inst)),
+ is_pd ? "pd,show" : "lb,show", 0.0f, 0.0f, 0.0f, 0.0f);
} else {
ErrPrint("Evas: (nil) %dx%d\n", info->w, info->h);
}
ecore_evas_activate(info->ee);
fb_sync(info->fb);
- if (e)
- script_signal_emit(e, util_uri_to_path(instance_id(info->inst)),
- is_pd ? "pd,show" : "lb,show", 0.0f, 0.0f, 0.0f, 0.0f);
return 0;
}
e = script_handler_evas(info);
if (e) {
- script_signal_emit(e, util_uri_to_path(instance_id(info->inst)), is_pd ? "pd,hide" : "lb,hide", 0.0f, 0.0f, 0.0f, 0.0f);
+ script_signal_emit(e, util_uri_to_path(instance_id(info->inst)),
+ is_pd ? "pd,hide" : "lb,hide", 0.0f, 0.0f, 0.0f, 0.0f);
if (info->port->unload(info->port_data, e) < 0)
ErrPrint("Failed to unload script object. but go ahead\n");
evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, render_post_cb);
goto out;
}
+ DbgPrint("(%dx%d) - (%lfx%lf)\n", w, h, x, y);
+
/*!
* \NOTE:
* Trust the package name which are sent by the client.
goto out;
}
+ DbgPrint("(%dx%d) - (%lfx%lf)\n", w, h, x, y);
/*!
* \NOTE:
* Trust the package name which are sent by the client.
goto out;
}
+ DbgPrint("(%dx%d) - (%lfx%lf)\n", w, h, x, y);
/*!
* \NOTE:
* Trust the package name which are sent by the client.
return ECORE_CALLBACK_CANCEL;
}
+static struct packet *client_pd_move(pid_t pid, int handle, const struct packet *packet) /* pkgname, id, x, y */
+{
+ struct client_node *client;
+ struct inst_info *inst;
+ const char *pkgname;
+ const char *id;
+ double x = 0.0f;
+ double y = 0.0f;
+ int ret;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = -ENOENT;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdd", &pkgname, &id, &x, &y);
+ if (ret != 4) {
+ ErrPrint("Parameter is not correct\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ DbgPrint("pid[%d] pkgname[%s] id[%s] %lfx%lf\n", pid, pkgname, id, x, y);
+
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst)
+ ret = -ENOENT;
+ else if (package_is_fault(instance_package(inst)))
+ ret = -EFAULT;
+ else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
+ instance_slave_set_pd_pos(inst, x, y);
+ ret = instance_signal_emit(inst,
+ "pd,move", util_uri_to_path(instance_id(inst)),
+ 0.0, 0.0, 0.0, 0.0, x, y, 0);
+ } else if (package_pd_type(instance_package(inst)) == PD_TYPE_SCRIPT) {
+ instance_slave_set_pd_pos(inst, x, y);
+ script_handler_update_pointer(instance_pd_script(inst), x, y, 0);
+ ret = instance_signal_emit(inst,
+ "pd,move", util_uri_to_path(instance_id(inst)),
+ 0.0, 0.0, 0.0, 0.0, x, y, 0);
+ } else {
+ ErrPrint("Invalid PD type\n");
+ ret = -EINVAL;
+ }
+out:
+ DbgPrint("Update PD position: %lfx%lf (%d)\n", x, y, ret);
+ return NULL;
+}
+
static struct packet *client_create_pd(pid_t pid, int handle, const struct packet *packet) /* pid, pkgname, filename, ret */
{
struct client_node *client;
* so we can hanle it later.
*/
instance_slave_set_pd_pos(inst, x, y);
- ret = instance_slave_open_pd(inst, client);
script_handler_update_pointer(instance_pd_script(inst), x, y, 0);
+ ret = instance_slave_open_pd(inst, client);
ret = script_handler_load(instance_pd_script(inst), 1);
/*!
inst = instance_ref(inst); /* To guarantee the inst */
if (!ecore_timer_add(DELAY_TIME, lazy_pd_created_cb, inst))
instance_unref(inst);
+ } else {
+ instance_client_pd_created(inst, ret);
}
} else {
ErrPrint("Invalid PD TYPE\n");
else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
ret = instance_signal_emit(inst,
"pd,hide", util_uri_to_path(instance_id(inst)),
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
+ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
ret = instance_slave_close_pd(inst, client);
/*!
*/
} else if (package_pd_type(instance_package(inst)) == PD_TYPE_SCRIPT) {
- ret = instance_slave_close_pd(inst, client);
-
ret = script_handler_unload(instance_pd_script(inst), 1);
+ ret = instance_slave_close_pd(inst, client);
/*!
* \note
.handler = client_create_pd, /* pid, pkgname, filename, ret */
},
{
+ .cmd = "pd_move",
+ .handler = client_pd_move, /* pkgname, id, x, y */
+ },
+ {
.cmd = "destroy_pd",
.handler = client_destroy_pd, /* pid, pkgname, filename, ret */
},