GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 66.7% 2 / 0 / 3
Functions: 50.0% 1 / 0 / 2
Branches: 20.0% 2 / 0 / 10

shumate/shumate-location.h
Line Branch Exec Source
1 /*
2 * Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
3 * Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #if !defined (__SHUMATE_SHUMATE_H_INSIDE__) && !defined (SHUMATE_COMPILATION)
21 #error "Only <shumate/shumate.h> can be included directly."
22 #endif
23
24 #ifndef __SHUMATE_LOCATION_H__
25 #define __SHUMATE_LOCATION_H__
26
27 #include <glib-object.h>
28 #include <shumate/shumate-version.h>
29
30 G_BEGIN_DECLS
31
32 /**
33 * SHUMATE_MIN_LATITUDE: (value -85.0511287798)
34 *
35 * The minimal possible latitude value.
36 */
37 #define SHUMATE_MIN_LATITUDE (-85.0511287798)
38
39 /**
40 * SHUMATE_MAX_LATITUDE: (value 85.0511287798)
41 *
42 * The maximal possible latitude value.
43 */
44 #define SHUMATE_MAX_LATITUDE (85.0511287798)
45
46 /**
47 * SHUMATE_MIN_LONGITUDE: (value -180.0)
48 *
49 * The minimal possible longitude value.
50 */
51 #define SHUMATE_MIN_LONGITUDE (-180.0)
52
53 /**
54 * SHUMATE_MAX_LONGITUDE: (value 180.0)
55 *
56 * The maximal possible longitude value.
57 */
58 #define SHUMATE_MAX_LONGITUDE (180.0)
59
60 #define SHUMATE_TYPE_LOCATION (shumate_location_get_type ())
61
2/10
None:
✓ Branch 29 → 30 taken 2 times.
✗ Branch 29 → 31 not taken.
✓ Branch 31 → 32 taken 2 times.
✗ Branch 31 → 33 not taken.
SHUMATE_IS_LOCATION:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 7 not taken.
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 7 not taken.
42 G_DECLARE_INTERFACE (ShumateLocation, shumate_location, SHUMATE, LOCATION, GObject)
62
63 /**
64 * ShumateLocationInterface:
65 * @get_latitude: virtual function for obtaining latitude.
66 * @get_longitude: virtual function for obtaining longitude.
67 * @set_location: virtual function for setting position.
68 *
69 * An interface common to objects having latitude and longitude.
70 */
71 struct _ShumateLocationInterface
72 {
73 /*< private >*/
74 GTypeInterface g_iface;
75
76 /*< public >*/
77 double (*get_latitude)(ShumateLocation *location);
78 double (*get_longitude)(ShumateLocation *location);
79 void (*set_location)(ShumateLocation *location,
80 double latitude,
81 double longitude);
82 };
83
84 void shumate_location_set_location (ShumateLocation *location,
85 double latitude,
86 double longitude);
87 double shumate_location_get_latitude (ShumateLocation *location);
88 double shumate_location_get_longitude (ShumateLocation *location);
89 SHUMATE_AVAILABLE_IN_1_2
90 double shumate_location_distance (ShumateLocation *self, ShumateLocation *other);
91
92 G_END_DECLS
93
94 #endif /* __SHUMATE_LOCATION_H__ */
95