1 /* EINA - EFL data type library
2 * Copyright (C) 2010 Cedric BAIL
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.
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.
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/>.
19 #ifndef EINA_QUADTREE_H_
20 #define EINA_QUADTREE_H_
22 #include "eina_config.h"
24 #include "eina_inlist.h"
26 typedef struct _Eina_QuadTree Eina_QuadTree;
27 typedef struct _Eina_QuadTree_Item Eina_QuadTree_Item;
33 } Eina_Quad_Direction;
35 typedef Eina_Quad_Direction (*Eina_Quad_Callback)(const void *object, size_t middle);
37 EAPI Eina_QuadTree *eina_quadtree_new(size_t w, size_t h, Eina_Quad_Callback vertical, Eina_Quad_Callback horizontal);
38 EAPI void eina_quadtree_free(Eina_QuadTree *q);
39 EAPI void eina_quadtree_resize(Eina_QuadTree *q, size_t w, size_t h);
41 EAPI void eina_quadtree_cycle(Eina_QuadTree *q);
42 EAPI void eina_quadtree_increase(Eina_QuadTree_Item *object);
44 EAPI Eina_QuadTree_Item *eina_quadtree_add(Eina_QuadTree *q, const void *object);
45 EAPI Eina_Bool eina_quadtree_del(Eina_QuadTree_Item *object);
46 EAPI Eina_Bool eina_quadtree_change(Eina_QuadTree_Item *object);
47 EAPI Eina_Bool eina_quadtree_hide(Eina_QuadTree_Item *object);
48 EAPI Eina_Bool eina_quadtree_show(Eina_QuadTree_Item *object);
50 EAPI Eina_Inlist *eina_quadtree_collide(Eina_QuadTree *q, int x, int y, int w, int h);
51 EAPI void *eina_quadtree_object(Eina_Inlist *list);