Inkscape
Vector Graphics Editor
|
The object that is the basis for the Extension system. More...
#include <extension.h>
Classes | |
class | extension_no_id |
no valid ID found while parsing XML representation More... | |
class | extension_no_name |
no valid name found while parsing XML representation More... | |
class | extension_not_compatible |
extension is not compatible with the current system and should not be loaded More... | |
class | no_implementation_for_extension |
No implementation could be loaded for the extension. More... | |
class | no_overwrite |
An error class for when a filename already exists, but the user doesn't want to overwrite it. More... | |
class | param_not_exist |
An error class for when a parameter is looked for that just simply doesn't exist. More... | |
Public Types | |
enum | state_t { STATE_LOADED , STATE_UNLOADED , STATE_DEACTIVATED } |
An enumeration to identify if the Extension has been loaded or not. More... | |
using | ImplementationHolder = Util::HybridPointer< Implementation::Implementation > |
Public Member Functions | |
Extension (Inkscape::XML::Node *in_repr, ImplementationHolder implementation, std::string *base_directory) | |
Constructs an Extension from a Inkscape::XML::Node. | |
virtual | ~Extension () |
void | set_state (state_t in_state) |
A function to set whether the extension should be loaded or unloaded. | |
state_t | get_state () |
A getter for the state variable. | |
bool | loaded () |
A quick function to test the state of the extension. | |
virtual bool | check () |
A function to check the validity of the extension. | |
virtual bool | prefs () |
Create a dialog for preference for this extension. | |
Inkscape::XML::Node * | get_repr () |
A getter for the internal Repr, does not add a reference. | |
char const * | get_id () const |
Get the ID of this extension - not a copy don't delete! | |
char const * | get_name () const |
Get the name of this extension - not a copy don't delete! | |
virtual void | deactivate () |
This function diactivates the extension (which makes it unusable, but not deleted) | |
bool | deactivated () |
Find out the status of the extension. | |
void | printFailure (Glib::ustring const &reason) |
A quick function to print out a standard start of extension errors in the log. | |
std::string const & | getErrorReason () |
Implementation::Implementation * | get_imp () |
auto const & | get_base_directory () const |
void | set_base_directory (std::string const &base_directory) |
std::string | get_dependency_location (char const *name) |
Gets the location of the dependency file as an absolute path. | |
char const * | get_translation (char const *msgid, char const *msgctxt=nullptr) const |
Gets a translation within the context of the current extension. | |
void | set_environment (SPDocument const *doc=nullptr) |
Sets environment suitable for executing this Extension. | |
ModuleImpType | get_implementation_type () |
Uses the object's type to figure out what the type is. | |
int | get_sort_priority () const |
void | set_sort_priority (int priority) |
virtual void | run_processing_actions (SPDocument *doc) |
Runs any pre-processing actions and modifies the document. | |
unsigned int | widget_visible_count () const |
A function to get the number of visible parameters of the extension. | |
bool | get_param_bool (char const *name) const |
Gets a parameter identified by name with the bool placed in value. | |
bool | get_param_bool (char const *name, bool alt) const |
Like get_param_bool but with a default on param_not_exist error. | |
int | get_param_int (char const *name) const |
Gets a parameter identified by name with the integer placed in value. | |
int | get_param_int (char const *name, int alt) const |
Like get_param_int but with a default on param_not_exist error. | |
double | get_param_float (char const *name) const |
Gets a float parameter identified by name with the double placed in value. | |
double | get_param_float (char const *name, double alt) const |
Like get_param_float but with a default on param_not_exist error. | |
char const * | get_param_string (char const *name, char const *alt) const |
Like get_param_string but with a default on param_not_exist error. | |
char const * | get_param_string (char const *name) const |
Gets a parameter identified by name with the string placed in value. | |
char const * | get_param_optiongroup (char const *name, char const *alt) const |
Like get_param_optiongroup but with a default on param_not_exist error. | |
char const * | get_param_optiongroup (char const *name) const |
Gets a parameter identified by name with the string placed in value. | |
Colors::Color | get_param_color (char const *name) const |
Gets a parameter identified by name with the unsigned int placed in value. | |
bool | get_param_optiongroup_contains (char const *name, char const *value) const |
This is useful to find out, if a given string value is selectable in a optiongroup named \cname. | |
bool | set_param_bool (char const *name, bool value) |
Sets a parameter identified by name with the boolean in the parameter value. | |
int | set_param_int (char const *name, int value) |
Sets a parameter identified by name with the integer in the parameter value. | |
double | set_param_float (char const *name, double value) |
Sets a parameter identified by name with the double in the parameter value. | |
char const * | set_param_string (char const *name, char const *value) |
Sets a parameter identified by name with the string in the parameter value. | |
char const * | set_param_optiongroup (char const *name, char const *value) |
Sets a parameter identified by name with the string in the parameter value. | |
void | set_param_color (char const *name, Colors::Color const &color) |
void | set_param_any (char const *name, std::string const &value) |
Parses the given string value and sets a parameter identified by name. | |
void | set_param_hidden (char const *name, bool hidden) |
Gtk::Widget * | autogui (SPDocument *doc, Inkscape::XML::Node *node, sigc::signal< void()> *changeSignal=nullptr) |
A function to automatically generate a GUI from the extensions' widgets. | |
void | paramListString (std::list< std::string > &retlist) const |
A function to get the parameters in a string form. | |
void | set_gui (bool s) |
bool | get_gui () const |
Gtk::Box * | get_info_widget () |
Gtk::Box * | get_params_widget () |
Static Public Member Functions | |
static void | error_file_open () |
A function to open the error log file. | |
static void | error_file_close () |
A function to close the error log file. | |
static void | error_file_write (Glib::ustring const &text) |
A function to write to the error log file. | |
Static Protected Member Functions | |
static void | add_val (Glib::ustring const &labelstr, Glib::ustring const &valuestr, Gtk::Grid *table, int *row) |
Protected Attributes | |
Inkscape::XML::Node * | repr |
The XML description of the Extension. | |
ImplementationHolder | imp |
An Implementation object provides the actual implementation of the Extension. | |
std::string | _base_directory |
Directory containing the .inx file, relative paths in the extension should usually be relative to it. | |
std::unique_ptr< ExpirationTimer > | timer |
Timeout to unload after a given time. | |
bool | _translation_enabled = true |
Attempt translation of strings provided by the extension? | |
Private Member Functions | |
void | lookup_translation_catalog () |
Searches for a gettext catalog matching the extension's translationdomain. | |
void | make_param (Inkscape::XML::Node *paramrepr) |
InxParameter * | get_param (char const *name) |
Looks up the parameter with the specified name. | |
InxParameter const * | get_param (char const *name) const |
Looks up the parameter with the specified name. | |
Private Attributes | |
std::string | _id |
The unique identifier for the Extension. | |
std::string | _name |
A user friendly name for the Extension. | |
state_t | _state = STATE_UNLOADED |
Which state the Extension is currently in. | |
int | _priority = 0 |
when sorted, should this come before any others | |
std::vector< std::unique_ptr< Dependency > > | _deps |
Dependencies for this extension. | |
std::string | _error_reason |
Short, textual explanation for the latest error. | |
bool | _gui = true |
std::vector< ProcessingAction > | _actions |
Processing actions. | |
char const * | _translationdomain = nullptr |
Domainname of gettext textdomain that should be used for translation of the extension's strings. | |
std::string | _gettext_catalog_dir |
Directory containing the gettext catalog for _translationdomain. | |
std::vector< std::unique_ptr< InxWidget > > | _widgets |
A list of widgets for this extension. | |
Static Private Attributes | |
static FILE * | error_file = nullptr |
This is the place where errors get reported. | |
The object that is the basis for the Extension system.
This object contains all of the information that all Extension have. The individual items are detailed within. This is the interface that those who want to use the extensions system should use. This is most likely to be those who are inside the Inkscape program.
Definition at line 133 of file extension.h.
using Inkscape::Extension::Extension::ImplementationHolder = Util::HybridPointer<Implementation::Implementation> |
Definition at line 141 of file extension.h.
An enumeration to identify if the Extension has been loaded or not.
Enumerator | |
---|---|
STATE_LOADED | The extension has been loaded successfully. |
STATE_UNLOADED | The extension has not been loaded. |
STATE_DEACTIVATED | The extension is missing something which makes it unusable. |
Definition at line 136 of file extension.h.
Inkscape::Extension::Extension::Extension | ( | Inkscape::XML::Node * | in_repr, |
ImplementationHolder | implementation, | ||
std::string * | base_directory | ||
) |
Constructs an Extension from a Inkscape::XML::Node.
in_repr | The repr that should be used to build it |
base_directory | Base directory of extensions that were loaded from a file (.inx file's location) |
This function is the basis of building an extension for Inkscape. It currently extracts the fields from the Repr that are used in the extension. The Repr will likely include other children that are not related to the module directly. If the Repr does not include a name and an ID the module will be left in an errored state.
Definition at line 66 of file extension.cpp.
References _actions, _base_directory, _deps, _gettext_catalog_dir, _id, _name, _translation_enabled, _translationdomain, _widgets, Inkscape::GC::anchor(), Inkscape::XML::Node::attribute(), child, Inkscape::XML::Node::content(), Inkscape::XML::ELEMENT_NODE, Inkscape::XML::Node::firstChild(), imp, Inkscape::Extension::InxWidget::is_valid_widget_name(), lookup_translation_catalog(), Inkscape::Extension::InxWidget::make(), name, Inkscape::XML::Node::name(), Inkscape::XML::Node::next(), repr, Inkscape::Extension::Dependency::TYPE_EXECUTABLE, and Inkscape::Extension::Dependency::TYPE_FILE.
|
virtual |
Definition at line 173 of file extension.cpp.
References Inkscape::GC::release(), and repr.
|
inlinestaticprotected |
Gtk::Widget * Inkscape::Extension::Extension::autogui | ( | SPDocument * | doc, |
Inkscape::XML::Node * | node, | ||
sigc::signal< void()> * | changeSignal = nullptr |
||
) |
A function to automatically generate a GUI from the extensions' widgets.
This function just goes through each widget, and calls it's 'get_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.
Definition at line 975 of file extension.cpp.
References _gui, _widgets, Inkscape::Extension::InxWidget::GUI_BOX_MARGIN, Inkscape::Extension::InxWidget::GUI_BOX_SPACING, and widget_visible_count().
Referenced by prefs().
|
virtual |
A function to check the validity of the extension.
This function chekcs to make sure that there is an id, a name, a repr and an implementation for this extension. Then it checks all of the dependencies to see if they pass. Finally, it asks the implementation to do a check of itself.
On each check, if there is a failure, it will print a message to the error log for that failure. It is important to note that the function keeps executing if it finds an error, to try and get as many of them into the error log as possible. This should help people debug installations, and figure out what they need to get for the full functionality of Inkscape to be available.
Reimplemented in Inkscape::Extension::Input, Inkscape::Extension::Output, and Inkscape::Extension::Template.
Definition at line 257 of file extension.cpp.
References _deps, error_file_write(), imp, printFailure(), and repr.
Referenced by Inkscape::Extension::Input::check(), Inkscape::Extension::Output::check(), and Inkscape::Extension::Template::check().
|
virtual |
This function diactivates the extension (which makes it unusable, but not deleted)
This function is used to removed an extension from functioning, but not delete it completely. It sets the state to STATE_DEACTIVATED
to mark to the world that it has been deactivated. It also removes the current implementation and replaces it with a standard one. This makes it so that we don't have to continually check if there is an implementation, but we are guaranteed to have a benign one.
Reimplemented in Inkscape::Extension::Effect.
Definition at line 347 of file extension.cpp.
References imp, set_state(), and STATE_DEACTIVATED.
Referenced by Inkscape::Extension::Effect::deactivate().
bool Inkscape::Extension::Extension::deactivated | ( | ) |
Find out the status of the extension.
Definition at line 361 of file extension.cpp.
References get_state(), and STATE_DEACTIVATED.
|
static |
A function to close the error log file.
Definition at line 919 of file extension.cpp.
References error_file.
Referenced by Inkscape::Extension::check_extensions().
|
static |
A function to open the error log file.
Definition at line 908 of file extension.cpp.
References error_file, Inkscape::IO::fopen_utf8name(), and Inkscape::IO::Resource::log_path().
Referenced by Inkscape::Extension::check_extensions().
|
static |
A function to write to the error log file.
Definition at line 928 of file extension.cpp.
References error_file.
Referenced by check(), and printFailure().
|
inline |
Definition at line 192 of file extension.h.
References _base_directory.
Referenced by Inkscape::Extension::TemplatePreset::_get_icon_path(), Inkscape::Extension::Dependency::check(), Inkscape::Extension::ParamPath::on_button_clicked(), Inkscape::Extension::ParamPath::value_to_string(), and Inkscape::Extension::WidgetImage::WidgetImage().
std::string Inkscape::Extension::Extension::get_dependency_location | ( | char const * | name | ) |
Gets the location of the dependency file as an absolute path.
Iterates over all dependencies of this extension and finds the one with matching name, then returns the absolute path to this dependency file as determined previously.
TODO: This function should not be necessary, but we parse script dependencies twice:
Definition at line 379 of file extension.cpp.
|
inline |
Definition at line 286 of file extension.h.
References _gui.
char const * Inkscape::Extension::Extension::get_id | ( | ) | const |
Get the ID of this extension - not a copy don't delete!
Definition at line 316 of file extension.cpp.
References _id.
Referenced by Inkscape::Extension::Dependency::check(), InkFileExportCmd::do_export_extension(), Inkscape::Extension::Implementation::Script::effect(), Inkscape::Extension::Effect::Effect(), Inkscape::Extension::Effect::find_icon_file(), Inkscape::Extension::Effect::get_sanitized_id(), Inkscape::Extension::InxWidget::get_widget(), Inkscape::Extension::InxParameter::InxParameter(), Inkscape::Extension::InxWidget::InxWidget(), Inkscape::Extension::InxParameter::make(), Inkscape::Extension::InxWidget::make(), Inkscape::Extension::open(), Inkscape::Extension::ParamColor::ParamColor(), Inkscape::Extension::ParamFloat::ParamFloat(), Inkscape::Extension::ParamInt::ParamInt(), Inkscape::Extension::ParamNotebook::ParamNotebook(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::ParamNotebookPage(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroup(), Inkscape::Extension::ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(), Inkscape::Extension::ParamPath::ParamPath(), Inkscape::Extension::ParamString::ParamString(), Inkscape::Extension::InxParameter::pref_name(), Inkscape::UI::Dialog::render_icon(), Inkscape::Extension::save(), Inkscape::Extension::ParamOptionGroup::set(), Inkscape::Extension::InxParameter::string_to_value(), Inkscape::Extension::ParamBool::string_to_value(), Inkscape::Extension::InxParameter::value_to_string(), Inkscape::Extension::WidgetBox::WidgetBox(), Inkscape::Extension::WidgetImage::WidgetImage(), Inkscape::Extension::WidgetLabel::WidgetLabel(), and Inkscape::Extension::WidgetSpacer::WidgetSpacer().
|
inline |
Definition at line 191 of file extension.h.
References Inkscape::Util::HybridPointer< T >::get(), and imp.
Referenced by Inkscape::Extension::Effect::apply_filter(), Inkscape::Extension::ExecutionEnv::cancel(), Inkscape::Extension::ExecutionEnv::commit(), Inkscape::Extension::ExecutionEnv::genDocCache(), Inkscape::Extension::PrefDialog::PrefDialog(), and Inkscape::Extension::ExecutionEnv::run().
ModuleImpType Inkscape::Extension::Extension::get_implementation_type | ( | ) |
Uses the object's type to figure out what the type is.
Definition at line 553 of file extension.cpp.
References Inkscape::Util::HybridPointer< T >::get(), imp, MODULE_EXTENSION, MODULE_PLUGIN, and MODULE_XSLT.
Gtk::Box * Inkscape::Extension::Extension::get_info_widget | ( | ) |
Definition at line 1003 of file extension.cpp.
References _id, _name, _state, add_val(), get_translation(), Inkscape::UI::pack_start(), STATE_LOADED, and STATE_UNLOADED.
Referenced by Inkscape::Extension::Effect::get_info_widget().
char const * Inkscape::Extension::Extension::get_name | ( | ) | const |
Get the name of this extension - not a copy don't delete!
Definition at line 326 of file extension.cpp.
References _name, and get_translation().
Referenced by Inkscape::UI::Dialog::add_effects(), Inkscape::Extension::ExecutionEnv::commit(), Inkscape::Extension::ExecutionEnv::createWorkingDialog(), Inkscape::Extension::Input::get_filetypename(), Inkscape::Extension::Output::get_filetypename(), prefs(), and Inkscape::Extension::Effect::prefs().
|
private |
Looks up the parameter with the specified name.
Searches the list of parameters attached to this extension, looking for a parameter with a matching name.
This function can throw a 'param_not_exist' exception if the name is not found.
name | Name of the parameter to search for. |
Definition at line 597 of file extension.cpp.
References _widgets, Inkscape::Extension::InxParameter::name(), and name.
Referenced by get_param(), get_param_bool(), get_param_color(), get_param_float(), get_param_int(), get_param_optiongroup(), get_param_optiongroup_contains(), get_param_string(), set_param_any(), set_param_bool(), set_param_color(), set_param_float(), set_param_hidden(), set_param_int(), set_param_optiongroup(), and set_param_string().
|
private |
Looks up the parameter with the specified name.
Searches the list of parameters attached to this extension, looking for a parameter with a matching name.
This function can throw a 'param_not_exist' exception if the name is not found.
name | Name of the parameter to search for. |
Definition at line 621 of file extension.cpp.
References get_param(), and name.
bool Inkscape::Extension::Extension::get_param_bool | ( | char const * | name | ) | const |
Gets a parameter identified by name with the bool placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 634 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_bool(), get_param(), and name.
Referenced by Inkscape::UI::Dialog::Export::exportRaster(), Inkscape::Extension::Internal::Filter::Blur::get_filter_text(), Inkscape::Extension::Internal::Filter::ImageBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::Bump::get_filter_text(), Inkscape::Extension::Internal::Filter::WaxBump::get_filter_text(), Inkscape::Extension::Internal::Filter::Brilliance::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelPaint::get_filter_text(), Inkscape::Extension::Internal::Filter::Colorize::get_filter_text(), Inkscape::Extension::Internal::Filter::ExtractChannel::get_filter_text(), Inkscape::Extension::Internal::Filter::Greyscale::get_filter_text(), Inkscape::Extension::Internal::Filter::Invert::get_filter_text(), Inkscape::Extension::Internal::Filter::EdgeDetect::get_filter_text(), Inkscape::Extension::Internal::Filter::Crosssmooth::get_filter_text(), Inkscape::Extension::Internal::Filter::Outline::get_filter_text(), Inkscape::Extension::Internal::Filter::NoiseFill::get_filter_text(), Inkscape::Extension::Internal::Filter::Chromolitho::get_filter_text(), Inkscape::Extension::Internal::Filter::CrossEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Drawing::get_filter_text(), Inkscape::Extension::Internal::Filter::Electrize::get_filter_text(), Inkscape::Extension::Internal::Filter::PointEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Posterize::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorizableDropShadow::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelTransparency::get_filter_text(), Inkscape::Extension::Internal::Filter::LightEraser::get_filter_text(), Inkscape::Extension::Internal::Filter::Silhouette::get_filter_text(), get_param_bool(), Inkscape::Extension::Internal::CairoPsOutput::textToPath(), Inkscape::Extension::Internal::CairoEpsOutput::textToPath(), Inkscape::Extension::Internal::PrintLatex::textToPath(), and Inkscape::Extension::Internal::PrintMetafile::textToPath().
bool Inkscape::Extension::Extension::get_param_bool | ( | char const * | name, |
bool | alt | ||
) | const |
Like get_param_bool but with a default on param_not_exist error.
Definition at line 645 of file extension.cpp.
References get_param_bool(), and name.
Colors::Color Inkscape::Extension::Extension::get_param_color | ( | char const * | name | ) | const |
Gets a parameter identified by name with the unsigned int placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 788 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_color(), get_param(), and name.
Referenced by Inkscape::Extension::Internal::Filter::DiffuseLight::get_filter_text(), Inkscape::Extension::Internal::Filter::MatteJelly::get_filter_text(), Inkscape::Extension::Internal::Filter::SpecularLight::get_filter_text(), Inkscape::Extension::Internal::Filter::ImageBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::Bump::get_filter_text(), Inkscape::Extension::Internal::Filter::WaxBump::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelPaint::get_filter_text(), Inkscape::Extension::Internal::Filter::Colorize::get_filter_text(), Inkscape::Extension::Internal::Filter::Duochrome::get_filter_text(), Inkscape::Extension::Internal::Filter::NudgeRGB::get_filter_text(), Inkscape::Extension::Internal::Filter::NudgeCMY::get_filter_text(), Inkscape::Extension::Internal::Filter::SimpleBlend::get_filter_text(), Inkscape::Extension::Internal::Filter::Tritone::get_filter_text(), Inkscape::Extension::Internal::Filter::Outline::get_filter_text(), Inkscape::Extension::Internal::Filter::NoiseFill::get_filter_text(), Inkscape::Extension::Internal::Filter::Drawing::get_filter_text(), Inkscape::Extension::Internal::Filter::PointEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorizableDropShadow::get_filter_text(), and Inkscape::Extension::Internal::Filter::Silhouette::get_filter_text().
double Inkscape::Extension::Extension::get_param_float | ( | char const * | name | ) | const |
Gets a float parameter identified by name with the double placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 690 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_float(), get_param(), and name.
Referenced by Inkscape::Extension::Internal::Grid::effect(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::UI::Dialog::Export::exportRaster(), Inkscape::Extension::Internal::Filter::DiffuseLight::get_filter_text(), Inkscape::Extension::Internal::Filter::MatteJelly::get_filter_text(), Inkscape::Extension::Internal::Filter::SpecularLight::get_filter_text(), Inkscape::Extension::Internal::Filter::Blur::get_filter_text(), Inkscape::Extension::Internal::Filter::CleanEdges::get_filter_text(), Inkscape::Extension::Internal::Filter::CrossBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::Feather::get_filter_text(), Inkscape::Extension::Internal::Filter::ImageBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::Bump::get_filter_text(), Inkscape::Extension::Internal::Filter::WaxBump::get_filter_text(), Inkscape::Extension::Internal::Filter::Brilliance::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelPaint::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorShift::get_filter_text(), Inkscape::Extension::Internal::Filter::Colorize::get_filter_text(), Inkscape::Extension::Internal::Filter::Duochrome::get_filter_text(), Inkscape::Extension::Internal::Filter::FadeToBW::get_filter_text(), Inkscape::Extension::Internal::Filter::Greyscale::get_filter_text(), Inkscape::Extension::Internal::Filter::Invert::get_filter_text(), Inkscape::Extension::Internal::Filter::Lighting::get_filter_text(), Inkscape::Extension::Internal::Filter::LightnessContrast::get_filter_text(), Inkscape::Extension::Internal::Filter::NudgeRGB::get_filter_text(), Inkscape::Extension::Internal::Filter::NudgeCMY::get_filter_text(), Inkscape::Extension::Internal::Filter::Quadritone::get_filter_text(), Inkscape::Extension::Internal::Filter::Tritone::get_filter_text(), Inkscape::Extension::Internal::Filter::FeltFeather::get_filter_text(), Inkscape::Extension::Internal::Filter::Roughen::get_filter_text(), Inkscape::Extension::Internal::Filter::EdgeDetect::get_filter_text(), Inkscape::Extension::Internal::Filter::Crosssmooth::get_filter_text(), Inkscape::Extension::Internal::Filter::Outline::get_filter_text(), Inkscape::Extension::Internal::Filter::NoiseFill::get_filter_text(), Inkscape::Extension::Internal::Filter::Chromolitho::get_filter_text(), Inkscape::Extension::Internal::Filter::CrossEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Drawing::get_filter_text(), Inkscape::Extension::Internal::Filter::Electrize::get_filter_text(), Inkscape::Extension::Internal::Filter::NeonDraw::get_filter_text(), Inkscape::Extension::Internal::Filter::PointEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Posterize::get_filter_text(), Inkscape::Extension::Internal::Filter::PosterizeBasic::get_filter_text(), Inkscape::Extension::Internal::Filter::Snow::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorizableDropShadow::get_filter_text(), Inkscape::Extension::Internal::Filter::InkBlot::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelTransparency::get_filter_text(), Inkscape::Extension::Internal::Filter::LightEraser::get_filter_text(), Inkscape::Extension::Internal::Filter::Opacity::get_filter_text(), Inkscape::Extension::Internal::Filter::Silhouette::get_filter_text(), get_param_float(), Inkscape::Extension::Internal::TemplateBase::get_template_size(), Inkscape::Extension::Internal::TemplateOther::get_template_size(), and Inkscape::Extension::Internal::TemplatePaper::get_template_size().
double Inkscape::Extension::Extension::get_param_float | ( | char const * | name, |
double | alt | ||
) | const |
Like get_param_float but with a default on param_not_exist error.
Definition at line 701 of file extension.cpp.
References get_param_float(), and name.
int Inkscape::Extension::Extension::get_param_int | ( | char const * | name | ) | const |
Gets a parameter identified by name with the integer placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 662 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_int(), get_param(), and name.
Referenced by Inkscape::UI::Dialog::Export::exportRaster(), Inkscape::Extension::Internal::Filter::DiffuseLight::get_filter_text(), Inkscape::Extension::Internal::Filter::MatteJelly::get_filter_text(), Inkscape::Extension::Internal::Filter::SpecularLight::get_filter_text(), Inkscape::Extension::Internal::Filter::Bump::get_filter_text(), Inkscape::Extension::Internal::Filter::WaxBump::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorShift::get_filter_text(), Inkscape::Extension::Internal::Filter::Quadritone::get_filter_text(), Inkscape::Extension::Internal::Filter::Solarize::get_filter_text(), Inkscape::Extension::Internal::Filter::Tritone::get_filter_text(), Inkscape::Extension::Internal::Filter::FeltFeather::get_filter_text(), Inkscape::Extension::Internal::Filter::Roughen::get_filter_text(), Inkscape::Extension::Internal::Filter::NoiseFill::get_filter_text(), Inkscape::Extension::Internal::Filter::Chromolitho::get_filter_text(), Inkscape::Extension::Internal::Filter::CrossEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Drawing::get_filter_text(), Inkscape::Extension::Internal::Filter::Electrize::get_filter_text(), Inkscape::Extension::Internal::Filter::PointEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Posterize::get_filter_text(), Inkscape::Extension::Internal::Filter::PosterizeBasic::get_filter_text(), Inkscape::Extension::Internal::Filter::InkBlot::get_filter_text(), and get_param_int().
int Inkscape::Extension::Extension::get_param_int | ( | char const * | name, |
int | alt | ||
) | const |
Like get_param_int but with a default on param_not_exist error.
Definition at line 673 of file extension.cpp.
References get_param_int(), and name.
char const * Inkscape::Extension::Extension::get_param_optiongroup | ( | char const * | name | ) | const |
Gets a parameter identified by name with the string placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 746 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_optiongroup(), get_param(), and name.
char const * Inkscape::Extension::Extension::get_param_optiongroup | ( | char const * | name, |
char const * | alt | ||
) | const |
Like get_param_optiongroup but with a default on param_not_exist error.
Definition at line 757 of file extension.cpp.
References get_param_optiongroup(), and name.
Referenced by Inkscape::Extension::Internal::Filter::CrossBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::ImageBlur::get_filter_text(), Inkscape::Extension::Internal::Filter::Bump::get_filter_text(), Inkscape::Extension::Internal::Filter::WaxBump::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorBlindness::get_filter_text(), Inkscape::Extension::Internal::Filter::Colorize::get_filter_text(), Inkscape::Extension::Internal::Filter::ComponentTransfer::get_filter_text(), Inkscape::Extension::Internal::Filter::Duochrome::get_filter_text(), Inkscape::Extension::Internal::Filter::ExtractChannel::get_filter_text(), Inkscape::Extension::Internal::Filter::FadeToBW::get_filter_text(), Inkscape::Extension::Internal::Filter::Invert::get_filter_text(), Inkscape::Extension::Internal::Filter::Quadritone::get_filter_text(), Inkscape::Extension::Internal::Filter::SimpleBlend::get_filter_text(), Inkscape::Extension::Internal::Filter::Solarize::get_filter_text(), Inkscape::Extension::Internal::Filter::Tritone::get_filter_text(), Inkscape::Extension::Internal::Filter::FeltFeather::get_filter_text(), Inkscape::Extension::Internal::Filter::Roughen::get_filter_text(), Inkscape::Extension::Internal::Filter::EdgeDetect::get_filter_text(), Inkscape::Extension::Internal::Filter::Crosssmooth::get_filter_text(), Inkscape::Extension::Internal::Filter::Outline::get_filter_text(), Inkscape::Extension::Internal::Filter::NoiseFill::get_filter_text(), Inkscape::Extension::Internal::Filter::Chromolitho::get_filter_text(), Inkscape::Extension::Internal::Filter::Electrize::get_filter_text(), Inkscape::Extension::Internal::Filter::NeonDraw::get_filter_text(), Inkscape::Extension::Internal::Filter::PointEngraving::get_filter_text(), Inkscape::Extension::Internal::Filter::Posterize::get_filter_text(), Inkscape::Extension::Internal::Filter::ColorizableDropShadow::get_filter_text(), Inkscape::Extension::Internal::Filter::InkBlot::get_filter_text(), Inkscape::Extension::Internal::Filter::Blend::get_filter_text(), get_param_optiongroup(), Inkscape::Extension::Internal::TemplatePaper::get_template_size(), Inkscape::Extension::Internal::TemplateBase::get_template_unit(), and Inkscape::Extension::Internal::CairoRendererPdfOutput::save().
bool Inkscape::Extension::Extension::get_param_optiongroup_contains | ( | char const * | name, |
char const * | value | ||
) | const |
This is useful to find out, if a given string value
is selectable in a optiongroup named \cname.
name | The name of the optiongroup parameter to get. |
Definition at line 773 of file extension.cpp.
References Inkscape::Extension::InxParameter::get_optiongroup_contains(), get_param(), and name.
Referenced by InkFileExportCmd::do_export_ps_pdf().
char const * Inkscape::Extension::Extension::get_param_string | ( | char const * | name | ) | const |
Gets a parameter identified by name with the string placed in value.
name | The name of the parameter to get |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 718 of file extension.cpp.
References get_param(), Inkscape::Extension::InxParameter::get_string(), and name.
char const * Inkscape::Extension::Extension::get_param_string | ( | char const * | name, |
char const * | alt | ||
) | const |
Like get_param_string but with a default on param_not_exist error.
Definition at line 729 of file extension.cpp.
References get_param_string(), and name.
Referenced by get_param_string(), Inkscape::Extension::Internal::TemplateBase::get_template_unit(), and Inkscape::Extension::Internal::TemplateFromFile::new_from_template().
Gtk::Box * Inkscape::Extension::Extension::get_params_widget | ( | ) |
Definition at line 1036 of file extension.cpp.
References Inkscape::UI::pack_start().
Inkscape::XML::Node * Inkscape::Extension::Extension::get_repr | ( | ) |
A getter for the internal Repr, does not add a reference.
Definition at line 306 of file extension.cpp.
References repr.
|
inline |
Definition at line 199 of file extension.h.
References _priority.
Referenced by Inkscape::Extension::Template::Template().
Extension::state_t Inkscape::Extension::Extension::get_state | ( | ) |
A getter for the state variable.
Definition at line 225 of file extension.cpp.
References _state.
Referenced by deactivated(), and loaded().
char const * Inkscape::Extension::Extension::get_translation | ( | char const * | msgid, |
char const * | msgctxt = nullptr |
||
) | const |
Gets a translation within the context of the current extension.
Query gettext for the translated version of the input string, handling the preferred translation domain of the extension internally.
msgid | String to translate |
msgctxt | Context for the translation |
Definition at line 498 of file extension.cpp.
References _id, _translation_enabled, and _translationdomain.
Referenced by Inkscape::Extension::Input::get_filetypename(), Inkscape::Extension::Output::get_filetypename(), Inkscape::Extension::Input::get_filetypetooltip(), Inkscape::Extension::Output::get_filetypetooltip(), get_info_widget(), Inkscape::Extension::Effect::get_menu(), get_name(), and Inkscape::Extension::InxWidget::get_translation().
|
inline |
Definition at line 190 of file extension.h.
References _error_reason.
bool Inkscape::Extension::Extension::loaded | ( | ) |
A quick function to test the state of the extension.
Definition at line 235 of file extension.cpp.
References get_state(), and STATE_LOADED.
Referenced by Inkscape::Extension::Effect::effect(), Inkscape::Extension::Output::export_raster(), Inkscape::Extension::Implementation::Script::load(), Inkscape::Extension::Implementation::XSLT::load(), Inkscape::Extension::Template::new_from_template(), Inkscape::Extension::Input::open(), Inkscape::Extension::open(), Inkscape::Extension::PrefDialog::param_change(), prefs(), Inkscape::Extension::Effect::prefs(), Inkscape::Extension::Template::resize_to_template(), Inkscape::Extension::save(), Inkscape::Extension::Output::save(), and Inkscape::Extension::Implementation::XSLT::unload().
|
private |
Searches for a gettext catalog matching the extension's translationdomain.
This function will attempt to find the correct gettext catalog for the translationdomain requested by the extension.
For this the following three locations are recursively searched for "${translationdomain}.mo":
If one matching file is found, the directory is assumed to be the correct location and registered with gettext
Definition at line 424 of file extension.cpp.
References _base_directory, Inkscape::Extension::_find_filename_recursive(), _gettext_catalog_dir, _translation_enabled, and _translationdomain.
Referenced by Extension().
|
private |
void Inkscape::Extension::Extension::paramListString | ( | std::list< std::string > & | retlist | ) | const |
A function to get the parameters in a string form.
Definition at line 570 of file extension.cpp.
References _widgets, Inkscape::Extension::InxParameter::name(), name, and Inkscape::Extension::InxParameter::value_to_string().
|
virtual |
Create a dialog for preference for this extension.
Will skip if not using GUI.
Definition at line 1061 of file extension.cpp.
References autogui(), Inkscape::UI::dialog_run(), get_name(), loaded(), set_state(), and STATE_LOADED.
Referenced by Inkscape::Extension::open(), Inkscape::Extension::PathEffect::processPathEffects(), Inkscape::Extension::save(), Inkscape::Extension::TemplatePreset::setup_prefs(), and Inkscape::Extension::Template::Template().
void Inkscape::Extension::Extension::printFailure | ( | Glib::ustring const & | reason | ) |
A quick function to print out a standard start of extension errors in the log.
reason | A string explaining why this failed |
Real simple, just put everything into error_file
.
Definition at line 295 of file extension.cpp.
References _error_reason, _name, and error_file_write().
Referenced by check().
|
virtual |
Runs any pre-processing actions and modifies the document.
Definition at line 1085 of file extension.cpp.
References _actions.
Referenced by Inkscape::Extension::Output::save().
|
inline |
Definition at line 193 of file extension.h.
References _base_directory.
void Inkscape::Extension::Extension::set_environment | ( | SPDocument const * | doc = nullptr | ) |
Sets environment suitable for executing this Extension.
Currently sets the environment variables INKEX_GETTEXT_DOMAIN and INKEX_GETTEXT_DIRECTORY to make the "translationdomain" accessible to child processes spawned by this extension's Implementation.
doc | Optional document, if provided sets the DOCUMENT_PATH from the document's save location. |
Definition at line 522 of file extension.cpp.
References _gettext_catalog_dir, _translationdomain, SPDocument::getDocumentFilename(), and Inkscape::IO::Resource::profile_path().
|
inline |
Definition at line 285 of file extension.h.
References _gui.
Referenced by InkFileExportCmd::do_export_extension(), InkFileExportCmd::do_export_vector(), and Inkscape::Extension::open().
void Inkscape::Extension::Extension::set_param_any | ( | char const * | name, |
std::string const & | value | ||
) |
Parses the given string value and sets a parameter identified by name.
name | The name of the parameter to set |
value | The value to set the parameter to |
Definition at line 896 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set().
Referenced by Inkscape::Extension::TemplatePreset::_add_prefs().
bool Inkscape::Extension::Extension::set_param_bool | ( | char const * | name, |
bool | value | ||
) |
Sets a parameter identified by name with the boolean in the parameter value.
name | The name of the parameter to set |
value | The value to set the parameter to |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 804 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_bool().
Referenced by InkFileExportCmd::do_export_ps_pdf(), Inkscape::Extension::Internal::Emf::save(), and Inkscape::Extension::Internal::Wmf::save().
void Inkscape::Extension::Extension::set_param_color | ( | char const * | name, |
Colors::Color const & | color | ||
) |
\return The passed in value \brief Sets a parameter identified by name with the unsigned integer RGBA value in the parameter value. \param name The name of the parameter to set \param value The value to set the parameter to
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 884 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_color().
double Inkscape::Extension::Extension::set_param_float | ( | char const * | name, |
double | value | ||
) |
Sets a parameter identified by name with the double in the parameter value.
name | The name of the parameter to set |
value | The value to set the parameter to |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 836 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_float().
void Inkscape::Extension::Extension::set_param_hidden | ( | char const * | name, |
bool | hidden | ||
) |
Definition at line 901 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxWidget::set_hidden().
Referenced by Inkscape::Extension::TemplatePreset::_add_prefs(), and Inkscape::Extension::TemplatePreset::setup_prefs().
int Inkscape::Extension::Extension::set_param_int | ( | char const * | name, |
int | value | ||
) |
Sets a parameter identified by name with the integer in the parameter value.
name | The name of the parameter to set |
value | The value to set the parameter to |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 820 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_int().
Referenced by InkFileExportCmd::do_export_ps_pdf().
char const * Inkscape::Extension::Extension::set_param_optiongroup | ( | char const * | name, |
char const * | value | ||
) |
Sets a parameter identified by name with the string in the parameter value.
name | The name of the parameter to set |
value | The value to set the parameter to |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 868 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_optiongroup().
Referenced by InkFileExportCmd::do_export_ps_pdf().
char const * Inkscape::Extension::Extension::set_param_string | ( | char const * | name, |
char const * | value | ||
) |
Sets a parameter identified by name with the string in the parameter value.
name | The name of the parameter to set |
value | The value to set the parameter to |
Look up in the parameters list, const then execute the function on that found parameter.
Definition at line 852 of file extension.cpp.
References get_param(), name, and Inkscape::Extension::InxParameter::set_string().
|
inline |
Definition at line 200 of file extension.h.
References _priority.
Referenced by Inkscape::Extension::Input::Input(), Inkscape::Extension::Output::Output(), and Inkscape::Extension::Template::Template().
void Inkscape::Extension::Extension::set_state | ( | state_t | in_state | ) |
A function to set whether the extension should be loaded or unloaded.
in_state | Which state should the extension be in? |
It checks to see if this is a state change or not. If we're changing states it will call the appropriate function in the implementation, load or unload. Currently, there is no error checking in this function. There should be.
Definition at line 190 of file extension.cpp.
References _state, imp, STATE_DEACTIVATED, STATE_LOADED, STATE_UNLOADED, and timer.
Referenced by deactivate(), InkFileExportCmd::do_export_extension(), Inkscape::Extension::Effect::effect(), Inkscape::Extension::Output::export_raster(), Inkscape::Extension::ExpirationTimer::idle_func(), Inkscape::Extension::Template::new_from_template(), Inkscape::Extension::Input::open(), Inkscape::Extension::open(), Inkscape::Extension::PrefDialog::param_change(), prefs(), Inkscape::Extension::Effect::prefs(), Inkscape::Extension::Template::resize_to_template(), Inkscape::Extension::save(), and Inkscape::Extension::Output::save().
unsigned int Inkscape::Extension::Extension::widget_visible_count | ( | ) | const |
A function to get the number of visible parameters of the extension.
Definition at line 1044 of file extension.cpp.
References _widgets.
Referenced by autogui(), Inkscape::Extension::Effect::prefs(), Inkscape::Extension::Implementation::Implementation::prefs_effect(), and Inkscape::Extension::Effect::takes_input().
|
private |
Processing actions.
Definition at line 153 of file extension.h.
Referenced by Extension(), and run_processing_actions().
|
protected |
Directory containing the .inx file, relative paths in the extension should usually be relative to it.
Definition at line 163 of file extension.h.
Referenced by Extension(), Inkscape::Extension::Effect::find_icon_file(), get_base_directory(), lookup_translation_catalog(), and set_base_directory().
|
private |
Dependencies for this extension.
Definition at line 148 of file extension.h.
Referenced by check(), Extension(), and get_dependency_location().
|
private |
Short, textual explanation for the latest error.
Definition at line 150 of file extension.h.
Referenced by getErrorReason(), and printFailure().
|
private |
Directory containing the gettext catalog for _translationdomain.
Definition at line 171 of file extension.h.
Referenced by Extension(), lookup_translation_catalog(), and set_environment().
|
private |
Definition at line 151 of file extension.h.
|
private |
The unique identifier for the Extension.
Definition at line 144 of file extension.h.
Referenced by Extension(), get_id(), get_info_widget(), and get_translation().
|
private |
A user friendly name for the Extension.
Definition at line 145 of file extension.h.
Referenced by Extension(), get_info_widget(), get_name(), and printFailure().
|
private |
when sorted, should this come before any others
Definition at line 147 of file extension.h.
Referenced by get_sort_priority(), and set_sort_priority().
|
private |
Which state the Extension is currently in.
Definition at line 146 of file extension.h.
Referenced by get_info_widget(), get_state(), and set_state().
|
protected |
Attempt translation of strings provided by the extension?
Definition at line 166 of file extension.h.
Referenced by Extension(), Inkscape::Extension::Effect::get_menu(), get_translation(), and lookup_translation_catalog().
|
private |
Domainname of gettext textdomain that should be used for translation of the extension's strings.
Definition at line 169 of file extension.h.
Referenced by Extension(), get_translation(), lookup_translation_catalog(), and set_environment().
|
private |
A list of widgets for this extension.
Definition at line 206 of file extension.h.
Referenced by autogui(), Extension(), get_param(), paramListString(), and widget_visible_count().
|
staticprivate |
This is the place where errors get reported.
Definition at line 149 of file extension.h.
Referenced by error_file_close(), error_file_open(), and error_file_write().
|
protected |
An Implementation object provides the actual implementation of the Extension.
We hold an owning pointer to the implementation when the implementation is created by Inkscape, and a non-owning pointer when the implementation is allocated in an external library.
Definition at line 162 of file extension.h.
Referenced by Inkscape::Extension::Print::begin(), Inkscape::Extension::Print::bind(), check(), deactivate(), Inkscape::Extension::Effect::Effect(), Inkscape::Extension::Output::export_raster(), Extension(), Inkscape::Extension::Print::fill(), Inkscape::Extension::Print::finish(), Inkscape::Extension::Print::fontEmbedded(), get_imp(), get_implementation_type(), Inkscape::Extension::Template::get_presets(), Inkscape::Extension::Print::image(), Inkscape::Extension::TemplatePreset::match_size(), Inkscape::Extension::Template::new_from_template(), Inkscape::Extension::Input::open(), Inkscape::Extension::Print::release(), Inkscape::Extension::Template::resize_to_template(), Inkscape::Extension::Output::save(), Inkscape::Extension::Print::set_preview(), set_state(), Inkscape::Extension::Print::setup(), Inkscape::Extension::Print::stroke(), Inkscape::Extension::Print::text(), and Inkscape::Extension::Print::textToPath().
|
protected |
The XML description of the Extension.
Definition at line 156 of file extension.h.
Referenced by check(), Inkscape::Extension::Effect::Effect(), Extension(), get_repr(), Inkscape::Extension::Input::Input(), Inkscape::Extension::Output::Output(), Inkscape::Extension::Template::Template(), and ~Extension().
|
protected |
Timeout to unload after a given time.
Definition at line 165 of file extension.h.
Referenced by Inkscape::Extension::Effect::effect(), Inkscape::Extension::Input::open(), and set_state().