6 * Patrick Storz <eduard.braun2@gmx.de>
8 * Copyright (C) 2019 Authors
10 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
24#include <sigc++/sigc++.h>
38 const char *name = in_repr->
name();
39 if (!strncmp(name, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) {
40 name += strlen(INKSCAPE_EXTENSION_NS);
50 g_warning(
"InxWidget without name in extension '%s'.", in_ext->
get_id());
51 }
else if (!strcmp(name,
"hbox") || !strcmp(name,
"vbox")) {
53 }
else if (!strcmp(name,
"image")) {
55 }
else if (!strcmp(name,
"label")) {
57 }
else if (!strcmp(name,
"separator")) {
59 }
else if (!strcmp(name,
"spacer")) {
61 }
else if (!strcmp(name,
"param")) {
64 g_warning(
"Unknown widget name ('%s') in extension '%s'", name, in_ext->
get_id());
74 static const std::vector<std::string> valid_names =
75 {
"hbox",
"vbox",
"image",
"label",
"separator",
"spacer",
"param"};
77 if (std::find(valid_names.begin(), valid_names.end(), name) != valid_names.end()) {
89 const char *translatable = in_repr->
attribute(
"translatable");
91 if (!strcmp(translatable,
"yes")) {
93 }
else if (!strcmp(translatable,
"no")) {
96 g_warning(
"Invalid value ('%s') for translatable attribute of widget '%s' in extension '%s'",
102 const char *context = in_repr->
attribute(
"context");
111 const char *gui_hidden = in_repr->
attribute(
"gui-hidden");
112 if (gui_hidden !=
nullptr) {
113 if (strcmp(gui_hidden,
"true") == 0) {
120 const char *indent = in_repr->
attribute(
"indent");
121 if (indent !=
nullptr) {
122 _indent = strtol(indent,
nullptr, 0);
126 const char *appearance = in_repr->
attribute(
"appearance");
149 g_critical(
"InxWidget::get_widget called from widget of type '%s' in extension '%s'",
151 g_assert_not_reached();
161 list.push_back(
this);
163 child->get_widgets(list);
The object that is the basis for the Extension system.
char const * get_translation(char const *msgid, char const *msgctxt=nullptr) const
Gets a translation within the context of the current extension.
char const * get_id() const
Get the ID of this extension - not a copy don't delete!
static InxParameter * make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Extension *in_ext)
Creates a new extension parameter for usage in a prefdialog.
Interface for refcounted XML nodes.
virtual char const * name() const =0
Get the name of the element node.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
CMYK to sRGB conversion routines.