]> git.street.me.uk Git - andy/viking.git/blame - src/vikwindow.h
[QA] Shift Gtk dependent utility functions into separate file.
[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);
1b14d0d2 66const gchar *vik_window_get_filename(VikWindow *vw);
39ae014f
RN
67
68void vik_window_statusbar_update (VikWindow *vw, const gchar* message, vik_statusbar_type_t vs_type);
c06a63ad 69
c9177aae 70void vik_window_set_redraw_trigger(struct _VikLayer *vl);
50a14534 71
8fb71d6c 72void vik_window_enable_layer_tool ( VikWindow *vw, gint layer_id, gint tool_id );
bce3a7b0 73
9d7c24ed
RN
74gpointer vik_window_get_selected_trw_layer ( VikWindow *vw ); /* return type VikTrwLayer */
75void vik_window_set_selected_trw_layer ( VikWindow *vw, gpointer vtl ); /* input VikTrwLayer */
1c70a947
RN
76GHashTable *vik_window_get_selected_tracks ( VikWindow *vw );
77void vik_window_set_selected_tracks ( VikWindow *vw, GHashTable *ght, gpointer vtl ); /* gpointer is a VikTrwLayer */
9d7c24ed 78gpointer vik_window_get_selected_track ( VikWindow *vw ); /* return type VikTrack */
1c70a947
RN
79void vik_window_set_selected_track ( VikWindow *vw, gpointer *vt, gpointer vtl ); /* gpointer is a VikTrwLayer */
80GHashTable *vik_window_get_selected_waypoints ( VikWindow *vw );
81void vik_window_set_selected_waypoints ( VikWindow *vw, GHashTable *ght, gpointer vtl ); /* gpointer is a VikTrwLayer */
9d7c24ed 82gpointer vik_window_get_selected_waypoint ( VikWindow *vw ); /* return type VikWaypoint */
b16effab 83void vik_window_set_selected_waypoint ( VikWindow *vw, gpointer *vwp, gpointer vtl ); /* input VikWaypoint, VikTrwLayer */
113c74f6
RN
84/* Return the VikTrwLayer of the selected track(s) or waypoint(s) are in (maybe NULL) */
85gpointer vik_window_get_containing_trw_layer ( VikWindow *vw );
9d7c24ed
RN
86/* return indicates if a redraw is necessary */
87gboolean vik_window_clear_highlight ( VikWindow *vw );
88
fa51adec
RN
89GThread *vik_window_get_thread ( VikWindow *vw );
90
55d3a53c
RN
91void vik_window_set_busy_cursor ( VikWindow *vw );
92void vik_window_clear_busy_cursor ( VikWindow *vw );
93
08f14055
RN
94typedef struct {
95 VikWindow *vw;
96 VikViewport *vvp;
97 gpointer *vtl; // VikTrwlayer
98 gboolean holding;
99 gboolean is_waypoint; // otherwise a track
100 GdkGC *gc;
101 int oldx, oldy;
102} tool_ed_t;
103
50a14534
EB
104G_END_DECLS
105
24277274
GB
106#define VIK_WINDOW_FROM_WIDGET(x) VIK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x)))
107
50a14534 108#endif