Flora License
-Version 1.0, April, 2013
+Version 1.1, April, 2013
http://floralicense.org/license/
Derivative Works; or, within a display generated by the Derivative Works,
if and wherever such third-party notices normally appear.
The contents of the NOTICE file are for informational purposes only
- and do not modify the License.
-
-You may add Your own attribution notices within Derivative Works
-that You distribute, alongside or as an addendum to the NOTICE text
-from the Work, provided that such additional attribution notices
-cannot be construed as modifying the License. You may add Your own
-copyright statement to Your modifications and may provide additional or
-different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works
-as a whole, provided Your use, reproduction, and distribution of
-the Work otherwise complies with the conditions stated in this License.
+ and do not modify the License. You may add Your own attribution notices
+ within Derivative Works that You distribute, alongside or as an addendum
+ to the NOTICE text from the Work, provided that such additional attribution
+ notices cannot be construed as modifying the License. You may add Your own
+ copyright statement to Your modifications and may provide additional or
+ different license terms and conditions for use, reproduction, or
+ distribution of Your modifications, or for any such Derivative Works
+ as a whole, provided Your use, reproduction, and distribution of
+ the Work otherwise complies with the conditions stated in this License
+ and your own copyright statement or terms and conditions do not conflict
+ the conditions stated in the License including section 3.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
Copyright [yyyy] [name of copyright owner]
- Licensed under the Flora License, Version 1.0 (the "License");
+ Licensed under the Flora License, Version 1.1 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
} part;
};
-enum access_event {
- ACCESS_HIGHLIGHT,
- ACCESS_HIGHLIGHT_NEXT,
- ACCESS_HIGHLIGHT_PREV,
- ACCESS_ACTIVATE,
- ACCESS_VALUE_CHANGE,
- ACCESS_SCROLL,
- ACCESS_UNHIGHLIGHT,
-};
-
-enum access_mouse_state {
- ACCESS_MOUSE_DOWN = 0,
- ACCESS_MOUSE_MOVE = 1,
- ACCESS_MOUSE_UP = 2,
-};
-
struct event_arg {
enum {
EVENT_NEW, /*!< Master will send this to create a new livebox instance */
} lb_resume;
struct {
- /*!< Accessibility */
- enum access_event event;
- int x;
- int y;
- int mouse_state;
- } lb_access;
-
- struct {
- /*!< Accessibility */
- enum access_event event;
- int x;
- int y;
- int mouse_state;
- } pd_access;
-
- struct {
int active_update;
} update_mode;
} info;
int (*pd_destroy)(struct event_arg *arg, void *data);
int (*pd_move)(struct event_arg *arg, void *data);
- /*!
- * \note
- * Accessibility functions
- */
- int (*lb_access)(struct event_arg *arg, void *data);
- int (*pd_access)(struct event_arg *arg, void *data);
-
int (*update_mode)(struct event_arg *arg, void *data);
};
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
BUFFER_EVENT_KEY_DOWN, /*!< */
BUFFER_EVENT_KEY_UP, /*!< */
+
+ BUFFER_EVENT_HIGHLIGHT,
+ BUFFER_EVENT_HIGHLIGHT_NEXT,
+ BUFFER_EVENT_HIGHLIGHT_PREV,
+ BUFFER_EVENT_ACTIVATE,
+ BUFFER_EVENT_ACTION_UP,
+ BUFFER_EVENT_ACTION_DOWN,
+ BUFFER_EVENT_SCROLL_UP,
+ BUFFER_EVENT_SCROLL_MOVE,
+ BUFFER_EVENT_SCROLL_DOWN,
+ BUFFER_EVENT_UNHIGHLIGHT,
};
struct livebox_buffer;
*/
extern int provider_buffer_set_user_data(struct livebox_buffer *handle, void *data);
+extern struct packet *provider_buffer_pd_access_action_up(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_action_down(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_scroll_down(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_scroll_move(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_scroll_up(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_unhighlight(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_hl(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_hl_prev(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_hl_next(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_pd_access_activate(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_unhighlight(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_hl(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_hl_prev(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_hl_next(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_action_up(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_action_down(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_scroll_down(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_scroll_move(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_scroll_up(pid_t pid, int handle, const struct packet *packet);
+
+extern struct packet *provider_buffer_lb_access_activate(pid_t pid, int handle, const struct packet *packet);
+
#ifdef __cplusplus
}
#endif
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
Name: libprovider
Summary: Library for developing the livebox service provider.
-Version: 0.8.2
+Version: 0.9.0
Release: 1
Group: HomeTF/Livebox
License: Flora License
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
return NULL;
}
-struct packet *master_pd_access_value_change(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id, ×tamp, &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_VALUE_CHANGE;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id, ×tamp, &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_SCROLL;
- arg.info.pd_access.mouse_state = ACCESS_MOUSE_DOWN;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id, ×tamp, &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_SCROLL;
- arg.info.pd_access.mouse_state = ACCESS_MOUSE_MOVE;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id, ×tamp, &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_SCROLL;
- arg.info.pd_access.mouse_state = ACCESS_MOUSE_UP;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_unhighlight(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id, ×tamp, &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_UNHIGHLIGHT;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_hl(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_HIGHLIGHT;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_hl_prev(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_HIGHLIGHT_PREV;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_hl_next(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_HIGHLIGHT_NEXT;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_pd_access_activate(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.pd_access.x, &arg.info.pd_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_PD_ACCESS;
- arg.info.pd_access.event = ACCESS_ACTIVATE;
- if (s_info.table.pd_access)
- (void)s_info.table.pd_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_unhighlight(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
-
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_UNHIGHLIGHT;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_hl(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_HIGHLIGHT;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_hl_prev(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_HIGHLIGHT_PREV;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_hl_next(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_HIGHLIGHT_NEXT;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_value_change(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_VALUE_CHANGE;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_SCROLL;
- arg.info.lb_access.mouse_state = ACCESS_MOUSE_DOWN;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_SCROLL;
- arg.info.lb_access.mouse_state = ACCESS_MOUSE_MOVE;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_SCROLL;
- arg.info.lb_access.mouse_state = ACCESS_MOUSE_UP;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
-struct packet *master_lb_access_activate(pid_t pid, int handle, const struct packet *packet)
-{
- struct event_arg arg;
- double timestamp;
- int ret;
-
- ret = packet_get(packet, "ssdii", &arg.pkgname, &arg.id,
- ×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 5) {
- ErrPrint("Invalid packet\n");
- goto out;
- }
-
- arg.type = EVENT_LB_ACCESS;
- arg.info.lb_access.event = ACCESS_ACTIVATE;
- if (s_info.table.lb_access)
- (void)s_info.table.lb_access(&arg, s_info.data);
- else
- (void)provider_send_access_status(arg.pkgname, arg.id, LB_ACCESS_STATUS_ERROR);
-
-out:
- return NULL;
-}
-
static struct method s_table[] = {
/*!< For the buffer type */
{
{
.cmd = "pd_access_hl",
- .handler = master_pd_access_hl,
+ .handler = provider_buffer_pd_access_hl,
},
{
.cmd = "pd_access_hl_prev",
- .handler = master_pd_access_hl_prev,
+ .handler = provider_buffer_pd_access_hl_prev,
},
{
.cmd = "pd_access_hl_next",
- .handler = master_pd_access_hl_next,
+ .handler = provider_buffer_pd_access_hl_next,
},
{
.cmd = "pd_access_activate",
- .handler = master_pd_access_activate,
+ .handler = provider_buffer_pd_access_activate,
},
{
- .cmd = "pd_access_value_change",
- .handler = master_pd_access_value_change,
+ .cmd = "pd_access_action_up",
+ .handler = provider_buffer_pd_access_action_up,
+ },
+ {
+ .cmd = "pd_access_action_down",
+ .handler = provider_buffer_pd_access_action_down,
},
{
.cmd = "pd_access_unhighlight",
- .handler = master_pd_access_unhighlight,
+ .handler = provider_buffer_pd_access_unhighlight,
},
{
.cmd = "pd_access_scroll_down",
- .handler = master_pd_access_scroll_down,
+ .handler = provider_buffer_pd_access_scroll_down,
},
{
.cmd = "pd_access_scroll_move",
- .handler = master_pd_access_scroll_move,
+ .handler = provider_buffer_pd_access_scroll_move,
},
{
.cmd = "pd_access_scroll_up",
- .handler = master_pd_access_scroll_up,
+ .handler = provider_buffer_pd_access_scroll_up,
},
{
.cmd = "lb_access_hl",
- .handler = master_lb_access_hl,
+ .handler = provider_buffer_lb_access_hl,
},
{
.cmd = "lb_access_hl_prev",
- .handler = master_lb_access_hl_prev,
+ .handler = provider_buffer_lb_access_hl_prev,
},
{
.cmd = "lb_access_hl_next",
- .handler = master_lb_access_hl_next,
+ .handler = provider_buffer_lb_access_hl_next,
},
{
.cmd = "lb_access_activate",
- .handler = master_lb_access_activate,
+ .handler = provider_buffer_lb_access_activate,
},
{
- .cmd = "lb_access_value_change",
- .handler = master_lb_access_value_change,
+ .cmd = "lb_access_action_up",
+ .handler = provider_buffer_lb_access_action_up,
},
{
- .cmd = "update_mode",
- .handler = master_update_mode,
+ .cmd = "lb_access_action_down",
+ .handler = provider_buffer_lb_access_action_down,
},
{
.cmd = "lb_access_unhighlight",
- .handler = master_lb_access_unhighlight,
+ .handler = provider_buffer_lb_access_unhighlight,
},
{
.cmd = "lb_access_scroll_down",
- .handler = master_lb_access_scroll_down,
+ .handler = provider_buffer_lb_access_scroll_down,
},
{
.cmd = "lb_access_scroll_move",
- .handler = master_lb_access_scroll_move,
+ .handler = provider_buffer_lb_access_scroll_move,
},
{
.cmd = "lb_access_scroll_up",
- .handler = master_lb_access_scroll_up,
+ .handler = provider_buffer_lb_access_scroll_up,
+ },
+ {
+ .cmd = "update_mode",
+ .handler = master_update_mode,
},
{
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
#include <dlog.h>
#include <livebox-errno.h>
+#include <livebox-service.h> /* LB_ACCESS_STATUS_ERROR */
#include "dlist.h"
#include "util.h"
return NULL;
}
+struct packet *provider_buffer_pd_access_action_up(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTION_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_action_down(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTION_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_MOVE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_unhighlight(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_UNHIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_hl(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_hl_prev(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT_PREV, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_hl_next(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT_NEXT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_pd_access_activate(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_PD, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTIVATE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_unhighlight(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_UNHIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_hl(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_hl_prev(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT_PREV, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_hl_next(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_HIGHLIGHT_NEXT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_action_up(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTION_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_action_down(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTION_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_scroll_down(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_scroll_move(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_MOVE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_scroll_up(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_SCROLL_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
+struct packet *provider_buffer_lb_access_activate(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *pkgname;
+ const char *id;
+ double timestamp;
+ int ret;
+ int x;
+ int y;
+ struct livebox_buffer *info;
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid packet\n");
+ goto out;
+ }
+
+ info = provider_buffer_find_buffer(TYPE_LB, pkgname, id);
+ if (!info) {
+ ErrPrint("Failed to find a buffer [%s:%s]\n", pkgname, id);
+ goto out;
+ }
+
+ if (info->handler) {
+ int w;
+ int h;
+
+ if (provider_buffer_get_size(info, &w, &h, NULL) < 0)
+ ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
+
+ ret = info->handler(info, BUFFER_EVENT_ACTIVATE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+ if (ret < 0)
+ (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
+ else
+ (void)provider_send_access_status(pkgname, id, ret);
+ }
+
+out:
+ return NULL;
+}
+
/* End of a file */
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*