QTeXEngine  0.2
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
QTeXPaintEngine Class Reference

#include <QTeXEngine.h>

Inheritance diagram for QTeXPaintEngine:

Public Member Functions

virtual bool begin (QPaintDevice *)
 
virtual void drawEllipse (const QRectF &)
 
virtual void drawImage (const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags)
 
virtual void drawLines (const QLineF *, int)
 
virtual void drawPath (const QPainterPath &path)
 
virtual void drawPixmap (const QRectF &, const QPixmap &, const QRectF &)
 
virtual void drawPoints (const QPointF *points, int pointCount)
 
virtual void drawPolygon (const QPointF *, int, PolygonDrawMode)
 
virtual void drawRects (const QRectF *, int)
 
virtual void drawTextItem (const QPointF &, const QTextItem &)
 
virtual bool end ()
 
void exportFontSizes (bool on=true)
 
 QTeXPaintEngine (const QString &, QTeXPaintDevice::Unit u=QTeXPaintDevice::pt)
 
void setDocumentMode (bool on=true)
 
void setEscapeTextMode (bool on=true)
 Enables/Disables escaping of special characters in texts. More...
 
void setGrayScale (bool on=true)
 Enables/Disables gray scale output. More...
 
void setOutputMode (QTeXPaintDevice::OutputMode mode)
 Set output syntax. More...
 
void setTextHorizontalAlignment (Qt::Alignment alignment)
 
void setUnit (QTeXPaintDevice::Unit u)
 Set length unit. More...
 
virtual QPaintEngine::Type type () const
 
virtual void updateState (const QPaintEngineState &)
 
 ~QTeXPaintEngine ()
 

Private Types

enum  Shape {
  Line, Polygon, Polyline, Rect,
  Ellipse, Path, Points
}
 

Private Member Functions

bool addNewBrushColor ()
 Returns true if a new color command should be added. More...
 
bool addNewPatternColor ()
 
bool addNewPenColor ()
 
QString beginScope ()
 
bool changedClipping ()
 
QString clipPath ()
 
QString color (const QColor &col)
 
QPointF convertPoint (const QPointF &p)
 
QString defineColor (const QColor &c, const QString &name)
 
QString drawPgfShape (Shape shape, const QString &path)
 
void drawPixmap (const QPixmap &pix, const QRectF &p)
 Draws pixmap pix in a given rectangle. More...
 
QString drawShape (Shape shape, const QString &path)
 
QString drawTikzShape (Shape shape, const QString &path)
 
bool emptyStringOperation ()
 Returns true if draw operation has NoBrush and NoPen. More...
 
QString endScope ()
 
QString indentString (const QString &s)
 
QString path (const QPainterPath &path)
 
QString pgfBrush (const QBrush &brush)
 
QString pgfPath (const QPainterPath &path)
 
QString pgfPen (const QPen &pen)
 
QString pgfPoint (const QPointF &p)
 
double resFactorX ()
 
double resFactorY ()
 
QString tikzBrush (const QBrush &brush)
 
QString tikzPath (const QPainterPath &path)
 
QString tikzPen (const QPen &pen)
 
QString tikzPoint (const QPointF &p)
 
QString unit ()
 
double unitFactor ()
 
void writeToFile (const QString &s)
 

Private Attributes

QPainterPath d_clip_path
 
QColor d_current_color
 
bool d_document_mode
 
bool d_escape_text
 
bool d_font_size
 
bool d_gray_scale
 
Qt::Alignment d_horizontal_alignment
 
bool d_open_scope
 
QColor d_pattern_color
 
bool d_pgf_mode
 
int d_pixmap_index
 
QTeXPaintDevice::Unit d_unit
 
QFile * file
 
QString fname
 Name of the output file. More...
 

Member Enumeration Documentation

◆ Shape

enum QTeXPaintEngine::Shape
private
Enumerator
Line 
Polygon 
Polyline 
Rect 
Ellipse 
Path 
Points 

Constructor & Destructor Documentation

◆ QTeXPaintEngine()

QTeXPaintEngine::QTeXPaintEngine ( const QString &  f,
QTeXPaintDevice::Unit  u = QTeXPaintDevice::pt 
)

◆ ~QTeXPaintEngine()

QTeXPaintEngine::~QTeXPaintEngine ( )
inline

Member Function Documentation

◆ addNewBrushColor()

bool QTeXPaintEngine::addNewBrushColor ( )
private

Returns true if a new color command should be added.

References changedClipping(), and d_current_color.

Referenced by tikzBrush().

◆ addNewPatternColor()

bool QTeXPaintEngine::addNewPatternColor ( )
private

References d_pattern_color.

Referenced by tikzBrush().

◆ addNewPenColor()

bool QTeXPaintEngine::addNewPenColor ( )
private

◆ begin()

bool QTeXPaintEngine::begin ( QPaintDevice *  p)
virtual

◆ beginScope()

QString QTeXPaintEngine::beginScope ( )
private

◆ changedClipping()

bool QTeXPaintEngine::changedClipping ( )
private

◆ clipPath()

QString QTeXPaintEngine::clipPath ( )
private

References d_pgf_mode, path(), pgfPath(), and tikzPath().

Referenced by beginScope(), and changedClipping().

◆ color()

QString QTeXPaintEngine::color ( const QColor &  col)
private

◆ convertPoint()

QPointF QTeXPaintEngine::convertPoint ( const QPointF &  p)
private

◆ defineColor()

QString QTeXPaintEngine::defineColor ( const QColor &  c,
const QString &  name 
)
private

References d_gray_scale.

Referenced by pgfBrush(), and tikzBrush().

◆ drawEllipse()

void QTeXPaintEngine::drawEllipse ( const QRectF &  rect)
virtual

◆ drawImage()

void QTeXPaintEngine::drawImage ( const QRectF &  r,
const QImage &  image,
const QRectF &  sr,
Qt::ImageConversionFlags  flags 
)
virtual

References drawPixmap().

◆ drawLines()

void QTeXPaintEngine::drawLines ( const QLineF *  lines,
int  lineCount 
)
virtual

References drawShape(), Line, path(), and writeToFile().

◆ drawPath()

void QTeXPaintEngine::drawPath ( const QPainterPath &  path)
virtual

◆ drawPgfShape()

QString QTeXPaintEngine::drawPgfShape ( Shape  shape,
const QString &  path 
)
private

References Ellipse, Line, Path, path(), pgfBrush(), pgfPen(), Points, Polygon, Polyline, and Rect.

Referenced by drawShape().

◆ drawPixmap() [1/2]

void QTeXPaintEngine::drawPixmap ( const QRectF &  r,
const QPixmap &  pm,
const QRectF &  sr 
)
virtual

Referenced by drawImage().

◆ drawPixmap() [2/2]

void QTeXPaintEngine::drawPixmap ( const QPixmap &  pix,
const QRectF &  p 
)
private

Draws pixmap pix in a given rectangle.

References convertPoint(), d_pixmap_index, file, pgfPoint(), resFactorX(), resFactorY(), and unit().

◆ drawPoints()

void QTeXPaintEngine::drawPoints ( const QPointF *  points,
int  pointCount 
)
virtual

◆ drawPolygon()

void QTeXPaintEngine::drawPolygon ( const QPointF *  points,
int  pointCount,
PolygonDrawMode  mode 
)
virtual

◆ drawRects()

void QTeXPaintEngine::drawRects ( const QRectF *  rects,
int  rectCount 
)
virtual

◆ drawShape()

QString QTeXPaintEngine::drawShape ( Shape  shape,
const QString &  path 
)
private

◆ drawTextItem()

void QTeXPaintEngine::drawTextItem ( const QPointF &  p,
const QTextItem &  textItem 
)
virtual

◆ drawTikzShape()

QString QTeXPaintEngine::drawTikzShape ( Shape  shape,
const QString &  path 
)
private

References Line, path(), Polyline, tikzBrush(), and tikzPen().

Referenced by drawShape().

◆ emptyStringOperation()

bool QTeXPaintEngine::emptyStringOperation ( )
private

Returns true if draw operation has NoBrush and NoPen.

References color().

Referenced by drawEllipse(), drawPath(), drawPoints(), drawPolygon(), and drawRects().

◆ end()

bool QTeXPaintEngine::end ( )
virtual

◆ endScope()

QString QTeXPaintEngine::endScope ( )
private

References d_pgf_mode.

Referenced by end(), and writeToFile().

◆ exportFontSizes()

void QTeXPaintEngine::exportFontSizes ( bool  on = true)
inline

References d_font_size.

Referenced by QTeXPaintDevice::exportFontSizes().

◆ indentString()

QString QTeXPaintEngine::indentString ( const QString &  s)
private

Referenced by beginScope(), and writeToFile().

◆ path()

QString QTeXPaintEngine::path ( const QPainterPath &  path)
private

◆ pgfBrush()

QString QTeXPaintEngine::pgfBrush ( const QBrush &  brush)
private

References color(), and defineColor().

Referenced by drawPgfShape().

◆ pgfPath()

QString QTeXPaintEngine::pgfPath ( const QPainterPath &  path)
private

