Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2022-11-07 17:22:05 +0300
committerelfmz <fenix1905@tut.by>2022-11-07 17:40:09 +0300
commite1c7f10e98950f3f35473b34f3970e63346053e0 (patch)
tree3cfba39e1e537aee8180a9c951b5beb4f2ddfc42
parentfa30944de1bd03ca9e2bfdf6ad82085a5b730f59 (diff)
use truecolor in colorer by adopting truemod functionality and extending editor API
-rw-r--r--HACKING.md70
-rw-r--r--README.md74
-rw-r--r--WinPort/WinCompat.h1
-rw-r--r--WinPort/src/Backend/TTY/TTYOutput.cpp6
-rw-r--r--WinPort/src/Backend/WX/Paint.cpp28
-rw-r--r--WinPort/src/Backend/WX/Paint.h3
-rw-r--r--colorer/configs/base/hrd/catalog-rgb.xml8
-rw-r--r--colorer/src/pcolorer2/FarEditor.cpp46
-rw-r--r--colorer/src/pcolorer2/FarEditorSet.cpp11
-rw-r--r--far2l/far2sdk/farplug-mb.h17
-rw-r--r--far2l/far2sdk/farplug-wide.h23
-rw-r--r--far2l/src/console/AnsiEsc.cpp12
-rw-r--r--far2l/src/console/AnsiEsc.hpp1
-rw-r--r--far2l/src/console/scrbuf.cpp8
-rw-r--r--far2l/src/console/scrbuf.hpp8
-rw-r--r--far2l/src/edit.cpp92
-rw-r--r--far2l/src/edit.hpp15
-rw-r--r--far2l/src/editor.cpp18
-rw-r--r--far2l/src/plug/wrap.cpp2
19 files changed, 282 insertions, 161 deletions
diff --git a/HACKING.md b/HACKING.md
new file mode 100644
index 00000000..b69d2031
--- /dev/null
+++ b/HACKING.md
@@ -0,0 +1,70 @@
+I implemented/borrowed from WINE some commonly used WinAPI functions. They are all declared in WinPort/WinPort.h and corresponding defines can be found in WinPort/WinCompat.h (both are included by WinPort/windows.h). Note that this stuff may not be 1-to-1 to corresponding Win32 functionality also doesn't provide full-UNIX functionality, but it simplifies porting and can be considered as temporary scaffold.
+
+However, only the main executable is linked statically to WinPort, although it also _exports_ WinPort functionality, so plugins use it without the neccessity to bring their own copies of this code. This is the reason that each plugin's binary should not statically link to WinPort.
+
+While FAR internally is UTF16 (because WinPort contains UTF16-related stuff), native Linux wchar_t size is 4 bytes (rather than 2 bytes) so potentially Linux FAR may be fully UTF32-capable console interaction in the future, but while it uses Win32-style UTF16 functions it does not. However, programmers need to be aware that wchar_t is not 2 bytes long anymore.
+
+Inspect all printf format strings: unlike Windows, in Linux both wide and multibyte printf-like functions have the same multibyte and wide specifiers. This means that %s is always multibyte while %ls is always wide. So, any %s used in wide-printf-s or %ws used in any printf should be replaced with %ls.
+
+Update from 27aug: now it's possible by defining WINPORT_DIRECT to avoid renaming used Windows API and also to avoid changing format strings as swprintf will be intercepted by a compatibility wrapper.
+Update from 03/11/22: far2l's console emulator capable to correctly render full-width and combining characters as well as 24 bit colors. This caused following deviation of console-simulation functions behavior comparing to original Win32 API counterparts:
+ * CHAR_INFO's Char::UnicodeChar field extended to 64 bit length to be able to associate sequence of multiple WCHARs with single cell.
+ * Writing to console full-width character causes two cells to be used: first will get given character code in UnicodeChar field but next one will have UnicodeChar set to zero.
+ * Writing combined characters - normal character followed by set of diactrical marks - will make UnicodeChar field to contain so-called 'composite' character code that represents sequence of character codes registered with WINPORT(CompositeCharRegister). Actual sequence of WCHARs can be obtained by WINPORT(CompositeCharLookup). There is macro CI_USING_COMPOSITE_CHAR that allows to detect if given CHAR_INFO contains composite character code or normal WCHAR.
+ * Both above transformations happen automatically _only_ if using WriteConsole API. If one uses WriteConsoleOutput - then its up to caller to perform that transformations. Failing to do so will cause incorrect rendering of full-width or diactrical characters.
+ * CHAR_INFO's and CONSOLE_SCREEN_BUFFER_INFO's Attributes fields extended to 64 bit to be able to hold 24 bit RGB colors in higher bytes. Use macroses GET_RGB_FORE/GET_RGB_BACK/SET_RGB_FORE/SET_RGB_BACK/SET_RGB_BOTH to access that colors. Note that such colors will be used only if FOREGROUND_TRUECOLOR/BACKGROUND_TRUECOLOR attribute is set. Old attributes define colors from usual 16-elements palette used to render if ..._TRUECOLOR is not set or if backend's target doesn't support more than 16 colors.
+
+## Plugin API
+
+Plugins API based on FAR Manager v2 plus following changes:
+
+### Added following entries to FarStandardFunctions:
+
+* `int Execute(const wchar_t *CmdStr, unsigned int ExecFlags);`
+...where ExecFlags - combination of values of EXECUTEFLAGS.
+Executes given command line, if EF_HIDEOUT and EF_NOWAIT are not specified then command will be executed on far2l virtual terminal.
+
+* `int ExecuteLibrary(const wchar_t *Library, const wchar_t *Symbol, const wchar_t *CmdStr, unsigned int ExecFlags)`
+Executes given shared library symbol in separate process (process creation behaviour is the same as for Execute).
+symbol function must be defined as: `int 'Symbol'(int argc, char *argv[])`
+
+* `void DisplayNotification(const wchar_t *action, const wchar_t *object);`
+Shows (depending on settings - always or if far2l in background) system shell-wide notification with given title and text.
+
+* `int DispatchInterThreadCalls();`
+far2l supports calling APIs from different threads by marshalling API calls from non-main threads into main one and dispatching them on main thread at certain known-safe points inside of dialog processing loops. DispatchInterThreadCalls() allows plugin to explicitly dispatch such calls and plugin must use it periodically in case it blocks main thread with some non-UI activity that may wait for other threads.
+
+* `void BackgroundTask(const wchar_t *Info, BOOL Started);`
+If plugin implements tasks running in background it may invoke this function to indicate about pending task in left-top corner.
+ * Info is a short description of task or just its owner and must be same string when invoked with Started TRUE or FALSE.
+
+* `size_t StrCellsCount(const wchar_t *Str, size_t CharsCount);`
+Returns count of console cells which will be used to display given string of CharsCount characters.
+
+* `size_t StrSizeOfCells(const wchar_t *Str, size_t CharsCount, size_t *CellsCount, BOOL RoundUp);`
+Returns count of characters which will be used to fill up to CellsCount cells from given string of CharsCount characters.
+RoundUp argument tells what to do with full-width characters that crossed by CellsCount.
+On return CellsCount contains cells count that will be filled by returned characters count, that:
+ * Can be smaller than initial value if string has too few characters to fill all CellsCount cells or if RoundUp was set to FALSE and last character would then overflow wanted amount.
+ * Can be larger by one than initial value if RoundUp was set to TRUE and last full-width character crossed initial value specified in *CellsCount.
+
+* `TruncStr and TruncPathStr`
+This two functions not added but changed to use console cells count as string limiting factor.
+
+
+### Added following commands into FILE_CONTROL_COMMANDS:
+* `FCTL_GETPANELPLUGINHANDLE`
+Can be used to interract with plugin that renders other panel.
+`hPlugin` can be set to `PANEL_ACTIVE` or `PANEL_PASSIVE`.
+`Param1` ignored.
+`Param2` points to value of type `HANDLE`, call sets that value to handle of plugin that renders specified panel or `INVALID_HANDLE_VALUE`.
+
+### Added following plugin-exported functions:
+* `int MayExitFARW();`
+far2l asks plugin if it can exit now. If plugin has some background tasks pending it may block exiting of far2l, however it highly recommended to give user choice using UI prompt.
+
+### Added following dialog messages:
+* `DM_GETCOLOR` - retrieves current color attributes of selected dialog item
+* `DM_SETCOLOR` - changes current color attributes of selected dialog item
+* `ECTL_ADDTRUECOLOR` - applies coloring to editor like ECTL_ADDCOLOR does but allows to specify 24 RGB color using EditorTrueColor structure.
+* `ECTL_GETTRUECOLOR` - retrieves coloring of editor like ECTL_GETCOLOR does but gets 24 RGB color using EditorTrueColor structure.
diff --git a/README.md b/README.md
index 055a1f13..eb7ab662 100644
--- a/README.md
+++ b/README.md
@@ -198,78 +198,8 @@ You can import the project into your favourite IDE like QtCreator, CodeLite, or
* Similar fork of Kitty: https://github.com/mihmig/KiTTY
* Tool to import color schemes from windows FAR manager 2 .reg format: https://github.com/unxed/far2l-deb/blob/master/far2l_import.pl
-## Notes on porting
-
-I implemented/borrowed from WINE some commonly used WinAPI functions. They are all declared in WinPort/WinPort.h and corresponding defines can be found in WinPort/WinCompat.h (both are included by WinPort/windows.h). Note that this stuff may not be 1-to-1 to corresponding Win32 functionality also doesn't provide full-UNIX functionality, but it simplifies porting and can be considered as temporary scaffold.
-
-However, only the main executable is linked statically to WinPort, although it also _exports_ WinPort functionality, so plugins use it without the neccessity to bring their own copies of this code. This is the reason that each plugin's binary should not statically link to WinPort.
-
-While FAR internally is UTF16 (because WinPort contains UTF16-related stuff), native Linux wchar_t size is 4 bytes (rather than 2 bytes) so potentially Linux FAR may be fully UTF32-capable console interaction in the future, but while it uses Win32-style UTF16 functions it does not. However, programmers need to be aware that wchar_t is not 2 bytes long anymore.
-
-Inspect all printf format strings: unlike Windows, in Linux both wide and multibyte printf-like functions have the same multibyte and wide specifiers. This means that %s is always multibyte while %ls is always wide. So, any %s used in wide-printf-s or %ws used in any printf should be replaced with %ls.
-
-Update from 27aug: now it's possible by defining WINPORT_DIRECT to avoid renaming used Windows API and also to avoid changing format strings as swprintf will be intercepted by a compatibility wrapper.
-
-Update from 03/11/22: far2l's console emulator capable to correctly render full-width and combining characters as well as 24 bit colors. This caused following deviation of console-simulation functions behavior comparing to original Win32 API counterparts:
- * CHAR_INFO's Char::UnicodeChar field extended to 64 bit length to be able to associate sequence of multiple WCHARs with single cell.
- * Writing to console full-width character causes two cells to be used: first will get given character code in UnicodeChar field but next one will have UnicodeChar set to zero.
- * Writing combined characters - normal character followed by set of diactrical marks - will make UnicodeChar field to contain so-called 'composite' character code that represents sequence of character codes registered with WINPORT(CompositeCharRegister). Actual sequence of WCHARs can be obtained by WINPORT(CompositeCharLookup). There is macro CI_USING_COMPOSITE_CHAR that allows to detect if given CHAR_INFO contains composite character code or normal WCHAR.
- * Both above transformations happen automatically _only_ if using WriteConsole API. If one uses WriteConsoleOutput - then its up to caller to perform that transformations. Failing to do so will cause incorrect rendering of full-width or diactrical characters.
- * CHAR_INFO's and CONSOLE_SCREEN_BUFFER_INFO's Attributes fields extended to 64 bit to be able to hold 24 bit RGB colors in higher bytes. Use macroses GET_RGB_FORE/GET_RGB_BACK/SET_RGB_FORE/SET_RGB_BACK/SET_RGB_BOTH to access that colors. Note that such colors will be used only if FOREGROUND_TRUECOLOR/BACKGROUND_TRUECOLOR attribute is set. Old attributes define colors from usual 16-elements palette used to render if ..._TRUECOLOR is not set or if backend's target doesn't support more than 16 colors.
-
-## Plugin API
-
-Plugins API based on FAR Manager v2 plus following changes:
-
-### Added following entries to FarStandardFunctions:
-
-* `int Execute(const wchar_t *CmdStr, unsigned int ExecFlags);`
-...where ExecFlags - combination of values of EXECUTEFLAGS.
-Executes given command line, if EF_HIDEOUT and EF_NOWAIT are not specified then command will be executed on far2l virtual terminal.
-
-* `int ExecuteLibrary(const wchar_t *Library, const wchar_t *Symbol, const wchar_t *CmdStr, unsigned int ExecFlags)`
-Executes given shared library symbol in separate process (process creation behaviour is the same as for Execute).
-symbol function must be defined as: `int 'Symbol'(int argc, char *argv[])`
-
-* `void DisplayNotification(const wchar_t *action, const wchar_t *object);`
-Shows (depending on settings - always or if far2l in background) system shell-wide notification with given title and text.
-
-* `int DispatchInterThreadCalls();`
-far2l supports calling APIs from different threads by marshalling API calls from non-main threads into main one and dispatching them on main thread at certain known-safe points inside of dialog processing loops. DispatchInterThreadCalls() allows plugin to explicitly dispatch such calls and plugin must use it periodically in case it blocks main thread with some non-UI activity that may wait for other threads.
-
-* `void BackgroundTask(const wchar_t *Info, BOOL Started);`
-If plugin implements tasks running in background it may invoke this function to indicate about pending task in left-top corner.
-Info is a short description of task or just its owner and must be same string when invoked with Started TRUE or FALSE.
-
-* `size_t StrCellsCount(const wchar_t *Str, size_t CharsCount);`
-Returns count of console cells which will be used to display given string of CharsCount characters.
-
-* `size_t StrSizeOfCells(const wchar_t *Str, size_t CharsCount, size_t *CellsCount, BOOL RoundUp);`
-Returns count of characters which will be used to fill up to CellsCount cells from given string of CharsCount characters.
-RoundUp argument tells what to do with full-width characters that crossed by CellsCount.
-On return CellsCount contains cells count that will be filled by returned characters count, that:
- Can be smaller than initial value if string has too few characters to fill all CellsCount cells or if RoundUp was set to FALSE and last character would then overflow wanted amount.
- Can be larger by one than initial value if RoundUp was set to TRUE and last full-width character crossed initial value specified in *CellsCount.
-
-* `TruncStr and TruncPathStr`
- This two functions not added but changed to use console cells count as string limiting factor.
-
-
-### Added following commands into FILE_CONTROL_COMMANDS:
-* `FCTL_GETPANELPLUGINHANDLE`
-Can be used to interract with plugin that renders other panel.
-`hPlugin` can be set to `PANEL_ACTIVE` or `PANEL_PASSIVE`.
-`Param1` ignored.
-`Param2` points to value of type `HANDLE`, call sets that value to handle of plugin that renders specified panel or `INVALID_HANDLE_VALUE`.
-
-### Added following plugin-exported functions:
-* `int MayExitFARW();`
-far2l asks plugin if it can exit now. If plugin has some background tasks pending it may block exiting of far2l, however it highly recommended to give user choice using UI prompt.
-
-### Added following dialog messages:
-* `DM_GETCOLOR` - retrieves get current color attributes of selected dialog item
-* `DM_SETCOLOR` - changes current color attributes of selected dialog item
+## Notes on porting and FAR Plugin API changes
+ * See HACKING.md
## Known issues:
* Only valid translations are English, Russian and Ukrainian, all other languages require deep correction.
-* Characters that occupy more than single cell or diacritic-like characters are rendered buggy, that means Chinese and Japanese texts are hardly readable in some cases.
diff --git a/WinPort/WinCompat.h b/WinPort/WinCompat.h
index 17286f60..f30fd733 100644
--- a/WinPort/WinCompat.h
+++ b/WinPort/WinCompat.h
@@ -611,6 +611,7 @@ typedef struct _INPUT_RECORD {
#define BACKGROUND_TRUECOLOR 0x0200 // Use 24 bit RGB colors set by SET_RGB_BACK
#define COMMON_LVB_REVERSE_VIDEO 0x4000 // Reverse fore/back ground attribute.
#define COMMON_LVB_UNDERSCORE 0x8000 // Underscore.
+#define COMMON_LVB_STRIKEOUT 0x2000 // Striekout.
// Constants below not implemented and their bit values are reserved and must be zero-inited
// #define COMMON_LVB_GRID_HORIZONTAL
diff --git a/WinPort/src/Backend/TTY/TTYOutput.cpp b/WinPort/src/Backend/TTY/TTYOutput.cpp
index 8f8ca44b..22924574 100644
--- a/WinPort/src/Backend/TTY/TTYOutput.cpp
+++ b/WinPort/src/Backend/TTY/TTYOutput.cpp
@@ -22,7 +22,7 @@
#define ATTRIBUTES_AFFECTING_BACKGROUND \
(BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY \
- | BACKGROUND_TRUECOLOR | COMMON_LVB_REVERSE_VIDEO | COMMON_LVB_UNDERSCORE)
+ | BACKGROUND_TRUECOLOR | COMMON_LVB_REVERSE_VIDEO | COMMON_LVB_UNDERSCORE | COMMON_LVB_STRIKEOUT)
void TTYOutput::TrueColors::AppendSuffix(std::string &out, DWORD rgb)
{
@@ -99,6 +99,10 @@ void TTYOutput::WriteUpdatedAttributes(DWORD64 attr, bool is_space)
_true_colors.AppendSuffix(_tmp_attrs, GET_RGB_BACK(attr));
}
+ if ( (xa & COMMON_LVB_STRIKEOUT) != 0) {
+ _tmp_attrs+= (attr & COMMON_LVB_STRIKEOUT) ? "9;" : "29;";
+ }
+
if ( (xa & COMMON_LVB_UNDERSCORE) != 0) {
_tmp_attrs+= (attr & COMMON_LVB_UNDERSCORE) ? "4;" : "24;";
}
diff --git a/WinPort/src/Backend/WX/Paint.cpp b/WinPort/src/Backend/WX/Paint.cpp
index d6f47725..1eabb702 100644
--- a/WinPort/src/Backend/WX/Paint.cpp
+++ b/WinPort/src/Backend/WX/Paint.cpp
@@ -506,7 +506,8 @@ void CursorProps::Update()
ConsolePainter::ConsolePainter(ConsolePaintContext *context, wxPaintDC &dc, wxString &buffer, CursorProps &cursor_props) :
_context(context), _dc(dc), _buffer(buffer), _cursor_props(cursor_props),
- _start_cx((unsigned int)-1), _start_back_cx((unsigned int)-1), _prev_fit_font_index(0), _prev_underlined(false)
+ _start_cx((unsigned int)-1), _start_back_cx((unsigned int)-1), _prev_fit_font_index(0),
+ _prev_underlined(false), _prev_strikeout(false)
{
_dc.SetPen(context->GetTransparentPen());
_dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT);
@@ -575,20 +576,31 @@ void ConsolePainter::FlushText(unsigned int cx_end)
_dc.DrawText(_buffer, _start_cx * _context->FontWidth(), _start_y);
_buffer.Empty();
}
- FlushUnderline(cx_end);
+ FlushDecorations(cx_end);
_start_cx = (unsigned int)-1;
_prev_fit_font_index = 0;
}
-void ConsolePainter::FlushUnderline(unsigned int cx_end)
+void ConsolePainter::FlushDecorations(unsigned int cx_end)
{
+ if (!_prev_underlined && !_prev_strikeout) {
+ return;
+ }
+ _dc.SetPen(wxColour(_clr_text.r, _clr_text.g, _clr_text.b));
+
if (_prev_underlined) {
- _dc.SetPen(wxColour(_clr_text.r, _clr_text.g, _clr_text.b));
_dc.DrawLine(_start_cx * _context->FontWidth(), _start_y + _context->FontHeight() - 1,
cx_end * _context->FontWidth(), _start_y + _context->FontHeight() - 1);
- _dc.SetPen(_context->GetTransparentPen());
_prev_underlined = false;
}
+
+ if (_prev_strikeout) {
+ _dc.DrawLine(_start_cx * _context->FontWidth(), _start_y + (_context->FontHeight() / 2),
+ cx_end * _context->FontWidth(), _start_y + (_context->FontHeight() / 2));
+ _prev_strikeout = false;
+ }
+
+ _dc.SetPen(_context->GetTransparentPen());
}
static inline unsigned char CalcFadeColor(unsigned char bg, unsigned char fg)
@@ -710,7 +722,7 @@ void ConsolePainter::NextChar(unsigned int cx, DWORD64 attributes, const wchar_t
FlushBackground(cx + nx);
WXCustomDrawCharPainter cdp(*this, clr_text, clr_back);
custom_draw(cdp, _start_y, cx);
- FlushUnderline(cx);
+ FlushDecorations(cx);
_start_cx = (unsigned int)-1;
_prev_fit_font_index = 0;
return;
@@ -718,8 +730,9 @@ void ConsolePainter::NextChar(unsigned int cx, DWORD64 attributes, const wchar_t
uint8_t fit_font_index = _context->CharFitTest(_dc, wcz);
const bool underlined = (attributes & COMMON_LVB_UNDERSCORE) != 0;
+ const bool strikeout = (attributes & COMMON_LVB_STRIKEOUT) != 0;
- if (fit_font_index == _prev_fit_font_index && _prev_underlined == underlined
+ if (fit_font_index == _prev_fit_font_index && _prev_underlined == underlined && _prev_strikeout == strikeout
&& _start_cx != (unsigned int)-1 && _clr_text == clr_text && _context->IsPaintBuffered()) {
_buffer+= wcz;
return;
@@ -730,6 +743,7 @@ void ConsolePainter::NextChar(unsigned int cx, DWORD64 attributes, const wchar_t
_prev_fit_font_index = fit_font_index;
_prev_underlined = underlined;
+ _prev_strikeout = strikeout;
_start_cx = cx;
_buffer = wcz;
diff --git a/WinPort/src/Backend/WX/Paint.h b/WinPort/src/Backend/WX/Paint.h
index b61199be..5127e2ab 100644
--- a/WinPort/src/Backend/WX/Paint.h
+++ b/WinPort/src/Backend/WX/Paint.h
@@ -99,6 +99,7 @@ class ConsolePainter
unsigned int _start_y;
uint8_t _prev_fit_font_index;
bool _prev_underlined;
+ bool _prev_strikeout;
std::map<WinPortRGB, wxPen *> _custom_draw_pens;
friend struct WXCustomDrawCharPainter;
@@ -107,7 +108,7 @@ class ConsolePainter
void PrepareBackground(unsigned int cx, const WinPortRGB &clr, unsigned int nx);
void FlushBackground(unsigned int cx_end);
void FlushText(unsigned int cx_end);
- void FlushUnderline(unsigned int cx_end);
+ void FlushDecorations(unsigned int cx_end);
public:
ConsolePainter(ConsolePaintContext *context, wxPaintDC &dc, wxString &_buffer, CursorProps &cursor_props);
diff --git a/colorer/configs/base/hrd/catalog-rgb.xml b/colorer/configs/base/hrd/catalog-rgb.xml
index 88978146..ef4b3b40 100644
--- a/colorer/configs/base/hrd/catalog-rgb.xml
+++ b/colorer/configs/base/hrd/catalog-rgb.xml
@@ -1,9 +1,9 @@
- <hrd class="rgb" name="default" description="White (crimsoned)">
- <location link="&hrd;/rgb/white.hrd"/>
- </hrd>
- <hrd class="rgb" name="blue" description="Blue (far-truemod)">
+ <hrd class="rgb" name="default" description="Blue (far-truemod)">
<location link="&hrd;/rgb/blue.hrd"/>
</hrd>
+ <hrd class="rgb" name="white" description="White (crimsoned)">
+ <location link="&hrd;/rgb/white.hrd"/>
+ </hrd>
<hrd class="rgb" name="navy" description="Navy (seashore)">
<location link="&hrd;/rgb/navy.hrd"/>
</hrd>
diff --git a/colorer/src/pcolorer2/FarEditor.cpp b/colorer/src/pcolorer2/FarEditor.cpp
index a4a7542a..7ba43c05 100644
--- a/colorer/src/pcolorer2/FarEditor.cpp
+++ b/colorer/src/pcolorer2/FarEditor.cpp
@@ -1249,12 +1249,58 @@ bool FarEditor::backDefault(color col)
void FarEditor::addFARColor(int lno, int s, int e, color col)
{
if (TrueMod){
+/*
AnnotationInfo ai;
ai.fg_color = ((col.fg>>16)&0xFF) + (col.fg&0x00FF00) + ((col.fg&0xFF)<<16);
ai.bk_color = ((col.bk>>16)&0xFF) + (col.bk&0x00FF00) + ((col.bk&0xFF)<<16);
ai.bk_valid = ai.fg_valid = 1;
ai.style = col.style;
addAnnotation(lno, s, e, ai);
+*/
+ EditorTrueColor ec{};
+ ec.Base.StringNumber = lno;
+ ec.Base.StartPos = s;
+ ec.Base.EndPos = e-1;
+ if (col.fg || col.bk) {
+ if (col.style & AI_STYLE_UNDERLINE) {
+ ec.Base.Color|= COMMON_LVB_UNDERSCORE;
+ }
+ if (col.style & AI_STYLE_STRIKEOUT) {
+ ec.Base.Color|= COMMON_LVB_STRIKEOUT;
+ }
+ ec.TrueFore.R = ((col.fg >> 16) & 0xFF);
+ ec.TrueFore.G = ((col.fg >> 8) & 0xFF);
+ ec.TrueFore.B = ((col.fg) & 0xFF);
+ ec.TrueFore.Flags = 1;
+ ec.TrueBack.R = ((col.bk >> 16) & 0xFF);
+ ec.TrueBack.G = ((col.bk >> 8) & 0xFF);
+ ec.TrueBack.B = ((col.bk) & 0xFF);
+ ec.TrueBack.Flags = 1;
+
+ if (ec.TrueFore.R > 0x10) ec.Base.Color|= FOREGROUND_RED;
+ if (ec.TrueFore.G > 0x10) ec.Base.Color|= FOREGROUND_GREEN;
+ if (ec.TrueFore.B > 0x10) ec.Base.Color|= FOREGROUND_BLUE;
+
+ if (ec.TrueBack.R > 0x10) ec.Base.Color|= BACKGROUND_RED;
+ if (ec.TrueBack.G > 0x10) ec.Base.Color|= BACKGROUND_GREEN;
+ if (ec.TrueBack.B > 0x10) ec.Base.Color|= BACKGROUND_BLUE;
+
+ if (ec.TrueFore.R > 0x80 || ec.TrueFore.G > 0x80 || ec.TrueFore.B > 0x80) {
+ ec.Base.Color = FOREGROUND_INTENSITY;
+ }
+
+ if (ec.Base.Color == 0 || ec.TrueBack.R > 0x80 || ec.TrueBack.G > 0x80 || ec.TrueBack.B > 0x80) {
+ ec.Base.Color = BACKGROUND_INTENSITY;
+ }
+ }
+
+#if 0
+ CLR_TRACE("FarEditor", "line:%d, %d-%d, color:%x", lno, s, e, col);
+#endif // if 0
+ info->EditorControl(ECTL_ADDTRUECOLOR, &ec);
+#if 0
+ CLR_TRACE("FarEditor", "line %d: %d-%d: color=%x", lno, s, e, col);
+#endif // if 0
}else{
EditorColor ec;
ec.StringNumber = lno;
diff --git a/colorer/src/pcolorer2/FarEditorSet.cpp b/colorer/src/pcolorer2/FarEditorSet.cpp
index 4a23725c..9afd4ea7 100644
--- a/colorer/src/pcolorer2/FarEditorSet.cpp
+++ b/colorer/src/pcolorer2/FarEditorSet.cpp
@@ -1350,19 +1350,14 @@ bool FarEditorSet::checkConEmu()
return conemu;*/
}
-bool FarEditorSet::checkFarTrueMod() //TODO
+bool FarEditorSet::checkFarTrueMod()
{
- return false;
- /*EditorAnnotation ea;
- ea.StringNumber = 1;
- ea.StartPos = 1;
- ea.EndPos = 2;
- return !!Info.EditorControl(ECTL_ADDANNOTATION, &ea);*/
+ return WINPORT(GetConsoleColorPalette)() >= 24;
}
bool FarEditorSet::checkConsoleAnnotationAvailable()
{
- return checkConEmu()&&checkFarTrueMod();
+ return checkFarTrueMod();
}
bool FarEditorSet::SetBgEditor()
diff --git a/far2l/far2sdk/farplug-mb.h b/far2l/far2sdk/farplug-mb.h
index 5adb2399..94dcf10c 100644
--- a/far2l/far2sdk/farplug-mb.h
+++ b/far2l/far2sdk/farplug-mb.h
@@ -1232,6 +1232,8 @@ namespace oldfar
ECTL_DELETESTACKBOOKMARK,
ECTL_GETSTACKBOOKMARKS,
ECTL_SERVICEREGION,
+ ECTL_ADDTRUECOLOR,
+ ECTL_GETTRUECOLOR,
};
enum EDITOR_SETPARAMETER_TYPES
@@ -1406,6 +1408,21 @@ namespace oldfar
int Color;
};
+ struct FarTrueColor
+ {
+ unsigned char R;
+ unsigned char G;
+ unsigned char B;
+ unsigned char Flags; // bit one - 'active' flag, others - ignored and must be set to zero
+ };
+
+ struct EditorTrueColor
+ {
+ struct EditorColor Base;
+ struct FarTrueColor TrueFore;
+ struct FarTrueColor TrueBack;
+ };
+
struct EditorSaveFile
{
char FileName[NM];
diff --git a/far2l/far2sdk/farplug-wide.h b/far2l/far2sdk/farplug-wide.h
index 09bc01ac..7561f803 100644
--- a/far2l/far2sdk/farplug-wide.h
+++ b/far2l/far2sdk/farplug-wide.h
@@ -1568,10 +1568,12 @@ enum EDITOR_CONTROL_COMMANDS
ECTL_GETSTACKBOOKMARKS,
ECTL_UNDOREDO,
ECTL_GETFILENAME,
-#ifdef FAR_USE_INTERNALS
- ECTL_SERVICEREGION,
-#endif // END FAR_USE_INTERNALS
+ ECTL_ADDTRUECOLOR,
+ ECTL_GETTRUECOLOR,
};
+//#ifdef FAR_USE_INTERNALS
+// ECTL_SERVICEREGION, // WTF
+//#endif // END FAR_USE_INTERNALS
enum EDITOR_SETPARAMETER_TYPES
{
@@ -1763,6 +1765,21 @@ struct EditorColor
int Color;
};
+struct FarTrueColor
+{
+ unsigned char R;
+ unsigned char G;
+ unsigned char B;
+ unsigned char Flags; // bit one - 'active' flag, others - ignored and must be set to zero
+};
+
+struct EditorTrueColor
+{
+ struct EditorColor Base;
+ struct FarTrueColor TrueFore;
+ struct FarTrueColor TrueBack;
+};
+
struct EditorSaveFile
{
const wchar_t *FileName;
diff --git a/far2l/src/console/AnsiEsc.cpp b/far2l/src/console/AnsiEsc.cpp
index 1980552e..606aa8f3 100644
--- a/far2l/src/console/AnsiEsc.cpp
+++ b/far2l/src/console/AnsiEsc.cpp
@@ -148,6 +148,7 @@ void FontState::ParseSuffixM(const int *args, int argc)
concealed = false;
bold = false;
underline = false;
+ strikeout = false;
case 39:
case 49: {
@@ -177,6 +178,9 @@ void FontState::ParseSuffixM(const int *args, int argc)
case 8:
concealed = 1;
break;
+ case 9:
+ strikeout = true;
+ break;
case 21: // oops, this actually turns on double underline
// but xterm turns off bold too, so that's alright
case 22:
@@ -192,6 +196,9 @@ void FontState::ParseSuffixM(const int *args, int argc)
case 28:
concealed = 0;
break;
+ case 29:
+ strikeout = false;
+ break;
}
}
}
@@ -200,6 +207,7 @@ void FontState::FromConsoleAttributes(DWORD64 qAttributes)
{
bold = (qAttributes & FOREGROUND_INTENSITY) != 0;
underline = (qAttributes & COMMON_LVB_UNDERSCORE) != 0;
+ strikeout = (qAttributes & COMMON_LVB_STRIKEOUT) != 0;
rvideo = (qAttributes & COMMON_LVB_REVERSE_VIDEO) != 0;
foreground = Attr2Ansi[qAttributes & 7];
background = Attr2Ansi[(qAttributes >> 4) & 7];
@@ -250,6 +258,10 @@ DWORD64 FontState::ToConsoleAttributes()
attribut|= COMMON_LVB_UNDERSCORE;
}
+ if (strikeout) {
+ attribut|= COMMON_LVB_STRIKEOUT;
+ }
+
return attribut;
}
diff --git a/far2l/src/console/AnsiEsc.hpp b/far2l/src/console/AnsiEsc.hpp
index f2278682..576bace8 100644
--- a/far2l/src/console/AnsiEsc.hpp
+++ b/far2l/src/console/AnsiEsc.hpp
@@ -14,6 +14,7 @@ namespace AnsiEsc
BYTE background = 0; // ANSI base color (0 to 7; add 40)
bool bold = false; //
bool underline = false; //
+ bool strikeout = false; //
bool rvideo = false; // swap console foreground & background attributes
bool concealed = false; // set foreground/bold to background/underline
diff --git a/far2l/src/console/scrbuf.cpp b/far2l/src/console/scrbuf.cpp
index 831856a9..f256692e 100644
--- a/far2l/src/console/scrbuf.cpp
+++ b/far2l/src/console/scrbuf.cpp
@@ -186,7 +186,7 @@ void ScreenBuf::Read(int X1,int Y1,int X2,int Y2,CHAR_INFO *Text,int MaxTextLeng
/* Изменить значение цветовых атрибутов в соответствии с маской
(в основном применяется для "создания" тени)
*/
-void ScreenBuf::ApplyColorMask(int X1,int Y1,int X2,int Y2,WORD ColorMask)
+void ScreenBuf::ApplyColorMask(int X1,int Y1,int X2,int Y2,DWORD64 ColorMask)
{
CriticalSectionLock Lock(CS);
int Width=X2-X1+1;
@@ -216,7 +216,7 @@ void ScreenBuf::ApplyColorMask(int X1,int Y1,int X2,int Y2,WORD ColorMask)
/* Непосредственное изменение цветовых атрибутов
*/
-void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,WORD Color)
+void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,DWORD64 Color)
{
CriticalSectionLock Lock(CS);
if(X1<=ScrX && Y1<=ScrY && X2>=0 && Y2>=0)
@@ -253,7 +253,7 @@ void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,WORD Color)
/* Непосредственное изменение цветовых атрибутов с заданым цетом исключением
*/
-void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,int Color,WORD ExceptColor)
+void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,DWORD64 Color,DWORD64 ExceptColor)
{
CriticalSectionLock Lock(CS);
if(X1<=ScrX && Y1<=ScrY && X2>=0 && Y2>=0)
@@ -285,7 +285,7 @@ void ScreenBuf::ApplyColor(int X1,int Y1,int X2,int Y2,int Color,WORD ExceptColo
/* Закрасить прямоугольник символом Ch и цветом Color
*/
-void ScreenBuf::FillRect(int X1,int Y1,int X2,int Y2,WCHAR Ch,WORD Color)
+void ScreenBuf::FillRect(int X1,int Y1,int X2,int Y2,WCHAR Ch,DWORD64 Color)
{
CriticalSectionLock Lock(CS);
int Width=X2-X1+1;
diff --git a/far2l/src/console/scrbuf.hpp b/far2l/src/console/scrbuf.hpp
index 497c01a9..f7ad4b4f 100644
--- a/far2l/src/console/scrbuf.hpp
+++ b/far2l/src/console/scrbuf.hpp
@@ -81,10 +81,10 @@ class ScreenBuf
void RestoreMacroChar();
void RestoreElevationChar();
- void ApplyColorMask(int X1,int Y1,int X2,int Y2,WORD ColorMask);
- void ApplyColor(int X1,int Y1,int X2,int Y2,WORD Color);
- void ApplyColor(int X1,int Y1,int X2,int Y2,int Color,WORD ExceptColor);
- void FillRect(int X1,int Y1,int X2,int Y2,WCHAR Ch,WORD Color);
+ void ApplyColorMask(int X1,int Y1,int X2,int Y2,DWORD64 ColorMask);
+ void ApplyColor(int X1,int Y1,int X2,int Y2,DWORD64 Color);
+ void ApplyColor(int X1,int Y1,int X2,int Y2,DWORD64 Color,DWORD64 ExceptColor);
+ void FillRect(int X1,int Y1,int X2,int Y2,WCHAR Ch,DWORD64 Color);
void Scroll(int);
void Flush();
diff --git a/far2l/src/edit.cpp b/far2l/src/edit.cpp
index e58c26ee..01efa5be 100644
--- a/far2l/src/edit.cpp
+++ b/far2l/src/edit.cpp
@@ -58,6 +58,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "history.hpp"
#include "vmenu.hpp"
#include "chgmmode.hpp"
+#include "VT256ColorTable.h"
#include <cwctype>
static int Recurse=0;
@@ -115,8 +116,6 @@ Edit::Edit(ScreenObject *pOwner, Callback* aCallback, bool bAllocateData):
SelColor=F_WHITE|B_BLACK;
ColorUnChanged=COL_DIALOGEDITUNCHANGED;
EndType=EOL_NONE;
- ColorList=nullptr;
- ColorCount=0;
TabSize=Opt.EdOpt.TabSize;
TabExpandMode = EXPAND_NOTABS;
Flags.Change(FEDITLINE_DELREMOVESBLOCKS,Opt.EdOpt.DelRemovesBlocks);
@@ -128,9 +127,6 @@ Edit::Edit(ScreenObject *pOwner, Callback* aCallback, bool bAllocateData):
Edit::~Edit()
{
- if (ColorList)
- free(ColorList);
-
if (Mask)
free(Mask);
@@ -2453,53 +2449,42 @@ void Edit::DeleteBlock()
}
-void Edit::AddColor(ColorItem *col)
+void Edit::AddColor(const ColorItem *col)
{
- if (!(ColorCount & 15))
- ColorList=(ColorItem *)realloc(ColorList,(ColorCount+16)*sizeof(*ColorList));
-
- ColorList[ColorCount++]=*col;
+ ColorList.emplace_back(*col);
}
-int Edit::DeleteColor(int ColorPos)
+size_t Edit::DeleteColor(int ColorPos)
{
- int Src;
-
- if (!ColorCount)
- return FALSE;
+ if (ColorList.empty())
+ return 0;
- int Dest=0;
+ size_t Dest, Src;
- for (Src=0; Src<ColorCount; Src++)
- if (ColorPos!=-1 && ColorList[Src].StartPos!=ColorPos)
+ for (Src = Dest = 0; Src < ColorList.size(); ++Src)
+ if (ColorPos != -1 && ColorList[Src].StartPos != ColorPos)
{
- if (Dest!=Src)
- ColorList[Dest]=ColorList[Src];
+ if (Dest != Src)
+ ColorList[Dest] = ColorList[Src];
- Dest++;
+ ++Dest;
}
- int DelCount=ColorCount-Dest;
- ColorCount=Dest;
-
- if (!ColorCount)
- {
- free(ColorList);
- ColorList=nullptr;
- }
+ const size_t DelCount = ColorList.size() - Dest;
+ ColorList.resize(Dest);
- return(DelCount);
+ return DelCount;
}
-int Edit::GetColor(ColorItem *col,int Item)
+bool Edit::GetColor(ColorItem *col, int Item)
{
- if (Item >= ColorCount)
- return FALSE;
+ if (Item >= (int)ColorList.size())
+ return false;
- *col=ColorList[Item];
- return TRUE;
+ *col = ColorList[Item];
+ return true;
}
@@ -2509,50 +2494,57 @@ void Edit::ApplyColor()
int Pos = INT_MIN, TabPos = INT_MIN, TabEditorPos = INT_MIN;
// Обрабатываем элементы ракраски
- for (int Col = 0; Col < ColorCount; Col++)
+ for (auto &CurItem : ColorList)
{
- ColorItem *CurItem = ColorList+Col;
-
// Пропускаем элементы у которых начало больше конца
- if (CurItem->StartPos > CurItem->EndPos)
+ if (CurItem.StartPos > CurItem.EndPos)
continue;
// Отсекаем элементы заведомо не попадающие на экран
- if (CurItem->StartPos-LeftPos > X2 && CurItem->EndPos-LeftPos < X1)
+ if (CurItem.StartPos-LeftPos > X2 && CurItem.EndPos-LeftPos < X1)
continue;
- int Attr = CurItem->Color;
- int Length = CurItem->EndPos-CurItem->StartPos+1;
+ DWORD64 Attr = CurItem.Color;
+ if (CurItem.TrueFore.Flags & 1)
+ {
+ SET_RGB_FORE(Attr, COMPOSE_RGB(CurItem.TrueFore.R, CurItem.TrueFore.G, CurItem.TrueFore.B));
+ }
+ if (CurItem.TrueBack.Flags & 1)
+ {
+ SET_RGB_BACK(Attr, COMPOSE_RGB(CurItem.TrueBack.R, CurItem.TrueBack.G, CurItem.TrueBack.B));
+ }
+
+ int Length = CurItem.EndPos - CurItem.StartPos+1;
- if (CurItem->StartPos+Length >= StrSize)
- Length = StrSize-CurItem->StartPos;
+ if (CurItem.StartPos + Length >= StrSize)
+ Length = StrSize - CurItem.StartPos;
// Получаем начальную позицию
int RealStart, Start;
// Если предыдущая позиция равна текущей, то ничего не вычисляем
// и сразу берём ранее вычисленное значение
- if (Pos == CurItem->StartPos)
+ if (Pos == CurItem.StartPos)
{
RealStart = TabPos;
Start = TabEditorPos;
}
// Если вычисление идёт первый раз или предыдущая позиция больше текущей,
// то производим вычисление с начала строки
- else if (Pos == INT_MIN || CurItem->StartPos < Pos)
+ else if (Pos == INT_MIN || CurItem.StartPos < Pos)
{
- RealStart = RealPosToCell(CurItem->StartPos);
+ RealStart = RealPosToCell(CurItem.StartPos);
Start = RealStart-LeftPos;
}
// Для отптимизации делаем вычисление относительно предыдущей позиции
else
{
- RealStart = RealPosToCell(TabPos, Pos, CurItem->StartPos, nullptr);
+ RealStart = RealPosToCell(TabPos, Pos, CurItem.StartPos, nullptr);
Start = RealStart-LeftPos;
}
// Запоминаем вычисленные значения для их дальнейшего повторного использования
- Pos = CurItem->StartPos;
+ Pos = CurItem.StartPos;
TabPos = RealStart;
TabEditorPos = Start;
@@ -2567,7 +2559,7 @@ void Edit::ApplyColor()
Attr &= ~ECF_TAB1;
// Получаем конечную позицию
- int EndPos = CurItem->EndPos;
+ int EndPos = CurItem.EndPos;
int RealEnd, End;
// Обрабатываем случай, когда предыдущая позиция равна текущей, то есть
diff --git a/far2l/src/edit.hpp b/far2l/src/edit.hpp
index ec531f16..66916245 100644
--- a/far2l/src/edit.hpp
+++ b/far2l/src/edit.hpp
@@ -38,6 +38,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "bitflags.hpp"
#include "FilesSuggestor.hpp"
#include <memory>
+#include <vector>
// Младший байт (маска 0xFF) юзается классом ScreenObject!!!
enum FLAGS_CLASS_EDITLINE
@@ -66,6 +67,9 @@ struct ColorItem
int StartPos;
int EndPos;
int Color;
+ FarTrueColor TrueFore;
+ FarTrueColor TrueBack;
+ bool TrueColorDefined;
};
enum SetCPFlags
@@ -144,8 +148,9 @@ class Edit:public ScreenObject
wchar_t *Mask;
- ColorItem *ColorList;
- int ColorCount;
+// ColorItem *ColorList;
+// int ColorCount;
+ std::vector<ColorItem> ColorList;
int Color;
int SelColor;
@@ -297,9 +302,9 @@ class Edit:public ScreenObject
void InsertTab();
- void AddColor(ColorItem *col);
- int DeleteColor(int ColorPos);
- int GetColor(ColorItem *col,int Item);
+ void AddColor(const ColorItem *col);
+ size_t DeleteColor(int ColorPos);
+ bool GetColor(ColorItem *col,int Item);
void Xlat(bool All=false);
diff --git a/far2l/src/editor.cpp b/far2l/src/editor.cpp
index b7ed7eba..7c0d7b49 100644
--- a/far2l/src/editor.cpp
+++ b/far2l/src/editor.cpp
@@ -5747,11 +5747,12 @@ int Editor::EditorControl(int Command,void *Param)
return TRUE;
}
// TODO: Если DI_MEMOEDIT не будет юзать раскаску, то должно выполняется в FileEditor::EditorControl(), в диалоге - нафиг ненать
+ case ECTL_ADDTRUECOLOR:
case ECTL_ADDCOLOR:
{
if (Param)
{
- EditorColor *col=(EditorColor *)Param;
+ const EditorColor *col=(EditorColor *)Param;
_ECTLLOG(SysLog(L"EditorColor{"));
_ECTLLOG(SysLog(L" StringNumber=%d",col->StringNumber));
_ECTLLOG(SysLog(L" ColorItem =%d (0x%08X)",col->ColorItem,col->ColorItem));
@@ -5759,7 +5760,7 @@ int Editor::EditorControl(int Command,void *Param)
_ECTLLOG(SysLog(L" EndPos =%d",col->EndPos));
_ECTLLOG(SysLog(L" Color =%d (0x%08X)",col->Color,col->Color));
_ECTLLOG(SysLog(L"}"));
- ColorItem newcol;
+ ColorItem newcol{0};
newcol.StartPos=col->StartPos+(col->StartPos!=-1?X1:0);
newcol.EndPos=col->EndPos+X1;
newcol.Color=col->Color;
@@ -5774,6 +5775,12 @@ int Editor::EditorControl(int Command,void *Param)
if (!col->Color)
return(CurPtr->DeleteColor(newcol.StartPos));
+ if (Command == ECTL_ADDTRUECOLOR)
+ {
+ const EditorTrueColor *tcol = (EditorTrueColor *)Param;
+ newcol.TrueFore = tcol->TrueFore;
+ newcol.TrueBack = tcol->TrueBack;
+ }
CurPtr->AddColor(&newcol);
return TRUE;
}
@@ -5781,6 +5788,7 @@ int Editor::EditorControl(int Command,void *Param)
break;
}
// TODO: Если DI_MEMOEDIT не будет юзать раскаску, то должно выполняется в FileEditor::EditorControl(), в диалоге - нафиг ненать
+ case ECTL_GETTRUECOLOR:
case ECTL_GETCOLOR:
{
if (Param)
@@ -5805,6 +5813,12 @@ int Editor::EditorControl(int Command,void *Param)
col->StartPos=curcol.StartPos-X1;
col->EndPos=curcol.EndPos-X1;
col->Color=curcol.Color;
+ if (Command == ECTL_ADDTRUECOLOR)
+ {
+ EditorTrueColor *tcol = (EditorTrueColor *)Param;
+ tcol->TrueFore = curcol.TrueFore;
+ tcol->TrueBack = curcol.TrueBack;
+ }
_ECTLLOG(SysLog(L"EditorColor{"));
_ECTLLOG(SysLog(L" StringNumber=%d",col->StringNumber));
_ECTLLOG(SysLog(L" ColorItem =%d (0x%08X)",col->ColorItem,col->ColorItem));
diff --git a/far2l/src/plug/wrap.cpp b/far2l/src/plug/wrap.cpp
index e08ef7fb..40ddd218 100644
--- a/far2l/src/plug/wrap.cpp
+++ b/far2l/src/plug/wrap.cpp
@@ -3514,11 +3514,13 @@ int WINAPI FarEditorControlA(int Command,void* Param)
switch (Command)
{
case oldfar::ECTL_ADDCOLOR: Command = ECTL_ADDCOLOR; break;
+ case oldfar::ECTL_ADDTRUECOLOR: Command = ECTL_ADDTRUECOLOR; break;
case oldfar::ECTL_DELETEBLOCK: Command = ECTL_DELETEBLOCK; break;
case oldfar::ECTL_DELETECHAR: Command = ECTL_DELETECHAR; break;
case oldfar::ECTL_DELETESTRING: Command = ECTL_DELETESTRING; break;
case oldfar::ECTL_EXPANDTABS: Command = ECTL_EXPANDTABS; break;
case oldfar::ECTL_GETCOLOR: Command = ECTL_GETCOLOR; break;
+ case oldfar::ECTL_GETTRUECOLOR: Command = ECTL_GETTRUECOLOR; break;
case oldfar::ECTL_GETBOOKMARKS: Command = ECTL_GETBOOKMARKS; break;
case oldfar::ECTL_INSERTSTRING: Command = ECTL_INSERTSTRING; break;
case oldfar::ECTL_QUIT: Command = ECTL_QUIT; break;