2 * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
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/>.
18 #include <gtk/gtkgl.h>
29 GisPluginTest *gis_plugin_test_new(GisViewer *viewer)
31 g_debug("GisPluginTest: new");
32 GisPluginTest *test = g_object_new(GIS_TYPE_PLUGIN_TEST, NULL);
33 test->viewer = g_object_ref(viewer);
35 GisMarker *marker = gis_marker_new("St. Charles");
36 gis_point_set_lle(gis_object_center(marker), 38.841847, -90.491982, 0);
37 GIS_OBJECT(marker)->lod = EARTH_R/4;
38 test->marker = gis_viewer_add(test->viewer, GIS_OBJECT(marker), GIS_LEVEL_OVERLAY, 0);
48 static void gis_plugin_test_plugin_init(GisPluginInterface *iface);
49 G_DEFINE_TYPE_WITH_CODE(GisPluginTest, gis_plugin_test, G_TYPE_OBJECT,
50 G_IMPLEMENT_INTERFACE(GIS_TYPE_PLUGIN,
51 gis_plugin_test_plugin_init));
52 static void gis_plugin_test_plugin_init(GisPluginInterface *iface)
54 g_debug("GisPluginTest: plugin_init");
55 /* Add methods to the interface */
57 /* Class/Object init */
58 static void gis_plugin_test_init(GisPluginTest *test)
60 g_debug("GisPluginTest: init");
62 static void gis_plugin_test_dispose(GObject *_test)
64 g_debug("GisPluginTest: dispose");
65 GisPluginTest *test = GIS_PLUGIN_TEST(_test);
67 gis_viewer_remove(test->viewer, test->marker);
68 g_object_unref(test->viewer);
71 G_OBJECT_CLASS(gis_plugin_test_parent_class)->finalize(_test);
73 static void gis_plugin_test_class_init(GisPluginTestClass *klass)
75 g_debug("GisPluginTest: class_init");
76 GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
77 gobject_class->dispose = gis_plugin_test_dispose;