1 #ifndef SP_FILTER_H_SEEN
2 #define SP_FILTER_H_SEEN
4 /** \file
5 * SVG <filter> implementation, see sp-filter.cpp.
6 */
7 /*
8 * Authors:
9 * Hugo Rodrigues <haa.rodrigues@gmail.com>
10 * Niko Kiirala <niko@kiirala.com>
11 *
12 * Copyright (C) 2006,2007 Authors
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #include <map>
19 #include <gtkmm.h>
21 #include "number-opt-number.h"
22 #include "sp-object.h"
23 #include "sp-filter-units.h"
24 #include "sp-filter-fns.h"
25 #include "svg/svg-length.h"
26 #include "display/nr-filter.h"
28 /* Filter base class */
30 /* MACROS DEFINED IN FILE sp-filter-fns.h */
32 struct SPFilterReference;
34 class SPFilter;
35 class SPFilterClass;
37 struct ltstr {
38 bool operator()(const char* s1, const char* s2) const;
39 };
41 struct SPFilter : public SPObject {
43 /** filterUnits attribute */
44 SPFilterUnits filterUnits;
45 guint filterUnits_set : 1;
46 /** primitiveUnits attribute */
47 SPFilterUnits primitiveUnits;
48 guint primitiveUnits_set : 1;
49 /** X attribute */
50 SVGLength x;
51 /** Y attribute */
52 SVGLength y;
53 /** WIDTH attribute */
54 SVGLength width;
55 /** HEIGHT attribute */
56 SVGLength height;
57 /** FILTERRES attribute */
58 NumberOptNumber filterRes;
59 /** HREF attribute */
60 SPFilterReference *href;
61 sigc::connection modified_connection;
63 Inkscape::Filters::Filter *_renderer;
65 std::map<gchar *, int, ltstr>* _image_name;
66 int _image_number_next;
67 };
69 struct SPFilterClass {
70 SPObjectClass parent_class;
71 };
73 /*
74 * Initializes the given Inkscape::Filters::Filter object as a renderer for this
75 * SPFilter object.
76 */
77 void sp_filter_build_renderer(SPFilter *sp_filter, Inkscape::Filters::Filter *nr_filter);
79 /*
80 * Returns the number of filter primitives in this SPFilter object.
81 */
82 int sp_filter_primitive_count(SPFilter *filter);
84 /**
85 * Returns a slot number for given image name, or -1 for unknown name.
86 */
87 int sp_filter_get_image_name(SPFilter *filter, gchar const *name);
88 /**
89 * Returns slot number for given image name, even if it's unknown.
90 */
91 int sp_filter_set_image_name(SPFilter *filter, gchar const *name);
92 /**
93 * Finds image name based on it's slot number. Returns 0 for unknown slot
94 * numbers.
95 */
96 gchar const *sp_filter_name_for_image(SPFilter const *filter, int const image);
98 /*
99 * Returns a result image name that is not in use inside this filter.
100 */
101 Glib::ustring sp_filter_get_new_result_name(SPFilter *filter);
103 #endif /* !SP_FILTER_H_SEEN */
105 /*
106 Local Variables:
107 mode:c++
108 c-file-style:"stroustrup"
109 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
110 indent-tabs-mode:nil
111 fill-column:99
112 End:
113 */
114 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :