/** \brief A function to automatically generate a GUI using the parameters \return Generated widget This function just goes through each parameter, and calls it's 'get_widget' function to get each widget. Then, each of those is placed into a Gtk::VBox, which is then returned to the calling function. If there are no visible parameters, this function just returns NULL. If all parameters are gui_visible = false NULL is returned as well. */ Gtk::Widget * Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal) { if (!_gui || param_visible_count() == 0) return NULL; AutoGUI * agui = Gtk::manage(new AutoGUI()); //go through the list of parameters to see if there are any non-hidden ones for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) { Parameter * param = reinterpret_cast<Parameter *>(list->data); if (param->get_gui_hidden()) continue; //Ignore hidden parameters Gtk::Widget * widg = param->get_widget(doc, node, changeSignal); gchar const * tip = param->get_tooltip(); agui->addWidget(widg, tip); } agui->show(); return agui; };
bool Effect::prefs (Inkscape::UI::View::View * doc) { if (_prefDialog != NULL) { _prefDialog->raise(); return true; } if (param_visible_count() == 0) { effect(doc); return true; } if (!loaded()) set_state(Extension::STATE_LOADED); if (!loaded()) return false; _prefDialog = new PrefDialog(this->get_name(), this->get_help(), NULL, this); _prefDialog->show(); return true; }