~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/sp-pattern.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SP_PATTERN_H__
 
2
#define __SP_PATTERN_H__
 
3
 
 
4
/*
 
5
 * SVG <pattern> implementation
 
6
 *
 
7
 * Author:
 
8
 *   Lauris Kaplinski <lauris@kaplinski.com>
 
9
 *
 
10
 * Copyright (C) 2002 Lauris Kaplinski
 
11
 *
 
12
 * Released under GNU GPL, read the file 'COPYING' for more information
 
13
 */
 
14
 
 
15
#include <gtk/gtktypeutils.h>
 
16
 
 
17
#include "forward.h"
 
18
 
 
19
#define SP_TYPE_PATTERN (sp_pattern_get_type ())
 
20
#define SP_PATTERN(o) (GTK_CHECK_CAST ((o), SP_TYPE_PATTERN, SPPattern))
 
21
#define SP_PATTERN_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), SP_TYPE_PATTERN, SPPatternClass))
 
22
#define SP_IS_PATTERN(o) (GTK_CHECK_TYPE ((o), SP_TYPE_PATTERN))
 
23
#define SP_IS_PATTERN_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SP_TYPE_PATTERN))
 
24
 
 
25
GType sp_pattern_get_type (void);
 
26
 
 
27
class SPPatternClass;
 
28
 
 
29
#include <libnr/nr-rect.h>
 
30
#include <libnr/nr-matrix.h>
 
31
#include "svg/svg-length.h"
 
32
#include "sp-paint-server.h"
 
33
#include "uri-references.h"
 
34
 
 
35
#include <sigc++/connection.h>
 
36
 
 
37
class SPPatternReference : public Inkscape::URIReference {
 
38
public:
 
39
    SPPatternReference (SPObject *obj) : URIReference(obj) {}
 
40
    SPPattern *getObject() const {
 
41
        return (SPPattern *)URIReference::getObject();
 
42
    }
 
43
 
 
44
protected:
 
45
    virtual bool _acceptObject(SPObject *obj) const {
 
46
        return SP_IS_PATTERN (obj);
 
47
    }
 
48
};
 
49
 
 
50
enum {
 
51
    SP_PATTERN_UNITS_USERSPACEONUSE,
 
52
    SP_PATTERN_UNITS_OBJECTBOUNDINGBOX
 
53
};
 
54
 
 
55
struct SPPattern : public SPPaintServer {
 
56
    /* Reference (href) */
 
57
    gchar *href;
 
58
    SPPatternReference *ref;
 
59
 
 
60
    /* patternUnits and patternContentUnits attribute */
 
61
    guint patternUnits : 1;
 
62
    guint patternUnits_set : 1;
 
63
    guint patternContentUnits : 1;
 
64
    guint patternContentUnits_set : 1;
 
65
    /* patternTransform attribute */
 
66
    Geom::Matrix patternTransform;
 
67
    guint patternTransform_set : 1;
 
68
    /* Tile rectangle */
 
69
    SVGLength x;
 
70
    SVGLength y;
 
71
    SVGLength width;
 
72
    SVGLength height;
 
73
    /* VieBox */
 
74
    NRRect viewBox;
 
75
    guint viewBox_set : 1;
 
76
 
 
77
    sigc::connection modified_connection;
 
78
};
 
79
 
 
80
struct SPPatternClass {
 
81
    SPPaintServerClass parent_class;
 
82
};
 
83
 
 
84
guint pattern_users (SPPattern *pattern);
 
85
SPPattern *pattern_chain (SPPattern *pattern);
 
86
SPPattern *sp_pattern_clone_if_necessary (SPItem *item, SPPattern *pattern, const gchar *property);
 
87
void sp_pattern_transform_multiply (SPPattern *pattern, Geom::Matrix postmul, bool set);
 
88
 
 
89
const gchar *pattern_tile (GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Matrix transform, Geom::Matrix move);
 
90
 
 
91
SPPattern *pattern_getroot (SPPattern *pat);
 
92
 
 
93
guint pattern_patternUnits (SPPattern *pat);
 
94
guint pattern_patternContentUnits (SPPattern *pat);
 
95
Geom::Matrix const &pattern_patternTransform(SPPattern const *pat);
 
96
gdouble pattern_x (SPPattern *pat);
 
97
gdouble pattern_y (SPPattern *pat);
 
98
gdouble pattern_width (SPPattern *pat);
 
99
gdouble pattern_height (SPPattern *pat);
 
100
NRRect *pattern_viewBox (SPPattern *pat);
 
101
 
 
102
#endif //__SP_PATTERN_H__
 
103
 
 
104
/*
 
105
  Local Variables:
 
106
  mode:c++
 
107
  c-file-style:"stroustrup"
 
108
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
109
  indent-tabs-mode:nil
 
110
  fill-column:99
 
111
  End:
 
112
*/
 
113
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :