Code

Filters. New custom predefined cross-smooth filter (very experimental...).
[inkscape.git] / src / extension / internal / latex-text-renderer.h
1 #ifndef EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN
2 #define EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN
4 /** \file
5  * Declaration of LaTeXTextRenderer, used for rendering the accompanying LaTeX file when exporting to PDF/EPS/PS + 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 <2geom/matrix.h>
22 #include <stack>
24 class SPItem;
26 namespace Inkscape {
27 namespace Extension {
28 namespace Internal {
30 bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename,
31                                         const gchar * const exportId, bool exportDrawing, bool exportCanvas,
32                                         bool pdflatex);
34 class LaTeXTextRenderer {
35 public:
36     LaTeXTextRenderer(bool pdflatex);
37     virtual ~LaTeXTextRenderer();
39     bool setTargetFile(gchar const *filename);
41     /** Initializes the LaTeXTextRenderer according to the specified
42     SPDocument. Important to set the boundingbox to the pdf boundingbox */
43     bool setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *base);
45     /** Traverses the object tree and invokes the render methods. */
46     void renderItem(SPItem *item);
48 protected:
49     FILE * _stream;
50     gchar * _filename;
52     bool _pdflatex; /** true if ouputting for pdfLaTeX*/
54     void push_transform(Geom::Matrix const &transform);
55     Geom::Matrix const & transform();
56     void pop_transform();
57     std::stack<Geom::Matrix> _transform_stack;
59     void writePreamble();
60     void writePostamble();
62     void sp_item_invoke_render(SPItem *item);
63     void sp_root_render(SPItem *item);
64     void sp_group_render(SPItem *item);
65     void sp_use_render(SPItem *item);
66     void sp_text_render(SPItem *item);
67     void sp_flowtext_render(SPItem *item);
68 };
70 }  /* namespace Internal */
71 }  /* namespace Extension */
72 }  /* namespace Inkscape */
74 #endif /* !EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN */
76 /*
77   Local Variables:
78   mode:c++
79   c-file-style:"stroustrup"
80   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
81   indent-tabs-mode:nil
82   fill-column:99
83   End:
84 */
85 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :