~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/extension/internal/pdf-cairo.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef EXTENSION_INTERNAL_PDF_CAIRO_H_SEEN
2
 
#define EXTENSION_INTERNAL_PDF_CAIRO_H_SEEN
3
 
 
4
 
/** \file
5
 
 * Declaration of PrintCairoPDF, the internal module used to do PDF printing with Cairo.
6
 
 */
7
 
/*
8
 
 * Authors:
9
 
 *         Lauris Kaplinski <lauris@kaplinski.com>
10
 
 *         Ted Gould <ted@gould.cx>
11
 
 *
12
 
 * Lauris' original code is in the public domain.
13
 
 * Ted's changes are licensed under the GNU GPL.
14
 
 */
15
 
 
16
 
#ifdef HAVE_CONFIG_H
17
 
# include "config.h"
18
 
#endif
19
 
 
20
 
#ifdef HAVE_CAIRO_PDF
21
 
 
22
 
#include "extension/extension.h"
23
 
#include "extension/implementation/implementation.h"
24
 
#include <set>
25
 
#include <string>
26
 
 
27
 
#include "libnr/nr-path.h"
28
 
#include "libnrtype/font-instance.h"
29
 
 
30
 
#include "svg/stringstream.h"
31
 
#include "sp-gradient.h"
32
 
 
33
 
#include <cairo.h>
34
 
 
35
 
namespace Inkscape {
36
 
namespace Extension {
37
 
namespace Internal {
38
 
 
39
 
class PrintCairoPDF : public Inkscape::Extension::Implementation::Implementation {
40
 
    float _width;
41
 
    float _height;
42
 
    FILE *_stream;
43
 
    cairo_t *cr;
44
 
    cairo_surface_t *pdf_surface;
45
 
    PangoLayout *_layout;
46
 
//    PangoContext *_context;
47
 
    std::vector<float> _alpha_stack;
48
 
    double _last_tx, _last_ty;
49
 
    
50
 
    unsigned short _dpi;
51
 
    bool _bitmap;
52
 
 
53
 
    void print_bpath(cairo_t *cr, NArtBpath const *bp);
54
 
    cairo_pattern_t *create_pattern_for_paint(SPPaintServer const *const paintserver, NRRect const *pbox, float alpha);
55
 
    
56
 
    void print_fill_style(cairo_t *cr, SPStyle const *const style, NRRect const *pbox);
57
 
    void print_stroke_style(cairo_t *cr, SPStyle const *style, NRRect const *pbox);
58
 
 
59
 
#ifndef RENDER_WITH_PANGO_CAIRO
60
 
    NR::Point draw_glyphs(cairo_t *cr, NR::Point p, PangoFont *font, PangoGlyphString *glyph_string,
61
 
                          bool vertical, bool stroke);
62
 
#endif
63
 
 
64
 
public:
65
 
    PrintCairoPDF(void);
66
 
    virtual ~PrintCairoPDF(void);
67
 
 
68
 
    /* Print functions */
69
 
    virtual unsigned int setup(Inkscape::Extension::Print *module);
70
 
    /*
71
 
      virtual unsigned int set_preview(Inkscape::Extension::Print *module);
72
 
    */
73
 
 
74
 
    virtual unsigned int begin(Inkscape::Extension::Print *module, SPDocument *doc);
75
 
    virtual unsigned int finish(Inkscape::Extension::Print *module);
76
 
 
77
 
    /* Rendering methods */
78
 
    virtual unsigned int bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity);
79
 
    virtual unsigned int release(Inkscape::Extension::Print *module);
80
 
    virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment);
81
 
    virtual unsigned int fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
82
 
                              NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
83
 
    virtual unsigned int stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
84
 
                                NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
85
 
    virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
86
 
                               NRMatrix const *transform, SPStyle const *style);
87
 
    virtual unsigned int text(Inkscape::Extension::Print *module, char const *text,
88
 
                              NR::Point p, SPStyle const *style);
89
 
 
90
 
    bool textToPath(Inkscape::Extension::Print *ext);
91
 
    static void init(void);
92
 
};
93
 
 
94
 
}  /* namespace Internal */
95
 
}  /* namespace Extension */
96
 
}  /* namespace Inkscape */
97
 
 
98
 
#endif /* HAVE_CAIRO_PDF */
99
 
 
100
 
#endif /* !EXTENSION_INTERNAL_PDF_CAIRO_H_SEEN */
101
 
 
102
 
/*
103
 
  Local Variables:
104
 
  mode:c++
105
 
  c-file-style:"stroustrup"
106
 
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
107
 
  indent-tabs-mode:nil
108
 
  fill-column:99
109
 
  End:
110
 
*/
111
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :