1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #include "stylescicmake.h" |
6 | #include "textedittabwidget/style/stylecolor.h" |
7 | #include "textedittabwidget/textedit.h" |
8 | #include "SciLexer.h" |
9 | |
10 | StyleSciCmake::StyleSciCmake(TextEdit *parent) |
11 | : StyleSci (parent) |
12 | { |
13 | |
14 | } |
15 | |
16 | QMap<int, QString> StyleSciCmake::keyWords() const |
17 | { |
18 | return StyleSci::keyWords(); |
19 | } |
20 | |
21 | void StyleSciCmake::setStyle() |
22 | { |
23 | StyleSci::setStyle(); |
24 | edit()->styleSetFore(SCE_CMAKE_COMMENT, StyleColor::color(StyleColor::Table::get()->SkyBlue)); |
25 | edit()->styleSetFore(SCE_CMAKE_STRINGDQ, StyleColor::color(StyleColor::Table::get()->Magenta)); |
26 | edit()->styleSetFore(SCE_CMAKE_STRINGLQ, StyleColor::color(StyleColor::Table::get()->Magenta)); |
27 | edit()->styleSetFore(SCE_CMAKE_STRINGRQ, StyleColor::color(StyleColor::Table::get()->Magenta)); |
28 | edit()->styleSetFore(SCE_CMAKE_COMMANDS, StyleColor::color(StyleColor::Table::get()->PaleGoldenRod)); |
29 | edit()->styleSetFore(SCE_CMAKE_PARAMETERS, StyleColor::color(StyleColor::Table::get()->Orange)); |
30 | edit()->styleSetFore(SCE_CMAKE_VARIABLE, StyleColor::color(StyleColor::Table::get()->Orange)); |
31 | edit()->styleSetFore(SCE_CMAKE_USERDEFINED, StyleColor::color(StyleColor::Table::get()->Magenta)); |
32 | edit()->styleSetFore(SCE_CMAKE_WHILEDEF, StyleColor::color(StyleColor::Table::get()->Gold)); |
33 | edit()->styleSetFore(SCE_CMAKE_FOREACHDEF, StyleColor::color(StyleColor::Table::get()->Gold)); |
34 | edit()->styleSetFore(SCE_CMAKE_IFDEFINEDEF, StyleColor::color(StyleColor::Table::get()->Gold)); |
35 | edit()->styleSetFore(SCE_CMAKE_MACRODEF, StyleColor::color(StyleColor::Table::get()->Gold)); |
36 | edit()->styleSetFore(SCE_CMAKE_STRINGVAR, StyleColor::color(StyleColor::Table::get()->Magenta)); |
37 | edit()->styleSetFore(SCE_CMAKE_NUMBER, StyleColor::color(StyleColor::Table::get()->Magenta)); |
38 | } |
39 | |
40 | void StyleSciCmake::setLexer() |
41 | { |
42 | StyleSci::setLexer(); |
43 | } |
44 | |
45 | int StyleSciCmake::sectionEnd() const |
46 | { |
47 | return SCE_CMAKE_NUMBER; |
48 | } |
49 | |