Implement WinTileGrid.

This commit is contained in:
TomAwezome 2021-12-30 22:22:37 -05:00
parent a879d1a330
commit ac3e0cee2d
6 changed files with 87 additions and 2 deletions

View file

@ -1,4 +1,8 @@
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
$IV,1$----12/30/21 22:08:17----$IV,0$
* Raised version number to 1.08.
* Implemented $LK+PU,"WinTileGrid",A="MN:WinTileGrid"$.
$IV,1$----12/30/21 17:12:01----$IV,0$
* Added $LK+PU,"LexDemo",A="FI:::/Demo/Lectures/LexDemo.ZC"$.

View file

@ -16,6 +16,7 @@ $FG,2$ <CTRL-F>$FG$ Find
$FG,2$ <ALT-M>$FG$ Max Window
$FG,2$ <ALT-H>$FG$ Horz Tile
$FG,2$ <ALT-V>$FG$ Vert Tile
$FG,2$ <ALT-G>$FG$ Grid Tile
$FG,2$ <CTRL-L>$FG$ Text Menu
$FG,2$ <F7>$FG$ God Word
$FG,2$ <SHIFT-F7>$FG$ God Passage

22
src/Home/Net/Tests/ICMPTest.ZC Executable file
View file

@ -0,0 +1,22 @@
U8 dst_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF};
U32 dst_ip = 0x01020304;
U0 ICMPTest()
{
U8 *data_payload = CAlloc(8);
*(data_payload(U64 *)) = EndianU64(0xDEADC0DEBEEFFADE);
ARPCachePut(dst_ip, dst_mac); // Force entry into ARP Cache so IPV4 can match it with IPV4AddressMACGet
while (TRUE)
{
ICMPReplySend(dst_ip, EndianU16(0xDEAD), EndianU16(0xBEEF), EndianU16(0xC0DE), data_payload, 8);
Sleep(300);
}
}
ICMPTest;

View file

@ -135,6 +135,13 @@ Bool MyPutKey(I64 ch, I64 sc)
AutoComplete;
return TRUE;
case 'g':
if (sc & SCF_KEY_DESC)
KeyDescSet("Cmd /WinTileGrid");
else
WinTileGrid;
return TRUE;
case 'h':
if (sc & SCF_KEY_DESC)
KeyDescSet("Cmd /WinTileHorz");

View file

@ -13,7 +13,7 @@ CTask *sys_winmgr_task,
U8 *rev_bits_table; //Table with U8 bits reversed
CDate local_time_offset;
F64 *pow10_I64,
sys_os_version = 1.07;
sys_os_version = 1.08;
CAutoCompleteDictGlobals acd;
CAutoCompleteGlobals ac;

View file

@ -495,7 +495,7 @@ public U0 WinTileHorz()
c = 1;
else if (c > 4)
c = 4;
vert_size = (TEXT_ROWS -1) / c;
vert_size = (TEXT_ROWS - 1) / c;
WinHorz(1 - no_border, TEXT_COLS - 2 + no_border, task);
WinVert((i & 3) * vert_size + 2 - no_border, (i & 3 + 1) * vert_size + no_border, task);
@ -557,6 +557,57 @@ public U0 WinTileVert()
POPFD
}
public U0 WinTileGrid()
{//Tile windows in a grid.
CTask *task, *last_task = Fs;
I64 count, c, i, j, horz_size, vert_size, no_border;
PUSHFD
CLI //TODO Multiprocessor safe
task = sys_winmgr_task;
count = 0;
do
{
if (!Bt(&task->win_inhibit, WIf_SELF_FOCUS))
count++;
task = task->last_task;
}
while (task != sys_winmgr_task);
task = sys_winmgr_task;
i = 0;
do
{
if (!Bt(&task->win_inhibit, WIf_SELF_FOCUS))
{
no_border = Bt(&task->display_flags, DISPLAYf_NO_BORDER);
c = 1 + i % 2;
vert_size = (TEXT_ROWS - 1) / c;
horz_size = TEXT_COLS / c;
j = i % 4;
if (j < 2) // top half of screen
WinVert(2 - no_border, TEXT_ROWS / 2 - 1 + no_border, task);
else // bottom half of screen
WinVert(TEXT_ROWS / 2 + 1 - no_border, TEXT_ROWS - 2 + no_border, task);
if (j % 2 == 0) // left half of screen
WinHorz(1 - no_border, TEXT_COLS / 2 - 1 + no_border, task);
else // right half of screen
WinHorz(TEXT_COLS / 2 + 1 - no_border, TEXT_COLS - 2 + no_border, task);
last_task = task;
i++;
}
task = task->last_task;
}
while (task != sys_winmgr_task);
POPFD
}
public U0 WinMax(CTask *task = NULL)
{//Maximize task's window
I64 no_border;