.TH "KateRenderer" kde3 "11 Jun 2005" "Version Version 3.4.1" "kate Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KateRenderer \- Handles all of the work of rendering the text (used for the views and printing).  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <katerenderer.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBcaretStyles\fP { \fBInsert\fP, \fBReplace\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKateRenderer\fP (KateDocument *doc, KateView *view=0)"
.br
.ti -1c
.RI "\fB~KateRenderer\fP ()"
.br
.ti -1c
.RI "void \fBupdateAttributes\fP ()"
.br
.ti -1c
.RI "bool \fBdrawCaret\fP () const "
.br
.ti -1c
.RI "void \fBsetDrawCaret\fP (bool drawCaret)"
.br
.ti -1c
.RI "\fBKateRenderer::caretStyles\fP \fBcaretStyle\fP () const "
.br
.ti -1c
.RI "void \fBsetCaretStyle\fP (\fBKateRenderer::caretStyles\fP style)"
.br
.ti -1c
.RI "bool \fBshowTabs\fP () const "
.br
.ti -1c
.RI "void \fBsetShowTabs\fP (bool showTabs)"
.br
.ti -1c
.RI "void \fBsetTabWidth\fP (int tabWidth)"
.br
.ti -1c
.RI "bool \fBshowSelections\fP () const "
.br
.ti -1c
.RI "void \fBsetShowSelections\fP (bool showSelections)"
.br
.ti -1c
.RI "void \fBincreaseFontSizes\fP ()"
.br
.ti -1c
.RI "void \fBdecreaseFontSizes\fP ()"
.br
.ti -1c
.RI "const \fBQFont\fP * \fBcurrentFont\fP ()"
.br
.ti -1c
.RI "const \fBQFontMetrics\fP * \fBcurrentFontMetrics\fP ()"
.br
.ti -1c
.RI "bool \fBisPrinterFriendly\fP () const "
.br
.ti -1c
.RI "void \fBsetPrinterFriendly\fP (bool printerFriendly)"
.br
.ti -1c
.RI "uint \fBspaceWidth\fP ()"
.br
.ti -1c
.RI "uint \fBtextWidth\fP (const \fBKateTextLine::Ptr\fP &, int cursorCol)"
.br
.ti -1c
.RI "uint \fBtextWidth\fP (const \fBKateTextLine::Ptr\fP &textLine, uint startcol, uint maxwidth, bool *needWrap, int *endX=0)"
.br
.ti -1c
.RI "uint \fBtextWidth\fP (const \fBKateTextCursor\fP &cursor)"
.br
.ti -1c
.RI "uint \fBtextWidth\fP (\fBKateTextCursor\fP &cursor, int xPos, uint startCol=0)"
.br
.ti -1c
.RI "uint \fBtextPos\fP (uint line, int xPos, uint startCol=0, bool nearest=true)"
.br
.ti -1c
.RI "uint \fBtextPos\fP (const \fBKateTextLine::Ptr\fP &, int xPos, uint startCol=0, bool nearest=true)"
.br
.ti -1c
.RI "uint \fBfontHeight\fP ()"
.br
.ti -1c
.RI "uint \fBdocumentHeight\fP ()"
.br
.ti -1c
.RI "bool \fBgetSelectionBounds\fP (uint line, uint lineLength, uint &start, uint &end)"
.br
.ti -1c
.RI "void \fBpaintTextLine\fP (\fBQPainter\fP &paint, const KateLineRange *range, int xStart, int xEnd, const \fBKateTextCursor\fP *cursor=0L, const KateTextRange *bracketmark=0L)"
.br
.ti -1c
.RI "bool \fBpaintTextLineBackground\fP (\fBQPainter\fP &paint, int line, bool isCurrentLine, int xStart, int xEnd)"
.br
.ti -1c
.RI "\fBKateAttribute\fP * \fBattribute\fP (uint pos)"
.br
.ti -1c
.RI "KateRendererConfig * \fBconfig\fP ()"
.br
.ti -1c
.RI "void \fBupdateConfig\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
Handles all of the work of rendering the text (used for the views and printing). 
.PP
Definition at line 42 of file katerenderer.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKateRenderer::caretStyles\fP"
.PP
Style of Caret (Insert or Replace mode). 
.PP
Definition at line 48 of file katerenderer.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KateRenderer::KateRenderer (KateDocument * doc, KateView * view = \fC0\fP)"
.PP
Constructor. 
.PP
\fBParameters:\fP
.RS 4
\fIdoc\fP document to render 
.br
\fIview\fP view which is output (0 for example for rendering to print) 
.RE
.PP

