2#ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_SHADOWS_H__
3#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_SHADOWS_H__
65 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
66 "<name>" N_(
"Drop Shadow")
"</name>\n"
67 "<id>org.inkscape.effect.filter.ColorDropShadow</id>\n"
68 "<param name=\"tab\" type=\"notebook\">\n"
69 "<page name=\"optionstab\" gui-text=\"" N_(
"Options")
"\">\n"
70 "<param name=\"blur\" gui-text=\"" N_(
"Blur radius (px)")
"\" type=\"float\" appearance=\"full\" min=\"0.0\" max=\"200.0\">3.0</param>\n"
71 "<param name=\"xoffset\" gui-text=\"" N_(
"Horizontal offset (px)")
"\" type=\"float\" appearance=\"full\" min=\"-50.0\" max=\"50.0\">6.0</param>\n"
72 "<param name=\"yoffset\" gui-text=\"" N_(
"Vertical offset (px)")
"\" type=\"float\" appearance=\"full\" min=\"-50.0\" max=\"50.0\">6.0</param>\n"
73 "<param name=\"type\" gui-text=\"" N_(
"Shadow type:")
"\" type=\"optiongroup\" appearance=\"combo\" >\n"
74 "<option value=\"outer\">" N_(
"Outer")
"</option>\n"
75 "<option value=\"inner\">" N_(
"Inner")
"</option>\n"
76 "<option value=\"outercut\">" N_(
"Outer cutout")
"</option>\n"
77 "<option value=\"innercut\">" N_(
"Inner cutout")
"</option>\n"
78 "<option value=\"shadow\">" N_(
"Shadow only")
"</option>\n"
81 "<page name=\"coltab\" gui-text=\"" N_(
"Blur color")
"\">\n"
82 "<param name=\"color\" gui-text=\"" N_(
"Color")
"\" type=\"color\">127</param>\n"
83 "<param name=\"objcolor\" gui-text=\"" N_(
"Use object's color")
"\" type=\"bool\" >false</param>\n"
87 "<object-type>all</object-type>\n"
89 "<submenu name=\"" N_(
"Filters")
"\">\n"
90 "<submenu name=\"" N_(
"Shadows and Glows")
"\"/>\n"
93 "<menu-tip>" N_(
"Colorizable Drop shadow")
"</menu-tip>\n"
95 "</inkscape-extension>\n", std::make_unique<ColorizableDropShadow>());
115 const char *comp1in1;
116 const char *comp1in2;
117 const char *comp2in1;
118 const char *comp2in2;
126 if (g_ascii_strcasecmp(
"outer",
mode) == 0) {
129 comp2in1 =
"SourceGraphic";
131 }
else if (g_ascii_strcasecmp(
"inner",
mode) == 0) {
135 comp2in2 =
"SourceGraphic";
136 }
else if (g_ascii_strcasecmp(
"outercut",
mode) == 0) {
140 comp2in2 =
"SourceGraphic";
141 }
else if (g_ascii_strcasecmp(
"innercut",
mode) == 0) {
145 comp2in2 =
"SourceGraphic";
147 std::swap(comp2in1, comp2in2);
158 std::swap(comp1in1, comp1in2);
162 auto old = std::locale::global(std::locale::classic());
164 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Drop Shadow\">\n"
165 "<feFlood result=\"flood\" in=\"SourceGraphic\" flood-opacity=\"%f\" flood-color=\"%s\"/>\n"
166 "<feGaussianBlur result=\"blur\" in=\"SourceGraphic\" stdDeviation=\"%f\"/>\n"
167 "<feOffset result=\"offset\" in=\"blur\" dx=\"%f\" dy=\"%f\"/>\n"
168 "<feComposite result=\"comp1\" operator=\"%s\" in=\"%s\" in2=\"%s\"/>\n"
169 "<feComposite result=\"comp2\" operator=\"%s\" in=\"%s\" in2=\"%s\"/>\n"
172 color.getOpacity(), color.toString(
false).c_str(),
176 comp1op, comp1in1, comp1in2,
177 comp2op, comp2in1, comp2in2
179 std::locale::global(old);
The object that is the basis for the Extension system.
char const * get_param_optiongroup(char const *name, char const *alt) const
Like get_param_optiongroup but with a default on param_not_exist error.
double get_param_float(char const *name) const
Gets a float parameter identified by name with the double placed in value.
Colors::Color get_param_color(char const *name) const
Gets a parameter identified by name with the unsigned int placed in value.
bool get_param_bool(char const *name) const
Gets a parameter identified by name with the bool placed in value.
Custom predefined Drop shadow filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
~ColorizableDropShadow() override
A way to clear the N_ macro, which is defined as an inline function.
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
Helper class to stream background task notifications as a series of messages.