~ubuntu-branches/debian/squeeze/inkscape/squeeze

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef EXTENSION_INTERNAL_PDF_H_SEEN
2
 
#define EXTENSION_INTERNAL_PDF_H_SEEN
3
 
 
4
 
/*
5
 
 * Authors:
6
 
 *     Lauris Kaplinski <lauris@kaplinski.com>
7
 
 *     Ted Gould <ted@gould.cx>
8
 
 *     Ulf Erikson <ulferikson@users.sf.net>
9
 
 *
10
 
 * Lauris' original code is in the public domain.
11
 
 * Ted's changes are licensed under the GNU GPL.
12
 
 */
13
 
 
14
 
#include <config.h>
15
 
#include "extension/extension.h"
16
 
#include "extension/implementation/implementation.h"
17
 
#include <set>
18
 
#include <string>
19
 
 
20
 
#include "libnr/nr-path.h"
21
 
 
22
 
#include "svg/stringstream.h"
23
 
 
24
 
class PdfFile;
25
 
class PdfObject;
26
 
 
27
 
namespace Inkscape {
28
 
namespace Extension {
29
 
namespace Internal {
30
 
 
31
 
class PrintPDF : public Inkscape::Extension::Implementation::Implementation {
32
 
    float _width;
33
 
    float _height;
34
 
    FILE *_stream;
35
 
    PdfFile   *pdf_file;
36
 
    PdfObject *doc_info;
37
 
    PdfObject *page_stream;
38
 
    unsigned short _dpi;
39
 
    bool _bitmap;
40
 
    std::set<std::string> _latin1_encoded_fonts;
41
 
    bool _newlatin1font_proc_defined;
42
 
 
43
 
    void print_bpath(SVGOStringStream &os, NArtBpath const *bp);
44
 
 
45
 
    void print_fill_style(SVGOStringStream &os, SPStyle const *style, NRRect const *pbox);
46
 
    void print_fill_alpha(SVGOStringStream &os, SPStyle const *style, NRRect const *pbox);
47
 
    void print_stroke_style(SVGOStringStream &os, SPStyle const *style);
48
 
 
49
 
    char const *PSFontName(SPStyle const *style);
50
 
 
51
 
    unsigned int print_image(FILE *ofp, guchar *px, unsigned int width, unsigned int height, unsigned int rs,
52
 
                             NRMatrix const *transform);
53
 
    void compress_packbits(int nin, guchar *src, int *nout, guchar *dst);
54
 
 
55
 
    /* ASCII 85 variables */
56
 
    guint32 ascii85_buf;
57
 
    int ascii85_len;
58
 
    int ascii85_linewidth;
59
 
    /* ASCII 85 Functions */
60
 
    void ascii85_init(void);
61
 
    void ascii85_flush(SVGOStringStream &os);
62
 
    inline void ascii85_out(guchar byte, SVGOStringStream &os);
63
 
    void ascii85_nout(int n, guchar *uptr, SVGOStringStream &os);
64
 
    void ascii85_done(SVGOStringStream &os);
65
 
 
66
 
 
67
 
public:
68
 
    PrintPDF(void);
69
 
    virtual ~PrintPDF(void);
70
 
 
71
 
    /* Print functions */
72
 
    virtual unsigned int setup(Inkscape::Extension::Print *module);
73
 
    /*
74
 
      virtual unsigned int set_preview(Inkscape::Extension::Print *module);
75
 
    */
76
 
 
77
 
    virtual unsigned int begin(Inkscape::Extension::Print *module, SPDocument *doc);
78
 
    virtual unsigned int finish(Inkscape::Extension::Print *module);
79
 
 
80
 
    /* Rendering methods */
81
 
    virtual unsigned int bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity);
82
 
    virtual unsigned int release(Inkscape::Extension::Print *module);
83
 
    virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment);
84
 
    virtual unsigned int fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
85
 
                              NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
86
 
    virtual unsigned int stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
87
 
                                NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
88
 
    virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
89
 
                               NRMatrix const *transform, SPStyle const *style);
90
 
    virtual unsigned int text(Inkscape::Extension::Print *module, char const *text,
91
 
                              NR::Point p, SPStyle const *style);
92
 
 
93
 
    bool textToPath(Inkscape::Extension::Print *ext);
94
 
    static void init(void);
95
 
};
96
 
 
97
 
}  /* namespace Internal */
98
 
}  /* namespace Extension */
99
 
}  /* namespace Inkscape */
100
 
 
101
 
 
102
 
#endif /* !EXTENSION_INTERNAL_PDF_H_SEEN */
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 :