25 lines
712 B
C++
25 lines
712 B
C++
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace Scintilla { class ILexer5; }
|
|
|
|
namespace ks::files
|
|
{
|
|
enum class TextColor { background, text, chromebg, chrome, selection, comment, keyword, string, number, symbol,
|
|
menuText, menuHighlight, menuHighlightText, menuAccessKey, count };
|
|
|
|
struct TextLanguage
|
|
{
|
|
std::string lexer;
|
|
const char *keywords = "";
|
|
};
|
|
|
|
TextLanguage detectLanguage(const std::filesystem::path &path, std::string_view firstPage);
|
|
std::wstring textLanguageLabel(const TextLanguage &language);
|
|
Scintilla::ILexer5 *createTextLexer(const TextLanguage &language);
|
|
TextColor syntaxColor(Scintilla::ILexer5 &lexer, std::string_view name, int style);
|
|
}
|