\section{Kate\-Renderer Class Reference}
\label{classKateRenderer}\index{KateRenderer@{KateRenderer}}
Handles all of the work of rendering the text (used for the views and printing).  


{\tt \#include $<$katerenderer.h$>$}

Collaboration diagram for Kate\-Renderer:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKateRenderer__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf caret\-Styles} \{ {\bf Insert}, 
{\bf Replace}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Kate\-Renderer} (Kate\-Document $\ast$doc, Kate\-View $\ast$view=0)
\item 
{\bf $\sim$Kate\-Renderer} ()
\item 
void {\bf update\-Attributes} ()
\item 
bool {\bf draw\-Caret} () const 
\item 
void {\bf set\-Draw\-Caret} (bool draw\-Caret)
\item 
{\bf Kate\-Renderer::caret\-Styles} {\bf caret\-Style} () const 
\item 
void {\bf set\-Caret\-Style} ({\bf Kate\-Renderer::caret\-Styles} style)
\item 
bool {\bf show\-Tabs} () const 
\item 
void {\bf set\-Show\-Tabs} (bool show\-Tabs)
\item 
void {\bf set\-Tab\-Width} (int tab\-Width)
\item 
bool {\bf show\-Selections} () const 
\item 
void {\bf set\-Show\-Selections} (bool show\-Selections)
\item 
void {\bf increase\-Font\-Sizes} ()
\item 
void {\bf decrease\-Font\-Sizes} ()\label{classKateRenderer_a13}

\item 
const {\bf QFont} $\ast$ {\bf current\-Font} ()\label{classKateRenderer_a14}

\item 
const {\bf QFont\-Metrics} $\ast$ {\bf current\-Font\-Metrics} ()\label{classKateRenderer_a15}

\item 
bool {\bf is\-Printer\-Friendly} () const 
\item 
void {\bf set\-Printer\-Friendly} (bool printer\-Friendly)
\item 
uint {\bf space\-Width} ()
\item 
uint {\bf text\-Width} (const {\bf Kate\-Text\-Line::Ptr} \&, int cursor\-Col)\label{classKateRenderer_a19}

\item 
uint {\bf text\-Width} (const {\bf Kate\-Text\-Line::Ptr} \&text\-Line, uint startcol, uint maxwidth, bool $\ast$need\-Wrap, int $\ast$end\-X=0)\label{classKateRenderer_a20}

\item 
uint {\bf text\-Width} (const {\bf Kate\-Text\-Cursor} \&cursor)\label{classKateRenderer_a21}

\item 
uint {\bf text\-Width} ({\bf Kate\-Text\-Cursor} \&cursor, int x\-Pos, uint start\-Col=0)\label{classKateRenderer_a22}

\item 
uint {\bf text\-Pos} (uint line, int x\-Pos, uint start\-Col=0, bool nearest=true)
\item 
uint {\bf text\-Pos} (const {\bf Kate\-Text\-Line::Ptr} \&, int x\-Pos, uint start\-Col=0, bool nearest=true)
\item 
uint {\bf font\-Height} ()\label{classKateRenderer_a25}

\item 
uint {\bf document\-Height} ()\label{classKateRenderer_a26}

\item 
bool {\bf get\-Selection\-Bounds} (uint line, uint line\-Length, uint \&start, uint \&end)\label{classKateRenderer_a27}

\item 
void {\bf paint\-Text\-Line} ({\bf QPainter} \&paint, const Kate\-Line\-Range $\ast$range, int x\-Start, int x\-End, const {\bf Kate\-Text\-Cursor} $\ast$cursor=0L, const Kate\-Text\-Range $\ast$bracketmark=0L)
\item 
bool {\bf paint\-Text\-Line\-Background} ({\bf QPainter} \&paint, int line, bool is\-Current\-Line, int x\-Start, int x\-End)
\item 
{\bf Kate\-Attribute} $\ast$ {\bf attribute} (uint pos)
\item 
Kate\-Renderer\-Config $\ast$ {\bf config} ()
\item 
void {\bf update\-Config} ()\label{classKateRenderer_a32}

\end{CompactItemize}


