summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-04-30 21:43:31 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-04-30 21:43:31 +0900
commit477b6ca70a186d4fd186f42e434dd0c921905b31 (patch)
tree68a9f2a5109cf7ce3816212a9a6e2d433381d1be
parent703df2f8053886bd95a153f893852bdd72a7259f (diff)
downloadlivebox-477b6ca70a186d4fd186f42e434dd0c921905b31.tar.gz
livebox-477b6ca70a186d4fd186f42e434dd0c921905b31.tar.bz2
livebox-477b6ca70a186d4fd186f42e434dd0c921905b31.zip
Udpate virtual window for accessibility Change-Id: Ibbf9d460262491a1e2c01d7f67589ac0e229393a
-rw-r--r--LICENSE26
-rw-r--r--include/debug.h2
-rw-r--r--include/dlist.h2
-rw-r--r--include/livebox.h2
-rw-r--r--include/livebox_PG.h2
-rw-r--r--include/util.h2
-rw-r--r--packaging/liblivebox.spec2
-rw-r--r--src/dlist.c2
-rw-r--r--src/livebox.c2
-rw-r--r--src/util.c2
-rw-r--r--src/virtual_window.c117
11 files changed, 138 insertions, 23 deletions
diff --git a/LICENSE b/LICENSE
index fd90a36..571fe79 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
Flora License
-Version 1.0, April, 2013
+Version 1.1, April, 2013
http://floralicense.org/license/
@@ -119,17 +119,17 @@ Object form, provided that You meet the following conditions:
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
@@ -192,7 +192,7 @@ identification within third-party archives.
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
diff --git a/include/debug.h b/include/debug.h
index ae273b7..5904b4c 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/include/dlist.h b/include/dlist.h
index 9f34dab..6ce75e0 100644
--- a/include/dlist.h
+++ b/include/dlist.h
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/include/livebox.h b/include/livebox.h
index 1a80a4c..417f687 100644
--- a/include/livebox.h
+++ b/include/livebox.h
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/include/livebox_PG.h b/include/livebox_PG.h
index 94fb941..67a71d8 100644
--- a/include/livebox_PG.h
+++ b/include/livebox_PG.h
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/include/util.h b/include/util.h
index d3b17a0..ad03f26 100644
--- a/include/util.h
+++ b/include/util.h
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/packaging/liblivebox.spec b/packaging/liblivebox.spec
index 612148c..3c3df9f 100644
--- a/packaging/liblivebox.spec
+++ b/packaging/liblivebox.spec
@@ -1,6 +1,6 @@
Name: liblivebox
Summary: Library for the development of a livebox
-Version: 0.2.2
+Version: 0.3.0
Release: 1
Group: HomeTF/Livebox
License: Flora License
diff --git a/src/dlist.c b/src/dlist.c
index 59e1a94..05800e3 100644
--- a/src/dlist.c
+++ b/src/dlist.c
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/src/livebox.c b/src/livebox.c
index 704ca5e..d3d1810 100644
--- a/src/livebox.c
+++ b/src/livebox.c
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/src/util.c b/src/util.c
index bdbb758..fd67d74 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,7 +1,7 @@
/*
* 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
*
diff --git a/src/virtual_window.c b/src/virtual_window.c
index 328126d..30ffe40 100644
--- a/src/virtual_window.c
+++ b/src/virtual_window.c
@@ -1,3 +1,4 @@
+#include <Elementary.h>
#include <Ecore_Evas.h>
#include <Evas.h>
@@ -20,6 +21,8 @@ struct info {
struct livebox_buffer *handle; /*!< Livebox buffer handle */
Evas_Object *window; /*!< Parent evas object - WARN: Incompatible with the elm_win object */
int is_hw; /*!< 1 if a buffer is created on the H/W accelerated place or 0 */
+
+ Evas_Object *elm_parent;
};
/*!
@@ -28,6 +31,8 @@ struct info {
*/
static int event_handler_cb(struct livebox_buffer *handler, enum buffer_event evt, double timestamp, double x, double y, void *data)
{
+ Elm_Access_Action_Info *info;
+ Elm_Access_Action_Type action;
struct info *info = data;
Evas *e;
int ix;
@@ -70,9 +75,102 @@ static int event_handler_cb(struct livebox_buffer *handler, enum buffer_event ev
evas_event_feed_mouse_up(e, 1, EVAS_BUTTON_NONE, timestamp, NULL);
evas_event_feed_mouse_out(e, timestamp + 0.01f, NULL); /* + 0.1f just for fake event */
break;
+ case BUFFER_EVENT_HIGHLIGHT:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+
+ action = ELM_ACCESS_ACTION_HIGHLIGHT;
+ info->x = x;
+ info->y = y;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT: %dx%d returns %d\n", x, y, ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_HIGHLIGHT_NEXT:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
+ info->highlight_cycle = EINA_FALSE;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT_NEXT, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_LAST : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_HIGHLIGHT_PREV:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
+ info->highlight_cycle = EINA_FALSE;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT_PREV, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_FIRST : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_ACTIVATE:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_ACTIVATE;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_ACTIVATE, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_ACTION_UP:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_UP;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_ACTION(%d), returns %d\n", down, ret);
+ break;
+ case BUFFER_EVENT_ACTION_DOWN:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_DOWN;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_ACTION(%d), returns %d\n", down, ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_SCROLL_UP:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_SCROLL;
+ info->x = ix;
+ info->y = iy;
+ info->mouse_type = 0;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_SCROLL_MOVE:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_SCROLL;
+ info->x = ix;
+ info->y = iy;
+ info->mouse_type = -1;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_SCROLL_DOWN:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_SCROLL;
+ info->x = ix;
+ info->y = iy;
+ info->mouse_type = 1;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
+ case BUFFER_EVENT_UNHIGHLIGHT:
+ if (!info->elm_parent)
+ return LB_ACCESS_STATUS_ERROR;
+ action = ELM_ACCESS_ACTION_UNHIGHLIGHT;
+ ret = elm_access_action(info->elm_parent, action, info);
+ DbgPrint("ACCESS_UNHIGHLIGHT, returns %d\n", ret);
+ ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+ break;
default:
LOGD("Unhandled buffer event (%d)\n", evt);
- break;
+ return -EINVAL;
}
return 0;
@@ -164,6 +262,8 @@ static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
Ecore_Evas *ee;
struct info *info = data;
+ evas_object_del(obj, "info");
+
ee = ecore_evas_ecore_evas_get(e);
if (!ee)
return;
@@ -252,10 +352,25 @@ PUBLIC Evas_Object *livebox_virtual_window_add(const char *id, int width, int he
evas_object_color_set(info->window, 0, 0, 0, 0);
evas_object_event_callback_add(info->window, EVAS_CALLBACK_DEL, del_cb, info);
evas_object_event_callback_add(info->window, EVAS_CALLBACK_RESIZE, resize_cb, info);
+ evas_object_data_set(info->window, "info", info);
return info->window;
}
+PUBLIC int livebox_virtual_window_set_parent_elm(Evas_Object *win, Evas_Object *parent_elm)
+{
+ struct info *info;
+ info = evas_object_data_get(win, "info");
+ if (!info)
+ return LB_STATUS_ERROR_INVALID;
+
+ if (info->parent_elm)
+ DbgPrint("Parent object will be replaced: %p\n", info->parent_elm);
+
+ info->parent_elm = parent_elm;
+ return 0;
+}
+
PUBLIC int livebox_virtual_window_del(Evas_Object *virtual_win)
{
evas_object_del(virtual_win);