~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to libgeis/geis_region.h

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file geis_region.h
 
3
 * @brief internal Geis region module private interface
 
4
 *
 
5
 * Copyright 2010 Canonical Ltd.
 
6
 *
 
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
 
10
 * later version.
 
11
 *
 
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
 
15
 * details.
 
16
 *
 
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
 
20
 */
 
21
#ifndef GEIS_REGION_H_
 
22
#define GEIS_REGION_H_
 
23
 
 
24
#include "geis/geis.h"
 
25
 
 
26
/**
 
27
 * @struct _GeisRegion
 
28
 *
 
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.
 
33
 *
 
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
 
36
 * under you.
 
37
 *
 
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.
 
41
 */
 
42
 
 
43
/**
 
44
 * Contains regions in no particular order, with no duplicate checking.
 
45
 *
 
46
 * @note This container is not threadsafe.
 
47
 */
 
48
typedef struct _GeisRegionBag *GeisRegionBag;
 
49
 
 
50
/**
 
51
 * Creates a new region bag.
 
52
 */
 
53
GeisRegionBag geis_region_bag_new();
 
54
 
 
55
/**
 
56
 * Destroys a region bag.
 
57
 *
 
58
 * @param[in] bag  The region bag.
 
59
 */
 
60
void geis_region_bag_delete(GeisRegionBag bag);
 
61
 
 
62
/**
 
63
 * Gets the number of regions held in a bag.
 
64
 */
 
65
GeisSize geis_region_bag_count(GeisRegionBag bag);
 
66
 
 
67
/**
 
68
 * Gets an indicated region from a bag.
 
69
 */
 
70
GeisRegion geis_region_bag_region(GeisRegionBag bag, GeisSize index);
 
71
 
 
72
/**
 
73
 * Puts a region into a bag.
 
74
 */
 
75
GeisStatus geis_region_bag_insert(GeisRegionBag bag, GeisRegion region);
 
76
 
 
77
/**
 
78
 * Takes a region out of a bag.
 
79
 */
 
80
GeisStatus geis_region_bag_remove(GeisRegionBag bag, GeisRegion region);
 
81
 
 
82
/**
 
83
 * Adds a reference to a region.
 
84
 *
 
85
 * @param[in] region  A region.
 
86
 */
 
87
void geis_region_ref(GeisRegion);
 
88
 
 
89
/**
 
90
 * Gets the type of the region.
 
91
 *
 
92
 * @param[in] region  A region.
 
93
 */
 
94
GeisString geis_region_type(GeisRegion region);
 
95
 
 
96
/**
 
97
 * Gets the data (if any) associated with the region type.
 
98
 *
 
99
 * @param[in] region  A region.
 
100
 */
 
101
void *geis_region_data(GeisRegion region);
 
102
 
 
103
#endif /* GEIS_REGION_H_ */