aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_canvas3d_object.c
blob: 3bae6b6a5e46e191c9a80c5523aef941c3d0f8a6 (plain) (blame)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "evas_common_private.h"
#include "evas_private.h"

#define MY_CLASS EVAS_CANVAS3D_OBJECT_CLASS

EOLIAN static Eo *
_evas_canvas3d_object_eo_base_constructor(Eo *obj, Evas_Canvas3D_Object_Data *pd)
{
   Eo *e = NULL;
   obj = eo_super_eo_constructor( MY_CLASS, obj);
   eo_do(obj, e = eo_parent_get(obj));
   pd->evas = e;
   pd->type = EVAS_CANVAS3D_OBJECT_TYPE_INVALID;
   memset(&pd->dirty[0], 0x00, sizeof(Eina_Bool) * EVAS_CANVAS3D_STATE_MAX);

   return obj;
}

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

EOLIAN static void
_evas_canvas3d_object_type_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Object_Data *pd, Evas_Canvas3D_Object_Type type)
{
   pd->type = type;
}

EOLIAN static Evas_Canvas3D_Object_Type
_evas_canvas3d_object_type_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Object_Data *pd)
{
   return pd->type;
}

EOLIAN static Eina_Bool
_evas_canvas3d_object_dirty_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Object_Data *pd, Evas_Canvas3D_State state)
{
   return pd->dirty[state];
}

EOLIAN static void
_evas_canvas3d_object_change(Eo *obj, Evas_Canvas3D_Object_Data *pd, Evas_Canvas3D_State state, Evas_Canvas3D_Object *ref)
{
   /* Skip already dirty properties. */
   if (pd->dirty[state])
     return;

   pd->dirty[state] = EINA_TRUE;
   pd->dirty[EVAS_CANVAS3D_STATE_ANY] = EINA_TRUE;

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

EOLIAN static void
_evas_canvas3d_object_update(Eo *obj, Evas_Canvas3D_Object_Data *pd)
{
   if (!pd->dirty[EVAS_CANVAS3D_STATE_ANY])
     return;

   eo_do(obj, evas_canvas3d_object_update_notify(obj));

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

EOLIAN static void
_evas_canvas3d_object_eo_base_event_callback_priority_add(Eo *obj,
                                                    Evas_Canvas3D_Object_Data *pd EINA_UNUSED,
                                                    const Eo_Event_Description *desc,
                                                    Eo_Callback_Priority priority,
                                                    Eo_Event_Cb func,
                                                    const void *user_data)
{
   eo_super_eo_event_callback_priority_add(MY_CLASS, obj, desc, priority, func, user_data);
   eo_do(obj, evas_canvas3d_object_callback_register(obj, desc->name, user_data));
}

EOLIAN static void
_evas_canvas3d_object_eo_base_event_callback_del(Eo *obj, Evas_Canvas3D_Object_Data *pd EINA_UNUSED,
                                           const Eo_Event_Description *desc,
                                           Eo_Event_Cb func,
                                           const void *user_data)
{
   eo_super_eo_event_callback_del(MY_CLASS, obj, desc, func, user_data);
   eo_do(obj, evas_canvas3d_object_callback_unregister(obj, desc->name));
}

#include "canvas/evas_canvas3d_object.eo.c"