aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_quadtree.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/include/eina_quadtree.h')
-rw-r--r--libraries/eina/src/include/eina_quadtree.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/libraries/eina/src/include/eina_quadtree.h b/libraries/eina/src/include/eina_quadtree.h
new file mode 100644
index 0000000..2638d8b
--- /dev/null
+++ b/libraries/eina/src/include/eina_quadtree.h
@@ -0,0 +1,53 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2010 Cedric BAIL
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_QUADTREE_H_
20#define EINA_QUADTREE_H_
21
22#include "eina_config.h"
23
24#include "eina_inlist.h"
25
26typedef struct _Eina_QuadTree Eina_QuadTree;
27typedef struct _Eina_QuadTree_Item Eina_QuadTree_Item;
28
29typedef enum {
30 EINA_QUAD_LEFT,
31 EINA_QUAD_RIGHT,
32 EINA_QUAD_BOTH
33} Eina_Quad_Direction;
34
35typedef Eina_Quad_Direction (*Eina_Quad_Callback)(const void *object, size_t middle);
36
37EAPI Eina_QuadTree *eina_quadtree_new(size_t w, size_t h, Eina_Quad_Callback vertical, Eina_Quad_Callback horizontal);
38EAPI void eina_quadtree_free(Eina_QuadTree *q);
39EAPI void eina_quadtree_resize(Eina_QuadTree *q, size_t w, size_t h);
40
41EAPI void eina_quadtree_cycle(Eina_QuadTree *q);
42EAPI void eina_quadtree_increase(Eina_QuadTree_Item *object);
43
44EAPI Eina_QuadTree_Item *eina_quadtree_add(Eina_QuadTree *q, const void *object);
45EAPI Eina_Bool eina_quadtree_del(Eina_QuadTree_Item *object);
46EAPI Eina_Bool eina_quadtree_change(Eina_QuadTree_Item *object);
47EAPI Eina_Bool eina_quadtree_hide(Eina_QuadTree_Item *object);
48EAPI Eina_Bool eina_quadtree_show(Eina_QuadTree_Item *object);
49
50EAPI Eina_Inlist *eina_quadtree_collide(Eina_QuadTree *q, int x, int y, int w, int h);
51EAPI void *eina_quadtree_object(Eina_Inlist *list);
52
53#endif