Code

writePreamble and writePostamble
[inkscape.git] / src / extension / internal / pdflatex-renderer.h
1 #ifndef EXTENSION_INTERNAL_PDF_LATEX_RENDERER_H_SEEN
2 #define EXTENSION_INTERNAL_PDF_LATEX_RENDERER_H_SEEN
4 /** \file
5  * Declaration of PDFLaTeXRenderer, used for rendering the accompanying LaTeX file when saving PDF output + LaTeX 
6  */
7 /*
8  * Authors:
9  *  Johan Engelen <goejendaagh@zonnet.nl>
10  *
11  * Copyright (C) 2010 Authors
12  * 
13  * Licensed under GNU GPL
14  */
16 #ifdef HAVE_CONFIG_H
17 # include "config.h"
18 #endif
20 #include "extension/extension.h"
21 #include <set>
22 #include <string>
24 #include "style.h"
26 #include <cairo.h>
28 #include <2geom/matrix.h>
30 class SPClipPath;
31 class SPMask;
32 class SPItem;
34 namespace Inkscape {
35 namespace Extension {
36 namespace Internal {
38 class PDFLaTeXRenderer {
39 public:
40     PDFLaTeXRenderer();
41     virtual ~PDFLaTeXRenderer();
43     bool setTargetFile(gchar const *filename);
45     void setStateForItem(SPItem const *item);
47 //    void applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp);
48 //    void applyMask(CairoRenderContext *ctx, SPMask const *mask);
50     /** Initializes the PDFLaTeXRenderer according to the specified
51     SPDocument. Important to set the boundingbox to the pdf boundingbox */
52     bool setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *base);
54     /** Traverses the object tree and invokes the render methods. */
55     void renderItem(SPItem *item);
57 protected:
58     FILE * _stream;
59     gchar * _filename;
61     void transform(Geom::Matrix const &transform);
62     Geom::Matrix _m; // the transform for current item
63     double _width;
64     double _height;
66     void writePreamble();
67     void writePostamble();
69     void sp_item_invoke_render(SPItem *item);
70     void sp_root_render(SPItem *item);
71     void sp_group_render(SPItem *item);
72     void sp_use_render(SPItem *item);
73     void sp_text_render(SPItem *item);
74     void sp_flowtext_render(SPItem *item);
75 };
77 }  /* namespace Internal */
78 }  /* namespace Extension */
79 }  /* namespace Inkscape */
81 #endif /* !EXTENSION_INTERNAL_CAIRO_RENDERER_H_SEEN */
83 /*
84   Local Variables:
85   mode:c++
86   c-file-style:"stroustrup"
87   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88   indent-tabs-mode:nil
89   fill-column:99
90   End:
91 */
92 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :