~ubuntu-branches/ubuntu/precise/inkscape/precise-updates

« back to all changes in this revision

Viewing changes to src/sp-paint-server.h

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __SP_PAINT_SERVER_H__
2
 
#define __SP_PAINT_SERVER_H__
 
1
#ifndef SEEN_SP_PAINT_SERVER_H
 
2
#define SEEN_SP_PAINT_SERVER_H
3
3
 
4
4
/*
5
5
 * Base class for gradients and patterns
6
6
 *
7
7
 * Author:
8
8
 *   Lauris Kaplinski <lauris@kaplinski.com>
 
9
 *   Jon A. Cruz <jon@joncruz.org>
9
10
 *
10
11
 * Copyright (C) 1999-2002 Lauris Kaplinski
11
12
 * Copyright (C) 2000-2001 Ximian, Inc.
 
13
 * Copyright (C) 2010 Authors
12
14
 *
13
15
 * Released under GNU GPL, read the file 'COPYING' for more information
14
16
 */
19
21
 
20
22
class SPPainter;
21
23
 
22
 
#define SP_TYPE_PAINT_SERVER (sp_paint_server_get_type ())
 
24
#define SP_TYPE_PAINT_SERVER (SPPaintServer::getType())
23
25
#define SP_PAINT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_PAINT_SERVER, SPPaintServer))
24
26
#define SP_PAINT_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_PAINT_SERVER, SPPaintServerClass))
25
27
#define SP_IS_PAINT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_PAINT_SERVER))
26
28
#define SP_IS_PAINT_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_PAINT_SERVER))
27
29
 
28
30
typedef enum {
29
 
        SP_PAINTER_IND,
30
 
        SP_PAINTER_DEP
 
31
    SP_PAINTER_IND,
 
32
    SP_PAINTER_DEP
31
33
} SPPainterType;
32
34
 
33
35
typedef void (* SPPainterFillFunc) (SPPainter *painter, NRPixBlock *pb);
34
36
 
35
37
/* fixme: I do not like that class thingie (Lauris) */
36
38
struct SPPainter {
37
 
        SPPainter *next;
38
 
        SPPaintServer *server;
39
 
        GType server_type;
40
 
        SPPainterType type;
41
 
        SPPainterFillFunc fill;
 
39
    SPPainter *next;
 
40
    SPPaintServer *server;
 
41
    GType server_type;
 
42
    SPPainterType type;
 
43
    SPPainterFillFunc fill;
42
44
};
43
45
 
44
46
struct SPPaintServer : public SPObject {
45
 
        /* List of paints */
46
 
        SPPainter *painters;
 
47
    /** List of paints */
 
48
    SPPainter *painters;
 
49
 
 
50
protected:
 
51
    bool swatch;
 
52
public:
 
53
 
 
54
    static GType getType(void);
 
55
 
 
56
    bool isSwatch() const;
 
57
    bool isSolid() const;
 
58
 
 
59
private:
 
60
    static void init(SPPaintServer *ps);
47
61
};
48
62
 
49
63
struct SPPaintServerClass {
50
 
        SPObjectClass sp_object_class;
51
 
        /* Get SPPaint instance */
52
 
        SPPainter * (* painter_new) (SPPaintServer *ps, Geom::Matrix const &full_transform, Geom::Matrix const &parent_transform, const NRRect *bbox);
53
 
        /* Free SPPaint instance */
54
 
        void (* painter_free) (SPPaintServer *ps, SPPainter *painter);
 
64
    SPObjectClass sp_object_class;
 
65
    /** Get SPPaint instance. */
 
66
    SPPainter * (* painter_new) (SPPaintServer *ps, Geom::Matrix const &full_transform, Geom::Matrix const &parent_transform, const NRRect *bbox);
 
67
    /** Free SPPaint instance. */
 
68
    void (* painter_free) (SPPaintServer *ps, SPPainter *painter);
55
69
};
56
70
 
57
 
GType sp_paint_server_get_type (void);
58
 
 
59
71
SPPainter *sp_paint_server_painter_new (SPPaintServer *ps, Geom::Matrix const &full_transform, Geom::Matrix const &parent_transform, const NRRect *bbox);
60
72
 
61
73
SPPainter *sp_painter_free (SPPainter *painter);
62
74
 
63
75
class SPPaintServerReference : public Inkscape::URIReference {
64
76
public:
65
 
        SPPaintServerReference (SPObject *obj) : URIReference(obj) {}
66
 
        SPPaintServerReference (SPDocument *doc) : URIReference(doc) {}
67
 
        SPPaintServer *getObject() const {
68
 
                return (SPPaintServer *)URIReference::getObject();
69
 
        }
 
77
    SPPaintServerReference (SPObject *obj) : URIReference(obj) {}
 
78
    SPPaintServerReference (SPDocument *doc) : URIReference(doc) {}
 
79
    SPPaintServer *getObject() const {
 
80
        return static_cast<SPPaintServer *>(URIReference::getObject());
 
81
    }
70
82
protected:
71
 
        virtual bool _acceptObject(SPObject *obj) const {
72
 
                return SP_IS_PAINT_SERVER (obj);
73
 
        }
 
83
    virtual bool _acceptObject(SPObject *obj) const {
 
84
        return SP_IS_PAINT_SERVER (obj);
 
85
    }
74
86
};
75
87
 
76
 
#endif
 
88
#endif // SEEN_SP_PAINT_SERVER_H
 
89
/*
 
90
  Local Variables:
 
91
  mode:c++
 
92
  c-file-style:"stroustrup"
 
93
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
94
  indent-tabs-mode:nil
 
95
  fill-column:99
 
96
  End:
 
97
*/
 
98
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :