3
* @brief internal Geis region module private interface
5
* Copyright 2010 Canonical Ltd.
7
* This library is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU Lesser General Public License as published by the Free
9
* Software Foundation; either version 3 of the License, or (at your option) any
12
* This library is distributed in the hope that it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this program; if not, write to the Free Software Foundation, Inc.,
19
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef GEIS_REGION_H_
22
#define GEIS_REGION_H_
24
#include "geis/geis.h"
29
* This is a refcounted object: using the internal function geis_region_ref()
30
* will increment the reference count on the object, and geis_region_delete()
31
* will decrement the reference count and destroy the object when the reference
32
* count is set to zero.
34
* If you are handed a GeisRegion and want to keep it around, you need to ref it
35
* and then delete it when you're done, otherwise it could disappear out from
38
* Because GeisRegion lifetime is affected explicitly by application action
39
* (new and delete calls are under application control), the refcount mechanism
40
* has been made threadsafe.
44
* Contains regions in no particular order, with no duplicate checking.
46
* @note This container is not threadsafe.
48
typedef struct _GeisRegionBag *GeisRegionBag;
51
* Creates a new region bag.
53
GeisRegionBag geis_region_bag_new();
56
* Destroys a region bag.
58
* @param[in] bag The region bag.
60
void geis_region_bag_delete(GeisRegionBag bag);
63
* Gets the number of regions held in a bag.
65
GeisSize geis_region_bag_count(GeisRegionBag bag);
68
* Gets an indicated region from a bag.
70
GeisRegion geis_region_bag_region(GeisRegionBag bag, GeisSize index);
73
* Puts a region into a bag.
75
GeisStatus geis_region_bag_insert(GeisRegionBag bag, GeisRegion region);
78
* Takes a region out of a bag.
80
GeisStatus geis_region_bag_remove(GeisRegionBag bag, GeisRegion region);
83
* Adds a reference to a region.
85
* @param[in] region A region.
87
void geis_region_ref(GeisRegion);
90
* Gets the type of the region.
92
* @param[in] region A region.
94
GeisString geis_region_type(GeisRegion region);
97
* Gets the data (if any) associated with the region type.
99
* @param[in] region A region.
101
void *geis_region_data(GeisRegion region);
103
#endif /* GEIS_REGION_H_ */