2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2013-04-08 04:02:58 -07:00
|
|
|
#include "evas_private.h"
|
|
|
|
//#include "evas_cs.h"
|
|
|
|
#ifdef EVAS_CSERVE2
|
|
|
|
#include "evas_cs2_private.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MY_CLASS EVAS_OUT_CLASS
|
2014-03-12 11:13:45 -07:00
|
|
|
typedef struct _Evas_Out_Data Evas_Out_Data;
|
|
|
|
struct _Evas_Out_Data
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2013-04-09 00:52:49 -07:00
|
|
|
void *info;/*, *context, *output;*/
|
2013-04-08 04:02:58 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI Evas_Out *
|
|
|
|
evas_out_add(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2016-03-09 07:47:28 -08:00
|
|
|
Evas_Object *eo_obj = NULL;
|
|
|
|
eo_add(&eo_obj, MY_CLASS, e);
|
2013-04-08 04:02:58 -07:00
|
|
|
return eo_obj;
|
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
EOLIAN static Eo *
|
2014-03-18 07:01:24 -07:00
|
|
|
_evas_out_eo_base_constructor(Eo *eo_obj, Evas_Out_Data *eo_dat)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2014-04-02 03:16:09 -07:00
|
|
|
Eo *eo_parent = NULL;
|
2013-09-24 21:32:56 -07:00
|
|
|
Evas_Public_Data *e;
|
|
|
|
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_parent = eo_parent_get(eo_obj);
|
2014-06-26 14:29:46 -07:00
|
|
|
e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_canvas_async_block(e);
|
2013-09-24 21:32:56 -07:00
|
|
|
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
|
2013-09-24 21:32:56 -07:00
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
if (!e) return NULL;
|
2013-04-08 04:02:58 -07:00
|
|
|
e->outputs = eina_list_append(e->outputs, eo_obj);
|
2013-04-09 00:52:49 -07:00
|
|
|
if (e->engine.func->info) eo_dat->info = e->engine.func->info(eo_parent);
|
|
|
|
// XXX: context and output are currently held in the core engine and are
|
|
|
|
// allocated by engine specific internal code. this all needs a new engine
|
|
|
|
// api to make it work
|
2015-05-19 03:41:27 -07:00
|
|
|
|
|
|
|
return eo_obj;
|
2013-04-08 04:02:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_del(Evas_Out *evo)
|
|
|
|
{
|
|
|
|
eo_unref(evo);
|
|
|
|
}
|
|
|
|
|
2014-03-12 11:13:45 -07:00
|
|
|
EOLIAN static void
|
2014-03-18 07:01:24 -07:00
|
|
|
_evas_out_eo_base_destructor(Eo *eo_obj, Evas_Out_Data *eo_dat)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2014-04-02 03:16:09 -07:00
|
|
|
Eo *eo_parent = NULL;
|
2013-09-24 21:32:56 -07:00
|
|
|
Evas_Public_Data *e;
|
|
|
|
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_parent = eo_parent_get(eo_obj);
|
2014-06-26 14:29:46 -07:00
|
|
|
e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_canvas_async_block(e);
|
|
|
|
if (!e) return;
|
2014-03-13 19:51:49 -07:00
|
|
|
// XXX: need to free output and context one they get allocated one day
|
2013-04-09 00:52:49 -07:00
|
|
|
// e->engine.func->context_free(eo_dat->output, eo_dat->context);
|
|
|
|
// e->engine.func->output_free(eo_dat->output);
|
|
|
|
e->engine.func->info_free(eo_parent, eo_dat->info);
|
2014-03-13 19:51:49 -07:00
|
|
|
e->outputs = eina_list_remove(e->outputs, eo_obj);
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_destructor(eo_super(eo_obj, MY_CLASS));
|
2013-04-08 04:02:58 -07:00
|
|
|
}
|
|
|
|
|
2014-03-12 11:13:45 -07:00
|
|
|
EOLIAN static void
|
2015-02-10 03:44:38 -08:00
|
|
|
_evas_out_view_set(Eo *eo_e, Evas_Out_Data *eo_dat, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2015-02-10 03:44:38 -08:00
|
|
|
Eo *eo_parent = NULL;
|
|
|
|
Evas_Public_Data *e;
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_parent = eo_parent_get(eo_e);
|
2015-02-10 03:44:38 -08:00
|
|
|
e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS);
|
|
|
|
evas_canvas_async_block(e);
|
2013-04-08 04:02:58 -07:00
|
|
|
eo_dat->x = x;
|
|
|
|
eo_dat->y = y;
|
|
|
|
eo_dat->w = w;
|
|
|
|
eo_dat->h = h;
|
|
|
|
// XXX: tell engine about any output size etc. changes
|
|
|
|
// XXX: tell evas to add damage if viewport loc/size changed
|
|
|
|
}
|
|
|
|
|
2014-03-12 11:13:45 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_evas_out_view_get(Eo *eo_e EINA_UNUSED, Evas_Out_Data *eo_dat, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
|
|
|
if (x) *x = eo_dat->x;
|
|
|
|
if (y) *y = eo_dat->y;
|
|
|
|
if (w) *w = eo_dat->w;
|
|
|
|
if (h) *h = eo_dat->h;
|
|
|
|
}
|
|
|
|
|
2014-03-12 11:13:45 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2015-02-10 03:44:38 -08:00
|
|
|
_evas_out_engine_info_set(Eo *eo_e, Evas_Out_Data *eo_dat, Evas_Engine_Info *info)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2015-02-10 03:44:38 -08:00
|
|
|
Eo *eo_parent = NULL;
|
|
|
|
Evas_Public_Data *e;
|
2016-03-01 10:06:28 -08:00
|
|
|
eo_parent = eo_parent_get(eo_e);
|
2015-02-10 03:44:38 -08:00
|
|
|
e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS);
|
|
|
|
evas_canvas_async_block(e);
|
2014-03-12 11:13:45 -07:00
|
|
|
if (eo_dat->info != info) return EINA_FALSE;
|
2013-04-08 04:02:58 -07:00
|
|
|
|
|
|
|
// XXX: handle setting of engine info here
|
2014-03-12 11:13:45 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2013-04-08 04:02:58 -07:00
|
|
|
}
|
|
|
|
|
2014-03-12 11:13:45 -07:00
|
|
|
EOLIAN static Evas_Engine_Info*
|
|
|
|
_evas_out_engine_info_get(Eo *eo_e EINA_UNUSED, Evas_Out_Data *eo_dat)
|
2013-04-08 04:02:58 -07:00
|
|
|
{
|
2014-03-12 11:13:45 -07:00
|
|
|
return eo_dat->info;
|
2013-04-08 04:02:58 -07:00
|
|
|
}
|
|
|
|
|
2014-03-13 19:51:49 -07:00
|
|
|
#include "canvas/evas_out.eo.c"
|