// SPDX-License-Identifier: GPL-2.0-or-later #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H__ #define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H__ /* Change the 'PROTRUSIONS' above to be your file name */ /* * Copyright (C) 2008 Authors: * Ted Gould * Copyright (C) 2011 Authors: * Ivan Louette (filters) * Nicolas Dufour (UI) * * Protrusion filters * Snow * * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ /* ^^^ Change the copyright to be you and your e-mail address ^^^ */ #include "filter.h" #include "extension/internal/clear-n_.h" #include "extension/system.h" #include "extension/extension.h" namespace Inkscape { namespace Extension { namespace Internal { namespace Filter { /** \brief Custom predefined Snow filter. Snow has fallen on object. */ class Snow : public Inkscape::Extension::Internal::Filter::Filter { protected: gchar const * get_filter_text (Inkscape::Extension::Extension * ext) override; public: Snow ( ) : Filter() { }; ~Snow ( ) override { if (_filter != nullptr) g_free((void *)_filter); return; } public: static void init () { // clang-format off Inkscape::Extension::build_from_mem( "\n" "" N_("Snow Crest") "\n" "org.inkscape.effect.filter.snow\n" "3.5\n" "\n" "all\n" "\n" "\n" "\n" "\n" "\n" "" N_("Snow has fallen on object") "\n" "\n" "\n", new Snow()); // clang-format on }; }; gchar const * Snow::get_filter_text (Inkscape::Extension::Extension * ext) { if (_filter != nullptr) g_free((void *)_filter); std::ostringstream drift; drift << ext->get_param_float("drift"); // clang-format off _filter = g_strdup_printf( "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n", drift.str().c_str()); // clang-format on return _filter; }; /* Snow filter */ }; /* namespace Filter */ }; /* namespace Internal */ }; /* namespace Extension */ }; /* namespace Inkscape */ /* Change the 'PROTRUSIONS' below to be your file name */ #endif /* SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H__ */