char *title;
int is_pinned_up;
double sleep_at;
- int scroll_locked;
+ int scroll_locked; /*!< Scroller which is in viewer is locked. */
+ int active_update; /*!< Viewer will reload the buffer by itself, so the provider doesn't need to send the updated event */
enum livebox_visible_state visible;
break;
}
- packet = packet_create("renew", "sssiidssiis",
+ packet = packet_create("renew", "sssiidssiisii",
package_name(inst->info),
inst->id,
inst->content,
inst->cluster,
inst->category,
inst->lb.width, inst->lb.height,
- package_abi(inst->info));
+ package_abi(inst->info),
+ inst->scroll_locked,
+ inst->active_update);
if (!packet) {
ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
return LB_STATUS_ERROR_FAULT;
instance_pd_updated_by_instance(inst, descfile);
}
+HAPI int instance_set_update_mode(struct inst_info *inst, int active_update)
+{
+ int ret;
+ struct packet *packet;
+
+ if (package_is_fault(inst->info)) {
+ DbgPrint("Fault package [%s]\n", package_name(inst->info));
+ return LB_STATUS_ERROR_FAULT;
+ }
+
+ if (inst->active_update == active_update) {
+ DbgPrint("Active update is not changed: %d\n", inst->active_update);
+ return LB_STATUS_ERROR_ALREADY;
+ }
+
+ /* NOTE: param is resued from here */
+ packet = packet_create_noack("update_mode", "ssi", package_name(inst->info), inst->id, active_update);
+ if (!packet) {
+ ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
+ return LB_STATUS_ERROR_FAULT;
+ }
+
+ ret = slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
+
+ if (ret == LB_STATUS_SUCCESS)
+ inst->active_update = active_update;
+
+ return ret;
+}
+
+HAPI int instance_active_update(struct inst_info *inst)
+{
+ return inst->active_update;
+}
+
HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double priority, const char *content, const char *title)
{
char *_content = NULL;
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, "sssddd", &pkgname, &id, &event, ×tamp, &x, &y);
if (ret != 6) {
ErrPrint("Parameter is not matched\n");
- ret = LB_STATUS_ERROR_INVALID;
goto out;
}
*/
inst = package_find_instance_by_id(pkgname, id);
if (!inst)
- ret = LB_STATUS_ERROR_NOT_EXIST;
+ ErrPrint("Instance is not exists\n");
else if (package_is_fault(instance_package(inst)))
- ret = LB_STATUS_ERROR_FAULT;
+ ErrPrint("Fault package\n");
else
- ret = instance_clicked(inst, event, timestamp, x, y);
+ (void)instance_clicked(inst, event, timestamp, x, y);
+
+out:
+ /*! \note No reply packet */
+ return NULL;
+}
+
+static struct packet *client_update_mode(pid_t pid, int handle, const struct packet *packet)
+{
+ struct client_node *client;
+ int active_update;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ struct inst_info *inst;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssi", &pkgname, &id, &active_update);
+ if (ret != 3) {
+ ErrPrint("Invalid argument\n");
+ goto out;
+ }
+
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst)
+ ErrPrint("Instance is not exists\n");
+ else if (package_is_fault(instance_package(inst)))
+ ErrPrint("Fault package\n");
+ else
+ instance_set_update_mode(inst, active_update);
out:
/*! \note No reply packet */
client = client_find_by_pid(pid);
if (!client) {
- ErrPrint("Client %d is paused - manually reported\n", pid);
- ret = LB_STATUS_ERROR_NOT_EXIST;
+ ErrPrint("Client %d is not exists\n", pid);
goto out;
}
ret = packet_get(packet, "d", ×tamp);
if (ret != 1) {
ErrPrint("Invalid parameter\n");
- ret = LB_STATUS_ERROR_INVALID;
goto out;
}
},
{
+ .cmd = "update_mode",
+ .handler = client_update_mode,
+ },
+
+ {
.cmd = NULL,
.handler = NULL,
},