X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fplugins%2Ftest.c;h=92b588681e263803a515ab2ac843bb0502d3abb3;hp=49939389ceb2a8b5b2abb2a962e001312ef51bd5;hb=aa51def2e3da1a15677bc8a3a85098a7c9a57577;hpb=b87064909e6d20e1ee2995adae0c1ce5cb692d7e diff --git a/src/plugins/test.c b/src/plugins/test.c index 4993938..92b5886 100644 --- a/src/plugins/test.c +++ b/src/plugins/test.c @@ -15,6 +15,14 @@ * along with this program. If not, see . */ +/** + * SECTION:test + * @short_description: Testing plugin + * + * #GisPluginTest is a testing plugin used during development and as an example + * for how to create a plugin. + */ + #include #include #include @@ -26,17 +34,29 @@ /*********** * Methods * ***********/ +gboolean _load_marker(gpointer _test) +{ + GisPluginTest *test = _test; + GisMarker *marker = gis_marker_new("St. Charles"); + gis_point_set_lle(gis_object_center(marker), 38.841847, -90.491982, 0); + GIS_OBJECT(marker)->lod = EARTH_R; + test->marker = gis_viewer_add(test->viewer, GIS_OBJECT(marker), GIS_LEVEL_OVERLAY, 0); + return FALSE; +} +/** + * gis_plugin_test_new: + * @viewer: the #GisViewer to use for drawing + * + * Create a new instance of the testing plugin. + * + * Returns: the new #GisPluginTest + */ GisPluginTest *gis_plugin_test_new(GisViewer *viewer) { g_debug("GisPluginTest: new"); GisPluginTest *test = g_object_new(GIS_TYPE_PLUGIN_TEST, NULL); test->viewer = g_object_ref(viewer); - - GisMarker *marker = gis_marker_new("St. Charles"); - gis_point_set_lle(gis_object_center(marker), 38.841847, -90.491982, 0); - GIS_OBJECT(marker)->lod = EARTH_R/4; - test->marker = gis_viewer_add(test->viewer, GIS_OBJECT(marker), GIS_LEVEL_OVERLAY, 0); - + g_idle_add(_load_marker, test); return test; }