Source Code (Use browser search to find items of interest.)

Class Index

kdevelop'CHighlight (./kdevelop/kdevelop/kwrite/highlight.h:406)

class CHighlight : public GenHighlight {
  public:
    CHighlight(const QString &name);
    virtual ~CHighlight();
  protected:
    virtual void createItemData(ItemDataList &);
    virtual void makeContextList();
    virtual void setKeywords(HlKeyword *keyword, HlKeyword *dataType);
};


kdevelop'CHighlight::CHighlight() (./kdevelop/kdevelop/kwrite/highlight.cpp:1097)

CHighlight::CHighlight(const QString &name) : GenHighlight(name) {
  iWildcards = "*.c";
  iMimetypes = "text/x-c-src";
}


kdevelop'CHighlight::~CHighlight() (./kdevelop/kdevelop/kwrite/highlight.cpp:1102)

CHighlight::~CHighlight() {
}


kdevelop'CHighlight::createItemData() (./kdevelop/kdevelop/kwrite/highlight.cpp:1105)

void CHighlight::createItemData(ItemDataList &list) {

  list.append(new ItemData(i18nop("Normal Text" ),dsNormal));
  list.append(new ItemData(i18nop("Keyword"     ),dsKeyword));
  list.append(new ItemData(i18nop("Data Type"   ),dsDataType));
  list.append(new ItemData(i18nop("Decimal"     ),dsDecVal));
  list.append(new ItemData(i18nop("Octal"       ),dsBaseN));
  list.append(new ItemData(i18nop("Hex"         ),dsBaseN));
  list.append(new ItemData(i18nop("Float"       ),dsFloat));
  list.append(new ItemData(i18nop("Char"        ),dsChar));
  list.append(new ItemData(i18nop("String"      ),dsString));
  list.append(new ItemData(i18nop("String Char" ),dsChar));
  list.append(new ItemData(i18nop("Comment"     ),dsComment));
  list.append(new ItemData(i18nop("Preprocessor"),dsOthers));
  list.append(new ItemData(i18nop("Prep. Lib"   ),dsOthers,Qt::darkYellow,Qt::yellow,false,false));
}


kdevelop'CHighlight::makeContextList() (./kdevelop/kdevelop/kwrite/highlight.cpp:1122)

void CHighlight::makeContextList() {
  HlContext *c;
  HlKeyword *keyword, *dataType;

  //normal context
  contextList[0] = c = new HlContext(0,0);
    c->items.append(keyword = new HlKeyword(1,0));
    c->items.append(dataType = new HlKeyword(2,0));
    c->items.append(new HlCFloat(6,0));
    c->items.append(new HlCOct(4,0));
    c->items.append(new HlCHex(5,0));
    c->items.append(new HlCInt(3,0));
    c->items.append(new HlCChar(7,0));
    c->items.append(new HlCharDetect(8,1,'"'));
    c->items.append(new Hl2CharDetect(10,2, '/', '/'));
    c->items.append(new Hl2CharDetect(10,3, '/', '*'));
    c->items.append(new HlCPrep(11,4));
  //string context
  contextList[1] = c = new HlContext(8,0);
    c->items.append(new HlLineContinue(8,6));
    c->items.append(new HlCStringChar(9,1));
    c->items.append(new HlCharDetect(8,0,'"'));
  //one line comment context
  contextList[2] = new HlContext(10,0);
  //multi line comment context
  contextList[3] = c = new HlContext(10,3);
    c->items.append(new Hl2CharDetect(10,0, '*', '/'));
  //preprocessor context
  contextList[4] = c = new HlContext(11,0);
    c->items.append(new HlLineContinue(11,7));
    c->items.append(new HlRangeDetect(12,4, '\"', '\"'));
    c->items.append(new HlRangeDetect(12,4, '<', '>'));
    c->items.append(new Hl2CharDetect(10,2, '/', '/'));
    c->items.append(new Hl2CharDetect(10,5, '/', '*'));
  //preprocessor multiline comment context
  contextList[5] = c = new HlContext(10,5);
    c->items.append(new Hl2CharDetect(10,4, '*', '/'));
  //string line continue
  contextList[6] = new HlContext(0,1);
  //preprocessor string line continue
  contextList[7] = new HlContext(0,4);

  setKeywords(keyword, dataType);
}


kdevelop'CHighlight::setKeywords() (./kdevelop/kdevelop/kwrite/highlight.cpp:1167)

void CHighlight::setKeywords(HlKeyword *keyword, HlKeyword *dataType) {

  keyword->addList(cKeywords);
  dataType->addList(cTypes);
}