Key down/up, Accessbility events added
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 25 Jan 2013 11:00:14 +0000 (11:00 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 27 Jan 2013 04:06:24 +0000 (04:06 +0000)
Update spec file

Change-Id: I2362e1495b6d6f81a7990b3a0122366190746997

include/provider.h
include/provider_buffer.h
packaging/libprovider.spec
src/provider.c
src/provider_buffer.c

index 7711d58..2e196cf 100644 (file)
@@ -39,6 +39,15 @@ struct event_info {
         } part;
 };
 
+enum access_event {
+       ACCESS_READ,
+       ACCESS_READ_NEXT,
+       ACCESS_READ_PREV,
+       ACCESS_ACTIVATE,
+       ACCESS_UP,
+       ACCESS_DOWN,
+};
+
 struct event_arg {
        enum {
                EVENT_NEW, /*!< Master will send this to create a new livebox instance */
@@ -67,6 +76,9 @@ struct event_arg {
 
                EVENT_LB_PAUSE, /*!< Freeze the update timer of a specified livebox */
                EVENT_LB_RESUME, /*!< Thaw the update timer of a specified livebox */
+
+               EVENT_PD_ACCESS, /* PD: Accessibility event */
+               EVENT_LB_ACCESS, /* LB: Accessibility event */
        } type;
        const char *pkgname; /*!< Package name of a livebox */
        const char *id; /*!< Instance Id of a livebox */
@@ -175,6 +187,24 @@ struct event_arg {
                struct {
                        /*!< */
                } lb_resume;
+
+               struct {
+                       /*!< Accessibility */
+                       enum access_event event;
+                       double x;
+                       double y;
+                       int w;
+                       int h;
+               } lb_access;
+
+               struct {
+                       /*!< Accessibility */
+                       enum access_event event;
+                       double x;
+                       double y;
+                       int w;
+                       int h;
+               } pd_access;
        } info;
 };
 
@@ -209,6 +239,13 @@ struct event_handler {
         */
        int (*pd_create)(struct event_arg *arg, void *data);
        int (*pd_destroy)(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);
 };
 
 /*!
index b712f01..57feac4 100644 (file)
@@ -41,6 +41,9 @@ enum buffer_event {
        BUFFER_EVENT_DOWN, /*!< */
        BUFFER_EVENT_MOVE, /*!< */
        BUFFER_EVENT_UP, /*!< */
+
+       BUFFER_EVENT_KEY_DOWN, /*!< */
+       BUFFER_EVENT_KEY_UP, /*!< */
 };
 
 struct livebox_buffer;
@@ -170,6 +173,22 @@ extern int provider_buffer_pre_render(struct livebox_buffer *info);
  */
 extern int provider_buffer_post_render(struct livebox_buffer *info);
 
+/*!
+ */
+extern struct packet *provider_buffer_lb_key_down(pid_t pid, int handle, const struct packet *packet);
+
+/*!
+ */
+extern struct packet *provider_buffer_lb_key_up(pid_t pid, int handle, const struct packet *packet);
+
+/*!
+ */
+extern struct packet *provider_buffer_pd_key_down(pid_t pid, int handle, const struct packet *packet);
+
+/*!
+ */
+extern struct packet *provider_buffer_pd_key_up(pid_t pid, int handle, const struct packet *packet);
+
 #ifdef __cplusplus
 }
 #endif
index 78be136..3a13bfa 100644 (file)
@@ -1,8 +1,8 @@
 Name: libprovider
-Summary: Library for the development of a livebox data provider
-Version: 0.5.9
+Summary: Library for developing the livebox service provider.
+Version: 0.5.10
 Release: 1
-Group: main/app
+Group: framework/livebox
 License: Flora License
 Source0: %{name}-%{version}.tar.gz
 BuildRequires: cmake, gettext-tools, coreutils