.PP
Definition at line 40 of file katerenderer.cpp.
.PP
References updateAttributes().
.SS "KateRenderer::~\fBKateRenderer\fP ()"
.PP
Destructor. 
.PP
Definition at line 55 of file katerenderer.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KateRenderer::updateAttributes ()"
.PP
update the highlighting attributes (for example after an hl change or after hl config changed) 
.PP
Definition at line 61 of file katerenderer.cpp.
.PP
References config().
.PP
Referenced by KateRenderer().
.SS "bool KateRenderer::drawCaret () const\fC [inline]\fP"
.PP
Determine whether the caret (text cursor) will be drawn. 
.PP
\fBParameters:\fP
.RS 4
\fIshould\fP it be drawn? 
.RE
.PP

.PP
Definition at line 75 of file katerenderer.h.
.PP
Referenced by paintTextLine().
.SS "void KateRenderer::setDrawCaret (bool drawCaret)"
.PP
Set whether the caret (text cursor) will be drawn. 
.PP
\fBParameters:\fP
.RS 4
\fIdrawCaret\fP should caret be drawn? 
.RE
.PP

.PP
Definition at line 75 of file katerenderer.cpp.
.PP
Referenced by setPrinterFriendly().
.SS "\fBKateRenderer::caretStyles\fP KateRenderer::caretStyle () const\fC [inline]\fP"
.PP
The style of the caret (text cursor) to be painted. 
.PP
\fBReturns:\fP
.RS 4
caretStyle 
.RE
.PP

.PP
Definition at line 87 of file katerenderer.h.
.PP
Referenced by paintTextLine().
.SS "void KateRenderer::setCaretStyle (\fBKateRenderer::caretStyles\fP style)"
.PP
Set the style of caret to be painted. 
.PP
\fBParameters:\fP
.RS 4
\fIstyle\fP style to set 
.RE
.PP

.PP
Definition at line 80 of file katerenderer.cpp.
.SS "bool KateRenderer::showTabs () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
whether tabs should be shown (ie. a small mark drawn to identify a tab) 
.PP
tabs should be shown 
.RE
.PP

.PP
Definition at line 100 of file katerenderer.h.
.PP
Referenced by paintTextLine().
.SS "void KateRenderer::setShowTabs (bool showTabs)"
.PP
Set whether a mark should be painted to help identifying tabs. 
.PP
\fBParameters:\fP
.RS 4
\fIshowTabs\fP show the tabs? 
.RE
.PP

.PP
Definition at line 85 of file katerenderer.cpp.
.PP
Referenced by setPrinterFriendly().
.SS "void KateRenderer::setTabWidth (int tabWidth)"
.PP
Sets the width of the tab. 
.PP
Helps performance. 
.PP
\fBParameters:\fP
.RS 4
\fItabWidth\fP new tab width 
.RE
.PP

.PP
Definition at line 90 of file katerenderer.cpp.
.SS "bool KateRenderer::showSelections () const\fC [inline]\fP"
.PP
Show the view's selection? 
.PP
\fBReturns:\fP
.RS 4
show sels? 
.RE
.PP

.PP
Definition at line 118 of file katerenderer.h.
.PP
Referenced by paintTextLine(), and paintTextLineBackground().
.SS "void KateRenderer::setShowSelections (bool showSelections)"
.PP
Set whether the view's selections should be shown. 
.PP
The default is true. 
.PP
\fBParameters:\fP
.RS 4
\fIshowSelections\fP show the selections? 
.RE
.PP

.PP
Definition at line 95 of file katerenderer.cpp.
.PP
Referenced by setPrinterFriendly().
.SS "void KateRenderer::increaseFontSizes ()"
.PP
Change to a different font (soon to be font set?). 
.PP
Definition at line 100 of file katerenderer.cpp.
.PP
References config(), QFont::pointSize(), and QFont::setPointSize().
.SS "bool KateRenderer::isPrinterFriendly () const"
.PP
\fBReturns:\fP
.RS 4
whether the renderer is configured to paint in a printer-friendly fashion. 
.RE
.PP

.PP
Definition at line 118 of file katerenderer.cpp.
.PP
Referenced by paintTextLine(), and paintTextLineBackground().
.SS "void KateRenderer::setPrinterFriendly (bool printerFriendly)"
.PP
Configure this renderer to paint in a printer-friendly fashion. 
.PP
Sets the other options appropriately if true. 
.PP
Definition at line 123 of file katerenderer.cpp.
.PP
References setDrawCaret(), setShowSelections(), and setShowTabs().
.SS "uint KateRenderer::spaceWidth ()"
.PP
Text width & height calculation functions... 
.PP
Definition at line 902 of file katerenderer.cpp.
.PP
References attribute(), config(), and KateAttribute::width().
.SS "uint KateRenderer::textPos (uint line, int xPos, uint startCol = \fC0\fP, bool nearest = \fCtrue\fP)"
.PP
\fBReturns:\fP
.RS 4
the index of the character at the horixontal position \fCxpos\fP in \fCline\fP.
.RE
.PP
If \fCnearest\fP is true, the character starting nearest to \fCxPos\fP is returned. If \fCnearest\fP is false, the index of the character containing \fCxPos\fP is returned. 
.PP
Definition at line 809 of file katerenderer.cpp.
.SS "uint KateRenderer::textPos (const \fBKateTextLine::Ptr\fP &, int xPos, uint startCol = \fC0\fP, bool nearest = \fCtrue\fP)"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 
.PP
Definition at line 814 of file katerenderer.cpp.
.PP
References attribute(), config(), and KateAttribute::width().
.SS "void KateRenderer::paintTextLine (\fBQPainter\fP & paint, const KateLineRange * range, int xStart, int xEnd, const \fBKateTextCursor\fP * cursor = \fC0L\fP, const KateTextRange * bracketmark = \fC0L\fP)"
.PP
This is the ultimate function to perform painting of a text line. 
.PP
(supports startcol/endcol, startx/endx)
.PP
The text line is painted from the upper limit of (0,0). To move that, apply a transform to your painter. 
.PP
Definition at line 206 of file katerenderer.cpp.
.PP
References KateAttribute::bgColor(), caretStyle(), KateTextCursor::col(), QColorGroup::color(), config(), KSharedPtr< T >::data(), drawCaret(), QString::fill(), KateAttribute::font(), isPrinterFriendly(), KateAttribute::itemSet(), QString::length(), paintTextLineBackground(), KateAttribute::selectedTextColor(), KateTextCursor::setCol(), QColor::setHsv(), KateAttribute::setTextColor(), showSelections(), showTabs(), KateAttribute::textColor(), and KateAttribute::width().
.SS "bool KateRenderer::paintTextLineBackground (\fBQPainter\fP & paint, int line, bool isCurrentLine, int xStart, int xEnd)"
.PP
Paint the background of a line. 
.PP
Split off from the main \fBpaintTextLine\fP method to make it smaller. As it's being called only once per line it shouldn't noticably affect performance and it helps readability a LOT.
.PP
\fBReturns:\fP
.RS 4
whether the selection has been painted or not 
.RE
.PP

.PP
Definition at line 131 of file katerenderer.cpp.
.PP
References QColor::blue(), config(), QColor::green(), isPrinterFriendly(), QColor::isValid(), QColor::red(), QColor::setRgb(), and showSelections().
.PP
Referenced by paintTextLine().
.SS "\fBKateAttribute\fP * KateRenderer::attribute (uint pos)"
.PP
This takes an in index, and returns all the attributes for it. 
.PP
For example, if you have a ktextline, and want the \fBKateAttribute\fP for a given position, do:
.PP
attribute(myktextline->attribute(position)); 
.PP
Definition at line 67 of file katerenderer.cpp.
.PP
References QMemArray::at().
.PP
Referenced by spaceWidth(), and textPos().
.SS "KateRendererConfig* KateRenderer::config ()\fC [inline]\fP"
.PP
Configuration. 
.PP
Definition at line 242 of file katerenderer.h.
.PP
Referenced by increaseFontSizes(), paintTextLine(), paintTextLineBackground(), spaceWidth(), textPos(), and updateAttributes().

.SH "Author"
.PP 
Generated automatically by Doxygen for kate Library from the source code.
