Init e_view 45/315145/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 25 Jul 2024 05:52:15 +0000 (14:52 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 25 Jul 2024 12:05:59 +0000 (21:05 +0900)
e_view replace evas object.

Change-Id: I14485596ef6d6d05334340b0816c8580ea8e6ef9

31 files changed:
packaging/enlightenment.spec
src/bin/Makefile.mk
src/bin/core/e_canvas.c [new file with mode: 0644]
src/bin/core/e_view.c [new file with mode: 0644]
src/bin/core/e_view_client.c [new file with mode: 0644]
src/bin/core/e_view_client_intern.h [new file with mode: 0644]
src/bin/core/e_view_edje.c [new file with mode: 0644]
src/bin/core/e_view_edje_intern.h [new file with mode: 0644]
src/bin/core/e_view_event.c [new file with mode: 0644]
src/bin/core/e_view_image.c [new file with mode: 0644]
src/bin/core/e_view_intern.h [new file with mode: 0644]
src/bin/core/e_view_rect.c [new file with mode: 0644]
src/bin/core/e_view_tree.c [new file with mode: 0644]
src/include/e_canvas.h [new file with mode: 0644]
src/include/e_map.h
src/include/e_view.h [new file with mode: 0644]
src/include/e_view_client.h [new file with mode: 0644]
src/include/e_view_edje.h [new file with mode: 0644]
src/include/e_view_image.h [new file with mode: 0644]
src/include/e_view_rect.h [new file with mode: 0644]
tests/Makefile.am
tests/evas_wrapper.cpp [new file with mode: 0644]
tests/evas_wrapper.h [new file with mode: 0644]
tests/evas_wrapper_intern.h [new file with mode: 0755]
tests/tc-e_canvas.cpp [new file with mode: 0644]
tests/tc-e_view.cpp [new file with mode: 0644]
tests/tc-e_view_event.cpp [new file with mode: 0644]
tests/tc-e_view_image.cpp [new file with mode: 0755]
tests/tc-e_view_rect.cpp [new file with mode: 0644]
tests/tc-main.cpp
tests/tc-main.h

index 067b0dc..e262b9c 100644 (file)
@@ -139,6 +139,9 @@ ln -sf %{_bindir}/enlightenment_input_key %{buildroot}%{_bindir}/input_keyevent
 mkdir -p %{buildroot}/%{_sysconfdir}/resourced/vip-process.d
 cp %{SOURCE1002} %{buildroot}/%{_sysconfdir}/resourced/vip-process.d/enlightenment.conf
 
+%check
+%{buildroot}%{_bindir}/enlightenment-tests
+
 %post
 /usr/bin/chsmack %{_bindir}/input_keyevent* -a "System::Tools"
 /usr/bin/chsmack %{_bindir}/enlightenment_input_key* -a "System::Tools"
index d42b141..5610289 100644 (file)
@@ -124,7 +124,14 @@ src/include/e_map.h \
 src/include/e_input_event.h \
 src/include/e_device.h \
 src/include/e_types.h \
-src/include/e_input_thread_client.h
+src/include/e_input_thread_client.h \
+src/include/e_canvas.h \
+src/include/e_view.h \
+src/include/e_view_rect.h \
+src/include/e_view_image.h \
+src/include/e_view_client.h \
+src/include/e_view_edje.h
+
 
 enlightenment_src = \
 src/bin/e_comp_screen.c \
@@ -140,6 +147,14 @@ src/bin/core/e_pixmap.c \
 src/bin/core/e_zone.c \
 src/bin/core/e_client_video.c \
 src/bin/core/e_zone_video.c \
+src/bin/core/e_view.c \
+src/bin/core/e_view_tree.c \
+src/bin/core/e_view_rect.c \
+src/bin/core/e_canvas.c \
+src/bin/core/e_view_image.c \
+src/bin/core/e_view_client.c \
+src/bin/core/e_view_edje.c \
+src/bin/core/e_view_event.c \
 src/bin/server/e_compositor.c \
 src/bin/server/e_comp_wl.c \
 src/bin/server/e_comp_wl_data.c \
diff --git a/src/bin/core/e_canvas.c b/src/bin/core/e_canvas.c
new file mode 100644 (file)
index 0000000..5acbf09
--- /dev/null
@@ -0,0 +1,339 @@
+#include "e_intern.h"
+#include "e_view_intern.h"
+
+#define E_CANVAS_LAYER_TREE_FOREACH(layer_tree, canvas, layer) \
+   for (layer = E_CANVAS_LAYER_BOTTOM, \
+        layer_tree = _canvas_layer_tree_get(canvas, layer); \
+        layer_tree != NULL; \
+        layer_tree = _canvas_layer_tree_get(canvas, ++layer))
+
+E_View_Tree_Impl layer_tree_impl;
+
+static void _canvas_cb_render_pre(void *data, Evas *e, void *event_info);
+static void _canvas_cb_render_post(void *data, Evas *e, void *event_info);
+static void _canvas_cb_render_flush_pre(void *data, Evas *e, void *event_info);
+static void _canvas_cb_render_flush_post(void *data, Evas *e, void *event_info);
+static void _canvas_tree_init(E_Canvas *canvas);
+static E_Canvas_Layer_Tree *_canvas_layer_tree_get(E_Canvas *canvas, E_Canvas_Layer layer);
+
+EINTERN E_Canvas *
+e_canvas_create(Evas *evas)
+{
+   E_Canvas *canvas;
+
+   canvas = malloc(sizeof(*canvas));
+   if (!canvas)
+     return NULL;
+
+   canvas->evas = evas;
+
+   _canvas_tree_init(canvas);
+
+   wl_signal_init(&canvas->events.destroy);
+   wl_signal_init(&canvas->events.render_pre);
+   wl_signal_init(&canvas->events.render_post);
+   wl_signal_init(&canvas->events.render_flush_pre);
+   wl_signal_init(&canvas->events.render_flush_post);
+
+   evas_event_callback_add(evas, EVAS_CALLBACK_RENDER_PRE, _canvas_cb_render_pre, canvas);
+   evas_event_callback_add(evas, EVAS_CALLBACK_RENDER_POST, _canvas_cb_render_post, canvas);
+   evas_event_callback_add(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _canvas_cb_render_flush_pre, canvas);
+   evas_event_callback_add(evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _canvas_cb_render_flush_post, canvas);
+
+   return canvas;
+}
+
+EINTERN void
+e_canvas_destroy(E_Canvas *canvas)
+{
+   wl_signal_emit_mutable(&canvas->events.destroy, canvas);
+
+   // TODO
+   // cleanup canvas->layers[]
+
+   evas_event_callback_del(canvas->evas, EVAS_CALLBACK_RENDER_PRE, _canvas_cb_render_pre);
+   evas_event_callback_del(canvas->evas, EVAS_CALLBACK_RENDER_POST, _canvas_cb_render_post);
+   evas_event_callback_del(canvas->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _canvas_cb_render_flush_pre);
+   evas_event_callback_del(canvas->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _canvas_cb_render_flush_post);
+
+   free(canvas);
+}
+
+EINTERN void
+e_canvas_destroy_listener_add(E_Canvas *canvas, struct wl_listener *listener)
+{
+   wl_signal_add(&canvas->events.destroy, listener);
+}
+
+EINTERN void
+e_canvas_render_pre_listener_add(E_Canvas *canvas, struct wl_listener *listener)
+{
+   wl_signal_add(&canvas->events.render_pre, listener);
+}
+
+EINTERN void
+e_canvas_render_post_listener_add(E_Canvas *canvas, struct wl_listener *listener)
+{
+   wl_signal_add(&canvas->events.render_post, listener);
+}
+
+EINTERN void
+e_canvas_render_flush_pre_listener_add(E_Canvas *canvas, struct wl_listener *listener)
+{
+   wl_signal_add(&canvas->events.render_flush_pre, listener);
+}
+
+EINTERN void
+e_canvas_render_flush_post_listener_add(E_Canvas *canvas, struct wl_listener *listener)
+{
+   wl_signal_add(&canvas->events.render_flush_post, listener);
+}
+
+E_API E_View_Tree *
+e_canvas_layer_view_tree_get(E_Canvas *canvas, E_Canvas_Layer layer)
+{
+   E_Canvas_Layer_Tree *layer_tree;
+
+   layer_tree = _canvas_layer_tree_get(canvas, layer);
+   if (!layer_tree)
+     return NULL;
+
+   return &layer_tree->tree;
+}
+
+E_API void
+e_canvas_tree_for_each(E_Canvas *canvas, E_View_Iterator_Cb iterator, void *user_data)
+{
+   e_view_for_each_view(&canvas->tree.view, iterator, user_data);
+}
+
+E_API void
+e_canvas_tree_for_each_reverse(E_Canvas *canvas, E_View_Iterator_Cb iterator, void *user_data)
+{
+   e_view_for_each_view_reverse(&canvas->tree.view, iterator, user_data);
+}
+
+EINTERN E_Canvas_Layer
+e_canvas_layer_find(E_Canvas *canvas, E_View *view)
+{
+   E_View_Tree *tree, *backup;
+   E_Canvas_Layer layer;
+
+   if (view->type == E_VIEW_TYPE_TREE)
+     tree = e_view_tree_from_view(view);
+   else
+     tree = view->parent;
+
+   backup = tree;
+   while (tree->view.parent)
+     {
+        backup = tree->view.parent;
+        if (backup->view.parent == NULL)
+          backup = tree;
+        tree = tree->view.parent;
+     }
+
+   for (layer = E_CANVAS_LAYER_BOTTOM; layer <= E_CANVAS_LAYER_MAX; layer++)
+     {
+        if (backup == e_canvas_layer_view_tree_get(canvas, layer))
+          return layer;
+     }
+
+   return E_CANVAS_LAYER_MAX;
+}
+
+EINTERN void
+e_canvas_damage_rectangle_add(E_Canvas *canvas, int x, int y, int w, int h)
+{
+   evas_damage_rectangle_add(canvas->evas, x, y, w, h);
+}
+
+EINTERN E_Canvas_Layer_Tree *
+e_canvas_layer_tree_from_tree(E_View_Tree *tree)
+{
+   E_Canvas_Layer_Tree *layer_tree;
+
+   assert(tree->impl == &layer_tree_impl);
+
+   return wl_container_of(tree, layer_tree, tree);
+}
+
+E_API E_View *
+e_canvas_top_get(E_Canvas *canvas)
+{
+   return e_view_tree_top_get(&canvas->tree);
+}
+
+E_API E_View *
+e_canvas_bottom_get(E_Canvas *canvas)
+{
+   return e_view_tree_bottom_get(&canvas->tree);
+}
+
+static void
+_canvas_cb_render_pre(void *data, Evas *e, void *event_info)
+{
+   E_Canvas *canvas = data;
+
+   wl_signal_emit_mutable(&canvas->events.render_pre, canvas);
+}
+
+static void
+_canvas_cb_render_post(void *data, Evas *e, void *event_info)
+{
+   E_Canvas *canvas = data;
+
+   wl_signal_emit_mutable(&canvas->events.render_post, canvas);
+}
+
+static void
+_canvas_cb_render_flush_pre(void *data, Evas *e, void *event_info)
+{
+   E_Canvas *canvas = data;
+
+   wl_signal_emit_mutable(&canvas->events.render_flush_pre, canvas);
+}
+
+static void
+_canvas_cb_render_flush_post(void *data, Evas *e, void *event_info)
+{
+   E_Canvas *canvas = data;
+
+   wl_signal_emit_mutable(&canvas->events.render_flush_post, canvas);
+}
+
+static E_Canvas_Layer_Tree *
+_canvas_layer_tree_get(E_Canvas *canvas, E_Canvas_Layer layer)
+{
+   if (layer < E_CANVAS_LAYER_BOTTOM || layer > E_CANVAS_LAYER_MAX)
+     return NULL;
+
+   return &canvas->layers[layer];
+}
+
+static E_Layer
+_canvas_layer_map_to(E_Canvas_Layer layer)
+{
+   switch (layer)
+     {
+      case E_CANVAS_LAYER_BOTTOM: return E_LAYER_BOTTOM;
+      case E_CANVAS_LAYER_BG: return E_LAYER_BG;
+      case E_CANVAS_LAYER_DESKTOP: return E_LAYER_DESKTOP;
+      case E_CANVAS_LAYER_DESKTOP_TOP: return E_LAYER_DESKTOP_TOP;
+      case E_CANVAS_LAYER_CLIENT_DESKTOP: return E_LAYER_CLIENT_DESKTOP;
+      case E_CANVAS_LAYER_CLIENT_BELOW: return E_LAYER_CLIENT_BELOW;
+      case E_CANVAS_LAYER_CLIENT_NORMAL: return E_LAYER_CLIENT_NORMAL;
+      case E_CANVAS_LAYER_CLIENT_ABOVE: return E_LAYER_CLIENT_ABOVE;
+      case E_CANVAS_LAYER_CLIENT_EDGE: return E_LAYER_CLIENT_EDGE;
+      case E_CANVAS_LAYER_CLIENT_FULLSCREEN: return E_LAYER_CLIENT_FULLSCREEN;
+      case E_CANVAS_LAYER_CLIENT_EDGE_FULLSCREEN: return E_LAYER_CLIENT_EDGE_FULLSCREEN;
+      case E_CANVAS_LAYER_CLIENT_POPUP: return E_LAYER_CLIENT_POPUP;
+      case E_CANVAS_LAYER_CLIENT_TOP: return E_LAYER_CLIENT_TOP;
+      case E_CANVAS_LAYER_CLIENT_PRIO: return E_LAYER_CLIENT_PRIO;
+      case E_CANVAS_LAYER_CLIENT_NOTIFICATION_LOW: return E_LAYER_CLIENT_NOTIFICATION_LOW;
+      case E_CANVAS_LAYER_CLIENT_NOTIFICATION_NORMAL: return E_LAYER_CLIENT_NOTIFICATION_NORMAL;
+      case E_CANVAS_LAYER_CLIENT_NOTIFICATION_HIGH: return E_LAYER_CLIENT_NOTIFICATION_HIGH;
+      case E_CANVAS_LAYER_CLIENT_NOTIFICATION_TOP: return E_LAYER_CLIENT_NOTIFICATION_TOP;
+      case E_CANVAS_LAYER_CLIENT_ALERT_LOW: return E_LAYER_CLIENT_ALERT_LOW;
+      case E_CANVAS_LAYER_CLIENT_ALERT: return E_LAYER_CLIENT_ALERT;
+      case E_CANVAS_LAYER_CLIENT_ALERT_HIGH: return E_LAYER_CLIENT_ALERT_HIGH;
+      case E_CANVAS_LAYER_CLIENT_DRAG: return E_LAYER_CLIENT_DRAG;
+      case E_CANVAS_LAYER_CLIENT_CURSOR: return E_LAYER_CLIENT_CURSOR;
+      case E_CANVAS_LAYER_POPUP: return E_LAYER_POPUP;
+      case E_CANVAS_LAYER_EFFECT: return E_LAYER_EFFECT;
+      case E_CANVAS_LAYER_DESK_OBJECT_BELOW: return E_LAYER_DESK_OBJECT_BELOW;
+      case E_CANVAS_LAYER_DESK_OBJECT: return E_LAYER_DESK_OBJECT;
+      case E_CANVAS_LAYER_DESK_OBJECT_ABOVE: return E_LAYER_DESK_OBJECT_ABOVE;
+      case E_CANVAS_LAYER_MENU: return E_LAYER_MENU;
+      case E_CANVAS_LAYER_DESKLOCK: return E_LAYER_DESKLOCK;
+      case E_CANVAS_LAYER_MAX: return E_LAYER_MAX;
+      default: assert(0);
+     }
+}
+
+static void
+_canvas_layer_tree_child_add(E_View_Tree *tree, E_View *child)
+{
+   E_Canvas_Layer layer;
+
+   if (!child->eo)
+     return;
+
+   layer = e_view_layer_index_get(&tree->view);
+   evas_object_layer_set(child->eo, _canvas_layer_map_to(layer));
+}
+
+E_View_Tree_Impl layer_tree_impl = {
+     .child_add = _canvas_layer_tree_child_add,
+};
+
+static void
+_canvas_tree_init(E_Canvas *canvas)
+{
+   E_Canvas_Layer_Tree *layer_tree;
+   E_Canvas_Layer layer;
+
+   e_view_tree_init(&canvas->tree, NULL, NULL);
+   e_view_show(&canvas->tree.view);
+   e_view_reorderable_set(&canvas->tree.view, false);
+
+   E_CANVAS_LAYER_TREE_FOREACH(layer_tree, canvas, layer)
+     {
+        layer_tree->layer = layer;
+        e_view_tree_init(&layer_tree->tree, &layer_tree_impl, &canvas->tree);
+        e_view_show(&layer_tree->tree.view);
+        e_view_reorderable_set(&layer_tree->tree.view, false);
+     }
+}
+
+EINTERN void
+e_canvas_size_get(E_Canvas *canvas, int *width, int *height)
+{
+   evas_output_size_get(canvas->evas, width, height);
+}
+
+EINTERN E_Canvas_Layer
+e_canvas_util_e_layer_map(short e_layer)
+{
+   switch (e_layer)
+     {
+      case E_LAYER_BOTTOM: return E_CANVAS_LAYER_BOTTOM;
+      case E_LAYER_BG: return E_CANVAS_LAYER_BG;
+      case E_LAYER_DESKTOP: return E_CANVAS_LAYER_DESKTOP;
+      case E_LAYER_DESKTOP_TOP: return E_CANVAS_LAYER_DESKTOP_TOP;
+      case E_LAYER_CLIENT_DESKTOP: return E_CANVAS_LAYER_CLIENT_DESKTOP;
+      case E_LAYER_CLIENT_BELOW: return E_CANVAS_LAYER_CLIENT_BELOW;
+      case E_LAYER_CLIENT_NORMAL: return E_CANVAS_LAYER_CLIENT_NORMAL;
+      case E_LAYER_CLIENT_ABOVE: return E_CANVAS_LAYER_CLIENT_ABOVE;
+      case E_LAYER_CLIENT_EDGE: return E_CANVAS_LAYER_CLIENT_EDGE;
+      case E_LAYER_CLIENT_FULLSCREEN: return E_CANVAS_LAYER_CLIENT_FULLSCREEN;
+      case E_LAYER_CLIENT_EDGE_FULLSCREEN: return E_CANVAS_LAYER_CLIENT_EDGE_FULLSCREEN;
+      case E_LAYER_CLIENT_POPUP: return E_CANVAS_LAYER_CLIENT_POPUP;
+      case E_LAYER_CLIENT_TOP: return E_CANVAS_LAYER_CLIENT_TOP;
+      case E_LAYER_CLIENT_PRIO: return E_CANVAS_LAYER_CLIENT_PRIO;
+      case E_LAYER_CLIENT_NOTIFICATION_LOW: return E_CANVAS_LAYER_CLIENT_NOTIFICATION_LOW;
+      case E_LAYER_CLIENT_NOTIFICATION_NORMAL: return E_CANVAS_LAYER_CLIENT_NOTIFICATION_NORMAL;
+      case E_LAYER_CLIENT_NOTIFICATION_HIGH: return E_CANVAS_LAYER_CLIENT_NOTIFICATION_HIGH;
+      case E_LAYER_CLIENT_NOTIFICATION_TOP: return E_CANVAS_LAYER_CLIENT_NOTIFICATION_TOP;
+      case E_LAYER_CLIENT_ALERT_LOW: return E_CANVAS_LAYER_CLIENT_ALERT_LOW;
+      case E_LAYER_CLIENT_ALERT: return E_CANVAS_LAYER_CLIENT_ALERT;
+      case E_LAYER_CLIENT_ALERT_HIGH: return E_CANVAS_LAYER_CLIENT_ALERT_HIGH;
+      case E_LAYER_CLIENT_DRAG: return E_CANVAS_LAYER_CLIENT_DRAG;
+      case E_LAYER_CLIENT_CURSOR: return E_CANVAS_LAYER_CLIENT_CURSOR;
+      case E_LAYER_POPUP: return E_CANVAS_LAYER_POPUP;
+      case E_LAYER_EFFECT: return E_CANVAS_LAYER_EFFECT;
+      case E_LAYER_DESK_OBJECT_BELOW: return E_CANVAS_LAYER_DESK_OBJECT_BELOW;
+      case E_LAYER_DESK_OBJECT: return E_CANVAS_LAYER_DESK_OBJECT;
+      case E_LAYER_DESK_OBJECT_ABOVE: return E_CANVAS_LAYER_DESK_OBJECT_ABOVE;
+      case E_LAYER_MENU: return E_CANVAS_LAYER_MENU;
+      case E_LAYER_DESKLOCK: return E_CANVAS_LAYER_DESKLOCK;
+      case E_LAYER_MAX: return E_CANVAS_LAYER_MAX;
+      default: assert(0);
+     }
+}
+
+EINTERN short
+e_canvas_util_layer_map(E_Canvas_Layer layer)
+{
+   return _canvas_layer_map_to(layer);
+}
diff --git a/src/bin/core/e_view.c b/src/bin/core/e_view.c
new file mode 100644 (file)
index 0000000..f78cf2f
--- /dev/null
@@ -0,0 +1,709 @@
+#include "e_intern.h"
+#include "e_view_intern.h"
+#include "e_map_intern.h"
+
+#include <assert.h>
+#include <stddef.h>
+
+static void
+_view_for_each_view(E_View *view, int lx, int ly, E_View_Iterator_Cb iterator, void *user_data, bool reverse)
+{
+   E_View_Tree *tree;
+   E_View *child;
+
+   lx += view->x;
+   ly += view->y;
+
+   if (view->type == E_VIEW_TYPE_TREE)
+     {
+        tree = e_view_tree_from_view(view);
+        if (!reverse)
+          {
+             wl_list_for_each(child, &tree->children, link)
+                _view_for_each_view(child, lx, ly, iterator, user_data, false);
+          }
+        else
+          {
+             wl_list_for_each_reverse(child, &tree->children, link)
+                _view_for_each_view(child, lx, ly, iterator, user_data, true);
+          }
+     }
+   else
+     {
+        iterator(view, lx, ly, user_data);
+     }
+}
+
+static void
+_view_destroy(E_View *view)
+{
+   E_View_Tree *tree;
+   E_View *child, *tmp;
+
+   wl_signal_emit_mutable(&view->events.destroy, view);
+
+   if (view->type == E_VIEW_TYPE_TREE)
+     {
+        tree = e_view_tree_from_view(view);
+        wl_list_for_each_safe(child, tmp, &tree->children, link)
+          _view_destroy(child);
+     }
+
+   e_view_name_set(view, NULL);
+
+   wl_list_remove(&view->link);
+
+   if (view->impl && view->impl->destroy)
+     view->impl->destroy(view);
+}
+
+static void
+_view_iterator_cb_position_set(E_View *view, int lx, int ly, void *user_data)
+{
+   if (view->eo)
+     evas_object_move(view->eo, lx, ly);
+}
+
+static void
+_view_eo_position_update(E_View *view)
+{
+   int x = 0, y = 0;
+
+   if (view->parent)
+     e_view_coords_get(e_view_tree_view_get(view->parent), &x, &y);
+
+   _view_for_each_view(view, x, y, &_view_iterator_cb_position_set, NULL, false);
+}
+
+static E_View *
+_view_below_get(E_View *view)
+{
+   E_View *below, *top_view;
+
+   if (!view->parent)
+     return NULL;
+
+   if (view->link.prev == &view->parent->children)
+     return _view_below_get(e_view_tree_view_get(view->parent));
+
+   below = wl_container_of(view->link.prev, below, link);
+   if (below->type != E_VIEW_TYPE_TREE)
+     return below;
+
+   top_view = e_view_tree_top_get(e_view_tree_from_view(below));
+   if (top_view)
+     return top_view;
+
+   return _view_below_get(below);
+}
+
+static E_View *
+_view_above_get(E_View *view)
+{
+   E_View *above, *bottom_view;
+
+   if (!view->parent)
+     return NULL;
+
+   if (view->link.next == &view->parent->children)
+     return _view_above_get(e_view_tree_view_get(view->parent));
+
+   above = wl_container_of(view->link.next, above, link);
+   if (above->type != E_VIEW_TYPE_TREE)
+     return above;
+
+   bottom_view = e_view_tree_bottom_get(e_view_tree_from_view(above));
+   if (bottom_view)
+     return bottom_view;
+
+   return _view_above_get(above);
+}
+
+typedef struct
+{
+   E_View *target_view;
+   void (*restack_func)(Evas_Object *obj, Evas_Object *target_obj);
+} E_View_Stack_Update_Data;
+
+static void
+_view_iterator_cb_stack_update(E_View *view, int lx, int ly, void *user_data)
+{
+   E_View_Stack_Update_Data *data = user_data;
+
+   if (view->eo)
+     {
+        data->restack_func(view->eo, data->target_view->eo);
+        data->target_view = view;
+     }
+}
+
+static void
+_view_eo_stack_update(E_View *view)
+{
+   E_View_Tree *tree;
+   E_View *below_view, *above_view;
+   E_View_Stack_Update_Data data;
+
+   tree = e_view_tree_try_from_view(view);
+   if (tree && wl_list_empty(&tree->children))
+     return;
+
+   below_view = _view_below_get(view);
+   if (below_view)
+     {
+        data.target_view = below_view;
+        data.restack_func = evas_object_stack_above;
+        _view_for_each_view(view, 0, 0, &_view_iterator_cb_stack_update, &data, false);
+        return;
+     }
+
+   above_view = _view_above_get(view);
+   if (above_view)
+     {
+        data.target_view = above_view;
+        data.restack_func = evas_object_stack_below;
+        _view_for_each_view(view, 0, 0, &_view_iterator_cb_stack_update, &data, false);
+     }
+}
+
+static void
+_e_view_events_init(E_View *view)
+{
+   int i;
+
+   for (i = 0; i < E_VIEW_EVENT_MAX; i++)
+     wl_signal_init(&view->signals[i]);
+
+   wl_signal_init(&view->events.destroy);
+   wl_signal_init(&view->events.show);
+   wl_signal_init(&view->events.hide);
+   wl_signal_init(&view->events.reposition);
+   wl_signal_init(&view->events.restack);
+}
+
+EINTERN void
+e_view_init(E_View *view, E_View_Type type, E_View_Impl *impl, Evas_Object *eo, E_View_Tree *parent)
+{
+   view->type = type;
+   view->eo = eo;
+   view->impl = impl;
+   view->parent = parent;
+   view->x = 0;
+   view->y = 0;
+   view->name = NULL;
+   view->visible = false;
+   view->reorderable = true;
+   view->map = NULL;
+
+   wl_list_init(&view->link);
+
+   _e_view_events_init(view);
+
+   if (parent)
+     {
+        e_view_tree_child_add(parent, view);
+
+        if (type != E_VIEW_TYPE_TREE)
+          {
+             _view_eo_stack_update(view);
+             _view_eo_position_update(view);
+          }
+     }
+}
+
+E_API void
+e_view_destroy(E_View *view)
+{
+   _view_destroy(view);
+}
+
+E_API E_Canvas *
+e_view_root_get(E_View *view)
+{
+   E_Canvas *canvas;
+   E_View_Tree *tree;
+
+   if (view->type == E_VIEW_TYPE_TREE)
+     tree = e_view_tree_from_view(view);
+   else
+     tree = view->parent;
+
+   assert(tree);
+
+   while (tree->view.parent)
+     tree = tree->view.parent;
+
+   canvas = wl_container_of(tree, canvas, tree);
+
+   return canvas;
+}
+
+E_API void
+e_view_for_each_view(E_View *view, E_View_Iterator_Cb iterator, void *user_data)
+{
+   _view_for_each_view(view, 0, 0, iterator, user_data, false);
+}
+
+E_API void
+e_view_for_each_view_reverse(E_View *view, E_View_Iterator_Cb iterator, void *user_data)
+{
+   _view_for_each_view(view, 0, 0, iterator, user_data, true);
+}
+
+E_API E_View *
+e_view_above_get(E_View *view)
+{
+   return _view_above_get(view);
+}
+
+E_API E_View *
+e_view_below_get(E_View *view)
+{
+   return _view_below_get(view);
+}
+
+E_API void
+e_view_place_above(E_View *view, E_View *sibling)
+{
+   assert(view != sibling);
+   assert(view->parent && sibling->parent);
+   assert(view->parent == sibling->parent);
+
+   if (!view->reorderable)
+     return;
+
+   if (view->link.prev == &sibling->link)
+     return;
+
+   wl_list_remove(&view->link);
+   wl_list_insert(&sibling->link, &view->link);
+
+   if ((view->eo) && (sibling->eo))
+     evas_object_stack_above(view->eo, sibling->eo);
+   else
+     _view_eo_stack_update(view);
+
+   wl_signal_emit_mutable(&view->events.restack, view);
+}
+
+E_API void
+e_view_place_below(E_View *view, E_View *sibling)
+{
+   assert(view != sibling);
+   assert(view->parent && sibling->parent);
+   assert(view->parent == sibling->parent);
+
+   if (!view->reorderable)
+     return;
+
+   if (view->link.next == &sibling->link)
+     return;
+
+   wl_list_remove(&view->link);
+   wl_list_insert(sibling->link.prev, &view->link);
+
+   if ((view->eo) && (sibling->eo))
+     evas_object_stack_below(view->eo, sibling->eo);
+   else
+     _view_eo_stack_update(view);
+
+   wl_signal_emit_mutable(&view->events.restack, view);
+}
+
+E_API void
+e_view_raise_to_top(E_View *view)
+{
+   E_View *top;
+
+   assert(view->parent);
+
+   if (!view->reorderable)
+     return;
+
+   top = wl_container_of(view->parent->children.prev, top, link);
+   if (view == top)
+     return;
+
+   wl_list_remove(&view->link);
+   wl_list_insert(&top->link, &view->link);
+
+   if (view->eo)
+     evas_object_raise(view->eo);
+}
+
+E_API void
+e_view_lower_to_bottom(E_View *view)
+{
+   E_View *bottom;
+
+   assert(view->parent);
+
+   if (!view->reorderable)
+     return;
+
+   bottom = wl_container_of(view->parent->children.next, bottom, link);
+   if (view == bottom)
+     return;
+
+   wl_list_remove(&view->link);
+   wl_list_insert(bottom->link.prev, &view->link);
+
+   if (view->eo)
+     evas_object_lower(view->eo);
+}
+
+static bool
+_view_visible_check(E_View *view)
+{
+   if (!view->visible)
+     return false;
+
+   if (!view->parent)
+     return true;
+
+   return _view_visible_check(e_view_tree_view_get(view->parent));
+}
+
+static void
+_view_show(E_View *view)
+{
+   E_View_Tree *tree;
+   E_View *child;
+
+   tree = e_view_tree_try_from_view(view);
+   if (tree)
+     {
+        wl_list_for_each(child, &tree->children, link)
+          {
+             if (child->visible)
+               _view_show(child);
+          }
+     }
+   else
+     {
+        evas_object_show(view->eo);
+     }
+}
+
+static void
+_view_hide(E_View *view)
+{
+   E_View_Tree *tree;
+   E_View *child;
+
+   tree = e_view_tree_try_from_view(view);
+   if (tree)
+     {
+        wl_list_for_each(child, &tree->children, link)
+          _view_hide(child);
+     }
+   else
+     {
+        evas_object_hide(view->eo);
+     }
+}
+
+E_API void
+e_view_show(E_View *view)
+{
+   if (view->visible == true)
+     return;
+
+   view->visible = true;
+
+   if (_view_visible_check(view))
+     _view_show(view);
+
+   wl_signal_emit_mutable(&view->events.show, view);
+}
+
+E_API void
+e_view_hide(E_View *view)
+{
+   if (view->visible == false)
+     return;
+
+   view->visible = false;
+
+   _view_hide(view);
+
+   wl_signal_emit_mutable(&view->events.hide, view);
+}
+
+E_API bool
+e_view_visible_get(E_View *view)
+{
+   return view->visible;
+}
+
+E_API void
+e_view_position_set(E_View *view, int x, int y)
+{
+   if (view->x == x && view->y == y)
+     return;
+
+   view->x = x;
+   view->y = y;
+
+   _view_eo_position_update(view);
+
+   wl_signal_emit_mutable(&view->events.reposition, view);
+}
+
+E_API void
+e_view_position_get(E_View *view, int *x, int *y)
+{
+   if (x) *x = view->x;
+   if (y) *y = view->y;
+}
+
+E_API void
+e_view_coords_get(E_View *view, int *lx, int *ly)
+{
+   int x = 0, y = 0;
+
+   do {
+     x += view->x;
+     y += view->y;
+   } while (view->parent && (view = &view->parent->view));
+
+   if (lx) *lx = x;
+   if (ly) *ly = y;
+}
+
+E_API E_View_Render_Op
+e_view_render_op_get(E_View *view)
+{
+   short render_op = (short)evas_object_render_op_get(view->eo);
+   return render_op;
+}
+
+E_API void
+e_view_render_op_set(E_View *view, E_View_Render_Op render_op)
+{
+   evas_object_render_op_set(view->eo, (short)render_op);
+}
+
+E_API void
+e_view_color_set(E_View *view, int r, int g, int b, int a)
+{
+   evas_object_color_set(view->eo, r, g, b, a);
+}
+
+E_API void
+e_view_color_get(E_View *view, int *r, int *g, int *b, int *a)
+{
+   evas_object_color_get(view->eo, r, g, b, a);
+}
+
+E_API void
+e_view_data_set(E_View *view, const char *key, const void *data)
+{
+   evas_object_data_set(view->eo, key, data);
+}
+
+E_API void *
+e_view_data_get(E_View *view, const char *key)
+{
+   return evas_object_data_get(view->eo, key);
+}
+
+E_API void *
+e_view_data_del(E_View *view, const char *key)
+{
+   return evas_object_data_del(view->eo, key);
+}
+
+E_API void
+e_view_clip_set(E_View *view, E_View *clip)
+{
+   if (clip->type != E_VIEW_TYPE_RECT &&
+       clip->type != E_VIEW_TYPE_IMAGE)
+     {
+        return;
+     }
+
+   evas_object_clip_set(view->eo, clip->eo);
+}
+
+E_API void
+e_view_clip_unset(E_View *view)
+{
+   evas_object_clip_set(view->eo, NULL);
+}
+
+E_API const E_Map *
+e_view_map_get(E_View *view)
+{
+   return view->map;
+}
+
+E_API void
+e_view_map_set(E_View *view, E_Map *map)
+{
+   if (view->map == map)
+     return;
+
+   if (view->map)
+     {
+        e_map_free(view->map);
+        view->map = NULL;
+     }
+
+   if (map)
+     view->map = e_map_dup(map);
+
+   if (view->eo)
+     e_map_set_to_comp_object(map, view->eo);
+}
+
+E_API void
+e_view_map_enable_set(E_View *view, bool enabled)
+{
+   if (!view) return;
+   evas_object_map_enable_set(view->eo, enabled);
+}
+
+E_API bool
+e_view_map_enable_get(const E_View *view)
+{
+   assert(view);
+   return evas_object_map_enable_get(view->eo);
+}
+
+E_API void
+e_view_freeze_events_set(E_View *view, bool freeze)
+{
+   evas_object_freeze_events_set(view->eo, freeze);
+}
+
+E_API void
+e_view_repeat_events_set(E_View *view, bool repeat)
+{
+   evas_object_repeat_events_set(view->eo, repeat);
+}
+
+E_API void
+e_view_destroy_listener_add(E_View *view, struct wl_listener *listener)
+{
+   wl_signal_add(&view->events.destroy, listener);
+}
+
+E_API void
+e_view_show_listener_add(E_View *view, struct wl_listener *listener)
+{
+   wl_signal_add(&view->events.show, listener);
+}
+
+E_API void
+e_view_hide_listener_add(E_View *view, struct wl_listener *listener)
+{
+   wl_signal_add(&view->events.hide, listener);
+}
+
+E_API void
+e_view_reposition_listener_add(E_View *view, struct wl_listener *listener)
+{
+   wl_signal_add(&view->events.reposition, listener);
+}
+
+E_API void
+e_view_restack_listener_add(E_View *view, struct wl_listener *listener)
+{
+   wl_signal_add(&view->events.restack, listener);
+}
+
+E_API void
+e_view_name_set(E_View *view, const char *name)
+{
+   if (!view) return;
+   if (view->name) free(view->name);
+
+   if (!name) view->name = NULL;
+   else
+     {
+        view->name = strdup(name);
+     }
+}
+
+E_API const char *
+e_view_name_get(const E_View *view)
+{
+   assert(view);
+   return view->name;
+}
+
+E_API E_View_Tree *
+e_view_parent_get(E_View *view)
+{
+   return view->parent;
+}
+
+E_API void
+e_view_reparent(E_View *view, E_View_Tree *new_parent)
+{
+   E_View_Tree *ancestor;
+
+   assert(new_parent != NULL);
+
+   if (!view->reorderable)
+     return;
+
+   if (view->parent == new_parent)
+     return;
+
+   /* Ensure that a view cannot become its own ancestor */
+   for (ancestor = new_parent; ancestor != NULL; ancestor = ancestor->view.parent)
+     assert(&ancestor->view != view);
+
+   if (view->parent)
+     e_view_tree_child_remove(view->parent, view);
+
+   view->parent = new_parent;
+   e_view_tree_child_add(new_parent, view);
+
+   _view_eo_stack_update(view);
+   _view_eo_position_update(view);
+
+   wl_signal_emit_mutable(&view->events.restack, view);
+}
+
+E_API void
+e_view_pass_events_set(E_View *view, bool set)
+{
+   evas_object_pass_events_set(view->eo, set);
+}
+
+E_API bool
+e_view_pass_events_get(E_View *view)
+{
+   return evas_object_pass_events_get(view->eo);
+}
+
+E_API E_Canvas_Layer
+e_view_layer_index_get(E_View *view)
+{
+   E_Canvas *canvas;
+   E_Canvas_Layer_Tree *layer_tree;
+
+   canvas = e_view_root_get(view);
+   while (1)
+     {
+        assert(view->parent);
+
+        if (view->parent == &canvas->tree)
+          {
+             layer_tree = e_canvas_layer_tree_from_tree(e_view_tree_from_view(view));
+             break;
+          }
+        view = e_view_tree_view_get(view->parent);
+     }
+
+   return layer_tree->layer;
+}
+
+EINTERN void
+e_view_reorderable_set(E_View *view, bool reorderable)
+{
+   view->reorderable = reorderable;
+}
diff --git a/src/bin/core/e_view_client.c b/src/bin/core/e_view_client.c
new file mode 100644 (file)
index 0000000..f3a8978
--- /dev/null
@@ -0,0 +1,808 @@
+#include "e_intern.h"
+#include "e_canvas.h"
+#include "e_view_client_intern.h"
+#include "e_view_intern.h"
+#include "e_comp_object_intern.h"
+#include "e_map_intern.h"
+
+E_View_Tree_Impl view_client_tree_impl;
+
+static void _view_client_handle_destroy(E_View *view);
+
+static const E_View_Impl view_client_impl = {
+     .destroy = _view_client_handle_destroy,
+};
+
+typedef struct _E_View_Client_Effect
+{
+   E_View_Client *client;
+   E_View_Client_Signal_Cb cb;
+   void *data;
+} E_View_Client_Effect;
+
+static E_View_Client *
+_view_client_from_view(E_View *view)
+{
+   E_View_Client *client;
+
+   assert(view->impl == (E_View_Impl*)&view_client_impl);
+   return wl_container_of(view, client, view);
+}
+
+static void
+_view_client_handle_destroy(E_View *view)
+{
+   E_View_Client *client = _view_client_from_view(view);
+
+   e_view_data_del(&client->view, "E_Client");
+
+   free(client);
+}
+
+static E_View_Client *
+_view_client_from_tree(E_View_Tree *tree)
+{
+   E_View_Client *view;
+
+   assert(tree->impl == &view_client_tree_impl);
+
+   return wl_container_of(tree, view, tree);
+}
+
+static void
+_view_client_tree_child_add(E_View_Tree *tree, E_View *child)
+{
+   E_View_Client *client;
+
+   if (!child->eo)
+     return;
+
+   client = _view_client_from_tree(tree);
+   evas_object_smart_member_add(child->eo, client->view.eo);
+}
+
+static void
+_view_client_tree_child_remove(E_View_Tree *tree, E_View *child)
+{
+   if (!child->eo)
+     return;
+
+   evas_object_smart_member_del(child->eo);
+}
+
+E_View_Tree_Impl view_client_tree_impl = {
+   .child_add = _view_client_tree_child_add,
+   .child_remove = _view_client_tree_child_remove,
+};
+
+EINTERN E_View_Client *
+e_view_client_create(E_Client *ec, E_View_Tree *parent)
+{
+   E_View_Client *client;
+
+   if (ec == NULL || ec->frame == NULL)
+     return NULL;
+
+   client = malloc(sizeof(*client));
+   if (!client)
+     return NULL;
+
+   client->width = 1;
+   client->height = 1;
+
+   wl_signal_init(&client->events.resize);
+
+   e_view_init(&client->view, E_VIEW_TYPE_CLIENT, (E_View_Impl*)&view_client_impl, ec->frame, parent);
+
+   e_view_tree_init(&client->tree, &view_client_tree_impl, NULL);
+   e_view_reorderable_set(&client->tree.view, false);
+
+   e_view_data_set(&client->view, "E_Client", ec);
+
+   return client;
+}
+
+EINTERN E_View *
+e_view_client_view_get(E_View_Client *client)
+{
+   assert(client != NULL);
+   return &client->view;
+}
+
+EINTERN void
+e_view_client_render_update_del(E_View_Client *client)
+{
+   if (client == NULL) return;
+
+   e_comp_object_render_update_del(client->view.eo);
+}
+
+E_API void
+e_view_client_alpha_set(E_View_Client *client, bool alpha)
+{
+   if (client == NULL) return;
+
+   e_comp_object_alpha_set(client->view.eo, alpha);
+}
+
+EINTERN bool
+e_view_client_alpha_get(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_alpha_get(client->view.eo);
+}
+
+E_API void
+e_view_client_color_get(E_View_Client *client, int *r, int *g, int *b, int *a)
+{
+   if (client == NULL) return;
+
+   e_comp_object_color_get(client->view.eo, r, g, b, a);
+}
+
+EINTERN bool
+e_view_client_color_visible_get(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_color_visible_get(client->view.eo);
+}
+
+
+EINTERN E_View *
+e_view_client_content_get(E_View_Client *client)
+{
+   if (client == NULL) return NULL;
+   if (client->content == NULL) return NULL;
+
+   return client->content;
+}
+
+E_API bool
+e_view_client_content_set(E_View_Client *client, E_View *content, E_Comp_Object_Content_Type type)
+{
+   bool ret = false;
+
+   if (client == NULL) return false;
+   if (content == NULL) return false;
+   if (content->eo == NULL) return false;
+   if (content->type != E_VIEW_TYPE_IMAGE) return false;
+
+   ret = e_comp_object_content_set(client->view.eo, content->eo, E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE);
+   if (ret == true)
+     client->content = content;
+
+   return ret;
+}
+
+E_API E_Comp_Object_Content_Type
+e_view_client_content_type_get(E_View_Client *client)
+{
+   if (client == NULL) return E_COMP_OBJECT_CONTENT_TYPE_NONE;
+   if (client->content == NULL) return E_COMP_OBJECT_CONTENT_TYPE_NONE;
+
+   return e_comp_object_content_type_get(client->view.eo);
+}
+
+EINTERN bool
+e_view_client_content_unset(E_View_Client *client)
+{
+   bool ret = false;
+
+   if (client == NULL) return false;
+   if (client->content == NULL) return false;
+
+   ret = e_comp_object_content_unset(client->view.eo);
+   if (ret == true)
+     client->content = NULL;
+
+   return ret;
+}
+
+E_API void
+e_view_client_damage(E_View_Client *client, int x, int y, int width, int height)
+{
+   if (client == NULL) return;
+
+   e_comp_object_damage(client->view.eo, x, y, width, height);
+}
+
+EINTERN bool
+e_view_client_damage_exists(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_damage_exists(client->view.eo);
+}
+
+EINTERN void
+e_view_client_dim_mask_set(E_View_Client *client, bool set)
+{
+   if (client == NULL) return;
+
+   e_comp_object_dim_mask_set(client->view.eo, set);
+}
+
+E_API void
+e_view_client_dirty(E_View_Client *client)
+{
+   if (client == NULL) return;
+
+   e_comp_object_dirty(client->view.eo);
+}
+
+E_API E_View *
+e_view_client_effect_object_get(E_View_Client *client)
+{
+   E_View *effect = NULL;
+   Evas_Object *eo = NULL;
+
+   if (client == NULL) return NULL;
+
+   eo = e_comp_object_effect_object_get(client->view.eo);
+   if (!eo) return NULL;
+
+   if (client->effect != NULL)
+     {
+        effect = client->effect;
+        if (effect->eo == eo)
+          return effect;
+        e_view_destroy(effect);
+        free(effect);
+     }
+
+   effect = malloc(sizeof(*effect));
+   if (!effect) return NULL;
+
+   e_view_init(effect, E_VIEW_TYPE_EDJE, NULL, eo, client->view.parent);
+   client->effect = effect;
+
+   return effect;
+}
+
+E_API bool
+e_view_client_effect_set(E_View_Client *client, const char *effect)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_effect_set(client->view.eo, effect);
+}
+
+static void
+_view_client_effect_end(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
+{
+   E_View_Client_Effect *effect = data;
+   E_View_Client *client = effect->client;
+
+   effect->cb(effect->data, client, emission, source);
+   free(effect);
+}
+
+E_API bool
+e_view_client_effect_start(E_View_Client *client, E_View_Client_Signal_Cb end_cb, void *end_data)
+{
+   E_View_Client_Effect *effect;
+   bool ret = false;
+
+   if (client == NULL) return false;
+
+   effect = malloc(sizeof(*effect));
+   if (!effect) return false;
+
+   effect->client = client;
+   effect->cb = end_cb;
+   effect->data = end_data;
+
+   ret = e_comp_object_effect_start(client->view.eo, _view_client_effect_end, effect);
+   if (ret == false)
+     {
+        free(effect);
+        return ret;
+     }
+
+   client->effect_data = effect;
+
+   return ret;
+}
+
+E_API bool
+e_view_client_effect_stop(E_View_Client *client,E_View_Client_Signal_Cb end_cb)
+{
+   E_View_Client_Effect *effect;
+   bool ret = false;
+
+   if (client == NULL) return false;
+   if (client->effect_data == NULL) return false;
+
+   effect = (E_View_Client_Effect *)client->effect_data;
+
+   ret = e_comp_object_effect_stop(client->view.eo, _view_client_effect_end);
+   if (ret == true)
+     {
+        free(effect);
+        client->effect_data = NULL;
+     }
+
+   return ret;
+}
+
+EINTERN void
+e_view_client_effect_clip(E_View_Client *client)
+{
+   if (client == NULL) return;
+
+   e_comp_object_effect_clip(client->view.eo);
+}
+
+EINTERN void
+e_view_client_effect_unclip(E_View_Client *client)
+{
+   if (client == NULL) return;
+
+   e_comp_object_effect_unclip(client->view.eo);
+}
+
+E_API bool
+e_view_client_render(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_render(client->view.eo);
+}
+
+EINTERN E_View_Render_Op
+e_view_client_render_op_get(E_View_Client *client)
+{
+   Evas_Render_Op evas_render_op;
+   E_View_Render_Op view_render_op = E_VIEW_RENDER_BLEND;
+
+   if (client == NULL) return view_render_op;
+
+   evas_render_op = e_comp_object_render_op_get(client->view.eo);
+   if (evas_render_op == EVAS_RENDER_COPY)
+     view_render_op = E_VIEW_RENDER_COPY;
+
+   return view_render_op;
+}
+
+EINTERN void
+e_view_client_render_op_set(E_View_Client *client, E_View_Render_Op op)
+{
+   Evas_Render_Op render_op = EVAS_RENDER_BLEND;
+
+   if (client == NULL) return;
+
+   if (op == E_VIEW_RENDER_COPY)
+     render_op = EVAS_RENDER_COPY;
+
+   e_comp_object_render_op_set(client->view.eo, render_op);
+}
+
+EINTERN bool
+e_view_client_frame_allowed(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_frame_allowed(client->view.eo);
+}
+
+EINTERN void
+e_view_client_frame_geometry_get(E_View_Client *client, int *l, int *r, int *t, int *b)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_geometry_get(client->view.eo, l, r, t, b);
+}
+
+EINTERN void
+e_view_client_frame_geometry_set(E_View_Client *client, int l, int r, int t, int b)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_geometry_set(client->view.eo, l, r, t, b);
+}
+
+EINTERN bool
+e_view_client_frame_exists(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_frame_exists(client->view.eo);
+}
+
+EINTERN bool
+e_view_client_frame_theme_set(E_View_Client *client, const char *name)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_frame_theme_set(client->view.eo, name);
+}
+
+E_API void
+e_view_client_focus_set(E_View_Client *client, bool focus)
+{
+   if (client == NULL) return;
+
+   evas_object_focus_set(client->view.eo, focus);
+}
+
+E_API bool
+e_view_client_focus_get(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return evas_object_focus_get(client->view.eo);
+}
+
+EINTERN bool
+e_view_client_image_filter_set(E_View_Client *client, E_Comp_Image_Filter filter)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_image_filter_set(client->view.eo, filter);
+}
+
+EINTERN E_Comp_Image_Filter
+e_view_client_image_filter_get(E_View_Client *client)
+{
+   if (client == NULL) return E_COMP_IMAGE_FILTER_NONE;
+
+   return e_comp_object_image_filter_get(client->view.eo);
+}
+
+E_API void
+e_view_client_size_hint_max_get(E_View_Client *client, int *width, int *height)
+{
+   if (client == NULL) return;
+
+   evas_object_size_hint_max_get(client->view.eo, width, height);
+}
+
+E_API void
+e_view_client_size_hint_min_get(E_View_Client *client, int *width, int *height)
+{
+   if (client == NULL) return;
+
+   evas_object_size_hint_min_get(client->view.eo, width, height);
+}
+
+E_API void
+e_view_client_size_hint_padding_get(E_View_Client *client, int *l, int *r, int *t, int *b)
+{
+   if (client == NULL) return;
+
+   evas_object_size_hint_padding_get(client->view.eo, l, r, t, b);
+}
+
+E_API void
+e_view_client_size_hint_weight_get(E_View_Client *client, double *x, double *y)
+{
+   if (client == NULL) return;
+
+   evas_object_size_hint_weight_get(client->view.eo, x, y);
+}
+
+E_API void
+e_view_client_size_hint_align_get(E_View_Client *client, double *x, double *y)
+{
+   if (client == NULL) return;
+
+   evas_object_size_hint_align_get(client->view.eo, x, y);
+}
+
+E_API bool
+e_view_client_visible_get(E_View_Client *client)
+{
+   return evas_object_visible_get(client->view.eo); //TODO : change visible get from e_view
+}
+
+E_API unsigned int
+e_view_client_is_animating(E_View_Client *client)
+{
+   return e_comp_object_is_animating(client->view.eo);
+}
+
+E_API void
+e_view_client_hwc_update_set(E_View_Client *client, bool set)
+{
+   e_comp_object_hwc_update_set(client->view.eo, set);
+}
+
+E_API bool
+e_view_client_render_update_lock_get(E_View_Client *client)
+{
+   return e_comp_object_render_update_lock_get(client->view.eo);
+}
+
+E_API void
+e_view_client_geometry_get(E_View_Client *client, int *x, int *y, int *width, int *height)
+{
+   if (width)
+     *width = client->width;
+
+   if (height)
+     *height = client->height;
+
+   e_view_position_get(&client->view, x, y);
+}
+
+E_API void
+e_view_client_geometry_set(E_View_Client *client, int x, int y, int width, int height)
+{
+   e_view_position_set(&client->view, x, y);
+   e_view_client_size_set(client, width, height);
+}
+
+E_API void
+e_view_client_size_set(E_View_Client *client, int width, int height)
+{
+   if (client->width == width && client->height == height)
+     return;
+
+   client->width = width;
+   client->height = height;
+
+   evas_object_resize(client->view.eo, width, height);
+
+   wl_signal_emit_mutable(&client->events.resize, client);
+}
+
+E_API void
+e_view_client_mask_set(E_View_Client *client, bool set)
+{
+   if (client == NULL) return;
+
+   e_comp_object_mask_set(client->view.eo, set);
+}
+
+E_API bool
+e_view_client_mask_has(E_View_Client *client)
+{
+   if (client == NULL) return false;
+
+   return e_comp_object_mask_has(client->view.eo);
+}
+
+E_API void
+e_view_client_frame_xy_adjust(E_View_Client *client, int x, int y, int *ax, int *ay)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_xy_adjust(client->view.eo, x, y, ax, ay);
+}
+
+E_API void
+e_view_client_frame_xy_unadjust(E_View_Client *client, int x, int y, int *ax, int *ay)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_xy_unadjust(client->view.eo, x, y, ax, ay);
+}
+
+E_API void
+e_view_client_frame_wh_adjust(E_View_Client *client, int width, int height, int *aw, int *ah)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_wh_adjust(client->view.eo, width, height, aw, ah);
+}
+
+E_API void
+e_view_client_frame_wh_unadjust(E_View_Client *client, int width, int height, int *aw, int *ah)
+{
+   if (client == NULL) return;
+
+   e_comp_object_frame_wh_unadjust(client->view.eo, width, height, aw, ah);
+}
+
+EINTERN bool
+e_view_client_hwc_update_exists(E_View_Client *client)
+{
+   return e_comp_object_hwc_update_exists(client->view.eo);
+}
+
+EINTERN bool
+e_view_client_redirected_get(E_View_Client *client)
+{
+   return e_comp_object_redirected_get(client->view.eo);
+}
+EINTERN void
+e_view_client_redirected_set(E_View_Client *client, bool set)
+{
+   e_comp_object_redirected_set(client->view.eo, set);
+}
+
+EINTERN E_Map *
+e_view_client_map_get(E_View_Client *client)
+{
+   return e_comp_object_map_get(client->view.eo);
+}
+
+EINTERN void
+e_view_client_map_update(E_View_Client *client)
+{
+   e_comp_object_map_update(client->view.eo);
+}
+
+EINTERN void
+e_view_client_frame_recalc(E_View_Client *client)
+{
+   e_comp_object_frame_recalc(client->view.eo);
+}
+
+EINTERN void
+e_view_client_maximize(E_View_Client *client)
+{
+   e_comp_object_maximize(client->view.eo);
+}
+
+EINTERN void
+e_view_client_fullscreen(E_View_Client *client)
+{
+   e_comp_object_fullscreen(client->view.eo);
+}
+
+EINTERN void
+e_view_client_unfullscreen(E_View_Client *client)
+{
+   e_comp_object_unfullscreen(client->view.eo);
+}
+
+EINTERN void
+e_view_client_lower_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_lower_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_lower_done_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_lower_done_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_raise_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_raise_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_show_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_show_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_hide_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_hide_listener_add(client->view.eo, listener);
+}
+
+#ifdef REFACTOR_DESK_AREA
+EINTERN void
+e_view_client_set_layer_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_set_layer_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_stack_above_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_stack_above_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_stack_below_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_stack_below_listener_add(client->view.eo, listener);
+}
+#endif
+
+EINTERN void
+e_view_client_image_filter_set_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_image_filter_set_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_render_op_set_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_render_op_set_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_content_type_set_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_content_type_set_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_color_set_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_color_set_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_color_visible_set_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   e_comp_object_color_visible_set_listener_add(client->view.eo, listener);
+}
+
+EINTERN void
+e_view_client_recalc(E_View_Client *client)
+{
+   //TO DO
+   //evas_object_smart_callback_call(ec->frame, "frame_recalc", NULL);
+}
+
+EINTERN E_View_Tree *
+e_view_client_tree_get(E_View_Client *client)
+{
+   return &client->tree;
+}
+
+E_API void
+e_view_client_resize_listener_add(E_View_Client *client, struct wl_listener *listener)
+{
+   wl_signal_add(&client->events.resize, listener);
+}
+
+E_API void
+e_view_client_signal_emit(E_View_Client *client, const char *sig, const char *src)
+{
+   e_comp_object_signal_emit(client->view.eo, sig, src);
+}
+
+E_API void
+e_view_client_input_area_set(E_View_Client *client, int x, int y, int w, int h)
+{
+   e_comp_object_input_area_set(client->view.eo, x, y, w, h);
+}
+
+EINTERN void
+e_view_client_input_objs_del(E_View_Client *client)
+{
+   e_comp_object_input_objs_del(client->view.eo);
+}
+
+EINTERN void
+e_view_client_clear(E_View_Client *client)
+{
+   e_comp_object_clear(client->view.eo);
+}
+
+EINTERN void
+e_view_client_size_update(E_View_Client *client, int w, int h)
+{
+   e_comp_object_size_update(client->view.eo, w, h);
+}
+
+EINTERN void
+e_view_client_layer_set(E_View_Client *client, E_Canvas_Layer layer)
+{
+   E_View_Tree *layer_tree;
+
+   layer_tree = e_canvas_layer_view_tree_get(e_view_root_get(&client->view), layer);
+   e_view_reparent(&client->view, layer_tree);
+   evas_object_layer_set(client->view.eo, e_canvas_util_layer_map(layer));
+}
+
+EINTERN void
+e_view_client_show(E_View_Client *client)
+{
+   if (e_view_visible_get(&client->view))
+     evas_object_show(client->view.eo);
+   else
+     e_view_show(&client->view);
+
+}
+
+EINTERN void
+e_view_client_hide(E_View_Client *client)
+{
+   if (!e_view_visible_get(&client->view))
+     evas_object_hide(client->view.eo);
+   else
+     e_view_hide(&client->view);
+}
diff --git a/src/bin/core/e_view_client_intern.h b/src/bin/core/e_view_client_intern.h
new file mode 100644 (file)
index 0000000..44b6e48
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef E_VIEW_CLIENT_INTERN_H
+#define E_VIEW_CLIENT_INTERN_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include "e_view_client.h"
+#include "e_client_intern.h"
+
+E_View_Client *e_view_client_create(E_Client *ec, E_View_Tree *parent);
+E_View *e_view_client_view_get(E_View_Client *client);
+void e_view_client_render_update_del(E_View_Client *view_client);
+bool e_view_client_alpha_get(E_View_Client *client);
+bool e_view_client_color_visible_get(E_View_Client *client);
+E_View *e_view_client_content_get(E_View_Client *client);
+bool e_view_client_content_unset(E_View_Client *client);
+bool e_view_client_damage_exists(E_View_Client *client);
+void e_view_client_dim_mask_set(E_View_Client *client, bool set);
+void e_view_client_effect_clip(E_View_Client *client);
+void e_view_client_effect_unclip(E_View_Client *client);
+E_View_Render_Op e_view_client_render_op_get(E_View_Client *client);
+void e_view_client_render_op_set(E_View_Client *client, E_View_Render_Op op);
+bool e_view_client_frame_allowed(E_View_Client *client);
+void e_view_client_frame_geometry_get(E_View_Client *client, int *l, int *r, int *t, int *b);
+void e_view_client_frame_geometry_set(E_View_Client *client, int l, int r, int t, int b);
+bool e_view_client_frame_exists(E_View_Client *client);
+bool e_view_client_frame_theme_set(E_View_Client *client, const char *name);
+bool e_view_client_image_filter_set(E_View_Client *client, E_Comp_Image_Filter filter);
+E_Comp_Image_Filter e_view_client_image_filter_get(E_View_Client *client);
+void e_view_client_recalc(E_View_Client *client);
+bool e_view_client_hwc_update_exists(E_View_Client *client);
+bool e_view_client_redirected_get(E_View_Client *client);
+void e_view_client_redirected_set(E_View_Client *client, bool set);
+E_Map *e_view_client_map_get(E_View_Client *client);
+void e_view_client_map_update(E_View_Client *client);
+void e_view_client_frame_recalc(E_View_Client *client);
+void e_view_client_maximize(E_View_Client *client);
+void e_view_client_fullscreen(E_View_Client *client);
+void e_view_client_unfullscreen(E_View_Client *client);
+void e_view_client_lower_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_lower_done_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_raise_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_show_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_hide_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_set_layer_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_stack_above_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_stack_below_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_image_filter_set_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_render_op_set_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_content_type_set_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_color_set_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_color_visible_set_listener_add(E_View_Client *client, struct wl_listener *listener);
+void e_view_client_input_objs_del(E_View_Client *client);
+void e_view_client_clear(E_View_Client *client);
+void e_view_client_size_update(E_View_Client *client, int w, int h);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/bin/core/e_view_edje.c b/src/bin/core/e_view_edje.c
new file mode 100644 (file)
index 0000000..f5c17fc
--- /dev/null
@@ -0,0 +1,411 @@
+#include "e_view_edje_intern.h"
+#include "e_view_intern.h"
+#include "e_view_image.h"
+#include "e_theme_intern.h"
+#include "e_comp_intern.h"
+#include "e_comp_object_intern.h"
+#include "e_utils_intern.h"
+
+#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
+#include <Edje_Edit.h>
+
+static void _view_edje_handle_destroy(E_View *view);
+
+static const E_View_Impl view_edje_impl = {
+     .destroy = _view_edje_handle_destroy,
+};
+
+typedef struct _E_View_Edje_Signal
+{
+   E_View_Edje *edje;
+   E_View_Edje_Signal_Cb cb;
+   void *data;
+
+   struct wl_list link;
+} E_View_Edje_Signal;
+
+typedef struct _E_View_Edje_Swallow
+{
+   E_View_Edje *edje;
+   E_View *view;
+   char *part;
+
+   struct wl_list link;
+} E_View_Edje_Swallow;
+
+
+static E_View_Edje *
+_view_edje_from_view(E_View *view)
+{
+   E_View_Edje *edje;
+
+   assert(view->impl == (E_View_Impl*)&view_edje_impl);
+   return wl_container_of(view, edje, view);
+}
+
+static void
+_view_edje_handle_destroy(E_View *view)
+{
+   E_View_Edje *edje = _view_edje_from_view(view);
+   E_View_Edje_Signal *signal, *signal_tmp;
+   E_View_Edje_Swallow *swallow, *swallow_tmp;
+
+   evas_object_del(view->eo);
+
+   if (!wl_list_empty(&edje->signals))
+     wl_list_for_each_safe(signal, signal_tmp, &edje->signals, link)
+       free(signal);
+
+   if (!wl_list_empty(&edje->swallows))
+     {
+        wl_list_for_each_safe(swallow, swallow_tmp, &edje->swallows, link)
+          {
+             free(swallow->part);
+             free(swallow);
+          }
+     }
+
+   free(edje);
+}
+
+EINTERN E_View_Edje *
+e_view_edje_create(E_View_Tree *parent)
+{
+   E_Canvas *canvas;
+   E_View_Edje *edje;
+   Evas_Object *eo = NULL;
+
+   assert(parent != NULL);
+
+   canvas = e_view_root_get(&parent->view);
+   if (!canvas)
+     return NULL;
+
+   edje = malloc(sizeof(*edje));
+   if (!edje)
+     return NULL;
+   edje->edje_edit = false;
+
+   eo = edje_object_add(canvas->evas);
+   if (!eo)
+     {
+        free(edje);
+        return NULL;
+     }
+
+   wl_list_init(&edje->signals);
+   wl_list_init(&edje->swallows);
+
+   e_view_init(&edje->view, E_VIEW_TYPE_EDJE, (E_View_Impl*)&view_edje_impl, eo, parent);
+
+   return edje;
+}
+
+EINTERN E_View *
+e_view_edje_view_get(E_View_Edje *edje)
+{
+   assert(edje != NULL);
+   return &edje->view;
+}
+
+EINTERN bool
+e_view_edje_file_set(E_View_Edje *edje, const char *file, const char *group)
+{
+   return edje_object_file_set(edje->view.eo, file, group);
+}
+
+EINTERN void
+e_view_edje_file_get(E_View_Edje *edje, const char **file, const char **group)
+{
+   edje_object_file_get(edje->view.eo, file, group);
+}
+
+EINTERN void
+e_view_edje_animation_set(E_View_Edje *edje, bool on)
+{
+   edje_object_animation_set(edje->view.eo, on);
+}
+
+EINTERN void
+e_view_edje_message_send(E_View_Edje *edje, E_View_Edje_Message_Type type, int id, void *msg)
+{
+   edje_object_message_send(edje->view.eo, (Edje_Message_Type)type, id, msg);
+}
+
+EINTERN void
+e_view_edje_message_signal_process(E_View_Edje *edje)
+{
+   edje_object_message_signal_process(edje->view.eo);
+}
+
+EINTERN void
+e_view_edje_signal_emit(E_View_Edje *edje, const char *emission, const char *source)
+{
+   edje_object_signal_emit(edje->view.eo, emission, source);
+}
+
+static void
+_view_edje_signal_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+   E_View_Edje_Signal *signal = data;
+   E_View_Edje *edje = signal->edje;
+
+   signal->cb(signal->data, edje, emission, source);
+}
+
+EINTERN void
+e_view_edje_signal_callback_add(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func, void *data)
+{
+   E_View_Edje_Signal *signal;
+
+   signal = malloc(sizeof(*signal));
+   if (!signal) return;
+
+   signal->edje = edje;
+   signal->cb = func;
+   signal->data = data;
+
+   wl_list_insert(edje->signals.prev, &signal->link);
+
+   edje_object_signal_callback_add(edje->view.eo, emission, source, _view_edje_signal_cb, signal);
+}
+
+EINTERN void
+e_view_edje_signal_callback_del(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func)
+{
+   e_view_edje_signal_callback_del_full(edje, emission, source, func, NULL);
+}
+
+EINTERN void
+e_view_edje_signal_callback_del_full(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func, void *data)
+{
+   E_View_Edje_Signal *signal = NULL, *signal_tmp;
+
+   if (wl_list_empty(&edje->signals)) return;
+
+   wl_list_for_each(signal_tmp, &edje->signals, link)
+     {
+        if ((signal_tmp->cb == func) && (signal_tmp->data == data))
+          signal = signal_tmp;
+     }
+
+   if (!signal) return;
+
+   edje_object_signal_callback_del_full(edje->view.eo, emission, source, _view_edje_signal_cb, (void *)signal);
+
+   wl_list_remove(&signal->link);
+   free(signal);
+}
+
+EINTERN bool
+e_view_edje_part_object_check(E_View_Edje *edje, const char *part, E_View *view)
+{
+   const Evas_Object *eo;
+
+   eo = edje_object_part_object_get(edje->view.eo, part);
+   if (eo == view->eo) return true;
+
+   return false;
+}
+
+EINTERN bool
+e_view_edje_part_geometry_get(E_View_Edje *edje, const char *part, int *x, int *y, int *w, int *h)
+{
+   return edje_object_part_geometry_get(edje->view.eo, part, x, y, w, h);
+}
+
+EINTERN bool
+e_view_edje_part_text_set(E_View_Edje *edje, const char *part, const char *text)
+{
+   return edje_object_part_text_set(edje->view.eo, part, text);
+}
+
+EINTERN E_View *
+e_view_edje_part_swallow_get(E_View_Edje *edje, const char *part)
+{
+   E_View_Edje_Swallow *swallow = NULL, *swallow_tmp;
+
+   if (wl_list_empty(&edje->swallows)) return NULL;
+
+   wl_list_for_each(swallow_tmp, &edje->swallows, link)
+     {
+        if (!strcmp(swallow_tmp->part, part))
+          swallow = swallow_tmp;
+     }
+
+   if (!swallow) return NULL;
+
+   return swallow->view;
+}
+
+EINTERN bool
+e_view_edje_part_swallow(E_View_Edje *edje, const char *part, E_View *view)
+{
+   E_View_Edje_Swallow *swallow;
+
+   swallow = malloc(sizeof(*swallow));
+   if (!swallow) return false;
+
+   swallow->edje = edje;
+   swallow->view = view;
+   swallow->part = strdup(part);
+
+   wl_list_insert(edje->swallows.prev, &swallow->link);
+
+   return edje_object_part_swallow(edje->view.eo, part, view->eo);
+}
+
+EINTERN void
+e_view_edje_part_unswallow(E_View_Edje *edje, E_View *view)
+{
+   E_View_Edje_Swallow *swallow = NULL, *swallow_tmp;
+
+   if (wl_list_empty(&edje->swallows)) return;
+
+   wl_list_for_each(swallow_tmp, &edje->swallows, link)
+     {
+        if (swallow_tmp->view == view)
+          swallow = swallow_tmp;
+     }
+
+   if (!swallow) return;
+
+   edje_object_part_unswallow(edje->view.eo, swallow->view->eo);
+
+   wl_list_remove(&swallow->link);
+   free(swallow->part);
+   free(swallow);
+}
+
+EINTERN bool
+e_view_edje_parts_extends_calc(E_View_Edje *edje, int *x, int *y, int *w, int *h)
+{
+   return edje_object_parts_extends_calc(edje->view.eo, x, y, w, h);
+}
+
+EINTERN E_View_Edje_Load_Error
+e_view_edje_load_error_get(E_View_Edje *edje)
+{
+   return (E_View_Edje_Load_Error)edje_object_load_error_get(edje->view.eo);
+}
+
+EINTERN void
+e_view_edje_play_set(E_View_Edje *edje, bool play)
+{
+   edje_object_play_set(edje->view.eo, play);
+}
+
+EINTERN void
+e_view_edje_calc_force(E_View_Edje *edje)
+{
+   edje_object_calc_force(edje->view.eo);
+}
+
+EINTERN int
+e_view_edje_freeze(E_View_Edje *edje)
+{
+   return edje_object_freeze(edje->view.eo);
+}
+
+EINTERN int
+e_view_edje_thaw(E_View_Edje *edje)
+{
+   return edje_object_thaw(edje->view.eo);
+}
+
+EINTERN const char *
+e_view_edje_data_get(E_View_Edje *edje, const char *key)
+{
+   return edje_object_data_get(edje->view.eo, key);
+}
+
+EINTERN E_View_Edje *
+e_view_edje_edit_create(E_View_Tree *parent)
+{
+   E_Canvas *canvas;
+   E_View_Edje *edje;
+   Evas_Object *eo = NULL;
+
+   assert(parent != NULL);
+
+   canvas = e_view_root_get(&parent->view);
+   if (!canvas)
+     return NULL;
+
+   edje = malloc(sizeof(*edje));
+   if (!edje)
+     return NULL;
+   edje->edje_edit = true;
+
+   eo = edje_edit_object_add(canvas->evas);
+   if (!eo)
+     {
+        free(edje);
+        return NULL;
+     }
+
+   wl_list_init(&edje->signals);
+   wl_list_init(&edje->swallows);
+
+   e_view_init(&edje->view, E_VIEW_TYPE_EDJE, (E_View_Impl*)&view_edje_impl, eo, parent);
+
+   return edje;
+}
+
+EINTERN Eina_List *
+e_view_edje_part_list_get(E_View_Edje *edje)
+{
+   if (!edje->edje_edit) return NULL;
+
+   return edje_edit_parts_list_get(edje->view.eo);
+}
+
+EINTERN void
+e_view_edje_size_set(E_View_Edje *edje, int width, int height)
+{
+   evas_object_resize(edje->view.eo, width, height);
+}
+
+E_View_Edje *
+e_view_edje_from_view(E_View *view)
+{
+   return _view_edje_from_view(view);
+}
+
+EINTERN void
+e_view_edje_geometry_get(E_View_Edje *edje, int *x, int *y, int *w, int *h)
+{
+   evas_object_geometry_get(edje->view.eo, x, y, w, h);
+   e_view_position_get(&edje->view, x, y);
+}
+
+EINTERN void
+e_view_edje_geometry_set(E_View_Edje *edje, int x, int y, int w, int h)
+{
+   evas_object_geometry_set(edje->view.eo, 0, 0, w, h);
+   e_view_position_set(&edje->view, x, y);
+}
+
+E_API E_View_Edje *
+e_view_edje_util_add(E_View *view)
+{
+   return NULL;
+}
+
+E_API bool
+e_view_edje_map_set(E_View_Edje *edje, E_Map *em)
+{
+   return e_comp_object_map_set(edje->view.eo, em);
+}
+
+EINTERN E_Map *
+e_view_edje_map_get(E_View_Edje *edje)
+{
+   return e_comp_object_map_get(edje->view.eo);
+}
+
+E_API bool
+e_view_edje_map_enable_set(E_View_Edje *edje, bool enable)
+{
+   return e_comp_object_map_enable_set(edje->view.eo, enable);
+}
diff --git a/src/bin/core/e_view_edje_intern.h b/src/bin/core/e_view_edje_intern.h
new file mode 100644 (file)
index 0000000..e51cb8f
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef E_VIEW_EDJE_INTERN_H
+#define E_VIEW_EDJE_INTERN_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include "e_intern.h"
+#include "e_view_edje.h"
+#include <eina_list.h>
+
+typedef void (*_E_View_Edje_Signal_Cb) (void *data, E_View_Edje *edje, const char *emission, const char *source);
+typedef _E_View_Edje_Signal_Cb E_View_Edje_Signal_Cb;
+
+typedef enum
+{
+   E_VIEW_EDJE_MESSAGE_NONE = 0,
+   E_VIEW_EDJE_MESSAGE_SIGNAL = 1,
+   E_VIEW_EDJE_MESSAGE_STRING = 2,
+   E_VIEW_EDJE_MESSAGE_INT = 3,
+   E_VIEW_EDJE_MESSAGE_FLOAT = 4,
+   E_VIEW_EDJE_MESSAGE_STRING_SET = 5,
+   E_VIEW_EDJE_MESSAGE_INT_SET = 6,
+   E_VIEW_EDJE_MESSAGE_FLOAT_SET = 7,
+   E_VIEW_EDJE_MESSAGE_STRING_INT = 8,
+   E_VIEW_EDJE_MESSAGE_STRING_FLOAT = 9,
+   E_VIEW_EDJE_MESSAGE_STRING_INT_SET = 10,
+   E_VIEW_EDJE_MESSAGE_STRING_FLOAT_SET = 11
+} E_View_Edje_Message_Type;
+
+typedef enum
+{
+   E_VIEW_EDJE_LOAD_ERROR_NONE = 0,
+   E_VIEW_EDJE_LOAD_ERROR_GENERIC = 1,
+   E_VIEW_EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2,
+   E_VIEW_EDJE_LOAD_ERROR_PERMISSION_DENIED = 3,
+   E_VIEW_EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4,
+   E_VIEW_EDJE_LOAD_ERROR_CORRUPT_FILE = 5,
+   E_VIEW_EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6,
+   E_VIEW_EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7,
+   E_VIEW_EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8,
+   E_VIEW_EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9
+} E_View_Edje_Load_Error;
+
+E_View_Edje *e_view_edje_create(E_View_Tree *parent);
+E_View_Edje *e_view_edje_from_view(E_View *view);
+E_View *e_view_edje_view_get(E_View_Edje *edje);
+bool e_view_edje_file_set(E_View_Edje *edje, const char *file, const char *group);
+void e_view_edje_file_get(E_View_Edje *edje, const char **file, const char **group);
+void e_view_edje_animation_set(E_View_Edje *edje, bool on);
+void e_view_edje_message_send(E_View_Edje *edje, E_View_Edje_Message_Type type, int id, void *msg);
+void e_view_edje_message_signal_process(E_View_Edje *edje);
+void e_view_edje_signal_emit(E_View_Edje *edje, const char *emission, const char *source);
+void e_view_edje_signal_callback_add(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func, void *data);
+void e_view_edje_signal_callback_del(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func);
+void e_view_edje_signal_callback_del_full(E_View_Edje *edje, const char *emission, const char *source, E_View_Edje_Signal_Cb func, void *data);
+bool e_view_edje_part_object_check(E_View_Edje *edje, const char *part, E_View *view);
+bool e_view_edje_part_geometry_get(E_View_Edje *edje, const char *part, int *x, int *y, int *w, int *h);
+bool e_view_edje_part_text_set(E_View_Edje *edje, const char *part, const char *text);
+E_View *e_view_edje_part_swallow_get(E_View_Edje *edje, const char *part);
+bool e_view_edje_part_swallow(E_View_Edje *edje, const char *part, E_View *edje_swallow);
+void e_view_edje_part_unswallow(E_View_Edje *edje, E_View *view);
+bool e_view_edje_parts_extends_calc(E_View_Edje *edje, int *x, int *y, int *w, int *h);
+E_View_Edje_Load_Error e_view_edje_load_error_get(E_View_Edje *edje);
+void e_view_edje_play_set(E_View_Edje *edje, bool play);
+void e_view_edje_calc_force(E_View_Edje *edje);
+int e_view_edje_freeze(E_View_Edje *edje);
+int e_view_edje_thaw(E_View_Edje *edje);
+const char *e_view_edje_data_get(E_View_Edje *edje, const char *key);
+E_View_Edje *e_view_edje_edit_create(E_View_Tree *parent);
+Eina_List *e_view_edje_part_list_get(E_View_Edje *edje);
+void e_view_edje_size_set(E_View_Edje *edje, int width, int height);
+void e_view_edje_geometry_get(E_View_Edje *edje, int *x, int *y, int *w, int *h);
+void e_view_edje_geometry_set(E_View_Edje *edje, int x, int y, int w, int h);
+E_Map *e_view_edje_map_get(E_View_Edje *edje);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/bin/core/e_view_event.c b/src/bin/core/e_view_event.c
new file mode 100644 (file)
index 0000000..606c612
--- /dev/null
@@ -0,0 +1,138 @@
+#include "e_intern.h"
+#include "e_view_intern.h"
+
+#include <assert.h>
+#include <stddef.h>
+
+static void
+_view_cb_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   E_View *view = (E_View *)data;
+
+   E_View_Event_Callback_Data callback_data = {
+      .view = view,
+      .event_info = NULL,
+   };
+
+   wl_signal_emit_mutable(&view->signals[E_VIEW_SHOW], &callback_data);
+}
+
+static void
+_view_cb_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   E_View *view = (E_View *)data;
+
+   E_View_Event_Callback_Data callback_data = {
+      .view = view,
+      .event_info = NULL,
+   };
+
+   wl_signal_emit_mutable(&view->signals[E_VIEW_HIDE], &callback_data);
+}
+
+static void
+_view_cb_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   E_View *view = (E_View *)data;
+
+   E_View_Event_Callback_Data callback_data = {
+      .view = view,
+      .event_info = NULL,
+   };
+
+   wl_signal_emit_mutable(&view->signals[E_VIEW_MOVE], &callback_data);
+}
+
+static void
+_view_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   E_View *view = (E_View *)data;
+
+   E_View_Event_Callback_Data callback_data = {
+      .view = view,
+      .event_info = NULL,
+   };
+
+   wl_signal_emit_mutable(&view->signals[E_VIEW_RESIZE], &callback_data);
+}
+
+static void
+_view_cb_stack(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   E_View *view = (E_View *)data;
+
+   E_View_Event_Callback_Data callback_data = {
+      .view = view,
+      .event_info = NULL,
+   };
+
+   wl_signal_emit_mutable(&view->signals[E_VIEW_RESTACK], &callback_data);
+}
+
+static Evas_Object_Event_Cb callback_table[E_VIEW_EVENT_MAX] =
+{
+   NULL, // E_VIEW_DESTROY - Don't use it
+   _view_cb_show, // E_VIEW_SHOW
+   _view_cb_hide, // E_VIEW_HIDE
+   _view_cb_move, // E_VIEW_MOVE
+   _view_cb_resize, // E_VIEW_RESIZE
+   _view_cb_stack, // E_VIEW_RESTACK
+   // Add new signals callback at here
+};
+
+static Evas_Callback_Type
+_e_view_event_evas_type_get(E_View_Event_Type type)
+{
+   switch (type)
+     {
+      case E_VIEW_SHOW:
+         return EVAS_CALLBACK_SHOW;
+      case E_VIEW_HIDE:
+         return EVAS_CALLBACK_HIDE;
+      case E_VIEW_MOVE:
+         return EVAS_CALLBACK_MOVE;
+      case E_VIEW_RESIZE:
+         return EVAS_CALLBACK_RESIZE;
+      case E_VIEW_RESTACK:
+         return EVAS_CALLBACK_RESTACK;
+      case E_VIEW_EVENT_MAX:
+      default:
+         assert(false);
+     }
+}
+
+E_API void
+e_view_event_listener_add(E_View *view, E_View_Event_Type type, struct wl_listener *listener)
+{
+   if (type == E_VIEW_DESTROY)
+     {
+        e_view_destroy_listener_add(view, listener);
+        return;
+     }
+
+   if (!view->eo) return;
+
+   if (wl_list_empty(&view->signals[type].listener_list))
+     evas_object_event_callback_add(view->eo, _e_view_event_evas_type_get(type), callback_table[type], view);
+
+   wl_signal_add(&view->signals[type], listener);
+}
+
+E_API void
+e_view_event_listener_del(E_View *view, E_View_Event_Type type, struct wl_listener *listener)
+{
+   wl_list_remove(&listener->link);
+
+   if (type == E_VIEW_DESTROY) return;
+   if (!view->eo) return;
+
+   if (wl_list_empty(&view->signals[type].listener_list))
+     evas_object_event_callback_del(view->eo, _e_view_event_evas_type_get(type), callback_table[type]);
+}
+
+#ifdef E_VIEW_TEST
+Evas_Object_Event_Cb e_view_event_callback_get(E_View_Event_Type type)
+{
+   return callback_table[type];
+}
+#endif
diff --git a/src/bin/core/e_view_image.c b/src/bin/core/e_view_image.c
new file mode 100644 (file)
index 0000000..de121b0
--- /dev/null
@@ -0,0 +1,709 @@
+#include "e_intern.h"\r
+#include "e_view_intern.h"\r
+#include "e_view_image.h"\r
+\r
+#include <Evas.h>\r
+//#include <Edje.h> // for using efl_gfx_filter_program_set()\r
+\r
+typedef struct _E_View_Image_Impl E_View_Image_Impl;\r
+\r
+struct _E_View_Image\r
+{\r
+   E_View view;\r
+\r
+   E_View_Native_Surface       native;\r
+   E_View_Image               *source;\r
+   E_View_Image_Pixels_Get_Cb  pixel_get_cb;\r
+   void                       *pixel_get_cb_data;\r
+   E_View_Image_Pixels_Get_Cb  pixel_noti_cb;\r
+   void                       *pixel_noti_cb_data;\r
+};\r
+\r
+static E_View_Image *_view_image_from_view(E_View *view);\r
+static void _view_image_handle_destroy(E_View *view);\r
+\r
+const static E_View_Impl view_image_impl = {\r
+     .destroy = _view_image_handle_destroy,\r
+};\r
+\r
+static E_View_Image *\r
+_view_image_from_view(E_View *view)\r
+{\r
+   E_View_Image *image;\r
+   assert(view->impl == &view_image_impl);\r
+   return wl_container_of(view, image, view);\r
+}\r
+\r
+static void\r
+_view_image_handle_destroy(E_View *view)\r
+{\r
+   E_View_Image *image = _view_image_from_view(view);\r
+\r
+   evas_object_del(view->eo);\r
+   free(image);\r
+}\r
+\r
+static void image_pixels_get_cb(void *data, Evas_Object *obj)\r
+{\r
+   E_View_Image* image = (E_View_Image*)data;\r
+   assert(image->view.eo == obj);\r
+\r
+   image->pixel_get_cb(image->pixel_get_cb_data, image);\r
+}\r
+\r
+static void image_pixels_noti_cb(void *data, Evas_Object *obj)\r
+{\r
+   E_View_Image* image = (E_View_Image*)data;\r
+   assert(image->view.eo == obj);\r
+\r
+   image->pixel_noti_cb(image->pixel_noti_cb_data, image);\r
+}\r
+\r
+/* for dali\r
+static Pixel::Format e_view_image_colorspace_map_to(E_View_Colorspace cspace)\r
+{\r
+   switch (cspace)\r
+     {\r
+      case E_VIEW_COLORSPACE_A8: return Pixel::A8;\r
+      case E_VIEW_COLORSPACE_L8: return Pixel::L8;\r
+      case E_VIEW_COLORSPACE_LA88: return Pixel::LA88;\r
+      case E_VIEW_COLORSPACE_RGB565: return Pixel::RGB565;\r
+      case E_VIEW_COLORSPACE_BRG565: return Pixel::BGR565;\r
+      case E_VIEW_COLORSPACE_RGBA4444: return Pixel::RGBA4444;\r
+      case E_VIEW_COLORSPACE_BGRA4444: return Pixel::BGRA4444;\r
+      case E_VIEW_COLORSPACE_RGBA5551: return Pixel::RGBA5551;\r
+      case E_VIEW_COLORSPACE_BGRA5551: return Pixel::BGRA5551;\r
+      case E_VIEW_COLORSPACE_RGB888: return Pixel::RGB888;\r
+      case E_VIEW_COLORSPACE_RGB8888: return Pixel::RGB8888;\r
+      case E_VIEW_COLORSPACE_BGR8888: return Pixel::BGR8888;\r
+      case E_VIEW_COLORSPACE_RGBA8888: return Pixel::RGBA8888;\r
+      case E_VIEW_COLORSPACE_BGRA8888: return Pixel::BGRA8888;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC1: return Pixel::COMPRESSED_RGB8_ETC1;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB_PVRTC_4BPPV1: return Pixel::COMPRESSED_RGB_PVRTC_4BPPV1;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_4x4_KHR: return Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x4_KHR: return Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x5_KHR: return Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x5_KHR: return Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x6_KHR: return Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x5_KHR: return Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x6_KHR: return Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x8_KHR: return Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x5_KHR: return Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x6_KHR: return Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x6_KHR: return Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x10_KHR: return Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x10_KHR: return Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x12_KHR: return Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: return Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_R11_EAC: return Pixel::COMPRESSED_R11_EAC;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SIGNED_R11_EAC: return Pixel::COMPRESSED_SIGNED_R11_EAC;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RG11_EAC: return Pixel::COMPRESSED_RG11_EAC;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SIGNED_RG11_EAC: return Pixel::COMPRESSED_SIGNED_RG11_EAC;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC2: return Pixel::COMPRESSED_RGB8_ETC2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ETC2: return Pixel::COMPRESSED_SRGB8_ETC2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: return Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: return Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA8_ETC2_EAC:        return Pixel::COMPRESSED_RGBA8_ETC2_EAC;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: return Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;\r
+      case E_VIEW_COLORSPACE_RGB16F: return Pixel::RGB16F;\r
+      case E_VIEW_COLORSPACE_RGB32F: return Pixel::RGB32F;\r
+      case E_VIEW_COLORSPACE_DEPTH_UNSIGNED_INT: return Pixel::DEPTH_UNSIGNED_INT;\r
+      case E_VIEW_COLORSPACE_DEPTH_FLOAT: return Pixel::DEPTH_FLOAT;\r
+      case E_VIEW_COLORSPACE_DEPTH_STENCIL: return Pixel::DEPTH_STENCIL;\r
+      case E_VIEW_COLORSPACE_R11G11B10F: return Pixel::R11G11B10F;\r
+      case E_VIEW_COLORSPACE_CHROMINANCE_U: return Pixel::CHROMINANCE_U;\r
+      case E_VIEW_COLORSPACE_CHROMINANCE_V: return Pixel::CHROMINANCE_V;\r
+      default: break;\r
+     }\r
+   return Pixel::INVALID;\r
+}\r
+\r
+static E_View_Colorspace e_view_image_colorspace_map(Pixel::Format pixel_format)\r
+{\r
+   switch (pixel_format)\r
+     {\r
+      case Pixel::A8: return E_VIEW_COLORSPACE_A8;\r
+      case Pixel::L8: return E_VIEW_COLORSPACE_L8;\r
+      case Pixel::LA88: return E_VIEW_COLORSPACE_LA88;\r
+      case Pixel::RGB565: return E_VIEW_COLORSPACE_RGB565;\r
+      case Pixel::BGR565: return E_VIEW_COLORSPACE_BRG565;\r
+      case Pixel::RGBA4444: return E_VIEW_COLORSPACE_RGBA4444;\r
+      case Pixel::BGRA4444: return E_VIEW_COLORSPACE_BGRA4444;\r
+      case Pixel::RGBA5551: return E_VIEW_COLORSPACE_RGBA5551;\r
+      case Pixel::BGRA5551: return E_VIEW_COLORSPACE_BGRA5551;\r
+      case Pixel::RGB888: return E_VIEW_COLORSPACE_RGB888;\r
+      case Pixel::RGB8888: return E_VIEW_COLORSPACE_RGB8888;\r
+      case Pixel::BGR8888: return E_VIEW_COLORSPACE_BGR8888;\r
+      case Pixel::RGBA8888: return E_VIEW_COLORSPACE_RGBA8888;\r
+      case Pixel::BGRA8888: return E_VIEW_COLORSPACE_BGRA8888;\r
+      case Pixel::COMPRESSED_R11_EAC: return E_VIEW_COLORSPACE_COMPRESSED_R11_EAC;\r
+      case Pixel::COMPRESSED_SIGNED_R11_EAC: return E_VIEW_COLORSPACE_COMPRESSED_SIGNED_R11_EAC;\r
+      case Pixel::COMPRESSED_RG11_EAC: return E_VIEW_COLORSPACE_COMPRESSED_RG11_EAC;\r
+      case Pixel::COMPRESSED_SIGNED_RG11_EAC: return E_VIEW_COLORSPACE_COMPRESSED_SIGNED_RG11_EAC;\r
+      case Pixel::COMPRESSED_RGB8_ETC2: return E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC2;\r
+      case Pixel::COMPRESSED_SRGB8_ETC2: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ETC2;\r
+      case Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: return E_VIEW_COLORSPACE_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;\r
+      case Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;\r
+      case Pixel::COMPRESSED_RGBA8_ETC2_EAC: return E_VIEW_COLORSPACE_COMPRESSED_RGBA8_ETC2_EAC;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;\r
+      case Pixel::COMPRESSED_RGB8_ETC1: return E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC1;\r
+      case Pixel::COMPRESSED_RGB_PVRTC_4BPPV1: return E_VIEW_COLORSPACE_COMPRESSED_RGB_PVRTC_4BPPV1;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_4x4_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x4_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x5_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x5_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x6_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x5_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x6_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x8_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x5_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x6_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x8_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x10_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x10_KHR;\r
+      case Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR: return E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x12_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;\r
+      case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: return E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;\r
+      case Pixel::RGB16F: return E_VIEW_COLORSPACE_RGB16F;\r
+      case Pixel::RGB32F: return E_VIEW_COLORSPACE_RGB32F;\r
+      case Pixel::DEPTH_UNSIGNED_INT: return E_VIEW_COLORSPACE_DEPTH_UNSIGNED_INT;\r
+      case Pixel::DEPTH_FLOAT: return E_VIEW_COLORSPACE_DEPTH_FLOAT;\r
+      case Pixel::DEPTH_STENCIL: return E_VIEW_COLORSPACE_DEPTH_STENCIL;\r
+      case Pixel::R11G11B10F: return E_VIEW_COLORSPACE_R11G11B10F;\r
+      case Pixel::CHROMINANCE_U: return E_VIEW_COLORSPACE_CHROMINANCE_U;\r
+      case Pixel::CHROMINANCE_V: return E_VIEW_COLORSPACE_CHROMINANCE_V;\r
+      default: break;\r
+     }\r
+   return E_VIEW_COLORSPACE_INVALID;\r
+}\r
+\r
+*/\r
+\r
+static Evas_Colorspace e_view_image_colorspace_map_to(E_View_Colorspace cspace)\r
+{\r
+   switch (cspace)\r
+     {\r
+      case E_VIEW_COLORSPACE_GRY8:                      return EVAS_COLORSPACE_GRY8;\r
+      case E_VIEW_COLORSPACE_AGRY88:                    return EVAS_COLORSPACE_AGRY88;\r
+      case E_VIEW_COLORSPACE_RGB565_A5P:                return EVAS_COLORSPACE_RGB565_A5P;\r
+      case E_VIEW_COLORSPACE_ARGB8888:                  return EVAS_COLORSPACE_ARGB8888;\r
+      case E_VIEW_COLORSPACE_YCBCR422P601_PL:           return EVAS_COLORSPACE_YCBCR422P601_PL;\r
+      case E_VIEW_COLORSPACE_YCBCR422P709_PL:           return EVAS_COLORSPACE_YCBCR422P709_PL;\r
+      case E_VIEW_COLORSPACE_YCBCR422601_PL:            return EVAS_COLORSPACE_YCBCR422601_PL;\r
+      case E_VIEW_COLORSPACE_YCBCR420NV12601_PL:        return EVAS_COLORSPACE_YCBCR420NV12601_PL;\r
+      case E_VIEW_COLORSPACE_YCBCR420TM12601_PL:        return EVAS_COLORSPACE_YCBCR420TM12601_PL;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC1:      return EVAS_COLORSPACE_ETC1;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_ETC1_ALPHA:     return EVAS_COLORSPACE_ETC1_ALPHA;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB_S3TC_DXT1:  return EVAS_COLORSPACE_RGB_S3TC_DXT1;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT1: return EVAS_COLORSPACE_RGBA_S3TC_DXT1;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT2: return EVAS_COLORSPACE_RGBA_S3TC_DXT2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT3: return EVAS_COLORSPACE_RGBA_S3TC_DXT3;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT4: return EVAS_COLORSPACE_RGBA_S3TC_DXT4;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT5: return EVAS_COLORSPACE_RGBA_S3TC_DXT5;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC2:      return EVAS_COLORSPACE_RGB8_ETC2;\r
+      case E_VIEW_COLORSPACE_COMPRESSED_RGBA8_ETC2_EAC: return EVAS_COLORSPACE_RGBA8_ETC2_EAC;\r
+      case E_VIEW_COLORSPACE_PALETTE:                   return EVAS_COLORSPACE_PALETTE;\r
+      default: break;\r
+     }\r
+   // EVAS_COLORSPACE_PALETTE is maximum color space enum value,\r
+   // Outside of enumulated color space value is used error value in evas\r
+   // So, (EVAS_COLORSPACE_PALETTE + 1) is can be used like Invalid color space.\r
+   return EVAS_COLORSPACE_PALETTE + 1;\r
+}\r
+\r
+static E_View_Colorspace e_view_image_colorspace_map(Evas_Colorspace cspace)\r
+{\r
+   switch (cspace)\r
+     {\r
+      case EVAS_COLORSPACE_ARGB8888:           return E_VIEW_COLORSPACE_ARGB8888;\r
+      case EVAS_COLORSPACE_YCBCR422P601_PL:    return E_VIEW_COLORSPACE_YCBCR422P601_PL;\r
+      case EVAS_COLORSPACE_YCBCR422P709_PL:    return E_VIEW_COLORSPACE_YCBCR422P709_PL;\r
+      case EVAS_COLORSPACE_RGB565_A5P:         return E_VIEW_COLORSPACE_RGB565_A5P;\r
+      case EVAS_COLORSPACE_GRY8:               return E_VIEW_COLORSPACE_GRY8;\r
+      case EVAS_COLORSPACE_YCBCR422601_PL:     return E_VIEW_COLORSPACE_YCBCR422601_PL;\r
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL: return E_VIEW_COLORSPACE_YCBCR420NV12601_PL;\r
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL: return E_VIEW_COLORSPACE_YCBCR420TM12601_PL;\r
+      case EVAS_COLORSPACE_AGRY88:             return E_VIEW_COLORSPACE_AGRY88;\r
+      case EVAS_COLORSPACE_ETC1:               return E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC1;\r
+      case EVAS_COLORSPACE_RGB8_ETC2:          return E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC2;\r
+      case EVAS_COLORSPACE_RGBA8_ETC2_EAC:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA8_ETC2_EAC;\r
+      case EVAS_COLORSPACE_ETC1_ALPHA:         return E_VIEW_COLORSPACE_COMPRESSED_ETC1_ALPHA;\r
+      case EVAS_COLORSPACE_RGB_S3TC_DXT1:      return E_VIEW_COLORSPACE_COMPRESSED_RGB_S3TC_DXT1;\r
+      case EVAS_COLORSPACE_RGBA_S3TC_DXT1:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT1;\r
+      case EVAS_COLORSPACE_RGBA_S3TC_DXT2:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT2;\r
+      case EVAS_COLORSPACE_RGBA_S3TC_DXT3:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT3;\r
+      case EVAS_COLORSPACE_RGBA_S3TC_DXT4:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT4;\r
+      case EVAS_COLORSPACE_RGBA_S3TC_DXT5:     return E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT5;\r
+      case EVAS_COLORSPACE_PALETTE:            return E_VIEW_COLORSPACE_PALETTE;\r
+      default: break;\r
+     }\r
+   return E_VIEW_COLORSPACE_INVALID;\r
+}\r
+\r
+E_API E_View_Image *\r
+e_view_image_create(E_View_Tree *parent)\r
+{\r
+   E_Canvas *canvas;\r
+   E_View_Image *image;\r
+   Evas_Object *eo;\r
+\r
+   assert(parent != NULL);\r
+\r
+   canvas = e_view_root_get(&parent->view);\r
+   if (!canvas)\r
+     return NULL;\r
+\r
+   image = malloc(sizeof(*image));\r
+   if (!image)\r
+     return NULL;\r
+\r
+   eo = evas_object_image_add(canvas->evas);\r
+   if (!eo)\r
+     {\r
+        free(image);\r
+        return NULL;\r
+     }\r
+\r
+   image->native.type        = E_VIEW_NATIVE_SURFACE_NONE;\r
+   image->source             = NULL;\r
+   image->pixel_get_cb       = NULL;\r
+   image->pixel_get_cb_data  = NULL;\r
+   image->pixel_noti_cb      = NULL;\r
+   image->pixel_noti_cb_data = NULL;\r
+\r
+   e_view_init(&image->view, E_VIEW_TYPE_IMAGE, (E_View_Impl*)&view_image_impl, eo, parent);\r
+\r
+   return image;\r
+}\r
+\r
+E_API E_View_Image *\r
+e_view_image_filled_create(E_View_Tree *parent)\r
+{\r
+   E_Canvas *canvas;\r
+   E_View_Image *image;\r
+   Evas_Object *eo;\r
+\r
+   assert(parent != NULL);\r
+\r
+   canvas = e_view_root_get(&parent->view);\r
+   if (!canvas)\r
+     return NULL;\r
+\r
+   image = malloc(sizeof(*image));\r
+   if (!image)\r
+     return NULL;\r
+\r
+   eo = evas_object_image_filled_add(canvas->evas);\r
+   if (!eo)\r
+     {\r
+        free(image);\r
+        return NULL;\r
+     }\r
+\r
+   image->native.type        = E_VIEW_NATIVE_SURFACE_NONE;\r
+   image->source             = NULL;\r
+   image->pixel_get_cb       = NULL;\r
+   image->pixel_get_cb_data  = NULL;\r
+   image->pixel_noti_cb      = NULL;\r
+   image->pixel_noti_cb_data = NULL;\r
+\r
+   e_view_init(&image->view, E_VIEW_TYPE_IMAGE, (E_View_Impl*)&view_image_impl, eo, parent);\r
+\r
+   return image;\r
+}\r
+\r
+E_API E_View *\r
+e_view_image_view_get(E_View_Image *image)\r
+{\r
+   return &image->view;\r
+}\r
+\r
+E_API E_View_Image *\r
+e_view_image_try_from_view(E_View *view)\r
+{\r
+   if (view->impl != &view_image_impl)\r
+     return NULL;\r
+\r
+   return _view_image_from_view(view);\r
+}\r
+\r
+E_API void\r
+e_view_image_alpha_set(E_View_Image *image, bool alpha)\r
+{\r
+   evas_object_image_alpha_set(image->view.eo, alpha);\r
+}\r
+\r
+E_API bool\r
+e_view_image_alpha_get(E_View_Image* image)\r
+{\r
+   return evas_object_image_alpha_get(image->view.eo);\r
+}\r
+\r
+E_API bool\r
+e_view_image_animated_get(E_View_Image* image)\r
+{\r
+   return evas_object_image_animated_get(image->view.eo);\r
+}\r
+\r
+E_API void\r
+e_view_image_animated_frame_set(E_View_Image* image, int frame_index)\r
+{\r
+   evas_object_image_animated_frame_set(image->view.eo, frame_index);\r
+}\r
+\r
+E_API int\r
+e_view_image_animated_frame_get(E_View_Image* image)\r
+{\r
+   return evas_object_image_animated_frame_get(image->view.eo);\r
+}\r
+\r
+E_API int\r
+e_view_image_animated_frame_count_get(E_View_Image* image)\r
+{\r
+   return evas_object_image_animated_frame_count_get(image->view.eo);\r
+}\r
+\r
+E_API double\r
+e_view_image_animated_frame_duration_get(const E_View_Image *image, int start_frame, int frame_num)\r
+{\r
+   return evas_object_image_animated_frame_duration_get(image->view.eo, start_frame, frame_num);\r
+}\r
+\r
+E_API void\r
+e_view_image_border_center_fill_set(const E_View_Image *image, E_View_Border_Fill_Mode fill)\r
+{\r
+   switch (fill)\r
+     {\r
+      case E_VIEW_BORDER_FILL_NONE:\r
+         evas_object_image_border_center_fill_set(image->view.eo, EVAS_BORDER_FILL_NONE);\r
+         break;\r
+      case E_VIEW_BORDER_FILL_DEFAULT:\r
+         evas_object_image_border_center_fill_set(image->view.eo, EVAS_BORDER_FILL_DEFAULT);\r
+         break;\r
+      case E_VIEW_BORDER_FILL_SOLID:\r
+         evas_object_image_border_center_fill_set(image->view.eo, EVAS_BORDER_FILL_SOLID);\r
+         break;\r
+     }\r
+}\r
+\r
+E_API E_View_Border_Fill_Mode\r
+e_view_image_border_center_fill_get(const E_View_Image *image)\r
+{\r
+   Evas_Border_Fill_Mode fill_mode = evas_object_image_border_center_fill_get(image->view.eo);\r
+   switch (fill_mode)\r
+     {\r
+      case EVAS_BORDER_FILL_NONE:\r
+         return E_VIEW_BORDER_FILL_NONE;\r
+      case EVAS_BORDER_FILL_DEFAULT:\r
+         return E_VIEW_BORDER_FILL_DEFAULT;\r
+      case EVAS_BORDER_FILL_SOLID:\r
+         return E_VIEW_BORDER_FILL_SOLID;\r
+     }\r
+   return E_VIEW_BORDER_FILL_NONE;\r
+}\r
+\r
+E_API void\r
+e_view_image_border_set(E_View_Image *image, int l, int r, int t, int b)\r
+{\r
+   evas_object_image_border_set(image->view.eo, l, r, t, b);\r
+}\r
+\r
+E_API void\r
+e_view_image_border_get(const E_View_Image *image, int *l, int *r, int *t, int *b)\r
+{\r
+   evas_object_image_border_get(image->view.eo, l, r, t, b);\r
+}\r
+\r
+E_API void\r
+e_view_image_colorspace_set(E_View_Image *image, E_View_Colorspace cspace)\r
+{\r
+   evas_object_image_colorspace_set(image->view.eo, e_view_image_colorspace_map_to(cspace));\r
+}\r
+\r
+E_API E_View_Colorspace\r
+e_view_image_colorspace_get(E_View_Image *image)\r
+{\r
+   return e_view_image_colorspace_map(evas_object_image_colorspace_get(image->view.eo));\r
+}\r
+\r
+E_API void\r
+e_view_image_data_copy_set(E_View_Image *image, void *data)\r
+{\r
+   evas_object_image_data_copy_set(image->view.eo, data);\r
+}\r
+\r
+E_API void\r
+e_view_image_data_set(E_View_Image *image, void *data)\r
+{\r
+   evas_object_image_data_set(image->view.eo, data);\r
+}\r
+\r
+E_API void*\r
+e_view_image_data_get(E_View_Image *image, bool for_writing)\r
+{\r
+   return evas_object_image_data_get(image->view.eo, for_writing);\r
+}\r
+\r
+E_API void\r
+e_view_image_data_update_add(E_View_Image *image, int x, int y, int w, int h)\r
+{\r
+   evas_object_image_data_update_add(image->view.eo, x, y, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_file_set(E_View_Image *image, const char *file, const char *key)\r
+{\r
+   evas_object_image_file_set(image->view.eo, file, key);\r
+}\r
+\r
+E_API void\r
+e_view_image_file_get(E_View_Image *image, const char **file, const char **key)\r
+{\r
+   evas_object_image_file_get(image->view.eo, file, key);\r
+}\r
+\r
+E_API void\r
+e_view_image_fill_set(E_View_Image *image, int x, int y, int w, int h)\r
+{\r
+   evas_object_image_fill_set(image->view.eo, x, y, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_fill_get(const E_View_Image *image, int *x, int *y, int *w, int *h)\r
+{\r
+   evas_object_image_fill_get(image->view.eo, x, y, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_filled_set(E_View_Image *image, bool filled)\r
+{\r
+   evas_object_image_filled_set(image->view.eo, filled);\r
+}\r
+\r
+E_API bool\r
+e_view_image_filled_get(E_View_Image *image)\r
+{\r
+   return evas_object_image_filled_get(image->view.eo);\r
+}\r
+\r
+E_API E_View_Load_Error\r
+e_view_image_load_error_get(const E_View_Image *image)\r
+{\r
+   return evas_object_image_load_error_get(image->view.eo);\r
+}\r
+\r
+E_API void\r
+e_view_image_load_size_set(E_View_Image *image, int w, int h)\r
+{\r
+   evas_object_image_load_size_set(image->view.eo, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_load_size_get(const E_View_Image *image, int *w, int *h)\r
+{\r
+   evas_object_image_load_size_get(image->view.eo, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_native_surface_set(E_View_Image *image, E_View_Native_Surface *surf)\r
+{\r
+   if (surf)\r
+     {\r
+        Evas_Native_Surface evas_native_surface;\r
+        image->native = *surf;\r
+        switch (surf->type)\r
+          {\r
+           case E_VIEW_NATIVE_SURFACE_TBM:\r
+              evas_native_surface.type = EVAS_NATIVE_SURFACE_TBM;\r
+              evas_native_surface.data.tbm.buffer = surf->data.tbm.buffer;\r
+              evas_native_surface.data.tbm.rot = surf->data.tbm.rot;\r
+              evas_native_surface.data.tbm.ratio = surf->data.tbm.ratio;\r
+              break;\r
+           case E_VIEW_NATIVE_SURFACE_WL:\r
+              evas_native_surface.type = EVAS_NATIVE_SURFACE_WL;\r
+              evas_native_surface.data.wl.legacy_buffer = surf->data.wl.legacy_buffer;\r
+              break;\r
+           default:\r
+              image->native.type = E_VIEW_NATIVE_SURFACE_NONE;\r
+              evas_native_surface.type = EVAS_NATIVE_SURFACE_NONE;\r
+          }\r
+\r
+        // this function is implemented copy of native_surface's structure after alloc inside of set function.\r
+        // so local variable is available, see example of evas_object_image_native_surface_set in efl\r
+        evas_object_image_native_surface_set(image->view.eo, &evas_native_surface);\r
+        return;\r
+     }\r
+\r
+   image->native.type = E_VIEW_NATIVE_SURFACE_NONE;\r
+   evas_object_image_native_surface_set(image->view.eo, NULL);\r
+}\r
+\r
+E_API E_View_Native_Surface *\r
+e_view_image_native_surface_get(E_View_Image *image)\r
+{\r
+   if (image->native.type == E_VIEW_NATIVE_SURFACE_NONE)\r
+     return NULL;\r
+   else\r
+     return &image->native;\r
+}\r
+\r
+E_API void\r
+e_view_image_pixels_dirty_set(E_View_Image *image, bool dirty)\r
+{\r
+   evas_object_image_pixels_dirty_set(image->view.eo, dirty);\r
+}\r
+\r
+E_API bool\r
+e_view_image_pixels_dirty_get(E_View_Image *image)\r
+{\r
+   return evas_object_image_pixels_dirty_get(image->view.eo);\r
+}\r
+\r
+E_API void\r
+e_view_image_pixels_get_callback_set(E_View_Image *image, E_View_Image_Pixels_Get_Cb func, void *data)\r
+{\r
+   image->pixel_get_cb      = func;\r
+   image->pixel_get_cb_data = data;\r
+\r
+   evas_object_image_pixels_get_callback_set(image->view.eo, image_pixels_get_cb, (void*)image);\r
+}\r
+\r
+E_API void\r
+e_view_image_pixels_noti_callback_set(E_View_Image *image, E_View_Image_Pixels_Get_Cb func, void *data)\r
+{\r
+   image->pixel_noti_cb      = func;\r
+   image->pixel_noti_cb_data = data;\r
+\r
+   evas_object_image_pixels_noti_callback_set(image->view.eo, image_pixels_noti_cb, (void*)image);\r
+}\r
+\r
+E_API void\r
+e_view_image_smooth_scale_set(E_View_Image *image, bool smooth_scale)\r
+{\r
+   evas_object_image_smooth_scale_set(image->view.eo, smooth_scale);\r
+}\r
+\r
+E_API bool\r
+e_view_image_smooth_scale_get(E_View_Image *image)\r
+{\r
+   return evas_object_image_smooth_scale_get(image->view.eo);\r
+}\r
+\r
+E_API void\r
+e_view_image_size_set(E_View_Image *image, int w, int h)\r
+{\r
+   evas_object_image_size_set(image->view.eo, w, h);\r
+}\r
+\r
+E_API void\r
+e_view_image_size_get(E_View_Image *image, int *w, int *h)\r
+{\r
+   evas_object_image_size_get(image->view.eo, w, h);\r
+}\r
+\r
+E_API bool\r
+e_view_image_source_set(E_View_Image *image, E_View_Image *src)\r
+{\r
+   if (src)\r
+     {\r
+        if (evas_object_image_source_set(image->view.eo, src->view.eo))\r
+        {\r
+           image->source = src;\r
+           return true;\r
+        }\r
+        else\r
+        {\r
+          image->source = NULL;\r
+          return false;\r
+        }\r
+     }\r
+   image->source = NULL;\r
+   return evas_object_image_source_set(image->view.eo, NULL);\r
+}\r
+\r
+E_API E_View_Image *\r
+e_view_image_source_get(E_View_Image *image)\r
+{\r
+   return image->source;\r
+}\r
+\r
+E_API bool\r
+e_view_image_source_unset(E_View_Image *image)\r
+{\r
+   if (evas_object_image_source_unset(image->view.eo))\r
+     {\r
+        image->source = NULL;\r
+        return true;\r
+     }\r
+   return false;\r
+}\r
+\r
+E_API bool\r
+e_view_image_save(E_View_Image *image, const char* file, const char *key, const char *flags)\r
+{\r
+   return evas_object_image_save(image->view.eo, file, key, flags);\r
+}\r
+\r
+void\r
+e_view_image_preload(E_View_Image *image, bool cancel)\r
+{\r
+   evas_object_image_preload(image->view.eo, cancel);\r
+}\r
+\r
+void\r
+e_view_image_snapshot_set(E_View_Image *image, bool set)\r
+{\r
+   evas_object_image_snapshot_set(image->view.eo, set);\r
+}\r
+\r
+void\r
+e_view_image_geometry_set(E_View_Image *image, int x, int y, int w, int h)\r
+{\r
+   int image_x, image_y;\r
+\r
+   e_view_position_set(&image->view, x, y);\r
+   e_view_position_get(&image->view, &image_x, &image_y);\r
+\r
+   evas_object_geometry_set(image->view.eo, image_x, image_y, w, h);\r
+}\r
+\r
+void\r
+e_view_image_geometry_get(E_View_Image *image, int *x, int *y, int *w, int *h)\r
+{\r
+   int image_x, image_y;\r
+\r
+   e_view_position_get(&image->view, x, y);\r
+   evas_object_geometry_get(image->view.eo, &image_x, &image_y, w, h);\r
+}\r
+\r
+void\r
+e_view_image_gfx_filter_program_set(E_View_Image *image, const char *code, const char *name)\r
+{\r
+   efl_gfx_filter_program_set(image->view.eo, code, name);\r
+}\r
+\r
diff --git a/src/bin/core/e_view_intern.h b/src/bin/core/e_view_intern.h
new file mode 100644 (file)
index 0000000..7b4bac6
--- /dev/null
@@ -0,0 +1,219 @@
+#ifndef E_VIEW_INTERN_H
+#define E_VIEW_INTERN_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdbool.h>
+#include "e_view.h"
+
+struct _E_Map;
+typedef struct _E_Map E_Map;
+
+typedef struct _E_Canvas E_Canvas;
+typedef struct _E_Canvas_Layer_Tree E_Canvas_Layer_Tree;
+typedef struct _E_View_Tree E_View_Tree;
+typedef struct _E_View E_View;
+typedef struct _E_View_Client E_View_Client;
+typedef struct _E_View_Impl       E_View_Impl;
+typedef struct _E_View_Tree_Impl  E_View_Tree_Impl;
+
+typedef enum {
+     E_VIEW_TYPE_TREE,
+     E_VIEW_TYPE_RECT,
+     E_VIEW_TYPE_IMAGE,
+     E_VIEW_TYPE_CLIENT,
+     E_VIEW_TYPE_EDJE,
+} E_View_Type;
+
+struct _E_View_Impl
+{
+   void (*destroy)(E_View *view);
+};
+
+struct _E_View_Tree_Impl
+{
+   void (*destroy)(E_View_Tree *tree);
+   void (*child_add)(E_View_Tree *tree, E_View *child);
+   void (*child_remove)(E_View_Tree *tree, E_View *child);
+};
+
+struct _E_View
+{
+   E_View_Type type;
+
+   E_View_Impl *impl;
+   E_View_Tree *parent;
+
+   Evas_Object *eo;
+   E_Map *map;
+
+   struct wl_list link; // E_View_Tree.children
+
+   char *name;
+   int x;
+   int y;
+   bool visible;
+   bool reorderable;
+
+   struct wl_signal signals[E_VIEW_EVENT_MAX];
+
+   struct
+     {
+        struct wl_signal destroy;
+        struct wl_signal show;
+        struct wl_signal hide;
+        struct wl_signal reposition;
+        struct wl_signal restack;
+     } events;
+};
+
+struct _E_View_Tree
+{
+   E_View view;
+
+   const E_View_Tree_Impl *impl;
+
+   struct wl_list children; // bottom to top
+};
+
+struct _E_Canvas_Layer_Tree
+{
+   E_View_Tree tree;
+   E_Canvas_Layer layer;
+};
+
+struct _E_Canvas
+{
+   E_View_Tree tree;
+   E_Canvas_Layer_Tree layers[E_CANVAS_LAYER_MAX + 1];
+
+   Evas *evas;
+
+   struct
+     {
+        struct wl_signal destroy;
+        struct wl_signal render_pre;
+        struct wl_signal render_post;
+        struct wl_signal render_flush_pre;
+        struct wl_signal render_flush_post;
+     } events;
+};
+
+struct _E_View_Client
+{
+   E_View view;
+   E_View *content;
+   E_View *effect;
+   E_View_Tree tree;
+   void *effect_data;
+
+   int width, height;
+
+   struct
+     {
+        struct wl_signal resize;
+     } events;
+};
+
+struct _E_View_Edje
+{
+   E_View view;
+   void *edje_data;
+   bool edje_edit;
+
+   struct wl_list signals;
+   struct wl_list swallows;
+
+   struct wl_listener destroy;
+   struct wl_listener restack;
+};
+
+/**
+ * Create E_Canvas
+ */
+E_Canvas *e_canvas_create(Evas *evas);
+
+/**
+ * Destroy E_Canvas
+ */
+void e_canvas_destroy(E_Canvas *canvas);
+
+/**
+ * Get Evas
+ */
+Evas *e_canvas_evas_get(E_Canvas *canvas);
+
+/**
+ * Register a listener for the destroy of canvas.
+ */
+void e_canvas_destroy_listener_add(E_Canvas *canvas, struct wl_listener *listener);
+
+/**
+ * Register a listener called just before rendering starts on the canvas target.
+ */
+void e_canvas_render_pre_listener_add(E_Canvas *canvas, struct wl_listener *listener);
+
+/**
+ * Register a listener called just after rendering stops on the canvas target.
+ */
+void e_canvas_render_post_listener_add(E_Canvas *canvas, struct wl_listener *listener);
+
+/**
+ * Register a listener called after render update regions have been calculated,
+ * but only if update regions exist.
+ */
+void e_canvas_render_flush_pre_listener_add(E_Canvas *canvas, struct wl_listener *listener);
+
+/**
+ * Register a listener called after render update regions have been sent to the
+ * display server, but only if update regions existed for the most recent frame.
+ */
+void e_canvas_render_flush_post_listener_add(E_Canvas *canvas, struct wl_listener *listener);
+
+/**
+ * Get view layer info
+ */
+E_Canvas_Layer e_canvas_layer_find(E_Canvas *canvas, E_View *view);
+
+void e_canvas_damage_rectangle_add(E_Canvas *canvas, int x, int y, int w, int h);
+
+E_Canvas_Layer_Tree *e_canvas_layer_tree_from_tree(E_View_Tree *tree);
+
+void e_canvas_size_get(E_Canvas *canvas, int *width, int *height);
+
+E_Canvas_Layer e_canvas_util_e_layer_map(short layer);
+
+short e_canvas_util_layer_map(E_Canvas_Layer layer);
+
+void e_view_init(E_View *view, E_View_Type type, E_View_Impl *impl, Evas_Object *eo, E_View_Tree *parent);
+void e_view_reorderable_set(E_View *view, bool reorderable);
+E_Canvas *e_view_root_get(E_View *view);
+
+E_View_Tree *e_view_tree_from_view(E_View *view);
+void e_view_tree_init(E_View_Tree *tree, const E_View_Tree_Impl *impl, E_View_Tree *parent);
+void e_view_tree_child_add(E_View_Tree *tree, E_View *view);
+void e_view_tree_child_remove(E_View_Tree *tree, E_View *view);
+E_View *e_view_tree_top_get(E_View_Tree *tree);
+E_View *e_view_tree_bottom_get(E_View_Tree *tree);
+
+E_View_Tree *e_view_client_tree_get(E_View_Client *client);
+void e_view_client_layer_set(E_View_Client *client, E_Canvas_Layer layer);
+void e_view_client_show(E_View_Client *client);
+void e_view_client_hide(E_View_Client *client);
+
+#ifdef E_VIEW_TEST
+extern Evas_Object_Event_Cb e_view_event_callback_get(E_View_Event_Type type);
+
+#define log(fmt, x...) \
+   printf("[%s: %d][%s] " fmt "\n", __FILE__, __LINE__, __func__, ##x);
+#else
+#define log(fmt, x...)
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/bin/core/e_view_rect.c b/src/bin/core/e_view_rect.c
new file mode 100644 (file)
index 0000000..5f73271
--- /dev/null
@@ -0,0 +1,132 @@
+#include "e_intern.h"
+#include "e_view_intern.h"
+#include "e_view_rect.h"
+
+typedef struct _E_View_Rect_Impl  E_View_Rect_Impl;
+
+struct _E_View_Rect
+{
+   E_View view;
+
+   struct
+     {
+        struct wl_signal resize;
+     } events;
+
+   int width;
+   int height;
+};
+
+static E_View_Rect *_view_rect_from_view(E_View *view);
+static void _view_rect_handle_destroy(E_View *view);
+
+const static E_View_Impl view_rect_impl = {
+     .destroy = _view_rect_handle_destroy,
+};
+
+static E_View_Rect *
+_view_rect_from_view(E_View *view)
+{
+   E_View_Rect *rect;
+   assert(view->impl == &view_rect_impl);
+   return wl_container_of(view, rect, view);
+}
+
+static void
+_view_rect_handle_destroy(E_View *view)
+{
+   E_View_Rect *rect = _view_rect_from_view(view);
+
+   evas_object_del(view->eo);
+   free(rect);
+}
+
+static void
+_view_rect_size_set(E_View_Rect *rect, int width, int height)
+{
+   rect->width = width;
+   rect->height = height;
+
+   evas_object_resize(rect->view.eo, width, height);
+}
+
+E_API E_View_Rect *
+e_view_rect_create(E_View_Tree *parent, int width, int height, const int color[4])
+{
+   E_Canvas *canvas;
+   E_View_Rect *rect;
+   Evas_Object *eo;
+
+   assert(parent != NULL);
+
+   rect = malloc(sizeof(*rect));
+   if (!rect)
+     return NULL;
+
+   canvas = e_view_root_get(&parent->view);
+   eo = evas_object_rectangle_add(canvas->evas);
+   if (!eo)
+     {
+        free(rect);
+        return NULL;
+     }
+
+   e_view_init(&rect->view, E_VIEW_TYPE_RECT, (E_View_Impl*)&view_rect_impl, eo, parent);
+   e_view_color_set(&rect->view, color[0], color[1], color[2], color[3]);
+   _view_rect_size_set(rect, width, height);
+
+   wl_signal_init(&rect->events.resize);
+
+   return rect;
+}
+
+E_API E_View *
+e_view_rect_view_get(E_View_Rect *rect)
+{
+   return &rect->view;
+}
+
+E_API E_View_Rect *
+e_view_rect_try_from_view(E_View *view)
+{
+   if (view->impl != &view_rect_impl)
+     return NULL;
+
+   return _view_rect_from_view(view);
+}
+
+E_API void
+e_view_rect_color_set(E_View_Rect *rect, int r, int g, int b, int a)
+{
+       e_view_color_set(&rect->view, r, g, b, a);
+}
+
+E_API void
+e_view_rect_color_get(E_View_Rect *rect, int *r, int *g, int *b, int *a)
+{
+   e_view_color_get(&rect->view, r, g, b, a);
+}
+
+E_API void
+e_view_rect_size_set(E_View_Rect *rect, int width, int height)
+{
+   if (rect->width == width && rect->height == height)
+     return;
+
+   _view_rect_size_set(rect, width, height);
+
+   wl_signal_emit_mutable(&rect->events.resize, rect);
+}
+
+E_API void
+e_view_rect_size_get(E_View_Rect *rect, int *width, int *height)
+{
+   *width = rect->width;
+   *height = rect->height;
+}
+
+E_API void
+e_view_rect_resize_listener_add(E_View_Rect *rect, struct wl_listener *listener)
+{
+   wl_signal_add(&rect->events.resize, listener);
+}
diff --git a/src/bin/core/e_view_tree.c b/src/bin/core/e_view_tree.c
new file mode 100644 (file)
index 0000000..d5896ba
--- /dev/null
@@ -0,0 +1,140 @@
+#include "e_intern.h"
+#include "e_view_intern.h"
+#include "e_view.h"
+#include <wayland-util.h>
+
+static E_View_Tree *_view_tree_from_view(E_View *view);
+static void _view_tree_handle_destroy(E_View *view);
+
+static const E_View_Impl view_tree_impl = {
+     .destroy = _view_tree_handle_destroy,
+};
+
+static E_View_Tree *
+_view_tree_from_view(E_View *view)
+{
+   assert(view->impl == (E_View_Impl*)&view_tree_impl);
+   E_View_Tree *tree = wl_container_of(view, tree, view);
+   return tree;
+}
+
+static void
+_view_tree_handle_destroy(E_View *view)
+{
+   E_View_Tree *tree = _view_tree_from_view(view);
+
+   if (tree->impl && tree->impl->destroy)
+     tree->impl->destroy(tree);
+}
+
+EINTERN void
+e_view_tree_init(E_View_Tree *tree, const E_View_Tree_Impl *impl, E_View_Tree *parent)
+{
+   wl_list_init(&tree->children);
+
+   if (impl)
+     tree->impl = impl;
+   else if (parent)
+     tree->impl = parent->impl;
+   else
+     tree->impl = NULL;
+
+   e_view_init(&tree->view, E_VIEW_TYPE_TREE, (E_View_Impl*)&view_tree_impl, NULL, parent);
+}
+
+EINTERN E_View_Tree *
+e_view_tree_from_view(E_View *view)
+{
+   E_View_Tree *tree;
+
+   assert(view->type == E_VIEW_TYPE_TREE);
+
+   return wl_container_of(view, tree, view);
+}
+
+E_API E_View_Tree *
+e_view_tree_try_from_view(E_View *view)
+{
+   if (view->impl != (E_View_Impl*)&view_tree_impl)
+     return NULL;
+
+   return _view_tree_from_view(view);
+}
+
+E_API E_View *
+e_view_tree_view_get(E_View_Tree *tree)
+{
+   return &tree->view;
+}
+
+EINTERN void
+e_view_tree_child_add(E_View_Tree *tree, E_View *view)
+{
+   wl_list_insert(tree->children.prev, &view->link);
+
+   if (tree->impl && tree->impl->child_add)
+     tree->impl->child_add(tree, view);
+}
+
+EINTERN void
+e_view_tree_child_remove(E_View_Tree *tree, E_View *view)
+{
+   wl_list_remove(&view->link);
+
+   if (tree->impl && tree->impl->child_remove)
+     tree->impl->child_remove(tree, view);
+}
+
+static E_View *
+_view_tree_top_get(E_View_Tree *tree)
+{
+   E_View *child, *top;
+
+   if (wl_list_empty(&tree->children))
+     return NULL;
+
+   wl_list_for_each_reverse(child, &tree->children, link)
+     {
+        if (child->type != E_VIEW_TYPE_TREE)
+          return child;
+
+        top = _view_tree_top_get(e_view_tree_from_view(child));
+        if (top)
+          return top;
+     }
+
+   return NULL;
+}
+
+EINTERN E_View *
+e_view_tree_top_get(E_View_Tree *tree)
+{
+   return _view_tree_top_get(tree);
+}
+
+static E_View *
+_view_tree_bottom_get(E_View_Tree *tree)
+{
+   E_View *child, *bottom;
+
+   if (wl_list_empty(&tree->children))
+     return NULL;
+
+   wl_list_for_each(child, &tree->children, link)
+     {
+        if (child->type != E_VIEW_TYPE_TREE)
+          return child;
+
+        bottom = _view_tree_bottom_get(e_view_tree_from_view(child));
+        if (bottom)
+          return bottom;
+     }
+
+   return NULL;
+}
+
+EINTERN E_View *
+e_view_tree_bottom_get(E_View_Tree *tree)
+{
+   return _view_tree_bottom_get(tree);
+}
diff --git a/src/include/e_canvas.h b/src/include/e_canvas.h
new file mode 100644 (file)
index 0000000..43ce0f4
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef E_CANVAS_H
+#define E_CANVAS_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <e_view.h>
+
+typedef struct _E_Canvas E_Canvas;
+
+/**
+ * Get E_View_Tree instance for given E_Canvas_Layer
+ */
+E_View_Tree *e_canvas_layer_view_tree_get(E_Canvas *canvas, E_Canvas_Layer layer);
+
+void e_canvas_tree_for_each(E_Canvas *canvas, E_View_Iterator_Cb iterator, void *user_data);
+
+void e_canvas_tree_for_each_reverse(E_Canvas *canvas, E_View_Iterator_Cb iterator, void *user_data);
+
+/**
+ * TODO
+ */
+E_View *e_canvas_top_get(E_Canvas *canvas);
+
+/**
+ * TODO
+ */
+E_View *e_canvas_bottom_get(E_Canvas *canvas);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
index eaf0645..055a3d6 100644 (file)
@@ -1,9 +1,16 @@
 #ifndef E_MAP_H
 #define E_MAP_H
 
-#include <e_types.h>
+#ifdef  __cplusplus
+extern "C" {
+#endif
 
+#ifndef E_TEST
+#include <e_types.h>
 #include <Evas.h>
+#endif
+
+#include <e_view.h>
 
 typedef struct _E_Map E_Map;
 
@@ -35,4 +42,8 @@ E_API Eina_Bool        e_map_util_zoom_with_constant_ratio(E_Map *em, double zoo
 E_API Eina_Bool        e_map_util_zoom(E_Map *em, double zoomx, double zoomy, int cx, int cy);
 E_API Eina_Bool        e_map_util_rotate(E_Map *em, int angle, int cx, int cy);
 
+#ifdef  __cplusplus
+}
+#endif
+
 #endif
diff --git a/src/include/e_view.h b/src/include/e_view.h
new file mode 100644 (file)
index 0000000..6997a5e
--- /dev/null
@@ -0,0 +1,399 @@
+#ifndef E_VIEW_H
+#define E_VIEW_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+struct _E_Map;
+typedef struct _E_Map E_Map;
+
+typedef struct _E_View       E_View;
+typedef struct _E_View_Tree  E_View_Tree;
+
+typedef void (*E_View_Iterator_Cb)(E_View *view, int sx, int sy, void *user_data);
+
+typedef enum {
+     E_CANVAS_LAYER_BOTTOM,
+     E_CANVAS_LAYER_BG,
+     E_CANVAS_LAYER_DESKTOP,
+     E_CANVAS_LAYER_DESKTOP_TOP,
+     E_CANVAS_LAYER_CLIENT_DESKTOP,
+     E_CANVAS_LAYER_CLIENT_BELOW,
+     E_CANVAS_LAYER_CLIENT_NORMAL,
+     E_CANVAS_LAYER_CLIENT_ABOVE,
+     E_CANVAS_LAYER_CLIENT_EDGE,
+     E_CANVAS_LAYER_CLIENT_FULLSCREEN,
+     E_CANVAS_LAYER_CLIENT_EDGE_FULLSCREEN,
+     E_CANVAS_LAYER_CLIENT_POPUP,
+     E_CANVAS_LAYER_CLIENT_TOP,
+     E_CANVAS_LAYER_CLIENT_PRIO,
+     E_CANVAS_LAYER_CLIENT_NOTIFICATION_LOW,
+     E_CANVAS_LAYER_CLIENT_NOTIFICATION_NORMAL,
+     E_CANVAS_LAYER_CLIENT_NOTIFICATION_HIGH,
+     E_CANVAS_LAYER_CLIENT_NOTIFICATION_TOP,
+     E_CANVAS_LAYER_CLIENT_ALERT_LOW,
+     E_CANVAS_LAYER_CLIENT_ALERT,
+     E_CANVAS_LAYER_CLIENT_ALERT_HIGH,
+     E_CANVAS_LAYER_CLIENT_DRAG,
+     E_CANVAS_LAYER_CLIENT_CURSOR,
+     E_CANVAS_LAYER_POPUP,
+     E_CANVAS_LAYER_EFFECT,
+     E_CANVAS_LAYER_DESK_OBJECT_BELOW,
+     E_CANVAS_LAYER_DESK_OBJECT,
+     E_CANVAS_LAYER_DESK_OBJECT_ABOVE,
+     E_CANVAS_LAYER_MENU,
+     E_CANVAS_LAYER_DESKLOCK,
+     E_CANVAS_LAYER_MAX,
+} E_Canvas_Layer;
+
+typedef enum {
+   E_VIEW_RENDER_BLEND = 0,
+   E_VIEW_RENDER_COPY = 2,
+} E_View_Render_Op;
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+//// view
+////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * TODO
+*/
+void e_view_destroy(E_View *view);
+
+/**
+ * TODO
+ */
+void e_view_for_each_view(E_View *view, E_View_Iterator_Cb iterator, void *user_data);
+
+/**
+ * TODO
+ */
+void e_view_for_each_view_reverse(E_View *view, E_View_Iterator_Cb iterator, void *user_data);
+
+/**
+ * Move the view to another location in the tree.
+ */
+void e_view_reparent(E_View *view, E_View_Tree *new_parent);
+
+/**
+ * Make the view visible.
+ */
+void e_view_show(E_View *view);
+
+/**
+ * Make the view invisible. All of its children are implicitly invisible as
+ * well.
+ */
+void e_view_hide(E_View *view);
+
+/**
+ * Retrieves whether or not the given E_View is visible.
+ */
+bool e_view_visible_get(E_View *view);
+
+/**
+ * Set the position of the view relative to its parent.
+ *
+ * @param[in] x Integer X coordinate to set to
+ * @param[in] y Integer Y coordinate to set to
+ */
+void e_view_position_set(E_View *view, int x, int y);
+
+/**
+ * Retrieve the position of the given E_View.
+ * Position refers to relative coordinates based on parent's position.
+ *
+ * @param[out] x Integer pointer to store the X coordinate of E_View.
+ * @param[out] y Integer pointer to store the Y coordinate of E_View.
+ */
+void e_view_position_get(E_View *view, int *x, int *y);
+
+/**
+ * Retrieve the local coordinates of the given E_View.
+ * Coords refers to layout coordinates considering all of its
+ * parent's positions.
+ *
+ * @param[out] lx Integer pointer to store the X local coordinate of E_View.
+ * @param[out] ly Integer pointer to store the Y local coordinate of E_View.
+*/
+void e_view_coords_get(E_View *view, int *lx, int *ly);
+
+/**
+ * Move the view right above the specified sibling.
+ * Asserts that view and sibling are distinct and share the same parent.
+ */
+void e_view_place_above(E_View *view, E_View *sibling);
+
+/**
+ * Move the view right below the specified sibling.
+ * Asserts that view and sibling are distinct and share the same parent.
+ */
+void e_view_place_below(E_View *view, E_View *sibling);
+
+/**
+ * Move the view above all of its sibling views.
+ */
+void e_view_raise_to_top(E_View *view);
+
+/**
+ * Move the view below all of its sibling views.
+ */
+void e_view_lower_to_bottom(E_View *view);
+
+/**
+ * Get the view stacked right above given view.
+ * TODO
+ */
+E_View *e_view_above_get(E_View *view);
+
+/**
+ * Get the view stacked right below given view.
+ * TODO
+ */
+E_View *e_view_below_get(E_View *view);
+
+/**
+ * Retrieve the render mode of the given E_View.
+*/
+E_View_Render_Op e_view_render_op_get(E_View *view);
+
+/**
+ * Set the render mode to be used for compositing.
+ *
+ * @param[in] render_op Enum value which is one of the E_View_Render_Op.
+*/
+void e_view_render_op_set(E_View *view, E_View_Render_Op render_op);
+
+/**
+ * Set the color of the given E_View to the given one.
+ *
+ * @param[in] r The red component of the given color.
+ * @param[in] g The green component of the given color.
+ * @param[in] b The blue component of the given color.
+ * @param[in] a The alpha component of the given color.
+*/
+void e_view_color_set(E_View *view, int r, int g, int b, int a);
+
+/**
+ * Retrieves the color of the given E_View.
+ *
+ * @param[out] r The red component of the given color.
+ * @param[out] g The green component of the given color.
+ * @param[out] b The blue component of the given color.
+ * @param[out] a The alpha component of the given color.
+*/
+void e_view_color_get(E_View *view, int *r, int *g, int *b, int *a);
+
+/**
+ * Set user data to E_View with the given string key.
+ *
+ * @param[in] view The E_View object to attach the data pointer to
+ * @param[in] key The string key for the data to access it
+ * @param[in] data The pointer to the data to be attached
+*/
+void e_view_data_set(E_View *view, const char *key, const void *data);
+
+/**
+ * Return an attached data pointer on E_View object by its given
+ * string key.
+ *
+ * @param[in] view The E_View object to which the data was attached
+ * @param[in] key The string key the data was stored under
+ * @return The data pointer stored, or @c NULL if none was stored
+ */
+void *e_view_data_get(E_View *view, const char *key);
+
+/**
+ * Delete an attached data pointer from the given E_View object
+ *  and return the deleted data pointer.
+ *
+ * @param[in] view The E_View object to delete the data pointer from
+ * @param[in] key The string key the data was stored under
+ * @return The original data pointer stored at @p key on @p view
+ */
+void *e_view_data_del(E_View *view, const char *key);
+
+/**
+ * Clip the E_View object @c view to the area occupied by the clip object
+ * @c clip.
+ *
+ * @c clip should be E_View_Rect or E_View_Image
+ *
+ * @param[in] view The E_View object
+ * @param[in] clip The E_View object to clip @c view by
+*/
+void e_view_clip_set(E_View *view, E_View *clip);
+
+/**
+ * Disable/cease clipping on a clipped @c view object.
+ *
+ * @param[in] view The E_View object to disable clipping
+*/
+void e_view_clip_unset(E_View *view);
+
+/**
+ * Get current E_View transformation map.
+ */
+const E_Map *e_view_map_get(E_View *view);
+
+/**
+ * Set current E_View transformation map.
+ */
+void e_view_map_set(E_View *view, E_Map *map);
+
+/**
+ * Enable or disable the use of map for the E_View object @c view.
+ *
+ * @param[in] enabled bool to set state
+*/
+void e_view_map_enable_set(E_View *view, bool enabled);
+
+/**
+ * Return bool to check whether the E_View object
+ * @c view is map enabled or not.
+ *
+ * @param[in] view The E_View object
+*/
+bool e_view_map_enable_get(const E_View *view);
+
+/**
+ * Set whether an E_View object is to freeze (discard) events.
+ *
+ * If @c freeze is @c true, it will force events on @c view to be discarded.
+ * If @c freeze is @c false, events will be processed on that object as normal.
+ *
+ * @param[in] freeze bool determining whether to freeze events
+*/
+void e_view_freeze_events_set(E_View *view, bool freeze);
+
+/**
+ * Set whether an Evas object is to repeat events.
+ *
+ * If @c repeat is @c true, it will make events on @c view to also be repeated
+ * for the next lower object in the objects' stack
+ * If @c repeat is @c false, events occurring on @c view will be processed only
+ * on it.
+ *
+ * @param[in] repeat bool determining whether to repeat events
+*/
+void e_view_repeat_events_set(E_View *view, bool repeat);
+
+/**
+ * Set the wl_listener to be called when view is destroyed.
+ */
+void e_view_destroy_listener_add(E_View *view, struct wl_listener *listener);
+
+/**
+ * Set the listener function to be called when show event occurs.
+*/
+void e_view_show_listener_add(E_View *view, struct wl_listener *listener);
+
+/**
+ * Set the listener function to be called when hide event occurs.
+*/
+void e_view_hide_listener_add(E_View *view, struct wl_listener *listener);
+
+/**
+ * Set the listener function to be called when move event occurs.
+*/
+void e_view_reposition_listener_add(E_View *view, struct wl_listener *listener);
+
+/**
+ * Set the listener function to be called when restack event occurs.
+*/
+void e_view_restack_listener_add(E_View *view, struct wl_listener *listener);
+
+/**
+ * Set the name of the given E_View object
+ *
+ * @param[in] name The string to set @c view 's name
+*/
+void e_view_name_set(E_View *view, const char *name);
+
+/**
+ * Get the name of the given E_View object
+*/
+const char *e_view_name_get(const E_View *view);
+
+/**
+ * Get a parent E_View_Tree instance from a given E_View
+ */
+E_View_Tree *e_view_parent_get(E_View *view);
+
+typedef enum
+{
+   E_VIEW_DESTROY = 0,
+   E_VIEW_SHOW, /**< Show Event */
+   E_VIEW_HIDE, /**< Hide Event */
+   E_VIEW_MOVE, /**< Move Event */
+   E_VIEW_RESIZE, /**< Resize Event */
+   E_VIEW_RESTACK, /**< Restack Event */
+   /* Add new events type at here */
+   E_VIEW_EVENT_MAX /**< Sentinel value to indicate last enum field during iteration */
+} E_View_Event_Type;
+
+typedef struct
+{
+   E_View *view;
+   void *event_info;
+} E_View_Event_Callback_Data;
+
+/**
+ * Add (register) a listener function to a given E_View with E_View_Event_Type.
+ *
+ * @param[in] type The value of the enum E_View_Event_Type to register the @c listener
+ * @param[in] listener The wl_listener to be called when the event is triggered
+ *
+ *  Since the wl_listener is registered in the listener_list of wl_signal,
+ * the memory of wl_listener cannot be freed until e_view_event_listener_del is called.
+ *  When an event occurs, the notify callback passes E_View_Event_Callback_Data.
+ *
+ * @see e_view_event_callback_del
+*/
+void e_view_event_listener_add(E_View *view, E_View_Event_Type type, struct wl_listener *listener);
+
+/**
+ * Delete (unregister) a listener function from a given E_View.
+ *
+ * @param[in] type The type of event that was triggering the callback
+ * @param[in] func The wl_listener to be deleted that is registered with @c type
+ *
+ *  e_view_event_listener_del should be called before the memory of the structure
+ * that contains @c listener is freed.
+*/
+void e_view_event_listener_del(E_View *view, E_View_Event_Type type, struct wl_listener *listener);
+
+/**
+ * Set pass_events to E_View
+ */
+void e_view_pass_events_set(E_View *view, bool set);
+
+/**
+ * Get pass_events from E_View
+ */
+bool e_view_pass_events_get(E_View *view);
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+//// view_tree
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * TODO
+ */
+E_View_Tree *e_view_tree_try_from_view(E_View *view);
+
+/**
+ * TODO
+ */
+E_View *e_view_tree_view_get(E_View_Tree *tree);
+
+/**
+ * TODO
+ */
+E_Canvas_Layer e_view_layer_index_get(E_View *view);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/include/e_view_client.h b/src/include/e_view_client.h
new file mode 100644 (file)
index 0000000..120f30a
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef E_VIEW_CLIENT_H
+#define E_VIEW_CLIENT_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <e_view.h>
+#include <e_comp_object.h>
+
+typedef struct _E_View_Client E_View_Client;
+typedef void (*_E_View_Client_Signal_Cb) (void *data, E_View_Client *client, const char *emission, const char *source);
+typedef _E_View_Client_Signal_Cb E_View_Client_Signal_Cb;
+
+void e_view_client_alpha_set(E_View_Client *client, bool alpha);
+void e_view_client_color_get(E_View_Client *client, int *r, int *g, int *b, int *a);
+bool e_view_client_content_set(E_View_Client *client, E_View *content, E_Comp_Object_Content_Type type);
+E_Comp_Object_Content_Type e_view_client_content_type_get(E_View_Client *client);
+void e_view_client_damage(E_View_Client *client, int x, int y, int width, int height);
+void e_view_client_dirty(E_View_Client *client);
+E_View *e_view_client_effect_object_get(E_View_Client *client);
+bool e_view_client_effect_set(E_View_Client *client, const char *effect);
+bool e_view_client_effect_start(E_View_Client *client, E_View_Client_Signal_Cb end_cb, void *end_data);
+bool e_view_client_effect_stop(E_View_Client *client, E_View_Client_Signal_Cb end_cb);
+bool e_view_client_render(E_View_Client *client);
+void e_view_client_focus_set(E_View_Client *client, bool focus);
+bool e_view_client_focus_get(E_View_Client *client);
+void e_view_client_size_hint_max_get(E_View_Client *client, int *width, int *height);
+void e_view_client_size_hint_min_get(E_View_Client *client, int *width, int *height);
+void e_view_client_size_hint_padding_get(E_View_Client *client, int *l, int *r, int *t, int *b);
+void e_view_client_size_hint_weight_get(E_View_Client *client, double *x, double *y);
+void e_view_client_size_hint_align_get(E_View_Client *client, double *x, double *y);
+bool e_view_client_visible_get(E_View_Client *client);
+unsigned int e_view_client_is_animating(E_View_Client *client);
+void e_view_client_hwc_update_set(E_View_Client *client, bool set);
+bool e_view_client_render_update_lock_get(E_View_Client *client);
+void e_view_client_geometry_get(E_View_Client *client, int *x, int *y, int *width, int *height);
+void e_view_client_geometry_set(E_View_Client *client, int x, int y, int width, int height);
+void e_view_client_size_set(E_View_Client *client, int width, int height);
+
+void e_view_client_mask_set(E_View_Client *client, bool set);
+bool e_view_client_mask_has(E_View_Client *client);
+
+void e_view_client_frame_xy_adjust(E_View_Client *client, int x, int y, int *ax, int *ay);
+void e_view_client_frame_xy_unadjust(E_View_Client *client, int x, int y, int *ax, int *ay);
+void e_view_client_frame_wh_adjust(E_View_Client *client, int width, int height, int *aw, int *ah);
+void e_view_client_frame_wh_unadjust(E_View_Client *client, int width, int height, int *aw, int *ah);
+
+void e_view_client_resize_listener_add(E_View_Client *client, struct wl_listener *listener);
+
+void e_view_client_signal_emit(E_View_Client *client, const char *sig, const char *src);
+void e_view_client_input_area_set(E_View_Client *client, int x, int y, int w, int h);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/include/e_view_edje.h b/src/include/e_view_edje.h
new file mode 100644 (file)
index 0000000..c3e7730
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef E_VIEW_EDJE_H
+#define E_VIEW_EDJE_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <e_view.h>
+#include <e_map.h>
+
+typedef struct _E_View_Edje E_View_Edje;
+
+E_View_Edje *e_view_edje_util_add(E_View *view);
+bool e_view_edje_map_set(E_View_Edje *edje, E_Map *em);
+bool e_view_edje_map_enable_set(E_View_Edje *edje, bool enable);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/include/e_view_image.h b/src/include/e_view_image.h
new file mode 100644 (file)
index 0000000..a0ca6f7
--- /dev/null
@@ -0,0 +1,404 @@
+#ifndef E_VIEW_IMAGE_H
+#define E_VIEW_IMAGE_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <e_view.h>
+
+typedef struct _E_View_Image E_View_Image;
+
+typedef void (*E_View_Image_Pixels_Get_Cb)(void *data, E_View_Image *image);
+
+typedef enum _E_View_Colorspace
+{
+   E_VIEW_COLORSPACE_INVALID, /**< Invalid color space */
+   E_VIEW_COLORSPACE_A8, /**< color depth 8-bit, alpha */
+   E_VIEW_COLORSPACE_L8, /**< color depth 8-bit, luminance */
+   E_VIEW_COLORSPACE_GRY8, /**< color depth 8 bit for gray color , G8 */
+   E_VIEW_COLORSPACE_LA88, /**< color depth 16-bit, luminance with 8 bit alpha */
+   E_VIEW_COLORSPACE_AGRY88, /**< AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */
+   E_VIEW_COLORSPACE_RGB565, /**< color depth 16bit, R5-G6-B5 */
+   E_VIEW_COLORSPACE_BRG565, /**< color depth 16bit, B5-G6-R5 */
+   E_VIEW_COLORSPACE_RGB565_A5P, /**<  color depth 24 bit with alpha & dummy, R5-G6-R5-A5-3# */
+   E_VIEW_COLORSPACE_RGBA4444, /**<  color depth 16 bit with alpha, R4-G4-B4-A4 */
+   E_VIEW_COLORSPACE_BGRA4444, /**<  color depth 16 bit with alpha, B4-G4-R4-A4 */
+   E_VIEW_COLORSPACE_RGBA5551, /**<  color depth 16 bit with alpha, R5-G5-B5-A1 */
+   E_VIEW_COLORSPACE_BGRA5551, /**<  color depth 16 bit with alpha, B5-G5-R5-A1 */
+   E_VIEW_COLORSPACE_RGB888, /**<  color depth 24 bit, R8-G8-B8 */
+   E_VIEW_COLORSPACE_RGB8888, /**<  color depth 32 bit, alpha is reserved but not used, R8-G8-B8-8# */
+   E_VIEW_COLORSPACE_BGR8888, /**<  color depth 32 bit, alpha is reserved but not used, B8-G8-R8-8# */
+   E_VIEW_COLORSPACE_RGBA8888, /**<  color depth 32 bit with alpha, R8-G8-B8-A8 */
+   E_VIEW_COLORSPACE_BGRA8888, /**<  color depth 32 bit with alpha, B8-G8-R8-A8 */
+   E_VIEW_COLORSPACE_ARGB8888, /**<  color depth 32 bit with alpha, A8-R8-G8-B8 */
+   E_VIEW_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
+   E_VIEW_COLORSPACE_YCBCR422P709_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
+   E_VIEW_COLORSPACE_YCBCR422601_PL, /**<  YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
+   E_VIEW_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+   E_VIEW_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+   /* Compressed pixel format */
+   E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC1, /**< OpenGL ETC1_RGB8_OES format @since 1.10 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGB_PVRTC_4BPPV1, /**< OpenGL COMPRESSED_RGB_PVRTC_4BPPV1 format, @since 1.1 extension*/
+   E_VIEW_COLORSPACE_COMPRESSED_ETC1_ALPHA, /**< ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 extension*/
+   E_VIEW_COLORSPACE_COMPRESSED_RGB_S3TC_DXT1, /**< OpenGL COMPRESSED_RGB_S3TC_DXT1_EXT format with RGB only. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT1,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT1_EXT format with RGBA punchthrough. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT2,        /**< DirectDraw DXT2 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT3,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT3_EXT format with RGBA. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT4,        /**< DirectDraw DXT4 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_S3TC_DXT5,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT5_EXT format with RGBA. @since 1.11 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_4x4_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_4x4_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x4_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_5x4_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_5x5_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_5x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x5_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_6x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_6x6_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_6x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x5_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_8x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x6_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_8x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_8x8_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_8x8_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x5_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_10x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x6_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_10x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x8_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_10x8_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_10x10_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_10x10_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x10_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_12x10_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA_ASTC_12x12_KHR, /**< OpenGL COMPRESSED_RGBA_ASTC_12x12_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, @since 2.0 extension */
+   E_VIEW_COLORSPACE_COMPRESSED_R11_EAC, /**< OpenGL COMPRESSED_R11_EAC format. @since 3.0 */
+   E_VIEW_COLORSPACE_COMPRESSED_SIGNED_R11_EAC, /**< OpenGL COMPRESSED_SIGNED_R11_EAC format. @since 3.0 */
+   E_VIEW_COLORSPACE_COMPRESSED_RG11_EAC, /**< OpenGL COMPRESSED_RG11_EAC format. @since 3.0 */
+   E_VIEW_COLORSPACE_COMPRESSED_SIGNED_RG11_EAC, /**< OpenGL COMPRESSED_RG11_EAC format. @since 3.0*/
+   E_VIEW_COLORSPACE_COMPRESSED_RGB8_ETC2, /**< OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 3.0 */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ETC2, /**< OpenGL COMPRESSED_SRGB8_ETC2 format. @since 3.0*/
+   E_VIEW_COLORSPACE_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, /**< OpenGL COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format. @since 3.0*/
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, /**< OpenGL COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format. @since 3.0*/
+   E_VIEW_COLORSPACE_COMPRESSED_RGBA8_ETC2_EAC,        /**< OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 3.0 */
+   E_VIEW_COLORSPACE_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, /**< OpenGL COMPRESSED_SRGB8_ALPHA8_ETC2_EAC format. @since 3.0*/
+   /* ETC */
+   E_VIEW_COLORSPACE_RGB16F, /**< color depth 48-bit, 16-16-16 half floating point. GLES 3.0 floating point format*/
+   E_VIEW_COLORSPACE_RGB32F, /**< color depth 96-bit, 32-32-32 floating point. GLES 3.0 floating point format*/
+   E_VIEW_COLORSPACE_DEPTH_UNSIGNED_INT, /**< Unsigned int depth format 32-bit. @SINCE_1_9.9 */
+   E_VIEW_COLORSPACE_DEPTH_FLOAT, /**< Float depth format 32-bit. @SINCE_1_9.9 */
+   E_VIEW_COLORSPACE_DEPTH_STENCIL,
+   E_VIEW_COLORSPACE_R11G11B10F, /**< Packed 32-bit, 11-11-10 unsigned floating point. */
+   E_VIEW_COLORSPACE_CHROMINANCE_U, /**< Color depth 8-bit, chrominance U */
+   E_VIEW_COLORSPACE_CHROMINANCE_V, /**< Color depth 8-bit, chrominance V */
+   /* TIZEN_ONLY(20200224): add EMILE_COLORSPACE_PALETTE for fixing warning */
+   E_VIEW_COLORSPACE_PALETTE, /**< TIZEN_ONLY(20200224): add EMILE_COLORSPACE_PALETTE for fixing warning */
+} E_View_Colorspace;
+
+typedef enum
+{
+   E_VIEW_LOAD_ERROR_NONE = 0,  /**< No error on load */
+   E_VIEW_LOAD_ERROR_GENERIC,  /**< A non-specific error occurred */
+   E_VIEW_LOAD_ERROR_DOES_NOT_EXIST,  /**< File (or file path) does not exist */
+   E_VIEW_LOAD_ERROR_PERMISSION_DENIED,         /**< Permission denied to an existing file (or path) */
+   E_VIEW_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED,  /**< Allocation of resources failure prevented load */
+   E_VIEW_LOAD_ERROR_CORRUPT_FILE,  /**< File corrupt (but was detected as a known format) */
+   E_VIEW_LOAD_ERROR_UNKNOWN_FORMAT,  /**< File is not a known format */
+   E_VIEW_LOAD_ERROR_CANCELLED, /**< File loading has been cancelled */
+} E_View_Load_Error;
+
+typedef enum _E_View_Native_Surface_Type
+{
+   E_VIEW_NATIVE_SURFACE_NONE, /**< No surface type */
+   E_VIEW_NATIVE_SURFACE_TBM, /**< Tizen system based type. tbm surface @since 1.14  */
+   E_VIEW_NATIVE_SURFACE_WL, /**< Wayland system based type. buffer of surface */
+} E_View_Native_Surface_Type;
+
+#define EVIEW_NATIVE_SURFACE_VERSION 5
+
+typedef struct _E_View_Native_Surface
+{
+   int version;
+   E_View_Native_Surface_Type type;
+   union {
+      struct
+      {
+         void *legacy_buffer; /**< wayland client buffer to use */
+      } wl; /**< Set this struct fields if surface data is Wayland based. */
+      struct
+      {
+         void *buffer; /**< tbm surface buffer to use @since 1.14 */
+         // TIZEN_ONLY(20171121) : support ROI mode (tbm rot, ratio, flip)
+         int   rot; /**< rotation (EVAS_IMAGE_ORIENT_NONE, EVAS_IMAGE_ORIENT_90, EVAS_IMAGE_ORIENT_180, EVAS_IMAGE_ORIENT_270) @since 1.14 */
+         float ratio; /**< width/height ratio of the source image @since 1.14 */
+         int   flip; /**< flip (EVAS_IMAGE_FLIP_HORIZONTAL:horizontal, EVAS_IMAGE_FLIP_VERTICAL:vertical) @since 1.14 */
+      } tbm; /**< Set this struct fields if surface data is Tizen based. @since 1.14 */
+   } data;
+} E_View_Native_Surface;
+
+typedef enum
+{
+  E_VIEW_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
+  E_VIEW_BORDER_FILL_DEFAULT = 1, /**< Image's center region is to be @b blended
+                                 * with objects underneath it, if it has
+                                 * transparency. This is the default behavior
+                                 * for image objects */
+  E_VIEW_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid,
+                              * even if it has transparency on it */
+} E_View_Border_Fill_Mode;
+
+/**
+ * TODO
+ */
+E_View_Image *e_view_image_create(E_View_Tree *parent);
+
+/**
+ * TODO
+ */
+E_View_Image *e_view_image_filled_create(E_View_Tree *parent);
+
+/**
+ * TODO
+ */
+E_View *e_view_image_view_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+E_View_Image *e_view_image_try_from_view(E_View *view);
+
+/**
+ * TODO
+ */
+void e_view_image_alpha_set(E_View_Image *image, bool alpha);
+
+/**
+ * TODO
+ */
+bool e_view_image_alpha_get(E_View_Image* image);
+
+/**
+ * TODO
+ */
+bool e_view_image_animated_get(E_View_Image* image);
+
+/**
+ * TODO
+ */
+void e_view_image_animated_frame_set(E_View_Image* image, int frame_index);
+
+/**
+ * TODO
+ */
+int e_view_image_animated_frame_get(E_View_Image* image);
+
+/**
+ * TODO
+ */
+int e_view_image_animated_frame_count_get(E_View_Image* image);
+
+/**
+ * TODO
+ */
+double e_view_image_animated_frame_duration_get(const E_View_Image *image, int start_frame, int frame_num);
+
+/**
+ * TODO
+ */
+void e_view_image_border_center_fill_set(const E_View_Image *image, E_View_Border_Fill_Mode fill);
+
+/**
+ * TODO
+ */
+E_View_Border_Fill_Mode e_view_image_border_center_fill_get(const E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_border_set(E_View_Image *image, int l, int r, int t, int b);
+
+/**
+ * TODO
+ */
+void e_view_image_border_get(const E_View_Image *image, int *l, int *r, int *t, int *b);
+
+/**
+ * TODO
+ */
+void e_view_image_colorspace_set(E_View_Image *image, E_View_Colorspace cspace);
+
+/**
+ * TODO
+ */
+E_View_Colorspace e_view_image_colorspace_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_data_copy_set(E_View_Image *image, void *data);
+
+/**
+ * TODO
+*/
+void e_view_image_data_set(E_View_Image *image, void *data);
+
+/**
+ * TODO
+ */
+void *e_view_image_data_get(E_View_Image *image, bool for_writing);
+
+/**
+ * TODO
+ */
+void e_view_image_data_update_add(E_View_Image *image, int x, int y, int w, int h);
+
+/**
+ * TODO
+ */
+void e_view_image_file_set(E_View_Image *image, const char *file, const char *key);
+
+/**
+ * TODO
+ */
+void e_view_image_file_get(E_View_Image *image, const char **file, const char **key);
+
+/**
+ * TODO
+ */
+void e_view_image_fill_set(E_View_Image *image, int x, int y, int w, int h);
+
+/**
+ * TODO
+ */
+void e_view_image_fill_get(const E_View_Image *image, int *x, int *y, int *w, int *h);
+
+/**
+ * TODO
+ */
+void e_view_image_filled_set(E_View_Image *image, bool filled);
+
+/**
+ * TODO
+ */
+bool e_view_image_filled_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+E_View_Load_Error e_view_image_load_error_get(const E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_load_size_set(E_View_Image *image, int w, int h);
+
+/**
+ * TODO
+ */
+void e_view_image_load_size_get(const E_View_Image *image, int *w, int *h);
+
+/**
+ * TODO
+ */
+void e_view_image_native_surface_set(E_View_Image *image, E_View_Native_Surface *surf);
+
+/**
+ * TODO
+ */
+E_View_Native_Surface *e_view_image_native_surface_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_pixels_dirty_set(E_View_Image *Image, bool dirty);
+
+/**
+ * TODO
+ */
+bool e_view_image_pixels_dirty_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_pixels_get_callback_set(E_View_Image *image, E_View_Image_Pixels_Get_Cb func, void *data);
+
+/**
+ * TODO
+ */
+void e_view_image_pixels_noti_callback_set(E_View_Image *image, E_View_Image_Pixels_Get_Cb func, void *data);
+
+/**
+ * TODO
+ */
+void e_view_image_smooth_scale_set(E_View_Image *image, bool smooth_scale);
+
+/**
+ * TODO
+ */
+bool e_view_image_smooth_scale_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+void e_view_image_size_set(E_View_Image *image, int w, int h);
+
+/**
+ * TODO
+ */
+void e_view_image_size_get(E_View_Image *image, int *w, int *h);
+
+/**
+ * TODO
+ */
+bool e_view_image_source_set(E_View_Image *image, E_View_Image *src);
+
+/**
+ * TODO
+ */
+E_View_Image *e_view_image_source_get(E_View_Image *image);
+
+/**
+ * TODO
+ */
+bool e_view_image_source_unset(E_View_Image *image);
+
+/**
+ * TODO
+ */
+bool e_view_image_save(E_View_Image *image, const char* file, const char *key, const char *flags);
+
+/**
+ * TODO
+ */
+void e_view_image_preload(E_View_Image *image, bool cancel);
+
+/**
+ * TODO
+ */
+void e_view_image_snapshot_set(E_View_Image *image, bool set);
+
+/**
+ * TODO
+ */
+void e_view_image_geometry_set(E_View_Image *image, int x, int y, int w, int h);
+
+/**
+ * TODO
+ */
+void e_view_image_geometry_get(E_View_Image *image, int *x, int *y, int *w, int *h);
+
+
+/**
+ * TODO
+ */
+void e_view_image_gfx_filter_program_set(E_View_Image *image, const char *code, const char *name);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/include/e_view_rect.h b/src/include/e_view_rect.h
new file mode 100644 (file)
index 0000000..c65f2f2
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef E_VIEW_RECT_H
+#define E_VIEW_RECT_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <e_view.h>
+
+typedef struct _E_View_Rect E_View_Rect;
+
+/**
+ * TODO
+ */
+E_View_Rect *e_view_rect_create(E_View_Tree *parent, int width, int height, const int color[4]);
+
+/**
+ * TODO
+ */
+E_View_Rect *e_view_rect_try_from_view(E_View *view);
+
+/**
+ * TODO
+ */
+E_View *e_view_rect_view_get(E_View_Rect *rect);
+
+/**
+ * TODO
+ */
+void e_view_rect_color_set(E_View_Rect *rect, int r, int g, int b, int a);
+
+/**
+ * TODO
+ */
+void e_view_rect_color_get(E_View_Rect *rect, int *r, int *g, int *b, int *a);
+
+/**
+ * Change the size of given E_View_Rect
+ *
+ * @param[in] width Integer to change width
+ * @param[in] height Integer to change height
+*/
+void e_view_rect_size_set(E_View_Rect *rect, int width, int height);
+
+/**
+ * TODO
+ */
+void e_view_rect_size_get(E_View_Rect *rect, int *width, int *height);
+
+/**
+ * TODO
+ */
+void e_view_rect_resize_listener_add(E_View_Rect *rect, struct wl_listener *listener);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
index 59a2e86..461bd23 100644 (file)
@@ -1,42 +1,54 @@
-
 bin_PROGRAMS = enlightenment-tests
 
-enlightenment_tests_SOURCES = \
-       tc-main.cpp \
-       tc-e_util_transform.cpp \
-       $(top_srcdir)/src/bin/e_util_transform.c
+enlightenment_source = \
+       $(top_builddir)/src/bin/core/e_view.c \
+       $(top_builddir)/src/bin/core/e_view_tree.c \
+       $(top_builddir)/src/bin/core/e_view_rect.c \
+       $(top_builddir)/src/bin/core/e_view_image.c \
+       $(top_builddir)/src/bin/core/e_canvas.c \
+       $(top_builddir)/src/bin/utils/e_map.c \
+       $(top_builddir)/src/bin/core/e_view_event.c
 
 enlightenment_tests_SOURCES = \
-       tc-main.cpp
+       ${enlightenment_source} \
+       tc-main.cpp \
+       evas_wrapper.cpp \
+       tc-e_view.cpp \
+       tc-e_canvas.cpp \
+       tc-e_view_rect.cpp \
+       tc-e_view_image.cpp \
+       tc-e_view_event.cpp
 
 enlightenment_tests_CFLAGS = \
-       @DLOG_CFLAGS@ \
-       @WAYLAND_CFLAGS@ \
-       @WAYLAND_TBM_CFLAGS@ \
        @E_CFLAGS@ \
        @GMOCK_CFLAGS@ \
-       @SUID_CFLAGS@ \
-       @e_cflags@ \
+       @WAYLAND_CFLAGS@ \
+       -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT \
        ${CFLAGS} \
-       -I$(top_builddir)/src/include
+       -fPIC \
+       -DE_VIEW_TEST \
+       -I$(top_builddir)/src/bin \
+       -I$(top_builddir)/src/include \
+       -I$(top_builddir)/src/bin/core \
+       -I$(top_builddir)/src/bin/utils \
+       -I$(top_builddir)/src/bin/log \
+       -I$(top_builddir)/src/bin/debug
 
 enlightenment_tests_CXXFLAGS = \
-       @DLOG_CFLAGS@ \
-       @WAYLAND_CFLAGS@ \
-       @WAYLAND_TBM_CFLAGS@ \
        @E_CFLAGS@ \
        @GMOCK_CFLAGS@ \
-       @SUID_CFLAGS@ \
+       @WAYLAND_CFLAGS@ \
        ${CXXFLAGS} \
+       -fPIC \
+       -DE_VIEW_TEST \
+       -I$(top_builddir)/src/bin \
        -I$(top_builddir)/src/include
 
 enlightenment_tests_LDFLAGS = \
-       @DLOG_LIBS@ \
-       @WAYLAND_LIBS@ \
-       @WAYLAND_TBM_LIBS@ \
        @E_LIBS@ \
        @GMOCK_LIBS@ \
        @SUID_CFLAGS@ \
+       @WAYLAND_LIBS@ \
        ${LDFLAGS} \
        -lpthread
 
diff --git a/tests/evas_wrapper.cpp b/tests/evas_wrapper.cpp
new file mode 100644 (file)
index 0000000..cca0061
--- /dev/null
@@ -0,0 +1,491 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+EvasMock *evasMock;
+
+void evas_object_del(Evas_Object *obj)
+{
+       evasMock->evas_object_del(obj);
+}
+
+void evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
+{
+    evasMock->evas_object_stack_above(obj, above);
+}
+
+void evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
+{
+    evasMock->evas_object_stack_below(obj, below);
+}
+
+void evas_object_raise(Evas_Object *obj)
+{
+   evasMock->evas_object_raise(obj);
+}
+
+void evas_object_lower(Evas_Object *obj)
+{
+   evasMock->evas_object_lower(obj);
+}
+
+void evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
+{
+       evasMock->evas_object_color_get(obj, r, g, b, a);
+}
+
+void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
+{
+       evasMock->evas_object_color_set(obj, r, g, b, a);
+}
+
+void evas_object_geometry_get(Evas_Object *obj, int *x, int *y, int *width, int *height)
+{
+       evasMock->evas_object_geometry_get(obj, x, y, width, height);
+}
+
+void evas_object_geometry_set(Evas_Object *obj, int x, int y, int width, int height)
+{
+       evasMock->evas_object_geometry_set(obj, x, y, width, height);
+}
+
+Evas_Render_Op evas_object_render_op_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_render_op_get(obj);
+}
+
+void evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op)
+{
+       evasMock->evas_object_render_op_set(obj, render_op);
+}
+
+void evas_object_data_set(Evas_Object *obj, const char *key, const void *data)
+{
+       evasMock->evas_object_data_set(obj, key, data);
+}
+
+void *evas_object_data_get(const Evas_Object *obj, const char *key)
+{
+       return evasMock->evas_object_data_get(obj, key);
+}
+
+void *evas_object_data_del(Evas_Object *obj, const char *key)
+{
+       return evasMock->evas_object_data_del(obj, key);
+}
+
+void evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
+{
+       evasMock->evas_object_clip_set(obj, clip);
+}
+
+void evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze)
+{
+       evasMock->evas_object_freeze_events_set(obj, freeze);
+}
+
+void evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat)
+{
+       evasMock->evas_object_repeat_events_set(obj, repeat);
+}
+
+void evas_object_move(Evas_Object *obj, int x, int y)
+{
+       evasMock->evas_object_move(obj, x, y);
+}
+
+void evas_object_show(Evas_Object *obj)
+{
+       evasMock->evas_object_show(obj);
+}
+
+void evas_object_hide(Evas_Object *obj)
+{
+       evasMock->evas_object_hide(obj);
+}
+
+void evas_object_resize(Evas_Object *obj, int w, int h)
+{
+       evasMock->evas_object_resize(obj, w, h);
+}
+
+void evas_object_map_enable_get(const Evas_Object *obj)
+{
+       evasMock->evas_object_map_enable_get(obj);
+}
+
+void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled)
+{
+       evasMock->evas_object_map_enable_set(obj, enabled);
+}
+
+Evas_Object * evas_object_rectangle_add(Evas *evas)
+{
+       return evasMock->evas_object_rectangle_add(evas);
+}
+
+Evas_Object* evas_object_image_add(Evas *e)
+{
+       return evasMock->evas_object_image_add(e);
+}
+
+void evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha)
+{
+       evasMock->evas_object_image_alpha_set(obj, alpha);
+}
+
+Eina_Bool evas_object_image_alpha_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_alpha_get(obj);
+}
+
+Eina_Bool evas_object_image_animated_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_animated_get(obj);
+}
+
+void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index)
+{
+       evasMock->evas_object_image_animated_frame_set(obj, frame_index);
+}
+
+int evas_object_image_animated_frame_get(Evas_Object *obj)
+{
+       return evasMock->evas_object_image_animated_frame_get(obj);
+}
+
+int evas_object_image_animated_frame_count_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_animated_frame_count_get(obj);
+}
+
+double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num)
+{
+       return evasMock->evas_object_image_animated_frame_duration_get(obj, start_frame, frame_num);
+}
+
+void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill)
+{
+       evasMock->evas_object_image_border_center_fill_set(obj, fill);
+}
+
+Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_border_center_fill_get(obj);
+}
+
+void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b)
+{
+       evasMock->evas_object_image_border_set(obj, l, r, t, b);
+}
+
+void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
+{
+       evasMock->evas_object_image_border_get(obj, l, r, t, b);
+}
+
+void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace)
+{
+       evasMock->evas_object_image_colorspace_set(obj,cspace);
+}
+
+Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_colorspace_get(obj);
+}
+
+void evas_object_image_data_copy_set(Evas_Object *obj, void *data)
+{
+       evasMock->evas_object_image_data_copy_set(obj, data);
+}
+
+void evas_object_image_data_set(Evas_Object *obj, void *data)
+{
+       evasMock->evas_object_image_data_set(obj, data);
+}
+
+void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing)
+{
+       return evasMock->evas_object_image_data_get(obj, for_writing);
+}
+
+void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h)
+{
+       evasMock->evas_object_image_data_update_add(obj, x, y, w, h);
+}
+
+void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key)
+{
+       evasMock->evas_object_image_file_set(obj, file, key);
+}
+
+void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key)
+{
+       evasMock->evas_object_image_file_get(obj, file, key);
+}
+
+void evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+       evasMock->evas_object_image_fill_set(obj, x, y, w, h);
+}
+
+void evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+{
+       evasMock->evas_object_image_fill_get(obj, x, y, w, h);
+}
+
+void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool filled)
+{
+       evasMock->evas_object_image_filled_set(obj, filled);
+}
+
+Eina_Bool evas_object_image_filled_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_filled_get(obj);
+}
+
+Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_load_error_get(obj);
+}
+
+void evas_object_image_load_size_set(Evas_Object *obj, int w, int h)
+{
+       evasMock->evas_object_image_load_size_set(obj, w, h);
+}
+
+void evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h)
+{
+       evasMock->evas_object_image_load_size_get(obj, w, h);
+}
+
+void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf)
+{
+       evasMock->evas_object_image_native_surface_set(obj, surf);
+}
+
+Evas_Native_Surface *evas_object_image_native_surface_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_native_surface_get(obj);
+}
+
+void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty)
+{
+       evasMock->evas_object_image_pixels_dirty_set(obj, dirty);
+}
+
+Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_pixels_dirty_get(obj);
+}
+
+void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data)
+{
+       evasMock->evas_object_image_pixels_get_callback_set(obj, func, data);
+       func(data, obj);
+}
+
+void evas_object_image_pixels_noti_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data)
+{
+       evasMock->evas_object_image_pixels_noti_callback_set(obj, func, data);
+       func(data, obj);
+}
+
+void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale)
+{
+       evasMock->evas_object_image_smooth_scale_set(obj, smooth_scale);
+}
+
+Eina_Bool evas_object_image_smooth_scale_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_smooth_scale_get(obj);
+}
+
+void evas_object_image_size_set(Evas_Object *obj, int w, int h)
+{
+       evasMock->evas_object_image_size_set(obj, w, h);
+}
+
+void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h)
+{
+       evasMock->evas_object_image_size_get(obj, w, h);
+}
+
+Eina_Bool evas_object_image_source_set(Evas_Object *obj, Evas_Object *src)
+{
+       return evasMock->evas_object_image_source_set(obj, src);
+}
+
+Evas_Object *evas_object_image_source_get(const Evas_Object *obj)
+{
+       return evasMock->evas_object_image_source_get(obj);
+}
+
+Eina_Bool evas_object_image_source_unset(Evas_Object *obj)
+{
+       return evasMock->evas_object_image_source_unset(obj);
+}
+
+Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags)
+{
+       return evasMock->evas_object_image_save(obj, file, key, flags);
+}
+
+void evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel)
+{
+       evasMock->evas_object_image_preload(obj, cancel);
+}
+
+Evas_Map *evas_map_new(int count)
+{
+   return evasMock->evas_map_new(count);
+}
+
+void evas_map_free(Evas_Map *m)
+{
+   evasMock->evas_map_free(m);
+}
+
+Evas_Map *evas_map_dup(const Evas_Map *m)
+{
+   return evasMock->evas_map_dup(m);
+}
+
+void evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z)
+{
+   evasMock->evas_map_point_coord_get(m, idx, x, y, z);
+}
+
+void evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z)
+{
+   evasMock->evas_map_point_coord_set(m, idx, x, y, z);
+}
+
+void evas_map_point_precise_coord_get(const Evas_Map *m, int idx, double *x, double *y, double *z)
+{
+   evasMock->evas_map_point_precise_coord_get(m, idx, x, y, z);
+}
+
+void evas_map_point_precise_coord_set(Evas_Map *m, int idx, double x, double y, double z)
+{
+   evasMock->evas_map_point_precise_coord_set(m, idx, x, y, z);
+}
+
+void evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v)
+{
+   evasMock->evas_map_point_image_uv_get(m, idx, u, v);
+}
+
+void evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v)
+{
+   evasMock->evas_map_point_image_uv_set(m, idx, u, v);
+}
+
+Eina_Bool evas_map_coords_get(const Evas_Map *m, double x, double y, double *mx, double *my, int grab)
+{
+   return evasMock->evas_map_coords_get(m, x, y, mx, my, grab);
+}
+
+Eina_Bool evas_map_alpha_get(const Evas_Map *m)
+{
+   return evasMock->evas_map_alpha_get(m);
+}
+
+void evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled)
+{
+   evasMock->evas_map_alpha_set(m, enabled);
+}
+
+void evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
+{
+   evasMock->evas_map_point_color_set(m, idx, r, g, b, a);
+}
+
+void evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled)
+{
+   evasMock->evas_map_smooth_set(m, enabled);
+}
+
+void evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z)
+{
+   evasMock->evas_map_util_points_populate_from_geometry(m, x, y, w, h, z);
+}
+
+void evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *eo_obj)
+{
+   evasMock->evas_map_util_points_populate_from_object(m, eo_obj);
+}
+
+void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *eo_obj, Evas_Coord z)
+{
+   evasMock->evas_map_util_points_populate_from_object_full(m, eo_obj, z);
+}
+
+void evas_map_util_object_move_sync_set(Evas_Map *m, Eina_Bool enabled)
+{
+   evasMock->evas_map_util_object_move_sync_set(m, enabled);
+}
+
+void evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
+{
+   evasMock->evas_map_util_points_color_set(m, r, g, b, a);
+}
+
+void evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
+{
+   evasMock->evas_map_util_zoom(m, zoomx, zoomy, cx, cy);
+}
+
+void evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy)
+{
+   evasMock->evas_map_util_rotate(m, degrees, cx, cy);
+}
+
+void evas_object_map_set(Evas_Object *obj, const Evas_Map *map)
+{
+   evasMock->evas_object_map_set(obj, map);
+}
+
+const Evas_Map *evas_object_map_get(Evas_Object *obj)
+{
+   return evasMock->evas_object_map_get(obj);
+}
+
+int evas_map_count_get(const Evas_Map *m)
+{
+   return evasMock->evas_map_count_get(m);
+}
+
+void evas_map_direct_render_set(Evas_Map *m, Eina_Bool direct_render)
+{
+   evasMock->evas_map_direct_render_set(m, direct_render);
+}
+
+void evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
+{
+       evasMock->evas_object_event_callback_add(obj, type, func, data);
+}
+
+void *evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
+{
+       return evasMock->evas_object_event_callback_del(obj, type, func);
+}
+
+void evas_object_pass_events_set(Evas_Object *obj, Eina_Bool set)
+{
+   evasMock->evas_object_pass_events_set(obj, set);
+}
+
+Eina_Bool evas_object_pass_events_get(Evas_Object *obj)
+{
+   return evasMock->evas_object_pass_events_get(obj);
+}
+
+char *efl_gfx_filter_program_set(Evas_Object *obj, const char *code, const char *name)
+{
+       return evasMock->efl_gfx_filter_program_set(obj, code, name);
+}
+
+void evas_object_layer_set(Evas_Object *obj, short layer)
+{
+       return evasMock->evas_object_layer_set(obj, layer);
+}
diff --git a/tests/evas_wrapper.h b/tests/evas_wrapper.h
new file mode 100644 (file)
index 0000000..5bfbfba
--- /dev/null
@@ -0,0 +1,217 @@
+#ifndef __EVAS_WRAPPER_H__
+#define __EVAS_WRAPPER_H__
+
+#include "evas_wrapper_intern.h"
+
+class EvasWrapper {
+public:
+    virtual ~EvasWrapper() {};
+    virtual void evas_object_del(Evas_Object *obj) = 0;
+
+    virtual void evas_object_stack_above(Evas_Object *obj, Evas_Object *above) = 0;
+    virtual void evas_object_stack_below(Evas_Object *obj, Evas_Object *below) = 0;
+    virtual void evas_object_raise(Evas_Object *obj) = 0;
+    virtual void evas_object_lower(Evas_Object *obj) = 0;
+    virtual void evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) = 0;
+    virtual void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) = 0;
+    virtual void evas_object_geometry_get(Evas_Object *obj, int *x, int *y, int *width, int *height) = 0;
+    virtual void evas_object_geometry_set(Evas_Object *obj, int x, int y, int width, int height) = 0;
+    virtual Evas_Render_Op evas_object_render_op_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op) = 0;
+    virtual void evas_object_data_set(Evas_Object *obj, const char *key, const void *data) = 0;
+    virtual void *evas_object_data_get(const Evas_Object *obj, const char *key) = 0;
+    virtual void *evas_object_data_del(Evas_Object *obj, const char *key) = 0;
+    virtual void evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) = 0;
+    virtual void evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze) = 0;
+    virtual void evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) = 0;
+    virtual void evas_object_show(Evas_Object *obj) = 0;
+    virtual void evas_object_hide(Evas_Object *obj) = 0;
+    virtual void evas_object_move(Evas_Object *obj, int x, int y) = 0;
+    virtual void evas_object_resize(Evas_Object *obj, int width, int height) = 0;
+    virtual void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled) = 0;
+    virtual Eina_Bool evas_object_map_enable_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_layer_set(Evas_Object *obj, short layer) = 0;
+
+    virtual Evas_Object* evas_object_rectangle_add(Evas *evas) = 0;
+
+    virtual Evas_Object* evas_object_image_add(Evas *e) = 0;
+    virtual void evas_object_image_alpha_set(Evas_Object* obj, Eina_Bool alpha) = 0;
+    virtual Eina_Bool evas_object_image_alpha_get(const Evas_Object* obj) = 0;
+    virtual Eina_Bool evas_object_image_animated_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index) = 0;
+    virtual int evas_object_image_animated_frame_get(Evas_Object *obj) = 0;
+    virtual int evas_object_image_animated_frame_count_get(const Evas_Object *obj) = 0;
+    virtual double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num) = 0;
+    virtual void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) = 0;
+    virtual Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) = 0;
+    virtual void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) = 0;
+    virtual void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) = 0;
+    virtual Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_data_copy_set(Evas_Object *obj, void *data) = 0;
+    virtual void evas_object_image_data_set(Evas_Object *obj, void *data) = 0;
+    virtual void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) = 0;
+    virtual void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) = 0;
+    virtual void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) = 0;
+    virtual void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key) = 0;
+    virtual void evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) = 0;
+    virtual void evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) = 0;
+    virtual void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool filled) = 0;
+    virtual Eina_Bool evas_object_image_filled_get(const Evas_Object *obj) = 0;
+    virtual Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_load_size_set(Evas_Object *obj, int w, int h) = 0;
+    virtual void evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h) = 0;
+    virtual void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) = 0;
+    virtual Evas_Native_Surface *evas_object_image_native_surface_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty) = 0;
+    virtual Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) = 0;
+    virtual void evas_object_image_pixels_noti_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) = 0;
+    virtual void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale) = 0;
+    virtual Eina_Bool evas_object_image_smooth_scale_get(const Evas_Object *obj) = 0;
+    virtual void evas_object_image_size_set(Evas_Object *obj, int w, int h) = 0;
+    virtual void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h) = 0;
+    virtual Eina_Bool evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) = 0;
+    virtual Evas_Object *evas_object_image_source_get(const Evas_Object *obj) = 0;
+    virtual Eina_Bool evas_object_image_source_unset(Evas_Object *obj) = 0;
+    virtual Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags) = 0;
+    virtual void evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel) = 0;
+    virtual Evas_Map *evas_map_new(int count) = 0;
+    virtual void evas_map_free(Evas_Map *m) = 0;
+    virtual Evas_Map *evas_map_dup(const Evas_Map *m) = 0;
+    virtual void evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z) = 0;
+    virtual void evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z) = 0;
+    virtual void evas_map_point_precise_coord_get(const Evas_Map *m, int idx, double *x, double *y, double *z) = 0;
+    virtual void evas_map_point_precise_coord_set(Evas_Map *m, int idx, double x, double y, double z) = 0;
+    virtual void evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v) = 0;
+    virtual void evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v) = 0;
+    virtual Eina_Bool evas_map_coords_get(const Evas_Map *m, double x, double y, double *mx, double *my, int grab) = 0;
+    virtual Eina_Bool evas_map_alpha_get(const Evas_Map *m) = 0;
+    virtual void evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled) = 0;
+    virtual void evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a) = 0;
+    virtual void evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled) = 0;
+    virtual void evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z) = 0;
+    virtual void evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *eo_obj) = 0;
+    virtual void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *eo_obj, Evas_Coord z) = 0;
+    virtual void evas_map_util_object_move_sync_set(Evas_Map *m, Eina_Bool enabled) = 0;
+    virtual void evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a) = 0;
+    virtual void evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy) = 0;
+    virtual void evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy) = 0;
+    virtual void evas_object_map_set(Evas_Object *obj, const Evas_Map *map) = 0;
+    virtual const Evas_Map *evas_object_map_get(Evas_Object *obj) = 0;
+    virtual int evas_map_count_get(const Evas_Map *m) = 0;
+    virtual void evas_map_direct_render_set(Evas_Map *m, Eina_Bool direct_render) = 0;
+    virtual void evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) = 0;
+    virtual void *evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) = 0;
+    virtual void evas_object_pass_events_set(Evas_Object *obj, Eina_Bool set) = 0;
+    virtual Eina_Bool evas_object_pass_events_get(Evas_Object *obj) = 0;
+    virtual char *efl_gfx_filter_program_set(Evas_Object *obj, const char *code, const char *name) = 0;
+};
+
+class EvasMock : public EvasWrapper {
+public:
+    MOCK_METHOD(void, evas_object_del, (Evas_Object *obj));
+
+    MOCK_METHOD(void, evas_object_stack_above, (Evas_Object *obj, Evas_Object *above));
+    MOCK_METHOD(void, evas_object_stack_below, (Evas_Object *obj, Evas_Object *below));
+    MOCK_METHOD(void, evas_object_raise, (Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_lower, (Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_color_get, (const Evas_Object *obj, int *r, int *g, int *b, int *a));
+    MOCK_METHOD(void, evas_object_color_set, (Evas_Object *obj, int r, int g, int b, int a));
+    MOCK_METHOD(void, evas_object_geometry_get, (Evas_Object *obj, int *x, int *y, int *width, int *height));
+    MOCK_METHOD(void, evas_object_geometry_set, (Evas_Object *obj, int x, int y, int width, int height));
+    MOCK_METHOD(Evas_Render_Op, evas_object_render_op_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_render_op_set, (Evas_Object *obj, Evas_Render_Op render_op));
+    MOCK_METHOD(void, evas_object_data_set, (Evas_Object *obj, const char *key, const void *data));
+    MOCK_METHOD(void*, evas_object_data_get, (const Evas_Object *obj, const char *key));
+    MOCK_METHOD(void*, evas_object_data_del, (Evas_Object *obj, const char *key));
+    MOCK_METHOD(void, evas_object_clip_set, (Evas_Object *obj, Evas_Object *clip));
+    MOCK_METHOD(void, evas_object_freeze_events_set, (Evas_Object *obj, Eina_Bool freeze));
+    MOCK_METHOD(void, evas_object_repeat_events_set, (Evas_Object *obj, Eina_Bool repeat));
+    MOCK_METHOD(void, evas_object_show, (Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_hide, (Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_move, (Evas_Object *obj, int x, int y));
+    MOCK_METHOD(void, evas_object_resize, (Evas_Object *obj, int width, int height));
+    MOCK_METHOD(void, evas_object_map_enable_set, (Evas_Object *obj, Eina_Bool enabled));
+    MOCK_METHOD(Eina_Bool, evas_object_map_enable_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_layer_set, (Evas_Object *obj, short layer));
+
+    MOCK_METHOD(Evas_Object *, evas_object_rectangle_add, (Evas *e));
+
+    MOCK_METHOD(Evas_Object *, evas_object_image_add, (Evas *e));
+    MOCK_METHOD(void, evas_object_image_alpha_set, (Evas_Object* obj, Eina_Bool alpha));
+    MOCK_METHOD(Eina_Bool, evas_object_image_alpha_get, (const Evas_Object* obj));
+    MOCK_METHOD(Eina_Bool, evas_object_image_animated_get, (const Evas_Object* obj));
+    MOCK_METHOD(void, evas_object_image_animated_frame_set, (Evas_Object *obj, int frame_index));
+    MOCK_METHOD(int, evas_object_image_animated_frame_get, (Evas_Object *obj));
+    MOCK_METHOD(int, evas_object_image_animated_frame_count_get, (const Evas_Object *obj));
+    MOCK_METHOD(double, evas_object_image_animated_frame_duration_get, (const Evas_Object *obj, int start_frame, int frame_num));
+    MOCK_METHOD(void, evas_object_image_border_center_fill_set, (Evas_Object *obj, Evas_Border_Fill_Mode fill));
+    MOCK_METHOD(Evas_Border_Fill_Mode, evas_object_image_border_center_fill_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_border_set, (Evas_Object *obj, int l, int r, int t, int b));
+    MOCK_METHOD(void, evas_object_image_border_get, (const Evas_Object *obj, int *l, int *r, int *t, int *b));
+    MOCK_METHOD(void, evas_object_image_colorspace_set, (Evas_Object *obj, Evas_Colorspace cspace));
+    MOCK_METHOD(Evas_Colorspace, evas_object_image_colorspace_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_data_copy_set, (Evas_Object *obj, void *data));
+    MOCK_METHOD(void, evas_object_image_data_set, (Evas_Object *obj, void *data));
+    MOCK_METHOD(void *, evas_object_image_data_get, (const Evas_Object *obj, Eina_Bool for_writing));
+    MOCK_METHOD(void, evas_object_image_data_update_add, (Evas_Object *obj, int x, int y, int w, int h));
+    MOCK_METHOD(void, evas_object_image_file_set, (Evas_Object *obj, const char *file, const char *key));
+    MOCK_METHOD(void, evas_object_image_file_get, (const Evas_Object *obj, const char **file, const char **key));
+    MOCK_METHOD(void, evas_object_image_fill_set, (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h));
+    MOCK_METHOD(void, evas_object_image_fill_get, (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h));
+    MOCK_METHOD(void, evas_object_image_filled_set, (Evas_Object *obj, Eina_Bool filled));
+    MOCK_METHOD(Eina_Bool, evas_object_image_filled_get, (const Evas_Object *obj));
+    MOCK_METHOD(Evas_Load_Error, evas_object_image_load_error_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_load_size_set, (Evas_Object *obj, int w, int h));
+    MOCK_METHOD(void, evas_object_image_load_size_get, (const Evas_Object *obj, int *w, int *h));
+    MOCK_METHOD(void, evas_object_image_native_surface_set, (Evas_Object *obj, Evas_Native_Surface *surf));
+    MOCK_METHOD(Evas_Native_Surface *, evas_object_image_native_surface_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_pixels_dirty_set, (Evas_Object *obj, Eina_Bool dirty));
+    MOCK_METHOD(Eina_Bool, evas_object_image_pixels_dirty_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_pixels_get_callback_set, (Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data));
+    MOCK_METHOD(void, evas_object_image_pixels_noti_callback_set, (Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data));
+    MOCK_METHOD(void, evas_object_image_smooth_scale_set, (Evas_Object *obj, Eina_Bool smooth_scale));
+    MOCK_METHOD(Eina_Bool, evas_object_image_smooth_scale_get, (const Evas_Object *obj));
+    MOCK_METHOD(void, evas_object_image_size_set, (Evas_Object *obj, int w, int h));
+    MOCK_METHOD(void, evas_object_image_size_get, (const Evas_Object *obj, int *w, int *h));
+    MOCK_METHOD(Eina_Bool, evas_object_image_source_set, (Evas_Object *obj, Evas_Object *src));
+    MOCK_METHOD(Evas_Object *, evas_object_image_source_get, (const Evas_Object *obj));
+    MOCK_METHOD(Eina_Bool, evas_object_image_source_unset, (Evas_Object *obj));
+    MOCK_METHOD(Eina_Bool, evas_object_image_save, (const Evas_Object *obj, const char *file, const char *key, const char *flags));
+    MOCK_METHOD(void, evas_object_image_preload, (Evas_Object *obj, Eina_Bool cancel));
+    MOCK_METHOD(Evas_Map *, evas_map_new, (int count));
+    MOCK_METHOD(void, evas_map_free, (Evas_Map *m));
+    MOCK_METHOD(Evas_Map *, evas_map_dup, (const Evas_Map *m));
+    MOCK_METHOD(void, evas_map_point_coord_get, (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z));
+    MOCK_METHOD(void, evas_map_point_coord_set, (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z));
+    MOCK_METHOD(void, evas_map_point_precise_coord_get, (const Evas_Map *m, int idx, double *x, double *y, double *z));
+    MOCK_METHOD(void, evas_map_point_precise_coord_set, (Evas_Map *m, int idx, double x, double y, double z));
+    MOCK_METHOD(void, evas_map_point_image_uv_get, (const Evas_Map *m, int idx, double *u, double *v));
+    MOCK_METHOD(void, evas_map_point_image_uv_set, (Evas_Map *m, int idx, double u, double v));
+    MOCK_METHOD(Eina_Bool, evas_map_coords_get, (const Evas_Map *m, double x, double y, double *mx, double *my, int grab));
+    MOCK_METHOD(Eina_Bool, evas_map_alpha_get, (const Evas_Map *m));
+    MOCK_METHOD(void, evas_map_alpha_set, (Evas_Map *m, Eina_Bool enabled));
+    MOCK_METHOD(void, evas_map_point_color_set, (Evas_Map *m, int idx, int r, int g, int b, int a));
+    MOCK_METHOD(void, evas_map_smooth_set, (Evas_Map *m, Eina_Bool enabled));
+    MOCK_METHOD(void, evas_map_util_points_populate_from_geometry, (Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z));
+    MOCK_METHOD(void, evas_map_util_points_populate_from_object, (Evas_Map *m, const Evas_Object *eo_obj));
+    MOCK_METHOD(void, evas_map_util_points_populate_from_object_full, (Evas_Map *m, const Evas_Object *eo_obj, Evas_Coord z));
+    MOCK_METHOD(void, evas_map_util_object_move_sync_set, (Evas_Map *m, Eina_Bool enabled));
+    MOCK_METHOD(void, evas_map_util_points_color_set, (Evas_Map *m, int r, int g, int b, int a));
+    MOCK_METHOD(void, evas_map_util_zoom, (Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy));
+    MOCK_METHOD(void, evas_map_util_rotate, (Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy));
+    MOCK_METHOD(void, evas_object_map_set, (Evas_Object *obj, const Evas_Map *map));
+    MOCK_METHOD(const Evas_Map *, evas_object_map_get, (Evas_Object *obj));
+    MOCK_METHOD(int, evas_map_count_get, (const Evas_Map *m));
+    MOCK_METHOD(void, evas_map_direct_render_set, (Evas_Map *m, Eina_Bool direct_render));
+    MOCK_METHOD(void, evas_object_event_callback_add, (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data));
+    MOCK_METHOD(void*, evas_object_event_callback_del, (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func));
+    MOCK_METHOD(void, evas_object_pass_events_set, (Evas_Object *obj, Eina_Bool set));
+    MOCK_METHOD(Eina_Bool, evas_object_pass_events_get, (Evas_Object *obj));
+    MOCK_METHOD(char *, efl_gfx_filter_program_set, (Evas_Object *obj, const char *code, const char *name));
+};
+
+extern EvasMock* evasMock;
+
+#endif
diff --git a/tests/evas_wrapper_intern.h b/tests/evas_wrapper_intern.h
new file mode 100755 (executable)
index 0000000..9137677
--- /dev/null
@@ -0,0 +1,450 @@
+#ifndef __EVAS_WRAPPER_INTERN_H__
+#define __EVAS_WRAPPER_INTERN_H__
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <wayland-server.h>
+
+#define EVAS_OBJECT_SIZE 1
+#define EVAS_NATIVE_SURFACE_VERSION 5
+#define EINTERN
+#define E_API
+
+#ifndef DATA32
+#define DATA32  unsigned int
+#endif
+
+typedef int Evas;
+typedef int Evas_Object;
+typedef int Evas_Map;
+typedef int  Evas_Coord;
+typedef char Eina_Bool;
+
+#define EINA_TRUE ((Eina_Bool)1)
+#define EINA_FALSE ((Eina_Bool)0)
+
+typedef struct _Evas_Smart_Class          Evas_Smart_Class;
+typedef struct _Evas_Smart_Interface      Evas_Smart_Interface;
+typedef struct _Evas_Smart_Cb_Description Evas_Smart_Cb_Description;
+typedef struct _Evas_Smart                Evas_Smart;
+typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
+typedef struct _Evas_Smart_Interfaces_Array     Evas_Smart_Interfaces_Array;
+typedef void (*Evas_Event_Cb)(void *data, Evas *e, void *event_info);  /**< Evas event callback function signature */
+
+
+typedef struct _Evas_Smart_Class
+{
+   const char                      *name; /**< the name string of the class */
+   int                              version;
+   void                             (*add)(Evas_Object *o); /**< code to be run when adding object to a canvas */
+   void                             (*del)(Evas_Object *o); /**< code to be run when removing object from a canvas */
+   void                             (*move)(Evas_Object *o, Evas_Coord x, Evas_Coord y); /**< code to be run when moving object on a canvas. @a x and @a y will be new coordinates one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
+   void                             (*resize)(Evas_Object *o, Evas_Coord w, Evas_Coord h); /**< code to be run when resizing object on a canvas. @a w and @a h will be new dimensions one applied to the object. use evas_object_geometry_get() if you need the old values, during this call. after that, the old values will be lost. */
+   void                             (*show)(Evas_Object *o); /**< code to be run when showing object on a canvas */
+   void                             (*hide)(Evas_Object *o); /**< code to be run when hiding object on a canvas */
+   void                             (*color_set)(Evas_Object *o, int r, int g, int b, int a); /**< code to be run when setting color of object on a canvas. @a r, @a g, @a b and @a a will be new color components one applied to the object. use evas_object_color_get() if you need the old values, during this call. after that, the old values will be lost. */
+   void                             (*clip_set)(Evas_Object *o, Evas_Object *clip); /**< code to be run when setting clipper of object on a canvas. @a clip will be new clipper one applied to the object. use evas_object_clip_get() if you need the old one, during this call. after that, the old (object pointer) value will be lost. */
+   void                             (*clip_unset)(Evas_Object *o); /**< code to be run when unsetting clipper of object on a canvas. if you need the pointer to a previous set clipper, during this call, use evas_object_clip_get(). after that, the old (object pointer) value will be lost. */
+   void                             (*calculate)(Evas_Object *o); /**< code to be run when object has rendering updates on a canvas */
+   void                             (*member_add)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is added to object */
+   void                             (*member_del)(Evas_Object *o, Evas_Object *child); /**< code to be run when a child member is removed from object */
+
+   const Evas_Smart_Class          *parent; /**< this class inherits from this parent */
+   const Evas_Smart_Cb_Description *callbacks; /**< callbacks at this level, @c NULL terminated */
+   const Evas_Smart_Interface     **interfaces; /**< #Evas_Smart_Interface pointers array, @c NULL terminated. These will be the interfaces supported at this level for an object (parents may have others) @since 1.7 */
+   const void                      *data;
+} Evas_Smart_Class;
+
+#define EVAS_SMART_CLASS_VERSION 4
+#define EVAS_SMART_CLASS_INIT_NAME_VERSION(name) {name, EVAS_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
+
+
+struct _Evas_Smart_Cb_Description
+{
+   const char *name; /**< callback name ("changed", for example) */
+
+   /**
+    * @brief Hint on the type of @c event_info parameter's contents on
+    * a #Evas_Smart_Cb callback.
+    *
+    * The type string uses the pattern similar to
+    * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures,
+    * but extended to optionally include variable names within
+    * brackets preceding types. Example:
+    *
+    * @li Structure with two integers:
+    *     @c "(ii)"
+    *
+    * @li Structure called 'x' with two integers named 'a' and 'b':
+    *     @c "[x]([a]i[b]i)"
+    *
+    * @li Array of integers:
+    *     @c "ai"
+    *
+    * @li Array called 'x' of struct with two integers:
+    *     @c "[x]a(ii)"
+    *
+    * @note This type string is used as a hint and is @b not validated
+    *       or enforced in any way. Implementors should make the best
+    *       use of it to help bindings, documentation and other users
+    *       of introspection features.
+    */
+   const char *type;
+};
+
+struct _Evas_Smart_Interface
+{
+   const char *name; /**< Name of the given interface */
+   unsigned    private_size; /**< Size, in bytes, of the interface's private dada blob. This will be allocated and freed automatically for you. Get it with evas_object_smart_interface_data_get(). */
+   Eina_Bool   (*add)(Evas_Object *obj); /**< Function to be called at object creation time. This will take place @b before the object's smart @c add() function. */
+   void        (*del)(Evas_Object *obj); /**< Function to be called at object deletion time. This will take place @b after the object's smart @c del() function. */
+};
+
+struct _Evas_Smart_Cb_Description_Array
+{
+   unsigned int                      size;
+   const Evas_Smart_Cb_Description **array;
+};
+
+struct _Evas_Smart_Interfaces_Array
+{
+   unsigned int                 size;
+   const Evas_Smart_Interface **array;
+};
+
+struct _Evas_Smart
+{
+   DATA32            magic;
+
+   int               usage;
+
+   const Evas_Smart_Class *smart_class;
+
+   Evas_Smart_Cb_Description_Array callbacks;
+   Evas_Smart_Interfaces_Array interfaces;
+
+   unsigned char     delete_me : 1;
+   unsigned char     class_allocated : 1;
+};
+
+typedef enum
+{
+  EVAS_CALLBACK_MOUSE_IN = 0, /**< Mouse In Event */
+  EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
+  EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
+  EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */
+  EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */
+  EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */
+  EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */
+  EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */
+  EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */
+  EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */
+  EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */
+  EVAS_CALLBACK_KEY_UP, /**< Key Release Event */
+  EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */
+  EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */
+  EVAS_CALLBACK_SHOW, /**< Show Event */
+  EVAS_CALLBACK_HIDE, /**< Hide Event */
+  EVAS_CALLBACK_MOVE, /**< Move Event */
+  EVAS_CALLBACK_RESIZE, /**< Resize Event */
+  EVAS_CALLBACK_RESTACK, /**< Restack Event */
+  EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
+  EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
+  EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
+  EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */
+  EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
+  EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
+  EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called after render update regions have
+                                   * been calculated, but only if update regions exist */
+  EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called after render update regions have
+                                    * been sent to the display server, but only
+                                    * if update regions existed for the most recent frame */
+  EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
+  EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
+  EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanism in Evas that throw out original image data) */
+  EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target. @since 1.2 */
+  EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target. @since 1.2 */
+  EVAS_CALLBACK_IMAGE_RESIZE, /**< Image size is changed. @since 1.8 */
+  EVAS_CALLBACK_DEVICE_CHANGED, /**< Devices added, removed or changed on canvas. @since 1.8 */
+  EVAS_CALLBACK_AXIS_UPDATE, /**< Input device changed value on some axis. @since 1.13 */
+  EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, /**< Canvas viewport resized. @since 1.15 */
+  EVAS_CALLBACK_LAST /**< Sentinel value to indicate last enum field during
+                      * iteration */
+} Evas_Callback_Type;
+
+typedef void      (*Evas_Object_Event_Cb)(void *data, Evas *e, Evas_Object *obj, void *event_info);  /**< Evas object event callback function signature */
+
+typedef enum
+{
+  EVAS_BORDER_FILL_NONE = 0, /**< Image's center region is @b not to be rendered */
+  EVAS_BORDER_FILL_DEFAULT = 1, /**< Image's center region is to be @b blended
+                                 * with objects underneath it, if it has
+                                 * transparency. This is the default behavior
+                                 * for image objects */
+  EVAS_BORDER_FILL_SOLID = 2 /**< Image's center region is to be made solid,
+                              * even if it has transparency on it */
+} Evas_Border_Fill_Mode;
+
+typedef enum _Emile_Colorspace
+{
+  EMILE_COLORSPACE_ARGB8888,/**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */
+  EMILE_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
+  EMILE_COLORSPACE_YCBCR422P709_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
+  EMILE_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
+  EMILE_COLORSPACE_GRY8 = 4,
+  EMILE_COLORSPACE_YCBCR422601_PL, /**<  YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
+  EMILE_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+  EMILE_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+  EMILE_COLORSPACE_AGRY88 = 8, /**< AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */
+  EMILE_COLORSPACE_ETC1 = 9, /**< OpenGL ETC1 encoding of RGB texture (4 bit per pixel) @since 1.10 */
+  EMILE_COLORSPACE_RGB8_ETC2 = 10, /**< OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 1.10 */
+  EMILE_COLORSPACE_RGBA8_ETC2_EAC = 11,        /**< OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 1.10 */
+  EMILE_COLORSPACE_ETC1_ALPHA = 12, /**< ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 */
+  EMILE_COLORSPACE_RGB_S3TC_DXT1 = 13, /**< OpenGL COMPRESSED_RGB_S3TC_DXT1_EXT format with RGB only. @since 1.11 */
+  EMILE_COLORSPACE_RGBA_S3TC_DXT1 = 14,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT1_EXT format with RGBA punchthrough. @since 1.11 */
+  EMILE_COLORSPACE_RGBA_S3TC_DXT2 = 15,        /**< DirectDraw DXT2 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */
+  EMILE_COLORSPACE_RGBA_S3TC_DXT3 = 16,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT3_EXT format with RGBA. @since 1.11 */
+  EMILE_COLORSPACE_RGBA_S3TC_DXT4 = 17,        /**< DirectDraw DXT4 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */
+  EMILE_COLORSPACE_RGBA_S3TC_DXT5 = 18,        /**< OpenGL COMPRESSED_RGBA_S3TC_DXT5_EXT format with RGBA. @since 1.11 */
+  //TIZEN_ONLY(20200224): add EMILE_COLORSPACE_PALETTE for fixing warning
+  EMILE_COLORSPACE_PALETTE = 19
+  //
+} Emile_Colorspace;
+
+typedef Emile_Colorspace Evas_Colorspace;
+
+#define EVAS_COLORSPACE_ARGB8888 EMILE_COLORSPACE_ARGB8888
+#define EVAS_COLORSPACE_YCBCR422P601_PL EMILE_COLORSPACE_YCBCR422P601_PL
+#define EVAS_COLORSPACE_YCBCR422P709_PL EMILE_COLORSPACE_YCBCR422P709_PL
+#define EVAS_COLORSPACE_RGB565_A5P EMILE_COLORSPACE_RGB565_A5P
+#define EVAS_COLORSPACE_GRY8 EMILE_COLORSPACE_GRY8
+#define EVAS_COLORSPACE_YCBCR422601_PL EMILE_COLORSPACE_YCBCR422601_PL
+#define EVAS_COLORSPACE_YCBCR420NV12601_PL EMILE_COLORSPACE_YCBCR420NV12601_PL
+#define EVAS_COLORSPACE_YCBCR420TM12601_PL EMILE_COLORSPACE_YCBCR420TM12601_PL
+#define EVAS_COLORSPACE_AGRY88 EMILE_COLORSPACE_AGRY88
+   // ETC1/2 support
+#define EVAS_COLORSPACE_ETC1 EMILE_COLORSPACE_ETC1
+#define EVAS_COLORSPACE_RGB8_ETC2 EMILE_COLORSPACE_RGB8_ETC2
+#define EVAS_COLORSPACE_RGBA8_ETC2_EAC EMILE_COLORSPACE_RGBA8_ETC2_EAC
+#define EVAS_COLORSPACE_ETC1_ALPHA EMILE_COLORSPACE_ETC1_ALPHA
+   // S3TC support
+#define EVAS_COLORSPACE_RGB_S3TC_DXT1 EMILE_COLORSPACE_RGB_S3TC_DXT1
+#define EVAS_COLORSPACE_RGBA_S3TC_DXT1 EMILE_COLORSPACE_RGBA_S3TC_DXT1
+#define EVAS_COLORSPACE_RGBA_S3TC_DXT2 EMILE_COLORSPACE_RGBA_S3TC_DXT2
+#define EVAS_COLORSPACE_RGBA_S3TC_DXT3 EMILE_COLORSPACE_RGBA_S3TC_DXT3
+#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EMILE_COLORSPACE_RGBA_S3TC_DXT4
+#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EMILE_COLORSPACE_RGBA_S3TC_DXT5
+//TIZEN_ONLY(20180510): png: prototype colormap load
+#define EVAS_COLORSPACE_PALETTE EMILE_COLORSPACE_PALETTE
+
+typedef enum
+{
+   EVAS_LOAD_ERROR_NONE = 0,  /**< No error on load */
+   EVAS_LOAD_ERROR_GENERIC,  /**< A non-specific error occurred */
+   EVAS_LOAD_ERROR_DOES_NOT_EXIST,  /**< File (or file path) does not exist */
+   EVAS_LOAD_ERROR_PERMISSION_DENIED,   /**< Permission denied to an existing file (or path) */
+   EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED,  /**< Allocation of resources failure prevented load */
+   EVAS_LOAD_ERROR_CORRUPT_FILE,  /**< File corrupt (but was detected as a known format) */
+   EVAS_LOAD_ERROR_UNKNOWN_FORMAT,  /**< File is not a known format */
+   EVAS_LOAD_ERROR_CANCELLED, /**< File loading has been cancelled */
+} Evas_Load_Error;
+
+typedef enum _Evas_Native_Surface_Type
+{
+   EVAS_NATIVE_SURFACE_NONE, /**< No surface type */
+   EVAS_NATIVE_SURFACE_X11,  /**< X Window system based type. pixmap id or visual of the pixmap */
+   EVAS_NATIVE_SURFACE_OPENGL, /**< OpenGL system based type. texture or framebuffer id*/
+   EVAS_NATIVE_SURFACE_TBM, /**< Tizen system based type. tbm surface @since 1.14  */
+   EVAS_NATIVE_SURFACE_EVASGL, /**< Evas GL based type. evas gl surface @since 1.14 */
+   EVAS_NATIVE_SURFACE_WL_DMABUF, /**< Wayland system based type. using dmabuf @since 1.18 */
+   EVAS_NATIVE_SURFACE_WL, /**< Wayland system based type. buffer of surface */
+} Evas_Native_Surface_Type;
+
+typedef void (*Evas_Object_Image_Pixels_Get_Cb)(void *data, Evas_Object *o);
+
+typedef enum _Evas_Native_Surface_Status
+{
+   EVAS_NATIVE_SURFACE_STATUS_SCANOUT_ON,
+   EVAS_NATIVE_SURFACE_STATUS_SCANOUT_OFF,
+   EVAS_NATIVE_SURFACE_STATUS_PLANE_ASSIGN,
+   EVAS_NATIVE_SURFACE_STATUS_PLANE_RELEASE,
+} Evas_Native_Surface_Status;
+
+typedef void (*Evas_Native_Scanout_Handler)(void *scanout_data, Evas_Native_Surface_Status status);
+
+typedef struct _Evas_Native_Scanout
+{
+   Evas_Native_Scanout_Handler handler;
+   void *data;
+} Evas_Native_Scanout;
+
+typedef struct _Evas_Native_Surface
+{
+   int                      version; /**< Current Native Surface Version. Use EVAS_NATIVE_SURFACE_VERSION */
+   Evas_Native_Surface_Type type; /**< Surface type. @see Evas_Native_Surface_Type */
+   union {
+      struct
+      {
+         void         *visual; /**< visual of the pixmap to use (Visual) */
+         unsigned long pixmap; /**< pixmap id to use (Pixmap) */
+         unsigned int  multiple_buffer; /**< From version 4. 1 if pixmap is multiple buffer pixmap such as named pixmap created by enlightenment. driver dependent. @since 1.19 */
+      } x11; /**< Set this struct fields if surface data is X11 based. */
+
+      struct
+      {
+         unsigned int texture_id; /**< opengl texture id to use from glGenTextures() */
+         unsigned int framebuffer_id; /**< 0 if not a FBO, FBO id otherwise from glGenFramebuffers() */
+         unsigned int internal_format; /**< same as 'internalFormat' for glTexImage2D() */
+         unsigned int format; /**< same as 'format' for glTexImage2D() */
+         unsigned int x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */
+      } opengl; /**< Set this struct fields if surface data is OpenGL based. */
+      struct
+      {
+         void *legacy_buffer; /**< wayland client buffer to use */
+      } wl; /**< Set this struct fields if surface data is Wayland based. */
+      struct
+      {
+         void *attr; /**< Pointer to dmabuf attributes - contents copied */
+         void *resource; /**< Wayland resource pointer, kept as is */
+         Evas_Native_Scanout scanout;
+      } wl_dmabuf; /**< Set this struct fields if surface data is Wayland dmabuf based. @since 1.18 */
+      struct
+      {
+         void *buffer; /**< tbm surface buffer to use @since 1.14 */
+         // TIZEN_ONLY(20171121) : support ROI mode (tbm rot, ratio, flip)
+         int   rot; /**< rotation (EVAS_IMAGE_ORIENT_NONE, EVAS_IMAGE_ORIENT_90, EVAS_IMAGE_ORIENT_180, EVAS_IMAGE_ORIENT_270) @since 1.14 */
+         float ratio; /**< width/height ratio of the source image @since 1.14 */
+         int   flip; /**< flip (EVAS_IMAGE_FLIP_HORIZONTAL:horizontal, EVAS_IMAGE_FLIP_VERTICAL:vertical) @since 1.14 */
+      } tbm; /**< Set this struct fields if surface data is Tizen based. @since 1.14 */
+      struct
+      {
+         void *surface; /**< evas gl surface to use @since 1.14 */
+      } evasgl; /**< Set this struct fields if surface data is Evas GL based. @since 1.14 */
+   } data; /**< Choose one union data according to your surface. */
+} Evas_Native_Surface;
+
+typedef enum
+{
+  EVAS_RENDER_BLEND = 0, /**< Default render operation: d = d*(1-sa) + s. The
+                          * object will be merged onto the bottom objects using
+                          * simple alpha compositing (a over b). */
+  EVAS_RENDER_COPY = 2, /**< Copy mode, d = s. The object's pixels will replace
+                         * everything that was below, effectively hiding them.
+                         */
+} Evas_Render_Op;
+
+
+void evas_object_del(Evas_Object *obj);
+void evas_object_stack_above(Evas_Object *obj, Evas_Object *above);
+void evas_object_stack_below(Evas_Object *obj, Evas_Object *below);
+void evas_object_raise(Evas_Object *obj);
+void evas_object_lower(Evas_Object *obj);
+void evas_object_resize(Evas_Object *obj, int w, int h);
+void evas_object_move(Evas_Object *obj, int x, int y);
+void evas_object_show(Evas_Object *obj);
+void evas_object_hide(Evas_Object *obj);
+void evas_object_geometry_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
+void evas_object_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+void evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op);
+Evas_Render_Op evas_object_render_op_get(const Evas_Object *obj);
+void evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
+void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a);
+void evas_object_data_set(Evas_Object *obj, const char *key, const void *data);
+void *evas_object_data_get(const Evas_Object *obj, const char *key);
+void *evas_object_data_del(Evas_Object *obj, const char *key);
+void evas_object_clip_set(Evas_Object *obj, Evas_Object *clip);
+Evas_Object *evas_object_smart_add(Evas *e, Evas_Smart *s);
+Evas *evas_object_evas_get(const Evas_Object *obj);
+Evas_Smart *evas_smart_class_new(const Evas_Smart_Class *sc);
+void  evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data);
+void *evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func);
+void evas_object_layer_set(Evas_Object *obj, short l);
+Evas_Object *evas_object_rectangle_add(Evas *e);
+Evas_Object *evas_object_image_add(Evas *e);
+void evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha);
+Eina_Bool evas_object_image_alpha_get(const Evas_Object *obj);
+void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index);
+int evas_object_image_animated_frame_get(Evas_Object *obj);
+int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
+double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num);
+void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill);
+Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj);
+void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b);
+void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b);
+void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace);
+Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj);
+Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
+void evas_object_image_data_set(Evas_Object *obj, void *data);
+void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing);
+void evas_object_image_data_copy_set(Evas_Object *obj, void *data);
+void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h);
+void evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
+void evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool filled);
+Eina_Bool evas_object_image_filled_get(const Evas_Object *obj);
+void evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h);
+void evas_object_image_load_size_set(Evas_Object *obj, int w, int h);
+void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key);
+void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key);
+Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj);
+void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty);
+Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj);
+void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale);
+Eina_Bool evas_object_image_smooth_scale_get(const Evas_Object *obj);
+void evas_object_image_size_set(Evas_Object *obj, int w, int h);
+void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h);
+Evas_Object *evas_object_image_source_get(const Evas_Object *obj);
+Eina_Bool evas_object_image_source_set(Evas_Object *obj, Evas_Object *src);
+Eina_Bool evas_object_image_source_unset(Evas_Object *obj);
+Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags);
+void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data);
+void evas_object_image_pixels_noti_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data);
+void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf);
+Evas_Native_Surface *evas_object_image_native_surface_get(const Evas_Object *obj);
+void evas_object_freeze_events_set(Evas_Object *obj, Eina_Bool freeze);
+void evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat);
+void evas_object_map_enable_get(const Evas_Object *obj);
+void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled);
+void evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel);
+void evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data);
+void *evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func);
+char *efl_gfx_filter_program_set(Evas_Object *obj, const char *code, const char *name);
+
+Evas_Map *evas_map_new(int count);
+void evas_map_free(Evas_Map *m);
+Evas_Map *evas_map_dup(const Evas_Map *m);
+void evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
+void evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
+void evas_map_point_precise_coord_get(const Evas_Map *m, int idx, double *x, double *y, double *z);
+void evas_map_point_precise_coord_set(Evas_Map *m, int idx, double x, double y, double z);
+void evas_map_point_image_uv_get(const Evas_Map *m, int idx, double *u, double *v);
+void evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v);
+Eina_Bool evas_map_coords_get(const Evas_Map *m, double x, double y, double *mx, double *my, int grab);
+Eina_Bool evas_map_alpha_get(const Evas_Map *m);
+void evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled);
+void evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a);
+void evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled);
+void evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z);
+void evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *eo_obj);
+void evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *eo_obj, Evas_Coord z);
+void evas_map_util_object_move_sync_set(Evas_Map *m, Eina_Bool enabled);
+void evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a);
+void evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
+void evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy);
+void evas_object_map_set(Evas_Object *obj, const Evas_Map *map);
+const Evas_Map *evas_object_map_get(Evas_Object *obj);
+int evas_map_count_get(const Evas_Map *m);
+void evas_map_direct_render_set(Evas_Map *m, Eina_Bool direct_render);
+void evas_object_pass_events_set(Evas_Object *obj, Eina_Bool set);
+Eina_Bool evas_object_pass_events_get(Evas_Object *obj);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/tests/tc-e_canvas.cpp b/tests/tc-e_canvas.cpp
new file mode 100644 (file)
index 0000000..f3079b4
--- /dev/null
@@ -0,0 +1,212 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+#include "src/bin/core/e_view_intern.h"
+#include "e_canvas.h"
+
+class ECanvasTest : public ::testing::Test
+{
+protected:
+       Evas *evas;
+
+       void SetUp(void) override {
+                this->evas = reinterpret_cast<Evas *>(malloc(sizeof(Evas)));
+       }
+
+       void TearDown(void) override {
+                free(this->evas);
+       }
+};
+
+void evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
+{
+}
+
+void *evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func)
+{
+   return NULL;
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Create)
+{
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   e_canvas_destroy(canvas);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Layer_Tree_Get)
+{
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   /* Check if all expected layers have been created */
+   for (int layer = E_CANVAS_LAYER_BOTTOM; layer <= E_CANVAS_LAYER_MAX; layer++) {
+               E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(layer));
+               ASSERT_NE(tree, nullptr);
+   }
+
+   e_canvas_destroy(canvas);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Layer_Tree_Get_With_Invalid_Layer)
+{
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(E_CANVAS_LAYER_BOTTOM - 1));
+   ASSERT_EQ(tree, nullptr);
+
+   tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(E_CANVAS_LAYER_MAX + 1));
+   ASSERT_EQ(tree, nullptr);
+
+   e_canvas_destroy(canvas);
+}
+
+static bool destroyed = false;
+static void
+canvas_handle_destroy(struct wl_listener *listener, void *data)
+{
+   destroyed = true;
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Destroy_Listener)
+{
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   struct wl_listener destroy = {
+               .notify = canvas_handle_destroy,
+   };
+   e_canvas_destroy_listener_add(canvas, &destroy);
+
+   e_canvas_destroy(canvas);
+   ASSERT_EQ(destroyed, true);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Render_Listener_Family_Test)
+{
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   struct wl_listener listener = {
+               .notify = NULL,
+   };
+   e_canvas_render_pre_listener_add(canvas, &listener);
+   e_canvas_render_post_listener_add(canvas, &listener);
+   e_canvas_render_flush_pre_listener_add(canvas, &listener);
+   e_canvas_render_flush_post_listener_add(canvas, &listener);
+
+   e_canvas_destroy(canvas);
+}
+
+typedef struct
+{
+   E_View views[E_CANVAS_LAYER_MAX + 1];
+   int expect_layer_index;
+} E_Canvas_For_Each_Data;
+
+static void
+canvas_tree_for_each_test_cb(E_View *view, int sx, int sy, void *user_data)
+{
+   E_Canvas_For_Each_Data *data = reinterpret_cast<E_Canvas_For_Each_Data *>(user_data);
+
+   ASSERT_EQ(view, &data->views[data->expect_layer_index++]);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Tree_For_Each)
+{
+   evasMock = new EvasMock();
+
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   E_Canvas_For_Each_Data data = {
+        .expect_layer_index = E_CANVAS_LAYER_BOTTOM,
+   };
+   for (int layer = E_CANVAS_LAYER_BOTTOM; layer <= E_CANVAS_LAYER_MAX; layer++) {
+        E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(layer));
+        e_view_init(&data.views[layer], E_VIEW_TYPE_RECT, NULL, NULL, tree);
+   }
+
+   e_canvas_tree_for_each(canvas, canvas_tree_for_each_test_cb, &data);
+
+   delete evasMock;
+}
+
+static void
+canvas_tree_for_each_reverse_test_cb(E_View *view, int sx, int sy, void *user_data)
+{
+   E_Canvas_For_Each_Data *data = reinterpret_cast<E_Canvas_For_Each_Data *>(user_data);
+
+   ASSERT_EQ(view, &data->views[data->expect_layer_index--]);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Tree_For_Each_Reverse)
+{
+   evasMock = new EvasMock();
+
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   E_Canvas_For_Each_Data data = {
+        .expect_layer_index = E_CANVAS_LAYER_MAX,
+   };
+   for (int layer = E_CANVAS_LAYER_BOTTOM; layer <= E_CANVAS_LAYER_MAX; layer++) {
+        E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(layer));
+        e_view_init(&data.views[layer], E_VIEW_TYPE_RECT, NULL, NULL, tree);
+   }
+
+   e_canvas_tree_for_each_reverse(canvas, canvas_tree_for_each_reverse_test_cb, &data);
+
+   delete evasMock;
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Layer_Find)
+{
+   evasMock = new EvasMock();
+
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+
+   E_Canvas_For_Each_Data data = {
+        .expect_layer_index = E_CANVAS_LAYER_MAX,
+   };
+   for (int layer = E_CANVAS_LAYER_BOTTOM; layer < E_CANVAS_LAYER_MAX; layer++) {
+        E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(layer));
+        e_view_init(&data.views[layer], E_VIEW_TYPE_RECT, NULL, NULL, tree);
+        ASSERT_EQ(e_canvas_layer_find(canvas, &data.views[layer]), layer);
+   }
+
+   delete evasMock;
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Top_Get)
+{
+   evasMock = new EvasMock();
+
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+   ASSERT_EQ(e_canvas_top_get(canvas), nullptr);
+
+   E_View top_view, middle_view, bottom_view;
+   e_view_init(&top_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_MAX));
+   e_view_init(&middle_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_CLIENT_ABOVE));
+   e_view_init(&bottom_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_BG));
+   ASSERT_EQ(e_canvas_top_get(canvas), &top_view);
+}
+
+TEST_F(ECanvasTest, Test_E_Canvas_Bottom_Get)
+{
+   evasMock = new EvasMock();
+
+   E_Canvas *canvas = e_canvas_create(this->evas);
+   ASSERT_NE(canvas, nullptr);
+   ASSERT_EQ(e_canvas_bottom_get(canvas), nullptr);
+
+   E_View top_view, middle_view, bottom_view;
+   e_view_init(&top_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_MAX));
+   e_view_init(&middle_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_CLIENT_ABOVE));
+   e_view_init(&bottom_view, E_VIEW_TYPE_RECT, NULL, NULL, e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_BG));
+   ASSERT_EQ(e_canvas_bottom_get(canvas), &bottom_view);
+}
diff --git a/tests/tc-e_view.cpp b/tests/tc-e_view.cpp
new file mode 100644 (file)
index 0000000..91c85e5
--- /dev/null
@@ -0,0 +1,1151 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+#define E_TEST
+#include "src/bin/core/e_view_intern.h"
+#include "e_canvas.h"
+#include "e_view.h"
+#include "e_map.h"
+
+using ::testing::Return;
+using ::testing::_;
+using ::testing::SetArgPointee;
+using ::testing::DoAll;
+
+class EViewTest : public ::testing::Test
+{
+public:
+       void SetUp(void) override {
+       }
+
+       void TearDown(void) override {
+       }
+};
+
+TEST(EViewTest, Test_E_View_Init_Without_Parent)
+{
+       E_View_Impl e_view_impl = {
+               .destroy = NULL,
+       };
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+
+       e_view_init(&view, E_VIEW_TYPE_RECT, &e_view_impl, obj, NULL);
+       EXPECT_EQ(view.eo, obj);
+       EXPECT_EQ(view.type, E_VIEW_TYPE_RECT);
+       EXPECT_EQ(view.impl, &e_view_impl);
+       EXPECT_EQ(view.parent, nullptr);
+
+       free(obj);
+}
+
+TEST(EViewTest, Test_E_View_Init_With_Normal_Parent)
+{
+       evasMock = new EvasMock();
+
+       E_View_Impl e_view_impl = {
+               .destroy = NULL,
+       };
+
+       E_View_Tree parent;
+
+       e_view_tree_init(&parent, NULL, NULL);
+       EXPECT_EQ(wl_list_length(&(parent.children)), 0);
+       EXPECT_EQ(parent.view.parent, nullptr);
+
+       const int PARENT_X = 10, PARENT_Y = 20;
+       parent.view.x = PARENT_X;
+       parent.view.y = PARENT_Y;
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+
+       EXPECT_CALL(*evasMock, evas_object_move(obj, PARENT_X, PARENT_Y)).Times(1);
+       e_view_init(&view, E_VIEW_TYPE_RECT, &e_view_impl, obj, &parent);
+       EXPECT_EQ(view.eo, obj);
+       EXPECT_EQ(view.type, E_VIEW_TYPE_RECT);
+       EXPECT_EQ(view.impl, &e_view_impl);
+       EXPECT_EQ(view.parent, &parent);
+
+       EXPECT_EQ(wl_list_length(&(parent.children)), 1);
+       EXPECT_EQ(parent.children.next, &(view.link));
+
+       free(obj);
+
+       delete evasMock;
+}
+
+static int destroyed;
+static void view_destroy(E_View *view)
+{
+       destroyed++;
+}
+
+TEST(EViewTest, Test_E_View_Destroy_With_Null_Callback)
+{
+       E_View_Impl e_view_impl = {
+               .destroy = NULL,
+       };
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+
+       e_view_init(&view, E_VIEW_TYPE_RECT, &e_view_impl, obj, NULL);
+
+       destroyed = 0;
+       e_view_destroy(&view);
+       EXPECT_NE(destroyed, 1);
+
+       free(obj);
+}
+
+TEST(EViewTest, Test_E_View_Destroy_With_Valid_Callback)
+{
+       E_View_Impl e_view_impl = {
+               .destroy = view_destroy,
+       };
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+
+       e_view_init(&view, E_VIEW_TYPE_RECT, &e_view_impl, obj, NULL);
+
+       destroyed = 0;
+       e_view_destroy(&view);
+       EXPECT_EQ(destroyed, 1);
+
+       free(obj);
+}
+
+typedef struct
+{
+   struct wl_listener listener;
+   bool called;
+} E_View_Destroy_Listener_Test_Data;
+
+static void
+cb_view_destroy(struct wl_listener *listener, void *data)
+{
+   E_View_Destroy_Listener_Test_Data *td = static_cast<E_View_Destroy_Listener_Test_Data *>(wl_container_of(listener, td, listener));
+   td->called = true;
+}
+
+TEST(EViewTest, Test_E_View_Destroy_Listener_Add)
+{
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+   E_View_Destroy_Listener_Test_Data td = {
+        .listener = {
+             .notify = cb_view_destroy,
+        },
+        .called = false,
+   };
+   e_view_destroy_listener_add(&view, &td.listener);
+   e_view_destroy(&view);
+   ASSERT_EQ(td.called, true);
+}
+
+TEST(EViewTest, Test_E_View_Tree_Destroy)
+{
+       E_View_Impl e_view_impl = {
+               .destroy = view_destroy,
+       };
+
+       E_View_Tree tree;
+       e_view_tree_init(&tree, NULL, NULL);
+
+       E_View view1, view2;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, &e_view_impl, NULL, &tree);
+       e_view_init(&view2, E_VIEW_TYPE_RECT, &e_view_impl, NULL, &tree);
+
+       destroyed = 0;
+       e_view_destroy(&tree.view);
+       EXPECT_EQ(destroyed, 2);
+}
+
+TEST(EViewTest, Test_E_View_Place_Above_With_Same_View)
+{
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_place_above(&view, &view));
+}
+
+TEST(EViewTest, Test_E_View_Place_Above_With_Null_Parent)
+{
+       E_View view, sibling;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_place_above(&view, &sibling));
+}
+
+TEST(EViewTest, Test_E_View_Place_Above_With_Different_Parent)
+{
+       E_View_Tree view_parent, sibling_parent;
+       e_view_tree_init(&view_parent, NULL, NULL);
+       e_view_tree_init(&sibling_parent, NULL, NULL);
+
+       E_View view, sibling;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, &view_parent);
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, NULL, &sibling_parent);
+
+       EXPECT_ABORT(e_view_place_above(&view, &sibling));
+}
+
+TEST(EViewTest, Test_E_View_Place_Above)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree parent;
+       e_view_tree_init(&parent, NULL, NULL);
+
+       Evas_Object *obj_view = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       E_View view, sibling;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj_view, &parent);
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, obj_sibling, &parent);
+
+       EXPECT_EQ(parent.children.next, &(view.link));
+       EXPECT_NE(view.link.prev, &(sibling.link));
+
+       EXPECT_CALL(*evasMock, evas_object_stack_above(obj_view, obj_sibling))
+               .Times(1);
+       e_view_place_above(&view, &sibling);
+
+       EXPECT_EQ(view.link.prev, &(sibling.link));
+
+       EXPECT_CALL(*evasMock, evas_object_stack_above(obj_view, obj_sibling))
+               .Times(0);
+       e_view_place_above(&view, &sibling);
+
+       free(obj_sibling);
+       free(obj_view);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Place_Above_With_Tree)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree root;
+       e_view_tree_init(&root, NULL, NULL);
+
+       E_View_Tree tree1, tree2;
+       e_view_tree_init(&tree1, NULL, &root);
+       e_view_tree_init(&tree2, NULL, &root);
+
+       Evas_Object *obj_view1 = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_view2 = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       E_View view1, view2;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, obj_view1, &tree1);
+       e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, obj_view2, &tree2);
+
+       EXPECT_CALL(*evasMock, evas_object_stack_above(obj_view1, obj_view2))
+               .Times(1);
+       e_view_place_above(&tree1.view, &tree2.view);
+
+       free(obj_view1);
+       free(obj_view2);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Place_Below_With_Same_View)
+{
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_place_below(&view, &view));
+}
+
+TEST(EViewTest, Test_E_View_Place_Below_With_Null_Parent)
+{
+       E_View view, sibling;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_place_below(&view, &sibling));
+}
+
+TEST(EViewTest, Test_E_View_Place_Below_With_Different_Parent)
+{
+       E_View_Tree view_parent, sibling_parent;
+       e_view_tree_init(&view_parent, NULL, NULL);
+       e_view_tree_init(&sibling_parent, NULL, NULL);
+
+       E_View view, sibling;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, &view_parent);
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, NULL, &sibling_parent);
+
+       EXPECT_ABORT(e_view_place_below(&view, &sibling));
+}
+
+TEST(EViewTest, Test_E_View_Place_Below)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree parent;
+       e_view_tree_init(&parent, NULL, NULL);
+
+       Evas_Object *obj_view = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       E_View view, sibling;
+       e_view_init(&sibling, E_VIEW_TYPE_RECT, NULL, obj_sibling, &parent);
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj_view, &parent);
+
+       EXPECT_EQ(parent.children.next, &(sibling.link));
+       EXPECT_NE(view.link.next, &(view.link));
+
+       EXPECT_CALL(*evasMock, evas_object_stack_below(obj_view, obj_sibling))
+               .Times(1);
+       e_view_place_below(&view, &sibling);
+
+       EXPECT_EQ(view.link.next, &(sibling.link));
+
+       EXPECT_CALL(*evasMock, evas_object_stack_below(obj_view, obj_sibling))
+               .Times(0);
+       e_view_place_below(&view, &sibling);
+
+       EXPECT_EQ(view.link.next, &(sibling.link));
+
+       free(obj_sibling);
+       free(obj_view);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Raise_To_Top_Without_Parent)
+{
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_raise_to_top(&view));
+}
+
+TEST(EViewTest, Test_E_View_Raise_To_Top)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree parent;
+       e_view_tree_init(&parent, NULL, NULL);
+
+       Evas_Object *obj_view = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling_mid = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling_top = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       E_View view, sibling_mid, sibling_top;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj_view, &parent);
+       e_view_init(&sibling_mid, E_VIEW_TYPE_RECT, NULL, obj_sibling_mid, &parent);
+       e_view_init(&sibling_top, E_VIEW_TYPE_RECT, NULL, obj_sibling_top, &parent);
+
+       /* view -> sibling_mid -> sibling_top */
+       EXPECT_EQ(parent.children.next, &(view.link));
+       EXPECT_EQ(view.link.next, &sibling_mid.link);
+       EXPECT_EQ(sibling_mid.link.next, &sibling_top.link);
+
+       EXPECT_CALL(*evasMock, evas_object_raise(obj_view))
+               .Times(1);
+       e_view_raise_to_top(&view);
+
+       EXPECT_EQ(parent.children.prev, &(view.link));
+
+       /* sibling_mid -> sibling_top -> view */
+       EXPECT_EQ(parent.children.next, &(sibling_mid.link));
+       EXPECT_EQ(sibling_mid.link.next, &sibling_top.link);
+       EXPECT_EQ(sibling_top.link.next, &view.link);
+
+       EXPECT_CALL(*evasMock, evas_object_raise(obj_view))
+               .Times(0);
+       e_view_raise_to_top(&view);
+
+       free(obj_sibling_top);
+       free(obj_sibling_mid);
+       free(obj_view);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Lower_To_Bottom_Without_Parent)
+{
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_lower_to_bottom(&view));
+}
+
+TEST(EViewTest, Test_E_View_Lower_To_Bottom)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree parent;
+       e_view_tree_init(&parent, NULL, NULL);
+
+       Evas_Object *obj_view = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling_mid = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       Evas_Object *obj_sibling_bottom = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       E_View view, sibling_mid, sibling_bottom;
+       e_view_init(&sibling_bottom, E_VIEW_TYPE_RECT, NULL, obj_sibling_bottom, &parent);
+       e_view_init(&sibling_mid, E_VIEW_TYPE_RECT, NULL, obj_sibling_mid, &parent);
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj_view, &parent);
+
+       /* sibling_bottom -> sibling_mid -> view */
+       EXPECT_EQ(parent.children.next, &(sibling_bottom.link));
+       EXPECT_EQ(sibling_bottom.link.next, &sibling_mid.link);
+       EXPECT_EQ(sibling_mid.link.next, &view.link);
+
+       EXPECT_CALL(*evasMock, evas_object_lower(obj_view))
+               .Times(1);
+       e_view_lower_to_bottom(&view);
+
+       /* view -> sibling_bottom -> sibling_mid */
+       EXPECT_EQ(parent.children.next, &(view.link));
+       EXPECT_EQ(view.link.next, &sibling_bottom.link);
+       EXPECT_EQ(sibling_bottom.link.next, &sibling_mid.link);
+
+       EXPECT_CALL(*evasMock, evas_object_lower(obj_view))
+               .Times(0);
+       e_view_lower_to_bottom(&view);
+
+       free(obj_sibling_bottom);
+       free(obj_sibling_mid);
+       free(obj_view);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Coords_Get)
+{
+       /*          root
+        *         /
+        *      tree1 (50, 40)
+        *    /
+        *   tree2 (100, 30)
+        *  /
+        * view1 (75, 20)
+        */
+       E_View_Tree root, tree1, tree2;
+       e_view_tree_init(&root, NULL, NULL);
+
+       e_view_tree_init(&tree1, NULL, &root);
+       tree1.view.x = 50;
+       tree1.view.y = 40;
+
+       e_view_tree_init(&tree2, NULL, &tree1);
+       tree2.view.x = 100;
+       tree2.view.y = 30;
+
+       E_View view1;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+       view1.x = 75;
+       view1.y = 20;
+
+       int lx = 0, ly = 0;
+       e_view_coords_get(&view1, &lx, &ly);
+
+       EXPECT_EQ(50 + 100 + 75, lx);
+       EXPECT_EQ(40 + 30 + 20, ly);
+}
+
+TEST(EViewTest, Test_E_View_Position_Set_Get)
+{
+       evasMock = new EvasMock();
+
+       /*          root
+        *         /
+        *      tree1 (50, 40)
+        *    /
+        *   tree2 (100, 30)
+        *  /
+        * view1 (75, 20)
+        */
+       E_View_Tree root, tree1, tree2;
+       e_view_tree_init(&root, NULL, NULL);
+       e_view_position_set(&root.view, 0, 0);
+
+       e_view_tree_init(&tree1, NULL, &root);
+       EXPECT_CALL(*evasMock, evas_object_move(_, _, _))
+               .Times(0);
+       e_view_position_set(&tree1.view, 50, 40);
+
+       e_view_tree_init(&tree2, NULL, &tree1);
+       EXPECT_CALL(*evasMock, evas_object_move(_, _, _))
+               .Times(0);
+       e_view_position_set(&tree2.view, 100, 30);
+
+       E_View view1;
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       EXPECT_CALL(*evasMock, evas_object_move(obj, 100 + 50, 40 + 30))
+               .Times(1);
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, obj, &tree2);
+
+       EXPECT_CALL(*evasMock, evas_object_move(obj, 50 + 100 + 75, 40 + 30 + 20))
+               .Times(1);
+       e_view_position_set(&view1, 75, 20);
+
+       EXPECT_CALL(*evasMock, evas_object_move(obj, -10 + 100 + 75, -20 + 30 + 20))
+               .Times(1);
+       e_view_position_set(&tree1.view, -10, -20);
+
+       int x, y;
+
+       e_view_position_get(&view1, &x, &y);
+
+       EXPECT_EQ(75, x);
+       EXPECT_EQ(20, y);
+
+       free(obj);
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Render_Op_Set_Get)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_render_op_set(obj, EVAS_RENDER_COPY))
+               .Times(1);
+       e_view_render_op_set(&view, E_VIEW_RENDER_COPY);
+
+       EXPECT_CALL(*evasMock, evas_object_render_op_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_RENDER_COPY));
+       EXPECT_EQ(E_VIEW_RENDER_COPY, e_view_render_op_get(&view));
+
+       free(obj);
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Color_Set_Get)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_TREE, NULL, obj, NULL);
+
+       int red = 255;
+       int green = 128;
+       int blue = 64;
+       int alpha = 32;
+
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, red, green, blue, alpha))
+               .Times(1);
+
+       e_view_color_set(&view, red, green, blue, alpha);
+
+       int r, g, b, a;
+       EXPECT_CALL(*evasMock, evas_object_color_get(obj, &r, &g, &b, &a))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(red),
+                                               SetArgPointee<2>(green),
+                                               SetArgPointee<3>(blue),
+                                               SetArgPointee<4>(alpha)));
+
+       e_view_color_get(&view, &r, &g, &b, &a);
+       EXPECT_EQ(red, r);
+       EXPECT_EQ(green, g);
+       EXPECT_EQ(blue, b);
+       EXPECT_EQ(alpha, a);
+
+       free(obj);
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Data_Set_Get_Del)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       const char key[] = "e_view";
+       EXPECT_CALL(*evasMock, evas_object_data_set(obj, key, &view)).Times(1);
+
+       e_view_data_set(&view, key, &view);
+
+       EXPECT_CALL(*evasMock, evas_object_data_get(obj, key))
+               .Times(1)
+               .WillOnce(Return(&view));
+
+       void *data = e_view_data_get(&view, key);
+       EXPECT_EQ(&view, data);
+
+       EXPECT_CALL(*evasMock, evas_object_data_del(obj, key))
+               .Times(1)
+               .WillOnce(Return(&view));
+
+       void *del_data = e_view_data_del(&view, key);
+       EXPECT_EQ(&view, del_data);
+
+       free(obj);
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Clip_Set)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       Evas_Object *clipper_obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View clipper;
+       e_view_init(&clipper, E_VIEW_TYPE_RECT, NULL, clipper_obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_clip_set(obj, clipper_obj))
+               .Times(1);
+       e_view_clip_set(&view, &clipper);
+
+       free(clipper_obj);
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Clip_Set_With_Clipper_Other_Than_Rect_Or_Image)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       Evas_Object *clipper_obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View clipper;
+       e_view_init(&clipper, E_VIEW_TYPE_TREE, NULL, clipper_obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_clip_set(obj, clipper_obj))
+               .Times(0);
+       e_view_clip_set(&view, &clipper);
+
+       free(clipper_obj);
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Clip_Unset)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_clip_set(obj, nullptr))
+               .Times(1);
+       e_view_clip_unset(&view);
+
+       free(obj);
+
+       delete evasMock;
+}
+
+
+TEST(EViewTest, Test_E_View_Freeze_Events_Set)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_freeze_events_set(obj, EINA_TRUE))
+               .Times(1);
+       e_view_freeze_events_set(&view, true);
+
+       EXPECT_CALL(*evasMock, evas_object_freeze_events_set(obj, EINA_FALSE))
+               .Times(1);
+       e_view_freeze_events_set(&view, false);
+
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Repeat_Events_Set)
+{
+       evasMock = new EvasMock();
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       EXPECT_CALL(*evasMock, evas_object_repeat_events_set(obj, EINA_TRUE))
+               .Times(1);
+       e_view_repeat_events_set(&view, true);
+
+       EXPECT_CALL(*evasMock, evas_object_repeat_events_set(obj, EINA_FALSE))
+               .Times(1);
+       e_view_repeat_events_set(&view, false);
+
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Show)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree tree;
+       e_view_tree_init(&tree, NULL, NULL);
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, &tree);
+
+       EXPECT_CALL(*evasMock, evas_object_show(obj))
+               .Times(0);
+       e_view_show(&view);
+
+       EXPECT_CALL(*evasMock, evas_object_show(obj))
+               .Times(1);
+       e_view_show(&tree.view);
+
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Hide)
+{
+       evasMock = new EvasMock();
+
+       E_View_Tree tree;
+       e_view_tree_init(&tree, NULL, NULL);
+       e_view_show(&tree.view);
+
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, &tree);
+
+       EXPECT_CALL(*evasMock, evas_object_show(obj))
+               .Times(1);
+       e_view_show(&view);
+
+       EXPECT_CALL(*evasMock, evas_object_hide(obj))
+               .Times(1);
+       e_view_hide(&view);
+
+       EXPECT_CALL(*evasMock, evas_object_show(obj))
+               .Times(1);
+       e_view_show(&view);
+
+       EXPECT_CALL(*evasMock, evas_object_hide(obj))
+               .Times(1);
+       e_view_hide(&tree.view);
+
+       free(obj);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Root_Get)
+{
+       evasMock = new EvasMock();
+
+       Evas *evas = reinterpret_cast<Evas *>(malloc(sizeof(Evas)));
+       E_Canvas *canvas = e_canvas_create(evas);
+       E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, E_CANVAS_LAYER_BOTTOM);
+
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, tree);
+
+       E_Canvas *root = e_view_root_get(&view);
+       ASSERT_EQ(root, canvas);
+}
+
+TEST(EViewTest, Test_E_View_Above_Get)
+{
+       /*          root
+        *         /    \
+        *      tree1   tree2
+        *    /      \       \
+        *   view1   view2   view3
+        */
+       E_View_Tree root, tree1, tree2;
+       e_view_tree_init(&root, NULL, NULL);
+       e_view_tree_init(&tree1, NULL, &root);
+       e_view_tree_init(&tree2, NULL, &root);
+
+       E_View view1, view2;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, NULL, &tree1);
+       e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, NULL, &tree1);
+
+       E_View view3;
+       e_view_init(&view3, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+
+       E_View *above = e_view_above_get(&view1);
+       ASSERT_EQ(above, &view2);
+
+       above = e_view_above_get(above);
+       ASSERT_EQ(above, &view3);
+}
+
+TEST(EViewTest, Test_E_View_Below_Get)
+{
+       /*          root
+        *         /    \
+        *      tree1   tree2
+        *    /        /     \
+        *   view1   view2   view3
+        */
+       E_View_Tree root, tree1, tree2;
+       e_view_tree_init(&root, NULL, NULL);
+       e_view_tree_init(&tree1, NULL, &root);
+       e_view_tree_init(&tree2, NULL, &root);
+
+       E_View view1;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, NULL, &tree1);
+
+       E_View view2, view3;
+       e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+       e_view_init(&view3, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+
+       E_View *below = e_view_below_get(&view3);
+       ASSERT_EQ(below, &view2);
+
+       below = e_view_below_get(below);
+       ASSERT_EQ(below, &view1);
+}
+
+static void view_iterator(E_View *view, int lx, int ly, void *user_data)
+{
+       int x = 0, y = 0;
+       e_view_coords_get(view, &x, &y);
+
+       EXPECT_EQ(x, lx);
+       EXPECT_EQ(y, ly);
+}
+
+TEST(EViewTest, Test_E_View_For_Each_View)
+{
+       evasMock = new EvasMock();
+
+       /*                   root (1, 2)
+        *              /                 \
+        *      tree1(10, 20)           tree2(30, 40)
+        *         /                   /            \
+        *   view1(100, 200)   view2(300, 400)   view3(500, 600)
+        */
+       E_View_Tree root, tree1, tree2;
+       int lx = 1, ly = 2;
+       e_view_tree_init(&root, NULL, NULL);
+       e_view_position_set(&root.view, lx, ly);
+       e_view_tree_init(&tree1, NULL, &root);
+       e_view_position_set(&tree1.view, 10, 20);
+       e_view_tree_init(&tree2, NULL, &root);
+       e_view_position_set(&tree2.view, 30, 40);
+
+       E_View view1;
+       e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, NULL, &tree1);
+       view1.x = 100;
+       view1.y = 200;
+
+       E_View view2, view3;
+       e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+       view2.x = 300;
+       view2.y = 400;
+
+       e_view_init(&view3, E_VIEW_TYPE_RECT, NULL, NULL, &tree2);
+       view2.x = 500;
+       view2.y = 600;
+
+       e_view_for_each_view(&root.view, view_iterator, NULL);
+
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Name_Set_Get)
+{
+       E_View view;
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+       EXPECT_ABORT(e_view_name_get(NULL));
+       EXPECT_STREQ(nullptr, e_view_name_get(&view));
+
+       e_view_name_set(NULL, NULL);
+       EXPECT_STREQ(nullptr, e_view_name_get(&view));
+
+       e_view_name_set(&view, "view_test_obj");
+       EXPECT_STREQ("view_test_obj", e_view_name_get(&view));
+
+       e_view_name_set(&view, "change_name");
+       EXPECT_STREQ("change_name", e_view_name_get(&view));
+
+       /* remove name */
+       e_view_name_set(&view, NULL);
+       EXPECT_STREQ(nullptr, e_view_name_get(&view));
+
+       e_view_name_set(&view, "view_destroy");
+       e_view_destroy(&view);
+
+       EXPECT_STREQ(nullptr, e_view_name_get(&view));
+}
+
+TEST(EViewTest, Test_E_View_Map_Enable_Set_Get)
+{
+       evasMock = new EvasMock();
+
+       E_View view;
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+       EXPECT_ABORT(e_view_map_enable_get(NULL));
+
+       EXPECT_CALL(*evasMock, evas_object_map_enable_set(_, _))
+               .Times(0);
+       e_view_map_enable_set(NULL, true);
+
+       EXPECT_CALL(*evasMock, evas_object_map_enable_set(obj, true))
+               .Times(1);
+       e_view_map_enable_set(&view, true);
+
+       EXPECT_CALL(*evasMock, evas_object_map_enable_get(obj))
+               .Times(1);
+       e_view_map_enable_get(&view);
+
+       free(obj);
+       delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Parent_Get)
+{
+   E_View_Tree parent;
+
+   e_view_tree_init(&parent, NULL, NULL);
+   ASSERT_EQ(e_view_parent_get(&parent.view), nullptr);
+
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, &parent);
+   ASSERT_EQ(e_view_parent_get(&view), &parent);
+}
+
+TEST(EViewTest, Test_E_View_Visible_Get)
+{
+   E_View view;
+   Evas_Object obj;
+   evasMock = new EvasMock();
+
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, &obj, NULL);
+   ASSERT_EQ(e_view_visible_get(&view), false);
+
+   EXPECT_CALL(*evasMock, evas_object_show(&obj))
+               .Times(1);
+   e_view_show(&view);
+   ASSERT_EQ(e_view_visible_get(&view), true);
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Map_Set_Get)
+{
+   evasMock = new EvasMock();
+
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+   ASSERT_EQ(e_view_map_get(&view), nullptr);
+
+   Evas_Map map_obj;
+   ON_CALL(*evasMock, evas_map_new(4)).WillByDefault(Return(&map_obj));
+   E_Map *map = e_map_new();
+
+   Evas_Map dup_map_obj;
+   ON_CALL(*evasMock, evas_map_dup(&map_obj)).WillByDefault(Return(&dup_map_obj));
+   e_view_map_set(&view, map);
+   ASSERT_NE(e_view_map_get(&view), nullptr);
+   e_map_free(map);
+
+   e_view_map_set(&view, NULL);
+   ASSERT_EQ(e_view_map_get(&view), nullptr);
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Reparent)
+{
+   evasMock = new EvasMock();
+
+   E_View_Tree parent1, parent2;
+   e_view_tree_init(&parent1, NULL, NULL);
+   e_view_tree_init(&parent2, NULL, NULL);
+
+   /*
+    * parent1           parent2
+    *    |
+    *  view
+    */
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, &parent1);
+   ASSERT_EQ(e_view_parent_get(&view), &parent1);
+   ASSERT_EQ(wl_list_empty(&parent1.children), false);
+   ASSERT_EQ(parent1.children.next, &view.link);
+
+   /* Nothing must happen. */
+   e_view_reparent(&view, &parent1);
+
+   /*
+    * parent1           parent2
+    *                      |
+    *                    view
+    */
+   e_view_reparent(&view, &parent2);
+   ASSERT_EQ(e_view_parent_get(&view), &parent2);
+   ASSERT_EQ(parent2.children.next, &view.link);
+   ASSERT_EQ(wl_list_empty(&parent1.children), true);
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Reparent_With_Null_Parent)
+{
+   evasMock = new EvasMock();
+
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+   EXPECT_ABORT(e_view_reparent(&view, NULL));
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Reparent_With_Invalid_Parent)
+{
+   evasMock = new EvasMock();
+
+   E_View_Tree parent1, parent2;
+   e_view_tree_init(&parent1, NULL, NULL);
+   e_view_tree_init(&parent2, NULL, &parent1);
+
+   /*
+    * parent1
+    *    |
+    * parent2
+    *    |
+    *  view
+    */
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, &parent2);
+
+   /* Cannot reparent a view with one of its descendants */
+   EXPECT_ABORT(e_view_reparent(&parent1.view, &parent2));
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Reparent_With_Evas_Object)
+{
+   evasMock = new EvasMock();
+
+   E_View_Tree parent1, parent2;
+   e_view_tree_init(&parent1, NULL, NULL);
+   e_view_tree_init(&parent2, NULL, NULL);
+
+   /*
+    *    parent1           parent2
+    *    /     \             |
+    * view1   view2         view3
+    */
+   E_View view1, view2, view3;
+   Evas_Object v1_obj, v2_obj, v3_obj;
+   e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, &v1_obj, &parent1);
+   e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, &v2_obj, &parent1);
+   e_view_init(&view3, E_VIEW_TYPE_RECT, NULL, &v3_obj, &parent2);
+
+   /*
+    *    parent2
+    *    /     \
+    * view3   parent1
+    *          /   \
+    *       view1  view2
+    */
+   EXPECT_CALL(*evasMock, evas_object_stack_above(&v1_obj, &v3_obj)).Times(1);
+   EXPECT_CALL(*evasMock, evas_object_stack_above(&v2_obj, &v1_obj)).Times(1);
+   e_view_reparent(&parent1.view, &parent2);
+
+   /*
+    *         parent2
+    *     /      |      \
+    * view3    parent1   view1
+    *            |
+    *          view2
+    */
+   EXPECT_CALL(*evasMock, evas_object_stack_above(&v1_obj, &v2_obj)).Times(1);
+   e_view_reparent(&view1, &parent2);
+
+   /*
+    *             parent2
+    *     /      /       \       \
+    * view3    parent1   view1  view2
+    */
+   EXPECT_CALL(*evasMock, evas_object_stack_above(&v2_obj, &v1_obj)).Times(1);
+   e_view_reparent(&view2, &parent2);
+
+   /*
+    *     parent2
+    *    /       \       \
+    * parent1   view1  view2
+    *     |
+    *   view3
+    */
+   EXPECT_CALL(*evasMock, evas_object_stack_below(&v3_obj, &v1_obj)).Times(1);
+   e_view_reparent(&view3, &parent1);
+
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Pass_Events_Set_Get)
+{
+   evasMock = new EvasMock();
+
+   E_View view;
+   Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, obj, NULL);
+
+   EXPECT_CALL(*evasMock, evas_object_pass_events_set(obj, true))
+      .Times(1);
+   e_view_pass_events_set(&view, true);
+
+   EXPECT_CALL(*evasMock, evas_object_pass_events_get(obj))
+      .Times(1);
+   e_view_pass_events_get(&view);
+
+   free(obj);
+   delete evasMock;
+}
+
+TEST(EViewTest, Test_E_View_Layer_Index_Get)
+{
+   Evas evas;
+   E_Canvas *canvas = e_canvas_create(&evas);
+
+   E_View views[E_CANVAS_LAYER_MAX + 1];
+   for (int layer = E_CANVAS_LAYER_BOTTOM; layer <= E_CANVAS_LAYER_MAX; layer++) {
+        E_View_Tree *tree = e_canvas_layer_view_tree_get(canvas, static_cast<E_Canvas_Layer>(layer));
+        E_View *view = &views[layer];
+        e_view_init(view, E_VIEW_TYPE_RECT, NULL, NULL, tree);
+        ASSERT_EQ(e_view_layer_index_get(view), static_cast<E_Canvas_Layer>(layer));
+   }
+}
+
+TEST(EViewTest, Test_E_View_Layer_Index_Get_With_Invalid_View)
+{
+   E_View view;
+   e_view_init(&view, E_VIEW_TYPE_RECT, NULL, NULL, NULL);
+
+   EXPECT_ABORT(e_view_layer_index_get(&view));
+}
diff --git a/tests/tc-e_view_event.cpp b/tests/tc-e_view_event.cpp
new file mode 100644 (file)
index 0000000..7fd52ba
--- /dev/null
@@ -0,0 +1,236 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+#include "src/bin/core/e_view_intern.h"
+#include "e_view.h"
+
+using ::testing::Return;
+using ::testing::_;
+using ::testing::SetArgPointee;
+using ::testing::DoAll;
+using ::testing::DoDefault;
+using ::testing::Invoke;
+using ::testing::AtLeast;
+using ::testing::AnyNumber;
+
+
+/*                root (0, 0)
+ *              /             \
+ *      tree1(10, 20)           tree2(30, 40)
+ *         /                   /            \
+ *   view1(100, 200)   view2(300, 400)   view3(500, 600)
+ */
+
+class EViewEventTest : public ::testing::Test
+{
+public:
+       Evas_Object obj1, obj2, obj3;
+       E_View_Tree root, tree1, tree2;
+       E_View view1, view2, view3;
+
+       void SetUp(void) override {
+               evasMock = new EvasMock();
+
+               e_view_tree_init(&root, NULL, NULL);
+               e_view_position_set(&root.view, 0, 0);
+
+               e_view_tree_init(&tree1, NULL, &root);
+               e_view_position_set(&tree1.view, 10,20);
+
+               e_view_tree_init(&tree2, NULL, &root);
+               e_view_position_set(&tree2.view, 30, 40);
+
+               EXPECT_CALL(*evasMock, evas_object_move(_, _, _))
+                       .Times(AnyNumber());
+               EXPECT_CALL(*evasMock, evas_object_stack_above(_, _))
+                       .Times(AnyNumber());
+
+               e_view_init(&view1, E_VIEW_TYPE_RECT, NULL, &obj1, &tree1);
+               view1.x = 100;
+               view1.y = 200;
+
+               e_view_init(&view2, E_VIEW_TYPE_RECT, NULL, &obj2, &tree2);
+               view2.x = 300;
+               view2.y = 400;
+
+               e_view_init(&view3, E_VIEW_TYPE_RECT, NULL, &obj3, &tree2);
+               view3.x = 500;
+               view3.y = 600;
+       }
+
+       void TearDown(void) override {
+               delete evasMock;
+       }
+};
+
+typedef struct test_container
+{
+       E_View *view;
+       struct wl_listener listener;
+} test_container;
+
+static bool show_notify_callback_1_called = false;
+static void
+_show_notify_callback_1(struct wl_listener *listener, void *data)
+{
+       E_View_Event_Callback_Data *callback_data = (E_View_Event_Callback_Data *)data;
+
+       test_container *container = wl_container_of(listener, container, listener);
+       ASSERT_NE(nullptr, container);
+       EXPECT_EQ(container->view, callback_data->view);
+       EXPECT_EQ(nullptr, callback_data->event_info);
+       EXPECT_EQ(true, callback_data->view->visible);
+
+       show_notify_callback_1_called = true;
+}
+
+static bool show_notify_callback_2_called = false;
+static void
+_show_notify_callback_2(struct wl_listener *listener, void *data)
+{
+       E_View_Event_Callback_Data *callback_data = (E_View_Event_Callback_Data *)data;
+
+       test_container *container = wl_container_of(listener, container, listener);
+       ASSERT_NE(nullptr, container);
+       EXPECT_EQ(container->view, callback_data->view);
+       EXPECT_EQ(nullptr, callback_data->event_info);
+       EXPECT_EQ(true, callback_data->view->visible);
+
+       show_notify_callback_2_called = true;
+}
+
+TEST_F(EViewEventTest, Test_E_View_Event_Show_Callback_Add_Del)
+{
+       this->root.view.visible = true;
+       this->tree1.view.visible = true;
+
+       test_container *container = (test_container *)malloc(sizeof(test_container));
+       ASSERT_NE(nullptr, container);
+
+       container->view = &this->view1;
+       container->listener.notify = _show_notify_callback_1;
+
+       Evas_Object_Event_Cb callback = e_view_event_callback_get(E_VIEW_SHOW);
+       ASSERT_NE(nullptr, callback);
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_add(&this->obj1, EVAS_CALLBACK_SHOW, _, &this->view1))
+               .Times(1);
+
+       e_view_event_listener_add(&this->view1, E_VIEW_SHOW, &container->listener);
+
+       ASSERT_NE(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       ON_CALL(*evasMock, evas_object_show(&this->obj1))
+               .WillByDefault([this, callback] {
+                       callback(&this->view1, NULL, &this->obj1, NULL);
+               });
+       EXPECT_CALL(*evasMock, evas_object_show(&this->obj1))
+               .Times(1)
+               .WillOnce(DoDefault());
+       e_view_show(&this->view1);
+
+       EXPECT_TRUE(show_notify_callback_1_called);
+
+       /* reset */
+       this->view1.visible = false;
+       show_notify_callback_1_called = false;
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_del(&this->obj1, EVAS_CALLBACK_SHOW, _))
+               .Times(1);
+
+       e_view_event_listener_del(&this->view1, E_VIEW_SHOW, &container->listener);
+
+       ASSERT_EQ(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       EXPECT_CALL(*evasMock, evas_object_show(&this->obj1))
+               .Times(1)
+               .WillOnce(DoDefault());
+       e_view_show(&this->view1);
+
+       EXPECT_FALSE(show_notify_callback_1_called);
+}
+
+TEST_F(EViewEventTest, Test_E_View_Event_Show_Callback_Multiple_Add_Del)
+{
+       this->root.view.visible = true;
+       this->tree1.view.visible = true;
+       show_notify_callback_1_called = false;
+       show_notify_callback_2_called = false;
+
+       test_container *container_1 = (test_container *)malloc(sizeof(test_container));
+       ASSERT_NE(nullptr, container_1);
+       container_1->view = &this->view1;
+       container_1->listener.notify = _show_notify_callback_1;
+
+       test_container *container_2 = (test_container *)malloc(sizeof(test_container));
+       ASSERT_NE(nullptr, container_2);
+       container_2->view = &this->view1;
+       container_2->listener.notify = _show_notify_callback_2;
+
+       Evas_Object_Event_Cb callback = e_view_event_callback_get(E_VIEW_SHOW);
+       ASSERT_NE(nullptr, callback);
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_add(&this->obj1, EVAS_CALLBACK_SHOW, _, &this->view1))
+               .Times(1);
+       e_view_event_listener_add(&this->view1, E_VIEW_SHOW, &container_1->listener);
+
+       ASSERT_NE(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_add(&this->obj1, EVAS_CALLBACK_SHOW, _, &this->view1))
+               .Times(0);
+       e_view_event_listener_add(&this->view1, E_VIEW_SHOW, &container_2->listener);
+
+       ASSERT_NE(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       ON_CALL(*evasMock, evas_object_show(&this->obj1))
+               .WillByDefault([this, callback] {
+                       callback(&this->view1, NULL, &this->obj1, NULL);
+               });
+       EXPECT_CALL(*evasMock, evas_object_show(&this->obj1))
+               .Times(1)
+               .WillOnce(DoDefault());
+       e_view_show(&this->view1);
+
+       EXPECT_TRUE(show_notify_callback_1_called);
+       EXPECT_TRUE(show_notify_callback_2_called);
+
+       /* reset */
+       this->view1.visible = false;
+       show_notify_callback_1_called = false;
+       show_notify_callback_1_called = false;
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_del(&this->obj1, EVAS_CALLBACK_SHOW, _))
+               .Times(0);
+
+       /* delete listener 1 */
+       e_view_event_listener_del(&this->view1, E_VIEW_SHOW, &container_1->listener);
+       ASSERT_NE(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       EXPECT_CALL(*evasMock, evas_object_show(&this->obj1))
+               .Times(1)
+               .WillOnce(DoDefault());
+       e_view_show(&this->view1);
+
+       EXPECT_FALSE(show_notify_callback_1_called);
+       EXPECT_TRUE(show_notify_callback_2_called);
+
+       /* reset */
+       this->view1.visible = false;
+       show_notify_callback_1_called = false;
+       show_notify_callback_2_called = false;
+
+       EXPECT_CALL(*evasMock, evas_object_event_callback_del(&this->obj1, EVAS_CALLBACK_SHOW, _))
+               .Times(1);
+
+       /* delete listener 2 */
+       e_view_event_listener_del(&this->view1, E_VIEW_SHOW, &container_2->listener);
+       ASSERT_EQ(1, wl_list_empty(&this->view1.signals[E_VIEW_SHOW].listener_list));
+
+       EXPECT_CALL(*evasMock, evas_object_show(&this->obj1))
+               .Times(1)
+               .WillOnce(DoDefault());
+       e_view_show(&this->view1);
+
+       EXPECT_FALSE(show_notify_callback_1_called);
+       EXPECT_FALSE(show_notify_callback_2_called);
+}
diff --git a/tests/tc-e_view_image.cpp b/tests/tc-e_view_image.cpp
new file mode 100755 (executable)
index 0000000..6c89d14
--- /dev/null
@@ -0,0 +1,932 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+#include "src/bin/core/e_view_intern.h"
+#include "e_view_image.h"
+#include "e_canvas.h"
+
+using ::testing::Return;
+using ::testing::_;
+using ::testing::SetArgPointee;
+using ::testing::DoAll;
+
+class EViewImageTest : public ::testing::Test
+{
+public:
+       Evas *evas;
+       E_Canvas *canvas;
+       E_View_Tree *tree;
+
+       void SetUp(void) override {
+                evasMock = new EvasMock();
+                this->evas = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+                this->canvas = e_canvas_create(this->evas);
+                this->tree = e_canvas_layer_view_tree_get(this->canvas, E_CANVAS_LAYER_BOTTOM);
+       }
+
+       void TearDown(void) override {
+                e_canvas_destroy(this->canvas);
+                free(this->evas);
+                delete evasMock;
+       }
+};
+
+TEST_F(EViewImageTest, Test_E_View_Image_Create)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(_))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       EXPECT_NE(image, nullptr);
+       E_View *view = e_view_image_view_get(image);
+       EXPECT_NE(view, nullptr);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_view_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+
+       E_View_Image *image_from_view = e_view_image_try_from_view(view);
+       EXPECT_EQ(image_from_view, image);
+       E_View *parent_view = e_view_tree_view_get(this->tree);
+       EXPECT_NE(parent_view, nullptr);
+       E_View_Image *parent_image_from_view = e_view_image_try_from_view(parent_view);
+       EXPECT_EQ(parent_image_from_view, nullptr);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_alpha_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+
+       EXPECT_CALL(*evasMock, evas_object_image_alpha_set(obj, EINA_TRUE))
+               .Times(1);
+
+       e_view_image_alpha_set(image, EINA_TRUE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_alpha_get(obj))
+               .Times(2)
+               .WillOnce(Return(EINA_TRUE))
+               .WillOnce(Return(EINA_FALSE));
+
+       Eina_Bool ret = e_view_image_alpha_get(image);
+       EXPECT_EQ(ret, EINA_TRUE);
+
+       ret = e_view_image_alpha_get(image);
+       EXPECT_EQ(ret, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_animated_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_get(obj))
+               .WillOnce(Return(EINA_TRUE));
+
+       Eina_Bool ret = e_view_image_animated_get(image);
+       EXPECT_EQ(ret, EINA_TRUE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_get(obj))
+               .WillOnce(Return(EINA_FALSE));
+
+       ret = e_view_image_animated_get(image);
+       EXPECT_EQ(ret, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_vew_image_animated_frame_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int frame = 3;
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_frame_set(obj, frame))
+               .Times(1);
+       e_view_image_animated_frame_set(image, frame);
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_frame_get(obj))
+               .WillOnce(Return(frame));
+
+       int ret = e_view_image_animated_frame_get(image);
+       EXPECT_EQ(ret, frame);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_animated_frame_count_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+
+       // test code start
+       int frame = 3;
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_frame_get(obj))
+               .WillOnce(Return(frame));
+
+       int ret = e_view_image_animated_frame_get(image);
+       EXPECT_EQ(ret, frame);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_animated_frame_duration_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       double duration = 3.0;
+       int start_frame = 1;
+       int frame_num = 3;
+
+       EXPECT_CALL(*evasMock, evas_object_image_animated_frame_duration_get(obj, start_frame, frame_num))
+               .WillOnce(Return(duration));
+
+       double ret = e_view_image_animated_frame_duration_get(image, start_frame, frame_num);
+       EXPECT_EQ(ret, duration);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_border_center_fill_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       E_View_Border_Fill_Mode fill_mode = E_VIEW_BORDER_FILL_NONE;
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_set(obj, EVAS_BORDER_FILL_NONE))
+               .Times(1);
+
+       e_view_image_border_center_fill_set(image, fill_mode);
+
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_BORDER_FILL_NONE));
+
+       E_View_Border_Fill_Mode ret = e_view_image_border_center_fill_get(image);
+       EXPECT_EQ(fill_mode, ret);
+
+       fill_mode = E_VIEW_BORDER_FILL_DEFAULT;
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_set(obj, EVAS_BORDER_FILL_DEFAULT))
+               .Times(1);
+
+       e_view_image_border_center_fill_set(image, fill_mode);
+
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_BORDER_FILL_DEFAULT));
+
+       ret = e_view_image_border_center_fill_get(image);
+       EXPECT_EQ(fill_mode, ret);
+
+       fill_mode = E_VIEW_BORDER_FILL_SOLID;
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_set(obj, EVAS_BORDER_FILL_SOLID))
+               .Times(1);
+
+       e_view_image_border_center_fill_set(image, fill_mode);
+
+       EXPECT_CALL(*evasMock, evas_object_image_border_center_fill_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_BORDER_FILL_SOLID));
+
+       ret = e_view_image_border_center_fill_get(image);
+       EXPECT_EQ(fill_mode, ret);
+       
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_border_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int l = 10;
+       int r = 20;
+       int t = 30;
+       int b = 40;
+
+       EXPECT_CALL(*evasMock, evas_object_image_border_set(obj, l, r, t, b))
+               .Times(1);
+       
+       e_view_image_border_set(image, l, r, t, b);
+
+       int ret_l, ret_r, ret_t, ret_b;
+       EXPECT_CALL(*evasMock, evas_object_image_border_get(obj, &ret_l, &ret_r, &ret_t, &ret_b))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(l),
+                                               SetArgPointee<2>(r),
+                                               SetArgPointee<3>(t),
+                                               SetArgPointee<4>(b)));
+       
+       e_view_image_border_get(image, &ret_l, &ret_r, &ret_t, &ret_b);
+       EXPECT_EQ(l, ret_l);
+       EXPECT_EQ(r, ret_r);
+       EXPECT_EQ(t, ret_t);
+       EXPECT_EQ(b, ret_b);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+       
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_colorspace_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       EXPECT_CALL(*evasMock, evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_GRY8))
+               .Times(1);
+       
+       e_view_image_colorspace_set(image, E_VIEW_COLORSPACE_GRY8);
+
+       EXPECT_CALL(*evasMock, evas_object_image_colorspace_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_COLORSPACE_GRY8));
+       
+       E_View_Colorspace ret = e_view_image_colorspace_get(image);
+       EXPECT_EQ(ret, E_VIEW_COLORSPACE_GRY8);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);      
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_data_copy_set)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       // raw data copy is needed width, height, colorspace is must be setted.
+       // this is just test evas's function is called or not
+       void* data = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       EXPECT_CALL(*evasMock, evas_object_image_data_copy_set(obj, data))
+               .Times(1);
+
+       e_view_image_data_copy_set(image, data);
+       free(data);
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_data_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       // test code start
+       // raw data copy is needed width, height, colorspace is must be setted.
+       // this is just test evas's function is called or not
+       void* data = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       EXPECT_CALL(*evasMock, evas_object_image_data_set(obj, data))
+               .Times(1);
+
+       e_view_image_data_set(image, data);
+
+       EXPECT_CALL(*evasMock, evas_object_image_data_get(obj, EINA_TRUE))
+               .Times(1)
+               .WillOnce(Return(data));
+       
+       void* ret = e_view_image_data_get(image, EINA_TRUE);
+       EXPECT_EQ(ret, data);
+       free(data);
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_data_update_add)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       EXPECT_CALL(*evasMock, evas_object_image_data_update_add(obj, 10, 20, 100, 200))
+               .Times(1);
+       
+       e_view_image_data_update_add(image, 10, 20, 100, 200);
+       
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_file_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       const char file[] = "temp.txt";
+       const char key[] = "key0";
+
+       EXPECT_CALL(*evasMock, evas_object_image_file_set(obj, file, key))
+               .Times(1);
+       
+       e_view_image_file_set(image, file, key);
+
+       char *ret_file;
+       char *ret_key;
+       EXPECT_CALL(*evasMock, evas_object_image_file_get(obj, _, _))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(file),
+                                               SetArgPointee<2>(key)));
+       
+       e_view_image_file_get(image, (const char**)&ret_file, (const char**)&ret_key);
+       EXPECT_EQ(ret_file, file);
+       EXPECT_EQ(ret_key, key);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_fill_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int x = 10;
+       int y = 20;
+       int w = 30;
+       int h = 40;
+       EXPECT_CALL(*evasMock, evas_object_image_fill_set(obj, x, y, w, h))
+               .Times(1);
+
+       e_view_image_fill_set(image, x, y, w, h);
+
+       int ret_x, ret_y, ret_w, ret_h;
+       EXPECT_CALL(*evasMock, evas_object_image_fill_get(obj, &ret_x, &ret_y, &ret_w, &ret_h))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(x),
+                                               SetArgPointee<2>(y),
+                                               SetArgPointee<3>(w),
+                                               SetArgPointee<4>(h)));
+
+       e_view_image_fill_get(image, &ret_x, &ret_y, &ret_w, &ret_h);
+       EXPECT_EQ(ret_x, x);
+       EXPECT_EQ(ret_y, y);
+       EXPECT_EQ(ret_w, w);
+       EXPECT_EQ(ret_h, h);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_filled_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       EXPECT_CALL(*evasMock, evas_object_image_filled_set(obj, EINA_TRUE))
+               .Times(1);
+
+       e_view_image_filled_set(image, EINA_TRUE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_filled_get(obj))
+               .Times(1)
+               .WillOnce(Return(EINA_TRUE));
+
+       Eina_Bool ret;
+       ret = e_view_image_filled_get(image);
+       EXPECT_EQ(ret, EINA_TRUE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_filled_get(obj))
+               .Times(1)
+               .WillOnce(Return(EINA_FALSE));
+
+       ret = e_view_image_filled_get(image);
+       EXPECT_EQ(ret, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_load_error_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       EXPECT_CALL(*evasMock, evas_object_image_load_error_get(obj))
+               .Times(1)
+               .WillOnce(Return(EVAS_LOAD_ERROR_NONE));
+       
+       E_View_Load_Error ret = e_view_image_load_error_get(image);
+       EXPECT_EQ(ret, E_VIEW_LOAD_ERROR_NONE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_load_size_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int w = 10;
+       int h = 20;
+       EXPECT_CALL(*evasMock, evas_object_image_load_size_set(obj, w, h))
+               .Times(1);
+       
+       e_view_image_load_size_set(image, w, h);
+
+       int ret_w, ret_h;
+       EXPECT_CALL(*evasMock, evas_object_image_load_size_get(obj, &ret_w, &ret_h))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(w),
+                                               SetArgPointee<2>(h)));
+
+       e_view_image_load_size_get(image, &ret_w, &ret_h);
+       EXPECT_EQ(ret_w, w);
+       EXPECT_EQ(ret_h, h);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_native_surface_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       E_View_Native_Surface surf;
+       surf.version = EVAS_NATIVE_SURFACE_VERSION;
+       surf.type = E_VIEW_NATIVE_SURFACE_NONE;
+
+       EXPECT_CALL(*evasMock, evas_object_image_native_surface_set(obj, _))
+               .Times(1);
+
+       e_view_image_native_surface_set(image, &surf);
+
+       E_View_Native_Surface *ret = e_view_image_native_surface_get(image);
+       EXPECT_EQ(ret, nullptr);
+
+       surf.version = EVAS_NATIVE_SURFACE_VERSION;
+       surf.type = E_VIEW_NATIVE_SURFACE_WL;
+       surf.data.wl.legacy_buffer = nullptr;
+
+       EXPECT_CALL(*evasMock, evas_object_image_native_surface_set(obj, _))
+               .Times(1);
+
+       e_view_image_native_surface_set(image, &surf);
+
+       ret = e_view_image_native_surface_get(image);
+       EXPECT_NE(ret, nullptr);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_pixels_dirty_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       Eina_Bool dirty = EINA_FALSE;
+       EXPECT_CALL(*evasMock, evas_object_image_pixels_dirty_set(obj, dirty))
+               .Times(1);
+       e_view_image_pixels_dirty_set(image, dirty);
+
+       EXPECT_CALL(*evasMock, evas_object_image_pixels_dirty_get(obj))
+               .Times(2)
+               .WillOnce(Return(EINA_TRUE))
+               .WillOnce(Return(EINA_FALSE));
+       
+       Eina_Bool ret_dirty;
+       ret_dirty = e_view_image_pixels_dirty_get(image);
+       EXPECT_EQ(ret_dirty, EINA_TRUE);
+       ret_dirty = e_view_image_pixels_dirty_get(image);
+       EXPECT_EQ(ret_dirty, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+static void *cb_data;
+static void *cb_image;
+static void cb_pixel_get(void *data, E_View_Image *image)
+{
+       EXPECT_EQ(data, cb_data);
+       EXPECT_EQ(image, cb_image);
+};
+
+TEST_F(EViewImageTest, Test_e_view_image_pixels_get_callback_set)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int data = 2;
+       cb_data = (void*)&data;
+       cb_image = image;
+       EXPECT_CALL(*evasMock, evas_object_image_pixels_get_callback_set(obj, _, _))
+               .Times(1);
+
+       e_view_image_pixels_get_callback_set(image, &cb_pixel_get, cb_data);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_pixels_noti_callback_set)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int data = 2;
+       cb_data = (void*)&data;
+       cb_image = image;
+       EXPECT_CALL(*evasMock, evas_object_image_pixels_noti_callback_set(obj, _, _))
+               .Times(1);
+
+       e_view_image_pixels_noti_callback_set(image, &cb_pixel_get, cb_data);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_smooth_scale_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       Eina_Bool smooth_scale = 0;
+       EXPECT_CALL(*evasMock, evas_object_image_smooth_scale_set(obj, smooth_scale))
+               .Times(1);
+       
+       e_view_image_smooth_scale_set(image, smooth_scale);
+
+       EXPECT_CALL(*evasMock, evas_object_image_smooth_scale_get(obj))
+               .Times(2)
+               .WillOnce(Return(EINA_TRUE))
+               .WillOnce(Return(EINA_FALSE));
+       
+       Eina_Bool ret_smooth_scale;
+       ret_smooth_scale = e_view_image_smooth_scale_get(image);
+       EXPECT_EQ(ret_smooth_scale, EINA_TRUE);
+
+       ret_smooth_scale = e_view_image_smooth_scale_get(image);
+       EXPECT_EQ(ret_smooth_scale, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_size_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       int w = 120, h = 240;
+       EXPECT_CALL(*evasMock, evas_object_image_size_set(obj, w, h))
+               .Times(1);      
+       e_view_image_size_set(image, w, h);
+
+       int ret_w, ret_h;
+       EXPECT_CALL(*evasMock, evas_object_image_size_get(obj, &ret_w, &ret_h))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(w),
+                                               SetArgPointee<2>(h)));
+       e_view_image_size_get(image, &ret_w, &ret_h);
+       EXPECT_EQ(w, ret_w);
+       EXPECT_EQ(h, ret_h);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_source_set_get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       Evas_Object *source_obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(source_obj));
+
+       // test code start
+       E_View_Image *img_source = e_view_image_create(this->tree);
+       E_View *view_source = e_view_image_view_get(img_source);
+       EXPECT_CALL(*evasMock, evas_object_image_source_set(obj, source_obj))
+               .Times(1)
+               .WillOnce(Return(EINA_TRUE));
+
+       Eina_Bool ret = e_view_image_source_set(image, img_source);
+       EXPECT_EQ(ret, EINA_TRUE);
+
+       E_View_Image * ret_img_source = e_view_image_source_get(image);
+       EXPECT_EQ(ret_img_source, img_source);
+
+       EXPECT_CALL(*evasMock, evas_object_image_source_unset(obj))
+               .Times(2)
+               .WillOnce(Return(EINA_TRUE))
+               .WillOnce(Return(EINA_FALSE));
+       
+       ret = e_view_image_source_unset(image);
+       EXPECT_EQ(ret, EINA_TRUE);
+       ret = e_view_image_source_unset(image);
+       EXPECT_EQ(ret, EINA_FALSE);
+
+       ret_img_source = e_view_image_source_get(image);
+       EXPECT_EQ(ret_img_source, nullptr);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view_source);
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(source_obj);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_save)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       const char file[] = "file.jpg";
+       const char key[] = "key";
+       const char flags[] = "compress=0 quality=100";
+
+       EXPECT_CALL(*evasMock, evas_object_image_save(obj, _, _, _))
+               .Times(2)
+               .WillOnce(Return(EINA_TRUE))
+               .WillOnce(Return(EINA_FALSE));
+
+       Eina_Bool ret;
+       ret = e_view_image_save(image, file, key, flags);
+       EXPECT_EQ(ret, EINA_TRUE);
+       ret = e_view_image_save(image, file, key, flags);
+       EXPECT_EQ(ret, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewImageTest, Test_e_view_image_preload)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+    E_View_Image *image = e_view_image_create(this->tree);
+       E_View *view = e_view_image_view_get(image);
+
+       // test code start
+       EXPECT_CALL(*evasMock, evas_object_image_preload(obj, EINA_TRUE))
+               .Times(1);
+
+       e_view_image_preload(image, EINA_TRUE);
+
+       EXPECT_CALL(*evasMock, evas_object_image_preload(obj, EINA_FALSE))
+               .Times(1);
+
+       e_view_image_preload(image, EINA_FALSE);
+
+       // end of test code
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
diff --git a/tests/tc-e_view_rect.cpp b/tests/tc-e_view_rect.cpp
new file mode 100644 (file)
index 0000000..7985ba5
--- /dev/null
@@ -0,0 +1,172 @@
+#include "tc-main.h"
+#include "evas_wrapper.h"
+
+#include "e_canvas.h"
+#include "src/bin/core/e_view_intern.h"
+#include "e_view_rect.h"
+
+using ::testing::Return;
+using ::testing::_;
+using ::testing::SetArgPointee;
+using ::testing::DoAll;
+
+class EViewRectTest : public ::testing::Test
+{
+protected:
+       Evas *evas;
+       E_Canvas *canvas;
+       E_View_Tree *tree;
+
+       void SetUp(void) override {
+                evasMock = new EvasMock();
+                this->evas = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+                this->canvas = e_canvas_create(this->evas);
+                this->tree = e_canvas_layer_view_tree_get(this->canvas, E_CANVAS_LAYER_BOTTOM);
+       }
+
+       void TearDown(void) override {
+                e_canvas_destroy(this->canvas);
+                free(this->evas);
+                delete evasMock;
+       }
+};
+
+TEST_F(EViewRectTest, Test_E_View_Rect_Create)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       int width = 123, height = 456;
+       int color[4] = { 10, 20, 30, 40 };
+       EXPECT_CALL(*evasMock, evas_object_rectangle_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, width, height))
+               .Times(1);
+
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, color[0], color[1], color[2], color[3]))
+               .Times(1);
+
+       E_View_Rect *rect = e_view_rect_create(this->tree, width, height, color);
+       EXPECT_NE(rect, nullptr);
+       E_View *view = e_view_rect_view_get(rect);
+       EXPECT_NE(view, nullptr);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewRectTest, Test_E_View_Rect_Size_Set_Get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(1);
+
+       int color[4] = { 10, 20, 30, 40 };
+       ON_CALL(*evasMock, evas_object_rectangle_add(this->evas)).WillByDefault(Return(obj));
+
+       EXPECT_CALL(*evasMock, evas_object_rectangle_add(this->evas))
+               .Times(1);
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, 123, 456))
+               .Times(1);
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, 10, 20, 30, 40))
+               .Times(1);
+
+       E_View_Rect *rect = e_view_rect_create(this->tree, 123, 456, color);
+       ASSERT_NE(rect, nullptr);
+       E_View *view = e_view_rect_view_get(rect);
+
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, _, _))
+               .Times(0);
+       e_view_rect_size_set(rect, 123, 456);
+       int width, height;
+       e_view_rect_size_get(rect, &width, &height);
+       EXPECT_EQ(width,123);
+       EXPECT_EQ(height,456);
+
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, 456, 123))
+               .Times(1);
+       e_view_rect_size_set(rect, 456, 123);
+       e_view_rect_size_get(rect, &width, &height);
+       EXPECT_EQ(width,456);
+       EXPECT_EQ(height,123);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+
+TEST_F(EViewRectTest, Test_E_View_Rect_Try_From_View)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       int width = 123, height = 456;
+       int color[4] = { 10, 20, 30, 40 };
+       EXPECT_CALL(*evasMock, evas_object_rectangle_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, width, height))
+               .Times(1);
+
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, color[0], color[1], color[2], color[3]))
+               .Times(1);
+
+       E_View_Rect *rect = e_view_rect_create(this->tree, width, height, color);
+       E_View *view = e_view_rect_view_get(rect);
+
+       E_View_Rect *rect_from_view = e_view_rect_try_from_view(view);
+       EXPECT_EQ(rect_from_view, rect);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
+
+TEST_F(EViewRectTest, Test_E_View_Rect_Color_Set_Get)
+{
+       Evas_Object *obj = (Evas_Object *)malloc(EVAS_OBJECT_SIZE);
+
+       int width = 123, height = 456;
+       int color[4] = { 10, 20, 30, 40 };
+       EXPECT_CALL(*evasMock, evas_object_rectangle_add(this->evas))
+               .Times(1)
+               .WillOnce(Return(obj));
+
+       EXPECT_CALL(*evasMock, evas_object_resize(obj, width, height))
+               .Times(1);
+
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, color[0], color[1], color[2], color[3]))
+               .Times(1);
+
+       E_View_Rect *rect = e_view_rect_create(this->tree, width, height, color);
+       E_View *view = e_view_rect_view_get(rect);
+
+       int red = 255;
+       int green = 128;
+       int blue = 64;
+       int alpha = 32;
+
+       EXPECT_CALL(*evasMock, evas_object_color_set(obj, red, green, blue, alpha))
+               .Times(1);
+
+       e_view_rect_color_set(rect, red, green, blue, alpha);
+
+       int r, g, b, a;
+       EXPECT_CALL(*evasMock, evas_object_color_get(obj, &r, &g, &b, &a))
+               .Times(1)
+               .WillOnce(DoAll(SetArgPointee<1>(red),
+                                               SetArgPointee<2>(green),
+                                               SetArgPointee<3>(blue),
+                                               SetArgPointee<4>(alpha)));
+
+       e_view_rect_color_get(rect, &r, &g, &b, &a);
+       EXPECT_EQ(red, r);
+       EXPECT_EQ(green, g);
+       EXPECT_EQ(blue, b);
+       EXPECT_EQ(alpha, a);
+
+       EXPECT_CALL(*evasMock, evas_object_del(_));
+       e_view_destroy(view);
+       free(obj);
+}
index a24d9c0..bb4f934 100644 (file)
@@ -29,6 +29,7 @@
 **************************************************************************/
 
 #include "gmock/gmock.h"
+#include <cstdlib>
 
 #ifdef TIZEN_TEST_GCOV
 extern "C" void __gcov_flush(void);
@@ -36,7 +37,7 @@ extern "C" void __gcov_flush(void);
 
 int main(int argc, char **argv)
 {
-       auto AllTestSuccess = false;
+       int AllTestSuccess;
 
 #ifdef TIZEN_TEST_GCOV
        setenv("GCOV_PREFIX", "/tmp", 1);
@@ -44,16 +45,16 @@ int main(int argc, char **argv)
 
        try {
                ::testing::InitGoogleMock(&argc, argv);
-               ::testing::FLAGS_gtest_death_test_style = "fast";
+               ::testing::FLAGS_gtest_death_test_style = "threadsafe";
        } catch ( ... ) {
                std::cout << "error while trying to init google tests.\n";
                exit(EXIT_FAILURE);
        }
 
        try {
-               AllTestSuccess = RUN_ALL_TESTS() == 0 ? true : false;
+               AllTestSuccess = RUN_ALL_TESTS() == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
        } catch (const ::testing::internal::GoogleTestFailureException & e) {
-               AllTestSuccess = false;
+               AllTestSuccess = EXIT_FAILURE;
                std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl;
                std::cout << "\n";
        }
index b73183b..cced7ff 100644 (file)
 #include <pthread.h>
 #include <gmock/gmock.h>
 #include <stdlib.h>
-#include <e.h>
+//#include <e.h>
 
 using ::testing::TestWithParam;
 using ::testing::Bool;
 using ::testing::Values;
 using ::testing::Combine;
 
+#define EXPECT_ABORT(exp) EXPECT_EXIT(exp, ::testing::KilledBySignal(SIGABRT), _);
+
 #endif