2 * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <gdk/gdkkeysyms.h>
27 static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer _)
29 g_debug("gis: on_key_press - key=%x, state=%x",
30 event->keyval, event->state);
31 switch (event->keyval) {
33 gtk_widget_destroy(widget);
42 int main(int argc, char **argv)
44 gtk_init(&argc, &argv);
47 GisPrefs *prefs = gis_prefs_new("aweather");
48 GisPlugins *plugins = gis_plugins_new();
49 GisWorld *world = gis_world_new();
50 GisView *view = gis_view_new();
51 GisOpenGL *opengl = gis_opengl_new(world, view, plugins);
53 //gis_plugins_load(plugins, "radar", world, view, opengl, prefs);
54 //gis_plugins_load(plugins, "ridge", world, view, opengl, prefs);
55 //gis_plugins_load(plugins, "example", world, view, opengl, prefs);
57 GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
58 g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
59 g_signal_connect(window, "key-press-event", G_CALLBACK(on_key_press), NULL);
60 gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(opengl));
61 gtk_widget_show_all(window);
63 gis_view_set_site(view, "KLSX");
66 g_object_unref(prefs);
67 g_object_unref(world);
69 g_object_unref(opengl);
70 gis_plugins_free(plugins);