1
/*
2
 * Copyright (C) 2009 Simon Wenner <simon@wenner.ch>
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; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
18
19
#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
20
#error "Only <champlain/champlain.h> can be included directly."
21
#endif
22
23
#ifndef CHAMPLAIN_BOUNDING_BOX_H
24
#define CHAMPLAIN_BOUNDING_BOX_H
25
26
#include <glib-object.h>
27
28
G_BEGIN_DECLS
29
30
typedef struct _ChamplainBoundingBox ChamplainBoundingBox;
31
32
#define CHAMPLAIN_BOUNDING_BOX(obj) ((ChamplainBoundingBox *) (obj))
33
34
/**
35
 * ChamplainBoundingBox:
36
 * @left: left coordinate
37
 * @top: top coordinate
38
 * @right: right coordinate
39
 * @bottom: bottom coordinate
40
 *
41
 * Defines the area of a ChamplainMapDataSource that contains data.
42
 *
43
 * Since: 0.6
44
 */
45
struct _ChamplainBoundingBox
46
{
47
  /*< public >*/
48
  gdouble left;
49
  gdouble top;
50
  gdouble right;
51
  gdouble bottom;
52
};
53
54
GType champlain_bounding_box_get_type (void) G_GNUC_CONST;
55
#define CHAMPLAIN_TYPE_BOUNDING_BOX (champlain_bounding_box_get_type ())
56
57
ChamplainBoundingBox *champlain_bounding_box_new (void);
58
59
ChamplainBoundingBox *champlain_bounding_box_copy (const ChamplainBoundingBox *bbox);
60
61
void champlain_bounding_box_free (ChamplainBoundingBox *bbox);
62
63
void champlain_bounding_box_get_center (ChamplainBoundingBox *bbox,
64
    gdouble *latitude,
65
    gdouble *longitude);
66
67
void champlain_bounding_box_compose (ChamplainBoundingBox *bbox,
68
    ChamplainBoundingBox *other);
69
70
void champlain_bounding_box_extend (ChamplainBoundingBox *bbox,
71
    gdouble latitude,
72
    gdouble longitude);
73
74
gboolean champlain_bounding_box_is_valid (ChamplainBoundingBox *bbox);
75
76
G_END_DECLS
77
78
#endif