forked from enlightenment/efl
evas: Move canvas events to a common interface
This merges window and evas events into a single name. Some events are marked as @beta as they shouldn't really be part of our EO API.
This commit is contained in:
parent
254f5ef772
commit
8a0e74afa8
|
@ -3,6 +3,7 @@
|
|||
|
||||
evas_eolian_pub_files = \
|
||||
lib/evas/canvas/evas_object.eo \
|
||||
lib/evas/canvas/efl_canvas.eo \
|
||||
lib/evas/canvas/efl_canvas_polygon.eo \
|
||||
lib/evas/canvas/efl_canvas_rectangle.eo \
|
||||
lib/evas/canvas/evas_textblock.eo \
|
||||
|
|
|
@ -840,7 +840,7 @@ _elm_win_move(Ecore_Evas *ee)
|
|||
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
|
||||
sd->screen.x = x;
|
||||
sd->screen.y = y;
|
||||
eo_event_callback_call(sd->obj, EFL_UI_WIN_EVENT_MOVED, NULL);
|
||||
eo_event_callback_call(sd->obj, EFL_GFX_EVENT_MOVE, NULL);
|
||||
evas_nochange_push(evas_object_evas_get(sd->obj));
|
||||
sd->response++;
|
||||
evas_object_move(sd->obj, x, y);
|
||||
|
@ -1751,7 +1751,7 @@ _elm_win_evas_render_post(void *data,
|
|||
Efl_Gfx_Event_Render_Post *ev = event_info;
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_RENDER_POST, ev);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_RENDER_POST, ev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1762,7 +1762,7 @@ _elm_win_evas_render_pre(void *data,
|
|||
{
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_RENDER_PRE, NULL);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_RENDER_PRE, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1773,7 +1773,7 @@ _elm_win_evas_focus_in(void *data,
|
|||
{
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_FOCUS_IN, NULL);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_FOCUS_IN, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1784,7 +1784,7 @@ _elm_win_evas_focus_out(void *data,
|
|||
{
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_FOCUS_OUT, NULL);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_FOCUS_OUT, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1796,7 +1796,7 @@ _elm_win_evas_object_focus_in(void *data,
|
|||
Eo *object = event_info;
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_OBJECT_FOCUS_IN, object);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_IN, object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1808,7 +1808,7 @@ _elm_win_evas_object_focus_out(void *data,
|
|||
Eo *object = event_info;
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_OBJECT_FOCUS_OUT, object);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT, object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1820,7 +1820,7 @@ _elm_win_evas_device_changed(void *data,
|
|||
Eo *device = event_info;
|
||||
Eo *win = data;
|
||||
|
||||
eo_event_callback_call(win, EFL_UI_WIN_EVENT_DEVICE_CHANGED, device);
|
||||
eo_event_callback_call(win, EFL_CANVAS_EVENT_DEVICE_CHANGED, device);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -1887,43 +1887,43 @@ _win_event_add_cb(void *data, const Eo_Event *ev)
|
|||
eo_event_callback_add(sd->evas, array[i].desc,
|
||||
_evas_event_key_cb, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_RENDER_POST)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_RENDER_POST)
|
||||
{
|
||||
if (!(sd->event_forward.render_post++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_POST,
|
||||
_elm_win_evas_render_post, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_RENDER_PRE)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_RENDER_PRE)
|
||||
{
|
||||
if (!(sd->event_forward.render_pre++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE,
|
||||
_elm_win_evas_render_pre, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_FOCUS_IN)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_FOCUS_IN)
|
||||
{
|
||||
if (!(sd->event_forward.focus_in++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_IN,
|
||||
_elm_win_evas_focus_in, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_FOCUS_OUT)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_FOCUS_OUT)
|
||||
{
|
||||
if (!(sd->event_forward.focus_out++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
|
||||
_elm_win_evas_focus_out, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_OBJECT_FOCUS_IN)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_OBJECT_FOCUS_IN)
|
||||
{
|
||||
if (!(sd->event_forward.object_focus_in++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
||||
_elm_win_evas_object_focus_in, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_OBJECT_FOCUS_OUT)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT)
|
||||
{
|
||||
if (!(sd->event_forward.object_focus_out++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
||||
_elm_win_evas_object_focus_out, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_DEVICE_CHANGED)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_DEVICE_CHANGED)
|
||||
{
|
||||
if (!(sd->event_forward.device_changed++))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
|
||||
|
@ -1998,43 +1998,43 @@ _win_event_del_cb(void *data, const Eo_Event *ev)
|
|||
eo_event_callback_add(sd->evas, array[i].desc,
|
||||
_evas_event_key_cb, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_RENDER_POST)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_RENDER_POST)
|
||||
{
|
||||
if (!(--sd->event_forward.render_post))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_POST,
|
||||
_elm_win_evas_render_post, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_RENDER_PRE)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_RENDER_PRE)
|
||||
{
|
||||
if (!(--sd->event_forward.render_pre))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE,
|
||||
_elm_win_evas_render_pre, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_FOCUS_IN)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_FOCUS_IN)
|
||||
{
|
||||
if (!(--sd->event_forward.focus_in))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_IN,
|
||||
_elm_win_evas_focus_in, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_FOCUS_OUT)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_FOCUS_OUT)
|
||||
{
|
||||
if (!(--sd->event_forward.focus_out))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
|
||||
_elm_win_evas_focus_out, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_OBJECT_FOCUS_IN)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_OBJECT_FOCUS_IN)
|
||||
{
|
||||
if (!(--sd->event_forward.object_focus_in))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
||||
_elm_win_evas_object_focus_in, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_OBJECT_FOCUS_OUT)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT)
|
||||
{
|
||||
if (!(--sd->event_forward.object_focus_out))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
||||
_elm_win_evas_object_focus_out, win);
|
||||
}
|
||||
else if (ev->info == EFL_UI_WIN_EVENT_DEVICE_CHANGED)
|
||||
else if (ev->info == EFL_CANVAS_EVENT_DEVICE_CHANGED)
|
||||
{
|
||||
if (!(--sd->event_forward.device_changed))
|
||||
evas_object_event_callback_add(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
|
||||
|
@ -2537,7 +2537,7 @@ _efl_ui_win_evas_object_smart_move(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Coord x, E
|
|||
{
|
||||
sd->screen.x = x;
|
||||
sd->screen.y = y;
|
||||
eo_event_callback_call(obj, EFL_UI_WIN_EVENT_MOVED, NULL);
|
||||
eo_event_callback_call(obj, EFL_GFX_EVENT_MOVE, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -2553,7 +2553,7 @@ _efl_ui_win_evas_object_smart_move(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Coord x, E
|
|||
{
|
||||
sd->screen.x = x;
|
||||
sd->screen.y = y;
|
||||
eo_event_callback_call(obj, EFL_UI_WIN_EVENT_MOVED, NULL);
|
||||
eo_event_callback_call(obj, EFL_GFX_EVENT_MOVE, NULL);
|
||||
}
|
||||
if (sd->frame_obj)
|
||||
{
|
||||
|
|
|
@ -143,7 +143,7 @@ enum Efl.Ui.Win.Urgent_Mode
|
|||
urgent [[The window is a urgent window.]]
|
||||
}
|
||||
|
||||
class Efl.Ui.Win (Elm.Widget, Elm.Interface.Atspi.Window,
|
||||
class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
|
||||
Elm.Interface.Atspi_Widget_Action, Efl.Pack,
|
||||
Efl.Input.State, Efl.Input.Interface, Efl.Screen,
|
||||
Efl.Gfx.Size.Hint, Efl.Text)
|
||||
|
@ -805,7 +805,6 @@ class Efl.Ui.Win (Elm.Widget, Elm.Interface.Atspi.Window,
|
|||
}
|
||||
events {
|
||||
delete,request;
|
||||
moved;
|
||||
withdrawn;
|
||||
iconified;
|
||||
normal;
|
||||
|
@ -822,12 +821,5 @@ class Efl.Ui.Win (Elm.Widget, Elm.Interface.Atspi.Window,
|
|||
wm,rotation,changed;
|
||||
theme,changed;
|
||||
elm,action,block_menu;
|
||||
focus,in;
|
||||
focus,out;
|
||||
object,focus,in;
|
||||
object,focus,out;
|
||||
render,pre;
|
||||
render,post: Efl.Gfx.Event.Render_Post;
|
||||
device,changed;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include "canvas/efl_ui_selectable.eo.h"
|
||||
#include "canvas/efl_ui_zoomable.eo.h"
|
||||
|
||||
#include "canvas/efl_canvas.eo.h"
|
||||
|
||||
#include "canvas/evas_canvas.eo.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
interface Efl.Canvas ()
|
||||
{
|
||||
[[Common interface for Window and some internal classes in EFL.]]
|
||||
events {
|
||||
focus,in;
|
||||
focus,out;
|
||||
object,focus,in: Efl.Gfx;
|
||||
object,focus,out: Efl.Gfx;
|
||||
render,pre;
|
||||
render,post;
|
||||
device,changed: Efl.Input.Device;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
#define EVAS_OBJECT_BETA
|
||||
#define EVAS_CANVAS_BETA
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
|
@ -40,17 +41,17 @@ static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAS
|
|||
EVAS_OBJECT_EVENT_HOLD,
|
||||
EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
|
||||
EFL_IMAGE_EVENT_PRELOAD,
|
||||
EVAS_CANVAS_EVENT_FOCUS_IN,
|
||||
EVAS_CANVAS_EVENT_FOCUS_OUT,
|
||||
EFL_CANVAS_EVENT_FOCUS_IN,
|
||||
EFL_CANVAS_EVENT_FOCUS_OUT,
|
||||
EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE,
|
||||
EVAS_CANVAS_EVENT_RENDER_FLUSH_POST,
|
||||
EVAS_CANVAS_EVENT_OBJECT_FOCUS_IN,
|
||||
EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT,
|
||||
EFL_CANVAS_EVENT_OBJECT_FOCUS_IN,
|
||||
EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT,
|
||||
EFL_IMAGE_EVENT_UNLOAD,
|
||||
EVAS_CANVAS_EVENT_RENDER_PRE,
|
||||
EVAS_CANVAS_EVENT_RENDER_POST,
|
||||
EFL_CANVAS_EVENT_RENDER_PRE,
|
||||
EFL_CANVAS_EVENT_RENDER_POST,
|
||||
EFL_IMAGE_EVENT_RESIZE,
|
||||
EVAS_CANVAS_EVENT_DEVICE_CHANGED,
|
||||
EFL_CANVAS_EVENT_DEVICE_CHANGED,
|
||||
EVAS_CANVAS_EVENT_AXIS_UPDATE,
|
||||
EVAS_CANVAS_EVENT_VIEWPORT_RESIZE
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import evas_types;
|
||||
import efl_event_types;
|
||||
|
||||
class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator,
|
||||
class Evas.Canvas (Eo.Base, Efl.Canvas, Evas.Common_Interface, Efl.Animator,
|
||||
Efl.Input.Interface)
|
||||
{
|
||||
legacy_prefix: evas;
|
||||
|
@ -1198,16 +1198,9 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator,
|
|||
Evas.Common_Interface.evas.get;
|
||||
}
|
||||
events {
|
||||
focus,in;
|
||||
focus,out;
|
||||
object,focus,in;
|
||||
object,focus,out;
|
||||
render,pre;
|
||||
render,post;
|
||||
render,flush,pre;
|
||||
render,flush,post;
|
||||
device,changed;
|
||||
axis,update;
|
||||
viewport,resize;
|
||||
render,flush,pre @beta;
|
||||
render,flush,post @beta;
|
||||
axis,update @beta;
|
||||
viewport,resize @beta;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|||
{
|
||||
// Post render callback is not required anymore
|
||||
Evas *e = obj->layer->evas->evas;
|
||||
eo_event_callback_del(e, EVAS_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
eo_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
pd->has_cb = EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|||
if (do_async && !pd->has_cb)
|
||||
{
|
||||
Evas *e = obj->layer->evas->evas;
|
||||
eo_event_callback_add(e, EVAS_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
eo_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
pd->has_cb = EINA_TRUE;
|
||||
}
|
||||
evas_filter_context_post_run_callback_set(filter, _filter_cb, eo_obj);
|
||||
|
@ -629,7 +629,7 @@ finish:
|
|||
if (pd->has_cb)
|
||||
{
|
||||
Evas *e = obj->layer->evas->evas;
|
||||
eo_event_callback_del(e, EVAS_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
eo_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
|
||||
}
|
||||
SLKD(pd->lck);
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#define EVAS_CANVAS_BETA
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
//#include "evas_cs.h"
|
||||
|
@ -872,4 +874,5 @@ evas_output_viewport_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Co
|
|||
if (h) *h = e->viewport.h;
|
||||
}
|
||||
|
||||
#include "canvas/efl_canvas.eo.c"
|
||||
#include "canvas/evas_canvas.eo.c"
|
||||
|
|
|
@ -103,7 +103,7 @@ _evas_vg_eo_base_destructor(Eo *eo_obj, Evas_VG_Data *pd)
|
|||
if (pd->engine_data)
|
||||
obj->layer->evas->engine.func->ector_free(pd->engine_data);
|
||||
|
||||
eo_event_callback_del(e, EVAS_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
||||
eo_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
||||
|
||||
eo_unref(pd->root);
|
||||
pd->root = NULL;
|
||||
|
@ -138,7 +138,7 @@ _evas_vg_eo_base_finalize(Eo *obj, Evas_VG_Data *pd)
|
|||
|
||||
// TODO: If we start to have to many Evas_Object_VG per canvas, it may be nice
|
||||
// to actually have one event per canvas and one array per canvas to.
|
||||
eo_event_callback_add(e, EVAS_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
||||
eo_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue