diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-08-04 19:31:05 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-08-31 14:50:38 +0000 |
| commit | 3329abac70b6326839349c6438664dbc2a4a5548 (patch) | |
| tree | 8ef2d305bc61082b2b7c5cea2284da52c0146110 /src/extension | |
| parent | Create new InxWidget base class for extension widgets. (diff) | |
| download | inkscape-3329abac70b6326839349c6438664dbc2a4a5548.tar.gz inkscape-3329abac70b6326839349c6438664dbc2a4a5548.zip | |
Rename Parameter -> InxParameter for consistency
Diffstat (limited to 'src/extension')
22 files changed, 90 insertions, 91 deletions
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 05a5f4402..83bfc7a8a 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -101,7 +101,7 @@ Extension::Extension (Inkscape::XML::Node *in_repr, Implementation::Implementati throw extension_no_name(); } } else if (!strcmp(chname, "param")) { - Parameter *param = Parameter::make(child_repr, this); + InxParameter *param = InxParameter::make(child_repr, this); if (param) { parameters.push_back(param); } @@ -405,7 +405,7 @@ const char *Extension::get_translation(const char *msgid, const char *msgctxt) { } } -Parameter *Extension::get_param(const gchar *name) +InxParameter *Extension::get_param(const gchar *name) { if (name == nullptr) { throw Extension::param_not_exist(); @@ -418,7 +418,7 @@ Parameter *Extension::get_param(const gchar *name) if (!strcmp(param->name(), name)) { return param; } else { - Parameter * subparam = param->get_param(name); + InxParameter * subparam = param->get_param(name); if (subparam) { return subparam; } @@ -429,7 +429,7 @@ Parameter *Extension::get_param(const gchar *name) throw Extension::param_not_exist(); } -Parameter const *Extension::get_param(const gchar *name) const +InxParameter const *Extension::get_param(const gchar *name) const { return const_cast<Extension *>(this)->get_param(name); } @@ -447,7 +447,7 @@ Parameter const *Extension::get_param(const gchar *name) const bool Extension::get_param_bool (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_bool(doc, node); } @@ -464,7 +464,7 @@ Extension::get_param_bool (const gchar *name, const SPDocument *doc, const Inksc int Extension::get_param_int (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_int(doc, node); } @@ -481,7 +481,7 @@ Extension::get_param_int (const gchar *name, const SPDocument *doc, const Inksca float Extension::get_param_float (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_float(doc, node); } @@ -498,7 +498,7 @@ Extension::get_param_float (const gchar *name, const SPDocument *doc, const Inks const char * Extension::get_param_string (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_string(doc, node); } @@ -515,7 +515,7 @@ Extension::get_param_string (const gchar *name, const SPDocument *doc, const Ink const char * Extension::get_param_optiongroup (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_optiongroup(doc, node); } @@ -531,7 +531,7 @@ Extension::get_param_optiongroup (const gchar *name, const SPDocument *doc, cons bool Extension::get_param_optiongroup_contains(const gchar *name, const char *value, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_optiongroup_contains(value, doc, node); } @@ -548,7 +548,7 @@ Extension::get_param_optiongroup_contains(const gchar *name, const char *value, guint32 Extension::get_param_color (const gchar *name, const SPDocument *doc, const Inkscape::XML::Node *node) const { - const Parameter *param; + const InxParameter *param; param = get_param(name); return param->get_color(doc, node); } @@ -566,7 +566,7 @@ Extension::get_param_color (const gchar *name, const SPDocument *doc, const Inks bool Extension::set_param_bool (const gchar *name, const bool value, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_bool(value, doc, node); } @@ -584,7 +584,7 @@ Extension::set_param_bool (const gchar *name, const bool value, SPDocument *doc, int Extension::set_param_int (const gchar *name, const int value, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_int(value, doc, node); } @@ -602,7 +602,7 @@ Extension::set_param_int (const gchar *name, const int value, SPDocument *doc, I float Extension::set_param_float (const gchar *name, const float value, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_float(value, doc, node); } @@ -620,7 +620,7 @@ Extension::set_param_float (const gchar *name, const float value, SPDocument *do const char * Extension::set_param_string (const gchar *name, const char *value, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_string(value, doc, node); } @@ -638,7 +638,7 @@ Extension::set_param_string (const gchar *name, const char *value, SPDocument *d const char * Extension::set_param_optiongroup (const gchar *name, const char *value, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_optiongroup(value, doc, node); } @@ -656,7 +656,7 @@ Look up in the parameters list, const then execute the function on that found pa guint32 Extension::set_param_color (const gchar *name, const guint32 color, SPDocument *doc, Inkscape::XML::Node *node) { - Parameter *param; + InxParameter *param; param = get_param(name); return param->set_color(color, doc, node); } @@ -702,7 +702,7 @@ public: */ void addWidget(Gtk::Widget *widg, gchar const *tooltip, int indent) { if (widg) { - widg->set_margin_start(indent * Parameter::GUI_INDENTATION); + widg->set_margin_start(indent * InxParameter::GUI_INDENTATION); this->pack_start(*widg, false, false, 0); if (tooltip) { widg->set_tooltip_text(tooltip); @@ -730,8 +730,8 @@ Extension::autogui (SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<voi if (!_gui || param_visible_count() == 0) return nullptr; AutoGUI * agui = Gtk::manage(new AutoGUI()); - agui->set_border_width(Parameter::GUI_BOX_MARGIN); - agui->set_spacing(Parameter::GUI_BOX_SPACING); + agui->set_border_width(InxParameter::GUI_BOX_MARGIN); + agui->set_spacing(InxParameter::GUI_BOX_SPACING); //go through the list of parameters to see if there are any non-hidden ones for (auto param:parameters) { diff --git a/src/extension/extension.h b/src/extension/extension.h index c09fec3a5..0868429b4 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -76,7 +76,7 @@ class ExecutionEnv; class Dependency; class ExpirationTimer; class ExpirationTimer; -class Parameter; +class InxParameter; namespace Implementation { @@ -138,9 +138,8 @@ public: /* Parameter Stuff */ private: - std::vector<Parameter *> parameters; /**< A table to store the parameters for this extension. - This only gets created if there are parameters in this - extension */ + std::vector<InxParameter *> parameters; /**< A table to store the parameters for this extension. + This only gets created if there are parameters in this extension */ public: /** \brief A function to get the number of parameters that @@ -195,9 +194,9 @@ private: * @param name The name to search for. * @return Parameter structure with a name of 'name'. */ - Parameter *get_param(const gchar * name); + InxParameter *get_param(const gchar * name); - Parameter const *get_param(const gchar * name) const; + InxParameter const *get_param(const gchar * name) const; public: bool get_param_bool (const gchar *name, diff --git a/src/extension/prefdialog/parameter-bool.cpp b/src/extension/prefdialog/parameter-bool.cpp index 56a1305ce..e1f242643 100644 --- a/src/extension/prefdialog/parameter-bool.cpp +++ b/src/extension/prefdialog/parameter-bool.cpp @@ -20,7 +20,7 @@ namespace Inkscape { namespace Extension { ParamBool::ParamBool(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get value if (xml->firstChild()) { diff --git a/src/extension/prefdialog/parameter-bool.h b/src/extension/prefdialog/parameter-bool.h index 5a73b42b3..3aefd03c0 100644 --- a/src/extension/prefdialog/parameter-bool.h +++ b/src/extension/prefdialog/parameter-bool.h @@ -27,7 +27,7 @@ namespace Extension { /** * A boolean parameter. */ -class ParamBool : public Parameter { +class ParamBool : public InxParameter { public: ParamBool(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext); @@ -55,7 +55,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } /** * Appends 'true' or 'false'. diff --git a/src/extension/prefdialog/parameter-color.cpp b/src/extension/prefdialog/parameter-color.cpp index b29f603f3..adb6c58a9 100644 --- a/src/extension/prefdialog/parameter-color.cpp +++ b/src/extension/prefdialog/parameter-color.cpp @@ -29,7 +29,7 @@ namespace Inkscape { namespace Extension { ParamColor::ParamColor(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get value unsigned int _value = 0x000000ff; // default to black diff --git a/src/extension/prefdialog/parameter-color.h b/src/extension/prefdialog/parameter-color.h index da78f5d61..552266e43 100644 --- a/src/extension/prefdialog/parameter-color.h +++ b/src/extension/prefdialog/parameter-color.h @@ -25,7 +25,7 @@ class Node; namespace Extension { -class ParamColor : public Parameter { +class ParamColor : public InxParameter { private: void _onColorChanged(); @@ -44,7 +44,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } void string (std::string &string) const override; diff --git a/src/extension/prefdialog/parameter-description.cpp b/src/extension/prefdialog/parameter-description.cpp index 9c6912d81..ca8825615 100644 --- a/src/extension/prefdialog/parameter-description.cpp +++ b/src/extension/prefdialog/parameter-description.cpp @@ -21,7 +21,7 @@ namespace Extension { ParamDescription::ParamDescription(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // construct the text content by concatenating all (non-empty) text nodes, // removing all other nodes (e.g. comment nodes) and replacing <extension:br> elements with "<br/>" diff --git a/src/extension/prefdialog/parameter-description.h b/src/extension/prefdialog/parameter-description.h index 7eac524a8..5ffec4de7 100644 --- a/src/extension/prefdialog/parameter-description.h +++ b/src/extension/prefdialog/parameter-description.h @@ -25,7 +25,7 @@ namespace Xml { namespace Extension { /** \brief A description parameter */ -class ParamDescription : public Parameter { +class ParamDescription : public InxParameter { public: enum AppearanceMode { DEFAULT, HEADER, URL diff --git a/src/extension/prefdialog/parameter-float.cpp b/src/extension/prefdialog/parameter-float.cpp index 852ac37ac..cdb5a4dd9 100644 --- a/src/extension/prefdialog/parameter-float.cpp +++ b/src/extension/prefdialog/parameter-float.cpp @@ -26,7 +26,7 @@ namespace Inkscape { namespace Extension { ParamFloat::ParamFloat(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get value if (xml->firstChild()) { diff --git a/src/extension/prefdialog/parameter-float.h b/src/extension/prefdialog/parameter-float.h index 0c42ef2bc..90dc7dba9 100644 --- a/src/extension/prefdialog/parameter-float.h +++ b/src/extension/prefdialog/parameter-float.h @@ -25,7 +25,7 @@ class Node; namespace Extension { -class ParamFloat : public Parameter { +class ParamFloat : public InxParameter { public: enum AppearanceMode { DEFAULT, FULL @@ -47,7 +47,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } void string(std::string &string) const override; diff --git a/src/extension/prefdialog/parameter-int.cpp b/src/extension/prefdialog/parameter-int.cpp index 4be385b2e..503fa9b43 100644 --- a/src/extension/prefdialog/parameter-int.cpp +++ b/src/extension/prefdialog/parameter-int.cpp @@ -27,7 +27,7 @@ namespace Extension { ParamInt::ParamInt(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get value if (xml->firstChild()) { diff --git a/src/extension/prefdialog/parameter-int.h b/src/extension/prefdialog/parameter-int.h index 30e34740c..e1a6d35ca 100644 --- a/src/extension/prefdialog/parameter-int.h +++ b/src/extension/prefdialog/parameter-int.h @@ -25,7 +25,7 @@ class Node; namespace Extension { -class ParamInt : public Parameter { +class ParamInt : public InxParameter { public: enum AppearanceMode { DEFAULT, FULL @@ -45,7 +45,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } void string(std::string &string) const override; diff --git a/src/extension/prefdialog/parameter-notebook.cpp b/src/extension/prefdialog/parameter-notebook.cpp index 2cbe8531a..0d64a4c32 100644 --- a/src/extension/prefdialog/parameter-notebook.cpp +++ b/src/extension/prefdialog/parameter-notebook.cpp @@ -36,7 +36,7 @@ namespace Extension { ParamNotebook::ParamNotebookPage::ParamNotebookPage(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // Read XML tree of page and parse parameters if (xml) { @@ -51,7 +51,7 @@ ParamNotebook::ParamNotebookPage::ParamNotebookPage(Inkscape::XML::Node *xml, In } if (!strcmp(chname, "param") || !strcmp(chname, "_param")) { - Parameter *param = Parameter::make(child_repr, ext); + InxParameter *param = InxParameter::make(child_repr, ext); if (param) { parameters.push_back(param); } @@ -114,7 +114,7 @@ Gtk::Widget *ParamNotebook::ParamNotebookPage::get_widget(SPDocument *doc, Inksc } /** Search the parameter's name in the page content. */ -Parameter *ParamNotebook::ParamNotebookPage::get_param(const gchar *name) +InxParameter *ParamNotebook::ParamNotebookPage::get_param(const gchar *name) { if (name == nullptr) { throw Extension::param_not_exist(); @@ -137,7 +137,7 @@ Parameter *ParamNotebook::ParamNotebookPage::get_param(const gchar *name) /** ParamNotebook **/ ParamNotebook::ParamNotebook(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // Read XML tree to add pages (allow _page for backwards compatibility) if (xml) { @@ -269,13 +269,13 @@ void NotebookWidget::changed_page(Gtk::Widget * /*page*/, guint pagenum) } /** Search the parameter's name in the notebook content. */ -Parameter *ParamNotebook::get_param(const gchar *name) +InxParameter *ParamNotebook::get_param(const gchar *name) { if (name == nullptr) { throw Extension::param_not_exist(); } for (auto page : pages) { - Parameter *subparam = page->get_param(name); + InxParameter *subparam = page->get_param(name); if (subparam) { return subparam; } diff --git a/src/extension/prefdialog/parameter-notebook.h b/src/extension/prefdialog/parameter-notebook.h index 303f5d2ce..cbf7e8625 100644 --- a/src/extension/prefdialog/parameter-notebook.h +++ b/src/extension/prefdialog/parameter-notebook.h @@ -35,7 +35,7 @@ class Extension; /** A class to represent a notebook parameter of an extension. */ -class ParamNotebook : public Parameter { +class ParamNotebook : public InxParameter { private: /** Internal value. */ Glib::ustring _value; @@ -43,12 +43,12 @@ private: /** * A class to represent the pages of a notebook parameter of an extension. */ - class ParamNotebookPage : public Parameter { + class ParamNotebookPage : public InxParameter { friend class ParamNotebook; private: /** A table to store the parameters for this page. * This only gets created if there are parameters on this page */ - std::vector<Parameter *> parameters; + std::vector<InxParameter *> parameters; public: ParamNotebookPage(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext); ~ParamNotebookPage() override; @@ -56,7 +56,7 @@ private: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; void paramString (std::list <std::string> &list); gchar *get_text () {return _text;}; - Parameter *get_param (const gchar *name) override; + InxParameter *get_param (const gchar *name) override; }; /* class ParamNotebookPage */ /** A table to store the pages with parameters for this notebook. @@ -76,10 +76,10 @@ public: void string (std::list <std::string> &list) const override; // Explicitly call superclass version to avoid method being hidden. - void string(std::string &string) const override {return Parameter::string(string);} + void string(std::string &string) const override {return InxParameter::string(string);} - Parameter *get_param (const gchar *name) override; + InxParameter *get_param (const gchar *name) override; const Glib::ustring& get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } const Glib::ustring& set (const int in, SPDocument *doc, Inkscape::XML::Node *node); diff --git a/src/extension/prefdialog/parameter-optiongroup.cpp b/src/extension/prefdialog/parameter-optiongroup.cpp index 07f60b897..6b6d3463b 100644 --- a/src/extension/prefdialog/parameter-optiongroup.cpp +++ b/src/extension/prefdialog/parameter-optiongroup.cpp @@ -35,7 +35,7 @@ namespace Inkscape { namespace Extension { ParamOptionGroup::ParamOptionGroup(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // Read valid optiongroup choices from XML tree, i,e. // - <option> elements @@ -298,7 +298,7 @@ Gtk::Widget *ParamOptionGroup::get_widget(SPDocument *doc, Inkscape::XML::Node * ParamOptionGroup::ParamOptionGroupOption::ParamOptionGroupOption(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext, const Inkscape::Extension::ParamOptionGroup *parent) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get content (=label) of option and translate it const char *text = nullptr; diff --git a/src/extension/prefdialog/parameter-optiongroup.h b/src/extension/prefdialog/parameter-optiongroup.h index 69715d4c1..96599c518 100644 --- a/src/extension/prefdialog/parameter-optiongroup.h +++ b/src/extension/prefdialog/parameter-optiongroup.h @@ -38,7 +38,7 @@ class Extension; // \brief A class to represent an optiongroup (option with multiple predefined value choices) parameter of an extension -class ParamOptionGroup : public Parameter { +class ParamOptionGroup : public InxParameter { public: enum AppearanceMode { RADIOBUTTON, COMBOBOX @@ -50,7 +50,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } void string(std::string &string) const override; @@ -74,7 +74,7 @@ private: AppearanceMode _mode = RADIOBUTTON; /* For internal use only. */ - class ParamOptionGroupOption : public Parameter { + class ParamOptionGroupOption : public InxParameter { friend class ParamOptionGroup; public: ParamOptionGroupOption(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext, diff --git a/src/extension/prefdialog/parameter-string.cpp b/src/extension/prefdialog/parameter-string.cpp index b62fae499..63d1a7fab 100644 --- a/src/extension/prefdialog/parameter-string.cpp +++ b/src/extension/prefdialog/parameter-string.cpp @@ -20,7 +20,7 @@ namespace Inkscape { namespace Extension { ParamString::ParamString(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext) - : Parameter(xml, ext) + : InxParameter(xml, ext) { // get value const char *value = nullptr; diff --git a/src/extension/prefdialog/parameter-string.h b/src/extension/prefdialog/parameter-string.h index 476807936..fdf20db72 100644 --- a/src/extension/prefdialog/parameter-string.h +++ b/src/extension/prefdialog/parameter-string.h @@ -19,7 +19,7 @@ class ustring; namespace Inkscape { namespace Extension { -class ParamString : public Parameter { +class ParamString : public InxParameter { public: ParamString(Inkscape::XML::Node *xml, Inkscape::Extension::Extension *ext); @@ -30,7 +30,7 @@ public: Gtk::Widget *get_widget(SPDocument *doc, Inkscape::XML::Node *node, sigc::signal<void> *changeSignal) override; // Explicitly call superclass version to avoid method being hidden. - void string(std::list <std::string> &list) const override { return Parameter::string(list); } + void string(std::list <std::string> &list) const override { return InxParameter::string(list); } void string(std::string &string) const override; diff --git a/src/extension/prefdialog/parameter.cpp b/src/extension/prefdialog/parameter.cpp index c60928752..6a9c744b3 100644 --- a/src/extension/prefdialog/parameter.cpp +++ b/src/extension/prefdialog/parameter.cpp @@ -41,9 +41,9 @@ namespace Inkscape { namespace Extension { -Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *in_ext) +InxParameter *InxParameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *in_ext) { - Parameter *param = nullptr; + InxParameter *param = nullptr; const char *type = in_repr->attribute("type"); if (!type) { @@ -76,7 +76,7 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex return param; } -bool Parameter::get_bool(SPDocument const *doc, Inkscape::XML::Node const *node) const +bool InxParameter::get_bool(SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamBool const *boolpntr = dynamic_cast<ParamBool const *>(this); if (!boolpntr) { @@ -85,7 +85,7 @@ bool Parameter::get_bool(SPDocument const *doc, Inkscape::XML::Node const *node) return boolpntr->get(doc, node); } -int Parameter::get_int(SPDocument const *doc, Inkscape::XML::Node const *node) const +int InxParameter::get_int(SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamInt const *intpntr = dynamic_cast<ParamInt const *>(this); if (!intpntr) { @@ -94,7 +94,7 @@ int Parameter::get_int(SPDocument const *doc, Inkscape::XML::Node const *node) c return intpntr->get(doc, node); } -float Parameter::get_float(SPDocument const *doc, Inkscape::XML::Node const *node) const +float InxParameter::get_float(SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamFloat const *floatpntr = dynamic_cast<ParamFloat const *>(this); if (!floatpntr) { @@ -103,7 +103,7 @@ float Parameter::get_float(SPDocument const *doc, Inkscape::XML::Node const *nod return floatpntr->get(doc, node); } -const char *Parameter::get_string(SPDocument const *doc, Inkscape::XML::Node const *node) const +const char *InxParameter::get_string(SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamString const *stringpntr = dynamic_cast<ParamString const *>(this); if (!stringpntr) { @@ -112,7 +112,7 @@ const char *Parameter::get_string(SPDocument const *doc, Inkscape::XML::Node con return stringpntr->get(doc, node).c_str(); } -const char *Parameter::get_optiongroup(SPDocument const *doc, Inkscape::XML::Node const *node) const +const char *InxParameter::get_optiongroup(SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamOptionGroup const *param = dynamic_cast<ParamOptionGroup const *>(this); if (!param) { @@ -121,7 +121,7 @@ const char *Parameter::get_optiongroup(SPDocument const *doc, Inkscape::XML::Nod return param->get(doc, node).c_str(); } -bool Parameter::get_optiongroup_contains(const char *value, SPDocument const *doc, Inkscape::XML::Node const *node) const +bool InxParameter::get_optiongroup_contains(const char *value, SPDocument const *doc, Inkscape::XML::Node const *node) const { ParamOptionGroup const *param = dynamic_cast<ParamOptionGroup const *>(this); if (!param) { @@ -130,7 +130,7 @@ bool Parameter::get_optiongroup_contains(const char *value, SPDocument const *do return param->contains(value, doc, node); } -guint32 Parameter::get_color(const SPDocument* doc, Inkscape::XML::Node const *node) const +guint32 InxParameter::get_color(const SPDocument* doc, Inkscape::XML::Node const *node) const { ParamColor const *param = dynamic_cast<ParamColor const *>(this); if (!param) { @@ -139,7 +139,7 @@ guint32 Parameter::get_color(const SPDocument* doc, Inkscape::XML::Node const *n return param->get(doc, node); } -bool Parameter::set_bool(bool in, SPDocument *doc, Inkscape::XML::Node *node) +bool InxParameter::set_bool(bool in, SPDocument *doc, Inkscape::XML::Node *node) { ParamBool * boolpntr = dynamic_cast<ParamBool *>(this); if (boolpntr == nullptr) @@ -147,7 +147,7 @@ bool Parameter::set_bool(bool in, SPDocument *doc, Inkscape::XML::Node *node) return boolpntr->set(in, doc, node); } -int Parameter::set_int(int in, SPDocument *doc, Inkscape::XML::Node *node) +int InxParameter::set_int(int in, SPDocument *doc, Inkscape::XML::Node *node) { ParamInt *intpntr = dynamic_cast<ParamInt *>(this); if (intpntr == nullptr) @@ -155,7 +155,7 @@ int Parameter::set_int(int in, SPDocument *doc, Inkscape::XML::Node *node) return intpntr->set(in, doc, node); } -float Parameter::set_float(float in, SPDocument *doc, Inkscape::XML::Node *node) +float InxParameter::set_float(float in, SPDocument *doc, Inkscape::XML::Node *node) { ParamFloat * floatpntr; floatpntr = dynamic_cast<ParamFloat *>(this); @@ -164,7 +164,7 @@ float Parameter::set_float(float in, SPDocument *doc, Inkscape::XML::Node *node) return floatpntr->set(in, doc, node); } -const char *Parameter::set_string(const char *in, SPDocument *doc, Inkscape::XML::Node *node) +const char *InxParameter::set_string(const char *in, SPDocument *doc, Inkscape::XML::Node *node) { ParamString * stringpntr = dynamic_cast<ParamString *>(this); if (stringpntr == nullptr) @@ -172,7 +172,7 @@ const char *Parameter::set_string(const char *in, SPDocument *doc, Inkscape::XML return stringpntr->set(in, doc, node).c_str(); } -const char *Parameter::set_optiongroup(const char *in, SPDocument *doc, Inkscape::XML::Node *node) +const char *InxParameter::set_optiongroup(const char *in, SPDocument *doc, Inkscape::XML::Node *node) { ParamOptionGroup *param = dynamic_cast<ParamOptionGroup *>(this); if (!param) { @@ -181,7 +181,7 @@ const char *Parameter::set_optiongroup(const char *in, SPDocument *doc, Inkscape return param->set(in, doc, node).c_str(); } -guint32 Parameter::set_color(guint32 in, SPDocument *doc, Inkscape::XML::Node *node) +guint32 InxParameter::set_color(guint32 in, SPDocument *doc, Inkscape::XML::Node *node) { ParamColor*param = dynamic_cast<ParamColor *>(this); if (param == nullptr) @@ -190,7 +190,7 @@ guint32 Parameter::set_color(guint32 in, SPDocument *doc, Inkscape::XML::Node *n } -Parameter::Parameter (Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *ext) +InxParameter::InxParameter(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *ext) : InxWidget(in_repr, ext) { // name (mandatory for all paramters) @@ -225,7 +225,7 @@ Parameter::Parameter (Inkscape::XML::Node *in_repr, Inkscape::Extension::Extensi } } -Parameter::~Parameter() +InxParameter::~InxParameter() { g_free(_name); _name = nullptr; @@ -237,18 +237,18 @@ Parameter::~Parameter() _description = nullptr; } -gchar *Parameter::pref_name() const +gchar *InxParameter::pref_name() const { return g_strdup_printf("%s.%s", _extension->get_id(), _name); } /** If I'm not sure which it is, just don't return a value. */ -void Parameter::string(std::string &/*string*/) const +void InxParameter::string(std::string &/*string*/) const { // TODO investigate clearing the target string. } -void Parameter::string(std::list <std::string> &list) const +void InxParameter::string(std::list <std::string> &list) const { std::string value; string(value); @@ -263,7 +263,7 @@ void Parameter::string(std::list <std::string> &list) const } } -Parameter *Parameter::get_param(const gchar */*name*/) +InxParameter *InxParameter::get_param(const gchar */*name*/) { return nullptr; } diff --git a/src/extension/prefdialog/parameter.h b/src/extension/prefdialog/parameter.h index 822c93416..7db7b9a3f 100644 --- a/src/extension/prefdialog/parameter.h +++ b/src/extension/prefdialog/parameter.h @@ -36,12 +36,12 @@ extern Glib::ustring const extension_pref_root; * around. There is also a few functions that are used by all the * different parameters. */ -class Parameter : public InxWidget { +class InxParameter : public InxWidget { public: - Parameter(Inkscape::XML::Node *in_repr, - Inkscape::Extension::Extension *ext); + InxParameter(Inkscape::XML::Node *in_repr, + Inkscape::Extension::Extension *ext); - virtual ~Parameter(); + virtual ~InxParameter(); /** Wrapper to cast to the object and use its function. */ bool get_bool(SPDocument const *doc, Inkscape::XML::Node const *node) const; @@ -104,9 +104,9 @@ public: * value from the XML and the type is set to the interpreted type. * * @param in_repr The XML describing the parameter. - * @return a pointer to a new Parameter if applicable, null otherwise.. + * @return a pointer to a new parameter if applicable, null otherwise.. */ - static Parameter *make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *in_ext); + static InxParameter *make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *in_ext); const gchar *get_tooltip() const { return _description; } @@ -119,7 +119,7 @@ public: virtual void string(std::string &string) const; /** All the code in Notebook::get_param to get the notebook content. */ - virtual Parameter *get_param(gchar const *name); + virtual InxParameter *get_param(gchar const *name); /** Recommended spacing between the widgets making up a single Parameter (e.g. label and input) (in px) */ diff --git a/src/extension/prefdialog/prefdialog.cpp b/src/extension/prefdialog/prefdialog.cpp index 66aaccc62..81d798744 100644 --- a/src/extension/prefdialog/prefdialog.cpp +++ b/src/extension/prefdialog/prefdialog.cpp @@ -81,7 +81,7 @@ PrefDialog::PrefDialog (Glib::ustring name, Gtk::Widget * controls, Effect * eff std::cout << "Error encountered loading live parameter XML !!!" << std::endl; return; } - _param_preview = Parameter::make(doc->root(), _effect); + _param_preview = InxParameter::make(doc->root(), _effect); } auto sep = Gtk::manage(new Gtk::Separator()); diff --git a/src/extension/prefdialog/prefdialog.h b/src/extension/prefdialog/prefdialog.h index 57d33bb28..9fe8acda8 100644 --- a/src/extension/prefdialog/prefdialog.h +++ b/src/extension/prefdialog/prefdialog.h @@ -23,7 +23,7 @@ namespace Inkscape { namespace Extension { class Effect; class ExecutionEnv; -class Parameter; +class InxParameter; /** \brief A class to represent the preferences for an extension */ class PrefDialog : public Gtk::Dialog { @@ -41,7 +41,7 @@ class PrefDialog : public Gtk::Dialog { Gtk::CheckButton *_checkbox_preview; /** \brief Parameter to control live preview */ - Parameter *_param_preview; + InxParameter *_param_preview; /** \brief XML to define the live effects parameter on the dialog */ static const char * live_param_xml; |
