summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_grid_eo.h
blob: f6ce03d5b507afed03cfcf260761d4327cac0941 (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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#ifndef _EVAS_GRID_EO_H_
#define _EVAS_GRID_EO_H_

#ifndef _EVAS_GRID_EO_CLASS_TYPE
#define _EVAS_GRID_EO_CLASS_TYPE

typedef Eo Evas_Grid;

#endif

#ifndef _EVAS_GRID_EO_TYPES
#define _EVAS_GRID_EO_TYPES


#endif
/** Evas grid class
 *
 * @ingroup Evas_Grid
 */
#define EVAS_GRID_CLASS evas_grid_class_get()

EVAS_API EVAS_API_WEAK const Efl_Class *evas_grid_class_get(void) EINA_CONST;

/**
 * @brief Set the virtual resolution for the grid
 *
 * @param[in] obj The object.
 * @param[in] w The virtual horizontal size (resolution) in integer units.
 * @param[in] h The virtual vertical size (resolution) in integer units.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK void evas_obj_grid_size_set(Eo *obj, int w, int h);

/**
 * @brief Get the current virtual resolution
 *
 * See also @ref evas_obj_grid_size_set
 *
 * @param[in] obj The object.
 * @param[out] w The virtual horizontal size (resolution) in integer units.
 * @param[out] h The virtual vertical size (resolution) in integer units.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK void evas_obj_grid_size_get(const Eo *obj, int *w, int *h);

/**
 * @brief Get the list of children for the grid.
 *
 * @note This is a duplicate of the list kept by the grid internally. It's up
 * to the user to destroy it when it no longer needs it. It's possible to
 * remove objects from the grid when walking this list, but these removals
 * won't be reflected on it.
 *
 * @param[in] obj The object.
 *
 * @return Iterator to grid children
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_List *evas_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT;

/**
 * @brief Get an accessor to get random access to the list of children for the
 * grid.
 *
 * @note Do not remove or delete objects while walking the list.
 *
 * @param[in] obj The object.
 *
 * @return Accessor to children list
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_Accessor *evas_obj_grid_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;

/**
 * @brief Faster way to remove all child objects from a grid object.
 *
 * @param[in] obj The object.
 * @param[in] clear If @c true, it will delete just removed children.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK void evas_obj_grid_clear(Eo *obj, Eina_Bool clear);

/**
 * @brief Get an iterator to walk the list of children for the grid.
 *
 * @note Do not remove or delete objects while walking the list.
 *
 * @param[in] obj The object.
 *
 * @return Iterator
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_Iterator *evas_obj_grid_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;

/**
 * @brief Create a grid that is child of a given element parent.
 *
 * @ref evas_object_grid_add()
 *
 * @param[in] obj The object.
 *
 * @return New child object
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Efl_Canvas_Object *evas_obj_grid_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT;

/**
 * @brief Remove child from grid.
 *
 * @note removing a child will immediately call a walk over children in order
 * to recalculate numbers of columns and rows. If you plan to remove all
 * children, use evas_object_grid_clear() instead.
 *
 * @param[in] obj The object.
 * @param[in] child Child to be removed
 *
 * @return 1 on success, 0 on failure.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2);

/**
 * @brief Get the pack options for a grid child
 *
 * Get the pack x, y, width and height in virtual coordinates set by
 * @ref evas_obj_grid_pack.
 *
 * @param[in] obj The object.
 * @param[in] child The grid child to query for coordinates.
 * @param[out] x The pointer to where the x coordinate will be returned.
 * @param[out] y The pointer to where the y coordinate will be returned.
 * @param[out] w The pointer to where the width will be returned.
 * @param[out] h The pointer to where the height will be returned.
 *
 * @return 1 on success, 0 on failure.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_pack_get(const Eo *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h);

/**
 * @brief Add a new child to a grid object.
 *
 * @param[in] obj The object.
 * @param[in] child The child object to add.
 * @param[in] x The virtual x coordinate of the child.
 * @param[in] y The virtual y coordinate of the child.
 * @param[in] w The virtual width of the child.
 * @param[in] h The virtual height of the child.
 *
 * @return 1 on success, 0 on failure.
 *
 * @since 1.1
 *
 * @ingroup Evas_Grid
 */
EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_pack(Eo *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(2);

#endif