kate Library API Documentation

KateRenderer Class Reference

Handles all of the work in directly rendering Kate's view. More...

#include <katerenderer.h>

List of all members.

Public Types

enum  caretStyles { Insert, Replace }

Public Member Functions

 KateRenderer (KateDocument *doc, KateView *view=0)
void updateAttributes ()
bool drawCaret () const
void setDrawCaret (bool drawCaret)
bool caretStyle () const
void setCaretStyle (int style)
bool showTabs () const
void setShowTabs (bool showTabs)
void setTabWidth (int tabWidth)
bool showSelections () const
void setShowSelections (bool showSelections)
void increaseFontSizes ()
void decreaseFontSizes ()
const QFontcurrentFont ()
const QFontMetricscurrentFontMetrics ()
bool isPrinterFriendly () const
void setPrinterFriendly (bool printerFriendly)
uint spaceWidth ()
uint textWidth (const TextLine::Ptr &, int cursorCol)
uint textWidth (const TextLine::Ptr &textLine, uint startcol, uint maxwidth, bool *needWrap, int *endX=0)
uint textWidth (const KateTextCursor &cursor)
uint textWidth (KateTextCursor &cursor, int xPos, uint startCol=0)
uint textPos (uint line, int xPos, uint startCol=0)
uint textPos (const TextLine::Ptr &, int xPos, uint startCol=0)
uint fontHeight ()
uint documentHeight ()
bool selectBounds (uint line, uint &start, uint &end, uint lineLength)
void paintTextLine (QPainter &paint, const LineRange *range, int xStart, int xEnd, const KateTextCursor *cursor=0L, const KateTextRange *bracketmark=0L)
KateAttributeattribute (uint pos)
KateRendererConfig * config ()
void updateConfig ()


Detailed Description

Handles all of the work in directly rendering Kate's view.

Definition at line 41 of file katerenderer.h.


Member Function Documentation

bool KateRenderer::drawCaret  )  const
 

Determine whether the caret (text cursor) will be drawn.

Definition at line 74 of file katerenderer.cpp.

Referenced by paintTextLine().

void KateRenderer::setDrawCaret bool  drawCaret  ) 
 

Set whether the caret (text cursor) will be drawn.

Definition at line 79 of file katerenderer.cpp.

Referenced by setPrinterFriendly().

bool KateRenderer::caretStyle  )  const
 

The style of the caret (text cursor) to be painted.

Definition at line 84 of file katerenderer.cpp.

Referenced by paintTextLine().

void KateRenderer::setCaretStyle int  style  ) 
 

Set the style of caret to be painted.

Definition at line 89 of file katerenderer.cpp.

bool KateRenderer::showTabs  )  const
 

Returns:
whether tabs should be shown (ie. a small mark drawn to identify a tab)

Definition at line 94 of file katerenderer.cpp.

Referenced by paintTextLine().

void KateRenderer::setShowTabs bool  showTabs  ) 
 

Set whether a mark should be painted to help identifying tabs.

Definition at line 99 of file katerenderer.cpp.

Referenced by setPrinterFriendly().

void KateRenderer::setTabWidth int  tabWidth  ) 
 

Sets the width of the tab.

Helps performance.

Definition at line 104 of file katerenderer.cpp.

bool KateRenderer::showSelections  )  const
 

Show the view's selection?

Definition at line 109 of file katerenderer.cpp.

Referenced by paintTextLine().

void KateRenderer::setShowSelections bool  showSelections  ) 
 

Set whether the view's selections should be shown.

The default is true.

Definition at line 114 of file katerenderer.cpp.

Referenced by setPrinterFriendly().

void KateRenderer::increaseFontSizes  ) 
 

Change to a different font (soon to be font set?).

Definition at line 119 of file katerenderer.cpp.

References config(), QFont::pointSize(), and QFont::setPointSize().

bool KateRenderer::isPrinterFriendly  )  const
 

Returns:
whether the renderer is configured to paint in a printer-friendly fashion.

Definition at line 137 of file katerenderer.cpp.

Referenced by paintTextLine().

void KateRenderer::setPrinterFriendly bool  printerFriendly  ) 
 

Configure this renderer to paint in a printer-friendly fashion.

Sets the other options appropriately if true.

Definition at line 142 of file katerenderer.cpp.

References setDrawCaret(), setShowSelections(), and setShowTabs().

uint KateRenderer::spaceWidth  ) 
 

Text width & height calculation functions...

Definition at line 902 of file katerenderer.cpp.

References config(), and KateAttribute::width().

void KateRenderer::paintTextLine QPainter paint,
const LineRange *  range,
int  xStart,
int  xEnd,
const KateTextCursor cursor = 0L,
const KateTextRange *  bracketmark = 0L
 

This is the ultimate function to perform painting of a text line.

(supports startcol/endcol, startx/endx)

The text line is painted from the upper limit of (0,0). To move that, apply a transform to your painter.

Definition at line 150 of file katerenderer.cpp.

References KateAttribute::bgColor(), QColor::blue(), caretStyle(), KateTextCursor::col(), QColorGroup::color(), config(), drawCaret(), QPainter::drawLine(), QPainter::drawPoint(), QPainter::drawText(), QString::fill(), QPainter::fillRect(), KateAttribute::font(), QColor::green(), isPrinterFriendly(), QColor::isValid(), KateAttribute::itemSet(), QString::length(), QPainter::pen(), QColor::red(), QPainter::restore(), QPainter::save(), KateAttribute::selectedTextColor(), KateTextCursor::setCol(), QPainter::setFont(), QColor::setHsv(), QPainter::setPen(), QColor::setRgb(), KateAttribute::setTextColor(), showSelections(), showTabs(), KateAttribute::textColor(), and KateAttribute::width().

KateRendererConfig* KateRenderer::config  )  [inline]
 

Configuration.

Definition at line 180 of file katerenderer.h.

Referenced by increaseFontSizes(), paintTextLine(), and spaceWidth().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kate Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:45:20 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003