Inkscape
Vector Graphics Editor
|
#include <db.h>
Public Types | |
typedef std::list< Template * > | TemplateList |
typedef std::list< Output * > | OutputList |
typedef std::list< Input * > | InputList |
typedef std::list< Effect * > | EffectList |
Public Member Functions | |
DB ()=default | |
DB (DB &&)=delete | |
DB & | operator= (DB &&)=delete |
Extension * | get (const gchar *key) const |
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a reference to that module. | |
void | take_ownership (std::unique_ptr< Extension > module) |
Take the ownership of an extension to ensure that it is freed on program exit. | |
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. | |
TemplateList & | get_template_list (TemplateList &ou_list) |
Create a list of all the Template extensions. | |
InputList & | get_input_list (InputList &ou_list) |
Creates a list of all the Input extensions. | |
OutputList & | get_output_list (OutputList &ou_list) |
Creates a list of all the Output extensions. | |
std::vector< Effect * > | get_effect_list () |
Creates a list of all the Effect extensions. | |
Static Private Member Functions | |
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. | |
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 | 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. | |
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. | |
Private Attributes | |
std::unordered_map< std::string, std::unique_ptr< Extension > > | moduledict |
This is the actual database. | |
typedef std::list<Effect *> Inkscape::Extension::DB::EffectList |
typedef std::list<Input *> Inkscape::Extension::DB::InputList |
typedef std::list<Output *> Inkscape::Extension::DB::OutputList |
typedef std::list<Template *> Inkscape::Extension::DB::TemplateList |
|
default |
|
delete |
|
staticprivate |
The function to look at each module and see if it is an effect module, then add it to the list.
in_plug | Module to be examined |
data | The list to be attached to |
The first thing that is checked is if this module is an effect module. If it is, then it is added to the list which is passed in through data
.
Definition at line 208 of file db.cpp.
References data.
void Inkscape::Extension::DB::foreach | ( | void(*)(Extension *in_plug, gpointer in_data) | in_func, |
gpointer | in_data | ||
) |
A function to execute another function with every entry in the database as a parameter.
in_func | The function to execute for every module |
in_data | A data pointer that is also passed to in_func |
Enumerates the modules currently in the database, calling a given callback for each one.
Definition at line 128 of file db.cpp.
References item, and moduledict.
Referenced by Inkscape::Extension::check_extensions().
Extension * Inkscape::Extension::DB::get | ( | const gchar * | key | ) | const |
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a reference to that module.
key | The unique ID of the module |
Retrieves a module by name or nullptr if not found.
Definition at line 101 of file db.cpp.
References key, and moduledict.
Referenced by Inkscape::Extension::Dependency::check(), Inkscape::Extension::Internal::Emf::check(), Inkscape::Extension::Internal::LatexOutput::check(), Inkscape::Extension::Internal::PdfOutput::check(), Inkscape::Extension::Internal::Wmf::check(), InkFileExportCmd::do_export(), InkFileExportCmd::do_export_svg(), Inkscape::Extension::get_print(), Inkscape::UI::Dialog::ExtensionList::getExtension(), Inkscape::Extension::open(), Inkscape::Extension::PathEffect::processPathEffects(), Inkscape::Extension::save(), Inkscape::Extension::Internal::Emf::save(), Inkscape::Extension::Internal::Wmf::save(), Inkscape::Extension::Internal::CairoPsOutput::save(), Inkscape::Extension::Internal::CairoRendererPdfOutput::save(), Inkscape::Extension::Internal::CairoEpsOutput::save(), and sp_file_save_dialog().
std::vector< Effect * > Inkscape::Extension::DB::get_effect_list | ( | ) |
Creates a list of all the Effect extensions.
Definition at line 266 of file db.cpp.
References item, and moduledict.
Referenced by add_document_actions_effect(), and InkscapeApplication::init_extension_action_data().
DB::InputList & Inkscape::Extension::DB::get_input_list | ( | DB::InputList & | ou_list | ) |
Creates a list of all the Input extensions.
ou_list | The list that is used to put all the extensions in |
Calls the database foreach
function with input_internal
.
Definition at line 242 of file db.cpp.
References input_internal().
Referenced by Inkscape::UI::Dialog::create_open_filters(), Inkscape::Extension::Input::find_by_filename(), Inkscape::Extension::Input::find_by_mime(), and InkscapeApplication::print_input_type_list().
DB::OutputList & Inkscape::Extension::DB::get_output_list | ( | DB::OutputList & | ou_list | ) |
Creates a list of all the Output extensions.
ou_list | The list that is used to put all the extensions in |
Calls the database foreach
function with output_internal
.
Definition at line 256 of file db.cpp.
References output_internal().
Referenced by Inkscape::UI::Dialog::create_export_filters(), InkFileExportCmd::do_export(), InkFileExportCmd::do_export_ps_pdf(), Inkscape::Extension::save(), Inkscape::UI::Dialog::ExtensionList::setup(), and sp_file_save_dialog().
DB::TemplateList & Inkscape::Extension::DB::get_template_list | ( | DB::TemplateList & | ou_list | ) |
Create a list of all the Template extensions.
ou_list | - The list that is used to put all the extensions in |
Calls the database foreach
function with template_internal
.
Definition at line 228 of file db.cpp.
References template_internal().
Referenced by Inkscape::Extension::Template::get_any_preset(), Inkscape::Extension::Template::get_any_preset(), Inkscape::UI::Widget::TemplateList::init(), and Inkscape::UI::Toolbar::PageToolbar::populate_sizes().
|
staticprivate |
The function to look at each module and see if it is an input module, then add it to the list.
in_plug | Module to be examined |
data | The list to be attached to |
The first thing that is checked is if this module is an input module. If it is, then it is added to the list which is passed in through data
.
Definition at line 162 of file db.cpp.
References data.
Referenced by get_input_list().
|
staticprivate |
The function to look at each module and see if it is an output module, then add it to the list.
in_plug | Module to be examined |
data | The list to be attached to |
The first thing that is checked is if this module is an output module. If it is, then it is added to the list which is passed in through data
.
Definition at line 182 of file db.cpp.
References data.
Referenced by get_output_list().
void Inkscape::Extension::DB::take_ownership | ( | std::unique_ptr< Extension > | module | ) |
Take the ownership of an extension to ensure that it is freed on program exit.
module | An owning pointer to the extension. |
Definition at line 86 of file db.cpp.
References moduledict.
Referenced by Inkscape::Extension::build_from_reprdoc().
|
staticprivate |
The function to look at each module and see if it is a template module, then add it to the list.
in_plug | - Module to be examined |
data | - The list to be attached to |
Definition at line 142 of file db.cpp.
References data.
Referenced by get_template_list().
|
private |
This is the actual database.
It has all of the modules in it, indexed by their ids. It's a hash table for faster lookups
Definition at line 39 of file db.h.
Referenced by foreach(), get(), get_effect_list(), and take_ownership().