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 "number-opt-number.h"
20 #include "sp-object.h"
21 #include "sp-filter-units.h"
22 #include "sp-filter-fns.h"
23 #include "svg/svg-length.h"
24 #include "display/nr-filter.h"
26 /* Filter base class */
28 /* MACROS DEFINED IN FILE sp-filter-fns.h */
30 struct SPFilterReference;
32 class SPFilter;
33 class SPFilterClass;
35 struct ltstr {
36 bool operator()(const char* s1, const char* s2) const;
37 };
39 struct SPFilter : public SPObject {
41 /** filterUnits attribute */
42 SPFilterUnits filterUnits;
43 guint filterUnits_set : 1;
44 /** primitiveUnits attribute */
45 SPFilterUnits primitiveUnits;
46 guint primitiveUnits_set : 1;
47 /** X attribute */
48 SVGLength x;
49 /** Y attribute */
50 SVGLength y;
51 /** WIDTH attribute */
52 SVGLength width;
53 /** HEIGHT attribute */
54 SVGLength height;
55 /** FILTERRES attribute */
56 NumberOptNumber filterRes;
57 /** HREF attribute */
58 SPFilterReference *href;
59 sigc::connection modified_connection;
61 NR::Filter *_renderer;
63 std::map<gchar *, int, ltstr>* _image_name;
64 int _image_number_next;
65 };
67 struct SPFilterClass {
68 SPObjectClass parent_class;
69 };
71 /*
72 * Initializes the given NR::Filter object as a renderer for this
73 * SPFilter object.
74 */
75 void sp_filter_build_renderer(SPFilter *sp_filter, NR::Filter *nr_filter);
77 /*
78 * Returns the number of filter primitives in this SPFilter object.
79 */
80 int sp_filter_primitive_count(SPFilter *filter);
82 int sp_filter_get_image_name(SPFilter *filter, gchar const *name);
83 int sp_filter_set_image_name(SPFilter *filter, gchar const *name);
85 #endif /* !SP_FILTER_H_SEEN */
87 /*
88 Local Variables:
89 mode:c++
90 c-file-style:"stroustrup"
91 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
92 indent-tabs-mode:nil
93 fill-column:99
94 End:
95 */
96 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :