diff --git a/src/Demo/Graphics/WallPaperDolDoc.ZC b/src/Demo/Graphics/WallPaperDolDoc.ZC index 2fb122ed..66707edb 100755 --- a/src/Demo/Graphics/WallPaperDolDoc.ZC +++ b/src/Demo/Graphics/WallPaperDolDoc.ZC @@ -1,6 +1,42 @@ U0 (*old_wall_paper)(CTask *task); CDoc *wallpaper_doc; +RegDefault("Wallpapers/Current", "1;\n"); +RegExe("Wallpapers/Current"); + +U0 WallPaperSet(I8 direction) { + CDirEntry *tmpde1; + // read the current wallpaper index from the registry + I64 current = RegExe("Wallpapers/Current"); + I64 max = 0; + + // SysLog("Reading current wallpaper index from registry: %d\n", current); + + // search the wallpapers directory for .DD files + tmpde1 = FilesFind("~/Wallpapers/1024/*.DD", 1); + if (tmpde1) { + do { + max++; + tmpde1 = tmpde1->next; + } while (tmpde1); + } + + // move to the next/previous wallpaper + current += direction; + if (current < 1) + current = max; // wrap around to the end + if (current > max) + current = 1; // wrap around to the start + + // write the new current index back to the registry + RegWrite("Wallpapers/Current", "%d;\n", current); + + // SysLog("Current: %d\n", current); + // Change the wallpaper + Sys("WallPaperDolDocInit(\"~/Wallpapers/1024/%d.DD\");\n", current); +} + + U0 WallPaperDolDocInit(I64 filepath="::/Home/Wallpapers/Default.DD") { if (Fs != sys_task) diff --git a/src/Home/Net/Programs/Telnet/Telnet.ZC b/src/Home/Net/Programs/Telnet/Telnet.ZC index 89f44263..ff5b6286 100755 --- a/src/Home/Net/Programs/Telnet/Telnet.ZC +++ b/src/Home/Net/Programs/Telnet/Telnet.ZC @@ -705,6 +705,7 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) { term.window_width = 80; term.window_height = 25; term.doc = Fs->display_doc; + // IsEditableText(term.doc->cur_entry); term.waiting_for_input = TRUE; term.sock_ready = 0; I64 art_path = "::/Home/Net/Programs/Telnet/Art/TelnetSplash.ans"; diff --git a/src/Home/Net/Programs/Telnet/TelnetNegotiation.ZC b/src/Home/Net/Programs/Telnet/TelnetNegotiation.ZC index 46a1209c..3973b524 100755 --- a/src/Home/Net/Programs/Telnet/TelnetNegotiation.ZC +++ b/src/Home/Net/Programs/Telnet/TelnetNegotiation.ZC @@ -38,15 +38,15 @@ -U0 TelnetRequest(I64 sock, U8 option_code) -{ - U8 request[3]; - request[0] = IAC; - request[1] = WILL; - request[2] = option_code; +// U0 TelnetRequest(I64 sock, U8 option_code) +// { +// U8 request[3]; +// request[0] = IAC; +// request[1] = WILL; +// request[2] = option_code; - TCPSocketSend(sock, request, 3); -} +// TCPSocketSend(sock, request, 3); +// } U0 SendWindowSize(I64 sock, U16 cols, U16 rows) {