\subsection{Detailed Description}
Handles all of the work of rendering the text (used for the views and printing). 



Definition at line 42 of file katerenderer.h.

\subsection{Member Enumeration Documentation}
\index{KateRenderer@{Kate\-Renderer}!caretStyles@{caretStyles}}
\index{caretStyles@{caretStyles}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Kate\-Renderer::caret\-Styles}}\label{classKateRenderer_w2}


Style of Caret (Insert or Replace mode). 



Definition at line 48 of file katerenderer.h.

\subsection{Constructor \& Destructor Documentation}
\index{KateRenderer@{Kate\-Renderer}!KateRenderer@{KateRenderer}}
\index{KateRenderer@{KateRenderer}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Kate\-Renderer::Kate\-Renderer (Kate\-Document $\ast$ {\em doc}, Kate\-View $\ast$ {\em view} = {\tt 0})}\label{classKateRenderer_a0}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em doc}]document to render \item[{\em view}]view which is output (0 for example for rendering to print) \end{description}
\end{Desc}


Definition at line 40 of file katerenderer.cpp.

References update\-Attributes().\index{KateRenderer@{Kate\-Renderer}!~KateRenderer@{$\sim$KateRenderer}}
\index{~KateRenderer@{$\sim$KateRenderer}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Kate\-Renderer::$\sim${\bf Kate\-Renderer} ()}\label{classKateRenderer_a1}


Destructor. 



Definition at line 55 of file katerenderer.cpp.

\subsection{Member Function Documentation}
\index{KateRenderer@{Kate\-Renderer}!updateAttributes@{updateAttributes}}
\index{updateAttributes@{updateAttributes}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::update\-Attributes ()}\label{classKateRenderer_a2}


update the highlighting attributes (for example after an hl change or after hl config changed) 



Definition at line 61 of file katerenderer.cpp.

References config().

Referenced by Kate\-Renderer().\index{KateRenderer@{Kate\-Renderer}!drawCaret@{drawCaret}}
\index{drawCaret@{drawCaret}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Kate\-Renderer::draw\-Caret () const\hspace{0.3cm}{\tt  [inline]}}\label{classKateRenderer_a3}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em should}]it be drawn? \end{description}
\end{Desc}


Definition at line 75 of file katerenderer.h.

Referenced by paint\-Text\-Line().\index{KateRenderer@{Kate\-Renderer}!setDrawCaret@{setDrawCaret}}
\index{setDrawCaret@{setDrawCaret}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Draw\-Caret (bool {\em draw\-Caret})}\label{classKateRenderer_a4}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em draw\-Caret}]should caret be drawn? \end{description}
\end{Desc}


Definition at line 75 of file katerenderer.cpp.

Referenced by set\-Printer\-Friendly().\index{KateRenderer@{Kate\-Renderer}!caretStyle@{caretStyle}}
\index{caretStyle@{caretStyle}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Kate\-Renderer::caret\-Styles} Kate\-Renderer::caret\-Style () const\hspace{0.3cm}{\tt  [inline]}}\label{classKateRenderer_a5}


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

\begin{Desc}
\item[Returns:]caret\-Style \end{Desc}


Definition at line 87 of file katerenderer.h.

Referenced by paint\-Text\-Line().\index{KateRenderer@{Kate\-Renderer}!setCaretStyle@{setCaretStyle}}
\index{setCaretStyle@{setCaretStyle}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Caret\-Style ({\bf Kate\-Renderer::caret\-Styles} {\em style})}\label{classKateRenderer_a6}


Set the style of caret to be painted. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em style}]style to set \end{description}
\end{Desc}


Definition at line 80 of file katerenderer.cpp.\index{KateRenderer@{Kate\-Renderer}!showTabs@{showTabs}}
\index{showTabs@{showTabs}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Kate\-Renderer::show\-Tabs () const\hspace{0.3cm}{\tt  [inline]}}\label{classKateRenderer_a7}


\begin{Desc}
\item[Returns:]whether tabs should be shown (ie. a small mark drawn to identify a tab) 

tabs should be shown \end{Desc}


Definition at line 100 of file katerenderer.h.

