From da728dbe9b58a4fcf5f216b3084e793b88a6e511 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 17:04:44 +0500
Subject: [PATCH 1/7] #86 WIP: Sync menu and hotkey actions
---
doc/apps.md | 51 +++++++++++++++++++++-----------
doc/settings.md | 44 +++++++++++++--------------
src/netxs/apps/term.hpp | 16 +++++-----
src/netxs/desktopio/controls.hpp | 2 +-
src/netxs/desktopio/gui.hpp | 1 +
src/netxs/desktopio/richtext.hpp | 4 +--
src/netxs/desktopio/terminal.hpp | 20 ++++++-------
src/vtm.xml | 26 ++++++++--------
8 files changed, 90 insertions(+), 74 deletions(-)
diff --git a/doc/apps.md b/doc/apps.md
index 88fa1d02a1..2d5172a3ac 100644
--- a/doc/apps.md
+++ b/doc/apps.md
@@ -102,8 +102,8 @@ Repeat | Selects the next label and exec the function specified by the `actio
Value | Arguments (`data=`) | Description
-----------------------------|-------------------------------|------------
-Drop | | Drop all events for the specified key combination. No further processing.
-DropAutoRepeat | | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
+Noop | | Ignore all events for the specified key combination. No further processing.
+DropAutoRepeat | | Ignore `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
SwitchHotkeyScheme | _Scheme name_ | Switch the hotkey scheme to the specified one.
TerminalCwdSync | | Current working directory sync toggle. The command to send for synchronization is configurable via the ` ` setting's option. Where `$P` is a variable containing current path received via OSC 9;9 notification. To enable OSC9;9 shell notifications: - Windows Command Prompt: `setx PROMPT $e]9;9;$P$e\$P$G` - PowerShell: `function prompt{ $e=[char]27; "$e]9;9;$(Convert-Path $pwd)$e\PS $pwd$('>' * ($nestedPromptLevel + 1)) " }` - Bash: `export PS1='\[\033]9;9;\w\033\\\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '`
TerminalWrapMode | `on` \| `off` | Set terminal scrollback lines wrapping mode. Applied to the active selection if it is.
@@ -114,14 +114,14 @@ TerminalOutput | _Text string_ | Direct output the
TerminalSendKey | _Text string_ | Simulating keypresses using the specified string.
TerminalQuit | | Terminate runnning console apps and close terminal.
TerminalRestart | | Terminate runnning console apps and restart current session.
-TerminalToggleFullscreen | | Toggle fullscreen mode.
-TerminalToggleMaximize | | Toggle between maximized and normal window size.
+TerminalFullscreen | | Toggle fullscreen mode.
+TerminalMaximize | | Toggle between maximized and normal window size.
TerminalUndo | | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input.
TerminalRedo | | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command.
+TerminalClipboardCopy | | Сopy selection to clipboard.
TerminalClipboardPaste | | Paste from clipboard.
TerminalClipboardWipe | | Reset clipboard.
-TerminalSelectionMode | `none` \| `text` \| `ansi` \| `rich` \| `html` \| `protected` | Set terminal text selection mode.
-TerminalSelectionCopy | | Сopy selection to clipboard.
+TerminalClipboardFormat | `none` \| `text` \| `ansi` \| `rich` \| `html` \| `protected` | Set terminal text selection copy format.
TerminalSelectionRect | `on` \| `off` | Set linear(off) or rectangular(on) selection form using boolean value.
TerminalSelectionCancel | | Deselect a selection.
TerminalSelectionOneShot | `none` \| `text` \| `ansi` \| `rich` \| `html` \| `protected` | One-shot toggle to copy text while mouse tracking is active. Keep selection if `Ctrl` key is pressed..
@@ -130,7 +130,7 @@ TerminalScrollViewportByPage | _`IntX, IntY`_ | Scroll viewport b
TerminalScrollViewportByCell | _`IntX, IntY`_ | Scroll viewport by _`IntX, IntY`_ cells.
TerminalScrollViewportToTop | | Scroll viewport to the scrollback top.
TerminalScrollViewportToEnd | | Scroll viewport to the scrollback bottom (reset viewport position).
-TerminalStdioLog | | Stdin/stdout log toggle.
+TerminalStdioLog | `on` \| `off` | Toggle stdin/stdout logging to the specified state, or just toggle to another state if no arguments are specified.
*TerminalLogStart | | Start logging to file.
*TerminalLogPause | | Pause logging.
*TerminalLogStop | | Stop logging.
@@ -210,7 +210,15 @@ Hotkey | Description
" - applied to selection if it is "
- -
+
-
+
+
+
+ " Align text lines left/right/center \n"
+ " - applied to selection if it is "
+
+
+ -
@@ -252,12 +260,19 @@ Hotkey | Description
-
- -
+
-
-
+
-
-
-
-
-
-
+
-
+
-
+
-
+
+
-
+
+
-
@@ -316,20 +331,20 @@ Hotkey | Description
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
diff --git a/doc/settings.md b/doc/settings.md
index 1ad7ea5169..6e99ffe261 100644
--- a/doc/settings.md
+++ b/doc/settings.md
@@ -353,8 +353,8 @@ Configuration record | Interpretation
Action | Arguments (`data=`) | Available at layer | Description
-------------------------------|---------------------|---------------------|------------
-`Drop` | | All layers | Drop all events for the specified key combination. No further processing.
-`DropAutoRepeat` | | All layers | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
+`Noop` | | All layers | Ignore all events for the specified key combination. No further processing.
+`DropAutoRepeat` | | All layers | Ignore `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay.
`SwitchHotkeyScheme` | _Scheme name_ | TUI matrix | Switch the hotkey scheme to the specified one.
`IncreaseCellHeight` | | Native GUI window | Increase the text cell height by one pixel.
@@ -375,22 +375,22 @@ Action | Arguments (`data=`) | Available at layer | Des
`TerminalScrollViewportToTop` | | Application | Scroll viewport to the scrollback top.
`TerminalScrollViewportToEnd` | | Application | Scroll viewport to the scrollback bottom (reset viewport position).
`TerminalViewportCopy` | | Application | Сopy viewport to clipboard.
+`TerminalClipboardCopy` | | Application | Сopy selection to clipboard.
`TerminalClipboardPaste` | | Application | Paste from clipboard.
`TerminalClipboardWipe` | | Application | Reset clipboard.
+`TerminalClipboardFormat` | | Application | Switch terminal text selection copy format.
`TerminalUndo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input.
`TerminalRedo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command.
-`TerminalToggleCwdSync` | | Application | Toggle the current working directory sync mode.
-`TerminalToggleWrapMode` | | Application | Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is.
-`TerminalToggleSelectionMode` | | Application | Toggle between linear and rectangular selection form.
-`TerminalToggleFullscreen` | | Application | Toggle fullscreen mode.
-`TerminalToggleMaximize` | | Application | Toggle between maximized and normal window size.
-`TerminalToggleStdioLog` | | Application | Stdin/stdout log toggle.
-`TerminalQuit` | | Application | Terminate runnning console apps and close terminal.
-`TerminalRestart` | | Application | Terminate runnning console apps and restart current session.
-`TerminalSwitchCopyMode` | | Application | Switch terminal text selection copy mode.
-`TerminalSelectionCopy` | | Application | Сopy selection to clipboard.
+`TerminalCwdSync` | | Application | Toggle the current working directory sync mode.
+`TerminalWrapMode` | | Application | Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is.
+`TerminalFullscreen` | | Application | Toggle fullscreen mode.
+`TerminalMaximize` | | Application | Toggle between maximized and normal window size.
+`TerminalStdioLog` | `on` \| `off` | Toggle stdin/stdout logging to the specified state, or just toggle to another state if no arguments are specified.
+`TerminalSelectionRect` | | Application | Toggle between linear and rectangular selection form.
`TerminalSelectionCancel` | | Application | Deselect a selection.
`TerminalSelectionOneShot` | | Application | One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed.
+`TerminalRestart` | | Application | Terminate runnning console apps and restart current session.
+`TerminalQuit` | | Application | Terminate runnning console apps and close terminal.
### DirectVT configuration payload received from the parent process
@@ -616,7 +616,7 @@ Notes
" Applied to selection if it is "
- -
+
-
@@ -757,7 +757,7 @@ Notes
" Applied to selection if it is "
- -
+
-
@@ -860,20 +860,20 @@ Notes
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
diff --git a/src/netxs/apps/term.hpp b/src/netxs/apps/term.hpp
index 3138f3cc48..04cdb6a537 100644
--- a/src/netxs/apps/term.hpp
+++ b/src/netxs/apps/term.hpp
@@ -211,8 +211,8 @@ namespace netxs::app::terminal
X(SwitchHotkeyScheme ) /* */ \
X(TerminalQuit ) /* */ \
X(TerminalCwdSync ) /* */ \
- X(TerminalToggleFullscreen ) /* */ \
- X(TerminalToggleMaximize ) /* */ \
+ X(TerminalFullscreen ) /* */ \
+ X(TerminalMaximize ) /* */ \
X(TerminalRestart ) /* */ \
X(TerminalSendKey ) /* */ \
X(TerminalWrapMode ) /* */ \
@@ -222,10 +222,10 @@ namespace netxs::app::terminal
X(TerminalFindPrev ) /* */ \
X(TerminalUndo ) /* Undo/Redo for cooked read on win32 */ \
X(TerminalRedo ) /* */ \
+ X(TerminalClipboardCopy ) /* */ \
X(TerminalClipboardPaste ) /* */ \
X(TerminalClipboardWipe ) /* */ \
- X(TerminalSelectionCopy ) /* */ \
- X(TerminalSelectionMode ) /* */ \
+ X(TerminalClipboardFormat ) /* */ \
X(TerminalSelectionRect ) /* Linear/Rectangular */ \
X(TerminalSelectionCancel ) /* */ \
X(TerminalSelectionOneShot ) /* One-shot toggle to copy text while mouse tracking is active */ \
@@ -361,14 +361,14 @@ namespace netxs::app::terminal
boss.bell::signal(tier::anycast, terminal::events::cmd, ui::term::commands::ui::commands::sighup);
});
}
- static void TerminalToggleFullscreen(ui::item& boss, menu::item& item)
+ static void TerminalFullscreen(ui::item& boss, menu::item& item)
{
_submit(boss, item, [](auto& boss, auto& /*item*/, auto& gear)
{
boss.base::riseup(tier::preview, e2::form::size::enlarge::fullscreen, gear);
});
}
- static void TerminalToggleMaximize(ui::item& boss, menu::item& item)
+ static void TerminalMaximize(ui::item& boss, menu::item& item)
{
_submit(boss, item, [](auto& boss, auto& /*item*/, auto& gear)
{
@@ -410,14 +410,14 @@ namespace netxs::app::terminal
gear.clear_clipboard();
});
}
- static void TerminalSelectionCopy(ui::item& boss, menu::item& item)
+ static void TerminalClipboardCopy(ui::item& boss, menu::item& item)
{
_submit(boss, item, [](auto& boss, auto& /*item*/, auto& gear)
{
boss.bell::signal(tier::anycast, terminal::events::data::copy, gear);
});
}
- static void TerminalSelectionMode(ui::item& boss, menu::item& item)
+ static void TerminalClipboardFormat(ui::item& boss, menu::item& item)
{
item.reindex([](auto& utf8){ return netxs::get_or(xml::options::format, utf8, mime::disabled); });
_submit(boss, item, [](auto& boss, auto& item, auto& /*gear*/)
diff --git a/src/netxs/desktopio/controls.hpp b/src/netxs/desktopio/controls.hpp
index a4e3ced5e8..7fc42b8b24 100644
--- a/src/netxs/desktopio/controls.hpp
+++ b/src/netxs/desktopio/controls.hpp
@@ -2046,7 +2046,7 @@ namespace netxs::ui
};
}
};
- proc("Drop", [](hids& gear, txts&){ gear.set_handled(); });
+ proc("Noop", [](hids& gear, txts&){ gear.set_handled(); });
proc("DropAutoRepeat", [](hids& gear, txts&){ if (gear.keystat == input::key::repeated) gear.set_handled(); });
}
diff --git a/src/netxs/desktopio/gui.hpp b/src/netxs/desktopio/gui.hpp
index 242615197b..611bdc138b 100644
--- a/src/netxs/desktopio/gui.hpp
+++ b/src/netxs/desktopio/gui.hpp
@@ -2491,6 +2491,7 @@ namespace netxs::gui
auto prime_canvas = layer_get_bits(master);
auto blink_canvas = layer_get_bits(blinky);
auto origin = blink_canvas.coor();
+ //todo blinks.mask size is out of sync on intensive resize
auto iter = blinks.mask.begin() + offset;
auto p = rect{ origin + start, cellsz };
auto m = origin + blink_canvas.size();
diff --git a/src/netxs/desktopio/richtext.hpp b/src/netxs/desktopio/richtext.hpp
index f2614584a9..818254bc6f 100644
--- a/src/netxs/desktopio/richtext.hpp
+++ b/src/netxs/desktopio/richtext.hpp
@@ -1491,7 +1491,7 @@ namespace netxs::ui
{
if (parser::defer && caret && caret == length())
{
- if constexpr (debugmode) log("try to reassemble cluster=", lyric->back().txt());
+ //if constexpr (debugmode) log("try to reassemble cluster=", lyric->back().txt());
auto last_cluster = lyric->pop_cluster();
if (caret != length())
{
@@ -1501,7 +1501,7 @@ namespace netxs::ui
reassembled_cluster += last_cluster;
reassembled_cluster += utf8;
ansi::parse(reassembled_cluster, this);
- if constexpr (debugmode) log("\treassembled_cluster=", utf::buffer_to_hex(reassembled_cluster, true));
+ //if constexpr (debugmode) log("\treassembled_cluster=", utf::buffer_to_hex(reassembled_cluster, true));
return *this;
}
}
diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp
index ed71199976..83f5551c7a 100644
--- a/src/netxs/desktopio/terminal.hpp
+++ b/src/netxs/desktopio/terminal.hpp
@@ -7722,24 +7722,24 @@ namespace netxs::ui
chords.proc("TerminalScrollViewportToEnd", [&](hids& gear, txts&){ if (target != &normal) return; gear.set_handled(); base::riseup(tier::preview, e2::form::upon::scroll::to_end::y); });
chords.proc("TerminalFindPrev", [&](hids& gear, txts&){ gear.set_handled(); selection_search(gear, feed::rev); });
chords.proc("TerminalFindNext", [&](hids& gear, txts&){ gear.set_handled(); selection_search(gear, feed::fwd); });
- chords.proc("TerminalSelectionCancel", [&](hids& gear, txts&){ if (!selection_active()) return; gear.set_handled(); exec_cmd(commands::ui::deselect); });
- chords.proc("TerminalToggleCwdSync", [&](hids& gear, txts&){ gear.set_handled(); base::riseup(tier::preview, ui::term::events::toggle::cwdsync, true); });
- chords.proc("TerminalToggleWrapMode", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglewrp); });
+ chords.proc("TerminalCwdSync", [&](hids& gear, txts&){ gear.set_handled(); base::riseup(tier::preview, ui::term::events::toggle::cwdsync, true); });
+ chords.proc("TerminalWrapMode", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglewrp); });
chords.proc("TerminalQuit", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::sighup); });
chords.proc("TerminalRestart", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::restart); });
//todo use wptr for gear when enqueueing
- chords.proc("TerminalToggleFullscreen", [&](hids& gear, txts&){ gear.set_handled(); bell::enqueue(This(), [&](auto& /*boss*/){ base::riseup(tier::preview, e2::form::size::enlarge::fullscreen, gear); }); }); // Refocus-related operations require execution outside of keyboard events.
- chords.proc("TerminalToggleMaximize", [&](hids& gear, txts&){ gear.set_handled(); bell::enqueue(This(), [&](auto& /*boss*/){ base::riseup(tier::preview, e2::form::size::enlarge::maximize, gear); }); });
+ chords.proc("TerminalFullscreen", [&](hids& gear, txts&){ gear.set_handled(); bell::enqueue(This(), [&](auto& /*boss*/){ base::riseup(tier::preview, e2::form::size::enlarge::fullscreen, gear); }); }); // Refocus-related operations require execution outside of keyboard events.
+ chords.proc("TerminalMaximize", [&](hids& gear, txts&){ gear.set_handled(); bell::enqueue(This(), [&](auto& /*boss*/){ base::riseup(tier::preview, e2::form::size::enlarge::maximize, gear); }); });
chords.proc("TerminalUndo", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::undo); });
chords.proc("TerminalRedo", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::redo); });
+ chords.proc("TerminalClipboardCopy", [&](hids& gear, txts&){ gear.set_handled(); copy(gear); });
chords.proc("TerminalClipboardPaste", [&](hids& gear, txts&){ gear.set_handled(); paste(gear); });
chords.proc("TerminalClipboardWipe", [&](hids& gear, txts&){ gear.set_handled(); gear.clear_clipboard(); });
- chords.proc("TerminalSwitchCopyMode", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglesel); });
- chords.proc("TerminalSelectionCopy", [&](hids& gear, txts&){ gear.set_handled(); copy(gear); });
- chords.proc("TerminalToggleSelectionMode", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::toggleselalt); });
- chords.proc("TerminalSelectionOneShot", [&](hids& gear, txts&){ gear.set_handled(); set_oneshot(mime::textonly); });
+ chords.proc("TerminalClipboardFormat", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglesel); });
chords.proc("TerminalViewportCopy", [&](hids& gear, txts&){ gear.set_handled(); prnscrn(gear); });
- chords.proc("TerminalToggleStdioLog", [&](hids& gear, txts&){ gear.set_handled(); set_log(!io_log); ondata(); });
+ chords.proc("TerminalSelectionRect", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::toggleselalt); });
+ chords.proc("TerminalSelectionCancel", [&](hids& gear, txts&){ if (!selection_active()) return; gear.set_handled(); exec_cmd(commands::ui::deselect); });
+ chords.proc("TerminalSelectionOneShot", [&](hids& gear, txts&){ gear.set_handled(); set_oneshot(mime::textonly); });
+ chords.proc("TerminalStdioLog", [&](hids& gear, txts& args){ gear.set_handled(); set_log(args.size() ? xml::take_or(args.front(), !io_log) : !io_log); ondata(); });
auto bindings = chords.load(xml_config, "term");
for (auto& r : bindings)
{
diff --git a/src/vtm.xml b/src/vtm.xml
index 9980557045..4e89310caa 100644
--- a/src/vtm.xml
+++ b/src/vtm.xml
@@ -193,7 +193,7 @@ R"==(
" Applied to selection if it is "
- -
+
-
@@ -337,7 +337,7 @@ R"==(
" Applied to selection if it is "
- -
+
-
@@ -441,22 +441,22 @@ R"==(
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
)=="
\ No newline at end of file
From 1b441de7745a62fb1926cb6c1fdd4a0937fe31f5 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 17:23:57 +0500
Subject: [PATCH 2/7] #86 WIP: Implement TerminalSendKey and TerminalOutput key
action
---
src/netxs/desktopio/terminal.hpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp
index 83f5551c7a..dceaafb7f5 100644
--- a/src/netxs/desktopio/terminal.hpp
+++ b/src/netxs/desktopio/terminal.hpp
@@ -7740,6 +7740,9 @@ namespace netxs::ui
chords.proc("TerminalSelectionCancel", [&](hids& gear, txts&){ if (!selection_active()) return; gear.set_handled(); exec_cmd(commands::ui::deselect); });
chords.proc("TerminalSelectionOneShot", [&](hids& gear, txts&){ gear.set_handled(); set_oneshot(mime::textonly); });
chords.proc("TerminalStdioLog", [&](hids& gear, txts& args){ gear.set_handled(); set_log(args.size() ? xml::take_or(args.front(), !io_log) : !io_log); ondata(); });
+ chords.proc("TerminalSendKey", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_out(args.front()); });
+ chords.proc("TerminalOutput", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_in(args.front()); });
+ //chords.proc("TerminalAlignMode", [&](hids& gear, txts& args){ gear.set_handled(); exec_cmd(commands::ui::togglealign); });
auto bindings = chords.load(xml_config, "term");
for (auto& r : bindings)
{
From 36964183587f5bb112bb4d1e5615a4a001c7e0f9 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 18:53:45 +0500
Subject: [PATCH 3/7] #86 WIP: Implement TerminalAlignMode and TerminalWrapMode
key action
---
src/netxs/desktopio/ansivt.hpp | 30 +++++++++---------
src/netxs/desktopio/terminal.hpp | 52 +++++++++++++++++++++-----------
2 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/src/netxs/desktopio/ansivt.hpp b/src/netxs/desktopio/ansivt.hpp
index 53d05327c3..2c8e3fb607 100644
--- a/src/netxs/desktopio/ansivt.hpp
+++ b/src/netxs/desktopio/ansivt.hpp
@@ -1268,24 +1268,24 @@ namespace netxs::ansi
ccc[ccc_cpy] = V{ F(py, q.subarg(0)); }; // fx_ccc_cpy
ccc[ccc_rst] = V{ F(zz, 0); }; // fx_ccc_rst
- ccc[ccc_mgn ] = V{ p->style.mgn (q ); }; // fx_ccc_mgn
- ccc[ccc_mgl ] = V{ p->style.mgl (q.subarg(0)); }; // fx_ccc_mgl
- ccc[ccc_mgr ] = V{ p->style.mgr (q.subarg(0)); }; // fx_ccc_mgr
- ccc[ccc_mgt ] = V{ p->style.mgt (q.subarg(0)); }; // fx_ccc_mgt
- ccc[ccc_mgb ] = V{ p->style.mgb (q.subarg(0)); }; // fx_ccc_mgb
- ccc[ccc_tbs ] = V{ p->style.tbs (q.subarg(0)); }; // fx_ccc_tbs
- ccc[ccc_jet ] = V{ p->style.jet (static_cast(q.subarg(0))); }; // fx_ccc_jet
- ccc[ccc_wrp ] = V{ p->style.wrp (static_cast(q.subarg(0))); }; // fx_ccc_wrp
- ccc[ccc_rtl ] = V{ p->style.rtl(static_cast(q.subarg(0)));
+ ccc[ccc_mgn ] = V{ p->style.mgn(q); }; // fx_ccc_mgn
+ ccc[ccc_mgl ] = V{ p->style.mgl(q.subarg(0)); }; // fx_ccc_mgl
+ ccc[ccc_mgr ] = V{ p->style.mgr(q.subarg(0)); }; // fx_ccc_mgr
+ ccc[ccc_mgt ] = V{ p->style.mgt(q.subarg(0)); }; // fx_ccc_mgt
+ ccc[ccc_mgb ] = V{ p->style.mgb(q.subarg(0)); }; // fx_ccc_mgb
+ ccc[ccc_tbs ] = V{ p->style.tbs(q.subarg(0)); }; // fx_ccc_tbs
+ ccc[ccc_jet ] = V{ p->style.jet((bias)q.subarg(0)); }; // fx_ccc_jet
+ ccc[ccc_wrp ] = V{ p->style.wrp((wrap)q.subarg(0)); }; // fx_ccc_wrp
+ ccc[ccc_rtl ] = V{ p->style.rtl((rtol)q.subarg(0));
p->brush.rtl(p->style.rtl() == rtol::rtl); }; // fx_ccc_rtl
- ccc[ccc_rlf ] = V{ p->style.rlf (static_cast(q.subarg(0))); }; // fx_ccc_rlf
- ccc[ccc_jet_or] = V{ p->style.jet_or(static_cast(q.subarg(0))); }; // fx_ccc_or_jet
- ccc[ccc_wrp_or] = V{ p->style.wrp_or(static_cast(q.subarg(0))); }; // fx_ccc_or_wrp
- ccc[ccc_rtl_or] = V{ p->style.rtl_or(static_cast(q.subarg(0)));
+ ccc[ccc_rlf ] = V{ p->style.rlf((feed)q.subarg(0)); }; // fx_ccc_rlf
+ ccc[ccc_jet_or] = V{ p->style.jet_or((bias)q.subarg(0)); }; // fx_ccc_or_jet
+ ccc[ccc_wrp_or] = V{ p->style.wrp_or((wrap)q.subarg(0)); }; // fx_ccc_or_wrp
+ ccc[ccc_rtl_or] = V{ p->style.rtl_or((rtol)q.subarg(0));
p->brush.rtl(p->style.rtl() == rtol::rtl); }; // fx_ccc_or_rtl
- ccc[ccc_rlf_or] = V{ p->style.rlf_or(static_cast(q.subarg(0))); }; // fx_ccc_or_rlf
+ ccc[ccc_rlf_or] = V{ p->style.rlf_or((feed)q.subarg(0)); }; // fx_ccc_or_rlf
- ccc[ccc_lnk ] = V{ p->brush.link (static_cast(q.subarg(0))); }; // fx_ccc_lnk
+ ccc[ccc_lnk ] = V{ p->brush.link((id_t)q.subarg(0)); }; // fx_ccc_lnk
ccc[ccc_nop] = nullptr;
ccc[ccc_idx] = nullptr;
diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp
index dceaafb7f5..6c074e64b3 100644
--- a/src/netxs/desktopio/terminal.hpp
+++ b/src/netxs/desktopio/terminal.hpp
@@ -83,6 +83,7 @@ namespace netxs::ui
{
center,
togglewrp,
+ togglejet,
togglesel,
toggleselalt,
restart,
@@ -1140,7 +1141,7 @@ namespace netxs::ui
}
return delta;
}
- virtual void selection_setjet(bias /*align*/)
+ virtual void selection_setjet(bias /*align*/ = {})
{
// Do nothing by default.
}
@@ -6140,15 +6141,33 @@ namespace netxs::ui
}
}
// scroll_buf: Sel alignment for selected lines.
- void selection_setjet(bias align) override
+ void selection_setjet(bias a = bias::none) override
{
- if (upmid.role == grip::idle) return;
- selection_foreach([&](auto& curln)
+ //todo unify setwrp and setjet
+ if (selection_active())
{
- curln.style.jet(align);
- batch.recalc(curln);
- });
- resize_viewport(panel, true); // Recalc batch.basis.
+ if (upmid.role == grip::idle) return;
+ auto i_top = std::clamp(batch.index_by_id(upmid.link), 0, batch.size);
+ auto j = batch[i_top].style.jet();
+ auto align = a != bias::none ? a
+ : j == bias::left ? bias::right
+ : j == bias::right ? bias::center
+ : bias::left;
+ selection_foreach([&](auto& curln)
+ {
+ curln.style.jet(align);
+ batch.recalc(curln);
+ });
+ resize_viewport(panel, true); // Recalc batch.basis.
+ }
+ else
+ {
+ auto j = style.jet();
+ style.jet(a != bias::none ? a
+ : j == bias::left ? bias::right
+ : j == bias::right ? bias::center
+ : bias::left);
+ }
}
// scroll_buf: Sel wrapping mode for selected lines.
void selection_setwrp(wrap w = wrap::none) override
@@ -7433,7 +7452,7 @@ namespace netxs::ui
console.brush.reset(brush);
bell::signal(tier::release, ui::term::events::colors::fg, fg);
}
- void set_wrapln(si32 wrapln)
+ void set_wrapln(si32 wrapln = {})
{
target->selection_setwrp((wrap)wrapln);
if (!target->selection_active())
@@ -7442,15 +7461,11 @@ namespace netxs::ui
}
ondata();
}
- void set_align(si32 align)
+ void set_align(si32 align = {})
{
- if (target->selection_active())
- {
- target->selection_setjet((bias)align);
- }
- else
+ target->selection_setjet((bias)align);
+ if (!target->selection_active())
{
- target->style.jet((bias)align);
follow[axis::Y] = true; // Reset viewport.
}
ondata();
@@ -7482,6 +7497,7 @@ namespace netxs::ui
switch (cmd)
{
case commands::ui::togglewrp: console.selection_setwrp(); break;
+ case commands::ui::togglejet: console.selection_setjet(); break;
case commands::ui::togglesel: selection_selmod(); break;
case commands::ui::toggleselalt: selection_toggle_selalt(); break;
case commands::ui::restart: restart(); break;
@@ -7723,7 +7739,6 @@ namespace netxs::ui
chords.proc("TerminalFindPrev", [&](hids& gear, txts&){ gear.set_handled(); selection_search(gear, feed::rev); });
chords.proc("TerminalFindNext", [&](hids& gear, txts&){ gear.set_handled(); selection_search(gear, feed::fwd); });
chords.proc("TerminalCwdSync", [&](hids& gear, txts&){ gear.set_handled(); base::riseup(tier::preview, ui::term::events::toggle::cwdsync, true); });
- chords.proc("TerminalWrapMode", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglewrp); });
chords.proc("TerminalQuit", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::sighup); });
chords.proc("TerminalRestart", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::restart); });
//todo use wptr for gear when enqueueing
@@ -7742,7 +7757,8 @@ namespace netxs::ui
chords.proc("TerminalStdioLog", [&](hids& gear, txts& args){ gear.set_handled(); set_log(args.size() ? xml::take_or(args.front(), !io_log) : !io_log); ondata(); });
chords.proc("TerminalSendKey", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_out(args.front()); });
chords.proc("TerminalOutput", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_in(args.front()); });
- //chords.proc("TerminalAlignMode", [&](hids& gear, txts& args){ gear.set_handled(); exec_cmd(commands::ui::togglealign); });
+ chords.proc("TerminalAlignMode", [&](hids& gear, txts& args){ gear.set_handled(); if (args.empty()) exec_cmd(commands::ui::togglejet); else set_align((si32)netxs::get_or(xml::options::align, args.front(), bias::none)); });
+ chords.proc("TerminalWrapMode", [&](hids& gear, txts& args){ gear.set_handled(); if (args.empty()) exec_cmd(commands::ui::togglewrp); else set_wrapln(1 + (si32)!xml::take_or(args.front(), true)); });
auto bindings = chords.load(xml_config, "term");
for (auto& r : bindings)
{
From ec3a3933d29bf6a5d10ddedd03e4530bf0651038 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 19:26:01 +0500
Subject: [PATCH 4/7] Minimize static_cast usage
---
src/netxs/desktopio/canvas.hpp | 12 +++++-----
src/netxs/desktopio/consrv.hpp | 32 ++++++++++++-------------
src/netxs/desktopio/directvt.hpp | 4 ++--
src/netxs/desktopio/geometry.hpp | 4 ++--
src/netxs/desktopio/input.hpp | 6 ++---
src/netxs/desktopio/intmath.hpp | 10 ++++----
src/netxs/desktopio/richtext.hpp | 8 +++----
src/netxs/desktopio/system.hpp | 29 ++++++++++++-----------
src/netxs/desktopio/terminal.hpp | 40 ++++++++++++++++----------------
src/netxs/desktopio/utf.hpp | 26 ++++++++++-----------
10 files changed, 86 insertions(+), 85 deletions(-)
diff --git a/src/netxs/desktopio/canvas.hpp b/src/netxs/desktopio/canvas.hpp
index 2879fbc7bf..15606ade7a 100644
--- a/src/netxs/desktopio/canvas.hpp
+++ b/src/netxs/desktopio/canvas.hpp
@@ -3022,8 +3022,8 @@ namespace netxs
{
assert( canvas.size() <= si32max);
assert(what.canvas.size() <= si32max);
- auto full = static_cast( canvas.size());
- auto size = static_cast(what.canvas.size());
+ auto full = (si32) canvas.size();
+ auto size = (si32)what.canvas.size();
auto rest = full - from;
auto look = [&](auto canvas_begin, auto canvas_end, auto what_begin)
{
@@ -3049,7 +3049,7 @@ namespace netxs
if (init == stop)
{
- from = static_cast(std::distance(head, iter)) - 1;
+ from = (si32)std::distance(head, iter) - 1;
return true;
}
else dest = base;
@@ -3079,7 +3079,7 @@ namespace netxs
auto toxy(si32 offset) const // core: Convert offset to coor.
{
assert(canvas.size() <= si32max);
- auto maxs = static_cast(canvas.size());
+ auto maxs = (si32)canvas.size();
if (!maxs) return dot_00;
offset = std::clamp(offset, 0, maxs - 1);
auto sx = std::max(1, region.size.x);
@@ -3089,11 +3089,11 @@ namespace netxs
{
if (from > upto) std::swap(from, upto);
assert(canvas.size() <= si32max);
- auto maxs = static_cast(canvas.size());
+ auto maxs = (si32)canvas.size();
from = std::clamp(from, 0, maxs ? maxs - 1 : 0);
upto = std::clamp(upto, 0, maxs);
auto size = upto - from;
- return core{ span{ canvas.begin() + from, static_cast(size) }, { size, 1 }};
+ return core{ span{ canvas.begin() + from, (size_t)size }, { size, 1 }};
}
auto line(twod p1, twod p2) const // core: Get stripe.
{
diff --git a/src/netxs/desktopio/consrv.hpp b/src/netxs/desktopio/consrv.hpp
index 0b3264d195..71208d0742 100644
--- a/src/netxs/desktopio/consrv.hpp
+++ b/src/netxs/desktopio/consrv.hpp
@@ -442,7 +442,7 @@ struct impl : consrv
ui32 length;
ui32 offset;
- auto readoffset() const { return static_cast(length ? length + sizeof(ui32) * 2 /*sizeof(drvpacket payload)*/ : 0); }
+ auto readoffset() const { return (ui32)(length ? length + sizeof(ui32) * 2 /*sizeof(drvpacket payload)*/ : 0); }
auto sendoffset() const { return length; }
template
auto recv_data(fd_t condrv, T&& buffer)
@@ -705,7 +705,7 @@ struct impl : consrv
auto c = utf::to_lower(s.back());
if (c >= '1' && c <= '9')
{
- auto n = static_cast(c - '1');
+ auto n = (ui32)(c - '1');
if (args.size() > n) result += args[n];
}
else switch (c)
@@ -742,7 +742,7 @@ struct impl : consrv
auto count()
{
auto lock = std::lock_guard{ locker };
- return static_cast(stream.size());
+ return (ui32)stream.size();
}
void abort(hndl* handle_ptr)
{
@@ -2226,7 +2226,7 @@ struct impl : consrv
if (c == brgb) bgcx = m;
}
}
- attr = static_cast(fgcx + (bgcx << 4));
+ attr = (ui16)(fgcx + (bgcx << 4));
if (brush.inv()) attr |= COMMON_LVB_REVERSE_VIDEO;
if (brush.und()) attr |= COMMON_LVB_UNDERSCORE;
if (brush.ovr()) attr |= COMMON_LVB_GRID_HORIZONTAL;
@@ -2653,7 +2653,7 @@ struct impl : consrv
}
auto count = avail / sizeof(ui32);
auto recs = wrap::cast(buffer, count);
- packet.reply.count = static_cast(joined.size());
+ packet.reply.count = (ui32)joined.size();
log("\treply.count: ", packet.reply.count);
if (count >= joined.size())
{
@@ -2915,7 +2915,7 @@ struct impl : consrv
log("\tread mode: raw ReadFile emulation");
packet.input = { .EOFon = 1 };
}
- auto namesize = static_cast(packet.input.execb * sizeof(wchr));
+ auto namesize = (ui32)(packet.input.execb * sizeof(wchr));
if (!size_check(packet.echosz, packet.input.affix)
|| !size_check(packet.echosz, answer.sendoffset())) return;
auto readstep = packet.echosz - answer.sendoffset();
@@ -3044,7 +3044,7 @@ struct impl : consrv
auto& packet = payload::cast(upload);
auto recs = take_buffer(packet);
if (recs.size()) events.sendevents(recs, packet.input.utf16);
- packet.reply.count = static_cast(recs.size());
+ packet.reply.count = (ui32)recs.size();
log("\twritten events count: ", packet.reply.count,
"\n\t", show_page(packet.input.utf16, inpenc->codepage));
}
@@ -3192,14 +3192,14 @@ struct impl : consrv
{
auto& screen = *uiterm.target;
auto coord = std::clamp(twod{ packet.input.coorx, packet.input.coory }, dot_00, screen.panel - dot_11);
- auto maxsz = static_cast(screen.panel.x * (screen.panel.y - coord.y) - coord.x);
+ auto maxsz = (ui32)(screen.panel.x * (screen.panel.y - coord.y) - coord.x);
auto saved = screen.coord;
auto count = ui32{};
screen.cup0(coord);
if (packet.input.etype == type::attribute)
{
auto recs = take_buffer(packet);
- count = static_cast(recs.size());
+ count = (ui32)recs.size();
if (count > maxsz) count = maxsz;
log(prompt, "WriteConsoleOutputAttribute",
"\n\tinput.coord: ", coord,
@@ -3252,7 +3252,7 @@ struct impl : consrv
auto success = direct(packet.target, [&](auto& scrollback)
{
auto& line = celler.content();
- count = static_cast(line.length());
+ count = (ui32)line.length();
if (count > maxsz)
{
count = maxsz;
@@ -3276,7 +3276,7 @@ struct impl : consrv
if (packet.input.etype == type::attribute)
{
auto recs = take_buffer(packet);
- count = static_cast(recs.size());
+ count = (ui32)recs.size();
log(prompt, "WriteConsoleOutputAttribute",
"\n\tinput.coord: ", coord,
"\n\tinput.count: ", count);
@@ -3289,7 +3289,7 @@ struct impl : consrv
if (packet.input.etype == type::ansiOEM)
{
auto recs = take_buffer(packet);
- count = static_cast(recs.size());
+ count = (ui32)recs.size();
if (outenc->codepage != CP_UTF8)
{
toUTF8.clear();
@@ -3304,7 +3304,7 @@ struct impl : consrv
else
{
auto recs = take_buffer(packet);
- count = static_cast(recs.size());
+ count = (ui32)recs.size();
toUTF8.clear();
utf::to_utf(recs, toUTF8);
log("\tinput.data: ", ansi::hi(utf::debase(toUTF8)));
@@ -3703,7 +3703,7 @@ struct impl : consrv
return;
}
auto recsz = packet.input.etype == type::ansiOEM ? sizeof(char) : sizeof(ui16);
- auto count = static_cast(avail / recsz);
+ auto count = (si32)(avail / recsz);
auto coor = twod{ packet.input.coorx, packet.input.coory };
if constexpr (isreal())
@@ -4176,14 +4176,14 @@ struct impl : consrv
uiterm.ctrack.color[bgcx] = brgb;
rgbpalette [bgcx] = argb::swap_rb(brgb); // conhost crashes if alpha non zero.
}
- packet.reply.attributes = static_cast(fgcx + (bgcx << 4));
+ packet.reply.attributes = (ui16)(fgcx + (bgcx << 4));
if (mark.inv()) packet.reply.attributes |= COMMON_LVB_REVERSE_VIDEO;
if (mark.und()) packet.reply.attributes |= COMMON_LVB_UNDERSCORE;
if (mark.ovr()) packet.reply.attributes |= COMMON_LVB_GRID_HORIZONTAL;
}
else
{
- packet.reply.attributes = static_cast(fgcx + (bgcx << 4));
+ packet.reply.attributes = (ui16)(fgcx + (bgcx << 4));
}
log("\treply.attributes: ", utf::to_hex_0x(packet.reply.attributes),
"\n\treply.cursor_coor: ", caretpos,
diff --git a/src/netxs/desktopio/directvt.hpp b/src/netxs/desktopio/directvt.hpp
index ce0641c381..91abf47731 100644
--- a/src/netxs/desktopio/directvt.hpp
+++ b/src/netxs/desktopio/directvt.hpp
@@ -428,7 +428,7 @@ namespace netxs::directvt
// stream: .
auto length() const
{
- return static_cast(block.length());
+ return (sz_t)block.length();
}
// stream: .
auto reset()
@@ -1019,7 +1019,7 @@ namespace netxs::directvt
if (bad)
{
if (sum) rep();
- auto offset = static_cast(src - beg);
+ auto offset = (sz_t)(src - beg);
add(subtype::mov, offset);
bad = faux;
}
diff --git a/src/netxs/desktopio/geometry.hpp b/src/netxs/desktopio/geometry.hpp
index c33e59f304..1ee77f2967 100644
--- a/src/netxs/desktopio/geometry.hpp
+++ b/src/netxs/desktopio/geometry.hpp
@@ -657,13 +657,13 @@ namespace netxs
static inline si32 getlen(T p)
{
if constexpr (std::is_same_v) return p.x;
- else return static_cast(p);
+ else return (si32)p;
}
// geometry: Extract 2D size.
template
static inline rect getvol(T p)
{
if constexpr (std::is_same_v) return { dot_00, p };
- else return { dot_00, { static_cast(p), 1 } };
+ else return { dot_00, { (si32)p, 1 } };
}
}
\ No newline at end of file
diff --git a/src/netxs/desktopio/input.hpp b/src/netxs/desktopio/input.hpp
index 31972f33f9..68505c15d2 100644
--- a/src/netxs/desktopio/input.hpp
+++ b/src/netxs/desktopio/input.hpp
@@ -228,13 +228,13 @@ namespace netxs::input
}
map(si32 vk, si32 sc, si32 cs)
- : hash{ static_cast(mask(vk) & (vk | (sc << 8) | (cs << 16))) }
+ : hash{ (sz_t)(mask(vk) & (vk | (sc << 8) | (cs << 16))) }
{ }
map(si32 vk, si32 sc, si32 cs, si32 keymask, view keyname, view generic_keyname, si32 doinput, si32 id)
{
mask(vk) = keymask;
data(id) = { .name = keyname, .generic = generic_keyname, .vkey = vk, .scan = sc, .edit = doinput };
- hash = static_cast(keymask & (vk | (sc << 8) | (cs << 16)));
+ hash = (sz_t)(keymask & (vk | (sc << 8) | (cs << 16)));
}
bool operator == (map const& m) const = default;
@@ -956,7 +956,7 @@ namespace netxs::input
}
m_buttons[left ] = faux;
m_buttons[right] = faux;
- m_sys.buttons = static_cast(m_buttons.to_ulong());
+ m_sys.buttons = (si32)m_buttons.to_ulong();
}
// Suppress left and right to avoid single button tracking (click, pull, etc)
diff --git a/src/netxs/desktopio/intmath.hpp b/src/netxs/desktopio/intmath.hpp
index df3cae28b8..4f7c2d6dbc 100644
--- a/src/netxs/desktopio/intmath.hpp
+++ b/src/netxs/desktopio/intmath.hpp
@@ -1037,11 +1037,11 @@ namespace netxs
using twod = T;
using type = disintegrate;
- auto gain = static_cast( 0 );
- auto dx = static_cast( p1.x - p0.x );
- auto dy = static_cast( p1.y - p0.y );
- auto lx = static_cast( std::abs(dx) );
- auto ly = static_cast( std::abs(dy) );
+ auto gain = ui16{};
+ auto dx = (si32)(p1.x - p0.x);
+ auto dy = (si32)(p1.y - p0.y);
+ auto lx = (ui32)std::abs(dx);
+ auto ly = (ui32)std::abs(dy);
rect = rect.normalize();
auto& coor = rect.coor;
diff --git a/src/netxs/desktopio/richtext.hpp b/src/netxs/desktopio/richtext.hpp
index 818254bc6f..f1ec32f2e9 100644
--- a/src/netxs/desktopio/richtext.hpp
+++ b/src/netxs/desktopio/richtext.hpp
@@ -580,7 +580,7 @@ namespace netxs::ui
if (*next != blank) break;
tail = next;
}
- auto new_size = static_cast(tail - head);
+ auto new_size = (si32)(tail - head);
if (max_size && max_size < new_size) new_size = max_size;
if (new_size != length()) crop(new_size);
}
@@ -2201,7 +2201,7 @@ namespace netxs::ui
}
auto& current() { return **layer; } // page: Access to the current paragraph.
auto& current() const { return **layer; } // page: RO access to the current paragraph.
- auto size() const { return static_cast(batch.size()); }
+ auto size() const { return (si32)batch.size(); }
// page: Estimated page size calculation (use fake printing for accurate calc).
auto limits() const
{
@@ -2277,11 +2277,11 @@ namespace netxs::ui
if (c =='\\') { data.push_back('\\'); data.push_back('\\'); }
else if (c == '{') { data.push_back('\\'); data.push_back('{' ); }
else if (c == '}') { data.push_back('\\'); data.push_back('}' ); }
- else if (c < 0x80) { data.push_back(static_cast(c)); }
+ else if (c < 0x80) { data.push_back((char)c); }
else
{
data.push_back('\\'); data.push_back('u');
- data += std::to_string(static_cast(c));
+ data += std::to_string((si16)c);
data.push_back('?');
}
}
diff --git a/src/netxs/desktopio/system.hpp b/src/netxs/desktopio/system.hpp
index 7b9f169ed6..72b8188d2e 100644
--- a/src/netxs/desktopio/system.hpp
+++ b/src/netxs/desktopio/system.hpp
@@ -427,10 +427,10 @@ namespace netxs::os
auto ioctl(DWORD dwIoControlCode, fd_t hDevice, I&& send = {}, O&& recv = {}) -> NTSTATUS
{
auto BytesReturned = DWORD{};
- auto lpInBuffer = std::is_same_v, noop> ? nullptr : static_cast(&send);
- auto nInBufferSize = std::is_same_v, noop> ? 0 : static_cast(sizeof(send));
- auto lpOutBuffer = std::is_same_v, noop> ? nullptr : static_cast(&recv);
- auto nOutBufferSize = std::is_same_v, noop> ? 0 : static_cast(sizeof(recv));
+ auto lpInBuffer = std::is_same_v, noop> ? nullptr : (void*)(&send);
+ auto nInBufferSize = std::is_same_v, noop> ? 0 : (DWORD)(sizeof(send));
+ auto lpOutBuffer = std::is_same_v, noop> ? nullptr : (void*)(&recv);
+ auto nOutBufferSize = std::is_same_v, noop> ? 0 : (DWORD)(sizeof(recv));
auto lpBytesReturned = &BytesReturned;
auto ok = ::DeviceIoControl(hDevice,
dwIoControlCode,
@@ -643,7 +643,7 @@ namespace netxs::os
}
if (c.inv()) std::swap(f, b);
if (c.und()) std::swap(f, b); // Interferes with the menu scrollbar mimics.
- auto attr = static_cast((b << 4) | f);
+ auto attr = (ui16)((b << 4) | f);
// LEADING/TRAILINGs only for OEMs.
//if (c.und()) attr |= COMMON_LVB_UNDERSCORE; // LVB attributes historically available only for DBCS code pages.
//if (c.ovr()) attr |= COMMON_LVB_GRID_HORIZONTAL;
@@ -2398,11 +2398,12 @@ namespace netxs::os
auto getid()
{
- #if defined(_WIN32)
- auto id = static_cast(::GetCurrentProcessId());
- #else
- auto id = static_cast(::getpid());
- #endif
+ auto id = (ui32)
+ #if defined(_WIN32)
+ ::GetCurrentProcessId();
+ #else
+ ::getpid();
+ #endif
ui::console::id = std::pair{ id, datetime::now() };
return ui::console::id;
}
@@ -2525,10 +2526,10 @@ namespace netxs::os
auto buffer = wide(MAX_PATH, '\0');
while (buffer.size() <= 32768)
{
- auto length = ::GetModuleFileNameExW(handle, // hProcess
- NULL, // hModule
- buffer.data(), // lpFilename
- static_cast(buffer.size()));// nSize
+ auto length = ::GetModuleFileNameExW(handle, // hProcess
+ NULL, // hModule
+ buffer.data(), // lpFilename
+ (DWORD)buffer.size());// nSize
if (length == 0) break;
if (buffer.size() > length + 1)
{
diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp
index 6c074e64b3..03879a9a2f 100644
--- a/src/netxs/desktopio/terminal.hpp
+++ b/src/netxs/desktopio/terminal.hpp
@@ -1551,7 +1551,7 @@ namespace netxs::ui
// bufferbase: Resize tabstop index.
void resize_tabstops(si32 new_size, bool forced = faux)
{
- auto size = static_cast(stops.size());
+ auto size = (si32)stops.size();
if (!forced && new_size <= size) return;
auto last_stop = si32{};
@@ -1599,7 +1599,7 @@ namespace netxs::ui
auto& last = tail->first;
if (coord.x != last)
{
- auto size = static_cast(stops.size());
+ auto size = (si32)stops.size();
auto base = last;
last = coord.x;
while (head != tail)
@@ -1627,7 +1627,7 @@ namespace netxs::ui
// bufferbase: (see CSI 0 g) Remove tabstop at the current cursor posistion.
void remove_tabstop()
{
- auto size = static_cast(stops.size());
+ auto size = (si32)stops.size();
if (coord.x <= 0 || coord.x >= size) return;
auto head = stops.begin();
auto tail = stops.begin() + coord.x;
@@ -1700,7 +1700,7 @@ namespace netxs::ui
virtual void tab(si32 n)
{
parser::flush();
- auto size = static_cast(stops.size());
+ auto size = (si32)stops.size();
if (n > 0) while (n-- > 0) tab_impl(size);
else while (n++ < 0) tab_impl(size);
}
@@ -2872,7 +2872,7 @@ namespace netxs::ui
{
//No need to disturb distant objects, it may already be in the swap.
auto total = length();
- return static_cast(total - 1 - (back().index - item_id)); // ring buffer size is never larger than max_int32.
+ return (si32)(total - 1 - (back().index - item_id)); // ring buffer size is never larger than max_int32.
}
// buff: Return an iterator pointing to the item with the specified id.
auto iter_by_id(ui32 line_id) -> ring::iter //todo MSVC 17.7.0 requires return type
@@ -3230,8 +3230,8 @@ namespace netxs::ui
if (batch.round && range1 < panel.y * 2)
{
lookup();
- auto count1 = static_cast(under.index - batch.ancid);
- auto count2 = static_cast(batch.ancid - front.index);
+ auto count1 = (si32)(under.index - batch.ancid);
+ auto count2 = (si32)(batch.ancid - front.index);
auto min_dy = std::min(count1, count2);
if (min_dy < approx_threshold) // Refine position to absolute value.
@@ -3269,7 +3269,7 @@ namespace netxs::ui
{
ui64 count1 = std::min(std::max(0, fresh_slide), batch.vsize);
ui64 count2 = batch.vsize;
- batch.ancid = front.index + static_cast(netxs::divround(batch.size * count1, count2));
+ batch.ancid = front.index + (id_t)netxs::divround(batch.size * count1, count2);
batch.ancdy = 0;
batch.slide = fresh_slide;
batch.round = batch.vsize != batch.size;
@@ -3341,17 +3341,17 @@ namespace netxs::ui
{
auto& front = batch.front();
auto& under = batch.back();
- auto range1 = static_cast(under.index - batch.ancid);
- auto range2 = static_cast(batch.ancid - front.index);
+ auto range1 = (si32)(under.index - batch.ancid);
+ auto range2 = (si32)(batch.ancid - front.index);
batch.round = faux;
if (range1 < batch.size)
{
if (approx_threshold < std::min(range1, range2))
{
auto& mapln = index.front();
- auto c1 = static_cast(static_cast(mapln.index - front.index));
- auto c2 = static_cast(range2);
- auto fresh_slide = static_cast(netxs::divround(batch.vsize * c2, c1));
+ auto c1 = (ui64)(si32)(mapln.index - front.index);
+ auto c2 = (ui64)range2;
+ auto fresh_slide = (si32)netxs::divround(batch.vsize * c2, c1);
batch.slide = batch.ancdy + fresh_slide;
batch.round = batch.vsize != batch.size;
}
@@ -3812,7 +3812,7 @@ namespace netxs::ui
auto upto = index[limit - 1].index + 1;
auto base = batch.index_by_id(from);
auto head = batch.begin() + base;
- auto size = static_cast(upto - from);
+ auto size = (si32)(upto - from);
auto tail = head + size;
auto area = block.area();
block.full(area);
@@ -4434,7 +4434,7 @@ namespace netxs::ui
{ // cursor overlaps some lines below and placed below the viewport.
curln.resize(batch.caret);
batch.recalc(curln);
- if (auto n = static_cast(batch.back().index - curid))
+ if (auto n = (si32)(batch.back().index - curid))
{
if constexpr (mixer) _merge(curln, oldsz, curid, n);
assert(n > 0);
@@ -4511,7 +4511,7 @@ namespace netxs::ui
batch.recalc(curln);
auto w = curln.length();
- auto spoil = static_cast(mapln.index - curid);
+ auto spoil = (si32)(mapln.index - curid);
assert(spoil > 0);
if constexpr (mixer) _merge(curln, oldsz, curid, spoil);
@@ -4990,7 +4990,7 @@ namespace netxs::ui
auto mdlid = index[mdl - 1].index + 1;
auto endid = index[end - 1].index + 1;
auto start = batch.index_by_id(topid);
- auto range = static_cast(mdlid - topid);
+ auto range = (si32)(mdlid - topid);
auto floor = batch.index_by_id(endid) - range;
batch.remove(start, range);
@@ -5027,7 +5027,7 @@ namespace netxs::ui
auto mdlid = mdl > 0 ? index[mdl - 1].index + 1 // mdl == 0 or mdl == top when count == max (full arena).
: topid;
auto start = batch.index_by_id(topid);
- auto range = static_cast(endid - mdlid);
+ auto range = (si32)(endid - mdlid);
auto floor = batch.index_by_id(endid) - range;
batch.remove(floor, range);
@@ -6076,7 +6076,7 @@ namespace netxs::ui
status.coor.x = 1 + std::abs(dnmid.coor.x - upmid.coor.x);
if (upmid.role != grip::idle)
{
- status.coor.y = 1 + std::abs(static_cast(dnmid.link - upmid.link));
+ status.coor.y = 1 + std::abs((si32)(dnmid.link - upmid.link));
if (status.coor.y < approx_threshold)
{
auto [i_top, i_end, upcur, dncur] = selection_get_it();
@@ -6262,7 +6262,7 @@ namespace netxs::ui
// scroll_buf: Retrun distance between lines.
auto selection_outrun(id_t id1, twod coor1, id_t id2, twod coor2)
{
- auto dir = static_cast(id2 - id1);
+ auto dir = (si32)(id2 - id1);
if (dir < 0)
{
std::swap(id1, id2);
diff --git a/src/netxs/desktopio/utf.hpp b/src/netxs/desktopio/utf.hpp
index 86aea4e000..5edb766a93 100644
--- a/src/netxs/desktopio/utf.hpp
+++ b/src/netxs/desktopio/utf.hpp
@@ -849,25 +849,25 @@ namespace netxs::utf
{
if (code <= 0x007f)
{
- push(static_cast(code));
+ push((char)code);
}
else if (code <= 0x07ff)
{
- push(static_cast(0xc0 | ((code >> 0x06) & 0x1f)));
- push(static_cast(0x80 | ( code & 0x3f)));
+ push((char)(0xc0 | ((code >> 0x06) & 0x1f)));
+ push((char)(0x80 | ( code & 0x3f)));
}
else if (code <= 0xffff)
{
- push(static_cast(0xe0 | ((code >> 0x0c) & 0x0f)));
- push(static_cast(0x80 | ((code >> 0x06) & 0x3f)));
- push(static_cast(0x80 | ( code & 0x3f)));
+ push((char)(0xe0 | ((code >> 0x0c) & 0x0f)));
+ push((char)(0x80 | ((code >> 0x06) & 0x3f)));
+ push((char)(0x80 | ( code & 0x3f)));
}
else
{
- push(static_cast(0xf0 | ((code >> 0x12) & 0x07)));
- push(static_cast(0x80 | ((code >> 0x0c) & 0x3f)));
- push(static_cast(0x80 | ((code >> 0x06) & 0x3f)));
- push(static_cast(0x80 | ( code & 0x3f)));
+ push((char)(0xf0 | ((code >> 0x12) & 0x07)));
+ push((char)(0x80 | ((code >> 0x0c) & 0x3f)));
+ push((char)(0x80 | ((code >> 0x06) & 0x3f)));
+ push((char)(0x80 | ( code & 0x3f)));
}
}
void _to_utf(text& utf8, utfx code)
@@ -1447,7 +1447,7 @@ namespace netxs::utf
if (++step == 4)
{
step = 0;
- for (auto& a : buff) a = static_cast(look.find(a));
+ for (auto& a : buff) a = (byte)look.find(a);
data.push_back(( buff[0] << 2) + ((buff[1] & 0x30) >> 4));
data.push_back(((buff[1] & 0x0F) << 4) + ((buff[2] & 0x3C) >> 2));
data.push_back(((buff[2] & 0x03) << 6) + buff[3]);
@@ -1458,7 +1458,7 @@ namespace netxs::utf
{
auto temp = step;
while (temp < 4) buff[temp++] = 0;
- for (auto& a : buff) a = static_cast(look.find(a));
+ for (auto& a : buff) a = (byte)look.find(a);
if (step > 1) data.push_back(( buff[0] << 2) + ((buff[1] & 0x30) >> 4));
if (step > 2) data.push_back(((buff[1] & 0x0F) << 4) + ((buff[2] & 0x3C) >> 2));
}
@@ -1534,7 +1534,7 @@ namespace netxs::utf
else buff += cluster.text;
};
decode(s, y, a, utf8, mode);
- return static_cast(buff.length() - init);
+ return (si32)(buff.length() - init);
}
// utf: Return a string without control chars (replace all ctrls with printables).
template
From 5651ddc69ee5efe65821cc2d3a16665328415029 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 19:51:46 +0500
Subject: [PATCH 5/7] #86 WIP: Implement TerminalClipboardFormat,
TerminalSelectionRect and TerminalSelectionOneShot
---
doc/settings.md | 54 ++++++++++++++++----------------
src/netxs/desktopio/terminal.hpp | 6 ++--
src/vtm.xml | 39 ++++++++++++-----------
3 files changed, 50 insertions(+), 49 deletions(-)
diff --git a/doc/settings.md b/doc/settings.md
index 6e99ffe261..55f55a5b6f 100644
--- a/doc/settings.md
+++ b/doc/settings.md
@@ -801,7 +801,7 @@ Notes
-
+
@@ -832,19 +832,16 @@ Notes
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
@@ -859,23 +856,26 @@ Notes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp
index 03879a9a2f..0452f5559b 100644
--- a/src/netxs/desktopio/terminal.hpp
+++ b/src/netxs/desktopio/terminal.hpp
@@ -7749,11 +7749,11 @@ namespace netxs::ui
chords.proc("TerminalClipboardCopy", [&](hids& gear, txts&){ gear.set_handled(); copy(gear); });
chords.proc("TerminalClipboardPaste", [&](hids& gear, txts&){ gear.set_handled(); paste(gear); });
chords.proc("TerminalClipboardWipe", [&](hids& gear, txts&){ gear.set_handled(); gear.clear_clipboard(); });
- chords.proc("TerminalClipboardFormat", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::togglesel); });
+ chords.proc("TerminalClipboardFormat", [&](hids& gear, txts& args){ gear.set_handled(); if (args.empty()) exec_cmd(commands::ui::togglesel); else set_selmod((si32)netxs::get_or(xml::options::format, args.front(), mime::textonly)); });
chords.proc("TerminalViewportCopy", [&](hids& gear, txts&){ gear.set_handled(); prnscrn(gear); });
- chords.proc("TerminalSelectionRect", [&](hids& gear, txts&){ gear.set_handled(); exec_cmd(commands::ui::toggleselalt); });
chords.proc("TerminalSelectionCancel", [&](hids& gear, txts&){ if (!selection_active()) return; gear.set_handled(); exec_cmd(commands::ui::deselect); });
- chords.proc("TerminalSelectionOneShot", [&](hids& gear, txts&){ gear.set_handled(); set_oneshot(mime::textonly); });
+ chords.proc("TerminalSelectionRect", [&](hids& gear, txts& args){ gear.set_handled(); if (args.empty()) exec_cmd(commands::ui::toggleselalt); else set_selalt(xml::take_or(args.front(), faux)); });
+ chords.proc("TerminalSelectionOneShot", [&](hids& gear, txts& args){ gear.set_handled(); if (args.empty()) set_oneshot(mime::textonly); else set_oneshot(netxs::get_or(xml::options::format, args.front(), mime::textonly)); });
chords.proc("TerminalStdioLog", [&](hids& gear, txts& args){ gear.set_handled(); set_log(args.size() ? xml::take_or(args.front(), !io_log) : !io_log); ondata(); });
chords.proc("TerminalSendKey", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_out(args.front()); });
chords.proc("TerminalOutput", [&](hids& gear, txts& args){ gear.set_handled(); if (args.size()) data_in(args.front()); });
diff --git a/src/vtm.xml b/src/vtm.xml
index 4e89310caa..f4918dfa9c 100644
--- a/src/vtm.xml
+++ b/src/vtm.xml
@@ -424,8 +424,6 @@ R"==(
-
-
@@ -440,23 +438,26 @@ R"==(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
)=="
\ No newline at end of file
From 2c147b49b519c907fc7e8c017cfce76e86debdfb Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 21:38:18 +0500
Subject: [PATCH 6/7] #86 WIP: Update docs
---
doc/apps.md | 2 +-
doc/settings.md | 143 +++++++++++++++++++++++++++++-------------------
src/vtm.xml | 18 +++---
3 files changed, 97 insertions(+), 66 deletions(-)
diff --git a/doc/apps.md b/doc/apps.md
index 2d5172a3ac..a58d76f31d 100644
--- a/doc/apps.md
+++ b/doc/apps.md
@@ -304,7 +304,7 @@ Hotkey | Description
-
+
diff --git a/doc/settings.md b/doc/settings.md
index 55f55a5b6f..61672ae133 100644
--- a/doc/settings.md
+++ b/doc/settings.md
@@ -230,8 +230,34 @@ The following declarations have the same meaning:
...
- ...
+ ...
+
+
+
+
+
+ ...
+
+
+
+
+
+ ...
+
+
+
+
+
+ ...
+
+
+
+
+
+ ...
+
+
```
@@ -305,9 +331,9 @@ The syntax for defining key combination bindings is:
```xml
-
+
...
-
+
```
@@ -316,7 +342,7 @@ Tag | Value
`key` | The text string containing the key combinations.
`scheme` | Hotkey scheme name for which mapping is being done (empty string by default).
`action` | The action name.
-`arg` | The arguments passed to the action.
+`data` | The arguments passed to the action.
The following joiners are allowed for combining keys:
@@ -324,7 +350,7 @@ Joiner | Meaning
-------|--------
`+` | The subsequent key is in pressed state.
`-` | The subsequent key is in released state. This joiner is allowed for the last key only.
-` | ` | The separator for key combinations in a list (vertical bar surrounded by spaces).
+` \| ` | The separator for key combinations in a list (vertical bar surrounded by spaces).
Key combinations can be of the following types:
@@ -341,56 +367,61 @@ The required key combination sequence can be generated on the Info page, accessi
#### Interpretation
-Configuration record | Interpretation
-------------------------------------------------------|-----------------
-`` | Append existing bindings using an indirect reference (the `NameOfAction` variable without quotes).
-` ` | Append existing bindings with the directly specified command "NameOfAction".
-` ` | Append existing bindings for scheme="1".
-` ` | Remove all existing bindings for the specified key combination "Key+Chord".
-` ` | Do nothing.
-
-#### Available actions
-
-Action | Arguments (`data=`) | Available at layer | Description
--------------------------------|---------------------|---------------------|------------
-`Noop` | | All layers | Ignore all events for the specified key combination. No further processing.
-`DropAutoRepeat` | | All layers | Ignore `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
-`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay.
-`SwitchHotkeyScheme` | _Scheme name_ | TUI matrix | Switch the hotkey scheme to the specified one.
-`IncreaseCellHeight` | | Native GUI window | Increase the text cell height by one pixel.
-`DecreaseCellHeight` | | Native GUI window | Decrease the text cell height by one pixel.
-`ResetCellHeight` | | Native GUI window | Reset text cell height.
-`ToggleFullscreenMode` | | Native GUI window | Toggle fullscreen mode.
-`ToggleAntialiasingMode` | | Native GUI window | Toggle text antialiasing mode.
-`RollFontsBackward` | | Native GUI window | Roll font list backward.
-`RollFontsForward` | | Native GUI window | Roll font list forward.
-`FocusPrevWindow` | | Desktop | Switch focus to the next desktop window.
-`FocusNextWindow` | | Desktop | Switch focus to the previous desktop window.
-`Disconnect` | | Desktop | Disconnect from the desktop.
-`TryToQuit` | | Desktop | Shut down the desktop server if no applications are running.
-`TerminalFindNext` | | Application | Highlight next match of selected text fragment. Clipboard content is used if no active selection.
-`TerminalFindPrev` | | Application | Highlight previous match of selected text fragment. Clipboard content is used if no active selection.
-`TerminalScrollViewportByPage` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ pages.
-`TerminalScrollViewportByCell` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ cells.
-`TerminalScrollViewportToTop` | | Application | Scroll viewport to the scrollback top.
-`TerminalScrollViewportToEnd` | | Application | Scroll viewport to the scrollback bottom (reset viewport position).
-`TerminalViewportCopy` | | Application | Сopy viewport to clipboard.
-`TerminalClipboardCopy` | | Application | Сopy selection to clipboard.
-`TerminalClipboardPaste` | | Application | Paste from clipboard.
-`TerminalClipboardWipe` | | Application | Reset clipboard.
-`TerminalClipboardFormat` | | Application | Switch terminal text selection copy format.
-`TerminalUndo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input.
-`TerminalRedo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command.
-`TerminalCwdSync` | | Application | Toggle the current working directory sync mode.
-`TerminalWrapMode` | | Application | Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is.
-`TerminalFullscreen` | | Application | Toggle fullscreen mode.
-`TerminalMaximize` | | Application | Toggle between maximized and normal window size.
-`TerminalStdioLog` | `on` \| `off` | Toggle stdin/stdout logging to the specified state, or just toggle to another state if no arguments are specified.
-`TerminalSelectionRect` | | Application | Toggle between linear and rectangular selection form.
-`TerminalSelectionCancel` | | Application | Deselect a selection.
-`TerminalSelectionOneShot` | | Application | One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed.
-`TerminalRestart` | | Application | Terminate runnning console apps and restart current session.
-`TerminalQuit` | | Application | Terminate runnning console apps and close terminal.
+Configuration record | Interpretation
+---------------------------------------------------------------|-----------------
+`` | Append existing bindings using an indirect reference (the `NameOfAction` variable without quotes).
+`` | Append existing bindings for `Key+Chord | Another+Chord`.
+` ` | Append existing bindings with the directly specified command "NameOfAction".
+` ` | Append existing bindings for scheme="1".
+` ` | Remove all existing bindings for the specified key combination "Key+Chord".
+` ` | Append existing bindings with the directly specified command "NameOfAction" with arguments "param".
+` ` | Do nothing.
+
+#### Available actions (`action=`)
+
+Action | Arguments (`data=`) | Available at layer | Description
+-------------------------------|--------------------------------------------------------|---------------------|------------
+`Noop` | | All layers | Ignore all events for the specified key combination. No further processing.
+`DropAutoRepeat` | | All layers | Ignore `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
+`IncreaseCellHeight` | | Native GUI window | Increase the text cell height by one pixel.
+`DecreaseCellHeight` | | Native GUI window | Decrease the text cell height by one pixel.
+`ResetCellHeight` | | Native GUI window | Reset text cell height.
+`ToggleFullscreenMode` | | Native GUI window | Toggle fullscreen mode.
+`ToggleAntialiasingMode` | | Native GUI window | Toggle text antialiasing mode.
+`RollFontsBackward` | | Native GUI window | Roll font list backward.
+`RollFontsForward` | | Native GUI window | Roll font list forward.
+`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay.
+`SwitchHotkeyScheme` | _Scheme name_ | TUI matrix, Window menu | Switch the hotkey scheme to the specified one.
+`FocusPrevWindow` | | Desktop | Switch focus to the next desktop window.
+`FocusNextWindow` | | Desktop | Switch focus to the previous desktop window.
+`Disconnect` | | Desktop | Disconnect from the desktop.
+`TryToQuit` | | Desktop | Shut down the desktop server if no applications are running.
+`TerminalFindNext` | | Application | Highlight next match of selected text fragment. Clipboard content is used if no active selection.
+`TerminalFindPrev` | | Application | Highlight previous match of selected text fragment. Clipboard content is used if no active selection.
+`TerminalScrollViewportByPage` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ pages.
+`TerminalScrollViewportByCell` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ cells.
+`TerminalScrollViewportToTop` | | Application | Scroll viewport to the scrollback top.
+`TerminalScrollViewportToEnd` | | Application | Scroll viewport to the scrollback bottom (reset viewport position).
+`TerminalViewportCopy` | | Application | Сopy viewport to clipboard.
+`TerminalClipboardCopy` | | Application | Сopy selection to clipboard.
+`TerminalClipboardPaste` | | Application | Paste from clipboard.
+`TerminalClipboardWipe` | | Application | Reset clipboard.
+`TerminalClipboardFormat` | `none` \| `text` \| `ansi` \| `rich` \| `html` \| `protected` | Application | Switch terminal text selection copy format.
+`TerminalOutput` | _Text string_ | Application | Direct output the string to the terminal scrollback.
+`TerminalSendKey` | _Text string_ | Application | Simulating keypresses using the specified string.
+`TerminalUndo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input.
+`TerminalRedo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command.
+`TerminalCwdSync` | | Application | Toggle the current working directory sync mode.
+`TerminalWrapMode` | `on` \| `off` | Application | Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is.
+`TerminalAlignMode` | `left` \| `right` \| `center` | Application | Set terminal scrollback lines aligning mode. Applied to the active selection if it is.
+`TerminalFullscreen` | | Application | Toggle fullscreen mode.
+`TerminalMaximize` | | Application | Toggle between maximized and normal window size.
+`TerminalStdioLog` | `on` \| `off` | Application | Toggle stdin/stdout logging to the specified state, or just toggle to another state if no arguments are specified.
+`TerminalSelectionRect` | `on` \| `off` | Application | Toggle between linear and rectangular selection form.
+`TerminalSelectionCancel` | | Application | Deselect a selection.
+`TerminalSelectionOneShot` | `text` \| `ansi` \| `rich` \| `html` \| `protected` | Application | One-shot toggle to copy text while mouse tracking is active. Keep selection if `Ctrl` key is pressed..
+`TerminalRestart` | | Application | Terminate runnning console apps and restart current session.
+`TerminalQuit` | | Application | Terminate runnning console apps and close terminal.
### DirectVT configuration payload received from the parent process
@@ -826,7 +857,7 @@ Notes
-
+
diff --git a/src/vtm.xml b/src/vtm.xml
index f4918dfa9c..257a0e1088 100644
--- a/src/vtm.xml
+++ b/src/vtm.xml
@@ -408,7 +408,7 @@ R"==(
-
+
@@ -422,14 +422,14 @@ R"==(
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
From e42963ac18a257fc8411af64196ce7b8f2f142c0 Mon Sep 17 00:00:00 2001
From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com>
Date: Sat, 23 Nov 2024 21:38:54 +0500
Subject: [PATCH 7/7] v0.9.99.50
---
src/netxs/desktopio/application.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/netxs/desktopio/application.hpp b/src/netxs/desktopio/application.hpp
index e2f6a6b42d..1ca75d78d5 100644
--- a/src/netxs/desktopio/application.hpp
+++ b/src/netxs/desktopio/application.hpp
@@ -24,7 +24,7 @@ namespace netxs::app
namespace netxs::app::shared
{
- static const auto version = "v0.9.99.49";
+ static const auto version = "v0.9.99.50";
static const auto repository = "https://github.com/directvt/vtm";
static const auto usr_config = "~/.config/vtm/settings.xml"s;
static const auto sys_config = "/etc/vtm/settings.xml"s;