X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fgis_test.c;h=efd9218d0f3613f8ae05774315ff9b01d0fd83db;hb=bc5aa14663ac94d7feae1600db18bac3fbbea1a0;hp=d587936a4a82f92833ab372d8e7566dff5a1cafe;hpb=d836e9913e3fa991c935a8e7d5064f9adb51e191;p=grits diff --git a/src/gis_test.c b/src/gis_test.c index d587936..efd9218 100644 --- a/src/gis_test.c +++ b/src/gis_test.c @@ -1,16 +1,16 @@ /* * Copyright (C) 2009 Andy Spencer - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -26,7 +26,7 @@ *************/ static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer _) { - g_debug("gis: on_key_press - key=%x, state=%x", + g_debug("GisTest: on_key_press - key=%x, state=%x", event->keyval, event->state); switch (event->keyval) { case GDK_q: @@ -41,8 +41,9 @@ static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer _) ***********/ int main(int argc, char **argv) { - gtk_init(&argc, &argv); g_thread_init(NULL); + gdk_threads_init(); + gtk_init(&argc, &argv); GisPrefs *prefs = gis_prefs_new(NULL, NULL); GisPlugins *plugins = gis_plugins_new(NULL); @@ -50,17 +51,20 @@ int main(int argc, char **argv) GisView *view = gis_view_new(); GisOpenGL *opengl = gis_opengl_new(world, view, plugins); - //gis_plugins_load(plugins, "radar", world, view, opengl, prefs); - //gis_plugins_load(plugins, "ridge", world, view, opengl, prefs); - //gis_plugins_load(plugins, "example", world, view, opengl, prefs); - + gdk_threads_enter(); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(window, "key-press-event", G_CALLBACK(on_key_press), NULL); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(opengl)); gtk_widget_show_all(window); + gdk_threads_leave(); + + gis_plugins_load(plugins, "bmng", world, view, opengl, prefs); + gis_plugins_load(plugins, "srtm", world, view, opengl, prefs); gis_view_set_site(view, "KLSX"); + + gdk_threads_enter(); gtk_main(); g_object_unref(prefs); @@ -68,5 +72,6 @@ int main(int argc, char **argv) g_object_unref(view); g_object_unref(opengl); gis_plugins_free(plugins); + gdk_threads_leave(); return 0; }