aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_page_transition.c
blob: f6d73a2c109687c06be3eedc64675289f4651c7a (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include <Elementary.h>
#include "elm_priv.h"

#include "efl_page_transition.h"
#include "efl_ui_widget_pager.h"

#define MY_CLASS EFL_PAGE_TRANSITION_CLASS


EOLIAN static void
_efl_page_transition_page_size_set(Eo *obj EINA_UNUSED,
                                   Efl_Page_Transition_Data *pd,
                                   Eina_Size2D sz)
{
   pd->page_spec.sz = sz;
}

EOLIAN static void
_efl_page_transition_padding_size_set(Eo *obj EINA_UNUSED,
                                      Efl_Page_Transition_Data *pd,
                                      int padding)
{
   pd->page_spec.padding = padding;
}

EOLIAN static void
_efl_page_transition_bind(Eo *obj EINA_UNUSED,
                          Efl_Page_Transition_Data *pd,
                          Eo *pager,
                          Efl_Canvas_Group *group)
{
   Eina_Rect group_rect;

   if (pd->pager.obj == pager) return;

   pd->pager.obj = pager;
   pd->pager.group = group;

   if (pager)
     {
        group_rect = efl_gfx_entity_geometry_get(group);

        pd->pager.x = group_rect.x;
        pd->pager.y = group_rect.y;
        pd->pager.w = group_rect.w;
        pd->pager.h = group_rect.h;

        pd->page_spec.sz = efl_ui_pager_page_size_get(pager);
        pd->page_spec.padding = efl_ui_pager_padding_get(pager);
        pd->loop = efl_ui_pager_loop_mode_get(pager);
     }
}

EOLIAN static void
_efl_page_transition_update(Eo *obj EINA_UNUSED,
                            Efl_Page_Transition_Data *pd EINA_UNUSED,
                            double move EINA_UNUSED)
{

}

EOLIAN static void
_efl_page_transition_pack(Eo *obj EINA_UNUSED,
                          Efl_Page_Transition_Data *pd EINA_UNUSED,
                          int index EINA_UNUSED)
{

}

EOLIAN static void
_efl_page_transition_unpack_all(Eo *obj EINA_UNUSED,
                                Efl_Page_Transition_Data *pd EINA_UNUSED,
                                int index EINA_UNUSED)
{

}

EOLIAN static void
_efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED,
                                      Efl_Page_Transition_Data *pd EINA_UNUSED,
                                      int diff EINA_UNUSED)
{

}

EOLIAN static Eina_Bool
_efl_page_transition_loop_set(Eo *obj EINA_UNUSED,
                              Efl_Page_Transition_Data *pd,
                              Efl_Ui_Pager_Loop loop)
{
   pd->loop = loop;

   return EINA_TRUE;
}


EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_update,
                          EFL_FUNC_CALL(move), double move)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_pack,
                          EFL_FUNC_CALL(index), int index)
EOAPI EFL_VOID_FUNC_BODY(efl_page_transition_unpack_all)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change,
                          EFL_FUNC_CALL(diff), int diff)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set,
                          EFL_FUNC_CALL(sz), Eina_Size2D sz)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_padding_size_set,
                          EFL_FUNC_CALL(padding), int padding)
EOAPI EFL_FUNC_BODYV(efl_page_transition_loop_set, Eina_Bool, 0,
                          EFL_FUNC_CALL(loop), Efl_Ui_Pager_Loop loop)


#define EFL_PAGE_TRANSITION_EXTRA_OPS \
   EFL_OBJECT_OP_FUNC(efl_page_transition_update, \
                      _efl_page_transition_update), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \
                      _efl_page_transition_pack), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \
                      _efl_page_transition_unpack_all), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
                      _efl_page_transition_curr_page_change), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
                      _efl_page_transition_page_size_set), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_padding_size_set, \
                      _efl_page_transition_padding_size_set), \
   EFL_OBJECT_OP_FUNC(efl_page_transition_loop_set, \
                      _efl_page_transition_loop_set)

#include "efl_page_transition.eo.c"