Branch data Line data Source code
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 : : 29 : : G_BEGIN_DECLS 30 : : 31 : : /** 32 : : * SHUMATE_MIN_LATITUDE: (value -85.0511287798) 33 : : * 34 : : * The minimal possible latitude value. 35 : : */ 36 : : #define SHUMATE_MIN_LATITUDE (-85.0511287798) 37 : : 38 : : /** 39 : : * SHUMATE_MAX_LATITUDE: (value 85.0511287798) 40 : : * 41 : : * The maximal possible latitude value. 42 : : */ 43 : : #define SHUMATE_MAX_LATITUDE (85.0511287798) 44 : : 45 : : /** 46 : : * SHUMATE_MIN_LONGITUDE: (value -180.0) 47 : : * 48 : : * The minimal possible longitude value. 49 : : */ 50 : : #define SHUMATE_MIN_LONGITUDE (-180.0) 51 : : 52 : : /** 53 : : * SHUMATE_MAX_LONGITUDE: (value 180.0) 54 : : * 55 : : * The maximal possible longitude value. 56 : : */ 57 : : #define SHUMATE_MAX_LONGITUDE (180.0) 58 : : 59 : : #define SHUMATE_TYPE_LOCATION (shumate_location_get_type ()) 60 [ + - + - : 63 : G_DECLARE_INTERFACE (ShumateLocation, shumate_location, SHUMATE, LOCATION, GObject) # # ] 61 : : 62 : : /** 63 : : * ShumateLocationInterface: 64 : : * @get_latitude: virtual function for obtaining latitude. 65 : : * @get_longitude: virtual function for obtaining longitude. 66 : : * @set_location: virtual function for setting position. 67 : : * 68 : : * An interface common to objects having latitude and longitude. 69 : : */ 70 : : struct _ShumateLocationInterface 71 : : { 72 : : /*< private >*/ 73 : : GTypeInterface g_iface; 74 : : 75 : : /*< public >*/ 76 : : double (*get_latitude)(ShumateLocation *location); 77 : : double (*get_longitude)(ShumateLocation *location); 78 : : void (*set_location)(ShumateLocation *location, 79 : : double latitude, 80 : : double longitude); 81 : : }; 82 : : 83 : : void shumate_location_set_location (ShumateLocation *location, 84 : : double latitude, 85 : : double longitude); 86 : : double shumate_location_get_latitude (ShumateLocation *location); 87 : : double shumate_location_get_longitude (ShumateLocation *location); 88 : : 89 : : double shumate_location_distance (ShumateLocation *self, ShumateLocation *other); 90 : : 91 : : G_END_DECLS 92 : : 93 : : #endif /* __SHUMATE_LOCATION_H__ */