#include "grits.h"
+#include "plugins/env.h"
+#include "plugins/elev.h"
+#include "plugins/sat.h"
+#include "plugins/map.h"
+
GritsPrefs *prefs = NULL;
GritsPlugins *plugins = NULL;
GritsViewer *viewer = NULL;
+GList *manual = NULL;
/*************
* Callbacks *
if (shutdown) return TRUE;
shutdown = TRUE;
+ g_list_free_full(manual, g_object_unref);
grits_plugins_free(plugins);
g_object_unref(prefs);
gtk_widget_destroy(window);
if (config)
gtk_notebook_append_page(notebook, config, gtk_label_new(name));
}
+static void load_static_plugin(GritsPluginConstructor constructor,
+ GritsPlugins *plugins, gchar *name,
+ GritsViewer *viewer, GritsPrefs *prefs, GtkNotebook *notebook)
+{
+ GritsPlugin *plugin = constructor(viewer, prefs);
+ GtkWidget *config = grits_plugin_get_config(plugin);
+ if (config)
+ gtk_notebook_append_page(notebook, config, gtk_label_new(name));
+ manual = g_list_prepend(manual, plugin);
+}
/***********
* Methods *
/* Configurable stuff */
grits_viewer_set_offline(viewer, TRUE);
(void)load_plugin;
- load_plugin(plugins, "env", viewer, prefs, GTK_NOTEBOOK(config));
+ //load_plugin(plugins, "env", viewer, prefs, GTK_NOTEBOOK(config));
//load_plugin(plugins, "elev", viewer, prefs, GTK_NOTEBOOK(config));
//load_plugin(plugins, "sat", viewer, prefs, GTK_NOTEBOOK(config));
- load_plugin(plugins, "map", viewer, prefs, GTK_NOTEBOOK(config));
+ //load_plugin(plugins, "map", viewer, prefs, GTK_NOTEBOOK(config));
//load_plugin(plugins, "alert", viewer, prefs, GTK_NOTEBOOK(config));
//load_plugin(plugins, "radar", viewer, prefs, GTK_NOTEBOOK(config));
- load_plugin(plugins, "test", viewer, prefs, GTK_NOTEBOOK(config));
+ //load_plugin(plugins, "test", viewer, prefs, GTK_NOTEBOOK(config));
+
+ (void)load_static_plugin;
+ load_static_plugin((GritsPluginConstructor)grits_plugin_env_new,
+ plugins, "env", viewer, prefs, GTK_NOTEBOOK(config));
+ load_static_plugin((GritsPluginConstructor)grits_plugin_elev_new,
+ plugins, "elev", viewer, prefs, GTK_NOTEBOOK(config));
+ load_static_plugin((GritsPluginConstructor)grits_plugin_sat_new,
+ plugins, "sat", viewer, prefs, GTK_NOTEBOOK(config));
+ load_static_plugin((GritsPluginConstructor)grits_plugin_map_new,
+ plugins, "map", viewer, prefs, GTK_NOTEBOOK(config));
gtk_widget_show_all(config);
gtk_main();
prefs = NULL;
plugins = NULL;
viewer = NULL;
+ manual = NULL;
window = vbox = config = NULL;
return 0;
}