References convertPoint(), path(), and pgfPoint().

Referenced by clipPath(), and path().

◆ pgfPen()

QString QTeXPaintEngine::pgfPen ( const QPen &  pen)
private

References color(), and unit().

Referenced by drawPgfShape().

◆ pgfPoint()

QString QTeXPaintEngine::pgfPoint ( const QPointF &  p)
private

◆ resFactorX()

double QTeXPaintEngine::resFactorX ( )
private

References unitFactor().

Referenced by convertPoint(), drawEllipse(), and drawPixmap().

◆ resFactorY()

double QTeXPaintEngine::resFactorY ( )
private

References unitFactor().

Referenced by convertPoint(), drawEllipse(), and drawPixmap().

◆ setDocumentMode()

void QTeXPaintEngine::setDocumentMode ( bool  on = true)
inline

◆ setEscapeTextMode()

void QTeXPaintEngine::setEscapeTextMode ( bool  on = true)
inline

Enables/Disables escaping of special characters in texts.

References d_escape_text.

Referenced by QTeXPaintDevice::setEscapeTextMode().

◆ setGrayScale()

void QTeXPaintEngine::setGrayScale ( bool  on = true)
inline

Enables/Disables gray scale output.

References d_gray_scale.

Referenced by QTeXPaintDevice::setColorMode().

◆ setOutputMode()

void QTeXPaintEngine::setOutputMode ( QTeXPaintDevice::OutputMode  mode)
inline

Set output syntax.

References d_pgf_mode, and QTeXPaintDevice::Pgf.

Referenced by QTeXPaintDevice::setOutputMode().

◆ setTextHorizontalAlignment()

void QTeXPaintEngine::setTextHorizontalAlignment ( Qt::Alignment  alignment)
inline

◆ setUnit()

void QTeXPaintEngine::setUnit ( QTeXPaintDevice::Unit  u)
inline

Set length unit.

References d_unit.

Referenced by QTeXPaintDevice::setUnit().

◆ tikzBrush()

QString QTeXPaintEngine::tikzBrush ( const QBrush &  brush)
private

◆ tikzPath()

QString QTeXPaintEngine::tikzPath ( const QPainterPath &  path)
private

References convertPoint(), path(), and tikzPoint().

Referenced by begin(), clipPath(), and path().

◆ tikzPen()

QString QTeXPaintEngine::tikzPen ( const QPen &  pen)
private

References addNewPenColor(), color(), d_current_color, and unit().

Referenced by drawTikzShape().

◆ tikzPoint()

QString QTeXPaintEngine::tikzPoint ( const QPointF &  p)
private

References unit().

Referenced by drawEllipse(), drawPoints(), and tikzPath().

◆ type()

virtual QPaintEngine::Type QTeXPaintEngine::type ( ) const
inlinevirtual

◆ unit()

QString QTeXPaintEngine::unit ( )
private

◆ unitFactor()

double QTeXPaintEngine::unitFactor ( )
private

◆ updateState()

virtual void QTeXPaintEngine::updateState ( const QPaintEngineState &  )
inlinevirtual

◆ writeToFile()

void QTeXPaintEngine::writeToFile ( const QString &  s)
private

Member Data Documentation

◆ d_clip_path

QPainterPath QTeXPaintEngine::d_clip_path
private

◆ d_current_color

QColor QTeXPaintEngine::d_current_color
private

◆ d_document_mode

bool QTeXPaintEngine::d_document_mode
private

◆ d_escape_text

bool QTeXPaintEngine::d_escape_text
private

◆ d_font_size

bool QTeXPaintEngine::d_font_size
private

◆ d_gray_scale

bool QTeXPaintEngine::d_gray_scale
private

◆ d_horizontal_alignment

Qt::Alignment QTeXPaintEngine::d_horizontal_alignment
private

◆ d_open_scope

bool QTeXPaintEngine::d_open_scope
private

Referenced by end(), QTeXPaintEngine(), and writeToFile().

◆ d_pattern_color

QColor QTeXPaintEngine::d_pattern_color
private

◆ d_pgf_mode

bool QTeXPaintEngine::d_pgf_mode
private

◆ d_pixmap_index

int QTeXPaintEngine::d_pixmap_index
private

Referenced by drawPixmap().

◆ d_unit

QTeXPaintDevice::Unit QTeXPaintEngine::d_unit
private

Referenced by setUnit(), unit(), and unitFactor().

◆ file

QFile* QTeXPaintEngine::file
private

Referenced by begin(), drawPixmap(), end(), and writeToFile().

◆ fname

QString QTeXPaintEngine::fname
private

Name of the output file.

Referenced by begin().


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