]> err.no Git - mapper/blob - src/gtkgps.h
Add header and cast properly.
[mapper] / src / gtkgps.h
1 /*
2  *
3  * GtkGps: Display GPS satellite information
4  * Copyright (C) 2007 Kaj-Michael Lang
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 #ifndef __GTK_GPS_H__
21 #define __GTK_GPS_H__
22
23 #include <gtk/gtk.h>
24 #include "gpsdata.h"
25
26 G_BEGIN_DECLS
27
28 #define GTK_GPS_TYPE                    (gtk_gps_get_type ())
29 #define GTK_GPS(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_GPS_TYPE, GtkGps))
30 #define GTK_GPS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_GPS_TYPE, GtkGpsClass))
31 #define GTK_IS_GPS(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_GPS_TYPE))
32
33 typedef struct _GtkGps                  GtkGps;
34 typedef struct _GtkGpsClass             GtkGpsClass;
35
36 typedef enum {
37         GTK_GPS_MODE_SKY,
38         GTK_GPS_MODE_SIGNAL,
39         GTK_GPS_MODE_COMBINED,
40 } GtkGpsMode;
41
42 struct _GtkGps {
43         GtkDrawingArea widget;
44         GdkGC *gc1;
45         GdkGC *gc_s;
46         GdkGC *gc_sf;
47         GdkGC *gc_w;
48         gint width, height;
49         gint size;
50         gint fs;
51         GtkGpsMode display_mode;
52
53         PangoContext *context;
54         PangoLayout *layout;
55         PangoFontDescription *fontdesc;
56
57         GpsData *data;
58         gint esid;
59 };
60
61 struct _GtkGpsClass {
62         GtkWidgetClass parent_class;
63 };
64
65 GType gtk_gps_get_type(void);
66 GtkWidget* gtk_gps_new(GtkGpsMode display_mode, GpsData *data);
67 void gtk_gps_refresh(GtkWidget *widget);
68
69 G_END_DECLS
70
71 #endif /* __GTK_GPS_H__ */