DisplayPlugin *display_plugin_create (const char *path) { DisplayPlugin *display_plugin; if (!path) { error (InvalidArgument); return NULL; } if (!(display_plugin = memory_create (sizeof (DisplayPlugin)))) { error_code (FunctionCall, 1); return NULL; } if (!(display_plugin->plugin = plugin_create (path))) { memory_destroy (display_plugin); error_code (FunctionCall, 2); return NULL; } if (!(plugin_set_function (display_plugin->plugin, (void **)&display_plugin->display_canvas, "display_canvas"))) { plugin_destroy (display_plugin->plugin); memory_destroy (display_plugin); error_code (FunctionCall, 3); return NULL; } if (!display_plugin->plugin->load ()) { plugin_destroy (display_plugin->plugin); memory_destroy (display_plugin); error_code (FunctionCall, 4); return NULL; } return display_plugin; }
void sched_plugin_unload (struct sched_plugin_loader *sploader) { if (sploader->plugin) { plugin_destroy (sploader->plugin); sploader->plugin = NULL; } }
void display_plugin_destroy (DisplayPlugin *display_plugin) { if (!display_plugin) { error (InvalidArgument); return; } display_plugin->plugin->unload (); plugin_destroy (display_plugin->plugin); memory_destroy (display_plugin); }
GtkWidget * create_dspdesc_window(ggobid *gg, PluginInstance *inst) { GtkWidget *window, *hb, *label, *entry; GtkTooltips *tips = gtk_tooltips_new (); dspdescd *desc = dspdescFromInst (inst); window = gtk_file_chooser_dialog_new("Save display description", NULL, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, GTK_STOCK_CLOSE, GTK_RESPONSE_REJECT, NULL); desc->window = window; /* label and entry widget for main title */ hb = gtk_hbox_new (false, 1); label = gtk_label_new_with_mnemonic ("Figure _title: "); gtk_box_pack_start (GTK_BOX (hb), label, false, false, 2); entry = gtk_entry_new (); gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); g_object_set_data(G_OBJECT(window), "TITLE", entry); gtk_tooltips_set_tip (GTK_TOOLTIPS (tips), entry, "Type in the figure title", NULL); gtk_box_pack_start (GTK_BOX (hb), entry, true, true, 2); gtk_widget_show_all(hb); gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(window), hb); if (gtk_dialog_run(GTK_DIALOG(window)) == GTK_RESPONSE_ACCEPT) desc_write(inst); plugin_destroy(inst); return(window); }
void closeWindow(ggobid *gg, GGobiPluginInfo *plugin, PluginInstance *inst) { plugin_destroy(inst); }
void close_dspdesc_window(GtkWidget *w, PluginInstance *inst) { plugin_destroy(inst); }
/* ------------------------------------------------------------------------- */ PLUGIN_MENU_PUBLIC_API PLUGIN_DEINIT() { plugin_destroy(get_global(game)->plugin); glob_destroy(game); }