]>
Commit | Line | Data |
---|---|---|
50a14534 EB |
1 | /* |
2 | * viking -- GPS Data and Topo Analyzer, Explorer, and Manager | |
3 | * | |
4 | * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net> | |
a7cd93ac | 5 | * Copyright (c) 2011, Rob Norris <rw_norris@hotmail.com> |
50a14534 EB |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | * | |
21 | */ | |
22 | ||
23 | #ifndef _VIKING_TRWLAYER_H | |
24 | #define _VIKING_TRWLAYER_H | |
25 | ||
a25c4c50 GB |
26 | #include "viklayer.h" |
27 | #include "vikviewport.h" | |
28 | #include "vikwaypoint.h" | |
29 | #include "viktrack.h" | |
073ede8c | 30 | #include "viklayerspanel.h" |
a25c4c50 | 31 | |
722b5481 RN |
32 | G_BEGIN_DECLS |
33 | ||
50a14534 EB |
34 | #define VIK_TRW_LAYER_TYPE (vik_trw_layer_get_type ()) |
35 | #define VIK_TRW_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TRW_LAYER_TYPE, VikTrwLayer)) | |
36 | #define VIK_TRW_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TRW_LAYER_TYPE, VikTrwLayerClass)) | |
37 | #define IS_VIK_TRW_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TRW_LAYER_TYPE)) | |
38 | #define IS_VIK_TRW_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TRW_LAYER_TYPE)) | |
39 | ||
9748531a RN |
40 | enum { |
41 | VIK_TRW_LAYER_SUBLAYER_TRACKS, | |
42 | VIK_TRW_LAYER_SUBLAYER_WAYPOINTS, | |
43 | VIK_TRW_LAYER_SUBLAYER_TRACK, | |
0d2b891f RN |
44 | VIK_TRW_LAYER_SUBLAYER_WAYPOINT, |
45 | VIK_TRW_LAYER_SUBLAYER_ROUTES, | |
46 | VIK_TRW_LAYER_SUBLAYER_ROUTE | |
9748531a RN |
47 | }; |
48 | ||
50a14534 EB |
49 | typedef struct _VikTrwLayerClass VikTrwLayerClass; |
50 | struct _VikTrwLayerClass | |
51 | { | |
52 | VikLayerClass object_class; | |
53 | }; | |
54 | ||
55 | ||
56 | GType vik_trw_layer_get_type (); | |
57 | ||
58 | typedef struct _VikTrwLayer VikTrwLayer; | |
59 | ||
805d282e EB |
60 | /* These are meant for use in file loaders (gpspoint.c, gpx.c, etc). |
61 | * These copy the name, so you should free it if necessary. */ | |
62 | void vik_trw_layer_filein_add_waypoint ( VikTrwLayer *vtl, gchar *name, VikWaypoint *wp ); | |
63 | void vik_trw_layer_filein_add_track ( VikTrwLayer *vtl, gchar *name, VikTrack *tr ); | |
64 | ||
04f36d92 RN |
65 | gint vik_trw_layer_get_property_tracks_line_thickness ( VikTrwLayer *vtl ); |
66 | ||
50a14534 EB |
67 | void vik_trw_layer_add_waypoint ( VikTrwLayer *vtl, gchar *name, VikWaypoint *wp ); |
68 | void vik_trw_layer_add_track ( VikTrwLayer *vtl, gchar *name, VikTrack *t ); | |
0d2b891f | 69 | void vik_trw_layer_add_route ( VikTrwLayer *vtl, gchar *name, VikTrack *t ); |
c9570f86 | 70 | |
5c3dea7a RN |
71 | // Waypoint returned is the first one |
72 | VikWaypoint *vik_trw_layer_get_waypoint ( VikTrwLayer *vtl, const gchar *name ); | |
73 | ||
ce4bd1cf | 74 | // Track returned is the first one |
f7f8a0a6 | 75 | VikTrack *vik_trw_layer_get_track ( VikTrwLayer *vtl, const gchar *name ); |
ce4bd1cf | 76 | gboolean vik_trw_layer_delete_track ( VikTrwLayer *vtl, VikTrack *trk ); |
0d2b891f | 77 | gboolean vik_trw_layer_delete_route ( VikTrwLayer *vtl, VikTrack *trk ); |
50a14534 | 78 | |
c5638216 | 79 | gboolean vik_trw_layer_auto_set_view ( VikTrwLayer *vtl, VikViewport *vvp ); |
50a14534 EB |
80 | gboolean vik_trw_layer_find_center ( VikTrwLayer *vtl, VikCoord *dest ); |
81 | GHashTable *vik_trw_layer_get_tracks ( VikTrwLayer *l ); | |
0d2b891f | 82 | GHashTable *vik_trw_layer_get_routes ( VikTrwLayer *l ); |
50a14534 | 83 | GHashTable *vik_trw_layer_get_waypoints ( VikTrwLayer *l ); |
bec82ff5 RN |
84 | gboolean vik_trw_layer_is_empty ( VikTrwLayer *vtl ); |
85 | ||
50a14534 EB |
86 | gboolean vik_trw_layer_new_waypoint ( VikTrwLayer *vtl, GtkWindow *w, const VikCoord *def_coord ); |
87 | ||
88 | VikCoordMode vik_trw_layer_get_coord_mode ( VikTrwLayer *vtl ); | |
89 | ||
073ede8c RN |
90 | gboolean vik_trw_layer_uniquify ( VikTrwLayer *vtl, VikLayersPanel *vlp ); |
91 | ||
700b0908 | 92 | void vik_trw_layer_delete_all_waypoints ( VikTrwLayer *vtl ); |
7bb60307 | 93 | void vik_trw_layer_delete_all_tracks ( VikTrwLayer *vtl ); |
0d2b891f | 94 | void vik_trw_layer_delete_all_routes ( VikTrwLayer *vtl ); |
ce4bd1cf | 95 | void trw_layer_cancel_tps_of_track ( VikTrwLayer *vtl, VikTrack *trk ); |
50a14534 | 96 | |
b3eb3b98 RN |
97 | /* Exposed Layer Interface function definitions */ |
98 | // Intended only for use by other trw_layer subwindows | |
99 | void trw_layer_verify_thumbnails ( VikTrwLayer *vtl, GtkWidget *vp ); | |
9748531a RN |
100 | // Other functions only for use by other trw_layer subwindows |
101 | gchar *trw_layer_new_unique_sublayer_name ( VikTrwLayer *vtl, gint sublayer_type, const gchar *name ); | |
b3eb3b98 | 102 | |
b1453c16 RN |
103 | void trw_layer_update_treeview ( VikTrwLayer *vtl, VikTrack *trk, gpointer *trk_id ); |
104 | ||
722b5481 RN |
105 | G_END_DECLS |
106 | ||
50a14534 | 107 | #endif |