@@ -20,10 +20,12 @@ BuildRequires: pkgconfig(dri2proto)
 BuildRequires: pkgconfig(xdamage)
 
 %description
-Livebox data provider development library
+Supporting the commnuncation channel with master service for livebox remote view.
+API for accessing the remote buffer of liveboxes.
+Feature for life-cycle management by the master provider.
 
 %package devel
-Summary: Files for livebox data provider development.
+Summary: Header & package configuration files for developing the livebox service provider 
 Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
 
index 217261c..743a61b 100644 (file)
@@ -560,6 +560,214 @@ out:
        return NULL;
 }
 
+struct packet *master_pd_access_read(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.pd_access.w, &arg.info.pd_access.h,
+                                        &timestamp,
+                                        &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_PD_ACCESS;
+       arg.info.pd_access.event = ACCESS_READ;
+       if (s_info.table.pd_access)
+               ret = s_info.table.pd_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
+struct packet *master_pd_access_read_prev(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.pd_access.w, &arg.info.pd_access.h,
+                                        &timestamp,
+                                        &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_PD_ACCESS;
+       arg.info.pd_access.event = ACCESS_READ_PREV;
+       if (s_info.table.pd_access)
+               ret = s_info.table.pd_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
+struct packet *master_pd_access_read_next(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.pd_access.w, &arg.info.pd_access.h,
+                                        &timestamp,
+                                        &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_PD_ACCESS;
+       arg.info.pd_access.event = ACCESS_READ_NEXT;
+       if (s_info.table.pd_access)
+               ret = s_info.table.pd_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+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;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.pd_access.w, &arg.info.pd_access.h,
+                                        &timestamp,
+                                        &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_PD_ACCESS;
+       arg.info.pd_access.event = ACCESS_ACTIVATE;
+       if (s_info.table.pd_access)
+               ret = s_info.table.pd_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
+struct packet *master_lb_access_read(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.lb_access.w, &arg.info.lb_access.h,
+                                        &timestamp,
+                                        &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_LB_ACCESS;
+       arg.info.lb_access.event = ACCESS_READ;
+       if (s_info.table.lb_access)
+               ret = s_info.table.lb_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
+struct packet *master_lb_access_read_prev(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.lb_access.w, &arg.info.lb_access.h,
+                                        &timestamp,
+                                        &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_LB_ACCESS;
+       arg.info.lb_access.event = ACCESS_READ_PREV;
+       if (s_info.table.lb_access)
+               ret = s_info.table.lb_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
+struct packet *master_lb_access_read_next(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       double timestamp;
+       int ret;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.lb_access.w, &arg.info.lb_access.h,
+                                        &timestamp,
+                                        &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_LB_ACCESS;
+       arg.info.lb_access.event = ACCESS_READ_NEXT;
+       if (s_info.table.lb_access)
+               ret = s_info.table.lb_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+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;
+
+       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+                                        &arg.info.lb_access.w, &arg.info.lb_access.h,
+                                        &timestamp,
+                                        &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
+       {
+               ErrPrint("Invalid packet\n");
+               goto out;
+       }
+
+       arg.type = EVENT_LB_ACCESS;
+       arg.info.lb_access.event = ACCESS_ACTIVATE;
+       if (s_info.table.lb_access)
+               ret = s_info.table.lb_access(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
 static struct method s_table[] = {
        /*!< For the buffer type */
        {
@@ -611,6 +819,22 @@ static struct method s_table[] = {
                .handler = provider_buffer_lb_mouse_leave,
        },
        {
+               .cmd = "lb_key_down",
+               .handler = provider_buffer_lb_key_down,
+       },
+       {
+               .cmd = "lb_key_up",
+               .handler = provider_buffer_lb_key_up,
+       },
+       {
+               .cmd = "pd_key_down",
+               .handler = provider_buffer_pd_key_down,
+       },
+       {
+               .cmd = "pd_key_up",
+               .handler = provider_buffer_pd_key_up,
+       },
+       {
                .cmd = "lb_pause",
                .handler = master_lb_pause,
        },
@@ -671,6 +895,38 @@ static struct method s_table[] = {
                .handler = master_resume, /* timestamp, ret */
        },
        {
+               .cmd = "pd_access_read",
+               .handler = master_pd_access_read,
+       },
+       {
+               .cmd = "pd_access_read_prev",
+               .handler = master_pd_access_read_prev,
+       },
+       {
+               .cmd = "pd_access_read_next",
+               .handler = master_pd_access_read_next,
+       },
+       {
+               .cmd = "pd_access_activate",
+               .handler = master_pd_access_activate,
+       },
+       {
+               .cmd = "lb_access_read",
+               .handler = master_lb_access_read,
+       },
+       {
+               .cmd = "lb_access_read_prev",
+               .handler = master_lb_access_read_prev,
+       },
+       {
+               .cmd = "lb_access_read_next",
+               .handler = master_lb_access_read_next,
+       },
+       {
+               .cmd = "lb_access_activate",
+               .handler = master_lb_access_activate,
+       },
+       {
                .cmd = NULL,
                .handler = NULL,
        },
index 0871a00..906dcb0 100644 (file)
@@ -455,6 +455,64 @@ int provider_buffer_fini(void)
        return fb_fini();
 }
 
+struct packet *provider_buffer_lb_key_down(pid_t pid, int handle, const struct packet *packet)
+{
+       const char *pkgname;
+       const char *id;
+       int w;
+       int h;
+       double x;
+       double y;
+       double timestamp;
+       struct livebox_buffer *info;
+
+       if (packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, &timestamp, &x, &y) != 7) {
+               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)
+               (void)info->handler(info, BUFFER_EVENT_KEY_DOWN, timestamp, x, y, info->data);
+
+out:
+       return NULL;
+}
+
+struct packet *provider_buffer_lb_key_up(pid_t pid, int handle, const struct packet *packet)
+{
+       const char *pkgname;
+       const char *id;
+       int w;
+       int h;
+       double x;
+       double y;
+       double timestamp;
+       struct livebox_buffer *info;
+
+       if (packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, &timestamp, &x, &y) != 7) {
+               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)
+               (void)info->handler(info, BUFFER_EVENT_KEY_UP, timestamp, x, y, info->data);
+
+out:
+       return NULL;
+}
+
 struct packet *provider_buffer_lb_mouse_enter(pid_t pid, int handle, const struct packet *packet)
 {
        const char *pkgname;
@@ -600,6 +658,64 @@ out:
        return NULL;
 }
 
+struct packet *provider_buffer_pd_key_down(pid_t pid, int handle, const struct packet *packet)
+{
+       const char *pkgname;
+       const char *id;
+       int w;
+       int h;
+       double x;
+       double y;
+       double timestamp;
+       struct livebox_buffer *info;
+
+       if (packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, &timestamp, &x, &y) != 7) {
+               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)
+               (void)info->handler(info, BUFFER_EVENT_KEY_DOWN, timestamp, x, y, info->data);
+
+out:
+       return NULL;
+}
+
+struct packet *provider_buffer_pd_key_up(pid_t pid, int handle, const struct packet *packet)
+{
+       const char *pkgname;
+       const char *id;
+       int w;
+       int h;
+       double x;
+       double y;
+       double timestamp;
+       struct livebox_buffer *info;
+
+       if (packet_get(packet, "ssiiddd", &pkgname, &id, &w, &h, &timestamp, &x, &y) != 7) {
+               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)
+               (void)info->handler(info, BUFFER_EVENT_KEY_UP, timestamp, x, y, info->data);
+
+out:
+       return NULL;
+}
+
 struct packet *provider_buffer_pd_mouse_enter(pid_t pid, int handle, const struct packet *packet)
 {
        const char *pkgname;