From 34a1f9ad048c2aec2149e0bdaca5e66fca8de442 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:20:24 +0200 Subject: Remove unused field "gui_tip" ("gui_description" does now what "gui_tip" was supposed to do) (bzr r15633.1.1) --- src/extension/param/bool.cpp | 3 +-- src/extension/param/bool.h | 1 - src/extension/param/color.cpp | 3 +-- src/extension/param/color.h | 1 - src/extension/param/description.cpp | 3 +-- src/extension/param/description.h | 1 - src/extension/param/enum.cpp | 3 +-- src/extension/param/enum.h | 1 - src/extension/param/float.cpp | 3 +-- src/extension/param/float.h | 1 - src/extension/param/int.cpp | 3 +-- src/extension/param/int.h | 1 - src/extension/param/notebook.cpp | 13 +++--------- src/extension/param/notebook.h | 1 - src/extension/param/parameter.cpp | 40 +++++++++++++------------------------ src/extension/param/parameter.h | 4 ---- src/extension/param/radiobutton.cpp | 3 +-- src/extension/param/radiobutton.h | 1 - src/extension/param/string.cpp | 3 +-- src/extension/param/string.h | 1 - 20 files changed, 25 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index a2f4f82c2..612bf0331 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -29,11 +29,10 @@ ParamBool::ParamBool(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(false) { const char * defaultval = NULL; diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index 0af12b105..8a7887cc6 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -37,7 +37,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index fd88e9adb..6f6582b82 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -57,11 +57,10 @@ ParamColor::ParamColor(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _changeSignal(0) { const char * defaulthex = NULL; diff --git a/src/extension/param/color.h b/src/extension/param/color.h index d6e9d1fbe..184d57b28 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -36,7 +36,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 480a0898a..0f3c92dd8 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -33,12 +33,11 @@ ParamDescription::ParamDescription(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(NULL) , _mode(mode) , _preserve_whitespace(false) diff --git a/src/extension/param/description.h b/src/extension/param/description.h index 91342fa6a..c065e5415 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -34,7 +34,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 7a79e32bb..d93ed4b5a 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -51,11 +51,10 @@ ParamComboBox::ParamComboBox(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(NULL) , choices(NULL) { diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index f9d3d75f7..b54815227 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -42,7 +42,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index e9bb45c2e..574c147b6 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -32,12 +32,11 @@ ParamFloat::ParamFloat(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(0.0) , _mode(mode) , _min(0.0) diff --git a/src/extension/param/float.h b/src/extension/param/float.h index 7fd86cea7..b81b7ff08 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -34,7 +34,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index e81b0a526..c76493a26 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -32,12 +32,11 @@ ParamInt::ParamInt(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(0) , _mode(mode) , _min(0) diff --git a/src/extension/param/int.h b/src/extension/param/int.h index 40c0395ec..ae307c371 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -34,7 +34,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index de86d1005..2e216e967 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -59,7 +59,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); @@ -76,10 +75,9 @@ ParamNotebookPage::ParamNotebookPage(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, /*indent*/ 0, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -157,15 +155,11 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: Parameter::_scope_t scope = Parameter::SCOPE_USER; bool gui_hidden = false; const char * gui_hide; - const char * gui_tip; name = in_repr->attribute("name"); guitext = in_repr->attribute("gui-text"); if (guitext == NULL) guitext = in_repr->attribute("_gui-text"); - gui_tip = in_repr->attribute("gui-tip"); - if (gui_tip == NULL) - gui_tip = in_repr->attribute("_gui-tip"); desc = in_repr->attribute("gui-description"); if (desc == NULL) desc = in_repr->attribute("_gui-description"); @@ -194,7 +188,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: } } - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, gui_tip, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -251,11 +245,10 @@ ParamNotebook::ParamNotebook(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) { pages = NULL; diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index 278c4de12..0b3a2ba85 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -46,7 +46,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 2c72c61df..a0488142e 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -77,10 +77,6 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex } } } - const char *gui_tip = in_repr->attribute("gui-tip"); - if (gui_tip == NULL) { - gui_tip = in_repr->attribute("_gui-tip"); - } const char *desc = in_repr->attribute("gui-description"); if (desc == NULL) { desc = in_repr->attribute("_gui-description"); @@ -125,21 +121,21 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex Parameter * param = NULL; if (!strcmp(type, "boolean")) { - param = new ParamBool(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); + param = new ParamBool(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "int")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamInt(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamInt::FULL); + param = new ParamInt(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamInt::FULL); } else { - param = new ParamInt(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamInt::MINIMAL); + param = new ParamInt(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamInt::MINIMAL); } } else if (!strcmp(type, "float")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamFloat(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamFloat::FULL); + param = new ParamFloat(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamFloat::FULL); } else { - param = new ParamFloat(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamFloat::MINIMAL); + param = new ParamFloat(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamFloat::MINIMAL); } } else if (!strcmp(type, "string")) { - param = new ParamString(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); + param = new ParamString(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); gchar const * max_length = in_repr->attribute("max_length"); if (max_length != NULL) { ParamString * ps = dynamic_cast(param); @@ -154,19 +150,19 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex appearance_mode = ParamDescription::URL; } } - param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, appearance_mode); + param = new ParamDescription(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, appearance_mode); } else if (!strcmp(type, "enum")) { - param = new ParamComboBox(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); + param = new ParamComboBox(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "notebook")) { - param = new ParamNotebook(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); + param = new ParamNotebook(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "optiongroup")) { if (appearance && !strcmp(appearance, "minimal")) { - param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); + param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); } else { - param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamRadioButton::FULL); + param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::FULL); } } else if (!strcmp(type, "color")) { - param = new ParamColor(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); + param = new ParamColor(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); } // Note: param could equal NULL @@ -313,12 +309,11 @@ Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) /** Oop, now that we need a parameter, we need it's name. */ -Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * desc, const Parameter::_scope_t scope, bool gui_hidden, gchar const * gui_tip, int indent, Inkscape::Extension::Extension * ext) : +Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * desc, const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext) : _desc(0), _scope(scope), _text(0), _gui_hidden(gui_hidden), - _gui_tip(0), _indent(indent), extension(ext), _name(0) @@ -326,12 +321,9 @@ Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * de if (name != NULL) { _name = g_strdup(name); } + if (desc != NULL) { _desc = g_strdup(desc); -// printf("Adding description: '%s' on '%s'\n", _desc, _name); - } - if (gui_tip != NULL) { - _gui_tip = g_strdup(gui_tip); } if (guitext != NULL) { @@ -349,7 +341,6 @@ Parameter::Parameter (gchar const * name, gchar const * guitext, Inkscape::Exten _scope(Parameter::SCOPE_USER), _text(0), _gui_hidden(false), - _gui_tip(0), _indent(0), extension(ext), _name(0) @@ -374,9 +365,6 @@ Parameter::~Parameter(void) g_free(_text); _text = 0; - g_free(_gui_tip); - _gui_tip = 0; - g_free(_desc); _desc = 0; } diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index c107f24f9..8888fb15b 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -61,7 +61,6 @@ public: gchar const *desc, const Parameter::_scope_t scope, bool gui_hidden, - gchar const *gui_tip, int indent, Inkscape::Extension::Extension * ext); @@ -185,9 +184,6 @@ protected: /** Whether the GUI is visible. */ bool _gui_hidden; - /** A tip for the GUI if there is one. */ - gchar * _gui_tip; - /** Indentation level of the parameter. */ int _indent; diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index df3c37e55..37d580381 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -62,12 +62,11 @@ ParamRadioButton::ParamRadioButton(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(0) , _mode(mode) , choices(0) diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index 5e15dcb57..185ec6a26 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -39,7 +39,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index 86895f217..ad2968503 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -81,11 +81,10 @@ ParamString::ParamString(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) , _value(NULL) { const char * defaultval = NULL; diff --git a/src/extension/param/string.h b/src/extension/param/string.h index f5412ebcc..e2721582b 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -28,7 +28,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); -- cgit v1.2.3 From f0ad38f6fd0d18f48d92df4b55ff8352747e6b2c Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:39:40 +0200 Subject: Remove unused field "scope" (bzr r15633.1.2) --- src/extension/internal/bluredge.cpp | 4 ++-- src/extension/param/bool.cpp | 3 +-- src/extension/param/bool.h | 1 - src/extension/param/color.cpp | 3 +-- src/extension/param/color.h | 1 - src/extension/param/description.cpp | 3 +-- src/extension/param/description.h | 1 - src/extension/param/enum.cpp | 3 +-- src/extension/param/enum.h | 1 - src/extension/param/float.cpp | 3 +-- src/extension/param/float.h | 1 - src/extension/param/int.cpp | 3 +-- src/extension/param/int.h | 1 - src/extension/param/notebook.cpp | 22 +++---------------- src/extension/param/notebook.h | 1 - src/extension/param/parameter.cpp | 42 ++++++++++++------------------------- src/extension/param/parameter.h | 12 ----------- src/extension/param/radiobutton.cpp | 3 +-- src/extension/param/radiobutton.h | 1 - src/extension/param/string.cpp | 3 +-- src/extension/param/string.h | 1 - src/extension/prefdialog.cpp | 2 +- 22 files changed, 27 insertions(+), 88 deletions(-) (limited to 'src') diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index 8aa982810..d1fe357da 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -131,8 +131,8 @@ BlurEdge::init (void) "\n" "" N_("Inset/Outset Halo") "\n" "org.inkscape.effect.bluredge\n" - "1.0\n" - "11\n" + "1.0\n" + "11\n" "\n" "all\n" "\n" diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 612bf0331..05f896a2d 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -27,12 +27,11 @@ namespace Extension { ParamBool::ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(false) { const char * defaultval = NULL; diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index 8a7887cc6..de6542d64 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -35,7 +35,6 @@ public: ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 6f6582b82..064a465b7 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -55,12 +55,11 @@ guint32 ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * ParamColor::ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _changeSignal(0) { const char * defaulthex = NULL; diff --git a/src/extension/param/color.h b/src/extension/param/color.h index 184d57b28..222eb13f3 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -34,7 +34,6 @@ public: ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 0f3c92dd8..48e95aa2a 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -31,13 +31,12 @@ namespace Extension { ParamDescription::ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(NULL) , _mode(mode) , _preserve_whitespace(false) diff --git a/src/extension/param/description.h b/src/extension/param/description.h index c065e5415..64fbef5e5 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -32,7 +32,6 @@ public: ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index d93ed4b5a..377bb0f57 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -49,12 +49,11 @@ public: ParamComboBox::ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(NULL) , choices(NULL) { diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index b54815227..e66274485 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -40,7 +40,6 @@ public: ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 574c147b6..8c54d4a4a 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -30,13 +30,12 @@ namespace Extension { ParamFloat::ParamFloat(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(0.0) , _mode(mode) , _min(0.0) diff --git a/src/extension/param/float.h b/src/extension/param/float.h index b81b7ff08..0f0078dae 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -32,7 +32,6 @@ public: ParamFloat(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index c76493a26..e179484d3 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -30,13 +30,12 @@ namespace Extension { ParamInt::ParamInt(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(0) , _mode(mode) , _min(0) diff --git a/src/extension/param/int.h b/src/extension/param/int.h index ae307c371..7b6588139 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -32,7 +32,6 @@ public: ParamInt(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 2e216e967..c61733d26 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -57,7 +57,6 @@ public: ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); @@ -73,11 +72,10 @@ public: ParamNotebookPage::ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, /*indent*/ 0, ext) + : Parameter(name, guitext, desc, gui_hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -151,8 +149,6 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: const char * name; const char * guitext; const char * desc; - const char * scope_str; - Parameter::_scope_t scope = Parameter::SCOPE_USER; bool gui_hidden = false; const char * gui_hide; @@ -163,7 +159,6 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: desc = in_repr->attribute("gui-description"); if (desc == NULL) desc = in_repr->attribute("_gui-description"); - scope_str = in_repr->attribute("scope"); gui_hide = in_repr->attribute("gui-hidden"); if (gui_hide != NULL) { if (strcmp(gui_hide, "1") == 0 || @@ -178,17 +173,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: return NULL; } - if (scope_str != NULL) { - if (!strcmp(scope_str, "user")) { - scope = Parameter::SCOPE_USER; - } else if (!strcmp(scope_str, "document")) { - scope = Parameter::SCOPE_DOCUMENT; - } else if (!strcmp(scope_str, "node")) { - scope = Parameter::SCOPE_NODE; - } - } - - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, gui_hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -243,12 +228,11 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod ParamNotebook::ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) { pages = NULL; diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index 0b3a2ba85..cfecdbbb3 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -44,7 +44,6 @@ public: ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index a0488142e..8d77830c4 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -105,37 +105,23 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex } const gchar* appearance = in_repr->attribute("appearance"); - Parameter::_scope_t scope = Parameter::SCOPE_USER; - { - const char *scope_str = in_repr->attribute("scope"); - if (scope_str != NULL) { - if (!strcmp(scope_str, "user")) { - scope = Parameter::SCOPE_USER; - } else if (!strcmp(scope_str, "document")) { - scope = Parameter::SCOPE_DOCUMENT; - } else if (!strcmp(scope_str, "node")) { - scope = Parameter::SCOPE_NODE; - } - } - } - Parameter * param = NULL; if (!strcmp(type, "boolean")) { - param = new ParamBool(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); + param = new ParamBool(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "int")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamInt(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamInt::FULL); + param = new ParamInt(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamInt::FULL); } else { - param = new ParamInt(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamInt::MINIMAL); + param = new ParamInt(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamInt::MINIMAL); } } else if (!strcmp(type, "float")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamFloat(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamFloat::FULL); + param = new ParamFloat(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamFloat::FULL); } else { - param = new ParamFloat(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamFloat::MINIMAL); + param = new ParamFloat(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamFloat::MINIMAL); } } else if (!strcmp(type, "string")) { - param = new ParamString(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); + param = new ParamString(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); gchar const * max_length = in_repr->attribute("max_length"); if (max_length != NULL) { ParamString * ps = dynamic_cast(param); @@ -150,19 +136,19 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex appearance_mode = ParamDescription::URL; } } - param = new ParamDescription(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, appearance_mode); + param = new ParamDescription(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, appearance_mode); } else if (!strcmp(type, "enum")) { - param = new ParamComboBox(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); + param = new ParamComboBox(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "notebook")) { - param = new ParamNotebook(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); + param = new ParamNotebook(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "optiongroup")) { if (appearance && !strcmp(appearance, "minimal")) { - param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); + param = new ParamRadioButton(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); } else { - param = new ParamRadioButton(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::FULL); + param = new ParamRadioButton(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::FULL); } } else if (!strcmp(type, "color")) { - param = new ParamColor(name, guitext, desc, scope, gui_hidden, indent, in_ext, in_repr); + param = new ParamColor(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); } // Note: param could equal NULL @@ -309,9 +295,8 @@ Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) /** Oop, now that we need a parameter, we need it's name. */ -Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * desc, const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext) : +Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * desc, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext) : _desc(0), - _scope(scope), _text(0), _gui_hidden(gui_hidden), _indent(indent), @@ -338,7 +323,6 @@ Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * de /** Oop, now that we need a parameter, we need it's name. */ Parameter::Parameter (gchar const * name, gchar const * guitext, Inkscape::Extension::Extension * ext) : _desc(0), - _scope(Parameter::SCOPE_USER), _text(0), _gui_hidden(false), _indent(0), diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index 8888fb15b..4994a6971 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -47,19 +47,10 @@ extern Glib::ustring const extension_pref_root; */ class Parameter { -protected: - /** List of possible scopes. */ - typedef enum { - SCOPE_USER, /**< Parameter value is saved in the user's configuration file. (default) */ - SCOPE_DOCUMENT, /**< Parameter value is saved in the document. */ - SCOPE_NODE /**< Parameter value is attached to the node. */ - } _scope_t; - public: Parameter(gchar const *name, gchar const *guitext, gchar const *desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext); @@ -175,9 +166,6 @@ protected: /** Description of the parameter. */ gchar * _desc; - /** Scope of the parameter. */ - _scope_t _scope; - /** Text for the GUI selection of this. */ gchar * _text; diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 37d580381..166167fda 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -60,13 +60,12 @@ public: ParamRadioButton::ParamRadioButton(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(0) , _mode(mode) , choices(0) diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index 185ec6a26..f41852baa 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -37,7 +37,6 @@ public: ParamRadioButton(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index ad2968503..22893cd0a 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -79,12 +79,11 @@ void ParamString::string(std::string &string) const ParamString::ParamString(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) , _value(NULL) { const char * defaultval = NULL; diff --git a/src/extension/param/string.h b/src/extension/param/string.h index e2721582b..2dc1bd483 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -26,7 +26,6 @@ public: ParamString(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index 2bdbb081e..92ddd3050 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -246,7 +246,7 @@ PrefDialog::on_response (int signal) { #include "internal/clear-n_.h" -const char * PrefDialog::live_param_xml = "false"; +const char * PrefDialog::live_param_xml = "false"; }; }; /* namespace Inkscape, Extension */ -- cgit v1.2.3 From bc1ecf9dd11d0b3bb6939114ce6aec229fc86548 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 16:46:33 +0200 Subject: Some code refactoring for consistency (notably "gui_hidden" -> hidden", "guitext" -> "text", "desc" -> "description") (bzr r15633.1.3) --- src/extension/extension.cpp | 6 +-- src/extension/param/bool.cpp | 10 ++--- src/extension/param/bool.h | 6 +-- src/extension/param/color.cpp | 10 ++--- src/extension/param/color.h | 6 +-- src/extension/param/description.cpp | 30 ++++++------- src/extension/param/description.h | 8 ++-- src/extension/param/enum.cpp | 44 +++++++++---------- src/extension/param/enum.h | 10 ++--- src/extension/param/float.cpp | 10 ++--- src/extension/param/float.h | 6 +-- src/extension/param/int.cpp | 10 ++--- src/extension/param/int.h | 6 +-- src/extension/param/notebook.cpp | 62 +++++++++++++------------- src/extension/param/notebook.h | 6 +-- src/extension/param/parameter.cpp | 88 ++++++++++++++++++------------------- src/extension/param/parameter.h | 26 +++++------ src/extension/param/radiobutton.cpp | 34 +++++++------- src/extension/param/radiobutton.h | 6 +-- src/extension/param/string.cpp | 10 ++--- src/extension/param/string.h | 6 +-- 21 files changed, 200 insertions(+), 200 deletions(-) (limited to 'src') diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 6c6e2d71e..ebdc83b94 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -718,7 +718,7 @@ public: a Gtk::VBox, which is then returned to the calling function. If there are no visible parameters, this function just returns NULL. - If all parameters are gui_visible = false NULL is returned as well. + If all parameters are gui_hidden = true NULL is returned as well. */ Gtk::Widget * Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) @@ -732,7 +732,7 @@ Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal(list->data); - if (param->get_gui_hidden()) continue; //Ignore hidden parameters + if (param->get_hidden()) continue; //Ignore hidden parameters Gtk::Widget * widg = param->get_widget(doc, node, changeSignal); gchar const * tip = param->get_tooltip(); int indent = param->get_indent(); @@ -837,7 +837,7 @@ unsigned int Extension::param_visible_count ( ) unsigned int _visible_count = 0; for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) { Parameter * param = reinterpret_cast(list->data); - if (!param->get_gui_hidden()) _visible_count++; + if (!param->get_hidden()) _visible_count++; } return _visible_count; } diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 05f896a2d..bfff6015c 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -25,13 +25,13 @@ namespace Inkscape { namespace Extension { ParamBool::ParamBool(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(false) { const char * defaultval = NULL; @@ -127,7 +127,7 @@ void ParamBool::string(std::string &string) const Gtk::Widget *ParamBool::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index de6542d64..826a98927 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -33,9 +33,9 @@ public: * Use the superclass' allocator and set the \c _value. */ ParamBool(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 064a465b7..035c43ba8 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -53,13 +53,13 @@ guint32 ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * } ParamColor::ParamColor(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _changeSignal(0) { const char * defaulthex = NULL; @@ -92,7 +92,7 @@ Gtk::Widget *ParamColor::get_widget( SPDocument * /*doc*/, Inkscape::XML::Node * { using Inkscape::UI::Widget::ColorNotebook; - if (_gui_hidden) return NULL; + if (_hidden) return NULL; if (changeSignal) { _changeSignal = new sigc::signal(*changeSignal); diff --git a/src/extension/param/color.h b/src/extension/param/color.h index 222eb13f3..890f5ba5f 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -32,9 +32,9 @@ private: sigc::connection _color_changed; public: ParamColor(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 48e95aa2a..1b3f64ec6 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -29,14 +29,14 @@ namespace Extension { /** \brief Initialize the object, to do that, copy the data. */ ParamDescription::ParamDescription(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(NULL) , _mode(mode) , _preserve_whitespace(false) @@ -69,44 +69,44 @@ ParamDescription::ParamDescription(const gchar * name, Gtk::Widget * ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { - if (_gui_hidden) { + if (_hidden) { return NULL; } if (_value == NULL) { return NULL; } - Glib::ustring newguitext = _value; + Glib::ustring newtext = _value; // do replacements in the source string matching those performed by xgettext to allow for proper translation if (_preserve_whitespace) { // xgettext copies the source string verbatim in this case, so no changes needed } else { // remove all whitespace from start/end of string and replace intermediate whitespace with a single space - newguitext = Glib::Regex::create("^\\s+|\\s+$")->replace_literal(newguitext, 0, "", (Glib::RegexMatchFlags)0); - newguitext = Glib::Regex::create("\\s+")->replace_literal(newguitext, 0, " ", (Glib::RegexMatchFlags)0); + newtext = Glib::Regex::create("^\\s+|\\s+$")->replace_literal(newtext, 0, "", (Glib::RegexMatchFlags)0); + newtext = Glib::Regex::create("\\s+")->replace_literal(newtext, 0, " ", (Glib::RegexMatchFlags)0); } // translate if (_context != NULL) { - newguitext = g_dpgettext2(NULL, _context, newguitext.c_str()); + newtext = g_dpgettext2(NULL, _context, newtext.c_str()); } else { - newguitext = _(newguitext.c_str()); + newtext = _(newtext.c_str()); } // finally replace all remaining
with a real newline character - newguitext = Glib::Regex::create("
")->replace_literal(newguitext, 0, "\n", (Glib::RegexMatchFlags)0); + newtext = Glib::Regex::create("
")->replace_literal(newtext, 0, "\n", (Glib::RegexMatchFlags)0); Gtk::Label * label = Gtk::manage(new Gtk::Label()); if (_mode == HEADER) { - label->set_markup(Glib::ustring("") + Glib::Markup::escape_text(newguitext) + Glib::ustring("")); + label->set_markup(Glib::ustring("") + Glib::Markup::escape_text(newtext) + Glib::ustring("")); label->set_margin_top(5); label->set_margin_bottom(5); } else if (_mode == URL) { - Glib::ustring escaped_url = Glib::Markup::escape_text(newguitext); + Glib::ustring escaped_url = Glib::Markup::escape_text(newtext); label->set_markup(Glib::ustring::compose("%1", escaped_url)); } else { - label->set_text(newguitext); + label->set_text(newtext); } label->set_line_wrap(); #if (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION >= 16) @@ -123,7 +123,7 @@ ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node // - Here we set a lower limit of GUI_MAX_LINE_LENGTH characters per line that long texts will always use // This means texts can not shrink anymore (they can still grow, though) and it's also necessary // to prevent https://bugzilla.gnome.org/show_bug.cgi?id=773572 - int len = newguitext.length(); + int len = newtext.length(); label->set_width_chars(len > Parameter::GUI_MAX_LINE_LENGTH ? Parameter::GUI_MAX_LINE_LENGTH : len); label->show(); diff --git a/src/extension/param/description.h b/src/extension/param/description.h index 64fbef5e5..67985470c 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -27,12 +27,12 @@ namespace Extension { class ParamDescription : public Parameter { public: enum AppearanceMode { - DESC, HEADER, URL + DESCRIPTION, HEADER, URL }; ParamDescription(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 377bb0f57..7cd860465 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -33,27 +33,27 @@ namespace Inkscape { namespace Extension { /* For internal use only. - Note that value and guitext MUST be non-NULL. This is ensured by newing only at one location in the code where non-NULL checks are made. */ + Note that value and text MUST be non-NULL. This is ensured by newing only at one location in the code where non-NULL checks are made. */ class enumentry { public: enumentry (Glib::ustring &val, Glib::ustring &text) : value(val), - guitext(text) + text(text) {} Glib::ustring value; - Glib::ustring guitext; + Glib::ustring text; }; ParamComboBox::ParamComboBox(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(NULL) , choices(NULL) { @@ -64,7 +64,7 @@ ParamComboBox::ParamComboBox(const gchar * name, for (Inkscape::XML::Node *node = xml->firstChild(); node; node = node->next()) { char const * chname = node->name(); if (!strcmp(chname, INKSCAPE_EXTENSION_NS "item") || !strcmp(chname, INKSCAPE_EXTENSION_NS "_item")) { - Glib::ustring newguitext, newvalue; + Glib::ustring newtext, newvalue; const char * contents = NULL; if (node->firstChild()) { contents = node->firstChild()->content(); @@ -75,12 +75,12 @@ ParamComboBox::ParamComboBox(const gchar * name, // still need to include if are to be localized if (!strcmp(chname, INKSCAPE_EXTENSION_NS "_item")) { if (node->attribute("msgctxt") != NULL) { - newguitext = g_dpgettext2(NULL, node->attribute("msgctxt"), contents); + newtext = g_dpgettext2(NULL, node->attribute("msgctxt"), contents); } else { - newguitext = _(contents); + newtext = _(contents); } } else { - newguitext = contents; + newtext = contents; } } else continue; @@ -92,8 +92,8 @@ ParamComboBox::ParamComboBox(const gchar * name, newvalue = contents; } - if ( (!newguitext.empty()) && (!newvalue.empty()) ) { // logical error if this is not true here - choices = g_slist_append( choices, new enumentry(newvalue, newguitext) ); + if ( (!newtext.empty()) && (!newvalue.empty()) ) { // logical error if this is not true here + choices = g_slist_append( choices, new enumentry(newvalue, newtext) ); } } } @@ -153,7 +153,7 @@ const gchar *ParamComboBox::set(const gchar * in, SPDocument * /*doc*/, Inkscape Glib::ustring settext; for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { enumentry * entr = reinterpret_cast(list->data); - if ( !entr->guitext.compare(in) ) { + if ( !entr->text.compare(in) ) { settext = entr->value; break; // break out of for loop } @@ -173,20 +173,20 @@ const gchar *ParamComboBox::set(const gchar * in, SPDocument * /*doc*/, Inkscape } /** - * function to test if \c guitext is selectable + * function to test if \c text is selectable */ -bool ParamComboBox::contains(const gchar * guitext, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const +bool ParamComboBox::contains(const gchar * text, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const { - if (guitext == NULL) { + if (text == NULL) { return false; /* Can't have NULL string */ } for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { enumentry * entr = reinterpret_cast(list->data); - if ( !entr->guitext.compare(guitext) ) + if ( !entr->text.compare(text) ) return true; } - // if we did not find the guitext in this ParamComboBox: + // if we did not find the text in this ParamComboBox: return false; } @@ -244,7 +244,7 @@ ParamComboBoxEntry::changed (void) */ Gtk::Widget *ParamComboBox::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -258,11 +258,11 @@ Gtk::Widget *ParamComboBox::get_widget(SPDocument * doc, Inkscape::XML::Node * n Glib::ustring settext; for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { enumentry * entr = reinterpret_cast(list->data); - Glib::ustring text = entr->guitext; + Glib::ustring text = entr->text; combo->append(text); if ( _value && !entr->value.compare(_value) ) { - settext = entr->guitext; + settext = entr->text; } } if (!settext.empty()) { diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index e66274485..143a648d7 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -38,9 +38,9 @@ private: public: ParamComboBox(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); @@ -58,9 +58,9 @@ public: const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); /** - * @returns true if guitext is part of this enum + * @returns true if text is part of this enum */ - bool contains(const gchar * guitext, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const; + bool contains(const gchar * text, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const; void changed (void); }; /* class ParamComboBox */ diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 8c54d4a4a..765644185 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -28,14 +28,14 @@ namespace Extension { /** Use the superclass' allocator and set the \c _value. */ ParamFloat::ParamFloat(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(0.0) , _mode(mode) , _min(0.0) @@ -168,7 +168,7 @@ void ParamFloatAdjustment::val_changed(void) */ Gtk::Widget * ParamFloat::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } diff --git a/src/extension/param/float.h b/src/extension/param/float.h index 0f0078dae..d58253ccb 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -30,9 +30,9 @@ public: FULL, MINIMAL }; ParamFloat(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index e179484d3..4d17827f1 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -28,14 +28,14 @@ namespace Extension { /** Use the superclass' allocator and set the \c _value. */ ParamInt::ParamInt(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(0) , _mode(mode) , _min(0) @@ -149,7 +149,7 @@ void ParamIntAdjustment::val_changed(void) Gtk::Widget * ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } diff --git a/src/extension/param/int.h b/src/extension/param/int.h index 7b6588139..fcb1ef3f1 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -30,9 +30,9 @@ public: FULL, MINIMAL }; ParamInt(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index c61733d26..a31dda421 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -55,27 +55,27 @@ public: static ParamNotebookPage * makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext); ParamNotebookPage(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void paramString (std::list &list); - gchar * get_guitext (void) {return _text;}; + gchar * get_text (void) {return _text;}; Parameter * get_param (const gchar * name); }; /* class ParamNotebookPage */ ParamNotebookPage::ParamNotebookPage(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, /*indent*/ 0, ext) + : Parameter(name, text, description, hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -147,23 +147,23 @@ ParamNotebookPage * ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext) { const char * name; - const char * guitext; - const char * desc; - bool gui_hidden = false; - const char * gui_hide; + const char * text; + const char * description; + bool hidden = false; + const char * hide; name = in_repr->attribute("name"); - guitext = in_repr->attribute("gui-text"); - if (guitext == NULL) - guitext = in_repr->attribute("_gui-text"); - desc = in_repr->attribute("gui-description"); - if (desc == NULL) - desc = in_repr->attribute("_gui-description"); - gui_hide = in_repr->attribute("gui-hidden"); - if (gui_hide != NULL) { - if (strcmp(gui_hide, "1") == 0 || - strcmp(gui_hide, "true") == 0) { - gui_hidden = true; + text = in_repr->attribute("gui-text"); + if (text == NULL) + text = in_repr->attribute("_gui-text"); + description = in_repr->attribute("gui-description"); + if (description == NULL) + description = in_repr->attribute("_gui-description"); + hide = in_repr->attribute("gui-hidden"); + if (hide != NULL) { + if (strcmp(hide, "1") == 0 || + strcmp(hide, "true") == 0) { + hidden = true; } /* else stays false */ } @@ -173,7 +173,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: return NULL; } - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, gui_hidden, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, text, description, hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -188,7 +188,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: */ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -226,13 +226,13 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod ParamNotebook::ParamNotebook(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) { pages = NULL; @@ -423,7 +423,7 @@ Parameter *ParamNotebookPage::get_param(const gchar * name) */ Gtk::Widget * ParamNotebook::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -436,7 +436,7 @@ Gtk::Widget * ParamNotebook::get_widget(SPDocument * doc, Inkscape::XML::Node * i++; ParamNotebookPage * page = reinterpret_cast(list->data); Gtk::Widget * widg = page->get_widget(doc, node, changeSignal); - nb->append_page(*widg, _(page->get_guitext())); + nb->append_page(*widg, _(page->get_text())); if (!strcmp(_value, page->name())) { pagenr = i; // this is the page to be displayed? } diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index cfecdbbb3..8475de61d 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -42,9 +42,9 @@ private: notebook */ public: ParamNotebook(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 8d77830c4..eeffbecf2 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -63,31 +63,31 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex } } - const char *guitext = in_repr->attribute("gui-text"); - if (guitext == NULL) { - guitext = in_repr->attribute("_gui-text"); - if (guitext == NULL) { - // guitext = ""; // propably better to require devs to explicitly set an empty gui-text if this is what they want + const char *text = in_repr->attribute("gui-text"); + if (text == NULL) { + text = in_repr->attribute("_gui-text"); + if (text == NULL) { + // text = ""; // propably better to require devs to explicitly set an empty gui-text if this is what they want } else { const char *context = in_repr->attribute("msgctxt"); if (context != NULL) { - guitext = g_dpgettext2(NULL, context, guitext); + text = g_dpgettext2(NULL, context, text); } else { - guitext = _(guitext); + text = _(text); } } } - const char *desc = in_repr->attribute("gui-description"); - if (desc == NULL) { - desc = in_repr->attribute("_gui-description"); + const char *description = in_repr->attribute("gui-description"); + if (description == NULL) { + description = in_repr->attribute("_gui-description"); } - bool gui_hidden = false; + bool hidden = false; { const char *gui_hide = in_repr->attribute("gui-hidden"); if (gui_hide != NULL) { if (strcmp(gui_hide, "1") == 0 || strcmp(gui_hide, "true") == 0) { - gui_hidden = true; + hidden = true; } /* else stays false */ } @@ -107,28 +107,28 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex Parameter * param = NULL; if (!strcmp(type, "boolean")) { - param = new ParamBool(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); + param = new ParamBool(name, text, description, hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "int")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamInt(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamInt::FULL); + param = new ParamInt(name, text, description, hidden, indent, in_ext, in_repr, ParamInt::FULL); } else { - param = new ParamInt(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamInt::MINIMAL); + param = new ParamInt(name, text, description, hidden, indent, in_ext, in_repr, ParamInt::MINIMAL); } } else if (!strcmp(type, "float")) { if (appearance && !strcmp(appearance, "full")) { - param = new ParamFloat(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamFloat::FULL); + param = new ParamFloat(name, text, description, hidden, indent, in_ext, in_repr, ParamFloat::FULL); } else { - param = new ParamFloat(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamFloat::MINIMAL); + param = new ParamFloat(name, text, description, hidden, indent, in_ext, in_repr, ParamFloat::MINIMAL); } } else if (!strcmp(type, "string")) { - param = new ParamString(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); + param = new ParamString(name, text, description, hidden, indent, in_ext, in_repr); gchar const * max_length = in_repr->attribute("max_length"); if (max_length != NULL) { ParamString * ps = dynamic_cast(param); ps->setMaxLength(atoi(max_length)); } } else if (!strcmp(type, "description")) { - ParamDescription::AppearanceMode appearance_mode = ParamDescription::DESC; + ParamDescription::AppearanceMode appearance_mode = ParamDescription::DESCRIPTION; if (appearance) { if (!strcmp(appearance, "header")) { appearance_mode = ParamDescription::HEADER; @@ -136,19 +136,19 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex appearance_mode = ParamDescription::URL; } } - param = new ParamDescription(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, appearance_mode); + param = new ParamDescription(name, text, description, hidden, indent, in_ext, in_repr, appearance_mode); } else if (!strcmp(type, "enum")) { - param = new ParamComboBox(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); + param = new ParamComboBox(name, text, description, hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "notebook")) { - param = new ParamNotebook(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); + param = new ParamNotebook(name, text, description, hidden, indent, in_ext, in_repr); } else if (!strcmp(type, "optiongroup")) { if (appearance && !strcmp(appearance, "minimal")) { - param = new ParamRadioButton(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); + param = new ParamRadioButton(name, text, description, hidden, indent, in_ext, in_repr, ParamRadioButton::MINIMAL); } else { - param = new ParamRadioButton(name, guitext, desc, gui_hidden, indent, in_ext, in_repr, ParamRadioButton::FULL); + param = new ParamRadioButton(name, text, description, hidden, indent, in_ext, in_repr, ParamRadioButton::FULL); } } else if (!strcmp(type, "color")) { - param = new ParamColor(name, guitext, desc, gui_hidden, indent, in_ext, in_repr); + param = new ParamColor(name, text, description, hidden, indent, in_ext, in_repr); } // Note: param could equal NULL @@ -295,24 +295,24 @@ Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) /** Oop, now that we need a parameter, we need it's name. */ -Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * desc, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext) : - _desc(0), +Parameter::Parameter(gchar const * name, gchar const * text, gchar const * description, bool hidden, int indent, Inkscape::Extension::Extension * ext) : + _description(0), _text(0), - _gui_hidden(gui_hidden), + _hidden(hidden), _indent(indent), - extension(ext), + _extension(ext), _name(0) { if (name != NULL) { _name = g_strdup(name); } - if (desc != NULL) { - _desc = g_strdup(desc); + if (description != NULL) { + _description = g_strdup(description); } - if (guitext != NULL) { - _text = g_strdup(guitext); + if (text != NULL) { + _text = g_strdup(text); } else { _text = g_strdup(name); } @@ -321,19 +321,19 @@ Parameter::Parameter(gchar const * name, gchar const * guitext, gchar const * de } /** Oop, now that we need a parameter, we need it's name. */ -Parameter::Parameter (gchar const * name, gchar const * guitext, Inkscape::Extension::Extension * ext) : - _desc(0), +Parameter::Parameter (gchar const * name, gchar const * text, Inkscape::Extension::Extension * ext) : + _description(0), _text(0), - _gui_hidden(false), + _hidden(false), _indent(0), - extension(ext), + _extension(ext), _name(0) { if (name != NULL) { _name = g_strdup(name); } - if (guitext != NULL) { - _text = g_strdup(guitext); + if (text != NULL) { + _text = g_strdup(text); } else { _text = g_strdup(name); } @@ -349,13 +349,13 @@ Parameter::~Parameter(void) g_free(_text); _text = 0; - g_free(_desc); - _desc = 0; + g_free(_description); + _description = 0; } gchar *Parameter::pref_name(void) const { - return g_strdup_printf("%s.%s", extension->get_id(), _name); + return g_strdup_printf("%s.%s", _extension->get_id(), _name); } Inkscape::XML::Node * @@ -388,7 +388,7 @@ Inkscape::XML::Node *Parameter::document_param_node(SPDocument * doc) child != NULL; child = child->next()) { if ((GQuark)child->code() == name_quark && - !strcmp(child->attribute("extension"), extension->get_id())) { + !strcmp(child->attribute("extension"), _extension->get_id())) { params = child; break; } @@ -396,7 +396,7 @@ Inkscape::XML::Node *Parameter::document_param_node(SPDocument * doc) if (params == NULL) { params = xml_doc->createElement("inkscape:extension-param"); - params->setAttribute("extension", extension->get_id()); + params->setAttribute("extension", _extension->get_id()); defs->appendChild(params); Inkscape::GC::release(params); } diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index 4994a6971..96cc055d8 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -49,14 +49,14 @@ class Parameter { public: Parameter(gchar const *name, - gchar const *guitext, - gchar const *desc, - bool gui_hidden, + gchar const *text, + gchar const *description, + bool hidden, int indent, Inkscape::Extension::Extension * ext); Parameter(gchar const *name, - gchar const *guitext, + gchar const *text, Inkscape::Extension::Extension * ext); virtual ~Parameter(void); @@ -130,10 +130,10 @@ public: virtual Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); - gchar const * get_tooltip(void) const { return _desc; } + gchar const * get_tooltip(void) const { return _description; } /** Indicates if the GUI for this parameter is hidden or not */ - bool get_gui_hidden() const { return _gui_hidden; } + bool get_hidden() const { return _hidden; } /** Indentation level of the parameter */ int get_indent() const { return _indent; } @@ -163,14 +163,14 @@ public: protected: - /** Description of the parameter. */ - gchar * _desc; + /** Parameter text to show as the GUI label. */ + gchar * _text; - /** Text for the GUI selection of this. */ - gchar * _text; + /** Extended description of the parameter (crrently shown as tooltip on hover). */ + gchar * _description; - /** Whether the GUI is visible. */ - bool _gui_hidden; + /** Whether the parameter is visible. */ + bool _hidden; /** Indentation level of the parameter. */ int _indent; @@ -191,7 +191,7 @@ protected: private: /** Which extension is this parameter attached to. */ - Inkscape::Extension::Extension *extension; + Inkscape::Extension::Extension *_extension; /** The name of this parameter. */ gchar *_name; diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 166167fda..2e757febe 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -41,31 +41,31 @@ namespace Inkscape { namespace Extension { /* For internal use only. - Note that value and guitext MUST be non-NULL. This is ensured by newing only at one location in the code where non-NULL checks are made. */ + Note that value and text MUST be non-NULL. This is ensured by newing only at one location in the code where non-NULL checks are made. */ class optionentry { public: optionentry (Glib::ustring * val, Glib::ustring * text) { value = val; - guitext = text; + text = text; } ~optionentry() { delete value; - delete guitext; + delete text; } Glib::ustring * value; - Glib::ustring * guitext; + Glib::ustring * text; }; ParamRadioButton::ParamRadioButton(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, AppearanceMode mode) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(0) , _mode(mode) , choices(0) @@ -77,7 +77,7 @@ ParamRadioButton::ParamRadioButton(const gchar * name, while (child_repr != NULL) { char const * chname = child_repr->name(); if (!strcmp(chname, INKSCAPE_EXTENSION_NS "option") || !strcmp(chname, INKSCAPE_EXTENSION_NS "_option")) { - Glib::ustring * newguitext = NULL; + Glib::ustring * newtext = NULL; Glib::ustring * newvalue = NULL; const char * contents = child_repr->firstChild()->content(); @@ -85,12 +85,12 @@ ParamRadioButton::ParamRadioButton(const gchar * name, // don't translate when 'item' but do translate when '_option' if (!strcmp(chname, INKSCAPE_EXTENSION_NS "_option")) { if (child_repr->attribute("msgctxt") != NULL) { - newguitext = new Glib::ustring(g_dpgettext2(NULL, child_repr->attribute("msgctxt"), contents)); + newtext = new Glib::ustring(g_dpgettext2(NULL, child_repr->attribute("msgctxt"), contents)); } else { - newguitext = new Glib::ustring(_(contents)); + newtext = new Glib::ustring(_(contents)); } } else { - newguitext = new Glib::ustring(contents); + newtext = new Glib::ustring(contents); } } else { continue; @@ -104,8 +104,8 @@ ParamRadioButton::ParamRadioButton(const gchar * name, newvalue = new Glib::ustring(contents); } - if ( (newguitext) && (newvalue) ) { // logical error if this is not true here - choices = g_slist_append( choices, new optionentry(newvalue, newguitext) ); + if ( (newtext) && (newvalue) ) { // logical error if this is not true here + choices = g_slist_append( choices, new optionentry(newvalue, newtext) ); } } child_repr = child_repr->next(); @@ -280,7 +280,7 @@ Glib::ustring ParamRadioButton::value_from_label(const Glib::ustring label) for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { optionentry * entr = reinterpret_cast(list->data); - if ( !entr->guitext->compare(label) ) { + if ( !entr->text->compare(label) ) { value = *(entr->value); break; } @@ -295,7 +295,7 @@ Glib::ustring ParamRadioButton::value_from_label(const Glib::ustring label) */ Gtk::Widget * ParamRadioButton::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -321,7 +321,7 @@ Gtk::Widget * ParamRadioButton::get_widget(SPDocument * doc, Inkscape::XML::Node Gtk::RadioButtonGroup group; for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { optionentry * entr = reinterpret_cast(list->data); - Glib::ustring * text = entr->guitext; + Glib::ustring * text = entr->text; switch ( _mode ) { case MINIMAL: { diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index f41852baa..b91b11ea3 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -35,9 +35,9 @@ public: }; ParamRadioButton(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml, diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index 22893cd0a..51b5dfdf3 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -77,13 +77,13 @@ void ParamString::string(std::string &string) const /** Initialize the object, to do that, copy the data. */ ParamString::ParamString(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) , _value(NULL) { const char * defaultval = NULL; @@ -162,7 +162,7 @@ void ParamStringEntry::changed_text(void) */ Gtk::Widget * ParamString::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } diff --git a/src/extension/param/string.h b/src/extension/param/string.h index 2dc1bd483..d338f83b9 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -24,9 +24,9 @@ private: gint _max_length; public: ParamString(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); -- cgit v1.2.3