• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • part
katerenderer.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
3  Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
4  Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
5  Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef __KATE_RENDERER_H__
23 #define __KATE_RENDERER_H__
24 
25 #include "katecursor.h"
26 #include "kateattribute.h"
27 #include "katetextline.h"
28 
29 #include <tqfont.h>
30 #include <tqfontmetrics.h>
31 
32 class KateDocument;
33 class KateView;
34 class KateLineRange;
35 class KateRendererConfig;
36 
42 class KateRenderer
43 {
44 public:
48  enum caretStyles {
49  Insert,
50  Replace
51  };
52 
58  KateRenderer(KateDocument* doc, KateView *view = 0);
59 
63  ~KateRenderer();
64 
69  void updateAttributes ();
70 
75  inline bool drawCaret() const { return m_drawCaret; }
76 
81  void setDrawCaret(bool drawCaret);
82 
87  inline KateRenderer::caretStyles caretStyle() const { return m_caretStyle; }
88 
93  void setCaretStyle(KateRenderer::caretStyles style);
94 
100  inline bool showTabs() const { return m_showTabs; }
101 
106  void setShowTabs(bool showTabs);
107 
112  void setTabWidth(int tabWidth);
113 
118  bool showIndentLines() const;
119 
124  void setShowIndentLines(bool showLines);
125 
130  void setIndentWidth(int indentWidth);
131 
136  inline bool showSelections() const { return m_showSelections; }
137 
143  void setShowSelections(bool showSelections);
144 
148  void increaseFontSizes();
149  void decreaseFontSizes();
150  const TQFont* currentFont();
151  const TQFontMetrics* currentFontMetrics();
152 
157  bool isPrinterFriendly() const;
158 
164  void setPrinterFriendly(bool printerFriendly);
165 
170  // Width calculators
171  uint spaceWidth();
172  uint textWidth(const KateTextLine::Ptr &, int cursorCol);
173  uint textWidth(const KateTextLine::Ptr &textLine, uint startcol, uint maxwidth, bool *needWrap, int *endX = 0);
174  uint textWidth(const KateTextCursor &cursor);
175 
176  // Cursor constrainer
177  uint textWidth(KateTextCursor &cursor, int xPos, uint startCol = 0);
178 
179  // Column calculators
188  uint textPos(uint line, int xPos, uint startCol = 0, bool nearest=true);
192  uint textPos(const KateTextLine::Ptr &, int xPos, uint startCol = 0, bool nearest=true);
193 
194  // Font height
195  uint fontHeight();
196 
197  // Document height
198  uint documentHeight();
199 
200  // Selection boundaries
201  bool getSelectionBounds(uint line, uint lineLength, uint &start, uint &end);
202 
210  void paintTextLine(TQPainter& paint, const KateLineRange* range, int xStart, int xEnd, const KateTextCursor* cursor = 0L, const KateBracketRange* bracketmark = 0L);
211 
221  bool paintTextLineBackground(TQPainter& paint, int line, bool isCurrentLine, int xStart, int xEnd);
222 
230  KateAttribute* attribute(uint pos);
231 
232  private:
238  void paintWhitespaceMarker(TQPainter &paint, uint x, uint y);
239 
241  void paintIndentMarker(TQPainter &paint, uint x, uint y);
242 
243  KateDocument* m_doc;
244  KateView *m_view;
245 
246  // cache of config values
247  int m_tabWidth;
248  int m_indentWidth;
249  uint m_schema;
250 
251  // some internal flags
252  KateRenderer::caretStyles m_caretStyle;
253  bool m_drawCaret;
254  bool m_showSelections;
255  bool m_showTabs;
256  bool m_printerFriendly;
257 
258  TQMemArray<KateAttribute> *m_attributes;
259 
263  public:
264  inline KateRendererConfig *config () { return m_config; };
265 
266  void updateConfig ();
267 
268  private:
269  KateRendererConfig *m_config;
270 };
271 
272 #endif

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.