File: guideuihighlighter.cpp

package info (click to toggle)
gambc 4.2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 54,404 kB
  • ctags: 10,660
  • sloc: ansic: 661,388; lisp: 143,554; sh: 3,531; makefile: 3,320; cpp: 2,143; perl: 1,730; sed: 498; java: 265
file content (41 lines) | stat: -rw-r--r-- 1,189 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* File: "guideuihighlighter.cpp", Time-stamp: <2005-04-12 14:25:52 feeley> */

/* Copyright (C) 1994-2005 by Marc Feeley, All Rights Reserved. */

/*---------------------------------------------------------------------------*/

#include "guideuihighlighter.h"
#include <qtextedit.h>

/*---------------------------------------------------------------------------*/

GuideUiHighlighter::GuideUiHighlighter (QTextEdit *textEdit)
  : QSyntaxHighlighter (textEdit)
{
  consoleInfo = 0;
}

// Set format of current paragraph with the specified color
void GuideUiHighlighter::setFormat (int start, int length, int colorNb)
{
  GuideUiElementFormat *ef = codeFormat->getElement(colorNb);
  QSyntaxHighlighter::setFormat(start, length, ef->getFont(textEdit()->font()), ef->getColor());
}

// Return the related code format
GuideUiCodeFormat* GuideUiHighlighter::getCodeFormat ()
{
  return codeFormat;
}

// Links the console infos at this highlighter
void GuideUiHighlighter::setConsoleInfo (GuideUiConsoleInfo *consoleInfo)
{
  this->consoleInfo = consoleInfo;
}

/*---------------------------------------------------------------------------*/

/* Local Variables: */
/* mode: C++ */
/* End: */