Referenced by paint\-Text\-Line().\index{KateRenderer@{Kate\-Renderer}!setShowTabs@{setShowTabs}}
\index{setShowTabs@{setShowTabs}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Show\-Tabs (bool {\em show\-Tabs})}\label{classKateRenderer_a8}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em show\-Tabs}]show the tabs? \end{description}
\end{Desc}


Definition at line 85 of file katerenderer.cpp.

Referenced by set\-Printer\-Friendly().\index{KateRenderer@{Kate\-Renderer}!setTabWidth@{setTabWidth}}
\index{setTabWidth@{setTabWidth}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Tab\-Width (int {\em tab\-Width})}\label{classKateRenderer_a9}


Sets the width of the tab. 

Helps performance. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tab\-Width}]new tab width \end{description}
\end{Desc}


Definition at line 90 of file katerenderer.cpp.\index{KateRenderer@{Kate\-Renderer}!showSelections@{showSelections}}
\index{showSelections@{showSelections}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Kate\-Renderer::show\-Selections () const\hspace{0.3cm}{\tt  [inline]}}\label{classKateRenderer_a10}


Show the view's selection? 

\begin{Desc}
\item[Returns:]show sels? \end{Desc}


Definition at line 118 of file katerenderer.h.

Referenced by paint\-Text\-Line(), and paint\-Text\-Line\-Background().\index{KateRenderer@{Kate\-Renderer}!setShowSelections@{setShowSelections}}
\index{setShowSelections@{setShowSelections}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Show\-Selections (bool {\em show\-Selections})}\label{classKateRenderer_a11}


Set whether the view's selections should be shown. 

The default is true. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em show\-Selections}]show the selections? \end{description}
\end{Desc}


Definition at line 95 of file katerenderer.cpp.

Referenced by set\-Printer\-Friendly().\index{KateRenderer@{Kate\-Renderer}!increaseFontSizes@{increaseFontSizes}}
\index{increaseFontSizes@{increaseFontSizes}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::increase\-Font\-Sizes ()}\label{classKateRenderer_a12}


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



Definition at line 100 of file katerenderer.cpp.

References config(), QFont::point\-Size(), and QFont::set\-Point\-Size().\index{KateRenderer@{Kate\-Renderer}!isPrinterFriendly@{isPrinterFriendly}}
\index{isPrinterFriendly@{isPrinterFriendly}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Kate\-Renderer::is\-Printer\-Friendly () const}\label{classKateRenderer_a16}


\begin{Desc}
\item[Returns:]whether the renderer is configured to paint in a printer-friendly fashion. \end{Desc}


Definition at line 118 of file katerenderer.cpp.

Referenced by paint\-Text\-Line(), and paint\-Text\-Line\-Background().\index{KateRenderer@{Kate\-Renderer}!setPrinterFriendly@{setPrinterFriendly}}
\index{setPrinterFriendly@{setPrinterFriendly}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::set\-Printer\-Friendly (bool {\em printer\-Friendly})}\label{classKateRenderer_a17}


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

Sets the other options appropriately if true. 

Definition at line 123 of file katerenderer.cpp.

References set\-Draw\-Caret(), set\-Show\-Selections(), and set\-Show\-Tabs().\index{KateRenderer@{Kate\-Renderer}!spaceWidth@{spaceWidth}}
\index{spaceWidth@{spaceWidth}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint Kate\-Renderer::space\-Width ()}\label{classKateRenderer_a18}


Text width \& height calculation functions... 



Definition at line 902 of file katerenderer.cpp.

References attribute(), config(), and Kate\-Attribute::width().\index{KateRenderer@{Kate\-Renderer}!textPos@{textPos}}
\index{textPos@{textPos}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint Kate\-Renderer::text\-Pos (uint {\em line}, int {\em x\-Pos}, uint {\em start\-Col} = {\tt 0}, bool {\em nearest} = {\tt true})}\label{classKateRenderer_a23}


\begin{Desc}
\item[Returns:]the index of the character at the horixontal position {\tt xpos} in {\tt line}.\end{Desc}
If {\tt nearest} is true, the character starting nearest to {\tt x\-Pos} is returned. If {\tt nearest} is false, the index of the character containing {\tt x\-Pos} is returned. 

Definition at line 809 of file katerenderer.cpp.\index{KateRenderer@{Kate\-Renderer}!textPos@{textPos}}
\index{textPos@{textPos}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint Kate\-Renderer::text\-Pos (const {\bf Kate\-Text\-Line::Ptr} \&, int {\em x\-Pos}, uint {\em start\-Col} = {\tt 0}, bool {\em nearest} = {\tt true})}\label{classKateRenderer_a24}


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 

Definition at line 814 of file katerenderer.cpp.

References attribute(), config(), and Kate\-Attribute::width().\index{KateRenderer@{Kate\-Renderer}!paintTextLine@{paintTextLine}}
\index{paintTextLine@{paintTextLine}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Kate\-Renderer::paint\-Text\-Line ({\bf QPainter} \& {\em paint}, const Kate\-Line\-Range $\ast$ {\em range}, int {\em x\-Start}, int {\em x\-End}, const {\bf Kate\-Text\-Cursor} $\ast$ {\em cursor} = {\tt 0L}, const Kate\-Text\-Range $\ast$ {\em bracketmark} = {\tt 0L})}\label{classKateRenderer_a28}


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 206 of file katerenderer.cpp.

References Kate\-Attribute::bg\-Color(), caret\-Style(), Kate\-Text\-Cursor::col(), QColor\-Group::color(), config(), KShared\-Ptr$<$ T $>$::data(), draw\-Caret(), QString::fill(), Kate\-Attribute::font(), is\-Printer\-Friendly(), Kate\-Attribute::item\-Set(), QString::length(), paint\-Text\-Line\-Background(), Kate\-Attribute::selected\-Text\-Color(), Kate\-Text\-Cursor::set\-Col(), QColor::set\-Hsv(), Kate\-Attribute::set\-Text\-Color(), show\-Selections(), show\-Tabs(), Kate\-Attribute::text\-Color(), and Kate\-Attribute::width().\index{KateRenderer@{Kate\-Renderer}!paintTextLineBackground@{paintTextLineBackground}}
\index{paintTextLineBackground@{paintTextLineBackground}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Kate\-Renderer::paint\-Text\-Line\-Background ({\bf QPainter} \& {\em paint}, int {\em line}, bool {\em is\-Current\-Line}, int {\em x\-Start}, int {\em x\-End})}\label{classKateRenderer_a29}


Paint the background of a line. 

Split off from the main {\bf paint\-Text\-Line}{\rm (p.\,\pageref{classKateRenderer_a28})} 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.

\begin{Desc}
\item[Returns:]whether the selection has been painted or not \end{Desc}


Definition at line 131 of file katerenderer.cpp.

References QColor::blue(), config(), QColor::green(), is\-Printer\-Friendly(), QColor::is\-Valid(), QColor::red(), QColor::set\-Rgb(), and show\-Selections().

Referenced by paint\-Text\-Line().\index{KateRenderer@{Kate\-Renderer}!attribute@{attribute}}
\index{attribute@{attribute}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Kate\-Attribute} $\ast$ Kate\-Renderer::attribute (uint {\em pos})}\label{classKateRenderer_a30}


This takes an in index, and returns all the attributes for it. 

For example, if you have a ktextline, and want the {\bf Kate\-Attribute}{\rm (p.\,\pageref{classKateAttribute})} for a given position, do:

attribute(myktextline-$>$attribute(position)); 

Definition at line 67 of file katerenderer.cpp.

References QMem\-Array::at().

Referenced by space\-Width(), and text\-Pos().\index{KateRenderer@{Kate\-Renderer}!config@{config}}
\index{config@{config}!KateRenderer@{Kate\-Renderer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Kate\-Renderer\-Config$\ast$ Kate\-Renderer::config ()\hspace{0.3cm}{\tt  [inline]}}\label{classKateRenderer_a31}


Configuration. 



Definition at line 242 of file katerenderer.h.

Referenced by increase\-Font\-Sizes(), paint\-Text\-Line(), paint\-Text\-Line\-Background(), space\-Width(), text\-Pos(), and update\-Attributes().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
katerenderer.h\item 
katerenderer.cpp\end{CompactItemize}
