]> git.street.me.uk Git - andy/viking.git/blame - src/vikwindow.h
Enable widget sensitivity in the layer properties to be controlled.
[andy/viking.git] / src / vikwindow.h
CommitLineData
50a14534
EB
1/*
2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
3 *
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef _VIKING_VIKWINDOW_H
23#define _VIKING_VIKWINDOW_H
24/* Requires <gtk/gtk.h> or glib, and coords.h*/
25
26#include <glib.h>
27#include <glib-object.h>
d156fff5 28#include <gtk/gtk.h>
50a14534 29
7bc965c0 30#include "vikviewport.h"
c06a63ad 31#include "vikstatus.h"
7bc965c0 32
50a14534
EB
33G_BEGIN_DECLS
34
35#define VIK_WINDOW_TYPE (vik_window_get_type ())
36#define VIK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_WINDOW_TYPE, VikWindow))
37#define VIK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_WINDOW_TYPE, VikWindowClass))
38#define IS_VIK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_WINDOW_TYPE))
39#define IS_VIK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_WINDOW_TYPE))
40
41typedef struct _VikWindow VikWindow;
42typedef struct _VikWindowClass VikWindowClass;
43
44struct _VikWindowClass
45{
46 GtkWindowClass window_class;
47 void (* newwindow) (VikWindow *vw);
60922e05 48 void (* openwindow) (VikWindow *vw, GSList *filenames);
50a14534
EB
49};
50
51GType vik_window_get_type ();
52
8a13dbd2
RN
53// To call from main to start things off:
54VikWindow *vik_window_new_window ();
55
8fa25c61
RN
56void vik_window_new_window_finish ( VikWindow *vw );
57
7bc965c0 58GtkWidget *vik_window_get_drawmode_button ( VikWindow *vw, VikViewportDrawMode mode );
1c6a6010 59gboolean vik_window_get_pan_move ( VikWindow *vw );
50a14534 60void vik_window_open_file ( VikWindow *vw, const gchar *filename, gboolean changefilename );
369e959a
QT
61struct _VikLayer;
62void vik_window_selected_layer(VikWindow *vw, struct _VikLayer *vl);
014128f6 63struct _VikViewport * vik_window_viewport(VikWindow *vw);
55477ce6 64struct _VikLayersPanel * vik_window_layers_panel(VikWindow *vw);
c06a63ad 65struct _VikStatusbar * vik_window_get_statusbar(VikWindow *vw);
39ae014f
RN
66
67void vik_window_statusbar_update (VikWindow *vw, const gchar* message, vik_statusbar_type_t vs_type);
c06a63ad 68
c9177aae 69void vik_window_set_redraw_trigger(struct _VikLayer *vl);
50a14534 70
8fb71d6c 71void vik_window_enable_layer_tool ( VikWindow *vw, gint layer_id, gint tool_id );
bce3a7b0 72
9d7c24ed
RN
73gpointer vik_window_get_selected_trw_layer ( VikWindow *vw ); /* return type VikTrwLayer */
74void vik_window_set_selected_trw_layer ( VikWindow *vw, gpointer vtl ); /* input VikTrwLayer */
1c70a947
RN
75GHashTable *vik_window_get_selected_tracks ( VikWindow *vw );
76void vik_window_set_selected_tracks ( VikWindow *vw, GHashTable *ght, gpointer vtl ); /* gpointer is a VikTrwLayer */
9d7c24ed 77gpointer vik_window_get_selected_track ( VikWindow *vw ); /* return type VikTrack */
1c70a947
RN
78void vik_window_set_selected_track ( VikWindow *vw, gpointer *vt, gpointer vtl ); /* gpointer is a VikTrwLayer */
79GHashTable *vik_window_get_selected_waypoints ( VikWindow *vw );
80void vik_window_set_selected_waypoints ( VikWindow *vw, GHashTable *ght, gpointer vtl ); /* gpointer is a VikTrwLayer */
9d7c24ed 81gpointer vik_window_get_selected_waypoint ( VikWindow *vw ); /* return type VikWaypoint */
b16effab 82void vik_window_set_selected_waypoint ( VikWindow *vw, gpointer *vwp, gpointer vtl ); /* input VikWaypoint, VikTrwLayer */
113c74f6
RN
83/* Return the VikTrwLayer of the selected track(s) or waypoint(s) are in (maybe NULL) */
84gpointer vik_window_get_containing_trw_layer ( VikWindow *vw );
9d7c24ed
RN
85/* return indicates if a redraw is necessary */
86gboolean vik_window_clear_highlight ( VikWindow *vw );
87
fa51adec
RN
88GThread *vik_window_get_thread ( VikWindow *vw );
89
55d3a53c
RN
90void vik_window_set_busy_cursor ( VikWindow *vw );
91void vik_window_clear_busy_cursor ( VikWindow *vw );
92
08f14055
RN
93typedef struct {
94 VikWindow *vw;
95 VikViewport *vvp;
96 gpointer *vtl; // VikTrwlayer
97 gboolean holding;
98 gboolean is_waypoint; // otherwise a track
99 GdkGC *gc;
100 int oldx, oldy;
101} tool_ed_t;
102
50a14534
EB
103G_END_DECLS
104
24277274
GB
105#define VIK_WINDOW_FROM_WIDGET(x) VIK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x)))
106
50a14534 107#endif