summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_3d_object.c
blob: ba1ecdc35223dfe2d550ffe8523c8e84ff773d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "evas_common_private.h"
#include "evas_private.h"

#define MY_CLASS EVAS_3D_OBJECT_CLASS

EOLIAN static void
_evas_3d_object_eo_base_constructor(Eo *obj, Evas_3D_Object_Data *pd)
{
   Eo *e = NULL;
   eo_do_super(obj, MY_CLASS, eo_constructor());
   eo_do(obj, e = eo_parent_get());
   pd->evas = e;
   pd->type = EVAS_3D_OBJECT_TYPE_INVALID;
   memset(&pd->dirty[0], 0x00, sizeof(Eina_Bool) * EVAS_3D_STATE_MAX);
}


EOLIAN static Evas *
 _evas_3d_object_evas_common_interface_evas_get(Eo *obj EINA_UNUSED, Evas_3D_Object_Data *pd)
{
   return pd->evas;
}

EOLIAN static void
_evas_3d_object_type_set(Eo *obj, Evas_3D_Object_Data *pd, Evas_3D_Object_Type type)
{
   evas_object_async_block(eo_data_scope_get(obj, EVAS_OBJECT_CLASS));
   pd->type = type;
}

EOLIAN static Evas_3D_Object_Type
_evas_3d_object_type_get(Eo *obj EINA_UNUSED, Evas_3D_Object_Data *pd)
{
   return pd->type;
}

EOLIAN static Eina_Bool
_evas_3d_object_dirty_get(Eo *obj EINA_UNUSED, Evas_3D_Object_Data *pd, Evas_3D_State state)
{
   return pd->dirty[state];
}

EOLIAN static void
_evas_3d_object_change(Eo *obj, Evas_3D_Object_Data *pd, Evas_3D_State state, Evas_3D_Object *ref)
{
   /* Skip already dirty properties. */
   if (pd->dirty[state])
     return;

   evas_object_async_block(eo_data_scope_get(obj, EVAS_OBJECT_CLASS));
   pd->dirty[state] = EINA_TRUE;
   pd->dirty[EVAS_3D_STATE_ANY] = EINA_TRUE;

   eo_do(obj, evas_3d_object_change_notify(state, ref));
}

EOLIAN static void
_evas_3d_object_update(Eo *obj, Evas_3D_Object_Data *pd)
{
   if (!pd->dirty[EVAS_3D_STATE_ANY])
     return;

   evas_object_async_block(eo_data_scope_get(obj, EVAS_OBJECT_CLASS));
   eo_do(obj, evas_3d_object_update_notify());

   memset(&pd->dirty[0], 0x00, sizeof(Eina_Bool) * EVAS_3D_STATE_MAX);
}

#include "canvas/evas_3d_object.eo.c"