1 #ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__
2 #define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__
4 /*
5 * Copyright (C) 2008 Authors:
6 * Ted Gould <ted@gould.cx>
7 *
8 * Released under GNU GPL, read the file 'COPYING' for more information
9 */
11 #include <glibmm/i18n.h>
13 #include "extension/implementation/implementation.h"
14 #include "extension/extension-forward.h"
16 namespace Inkscape {
17 namespace Extension {
18 namespace Internal {
19 namespace Filter {
21 class Filter : public Inkscape::Extension::Implementation::Implementation {
22 protected:
23 gchar const * _filter;
24 virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext);
26 private:
27 Inkscape::XML::Document * get_filter (Inkscape::Extension::Extension * ext);
28 void merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc, gchar const * srcGraphic = NULL, gchar const * srcGraphicAlpha = NULL);
30 public:
31 Filter();
32 Filter(gchar const * filter);
33 virtual ~Filter();
35 bool load(Inkscape::Extension::Extension *module);
36 Inkscape::Extension::Implementation::ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc);
37 void effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache);
39 static void filter_init(gchar const * id, gchar const * name, gchar const * submenu, gchar const * tip, gchar const * filter);
40 static void filters_all(void);
42 /* File loader related */
43 static void filters_all_files(void);
44 static void filters_load_dir(gchar const * filename, gchar * menuname);
45 static void filters_load_file(gchar * filename, gchar * menuname);
46 static void filters_load_node(Inkscape::XML::Node * node, gchar * menuname);
48 };
50 }; /* namespace Filter */
51 }; /* namespace Internal */
52 }; /* namespace Extension */
53 }; /* namespace Inkscape */
55 #endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ */