35struct ModuleGenericCmp
39 int n1 = module1->get_sort_priority();
40 int n2 = module2->get_sort_priority();
43 return (strcmp(module1->get_name(), module2->get_name()) <= 0);
47struct ModuleInputCmp {
48 bool operator()(Input* module1, Input* module2)
const {
50 int n1 = module1->get_sort_priority();
51 int n2 = module2->get_sort_priority();
56 return (strcmp(module1->get_filetypename(), module2->get_filetypename()) <= 0);
61struct ModuleOutputCmp {
62 bool operator()(Output* module1, Output* module2)
const {
64 int n1 = module1->get_sort_priority();
65 int n2 = module2->get_sort_priority();
71 if (Glib::ustring(module1->get_extension()).lowercase() == Glib::ustring(module2->get_extension()).lowercase()) {
74 if (module1_is_script != module2_is_script) {
75 return module1_is_script ? false :
true;
78 return (strcmp(module1->get_filetypename(), module2->get_filetypename()) <= 0);
89 moduledict[
module->get_id()] = std::move(module);
103 if (
key ==
nullptr)
return nullptr;
112 if (!mod || mod->deactivated())
131 in_func(
item.second.get(), in_data);
144 if (
auto tmod =
dynamic_cast<Template *
>(in_plug)) {
146 tlist->push_back(tmod);
164 if (
auto imod =
dynamic_cast<Input *
>(in_plug)) {
166 ilist->push_back(imod);
184 if (
dynamic_cast<Output *
>(in_plug)) {
188 omod =
dynamic_cast<Output *
>(in_plug);
191 olist->push_back(omod);
210 if (
dynamic_cast<Effect *
>(in_plug)) {
214 emod =
dynamic_cast<Effect *
>(in_plug);
217 elist->push_back(emod);
231 ou_list.sort(ModuleGenericCmp());
245 ou_list.sort( ModuleInputCmp() );
259 ou_list.sort( ModuleOutputCmp() );
267 std::vector<Effect*> out;
269 auto ex =
item.second.get();
270 if (
auto effect =
dynamic_cast<Effect*
>(ex)) {
271 out.push_back(effect);
std::list< Output * > OutputList
std::list< Effect * > EffectList
static void output_internal(Extension *in_plug, gpointer data)
The function to look at each module and see if it is an output module, then add it to the list.
void foreach(void(*in_func)(Extension *in_plug, gpointer in_data), gpointer in_data)
A function to execute another function with every entry in the database as a parameter.
void take_ownership(std::unique_ptr< Extension > module)
Take the ownership of an extension to ensure that it is freed on program exit.
std::vector< Effect * > get_effect_list()
Creates a list of all the Effect extensions.
OutputList & get_output_list(OutputList &ou_list)
Creates a list of all the Output extensions.
TemplateList & get_template_list(TemplateList &ou_list)
Create a list of all the Template extensions.
std::unordered_map< std::string, std::unique_ptr< Extension > > moduledict
This is the actual database.
std::list< Input * > InputList
static void effect_internal(Extension *in_plug, gpointer data)
The function to look at each module and see if it is an effect module, then add it to the list.
std::list< Template * > TemplateList
Extension * get(const gchar *key) const
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a ref...
InputList & get_input_list(InputList &ou_list)
Creates a list of all the Input extensions.
static void input_internal(Extension *in_plug, gpointer data)
The function to look at each module and see if it is an input module, then add it to the list.
static void template_internal(Extension *in_plug, gpointer data)
The function to look at each module and see if it is a template module, then add it to the list.
Effects are extensions that take a document and do something to it in place.
The object that is the basis for the Extension system.
Utility class used for loading and launching script extensions.
DB db
This is the actual database object.
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key