--- /dev/null
+// provider -> master
+// master -> client
+#define CMD_UPDATED 0x00000001
+#define CMD_LB_UPDATED 0x00000001 // same with UPDATED
+#define CMD_DESC_UPDATED 0x00000101
+#define CMD_PD_UPDATED 0x00000101 // same with DESC_UPDATED
+#define CMD_EXTRA_INFO 0x00000201
+#define CMD_DELETED 0x00000301
+#define CMD_FAULTED 0x00000401
+#define CMD_FAULT_PACKAGE 0x00000401
+#define CMD_SCROLL 0x00000501
+#define CMD_LB_UPDATE_BEGIN 0x00000601
+#define CMD_LB_UPDATE_END 0x00000701
+#define CMD_PD_UPDATE_BEGIN 0x00000801
+#define CMD_PD_UPDATE_END 0x00000901
+#define CMD_ACCESS_STATUS 0x00000A01
+#define CMD_KEY_STATUS 0x00000B01
+#define CMD_CLOSE_PD 0x00000C01
+
+// provider -> master
+// Upper list must be sync'd with client(viewer)'s result event table
+#define CMD_CALL 0x00000D01
+#define CMD_RET 0x00000E01
+#define CMD_ACQUIRE_BUFFER 0x00000F01
+#define CMD_RESIZE_BUFFER 0x00001001
+#define CMD_RELEASE_BUFFER 0x00001101
+#define CMD_HELLO 0x00001201
+#define CMD_PING 0x00001301
+#define CMD_CTRL 0x00001401
+
+// Following list is only for the viewer
+// master -> client
+#define CMD_PD_CREATED 0x00000D01
+#define CMD_PD_DESTROYED 0x00000E01
+#define CMD_CREATED 0x00000F01
+#define CMD_GROUP_CHANGED 0x00001001
+#define CMD_PERIOD_CHANGED 0x00001101
+#define CMD_SIZE_CHANGED 0x00001201
+#define CMD_RESULT_PINUP 0x00001301 // viewer
+#define CMD_RESULT_UPDATE_MODE 0x00001401 // viewer
+
+// Following list should be started after the common list of client_cmd_list
+// master -> provider
+#define CMD_PD_SHOW 0x00003701
+#define CMD_PD_HIDE 0x00003801
+#define CMD_LB_PAUSE 0x00003901
+#define CMD_LB_RESUME 0x00003A01
+#define CMD_SCRIPT 0x00003B01
+#define CMD_RENEW 0x00003C01
+#define CMD_PINUP 0x00003D01
+#define CMD_UPDATE_CONTENT 0x00003E01
+#define CMD_PAUSE 0x00003F01
+#define CMD_RESUME 0x00004001
+#define CMD_DISCONNECT 0x00004101
+
+// Live Info -> master
+#define CMD_INFO_HELLO 0x00000001
+#define CMD_INFO_SLAVE_LIST 0x00000101
+#define CMD_INFO_PKG_LIST 0x00000201
+#define CMD_INFO_INST_LIST 0x00000301
+#define CMD_INFO_SLAVE_CTRL 0x00000401
+#define CMD_INFO_PKG_CTRL 0x00000501
+#define CMD_INFO_MASTER_CTRL 0x00000601
+
+// client -> master
+// master -> provider
+#define CMD_PD_MOUSE_MOVE 0x00000001
+#define CMD_LB_MOUSE_MOVE 0x00000101
+#define CMD_PD_MOUSE_DOWN 0x00000201
+#define CMD_PD_MOUSE_UP 0x00000301
+#define CMD_LB_MOUSE_DOWN 0x00000401
+#define CMD_LB_MOUSE_UP 0x00000501
+#define CMD_PD_MOUSE_ENTER 0x00000601
+#define CMD_PD_MOUSE_LEAVE 0x00000701
+#define CMD_LB_MOUSE_ENTER 0x00000801
+#define CMD_LB_MOUSE_LEAVE 0x00000901
+#define CMD_LB_MOUSE_ON_SCROLL 0x00000A01
+#define CMD_LB_MOUSE_OFF_SCROLL 0x00000B01
+#define CMD_PD_MOUSE_ON_SCROLL 0x00000C01
+#define CMD_PD_MOUSE_OFF_SCROLL 0x00000D01
+#define CMD_LB_MOUSE_ON_HOLD 0x00000E01
+#define CMD_LB_MOUSE_OFF_HOLD 0x00000F01
+#define CMD_PD_MOUSE_ON_HOLD 0x00001001
+#define CMD_PD_MOUSE_OFF_HOLD 0x00001101
+#define CMD_CLICKED 0x00001201
+#define CMD_TEXT_SIGNAL 0x00001301
+#define CMD_DELETE 0x00001401
+#define CMD_RESIZE 0x00001501
+#define CMD_NEW 0x00001601
+#define CMD_SET_PERIOD 0x00001701
+#define CMD_CHANGE_GROUP 0x00001801
+#define CMD_PD_MOVE 0x00001901
+#define CMD_PD_ACCESS_HL 0x00001A01
+#define CMD_PD_ACCESS_ACTIVATE 0x00001B01
+#define CMD_PD_ACCESS_ACTION 0x00001C01
+#define CMD_PD_ACCESS_SCROLL 0x00001D01
+#define CMD_PD_ACCESS_VALUE_CHANGE 0x00001E01
+#define CMD_PD_ACCESS_MOUSE 0x00001F01
+#define CMD_PD_ACCESS_BACK 0x00002001
+#define CMD_PD_ACCESS_OVER 0x00002101
+#define CMD_PD_ACCESS_READ 0x00002201
+#define CMD_PD_ACCESS_ENABLE 0x00002301
+#define CMD_LB_ACCESS_HL 0x00002401
+#define CMD_LB_ACCESS_ACTIVATE 0x00002501
+#define CMD_LB_ACCESS_ACTION 0x00002601
+#define CMD_LB_ACCESS_SCROLL 0x00002701
+#define CMD_LB_ACCESS_VALUE_CHANGE 0x00002801
+#define CMD_LB_ACCESS_MOUSE 0x00002901
+#define CMD_LB_ACCESS_BACK 0x00002A01
+#define CMD_LB_ACCESS_OVER 0x00002B01
+#define CMD_LB_ACCESS_READ 0x00002C01
+#define CMD_LB_ACCESS_ENABLE 0x00002D01
+#define CMD_LB_KEY_DOWN 0x00002E01
+#define CMD_LB_KEY_UP 0x00002F01
+#define CMD_LB_KEY_FOCUS_IN 0x00003001
+#define CMD_LB_KEY_FOCUS_OUT 0x00003101
+#define CMD_PD_KEY_DOWN 0x00003201
+#define CMD_PD_KEY_UP 0x00003301
+#define CMD_PD_KEY_FOCUS_IN 0x00003401
+#define CMD_PD_KEY_FOCUS_OUT 0x00003501
+#define CMD_UPDATE_MODE 0x00003601
+
+// client -> master
+#define CMD_LB_MOUSE_SET 0x00003701
+#define CMD_LB_MOUSE_UNSET 0x00003801
+#define CMD_PD_MOUSE_SET 0x00003901
+#define CMD_PD_MOUSE_UNSET 0x00003A01
+#define CMD_CHANGE_VISIBILITY 0x00003B01
+#define CMD_LB_ACQUIRE_PIXMAP 0x00003C01
+#define CMD_LB_RELEASE_PIXMAP 0x00003D01
+#define CMD_PD_ACQUIRE_PIXMAP 0x00003E01
+#define CMD_PD_RELEASE_PIXMAP 0x00003F01
+#define CMD_ACQUIRE 0x00004001
+#define CMD_RELEASE 0x00004101
+#define CMD_PINUP_CHANGED 0x00004201
+#define CMD_CREATE_PD 0x00004301
+#define CMD_DESTROY_PD 0x00004401
+#define CMD_ACTIVATE_PACKAGE 0x00004501
+#define CMD_SUBSCRIBE 0x00004601
+#define CMD_UNSUBSCRIBE 0x00004701
+#define CMD_DELETE_CLUSTER 0x00004801
+#define CMD_DELETE_CATEGORY 0x00004901
+#define CMD_REFRESH_GROUP 0x00004A01
+#define CMD_UPDATE 0x00004B01
+#define CMD_LB_KEY_SET 0x00004C01
+#define CMD_LB_KEY_UNSET 0x00004D01
+#define CMD_PD_KEY_SET 0x00004E01
+#define CMD_PD_KEY_UNSET 0x00004F01
+#define CMD_CLIENT_PAUSED 0x00005001
+#define CMD_CLIENT_RESUMED 0x00005101
+
+// service -> master
+#define CMD_SERVICE_UPDATE 0x00000001
+#define CMD_SERVICE_CHANGE_PERIOD 0x00000101
+#define CMD_SERVICE_INST_CNT 0x00000201
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
+#include <sys/types.h>
#include <dlog.h>
#include <glib.h>
#include "conf.h"
#include "file_service.h"
#include "dlist.h"
+#include "provider_cmd_list.h"
int errno;
+#define MAX_DIRECT_ADDR 256
+
static struct info {
int fd;
+ int direct_fd;
guint timer_id;
char *client_addr;
+ char *direct_addr;
} s_info = {
.fd = -1,
+ .direct_fd = -1,
.timer_id = 0,
.client_addr = NULL,
+ .direct_addr = NULL,
};
static struct packet *master_fault_package(pid_t pid, int handle, const struct packet *packet)
.handler = master_extra_info,
},
{
- .cmd = "pd_created",
- .handler = master_pd_created,
- },
- {
- .cmd = "pd_destroyed",
- .handler = master_pd_destroyed,
- },
- {
- .cmd = "fault_package", /* pkgname, id, function, ret */
- .handler = master_fault_package,
- },
- {
.cmd = "deleted", /* pkgname, id, timestamp, ret */
.handler = master_deleted,
},
{
- .cmd = "created", /* timestamp, pkgname, id, content, lb_w, lb_h, pd_w, pd_h, cluster, category, lb_file, pd_file, auto_launch, priority, size_list, is_user, pinup_supported, text_lb, text_pd, period, ret */
- .handler = master_created,
- },
- {
- .cmd = "group_changed",
- .handler = master_group_changed,
- },
- {
- .cmd = "period_changed",
- .handler = master_period_changed,
- },
- {
- .cmd = "size_changed",
- .handler = master_size_changed,
- },
- {
- .cmd = "pinup",
- .handler = master_pinup,
+ .cmd = "fault_package", /* pkgname, id, function, ret */
+ .handler = master_fault_package,
},
{
.cmd = "scroll",
.handler = master_hold_scroll,
},
-
- {
- .cmd = "update_mode",
- .handler = master_update_mode,
- },
-
{
.cmd = "lb_update_begin",
.handler = master_lb_update_begin,
.cmd = "pd_update_end",
.handler = master_pd_update_end,
},
-
{
.cmd = "access_status",
.handler = master_access_status,
},
{
+ .cmd = "pd_created",
+ .handler = master_pd_created,
+ },
+ {
+ .cmd = "pd_destroyed",
+ .handler = master_pd_destroyed,
+ },
+ {
+ .cmd = "created", /* timestamp, pkgname, id, content, lb_w, lb_h, pd_w, pd_h, cluster, category, lb_file, pd_file, auto_launch, priority, size_list, is_user, pinup_supported, text_lb, text_pd, period, ret */
+ .handler = master_created,
+ },
+ {
+ .cmd = "group_changed",
+ .handler = master_group_changed,
+ },
+ {
+ .cmd = "period_changed",
+ .handler = master_period_changed,
+ },
+ {
+ .cmd = "size_changed",
+ .handler = master_size_changed,
+ },
+ {
+ .cmd = "pinup",
+ .handler = master_pinup,
+ },
+
+ {
+ .cmd = "update_mode",
+ .handler = master_update_mode,
+ },
+
+ {
.cmd = NULL,
.handler = NULL,
},
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_ACQUIRE;
DbgPrint("Let's making connection!\n");
return LB_STATUS_ERROR_IO;
}
- packet = packet_create("acquire", "d", util_timestamp());
+ packet = packet_create((const char *)&cmd, "ds", util_timestamp(), client_direct_addr());
if (!packet) {
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
return 0;
}
+static struct method s_direct_table[] = {
+ {
+ .cmd = "lb_updated", /* pkgname, id, lb_w, lb_h, priority, ret */
+ .handler = master_lb_updated,
+ },
+ {
+ .cmd = "pd_updated", /* pkgname, id, descfile, pd_w, pd_h, ret */
+ .handler = master_pd_updated,
+ },
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+};
+
+static void prepare_direct_update(void)
+{
+ char path[MAX_DIRECT_ADDR];
+
+ if (!conf_direct_update()) {
+ return;
+ }
+
+ if (!strncmp(s_info.client_addr, COM_CORE_REMOTE_SCHEME, strlen(COM_CORE_REMOTE_SCHEME))) {
+ ErrPrint("Remote model is not support this\n");
+ return;
+ }
+
+ snprintf(path, sizeof(path) - 1, "/tmp/.%d.%lf.dbox.viewer", getpid(), util_timestamp());
+
+ s_info.direct_addr = strdup(path);
+ if (!s_info.direct_addr) {
+ ErrPrint("strdup: %s\n", strerror(errno));
+ return;
+ }
+
+ s_info.direct_fd = com_core_packet_server_init(client_direct_addr(), s_direct_table);
+ if (s_info.direct_fd < 0) {
+ ErrPrint("Failed to prepare server: %s\n", client_direct_addr());
+ return;
+ }
+
+ DbgPrint("Direct update is prepared: %s - %d\n", client_direct_addr(), client_direct_fd());
+}
+
int client_init(int use_thread)
{
com_core_packet_use_thread(use_thread);
com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
com_core_add_event_callback(CONNECTOR_CONNECTED, connected_cb, NULL);
+
+ /**
+ * @note
+ * Before creating a connection with master,
+ * Initiate the private channel for getting the updated event from providers
+ * How could we propagates the our address to every providers?
+ */
+ prepare_direct_update();
+
if (vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL) < 0) {
ErrPrint("Failed to add vconf for service state\n");
} else {
return s_info.client_addr;
}
+const char *client_direct_addr(void)
+{
+ return s_info.direct_addr;
+}
+
+int client_direct_fd(void)
+{
+ return s_info.direct_fd;
+}
+
int client_fini(void)
{
int ret;
com_core_del_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
com_core_del_event_callback(CONNECTOR_CONNECTED, connected_cb, NULL);
+
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
+
+ if (s_info.direct_fd >= 0) {
+ com_core_packet_server_fini(s_info.direct_fd);
+ s_info.direct_fd = -1;
+ }
+
free(s_info.client_addr);
s_info.client_addr = NULL;
+
+ free(s_info.direct_addr);
+ s_info.direct_addr = NULL;
return LB_STATUS_SUCCESS;
}
#include "master_rpc.h"
#include "client.h"
#include "conf.h"
+#include "provider_cmd_list.h"
#define EAPI __attribute__((visibility("default")))
struct cb_info *cbinfo;
const char *id;
int ret;
+ unsigned int cmd = CMD_LB_ACQUIRE_PIXMAP;
id = fb_id(handler->common->lb.fb);
if (!id || strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create("lb_acquire_pixmap", "ss", handler->common->pkgname, handler->common->id);
+ packet = packet_create((const char *)&cmd, "ss", handler->common->pkgname, handler->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
struct cb_info *cbinfo;
const char *id;
int ret;
+ unsigned int cmd = CMD_PD_ACQUIRE_PIXMAP;
id = fb_id(handler->common->pd.fb);
if (!id || strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create("pd_acquire_pixmap", "ss", handler->common->pkgname, handler->common->id);
+ packet = packet_create((const char *)&cmd, "ss", handler->common->pkgname, handler->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
struct livebox_common *common;
int ret;
+ unsigned int cmd = CMD_NEW;
common = handler->common;
- packet = packet_create("new", "dssssdii",
+ packet = packet_create((const char *)&cmd, "dssssdii",
common->timestamp, common->pkgname, common->content,
common->cluster, common->category,
common->lb.period, common->lb.width, common->lb.height);
struct packet *packet;
int need_to_add_job = 0;
int ret;
+ unsigned int cmd = CMD_CHANGE_VISIBILITY;
if (handler->common->visible != LB_SHOW && state == LB_SHOW) {
need_to_add_job = !!handler->paused_updating;
return LB_STATUS_SUCCESS;
}
- packet = packet_create_noack("change,visibility", "ssi", handler->common->pkgname, handler->common->id, (int)state);
+ packet = packet_create_noack((const char *)&cmd, "ssi", handler->common->pkgname, handler->common->id, (int)state);
if (!packet) {
ErrPrint("Failed to create a packet\n");
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_SET_PERIOD;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is not valid\n");
return LB_STATUS_ERROR_ALREADY;
}
- packet = packet_create("set_period", "ssd", handler->common->pkgname, handler->common->id, period);
+ packet = packet_create((const char *)&cmd, "ssd", handler->common->pkgname, handler->common->id, period);
if (!packet) {
ErrPrint("Failed to build a packet %s\n", handler->common->pkgname);
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_UPDATE_MODE;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is Invalid\n");
return LB_STATUS_ERROR_PERMISSION;
}
- packet = packet_create("update_mode", "ssi", handler->common->pkgname, handler->common->id, active_update);
+ packet = packet_create((const char *)&cmd, "ssi", handler->common->pkgname, handler->common->id, active_update);
if (!packet) {
return LB_STATUS_ERROR_FAULT;
}
if (handler->common->refcnt <= 1) {
struct packet *packet;
+ unsigned int cmd = CMD_RESIZE;
/* Only 1 instance */
- packet = packet_create("resize", "ssii", handler->common->pkgname, handler->common->id, w, h);
+ packet = packet_create((const char *)&cmd, "ssii", handler->common->pkgname, handler->common->id, w, h);
if (!packet) {
ErrPrint("Failed to build param\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
double timestamp;
int ret;
+ unsigned int cmd = CMD_CLICKED;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
timestamp = util_timestamp();
DbgPrint("CLICKED: %lf\n", timestamp);
- packet = packet_create_noack("clicked", "sssddd", handler->common->pkgname, handler->common->id, "clicked", timestamp, x, y);
+ packet = packet_create_noack((const char *)&cmd, "sssddd", handler->common->pkgname, handler->common->id, "clicked", timestamp, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
return LB_STATUS_ERROR_FAULT;
ret = master_rpc_request_only(handler, packet);
- if (!handler->common->lb.mouse_event && (handler->common->lb.type == _LB_TYPE_BUFFER || handler->common->lb.type == _LB_TYPE_SCRIPT)) {
- int ret; /* Shadow variable */
- ret = send_mouse_event(handler, "lb_mouse_down", x * handler->common->lb.width, y * handler->common->lb.height);
- if (ret < 0) {
- ErrPrint("Failed to send Down: %d\n", ret);
- }
-
- ret = send_mouse_event(handler, "lb_mouse_move", x * handler->common->lb.width, y * handler->common->lb.height);
- if (ret < 0) {
- ErrPrint("Failed to send Move: %d\n", ret);
- }
-
- ret = send_mouse_event(handler, "lb_mouse_up", x * handler->common->lb.width, y * handler->common->lb.height);
- if (ret < 0) {
- ErrPrint("Failed to send Up: %d\n", ret);
- }
- }
-
return ret;
}
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_CREATE_PD;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
}
}
- packet = packet_create("create_pd", "ssdd", handler->common->pkgname, handler->common->id, x, y);
+ packet = packet_create((const char *)&cmd, "ssdd", handler->common->pkgname, handler->common->id, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
return LB_STATUS_ERROR_FAULT;
EAPI int livebox_move_pd(struct livebox *handler, double x, double y)
{
struct packet *packet;
+ unsigned int cmd = CMD_PD_MOVE;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create_noack("pd_move", "ssdd", handler->common->pkgname, handler->common->id, x, y);
+ packet = packet_create_noack((const char *)&cmd, "ssdd", handler->common->pkgname, handler->common->id, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
struct cb_info *cbinfo;
+ unsigned int cmd = CMD_ACTIVATE_PACKAGE;
int ret;
if (!pkgname) {
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create("activate_package", "s", pkgname);
+ packet = packet_create((const char *)&cmd, "s", pkgname);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
struct cb_info *cbinfo;
int ret;
+ unsigned int cmd = CMD_DESTROY_PD;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
DbgPrint("[%s]\n", handler->common->pkgname);
- packet = packet_create("destroy_pd", "ss", handler->common->pkgname, handler->common->id);
+ packet = packet_create((const char *)&cmd, "ss", handler->common->pkgname, handler->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
{
int w = 1;
int h = 1;
- char cmd[32] = { '\0', };
- char *ptr = cmd;
int ret = 0; /* re-used for sending event type */
+ unsigned int cmd;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
ErrPrint("PD is not created\n");
return LB_STATUS_ERROR_INVALID;
}
- *ptr++ = 'p';
- *ptr++ = 'd';
+ switch (type & ~(ACCESS_EVENT_PD_MASK | ACCESS_EVENT_LB_MASK)) {
+ case ACCESS_EVENT_HIGHLIGHT:
+ cmd = CMD_PD_ACCESS_HL;
+ ret = ACCESS_TYPE_CUR;
+ break;
+ case ACCESS_EVENT_HIGHLIGHT_NEXT:
+ cmd = CMD_PD_ACCESS_HL;
+ ret = ACCESS_TYPE_NEXT;
+ break;
+ case ACCESS_EVENT_HIGHLIGHT_PREV:
+ cmd = CMD_PD_ACCESS_HL;
+ ret = ACCESS_TYPE_PREV;
+ break;
+ case ACCESS_EVENT_UNHIGHLIGHT:
+ cmd = CMD_PD_ACCESS_HL;
+ ret = ACCESS_TYPE_OFF;
+ break;
+ case ACCESS_EVENT_ACTIVATE:
+ cmd = CMD_PD_ACCESS_ACTIVATE;
+ break;
+ case ACCESS_EVENT_ACTION_DOWN:
+ cmd = CMD_PD_ACCESS_ACTION;
+ ret = ACCESS_TYPE_DOWN;
+ break;
+ case ACCESS_EVENT_ACTION_UP:
+ cmd = CMD_PD_ACCESS_ACTION;
+ ret = ACCESS_TYPE_UP;
+ break;
+ case ACCESS_EVENT_SCROLL_DOWN:
+ cmd = CMD_PD_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_DOWN;
+ break;
+ case ACCESS_EVENT_SCROLL_MOVE:
+ cmd = CMD_PD_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_MOVE;
+ break;
+ case ACCESS_EVENT_SCROLL_UP:
+ cmd = CMD_PD_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_UP;
+ break;
+ case ACCESS_EVENT_VALUE_CHANGE:
+ cmd = CMD_PD_ACCESS_VALUE_CHANGE;
+ break;
+ case ACCESS_EVENT_MOUSE:
+ cmd = CMD_PD_ACCESS_MOUSE;
+ break;
+ case ACCESS_EVENT_BACK:
+ cmd = CMD_PD_ACCESS_BACK;
+ break;
+ case ACCESS_EVENT_OVER:
+ cmd = CMD_PD_ACCESS_OVER;
+ break;
+ case ACCESS_EVENT_READ:
+ cmd = CMD_PD_ACCESS_READ;
+ break;
+ case ACCESS_EVENT_ENABLE:
+ cmd = CMD_PD_ACCESS_ENABLE;
+ ret = 1;
+ break;
+ case ACCESS_EVENT_DISABLE:
+ cmd = CMD_PD_ACCESS_ENABLE;
+ ret = 0;
+ break;
+ default:
+ return LB_STATUS_ERROR_INVALID;
+ }
w = handler->common->pd.width;
h = handler->common->pd.height;
} else if (type & ACCESS_EVENT_LB_MASK) {
- *ptr++ = 'l';
- *ptr++ = 'b';
+ switch (type & ~(ACCESS_EVENT_PD_MASK | ACCESS_EVENT_LB_MASK)) {
+ case ACCESS_EVENT_HIGHLIGHT:
+ cmd = CMD_LB_ACCESS_HL;
+ ret = ACCESS_TYPE_CUR;
+ break;
+ case ACCESS_EVENT_HIGHLIGHT_NEXT:
+ cmd = CMD_LB_ACCESS_HL;
+ ret = ACCESS_TYPE_NEXT;
+ break;
+ case ACCESS_EVENT_HIGHLIGHT_PREV:
+ cmd = CMD_LB_ACCESS_HL;
+ ret = ACCESS_TYPE_PREV;
+ break;
+ case ACCESS_EVENT_UNHIGHLIGHT:
+ cmd = CMD_LB_ACCESS_HL;
+ ret = ACCESS_TYPE_OFF;
+ break;
+ case ACCESS_EVENT_ACTIVATE:
+ cmd = CMD_LB_ACCESS_ACTIVATE;
+ break;
+ case ACCESS_EVENT_ACTION_DOWN:
+ cmd = CMD_LB_ACCESS_ACTION;
+ ret = ACCESS_TYPE_DOWN;
+ break;
+ case ACCESS_EVENT_ACTION_UP:
+ cmd = CMD_LB_ACCESS_ACTION;
+ ret = ACCESS_TYPE_UP;
+ break;
+ case ACCESS_EVENT_SCROLL_DOWN:
+ cmd = CMD_LB_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_DOWN;
+ break;
+ case ACCESS_EVENT_SCROLL_MOVE:
+ cmd = CMD_LB_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_MOVE;
+ break;
+ case ACCESS_EVENT_SCROLL_UP:
+ cmd = CMD_LB_ACCESS_SCROLL;
+ ret = ACCESS_TYPE_UP;
+ break;
+ case ACCESS_EVENT_VALUE_CHANGE:
+ cmd = CMD_LB_ACCESS_VALUE_CHANGE;
+ break;
+ case ACCESS_EVENT_MOUSE:
+ cmd = CMD_LB_ACCESS_MOUSE;
+ break;
+ case ACCESS_EVENT_BACK:
+ cmd = CMD_LB_ACCESS_BACK;
+ break;
+ case ACCESS_EVENT_OVER:
+ cmd = CMD_LB_ACCESS_OVER;
+ break;
+ case ACCESS_EVENT_READ:
+ cmd = CMD_LB_ACCESS_READ;
+ break;
+ case ACCESS_EVENT_ENABLE:
+ cmd = CMD_LB_ACCESS_ENABLE;
+ ret = 1;
+ break;
+ case ACCESS_EVENT_DISABLE:
+ cmd = CMD_LB_ACCESS_ENABLE;
+ ret = 0;
+ break;
+ default:
+ return LB_STATUS_ERROR_INVALID;
+ }
w = handler->common->lb.width;
h = handler->common->lb.height;
} else {
return LB_STATUS_ERROR_INVALID;
}
- switch (type & ~(ACCESS_EVENT_PD_MASK | ACCESS_EVENT_LB_MASK)) {
- case ACCESS_EVENT_HIGHLIGHT:
- strcpy(ptr, "_access_hl");
- ret = ACCESS_TYPE_CUR;
- break;
- case ACCESS_EVENT_HIGHLIGHT_NEXT:
- strcpy(ptr, "_access_hl");
- ret = ACCESS_TYPE_NEXT;
- break;
- case ACCESS_EVENT_HIGHLIGHT_PREV:
- strcpy(ptr, "_access_hl");
- ret = ACCESS_TYPE_PREV;
- break;
- case ACCESS_EVENT_UNHIGHLIGHT:
- strcpy(ptr, "_access_hl");
- ret = ACCESS_TYPE_OFF;
- break;
- case ACCESS_EVENT_ACTIVATE:
- strcpy(ptr, "_access_activate");
- break;
- case ACCESS_EVENT_ACTION_DOWN:
- strcpy(ptr, "_access_action");
- ret = ACCESS_TYPE_DOWN;
- break;
- case ACCESS_EVENT_ACTION_UP:
- strcpy(ptr, "_access_action");
- ret = ACCESS_TYPE_UP;
- break;
- case ACCESS_EVENT_SCROLL_DOWN:
- strcpy(ptr, "_access_scroll");
- ret = ACCESS_TYPE_DOWN;
- break;
- case ACCESS_EVENT_SCROLL_MOVE:
- strcpy(ptr, "_access_scroll");
- ret = ACCESS_TYPE_MOVE;
- break;
- case ACCESS_EVENT_SCROLL_UP:
- strcpy(ptr, "_access_scroll");
- ret = ACCESS_TYPE_UP;
- break;
- case ACCESS_EVENT_VALUE_CHANGE:
- strcpy(ptr, "_access_value_change");
- break;
- case ACCESS_EVENT_MOUSE:
- strcpy(ptr, "_access_mouse");
- break;
- case ACCESS_EVENT_BACK:
- strcpy(ptr, "_access_back");
- break;
- case ACCESS_EVENT_OVER:
- strcpy(ptr, "_access_over");
- break;
- case ACCESS_EVENT_READ:
- strcpy(ptr, "_access_read");
- break;
- case ACCESS_EVENT_ENABLE:
- strcpy(ptr, "_access_enable");
- ret = 1;
- break;
- case ACCESS_EVENT_DISABLE:
- strcpy(ptr, "_access_enable");
- ret = 0;
- break;
- default:
- return LB_STATUS_ERROR_INVALID;
- }
if (!cb) {
cb = default_access_event_cb;
}
- ret = send_access_event(handler, cmd, x * w, y * h, ret);
+ ret = send_access_event(handler, (const char *)&cmd, x * w, y * h, ret);
if (ret == (int)LB_STATUS_SUCCESS) {
handler->cbs.access_event.cb = cb;
handler->cbs.access_event.data = data;
{
int w = 1;
int h = 1;
- char cmd[32] = { '\0', };
- char *ptr = cmd;
+ unsigned int cmd;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
flag = 0;
}
- w = handler->common->pd.width;
- h = handler->common->pd.height;
if (flag) {
+ w = handler->common->pd.width;
+ h = handler->common->pd.height;
handler->common->pd.x = x;
handler->common->pd.y = y;
}
- *ptr++ = 'p';
- *ptr++ = 'd';
- } else if (type & CONTENT_EVENT_LB_MASK) {
- int flag = 1;
- if (!handler->common->lb.mouse_event) {
+ switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
+ case CONTENT_EVENT_MOUSE_ENTER | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_ENTER;
+ break;
+ case CONTENT_EVENT_MOUSE_LEAVE | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_LEAVE;
+ break;
+ case CONTENT_EVENT_MOUSE_UP | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_UP;
+ break;
+ case CONTENT_EVENT_MOUSE_DOWN | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_DOWN;
+ break;
+ case CONTENT_EVENT_MOUSE_MOVE | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_MOVE;
+ break;
+ case CONTENT_EVENT_MOUSE_SET | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_SET;
+ break;
+ case CONTENT_EVENT_MOUSE_UNSET | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_UNSET;
+ break;
+ case CONTENT_EVENT_ON_SCROLL | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_ON_SCROLL;
+ break;
+ case CONTENT_EVENT_ON_HOLD | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_ON_HOLD;
+ break;
+ case CONTENT_EVENT_OFF_SCROLL | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_OFF_SCROLL;
+ break;
+ case CONTENT_EVENT_OFF_HOLD | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_PD_MOUSE_OFF_HOLD;
+ break;
+ default:
+ ErrPrint("Invalid event type\n");
return LB_STATUS_ERROR_INVALID;
}
+ } else if (type & CONTENT_EVENT_LB_MASK) {
+ int flag = 1;
+
if (!handler->common->lb.fb) {
ErrPrint("Handler is not valid\n");
return LB_STATUS_ERROR_INVALID;
flag = 0;
}
- w = handler->common->lb.width;
- h = handler->common->lb.height;
if (flag) {
+ w = handler->common->lb.width;
+ h = handler->common->lb.height;
handler->common->lb.x = x;
handler->common->lb.y = y;
}
- *ptr++ = 'l';
- *ptr++ = 'b';
- } else {
- ErrPrint("Invalid event type\n");
- return LB_STATUS_ERROR_INVALID;
- }
- /*!
- * Must be shorter than 29 bytes.
- */
- switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
- case CONTENT_EVENT_MOUSE_ENTER | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_enter");
- break;
- case CONTENT_EVENT_MOUSE_LEAVE | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_leave");
- break;
- case CONTENT_EVENT_MOUSE_UP | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_up");
- break;
- case CONTENT_EVENT_MOUSE_DOWN | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_down");
- break;
- case CONTENT_EVENT_MOUSE_MOVE | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_move");
- break;
- case CONTENT_EVENT_MOUSE_SET | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_set");
- break;
- case CONTENT_EVENT_MOUSE_UNSET | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_unset");
- break;
- case CONTENT_EVENT_ON_SCROLL | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_on_scroll");
- break;
- case CONTENT_EVENT_ON_HOLD | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_on_hold");
- break;
- case CONTENT_EVENT_OFF_SCROLL | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_off_scroll");
- break;
- case CONTENT_EVENT_OFF_HOLD | CONTENT_EVENT_MOUSE_MASK:
- strcpy(ptr, "_mouse_off_hold");
- break;
- default:
+ switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
+ case CONTENT_EVENT_MOUSE_ENTER | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_ENTER;
+ break;
+ case CONTENT_EVENT_MOUSE_LEAVE | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_LEAVE;
+ break;
+ case CONTENT_EVENT_MOUSE_UP | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_UP;
+ break;
+ case CONTENT_EVENT_MOUSE_DOWN | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_DOWN;
+ break;
+ case CONTENT_EVENT_MOUSE_MOVE | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_MOVE;
+ if (!handler->common->lb.mouse_event) {
+ return LB_STATUS_ERROR_INVALID;
+ }
+ break;
+ case CONTENT_EVENT_MOUSE_SET | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_SET;
+ if (!handler->common->lb.mouse_event) {
+ return LB_STATUS_ERROR_INVALID;
+ }
+ break;
+ case CONTENT_EVENT_MOUSE_UNSET | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_UNSET;
+ if (!handler->common->lb.mouse_event) {
+ return LB_STATUS_ERROR_INVALID;
+ }
+ break;
+ case CONTENT_EVENT_ON_SCROLL | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_ON_SCROLL;
+ break;
+ case CONTENT_EVENT_ON_HOLD | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_ON_HOLD;
+ break;
+ case CONTENT_EVENT_OFF_SCROLL | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_OFF_SCROLL;
+ break;
+ case CONTENT_EVENT_OFF_HOLD | CONTENT_EVENT_MOUSE_MASK:
+ cmd = CMD_LB_MOUSE_OFF_HOLD;
+ break;
+ default:
+ ErrPrint("Invalid event type\n");
+ return LB_STATUS_ERROR_INVALID;
+ }
+ } else {
ErrPrint("Invalid event type\n");
return LB_STATUS_ERROR_INVALID;
}
- return send_mouse_event(handler, cmd, x * w, y * h);
+ return send_mouse_event(handler, (const char *)&cmd, x * w, y * h);
}
EAPI int livebox_key_event(struct livebox *handler, enum content_event_type type, unsigned int keycode, ret_cb_t cb, void *data)
{
- char cmd[32] = { '\0', };
- char *ptr = cmd;
+ unsigned int cmd;
int ret;
if (!handler || handler->state != CREATE) {
*/
}
- *ptr++ = 'p';
- *ptr++ = 'd';
- } else if (type & CONTENT_EVENT_LB_MASK) {
- if (!handler->common->lb.mouse_event) {
+ switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
+ case CONTENT_EVENT_KEY_FOCUS_IN | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_FOCUS_IN;
+ break;
+ case CONTENT_EVENT_KEY_FOCUS_OUT | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_FOCUS_OUT;
+ break;
+ case CONTENT_EVENT_KEY_UP | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_UP;
+ break;
+ case CONTENT_EVENT_KEY_DOWN | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_DOWN;
+ break;
+ case CONTENT_EVENT_KEY_SET | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_SET;
+ break;
+ case CONTENT_EVENT_KEY_UNSET | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_PD_KEY_UNSET;
+ break;
+ default:
+ ErrPrint("Invalid event type\n");
return LB_STATUS_ERROR_INVALID;
}
+ } else if (type & CONTENT_EVENT_LB_MASK) {
if (!handler->common->lb.fb) {
ErrPrint("Handler is not valid\n");
return LB_STATUS_ERROR_INVALID;
*/
}
- *ptr++ = 'l';
- *ptr++ = 'b';
+ switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
+ case CONTENT_EVENT_KEY_FOCUS_IN | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_FOCUS_IN;
+ break;
+ case CONTENT_EVENT_KEY_FOCUS_OUT | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_FOCUS_OUT;
+ break;
+ case CONTENT_EVENT_KEY_UP | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_UP;
+ break;
+ case CONTENT_EVENT_KEY_DOWN | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_DOWN;
+ break;
+ case CONTENT_EVENT_KEY_SET | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_SET;
+ break;
+ case CONTENT_EVENT_KEY_UNSET | CONTENT_EVENT_KEY_MASK:
+ cmd = CMD_LB_KEY_UNSET;
+ break;
+ default:
+ ErrPrint("Invalid event type\n");
+ return LB_STATUS_ERROR_INVALID;
+ }
} else {
ErrPrint("Invalid event type\n");
return LB_STATUS_ERROR_INVALID;
}
- /*!
- * Must be short than 29 bytes.
- */
- switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
- case CONTENT_EVENT_KEY_FOCUS_IN | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_focus_in");
- break;
- case CONTENT_EVENT_KEY_FOCUS_OUT | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_focus_out");
- break;
- case CONTENT_EVENT_KEY_UP | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_up");
- break;
- case CONTENT_EVENT_KEY_DOWN | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_down");
- break;
- case CONTENT_EVENT_KEY_SET | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_set");
- break;
- case CONTENT_EVENT_KEY_UNSET | CONTENT_EVENT_KEY_MASK:
- strcpy(ptr, "_key_unset");
- break;
- default:
- ErrPrint("Invalid event type\n");
- return LB_STATUS_ERROR_INVALID;
- }
-
if (!cb) {
cb = default_key_event_cb;
}
- ret = send_key_event(handler, cmd, keycode);
+ ret = send_key_event(handler, (const char *)&cmd, keycode);
if (ret == (int)LB_STATUS_SUCCESS) {
handler->cbs.key_event.cb = cb;
handler->cbs.key_event.data = data;
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_CHANGE_GROUP;
if (!handler) {
ErrPrint("Handler is NIL\n");
return LB_STATUS_ERROR_ALREADY;
}
- packet = packet_create("change_group", "ssss", handler->common->pkgname, handler->common->id, cluster, category);
+ packet = packet_create((const char *)&cmd, "ssss", handler->common->pkgname, handler->common->id, cluster, category);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
struct cb_info *cbinfo;
+ unsigned int cmd = CMD_DELETE_CLUSTER;
int ret;
- packet = packet_create("delete_cluster", "s", cluster);
+ packet = packet_create((const char *)&cmd, "s", cluster);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
struct cb_info *cbinfo;
+ unsigned int cmd = CMD_DELETE_CATEGORY;
int ret;
- packet = packet_create("delete_category", "ss", cluster, category);
+ packet = packet_create((const char *)&cmd, "ss", cluster, category);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
const char *pkgname;
const char *id;
+ unsigned int cmd = CMD_LB_RELEASE_PIXMAP;
if (pixmap == 0 /* || handler->state != CREATE */ ) {
ErrPrint("Handler is invalid [%d]\n", pixmap);
id = handler->common->id;
}
- packet = packet_create_noack("lb_release_pixmap", "ssi", pkgname, id, pixmap);
+ packet = packet_create_noack((const char *)&cmd, "ssi", pkgname, id, pixmap);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_INVALID;
struct packet *packet;
const char *pkgname;
const char *id;
+ unsigned int cmd = CMD_PD_RELEASE_PIXMAP;
if (pixmap == 0 /* || handler->state != CREATE */) {
ErrPrint("Pixmap is invalid [%d]\n", pixmap);
id = handler->common->id;
}
- packet = packet_create_noack("pd_release_pixmap", "ssi", pkgname, id, pixmap);
+ packet = packet_create_noack((const char *)&cmd, "ssi", pkgname, id, pixmap);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
{
struct packet *packet;
int ret;
+ unsigned int cmd = CMD_PINUP_CHANGED;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
return LB_STATUS_ERROR_ALREADY;
}
- packet = packet_create("pinup_changed", "ssi", handler->common->pkgname, handler->common->id, flag);
+ packet = packet_create((const char *)&cmd, "ssi", handler->common->pkgname, handler->common->id, flag);
if (!packet) {
ErrPrint("Failed to build a param\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
struct cb_info *cbinfo;
int ret;
+ unsigned int cmd = CMD_TEXT_SIGNAL;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
source = "";
}
- packet = packet_create("text_signal", "ssssdddd",
+ packet = packet_create((const char *)&cmd, "ssssdddd",
handler->common->pkgname, handler->common->id, emission, source, sx, sy, ex, ey);
if (!packet) {
ErrPrint("Failed to build a param\n");
EAPI int livebox_subscribe_group(const char *cluster, const char *category)
{
struct packet *packet;
+ unsigned int cmd = CMD_SUBSCRIBE;
/*!
* \todo
* If the group info is not valid, do not send this request
*/
- packet = packet_create_noack("subscribe", "ss", cluster ? cluster : "", category ? category : "");
+ packet = packet_create_noack((const char *)&cmd, "ss", cluster ? cluster : "", category ? category : "");
if (!packet) {
ErrPrint("Failed to create a packet\n");
return LB_STATUS_ERROR_FAULT;
EAPI int livebox_unsubscribe_group(const char *cluster, const char *category)
{
struct packet *packet;
+ unsigned int cmd = CMD_UNSUBSCRIBE;
/*!
* \todo
* AND Check the subscribed or not too
*/
- packet = packet_create_noack("unsubscribe", "ss", cluster ? cluster : "", category ? category : "");
+ packet = packet_create_noack((const char *)&cmd, "ss", cluster ? cluster : "", category ? category : "");
if (!packet) {
ErrPrint("Failed to create a packet\n");
return LB_STATUS_ERROR_FAULT;
EAPI int livebox_refresh(struct livebox *handler, int force)
{
struct packet *packet;
+ unsigned int cmd = CMD_UPDATE;
if (!handler || handler->state != CREATE) {
ErrPrint("Handler is invalid\n");
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create_noack("update", "ssi", handler->common->pkgname, handler->common->id, force);
+ packet = packet_create_noack((const char *)&cmd, "ssi", handler->common->pkgname, handler->common->id, force);
if (!packet) {
ErrPrint("Failed to create a packet\n");
return LB_STATUS_ERROR_FAULT;
EAPI int livebox_refresh_group(const char *cluster, const char *category, int force)
{
struct packet *packet;
+ unsigned int cmd = CMD_REFRESH_GROUP;
if (!cluster || !category) {
ErrPrint("Invalid argument\n");
return LB_STATUS_ERROR_INVALID;
}
- packet = packet_create_noack("refresh_group", "ssi", cluster, category, force);
+ packet = packet_create_noack((const char *)&cmd, "ssi", cluster, category, force);
if (!packet) {
ErrPrint("Failed to create a packet\n");
return LB_STATUS_ERROR_FAULT;
struct packet *packet;
struct cb_info *cbinfo;
int ret;
+ unsigned int cmd = CMD_DELETE;
if (handler->common->request.deleted) {
ErrPrint("Already in-progress\n");
cb = default_delete_cb;
}
- packet = packet_create("delete", "ssid", handler->common->pkgname, handler->common->id, type, handler->common->timestamp);
+ packet = packet_create((const char *)&cmd, "ssid", handler->common->pkgname, handler->common->id, type, handler->common->timestamp);
if (!packet) {
ErrPrint("Failed to build a param\n");
if (cb) {
EAPI int livebox_client_paused(void)
{
struct packet *packet;
+ unsigned int cmd = CMD_CLIENT_PAUSED;
- packet = packet_create_noack("client_paused", "d", util_timestamp());
+ packet = packet_create_noack((const char *)&cmd, "d", util_timestamp());
if (!packet) {
ErrPrint("Failed to create a pause packet\n");
return LB_STATUS_ERROR_FAULT;
EAPI int livebox_client_resumed(void)
{
struct packet *packet;
+ unsigned int cmd = CMD_CLIENT_RESUMED;
- packet = packet_create_noack("client_resumed", "d", util_timestamp());
+ packet = packet_create_noack((const char *)&cmd, "d", util_timestamp());
if (!packet) {
ErrPrint("Failed to create a resume packet\n");
return LB_STATUS_ERROR_FAULT;
case LB_OPTION_SHARED_CONTENT:
conf_set_shared_content(state);
break;
+ case LB_OPTION_DIRECT_UPDATE:
+ if (s_info.init_count) {
+ DbgPrint("Already intialized, this option is not applied\n");
+ }
+ conf_set_direct_update(state);
+ break;
default:
ret = LB_STATUS_ERROR_INVALID;
break;
case LB_OPTION_SHARED_CONTENT:
ret = conf_shared_content();
break;
+ case LB_OPTION_DIRECT_UPDATE:
+ ret = conf_direct_update();
+ break;
default:
ret = LB_STATUS_ERROR_INVALID;
break;