Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Extension::Internal::LaTeXTextRenderer Class Reference

#include <latex-text-renderer.h>

Public Member Functions

 LaTeXTextRenderer (bool pdflatex)
 
virtual ~LaTeXTextRenderer ()
 
bool setTargetFile (gchar const *filename)
 This should create the output LaTeX file, and assign it to _stream.
 
bool setupDocument (SPDocument *doc, SPItem *base)
 Initializes the LaTeXTextRenderer according to the specified SPDocument.
 
void renderItem (SPItem *item)
 Traverses the object tree and invokes the render methods.
 

Protected Types

enum  LaTeXOmitTextPageState { EMPTY , GRAPHIC_ON_TOP , NEW_PAGE_ON_GRAPHIC }
 

Protected Member Functions

void push_transform (Geom::Affine const &transform)
 
Geom::Affine const & transform ()
 
void pop_transform ()
 
void writePreamble ()
 
void writePostamble ()
 
void writeGraphicPage ()
 
void sp_item_invoke_render (SPItem *item)
 
void sp_root_render (SPRoot *item)
 
void sp_group_render (SPGroup *group)
 
void sp_use_render (SPUse *use)
 
void sp_text_render (SPText *text)
 
void sp_flowtext_render (SPFlowtext *flowtext)
 

Protected Attributes

FILE * _stream
 
gchar * _filename
 
bool _pdflatex
 
LaTeXOmitTextPageState _omittext_state
 true if outputting for pdfLaTeX
 
gulong _omittext_page
 
std::stack< Geom::Affine_transform_stack
 

Detailed Description

Definition at line 34 of file latex-text-renderer.h.

Member Enumeration Documentation

◆ LaTeXOmitTextPageState

Enumerator
EMPTY 
GRAPHIC_ON_TOP 
NEW_PAGE_ON_GRAPHIC 

Definition at line 49 of file latex-text-renderer.h.

Constructor & Destructor Documentation

◆ LaTeXTextRenderer()

Inkscape::Extension::Internal::LaTeXTextRenderer::LaTeXTextRenderer ( bool  pdflatex)

Definition at line 80 of file latex-text-renderer.cpp.

References Geom::identity(), and push_transform().

◆ ~LaTeXTextRenderer()

Inkscape::Extension::Internal::LaTeXTextRenderer::~LaTeXTextRenderer ( )
virtual

Definition at line 90 of file latex-text-renderer.cpp.

References _filename, _stream, and writePostamble().

Member Function Documentation

◆ pop_transform()

void Inkscape::Extension::Internal::LaTeXTextRenderer::pop_transform ( )
protected

Definition at line 696 of file latex-text-renderer.cpp.

References _transform_stack.

Referenced by renderItem(), sp_root_render(), and sp_use_render().

◆ push_transform()

void Inkscape::Extension::Internal::LaTeXTextRenderer::push_transform ( Geom::Affine const &  transform)
protected

◆ renderItem()

void Inkscape::Extension::Internal::LaTeXTextRenderer::renderItem ( SPItem item)

Traverses the object tree and invokes the render methods.

Definition at line 608 of file latex-text-renderer.cpp.

References item, pop_transform(), push_transform(), sp_item_invoke_render(), and SPItem::transform.

Referenced by Inkscape::Extension::Internal::latex_render_document_text_to_file(), sp_group_render(), and sp_use_render().

◆ setTargetFile()

bool Inkscape::Extension::Internal::LaTeXTextRenderer::setTargetFile ( gchar const *  filename)

This should create the output LaTeX file, and assign it to _stream.

Returns
Returns true when successful

Definition at line 107 of file latex-text-renderer.cpp.

References _filename, _stream, Inkscape::IO::dump_fopen_call(), Inkscape::IO::fopen_utf8name(), Inkscape::version_string, and writePreamble().

Referenced by Inkscape::Extension::Internal::latex_render_document_text_to_file().

◆ setupDocument()

◆ sp_flowtext_render()

◆ sp_group_render()

void Inkscape::Extension::Internal::LaTeXTextRenderer::sp_group_render ( SPGroup group)
protected

Definition at line 200 of file latex-text-renderer.cpp.

References SPObject::childList(), item, and renderItem().

Referenced by sp_item_invoke_render(), and sp_root_render().

◆ sp_item_invoke_render()

void Inkscape::Extension::Internal::LaTeXTextRenderer::sp_item_invoke_render ( SPItem item)
protected

◆ sp_root_render()

void Inkscape::Extension::Internal::LaTeXTextRenderer::sp_root_render ( SPRoot item)
protected

Definition at line 564 of file latex-text-renderer.cpp.

References pop_transform(), push_transform(), root, and sp_group_render().

Referenced by sp_item_invoke_render().

◆ sp_text_render()

void Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render ( SPText text)
protected

◆ sp_use_render()

void Inkscape::Extension::Internal::LaTeXTextRenderer::sp_use_render ( SPUse use)
protected

◆ transform()

Geom::Affine const & Inkscape::Extension::Internal::LaTeXTextRenderer::transform ( )
protected

Definition at line 679 of file latex-text-renderer.cpp.

References _transform_stack.

Referenced by sp_flowtext_render(), and sp_text_render().

◆ writeGraphicPage()

void Inkscape::Extension::Internal::LaTeXTextRenderer::writeGraphicPage ( )
protected

◆ writePostamble()

void Inkscape::Extension::Internal::LaTeXTextRenderer::writePostamble ( )
protected

Definition at line 195 of file latex-text-renderer.cpp.

References _stream, and Inkscape::Extension::Internal::postamble.

Referenced by ~LaTeXTextRenderer().

◆ writePreamble()

void Inkscape::Extension::Internal::LaTeXTextRenderer::writePreamble ( )
protected

Definition at line 190 of file latex-text-renderer.cpp.

References _stream, and Inkscape::Extension::Internal::preamble.

Referenced by setTargetFile().

Member Data Documentation

◆ _filename

gchar* Inkscape::Extension::Internal::LaTeXTextRenderer::_filename
protected

Definition at line 56 of file latex-text-renderer.h.

Referenced by setTargetFile(), writeGraphicPage(), and ~LaTeXTextRenderer().

◆ _omittext_page

gulong Inkscape::Extension::Internal::LaTeXTextRenderer::_omittext_page
protected

Definition at line 61 of file latex-text-renderer.h.

Referenced by writeGraphicPage().

◆ _omittext_state

LaTeXOmitTextPageState Inkscape::Extension::Internal::LaTeXTextRenderer::_omittext_state
protected

true if outputting for pdfLaTeX

Definition at line 60 of file latex-text-renderer.h.

Referenced by sp_flowtext_render(), sp_item_invoke_render(), and sp_text_render().

◆ _pdflatex

bool Inkscape::Extension::Internal::LaTeXTextRenderer::_pdflatex
protected

◆ _stream

FILE* Inkscape::Extension::Internal::LaTeXTextRenderer::_stream
protected

◆ _transform_stack

std::stack<Geom::Affine> Inkscape::Extension::Internal::LaTeXTextRenderer::_transform_stack
protected

Definition at line 66 of file latex-text-renderer.h.

Referenced by pop_transform(), push_transform(), and transform().


The documentation for this class was generated from the following files: