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

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/extension/internal/cairo-renderer.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 EXTENSION_INTERNAL_CAIRO_RENDERER_H_SEEN
 
2
#define EXTENSION_INTERNAL_CAIRO_RENDERER_H_SEEN
 
3
 
 
4
/** \file
 
5
 * Declaration of CairoRenderer, a class used for rendering via a CairoRenderContext.
 
6
 */
 
7
/*
 
8
 * Authors:
 
9
 *         Miklos Erdelyi <erdelyim@gmail.com>
 
10
 *
 
11
 * Copyright (C) 2006 Miklos Erdelyi
 
12
 * 
 
13
 * Licensed under GNU GPL
 
14
 */
 
15
 
 
16
#ifdef HAVE_CONFIG_H
 
17
# include "config.h"
 
18
#endif
 
19
 
 
20
#include "extension/extension.h"
 
21
#include <set>
 
22
#include <string>
 
23
 
 
24
//#include "libnrtype/font-instance.h"
 
25
#include "style.h"
 
26
 
 
27
#include <cairo.h>
 
28
 
 
29
class SPClipPath;
 
30
class SPMask;
 
31
 
 
32
namespace Inkscape {
 
33
namespace Extension {
 
34
namespace Internal {
 
35
 
 
36
class CairoRenderer;
 
37
class CairoRenderContext;
 
38
 
 
39
class CairoRenderer {
 
40
public:
 
41
    CairoRenderer(void);
 
42
    virtual ~CairoRenderer(void);
 
43
    
 
44
    CairoRenderContext *createContext(void);
 
45
    void destroyContext(CairoRenderContext *ctx);
 
46
 
 
47
    void setStateForItem(CairoRenderContext *ctx, SPItem const *item);
 
48
 
 
49
    void applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp);
 
50
    void applyMask(CairoRenderContext *ctx, SPMask const *mask);
 
51
 
 
52
    /** Initializes the CairoRenderContext according to the specified
 
53
    SPDocument. A set*Target function can only be called on the context
 
54
    before setupDocument. */
 
55
    bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base);
 
56
 
 
57
    /** Traverses the object tree and invokes the render methods. */
 
58
    void renderItem(CairoRenderContext *ctx, SPItem *item);
 
59
};
 
60
 
 
61
// FIXME: this should be a static method of CairoRenderer
 
62
void calculatePreserveAspectRatio(unsigned int aspect_align, unsigned int aspect_clip, double vp_width,
 
63
                                  double vp_height, double *x, double *y, double *width, double *height);
 
64
 
 
65
}  /* namespace Internal */
 
66
}  /* namespace Extension */
 
67
}  /* namespace Inkscape */
 
68
 
 
69
#endif /* !EXTENSION_INTERNAL_CAIRO_RENDERER_H_SEEN */
 
70
 
 
71
/*
 
72
  Local Variables:
 
73
  mode:c++
 
74
  c-file-style:"stroustrup"
 
75
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
76
  indent-tabs-mode:nil
 
77
  fill-column:99
 
78
  End:
 
79
*/
 
80
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :