Skip to content

Commit

Permalink
#266 #273 WIP: Bidirectional clipboard sync (win32, preview hide time…
Browse files Browse the repository at this point in the history
…out + highlighting)
  • Loading branch information
o-sdn-o committed Dec 5, 2022
1 parent 8e85738 commit 56a6971
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 145 deletions.
15 changes: 9 additions & 6 deletions src/netxs/apps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ R"==(
<match fx=selection bgc="0xFF007F00" fgc=whitelt /> <!-- Color of the selected text occurrences. Set fx to use cell::shaders: xlight | selection | contrast | invert | reverse -->
<selection>
<text fx=selection bgc=bluelt fgc=whitelt /> <!-- Highlighting of the selected text in plaintext mode. -->
<pass fx=selection bgc=bluelt fgc=whitelt />
<protected fx=selection bgc=bluelt fgc=whitelt />
<ansi fx=xlight/>
<rich fx=xlight/>
<html fx=xlight/>
Expand All @@ -111,7 +111,7 @@ R"==(
<slim="true"/>
</menu>
<selection>
<mode="text"/> <!-- text | ansi | rich | html | pass | none -->
<mode="text"/> <!-- text | ansi | rich | html | protected | none -->
</selection>
<hotkeys> <!-- not implemented -->
<key*/>
Expand Down Expand Up @@ -227,11 +227,14 @@ R"==(
<client>
<background fgc=whitedk bgc=0xFF000000 /> <!-- Desktop background color. -->
<clipboard>
<preview enabled=true size=80x25 />
<preview enabled=true size=80x25 bgc=bluedk fgc=whitelt>
<alpha=0x1f /> <!-- Preview alpha is applied only to the ansi/rich/html text type -->
<timeout=3s /> <!-- Preview hide timeout. Set it to zero to disable hiding. -->
</preview>
</clipboard>
<viewport coor=0,0 />
<mouse dblclick=500ms />
<tooltip timeout=500ms enabled=true />
<tooltip timeout=500ms enabled=true fgc=pureblack bgc=purewhite />
<glowfx=true /> <!-- Show glow effect around selected item. -->
<debug overlay=faux toggle="🐞" /> <!-- Display console debug info. -->
<regions enabled=faux /> <!-- Highlight UI objects boundaries. -->
Expand Down Expand Up @@ -264,7 +267,7 @@ R"==(
<match fx=selection bgc="0xFF007F00" fgc=whitelt /> <!-- Color of the selected text occurrences. Set fx to use cell::shaders: xlight | selection | contrast | invert | reverse -->
<selection>
<text fx=selection bgc=bluelt fgc=whitelt /> <!-- Highlighting of the selected text in plaintext mode. -->
<pass fx=selection bgc=bluelt fgc=whitelt />
<protected fx=selection bgc=bluelt fgc=whitelt />
<ansi fx=xlight/>
<rich fx=xlight/>
<html fx=xlight/>
Expand All @@ -287,7 +290,7 @@ R"==(
<slim=true />
</menu>
<selection>
<mode="text"/> <!-- text | ansi | rich | html | pass | none -->
<mode="text"/> <!-- text | ansi | rich | html | protected | none -->
</selection>
<hotkeys> <!-- not implemented -->
<key*/>
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/apps/term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace netxs::app::term
if (boss.client) boss.client->SIGNAL(tier::release, e2::data::text, "HTML-code");
boss.color(0xFFffff00, x3.bgc());
break;
case clip::password:
case clip::safetext:
if (boss.client) boss.client->SIGNAL(tier::release, e2::data::text, "Protected");
boss.color(0xFFffff00, x3.bgc());
break;
Expand Down
6 changes: 3 additions & 3 deletions src/netxs/console/ansi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace netxs::ansi
static const auto mimeansi = "text/xterm"sv;
static const auto mimehtml = "text/html"sv;
static const auto mimerich = "text/rtf"sv;
static const auto mimehide = "hidden/plain"sv;
static const auto mimesafe = "text/protected"sv;

struct clip
{
Expand All @@ -281,7 +281,7 @@ namespace netxs::ansi
ansitext,
richtext,
htmltext,
password, // mime: Sensitive textonly data.
safetext, // mime: Sensitive textonly data.
count,
};

Expand Down Expand Up @@ -643,7 +643,7 @@ namespace netxs::ansi
return add("\033]52;", kind == clip::htmltext ? mimehtml
: kind == clip::richtext ? mimerich
: kind == clip::ansitext ? mimeansi
: kind == clip::password ? mimehide
: kind == clip::safetext ? mimesafe
: mimetext, ";", utf::base64(utf8), C0_BEL);
}
auto& old_palette(si32 i, rgba const& c) // esc: Set color palette (Linux console).
Expand Down

0 comments on commit 56a6971

Please sign in to comment.