diff --git a/file_index.xslt b/file_index.xslt index 3598197..371095d 100644 --- a/file_index.xslt +++ b/file_index.xslt @@ -30,7 +30,7 @@ - + diff --git a/public/Wb/Home/Doc/AboutTempleOS.DD.HTML b/public/Wb/Home/Doc/AboutTempleOS.DD.HTML deleted file mode 100755 index 4058dba..0000000 --- a/public/Wb/Home/Doc/AboutTempleOS.DD.HTML +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - -
-                                    TempleOS
-
-
-Websites:
-www.templeos.org
-
-Owner/President:
-Terry A. Davis
-
-
- -8144 Sickle Lane -Las Vegas, NV 89128 -(702)254-4223 - -tdavis@templeos.org - - -About Me: - -I was a National Merit Scholar with a 1440 SAT at Arizona State University. I -have a bachelor's in Computer System Engineering from ASU, basically, embedded -systems, and a master's in Electrical Engineering from ASU, control systems. I -worked as a software, hardware and mechanical engineer at Ticketmaster from -1990-1996. - -I designed a 3 axis stepper-motor-driven milling machine 1996-1997 with a -CAD/CAM package for a company I started called Home Automation and Robotic -Equipment. - -
- -I worked for a company named Xytec Corp. 1997-1999. We made FPGA-based image -processing equipment. I wrote SimStructure from 2000-2001 for H.A.R.E. I -worked as head software/electrical engineer for a company called Graphic -Technologies, 2001-2002, making replacement chips for toner printer cartridges -so they could be refilled. - -Credits: -See ::/Doc/Credits.DD. - -
- diff --git a/public/Wb/Home/Doc/Asm.DD.HTML b/public/Wb/Home/Doc/Asm.DD.HTML deleted file mode 100755 index 7d34c33..0000000 --- a/public/Wb/Home/Doc/Asm.DD.HTML +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - -
-                                   Assembler
-
-See ::/Compiler/OpCodes.DD for opcodes.  They're not standard.  Some invalid 
-insts are not flagged and some valid insts are not implemented. 16-bit asm 
-support is limited.
-
-Here are example inst formats:
-        ADD     RAX,I64 FS:DISP[RSI+RDI*8]
-        ADD     RAX,I64 [DISP]
-
-$ Current compiler output pos (inst ptr).  Even works in HolyC expressions.
-
-$ works in classes.
-  class MyFun
-  {
-    $=-16;
-    I64 local1;
-    I64 local2;
-    $=$+256;
-    I64 crazy;
-  };
-
-LABEL::
-  Defines an exported glbl label.
-
-LABEL:
-  Defines an non-exported glbl label.
-
-@@LABEL:
-  Defines a local label with scope valid between two global labels.
-
-DU8, DU16, DU32, DU64
-  Define BYTE, WORD, DWORD or QWORD. Can be used with DUP() and ASCII strings.  
-For your convenience, the ASCII strings do not have terminating zeros.  Define 
-cmds must end with a semicolon.
-
-USE16, USE32, USE64
-
-IMPORT sym1name, sym2name;
-
-LIST, NOLIST
-
-ALIGN num, fill_byte
-  Align to num boundary and fill with fill_byte.
-
-ORG num
-  Set code addr for JIT or set module Load() addr -- has 16-byte CBinFile header 
-and patch table trailing.
-
-BINFILE "FileName.BIN";
-
-See Assembly Language, ::/Demo/Asm/AsmAndC1.HC, ::/Demo/Asm/AsmAndC2.HC and 
-::/Demo/Asm/AsmAndC3.HC.
-
- diff --git a/public/Wb/Home/Doc/AutoComplete.DD.HTML b/public/Wb/Home/Doc/AutoComplete.DD.HTML deleted file mode 100755 index c219a94..0000000 --- a/public/Wb/Home/Doc/AutoComplete.DD.HTML +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - -
-AutoComplete is the LTGRAY window on the right of the scrn.  ACInit() collects 
-words from all text files in subdirectories.  Normally, the call to ACInit() is 
-in HomeSys.HC.  It provides auto-complete for typing, jump-to-code and 
-jump-to-dictionary functionality.
-
-<ALT-SHIFT-A>   Closes the LTGRAY AutoComplete window.
-<ALT-a>         Opens the LTGRAY AutoComplete window.
-
-<CTRL-SHIFT-F1> Jumps to the source code for 1st symbol in the window.
-<CTRL-SHIFT-F2> Jumps to the source code for 2nd symbol in the window.
-<CTRL-SHIFT-Fn> Jumps to the source code for n-th symbol in the window.
-<CTRL-F1>       Autocompletes the 1st symbol in the window.
-<CTRL-F2>       Autocompletes the 2nd symbol in the window.
-<CTRL-Fn>       Autocompletes the n-th symbol in the window.
-<CTRL-SHIFT-1>  Jumps to the dictionary for 1st symbol in the window.
-<CTRL-SHIFT-2>  Jumps to the dictionary for 2nd symbol in the window.
-<CTRL-SHIFT-n>  Jumps to the dictionary for n-th symbol in the window.
-<CTRL-1>        Autocompletes the 1st dictionary word in the window.
-<CTRL-2>        Autocompletes the 2nd dictionary word in the window.
-<CTRL-n>        Autocompletes the n-th dictionary word in the window.
-
-If you have the raw Project Gutenberg dictionary file, you can generate the 
-TempleOS processed dictionary files with the stand-alone program 
-::/Adam/AutoComplete/ACDictGen.HC.
-
- diff --git a/public/Wb/Home/Doc/Bit.DD.HTML b/public/Wb/Home/Doc/Bit.DD.HTML deleted file mode 100755 index 8b95802..0000000 --- a/public/Wb/Home/Doc/Bit.DD.HTML +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - -
-
-These take a pointer to a bit field.
-Bt:     Bit Test
-Bts:    Bit Test and Set to one
-Btr:    Bit Test and Rst to zero
-Btc:    Bit Test and Compliment (toggle)
-BEqu:   Set bit to value.
-
-Bit operations are "atomic", no interrupt between the reading and writing the 
-bit, important when multitasking.  For multicore use "locked" forms.
-
-These don't take a pointer, but the actual field.
-Bsf:    Bit Scan Fwd (Pos of first low one bit or -1)
-Bsr:    Bit Scan Rev (Pos of first high one bit or -1)
-BCnt:   Bit Cnt (Cnt of set bits)
-
- diff --git a/public/Wb/Home/Doc/BlkChain.DD.HTML b/public/Wb/Home/Doc/BlkChain.DD.HTML deleted file mode 100755 index f56dbae..0000000 --- a/public/Wb/Home/Doc/BlkChain.DD.HTML +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - -
-                                  Block Chain
-
-There was a technique on the Commodore 64 where disk blocks were chained 
-together with a block pointer at the end of each block.  This is far inferior to 
-having a file allocation table, as in FAT32.
-
-The RedSea file system does not allow files to grow because it only has an 
-allocation bitmap and not a FAT table.  This "flaw" is by design.  I am 
-intentionally crippling this operating system, making it a toy with the wisdom 
-that this will prevent commercialization and corruption.  The toy spirit of the 
-operating system will be preserved going into the future.  The vision for this 
-operating system was a modern Commodore 64, which was a fun toy.
-
-Doing whole file operations is the TempleOS way of doing thinks.  It is the 
-simplest and, ironically, the fastest.  It is obnoxious in the characteristic 
-way that TempleOS is obnoxious, flaunting massive modern resources in a way that 
-makes old programmers protest.
-
-Doing whole file operations will sabotage efforts to change the 640x480 
-resolution and violate the ban on multimedia.  When doing large, whole-file 
-operations, immediately memory fragmentation is a serious problem, but not so 
-for allocations in the range under a Meg (with occasional larger ones).
-
-The file compression scheme in TempleOS only works on whole file operations and 
-the DolDoc format cannot have text tacked onto the end, since binary data is at 
-the end.
-
-I don't want to spoil fun, so of course I offer a way to get awesome performance 
-that is, ironically, superior.  FBlkRead() and FBlkWrite() allow you to read a 
-block offset from the start of a file.  Since files are all contiguous, this is 
-incredibly efficient.  You just have to declare the desired file size when you 
-create it with FOpen() and cannot change it.  See ::/Demo/Dsk/DataBase.HC.
-
-If you like, you are encouraged to to do raw BlkRead() and BlkWrite() directly 
-on a drive.  Just get a pointer to a CDrv with Let2Drv() and you are on your 
-way!  Your computer is supposed to be a fun toy!  You can make an entire 
-partition used for a database, or invent a file system.
-
-On the whole, the RedSea file system with its whole-file-only limitation bring 
-beautiful harmony.  It beautifully captures the spirit of TempleOS with 
-simplicity and, ironic speed, since contiguous is fastest.
-
-
-* "Commodore 64" is a trademark owned by Polabe Holding NV.
-
- diff --git a/public/Wb/Home/Doc/Boot.DD.HTML b/public/Wb/Home/Doc/Boot.DD.HTML deleted file mode 100755 index 84569c2..0000000 --- a/public/Wb/Home/Doc/Boot.DD.HTML +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - -
-                                  Booting A PC
-
-TempleOS only supports traditional BIOS booting, not the newer technique, UEFI.  
-This document describes BIOS booting.
-
-When you turn-on (power-up) a computer or you do a hardware reset, the computer 
-starts executing the BIOS.  Sometimes, you must change the BIOS boot order to 
-boot the device you want.
-
-The BIOS loads a boot sector from CD/DVD, hard disk or whatever.  The boot 
-sector runs in 16-bit real mode and often loads-in a second file that's bigger 
-if it can't be done by just one sector.  It's a safe bet that boot sectors are 
-hand-coded assembly language.  Most boot sectors use the BIOS to load-in the 
-next stage.
-
-Not only do boot sectors have a size limit, 512 bytes or 2048 bytes for CD/DVD, 
-the files they load have to fit within 640K because they run in 16-bit mode.  
-This means they usually can't just load the whole operating system and start it 
-running.  Some boot loaders, like Grub, have a capability of switching modes 
-before handing-off control to the operating system.  The operating system must 
-load the rest of itself.  With TempleOS, the ::/Kernel.BIN.C file is loaded by 
-the boot sector.  I try to put a minimum in the Kernel Module, so that it will 
-always fit in 640K.  When Kernel.BIN runs, it switches to 32-bit mode, then, to 
-64-bit mode allowing access to more memory.  Then, it loads in the rest of 
-TempleOS by executing ::/StartOS.HC.
-
-All the boot related code for TempleOS is in the /Adam/Opt/Boot directory.
-
-BootDVD.HC      CD/DVD boot sector.
-BootDVDIns.HC   Prep for CD/DVD install by creating /0000Boot/0000Kernel.BIN.C.
-If you are curious about CD/DVDs, see DskISORedSea.HC.  To make a custom 
-bootable CD/DVD, look here Bootable CD.
-
-BootMHD.HC      Stage 1 Master HD boot loader.
-BootMHD2.HC     Stage 2 Master HD boot loader.
-BootMHDIns.HC   Installs Master HD boot loader.
-BootMHD goes on block zero.  /0000Boot/BootMHD2.BIN.C is stored as a file in a 
-partition, risky and unusual, since most master boot loaders place stage 2 in a 
-gap that's not in any partition.  BootMHD2 displays a menu and boots a 
-partition.
-
-BootHD.HC       HD partition boot record.
-BootHDIns.HC    Installs HD partition boot record.
-BootHD is the boot record for a TempleOS partition.  Each partition has its own 
-partition boot record, the first block of the partition.
-
-My boot records don't access directories because that would make them too big 
-for one block and would make them depend on a file system layout.  Instead, they 
-get patched with the LBA, logical block addresses, to load files.  To update 
-with a new TempleOS kernel, you must create a ::/Kernel.BIN.C binary file and 
-patch the boot loader so it knows the LBA blocks to load.  Therefore, you 
-usually recompile the kernel and update the boot sector at the same time with  
-BootHDIns().  BootMHDIns() will install a master boot loader.
-
-With TempleOS, ::/Kernel.BIN.C loads ::/Compiler/Compiler.BIN so it can work 
-with source code from then on.  It compiles start-up scripts beginning with 
-::/StartOS.HC into the Adam Task's memory including the code in the /Adam and /H
-ome directories.
-
-It is possible to do a fast reboot without doing a hardware reset.  You might do 
-this when working on ::/Kernel.BIN.C or your start-up scripts when you want to 
-compile them effect.  See BootRAM().
-
-
-/* Graphics Not Rendered in HTML */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- diff --git a/public/Wb/Home/Doc/CharOverview.DD.HTML b/public/Wb/Home/Doc/CharOverview.DD.HTML deleted file mode 100755 index 095a0a9..0000000 --- a/public/Wb/Home/Doc/CharOverview.DD.HTML +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - -
-                                 Char Overview
-
-A Character is a single byte holding an ASCII code for a letter, num or sym.  
-The TempleOS term is a U8.
-
-Standard ASCII values range from 0 to 127.  Values below 32 are ctrl key's.  So, 
-an ASCII #3 is a <CTRL-c>.  TempleOS uses a few nonstandard values below 32.  
-See Char Definitions.
-
-ASCII #5  is the cursor location in a saved file.
-ASCII #28 is <SHIFT-ESC>.
-ASCII #31 is a <SHIFT-SPACE>.
-
-TempleOS ASCII is 8-bit instead of 7-bit, so it also uses the range from 
-128-255.  Press <CTRL-ALT-a> to see shapes for 128-255.  Technically, <CTRL-ALT-
-a> are scrn codes.
-
-A Key is typically specified with a scan code.  TempleOS scan codes contain the 
-key value in the lowest U8, and flags in the upper 3 bytes.  See 
-Scan Code Flags and Scan Codes.
-
-TempleOS stores scan codes in 8 bytes.
-  Byte 0   is the code.  NumPad keys, SHIFT, ALT, CTRL and GUI keys combined.
-  Byte 1-3 are flags
-
-The upper 4-bytes are copied from lower 4-bytes.
-  Byte 4   is the code.  Left, Right and NumPad keys distinct.
-  Byte 5-7 are flags
-
-Run the program ::/Demo/MsgLoop.HC to examine scan code.  Press <CTRL-SHIFT-l> 
-and "Insert ASCII/ScanCode".
-
-See Key Allocations and CKbdStateGlbls.
-
-A String is a bunch of ASCII characters terminated with a zero.
-
- diff --git a/public/Wb/Home/Doc/Charter.DD.HTML b/public/Wb/Home/Doc/Charter.DD.HTML deleted file mode 100755 index b802d17..0000000 --- a/public/Wb/Home/Doc/Charter.DD.HTML +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - -
-                                TempleOS Charter
-
-Why did they make Solomon's Temple?  It was a direction to look, to focus on, a 
-special place for meditation, to do offerings, a community center, a home to 
-God's beauty, that encouraged love of God.  People cherished God's temple, 
-beautifying it with gold and all fine things to show love of God, as great 
-cathedrals were decorated with astounding, awe-striking intricate art and 
-gargoyles, incredible devotion to God with hours of effort, toiling and 
-slaving-away for the glory of God, for families with children to see 
-stained-glass windows and tomes with ridiculously elaborate calligraphy to show 
-love of God, from a people who did little else but show love toward God, lived 
-in dire conditions by today's standards, yet with so much difficulty 
-scraping-by, found the time to devote even all free-time to God!
-
-
-1 Kings 6:21 (King James)
-
-     6:21 So Solomon overlaid the house within with pure gold: and he made
-     a partition by the chains of gold before the oracle; and he overlaid
-     it with gold.
-     
-     6:22 And the whole house he overlaid with gold, until he had finished
-     all the house: also the whole altar that was by the oracle he overlaid
-     with gold.
-     
-     6:23 And within the oracle he made two cherubims of olive tree, each
-     ten cubits high.
-
-
-* TempleOS is God's official temple.  Just like Solomon's temple, this is a 
-community focal point where offerings are made and God's oracle is consulted.
-
-* God said 640x480 16 color graphics is a covenant like circumcision.  Children 
-will do offerings.  Think of 16 colors like the Simpson's cartoons.  In the 
-future, even if one GPU were universal, we would still keep 640x480 16 color and 
-not use GPU acceleration.  Graphics operations should be transparent, not hidden 
-in a GPU.
-
-* God said to use a single-voice 8-bit signed MIDI-like sample for sound.  God 
-does not want death screams, perhaps, because God has PTSD or soldiers have 
-PTSD.  (Imagine wounded on battlefields.) 
-
-* God said His temple must be perfect.  We don't think twice about breaking 
-compatibility.  God said we do a seven year release cycle.  I say the PC 
-hardware follows a 49 year, jubilee cycle, like broadcast TV upgrades.
-
-* The vision is the same usage model and niche as the Commodore 64 -- a 
-non-networked, simple machine where programming was the goal, not just a means 
-to an end.  However, it is modern, 64-bit and multi-cored.  It is special 
-purpose, not general purpose, so some things it will not do.  Also, it's a 
-kayak, not a Titanic. The priority is user developers, not 3rd party developers.
-
-* We do not put any hooks for future changes.  "Perfect" means we always act as 
-though it is final, for all time.  Microsoft allowed the Windows BMP file format 
-to adapt to the future and it became grotesque.
-
-* Low line count is the highest good, so it is easy to learn the whole thing.  
-Users should see the light at the end of the tunnel.  One file system, for 
-example, is better than many file systems.
-
-* There is a limit of 100,000 lines of code for all time, not including 
-applications and demos.  Code comments count, however.  Currently, there are 
-80,849 lines of code.  3rd party libraries are banned because they circumvent 
-the intent of this limit.  The vision is a Commodore 64 ROM -- a fixed core API 
-that is the only dependency of applications.  Dependency on components and 
-libraries creates a hell that is no longer blissful.
-
-* The metric for resolving all TempleOS code governance issues is how fast the 
-compiler compiles itself and the kernel with BootHDIns().  The HolyC language 
-should be changed to optimize this metric, as I did when I changed type casting 
-from prefix standard C to postfix HolyC, but we need a rule to prevent 
-degenerating into a brainfuck language.
- 
-* Minimal abstraction is a goal.  Sheep are fools.  They always respect a design 
-that is more complicated than another.  Any genius can make it complicated.  
-Like in physics, it takes a supra-genius to make it simple.
-
-* It is for one platformc -- x86_64 desktop PC compatibles, more like 
-super-computers than battery efficient wimpy mobiles.
-
-* All hardware access will be done through x86 IN/OUT instructions, not PCI 
-drivers.  A frame buffer for VGA is an exception.
-
-* One driver for each class of device.  Limited exceptions are allowed.  With 
-divergent device capabilities, it is a nightmare for user applications and what 
-is gained?  A three buuton mouse is like a leg you cannot put weight on.
-
-* Ring-0-only.  Everything runs in kernel mode, including user applications.
-
-* Full access to everything.  All memory, I/O ports, instructions, and similar 
-things must never be off limits.  All functions, variables and class members 
-will be accessible.  There are no C++ public/private protections and all 
-functions, even secondary ones in the kernel, can be called.
-
-* Single-address-map as though paging is not used.  Long mode requires paging, 
-however, so the nearest thing is keeping all memory identity-mapped.
-
-* No networking, so malware is not an issue.
-
-* No encryption or passwords.  Files are compressed, not encrypted.
-
-* Free and public domain.
-
-* 100% open source with all source included.
-
-* Documents are not for printing.  They're dynamic, intended for the scrn.
-
-* Just one 8x8 fixed-width font.  No Unicode, just Extended ASCII.  Other 
-countries can make their own versions.  The versions should be just for one 
-language and platform.
-
-* No multimedia.  Sounds and images will be primarily calculated in real-time, 
-not fetched from storage.
-
-
-* "Commodore 64" is a trademark owned by Polabe Holding NV.
-* "The Simpsons" is a trademark owned by Fox.
-* "Windows" is a trademark owned by MicroSoft Corp.
-
-
-
-                              Possible Amendments
-
-The compiler's parser makes RISC code which it optimizes to CISC.  I discovered 
-this does not matter because the CPU converts it back to RISC and schedules it, 
-internally.  A TempleOS zealot with more zeal than I, might say we should save 
-lines-of-code by removing the CISC optimizing.
-
- diff --git a/public/Wb/Home/Doc/CmdLineOverview.DD.HTML b/public/Wb/Home/Doc/CmdLineOverview.DD.HTML deleted file mode 100755 index 05fd4a7..0000000 --- a/public/Wb/Home/Doc/CmdLineOverview.DD.HTML +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - -
-                             Command Line Overview
-
-The cmd line feeds into the HolyC compiler line-by-line as you type.  A stmt 
-outside a function executes immediately.  Remember to add a semicolon.
-
-Look-up the function headers with AutoComplete by hitting <CTRL-SHIFT-F1> after 
-typing the first few letters.
-
-Click Here to see the directory cmd header.  It accepts default args from C++.
-
->Dir("*.DD.Z");
-
-If you don't have args, you don't need parenthesis.
-
->Dir;
-
-Directories are referenced with / not \.  There is a current directory, but not 
-a path.  To run a program, you typically #include it.  There are several 
-shortcuts for #includeing files.  Right-click or hit <ENTER> on a directory 
-listing or press <F5> while editing.
-
->Ed("NewFile.HC.Z");    Invokes the editor. See Doc Link Type.
-
-Most filenames end in .Z because they are stored compressed.
-
-Drives are specified with a letter.  The boot drive is specified with a ':'.  
-The home dir drive is specified with a '~'.
-
->Drv('B');      B drive
-
-The drive can be specified in a Cd() command as in:
-
->Cd("B:/Tmp");  B drive
->Cd("::/Demo"); Boot drive
-
-The home directory is specified with a '~'.
-
->Cd("~/Psalmody");      See ::/Home dir.
-
-If a file is not found, .Z is added or removed and a search is done, again.  If 
-a file is still not found, all parent directories are searched.
-
-You can place macros in your PersonalMenu for Cd() commands.  <CTRL-m> to access 
-your menu.
-
->Find("needle","/Demo/*.HC.Z;*.DD.Z;"); See File Utils.
-
-Cmd Line Routines
-
-Take Tour
-
- diff --git a/public/Wb/Home/Doc/Comm.HC.HTML b/public/Wb/Home/Doc/Comm.HC.HTML deleted file mode 100755 index 72312db..0000000 --- a/public/Wb/Home/Doc/Comm.HC.HTML +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - -
-/* RS232 serial ports no longer exist.
-Be sure to Adam Include this by placing
-it in your start-up scripts.
-*/
-
-#help_index "Comm"
-
-#define UART_THR                0
-#define UART_RDR                0
-#define UART_BRDL               0
-#define UART_IER                1
-#define UART_BRDH               1
-#define UART_IIR                2
-#define UART_LCR                3
-#define UART_MCR                4
-#define UART_LSR                5
-#define UART_MSR                6
-
-#define COMf_ENABLED    0
-class CComm
-{
-  I64   base,
-        flags;
-  CFifoU8 *RX_fifo;
-  CFifoU8 *TX_fifo;
-} comm_ports[5];
-
-U0 CommHndlr(I64 port)
-{
-  CComm *c=&comm_ports[port];
-  I64 b=0,stat;
-  if (Bt(&c->flags,COMf_ENABLED)) {
-    stat=InU8(c->base+UART_IIR);
-    if (stat & 4)       //RX
-      FifoU8Ins(c->RX_fifo,InU8(c->base+UART_RDR));
-    if (stat & 2) {     //TX
-      if (FifoU8Rem(c->TX_fifo,&b))
-        OutU8(c->base+UART_THR,b);
-      else
-        OutU8(c->base+UART_IER,1); //RX but no THR empty
-    }
-  }
-}
-
-interrupt U0 IRQComm3()
-{
-  CommHndlr(2);
-  CommHndlr(4);
-  OutU8(0x20,0x20);
-}
-
-interrupt U0 IRQComm4()
-{
-  CommHndlr(1);
-  CommHndlr(3);
-  OutU8(0x20,0x20);
-}
-
-U0 CommInit()
-{
-  MemSet(&comm_ports,0,sizeof(comm_ports));
-  comm_ports[1].base=0x3F8;
-  comm_ports[2].base=0x2F8;
-  comm_ports[3].base=0x3E8;
-  comm_ports[4].base=0x2E8;
-  IntEntrySet(0x23,&IRQComm3);
-  IntEntrySet(0x24,&IRQComm4);
-}
-CommInit;
-
-public CComm *CommInit8n1(I64 port,I64 baud)
-{
-  CComm *c=&comm_ports[port];
-
-  PUSHFD
-  CLI
-  if (LBts(&c->flags,COMf_ENABLED)) {
-    FifoU8Del(c->RX_fifo);
-    FifoU8Del(c->TX_fifo);
-  }
-  c->RX_fifo=FifoU8New(256);
-  c->TX_fifo=FifoU8New(256);
-  OutU8(c->base+UART_LCR,0);    //Set for IER
-  OutU8(c->base+UART_IER,0);    //Disable all IRQ
-  OutU8(c->base+UART_LCR,0x80); //Enable baud rate control
-  OutU8(c->base+UART_BRDL,(0x180/(baud/300)) & 0xFF);   //LSB
-  OutU8(c->base+UART_BRDH,(0x180/(baud/300)) / 256);    //MSB
-  OutU8(c->base+UART_LCR,3);    //8-none-1
-
-  InU8(c->base+UART_RDR);       //read garbage
-  InU8(c->base+UART_LSR);
-
-  OutU8(c->base+UART_MCR,4);
-  OutU8(c->base+UART_IER,0);    //Disable all IRQ
-  OutU8(c->base+UART_MCR,0xA);  //out2 and rts
-  OutU8(0x21,InU8(0x21) & (0xFF-0x18)); //Enable 8259 IRQ 3 & 4
-  OutU8(c->base+UART_IER,1);    //RX but no THR empty
-  POPFD
-
-  return c;
-}
-
-public U0 CommPutChar(I64 port,U8 b)
-{
-  CComm *c=&comm_ports[port];
-  PUSHFD
-  CLI
-  FifoU8Ins(c->TX_fifo,b);
-  OutU8(c->base+UART_IER,3);    //RX and THR empty
-  POPFD
-  Sleep(10); //!!! Remove this line!!!  Linux echo_socket is too slow.
-}
-
-U0 CommPutS(I64 port,U8 *st)
-{
-  I64 b;
-  while (b=*st++)
-    CommPutChar(port,b);
-}
-
-public U0 CommPutBlk(I64 port,U8 *buf,I64 cnt)
-{
-  while (cnt--)
-    CommPutChar(port,*buf++);
-}
-
-public U0 CommPrint(I64 port,U8 *fmt,...)
-{
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  CommPutS(port,buf);
-  Free(buf);
-}
-
- diff --git a/public/Wb/Home/Doc/CompilerOverview.DD.HTML b/public/Wb/Home/Doc/CompilerOverview.DD.HTML deleted file mode 100755 index 0f4c387..0000000 --- a/public/Wb/Home/Doc/CompilerOverview.DD.HTML +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - -
-                                 Compiler Index
-
-::/Doc/Asm.DD
-
-::/Doc/Directives.DD
-
-::/Doc/Options.DD
-
-::/Doc/PreProcessor.DD
-
-::/Doc/ScopingLinkage.DD
-
-See Hello World.
-
- diff --git a/public/Wb/Home/Doc/Credits.DD.HTML b/public/Wb/Home/Doc/Credits.DD.HTML deleted file mode 100755 index 0ee38aa..0000000 --- a/public/Wb/Home/Doc/Credits.DD.HTML +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - -
-                                    Credits
-
-I, Terry A. Davis, wrote all of TempleOS over the past 20.6 years (full-time).  
-It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, 
-libraries, tools, modules or anything from other sources.  Otherwise, you run it 
-in a virtual machine, like VMware, QEMU or VirtualBox.  It is independent and 
-stands alone.  It has no networking, so it certainly doesn't call home.  100% of 
-the src code is including on all distro's, from the kernel to the compiler to 
-the boot loaders!  It is public domain, not GPL.
-
-*) ::/Kernel/FontStd.HC, is taken from FreeDOS.  It's public domain.
-
-*) ::/Kernel/FontCyrillic.HC, is taken from OrientDisplay without permission.
-
-*) ATA Reg and Cmd Definitions are originally from Linux.  Later, I got the 
-spec.
-
-*) The heap algorithm, ::/Kernel/Mem/MAllocFree.HC, is adapted from one I saw at 
-Ticketmaster when I worked on their VAX operating system.
-
-*) The LZW compression algorithm, ::/Kernel/Compress.HC, came from a magazine 
-and I implemented it when I worked for Ticketmaster.
-
-*) The adaptive-step-size-Runge-Kutta algorithm, ::/Adam/AMathODE.HC, is adapted 
-from the book, Numeric Recipies in C.
-
-*) The mountain in some games is from http://www.public-domain-photos.com.  The 
-wolf in BlackDiamond is also from there.  I took watermarked photos and 
-converted to 16 color.
-
-*) The FAT32 file system is owned by MicroSoft.
-
-*) A few features were inspired by MATLAB, such as ans in expressions at the 
-command-line.  There is a lot of MSDOS , Windows, VAXTMOS (VAX Ticketmaster 
-O.S.) and Unix inspiration, too, such as drive letters, command names, etc.
-
-*) I included PCIDevice Lst File.
-
-*) Thanks to whoever wrote this CppHtml.HC.Z.  I'm a novice on web stuff and you 
-helped me with html.  See ::/Demo/ToHtmlToTXTDemo/ToHtml.HC.
-
-*) I looked at bootable CD boot sects, but didn't learn anything, finding it 
-easier to make my own.
-
-*) I think I got my original PC speaker code from Borland C.
-
-*) I found PS/2 keyboard and mouse code on the net and documentation.  My code 
-is very different.  I found VGA reg info on the net.
-
-*) Thanks to http://www.osdev.org for a couple tips.
-
-*) God told me to stick with 640x480 16 color and single-voice 8-bit signed 
-MIDI-like sample for sound.   He kept me from zombie-walking into making child 
-windows like Windows.  Instead, I made one window per task with no child 
-windows.  He also guided my progress, very obviously.
-
-*) I got Webster's Dictionary and The King James Bible from Project Gutenberg.
-
-*) John Carmack inspired me to use "Clamp" as a name instead of "Limit".  He 
-inspired me to use "needle" and "haystack" as names.  He inspired me to simplify 
-my Frames-Per-Second code.
-
-*) Bill Gates inspired me to add comments to my Help & Index.
-
-*) I hired an artist, Cody Rigby, for $3,000 worth of pixel art.
-
-*) Erik van der Karbargenbok wrote /Downloads shell scripts -- gw.
-
-*) The random number generator is from Donald Knuth in the wikipedia entry for 
-Linear_congruential_generator.
-
-
-* "MSDOS", "Windows", "MovieMaker", "MS Paint" and "FAT32" are trademarks owned 
-by MicroSoft Corp.
-* "SiteBuilder" is a trademark owned by Yahoo! Inc.
-* "MagicISO" is a trademark owned by MagicISO Corp.
-* "MATLAB" is a trademark owned by The Math Works, Inc.
-* "FreeDOS" is a trademark owned by Jim Hall.
-* "QEMU" is a trademark owned by Fabrice Bellard.
-* "VAX" is a trademark owned by Digital Equipment Corp.
-* "Linux" is a trademark owned by Linus Torvalds.
-* "VAXTMOS" is a trademark owned by Ticketmaster.
-
- diff --git a/public/Wb/Home/Doc/Ctrls.DD.HTML b/public/Wb/Home/Doc/Ctrls.DD.HTML deleted file mode 100755 index a6691b8..0000000 --- a/public/Wb/Home/Doc/Ctrls.DD.HTML +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -
-To create a TempleOS graphic ctrl, you define callback functions and insert a 
-CCtrl structure in the CTask queue.  See ::/Demo/Graphics/Slider.HC, 
-::/Demo/Graphics/ScrollBars.HC and TermBttnNew.  There is a template-code ctrl 
-generator, if you press <CTRL-SHIFT-L>.
-
- diff --git a/public/Wb/Home/Doc/Customize.DD.HTML b/public/Wb/Home/Doc/Customize.DD.HTML deleted file mode 100755 index d00bed8..0000000 --- a/public/Wb/Home/Doc/Customize.DD.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-
-* You can adjust the mouse movement rate by setting global vars in your start-up 
-file.  See mouse scale.
-
-* You can set your local time zone by setting the local_time_offset global var 
-in a start-up file.  It's units are CDATE_FREQ.  See local time.
-
-* Get rid of this msg here.
-
- diff --git a/public/Wb/Home/Doc/CutCorners.DD.HTML b/public/Wb/Home/Doc/CutCorners.DD.HTML deleted file mode 100755 index f1f9a9e..0000000 --- a/public/Wb/Home/Doc/CutCorners.DD.HTML +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - -
-                                  Cut Corners
-
-There are a few places where I cut corners in the interest of not junking-up 
-code.  This is part of the TempleOS mentality.  I try not to let stupid legacy 
-compatibility issues enter and junk-up TempleOS.
-
-* I made my type-casting operator post-fix because it makes the compiler way 
-cleaner.
-
-* TempleOS does not figure-out FAT32 short name alias numbers.  FAT32DirNew().  
-It can cause hard drive corruption, so I might have to do it.  It would really 
-take a lot of junky code for this hatefully, detestable, legacy issue.  "Please 
-don't make me ruin my beautiful shiny-new TempleOS with that!"  I am also not 
-enthused about FAT32 because it is in patent limbo.  FAT32 might get removed 
-from TempleOS.  There is the RedSea  64-bit file system that works perfectly 
-well.  FAT32 is useful, however, because it assists in transferring between dual 
-booted operating systems.
-
-* I changed the asm opcodes names to remove the ambiguity between insts with 
-different numbers of arguments, making my assembler simpler and I did minimal 
-16-bit asm support, since 64-bit is what you should be using, unless you're 
-doing a boot loader.
-
-* There are no user-controlled file-sharing locks.  However, the drive and file 
-system have locks and concurrent operations should be fine. 
-
-* A hidden window is never refreshed.  Certain tasks are never done, therefore.  
-During refresh, the entry count limit of the document buffer is, normally, 
-checked and enforced.  If you print to the command-line in a task whose window 
-is covered, no limit on buffer exists and it will alloc memory for the document 
-buffer until the system runs out of memory and crashes.
-
-* Even if a local function variable is declared less than 64 bits, the compiler 
-does calculations with 64-bit.
-
-* Print() uses StrPrintJoin().  You cannot use vastly over-sized fields for %f.
-
-* GrEllipse3() is broken on transformations.
- 
- diff --git a/public/Wb/Home/Doc/D3.DD.HTML b/public/Wb/Home/Doc/D3.DD.HTML deleted file mode 100755 index 6016b8b..0000000 --- a/public/Wb/Home/Doc/D3.DD.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-TempleOS has a class for 3 dimensional points consisting of F64s.  HolyC is not 
-C++ -- it does not support passing or returning values from functions which are 
-not 64-bits, therefore, it can't be implemented with operator overloading.  
-Making all function args and returns 64-bit is a core prinicple of TempleOS.
-
-As a courtesy, most of the CD3 functions return the addr of the destination 
-vect, so you can nestle calls.  They do not alloc new space for the destination 
-vect.
-
- diff --git a/public/Wb/Home/Doc/Date.DD.HTML b/public/Wb/Home/Doc/Date.DD.HTML deleted file mode 100755 index 4e1c23d..0000000 --- a/public/Wb/Home/Doc/Date.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-Dates are 32-bit signed ints representing the number of days since the birth of 
-Christ.  Negative values represent B.C.E. dates.
-
- diff --git a/public/Wb/Home/Doc/DbgFunSeg.DD.HTML b/public/Wb/Home/Doc/DbgFunSeg.DD.HTML deleted file mode 100755 index 943a43c..0000000 --- a/public/Wb/Home/Doc/DbgFunSeg.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-Use %p to print a pointer with FunSeg+Offset or use %P to print a link to a 
-FunSeg+Offset.
- 
- diff --git a/public/Wb/Home/Doc/DbgOverview.DD.HTML b/public/Wb/Home/Doc/DbgOverview.DD.HTML deleted file mode 100755 index ad8231f..0000000 --- a/public/Wb/Home/Doc/DbgOverview.DD.HTML +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - -
-                               Debugging Overview
-
-* You can enter the debugger with Dbg() or <CTRL-ALT-d>.  You might enter the 
-debugger through a fault.  Enter G() or G2() to continue execution.  Place a 
-call to Dbg() in your code at fatal error points to enter the debugger.  If you 
-see a stk dump, record the label+offset and unassemble, U(). U(_RIP); 
-
-* U(&FunName+offset) to unassemble mem or Uf("FunName") to unassemble a 
-function. U(_RIP-16);
-
-* While debugging, you specify addresses of assembly routines with just the 
-label, as in _MALLOC+0x20.  You specify HolyC function names with & before 
-functions as in &Print+0x10.
-
-* I use progress1-progress4 for debugging because they show on the wallpaper.  
-They're just global int vars.
-
-* You can use AdamLog() to send text to the Adam Task window.  It works like 
-Print().  I never use that.  Instead, I use RawPrint().
-
-* D(), DocD(), RawD() to do 16 column hex dump mem with numbering from zero.  
-With DocD the values are updated continually and you can alter mem by editing.
-
-* Dm(), DocDm(), RawDm() to do 16 column hex dump mem with addresses showing.
-
-* Da() to do one column address dump (for stk, etc.) with symbolic addresses.
-
-* Dr() dumps regs.  You can display and modify regs in the debugger with 
-var-like labels, _RAX, _RBX, etc.
-
-* ClassRep() and the dynamic version ClassRepD() can be used to dump structures.
-
-* Prof() and ProfRep() provide code profiling.  See ::/Demo/InFile/InProfile.IN 
-(This is an InFile.)
-
-* Use RawPrint() to print debug info bypassing the window framework.  You pass 
-these routines a count in milliseconds for how long it should be displayed.  You 
-can use Raw(TRUE) to make all output bypass the window framework.  The WinMgr 
-runs on Core0 and will overwrite raw text from other cores when it updates the 
-scrn.
-
-* Use SysDbg() to set a flag which you can read with IsSysDbg() when you wish to 
-trigger some debug activity.  It's just a handy simple flag, nothing fancy.
-
-* There are flags for various trace options that can help debugging when there 
-are compiler bugs.  Often, you place them in #exe{} blocks.
-  
-  Echo() turns on or off raw data going into the lexical analyzer.
-  
-  Trace() unassembles code generated from the HolyC compiler.
-  
-  PassTrace() shows intermediate code coming-out after optimization.  The bits 
-  ctrl which passes are displayed.
-
-
-* There is a heap check utility which can find leaks.  Use HeapLog(), 
-HeapLogAddrRep() and HeapLogSizeRep().  It's a really simple program which 
-intercepts MAlloc() and Free().  You can customize the code to find other heap 
-issues.
-
-* You can define hndlr functions for <CTRL-ALT-letter> keys with CtrlAltCBSet(). 
- They operate either in a interrupt environment or in the window mgr when it 
-queues kbd msgs.  You can do Raw() output.  <CTRL-ALT-letter> hndlrs take a 
-scan_code as an arg.
-
-* If you recompile Kernel with BootHDIns(), you can set the MemInit, option to 
-initialize memory to a value at boot, the HeapInit option to cause mem alloced 
-off the heap to be initialized or VarInit option so both global and local vars 
-will be initialized to a value, but global AOT variables are always zero if not 
-initialized.  Pick a non-zero value to discover uninitialized var bugs.  You can 
-set sys_var_init_flag, and sys_heap_init_flag directly after booting.
-
- diff --git a/public/Wb/Home/Doc/Define.DD.HTML b/public/Wb/Home/Doc/Define.DD.HTML deleted file mode 100755 index c0e919b..0000000 --- a/public/Wb/Home/Doc/Define.DD.HTML +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - -
-TempleOS has a string indirection feature implemented with the same hash symbol 
-table entry as #define macros, HTT_DEFINE_STR.  Support for string lists is also 
-provided, but it's not very efficient, though, you can make a hash table with a 
-list using HashDefineLstAdd().  See ::/Adam/DolDoc/DocInit.HC.
-
-If you have an @ as the first char of a define list entry, it is an alias for 
-the prev entry num.
-
-Each task can load its own Define strings.  Remember, when a Hash table is 
-searched for a string, if it is not found, the parent task's table is searched.
-
-The DolDoc framework supports text that changes based on entries in the task's 
-symbol table.  Set a text entry with a D= arg, as in $TX,"",D="DD_MYSTRING"$.  
-See ::/Demo/DolDoc/DefineStr.HC, ::/Adam/ADefine.HC and ::/Doc/MemOverview.DD.
-
-See ::/Demo/Define.HC.
-
- diff --git a/public/Wb/Home/Doc/Demands.DD.HTML b/public/Wb/Home/Doc/Demands.DD.HTML deleted file mode 100755 index 972c092..0000000 --- a/public/Wb/Home/Doc/Demands.DD.HTML +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - -
-                                    Demands
-
-I, Terry Davis, am high priest of God's official third temple, TempleOS.  
-TempleOS is an operating system for IBM PC x86_64 desktops that will always dual 
-boot along-side Windows or Linux.  I am in charge of the core 100,000 lines of 
-TempleOS code and I do continual offerings to keep God entertained.  I have 
-divine authority to command any company in the computer industry to do anything 
-that I deem necessary to make God's temple more beautiful, glorious and perfect. 
-I have oversight authority similar to a building inspector or a person enforcing 
-the Americans with Disability Act -- I make commands, God signs-off with a 
-miraculous authentication from an oracle, and Intel, Microsoft or VMware obeys.
-
-
-
-* Windows, Linux and VMware (because of mounted drives) must support RedSea file 
-system when mounting partition, so I can get rid of 1,000 lines of redundant, 
-blemished code -- FAT32.  God's temple must be perfect.  Redundant code for 
-multiple file systems is bad and imperfect.  For this operating system, we want 
-low line count.  More than one driver for the same type of device is also bad.
-
-See ::/Kernel/BlkDev/FileSysRedSea.HC and ::/Adam/Opt/Boot/DskISORedSea.HC.
-
-::/Kernel/BlkDev/FileSysFAT.HC  :974 lines for FAT32 gets eliminated.
-::/Kernel/BlkDev/DskClus.HC     :152 All the clus operations become blk.
-
-* Microsoft must cancel SecureBoot because it makes dual booting impossible.  
-TempleOS is an additional operating system that must be used along-side Windows 
-or Linux, not as a replacement.  It must dual boot because it has no networking. 
-Real hardware as opposed to VMware is like the difference between looking in a 
-telescope eye piece vs just looking at an off-line image.  God said the 
-C64/Apple II generation owned ancestral lands.  VMware is like being taken off 
-of our land and moved onto a reservation.  In this case, however, it will not 
-stand.  In fact, God said to replace Windows with Wine, justice.  We can make a 
-100% standard model PC with a standard software for everyone, backed-up in 
-factory ROM.
-
-* VMware needs to support ATAPI CD/DVD/Blu-ray disk burning, directly to real 
-hardware.  Industry needs write-just once media to stop Farenheit 451 non-sense.
-
-* VMware has a bug stretching 640x480 16 color to full screen.
-
-* VMware some PC speaker's distortion is a good idea -- squarewave -- but 
-currently there is too much for hymns.  CIA monkery made fart noises.
-
-* VMware and others must list TempleOS as an official 64-bit operating system 
-and automatically enforce 512 Meg min RAM requirement.
-
-* VMware needs to support more than 16 cores.  I had a 24 core Xeon with 128 Gig 
-of RAM.  I discovered VMware allocates memory too slowly, where QEMU had no 
-problem.
-
-* Until super-simple block devices are available, hard disk should be placed at 
-IDE primary master 1F0/3F6 and CD/DVD/Blu-ray should be placed at the IDE 
-secondary master 170/376.  Currently, the wicked CIA plays musical chairs with 
-controllers each time you make an install.  With tons of ugly code, I do my 
-best.
-/Kernel/BlkDev/DskATAId.HC      :286 lines to figure-out I/O ports is gone.
-/Kernel/PCIBIOS.HC              :290 could be eliminated, but maybe we will keep 
-it so people can play with PCI devices.
-
-* Until super-simple serial ports are available, PS/2 emulated keyboard and 
-mouse must work.  The BIOS must enable these.  The plan is to transition the 
-industry off of USB.  Interum solution is to make virtual RS232 Octart for USB 
-devices in the same way PS/2 mouse is emulated.  All mice will be two button, 
-one wheel.  No more HID insanity, no more multi-end point, just simple tx rx 
-fifos with soft/hard flowcontrol that can jump the queue.  People with special 
-needs can buy PCI cards.  Our kids deserve code this simple ::/Doc/Comm.HC.  The 
-right to do your own port banging is what the C64 being our God given ancestral 
-land means.
-
-* The x86 IN/OUT port instructions, normally have a delay.  Perhaps, VMware & 
-Intel can enable faster x86 IN/OUT instruction timing for ATA/ATAPI PIO, so 
-bandwidth isn't as bad when doing port I/O.  See ATAGetRes().  We don't want to 
-do DMA.  Perhaps, x86 CPU chips need a new TempleOS mode for fast IN/OUT 
-instructions?  I think VMware already does something to speed disk I/O to faster 
-than native speed.
-
-* Perhaps, a new interrupt descriptor table entry type or a new x86 CPU mode can 
-be made that cause fast software interrupts, doing exactly what the CALL REL32 
-does, but with IDT as indirection.  We don't need to change privilege levels or 
-stacks.
-
-* Since I don't use paging (for anything), Intel should have an option for  
-no-paging long mode, and optimize it!
-::/Kernel/Mem/PageTables.HC     :135 lines to identity-map gets eliminated.
-
-* Desktop computers must have a reset switch and a fast reboot option, skipping 
-diagnostics.  I recommend booting TempleOS from a ROM when the reset bttn is 
-pressed and booting UEFI when the power bttn is pressed.  Or, we could build 
-UEFI on a TempleOS layer.  Intel must burn TempleOS into a ROM in the factory 
-for all desktop x86 CPUs to ensure tamper-proof trust in the oracle and because 
-God deserves the glory.  There will be just an English version.  A new ROM 
-version is released every seven years.  The ROM should boot like the DVD boots, 
-but with BOOT_SRC_ROM.
-
-* We do not want UTF, just 8-bit characters.  <CTRL-ALT-f> toggles between 
-Cyrillic and Std Fonts.  We need the twelve window TextBorder characters added 
-to the VGA font 0x02-0x0D.  Japan, China and Korea must switch to alphabets.  
-Maybe, the United States will change to metric, out of good will.  I am 
-beginning to plan fresh ASCII replacement, ::/Doc/NewASCII.DD.
-
-* Microsoft Paint and Linux's Gimp must support TempleOS GR Files.  They are 
-blemish free, unlike BMP files.  The TOSZ Linux utility can be used to make 
-screencasts from TempleOS exported GR Files and AU Files.
-
-* We must have a nice dictionary.  Someone needs to do a Spell Checker, too.
-
-* Intel needs to make DolDoc versions of its x86 CPU data sheets documenting all 
-hardware relevant to TempleOS. 
-
-* We must have the ultimate Bible search engine.  Currently, all we have is     
-filter search.  In the end, it should be a low line-count technique.  Maybe, I 
-allocate 500 lines out of the 20,000 reserve.
-
-* We will make a Standard TempleOS PC.
-
-* "VMware" is a trademark owned by VMware, Inc.
-* "Linux" is a trademark owned by Linus Torvalds.
-* "Windows" and "Paint" are trademarks owned by MicroSoft Corp.
-
- diff --git a/public/Wb/Home/Doc/DemoIndex.DD.HTML b/public/Wb/Home/Doc/DemoIndex.DD.HTML deleted file mode 100755 index 5c47f7a..0000000 --- a/public/Wb/Home/Doc/DemoIndex.DD.HTML +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - -
-                              TempleOS Demo Index
-
-These are arranged in increasing order of difficulty, more or less.  This can be 
-used as a tutorial if you start at the beginning and work your way fwd.
-
-<SPACE> to edit a file and <F5> to run it.
-
-::/Doc/HelloWorld.DD
-
-+] Games: Beginner
-+] Games: Intermediate
-+] Games: Advanced
-+] Non-Game
-+] TempleOS Specific
-
-
- diff --git a/public/Wb/Home/Doc/Directives.DD.HTML b/public/Wb/Home/Doc/Directives.DD.HTML deleted file mode 100755 index cba8fde..0000000 --- a/public/Wb/Home/Doc/Directives.DD.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-#define __DATE__ #exe{StreamPrint("\"%D\"",Now);}
-#define __TIME__ #exe{StreamPrint("\"%T\"",Now);}
-#define __LINE__ #exe{StreamPrint("%d",Fs->last_cc->lex_include_stk->line_num);}
-#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE && Fs->last_cc->lex_include_stk->depth<1);}
-#define __FILE__ #exe{StreamPrint("\"%s\"",Fs->last_cc->lex_include_stk->full_name);}
-#define __DIR__  #exe{StreamDir;}
-
-See ::/Demo/Directives.HC.
-
- diff --git a/public/Wb/Home/Doc/DolDoc.DD.HTML b/public/Wb/Home/Doc/DolDoc.DD.HTML deleted file mode 100755 index fc095d6..0000000 --- a/public/Wb/Home/Doc/DolDoc.DD.HTML +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -
-A DolDoc in memory is a Circular Queue of cmds and graphics.  See CDocEntry for 
-the entry structure.  See TipOfDay() for a nice example.
-
-DolDoc's are used for the editor, viewer, browser, and cmd line.
-
- diff --git a/public/Wb/Home/Doc/DolDocOverview.DD.HTML b/public/Wb/Home/Doc/DolDocOverview.DD.HTML deleted file mode 100755 index 4059ea2..0000000 --- a/public/Wb/Home/Doc/DolDocOverview.DD.HTML +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - -
-                                DolDoc Overview
-
-DolDoc is a TempleOS document type supported by DolDoc Routines.  In a document, 
-commands are bracketed with '$'s.  Use <CTRL-l> to experiment inserting a 
-command.  Then, use <CTRL-t> to toggle to plain text to see it.
-
-Here is the grammar:
-
-<DolDocCmd> := $<TwoLetterCmd>[<FlagList>][,<ArgList>]$ | $ColorName$
-
-<FlagList> := +|- <FlagCode>[<FlagList>]
-
-<ArgList> := <ArgCode>=<ArgExpression>[,<ArgList>]
-
-
-The format of DolDoc cmds is a two character code, +/-flags, a comma and args 
-separated by commas.  Some commands have mandatory args.  Optional args are 
-indicated with <ArgCode>=.  A ColorName bracked by dollars, will change the 
-foreground color.
-
-See ::/Doc/Widget.DD, ::/Demo/DolDoc/DemoDoc.DD, and 
-::/Demo/ToHtmlToTXTDemo/ToHtml.HC.
-
-<TwoLetterCmd>  See Type Defines and PrsDollarCmd().
-+] TX Text
-+] CR Hard New Line
-+] SR Soft New Line
-+] CU Cursor pos
-+] TB Tab
-+] CL Clear
-+] PB Page Break
-+] PL Page Length
-+] LM Left Margin
-+] RM Right Margin
-+] HD Header
-+] FO Footer
-+] ID Indent +/- num
-+] Text Colors
-+] PT User Prompt
-+] WW Word Wrap
-+] UL Underline
-+] IV Invert
-+] BK Blink
-+] SX Shift X pos
-+] SY Shift Y pos
-+] CM Cursor Movement
-+] AN Anchor
-+] LK Link
-+] BT Bttn
-+] DA Data
-+] CB Check Box
-+] LS List Widget
-+] MA Macro
-+] MU Menu Value
-+] HX Hex Edit
-+] TR Tree Widget
-+] SP Sprite
-+] IB Insert Binary
-+] IS Insert Binary Size
-+] SO Song
-+] HL Highlighting
-+] HC html
-+] ER Error
-
-<FlagCode>  See Flag Defines and Simple Flags.
-+] +H Hold
-+] +L Link
-+] +TR Tree
-+] +LS List
-+] +PU PopUp
-+] +C Collapsed
-+] +X <ESC> (Exit)
-+] +Q <SHIFT-ESC> (Abort Quit)
-+] +Z Zero
-+] +RD Refresh Data
-+] +UD Update Data
-+] +TC Tag CallBack
-+] +LC Left CallBack
-+] +RC Right CallBack
-
-<ArgCode>  See Arg Defines.
-+] T="" Tag Str
-+] LEN="" Field Length
-+] A="" Auxilliary Str
-+] D="" Define Str
-+] HTML=""
-+] LE=<Exp> Left Expression
-+] LM="" Left Macro Str
-+] RE=<Exp> Right Expression
-+] RM="" Right Macro Str
-+] BI=<Exp> Bin Number
-+] BP="" Bin Ptr
-+] RT=<raw_data_type>
-+] SX=<Exp> Shift X
-+] SY=<Exp> Shift Y
-+] SCX=<Exp> Scroll X
-+] U=<Exp> User Data
-
-EXAMPLES:
-
-<CTRL-t> to see how the following were done.
-Underlined Inverted Blinking super sub
-This is a big long scrolling msg.
-
-Cursor Movements:
-
-
-
-   Cursor moved 3 rows down and to 3rd column from left.
-                                                                                
-
-
-                                        Note mandatory comma after flags
-
-The following may be changed to modes instead of attr with flags.
-
-                                This is centered
-
-                                                         This is right justified
-
- diff --git a/public/Wb/Home/Doc/EdPullDown.DD.HTML b/public/Wb/Home/Doc/EdPullDown.DD.HTML deleted file mode 100755 index 0aadddf..0000000 --- a/public/Wb/Home/Doc/EdPullDown.DD.HTML +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - -
-File
-{
-  Save(,CH_CTRLS);
-  SaveAs(,CH_CTRLA);
-  Abort(,CH_SHIFT_ESC);
-  Exit(,CH_ESC);
-}
-
-Edit
-{
-  Undo(,CH_CTRLH,0x80E0000080E);
-  Cut(,CH_CTRLX);
-  Copy(,CH_CTRLC);
-  Paste(,CH_CTRLV);
-  DelLine(,CH_CTRLY);
-  FindReplace(,CH_CTRLF);
-  FindNext(,,0x3D0000003D);
-  FindLast(,,0x23D0000023D);
-  GoLine(,CH_CTRLG,0x42200000422);
-  GoBegin(,,0x4C800000448);
-  GoEnd(,,0x4D000000450);
-  GoLeft(,,0x4CB0000044B);
-  GoRight(,,0x4CD0000044D);
-  GoLBrace(,0x5B,0x61A0000061A);
-  GoRBrace(,0x5D,0x61B0000061B);
-  Macro(,,0x3C0000003C);
-  PlayMacro(,,0x23C0000023C);
-  AutoSaveToggle(,CH_CTRLS,0x61F0000061F);
-}
-
-Insert
-{
-  TextWidgets(,CH_CTRLL,0x42600000426);
-  GraphicResource(,CH_CTRLR,0x41300000413);
-  FileName(,,0x3E0000003E);
-  DirName(,,0x23E0000023E);
-  GodWord(,,0x4100000041);
-  GodBiblePassage(,,0x24100000241);
-  GodSong(,,0x4000000040);
-  GodDoodle(,,0x24000000240);
-  IndentIn(,CH_CTRLI,0x41700000417);
-  IndentOut(,CH_CTRLI,0x61700000617);
-  WordWrapOn(,CH_CTRLW,0x41100000411);
-  WordWrapOff(,CH_CTRLW,0x61100000611);
-  UnderlineOn(,CH_CTRLU,0x41600000416);
-  UnderlineOff(,CH_CTRLU,0x61600000616);
-  BlinkOn(,CH_CTRLK,0x42500000425);
-  BlinkOff(2,CH_CTRLK,0x62500000625);
-  InvertOn(,CH_CTRLZ,0x42C0000042C);
-  InvertOff(,CH_CTRLZ,0x62C0000062C);
-  SuperToggle(,CH_CTRLP,0x41900000419);
-  SubToggle(,CH_CTRLP,0x61900000619);
-  PageBreak(,CH_CTRLJ,0x41C0000041C);
-}
-
-Program
-{
-  CodeTools(,CH_CTRLL,0x62600000626);
-  Include(,0,0x3F0000003F);
-  AdamInclude(,0,0x23F0000023F);
-}
-
-View
-{
-  PlainText(,CH_CTRLT);
-  Collapse(,CH_CTRLO,0x61800000618);
-  Uncollapse(,CH_CTRLO,0x41800000418);
-  Border(,CH_CTRLB);
-  FileMgr(,CH_CTRLD,0x42000000420);
-  Search(,CH_CTRLF,0x62100000621);
-}
-
-Help
-{
-  Menu(,CH_CTRLM,0x43200000432);
-  Help(,,0x3B0000003B);
-  About(,,0x23B0000023B);
-}
-
- diff --git a/public/Wb/Home/Doc/FAQ.DD.HTML b/public/Wb/Home/Doc/FAQ.DD.HTML deleted file mode 100755 index 7ef2750..0000000 --- a/public/Wb/Home/Doc/FAQ.DD.HTML +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - -
-                           Frequently Asked Questions
-
-+] How come it is public domain, not GPL?
-+] Shouldn't it be GNU/TempleOS?
-+] Don't you use GNU's gcc?
-+] Why do you dual boot?
-+] It has links, so is it a browser?
-+] Where are the animated 3D icon GIFs?
-+] If the compiler is JIT, isn't it an interpretor?
-+] Are you a Creationist?
-+] Is 'Bt()' in the code Bit Torrent?
-+] Is 'Fs->' in the code file system?
-+] Is it Pascal?
-+] Why doesn't Sleep() make my laptop hibernate?
-+] What is Yield() for in loops?
-+] What is JIT Compiled Mode?
-+] Why do files end in .Z?  Are they encrypted?
-+] Is it open source?  How do I build it?
-+] Where are object files?  How do I link?
-+] What is the FPS refresh rate?
-+] How does a task own the speaker?
-+] Why does it leak memory?
-+] Why do I get a memory leak when editing big files?
-+] Why is it in text mode?
-+] Where is the kernel memory?
-+] Why does it run code from stack addresses?
-+] How does it SYSCALL?
-+] How do you fault-in stack?
-+] How do I set the PATH?
-+] How do I boot it with Grub?
-+] How do I get Kernel.BIN to boot?
-+] Why is there some 16-Bit code?
-+] Why are you pushing 32-bit values on the stack?
-+] Why are you using 32-bit insts and not setting high 32-bits?
-+] How do you use the FS and GS segment registers.
-+] How do I set ORG for position of code?
-+] How are symbols loaded?
-+] Why doesn't assert work?
-+] Why doesn't C++ public work?
-+] How does the debugger do source debugging?
-+] What are the ASCII 5 and ASCII 31 chars doing in my text files?
-+] Why is there garbage at the end of my text files?
-+] Why are sprites so small?
-+] Why don't I need to recompile /Adam and /Home files?
-+] Why does it finds files that aren't there?
-
-
-* "Windows" is a trademark owned by MicroSoft Corp.
-* "Linux" is a trademark owned by Linus Torvalds.
-* "QEMU" is a trademark owned by Fabrice Bellard.
-* "VMware" is a trademark owned by VMware, Inc.
-* "VirtualBox" is a trademark owned by Oracle.
-
- diff --git a/public/Wb/Home/Doc/Features.DD.HTML b/public/Wb/Home/Doc/Features.DD.HTML deleted file mode 100755 index eab7988..0000000 --- a/public/Wb/Home/Doc/Features.DD.HTML +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - -
-                               TempleOS' Features
-
-* Oracle in with <F7> for words or <SHIFT-F7> for passages.  See tongues.
-
-* x86_64, ring-0-only, single-address-map (identity), multitasking kernel with 
-multicore support.
-
-* Master/Slave MultiCore 
-
-* Free, public domain, 100% open source.
-
-* 64-bit compiler/assembler for HolyC.  Truly compiles, doesn't interpret.  Just
--in-Time and Ahead-of-Time compilation.  With JIT, no need for object or exe 
-files.
-
-* No 32-bit krufty code.
-
-* 640x480 16 color VGA graphics.
-
-* Keyboard & Mouse support.
-
-* ATA PIO Hard drives, support for FAT32 and RedSea file systems with file 
-compression.
-
-* ATAPI PIO CD/DVD support with RedSea file system.  Can make bootable ISO files 
-so you can roll-your-own distro's.
-
-* Partitioning tool, installer, boot loaders for CD/DVD and hard disk.
-
-* Editor/Browser for a new Document Format.  Source files and the command line 
-window can have graphics, links, icons, trees, colors, super/sub scripts, 
-margins.  Everything is seamless through-out the tool chain.  No need for 
-separate resource files.
-
-* 8-bit ASCII, not just 7-bit.  Supported in entire tool chain.  <CTRL-ALT-a>
-
-* Graphics in source code, no resource files, graphic sprite editor. <CTRL-r>
-
-* 64-bit pointers.  All memory, even more than 4Gig, can be directly accessed by 
-all tasks on all cores at all times.
-
-* Ring-0-only.  Highest CPU privileged mode at all times.  No off-limits insts.  
-No time lost changing modes or address maps.  Switches tasks in half a 
-microsecond.
-
-* 2D/3D graphics library
-
-* Real-time fancy differential-equation solver for physics engines, to use in 
-games.  (Adaptive step-size Runge-Kutta, interpolated for real-time.)
-
-* Auto-completion, jump-to-source tool called AutoComplete with Dictionary.
-
-* Window Manager.  Pan scrn with <CTRL-LeftDrag>.  Zoom scrn on mouse cursor 
-with <CTRL-ALT-z>/<CTRL-ALT-SHIFT-Z>.
-
-* File Manager, <CTRL-d>.
-
-* Code profiler, merge, diff utils.
-
-* PC Speaker support with many hymns.
-
-* Music composing tool.
-
-* Many games, demos and documentation.
-
-* All source code included.  Only compiles with the included TempleOS compiler 
-and assembler.
-
- diff --git a/public/Wb/Home/Doc/FileLowLevel.DD.HTML b/public/Wb/Home/Doc/FileLowLevel.DD.HTML deleted file mode 100755 index 30cf57c..0000000 --- a/public/Wb/Home/Doc/FileLowLevel.DD.HTML +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - -
-/* Graphics Not Rendered in HTML */
-
-                       CFile
-
-
-
-
-
-
-
-    BlkRead()         BlkWrite()
-
-
-
-
-
-
-
-
-
-
-
- diff --git a/public/Wb/Home/Doc/FileMgr.DD.HTML b/public/Wb/Home/Doc/FileMgr.DD.HTML deleted file mode 100755 index 4d3a5f3..0000000 --- a/public/Wb/Home/Doc/FileMgr.DD.HTML +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - -
-                                  File Manager
-
-<SHIFT CURSOR>
-  Select files.
-
-<CTRL-y> or <DEL>
-  Delete file or tree.
-
-<CTRL-c> or <CTRL-INS>
-  Copy select files to clip.
-
-<CTRL-v> or <SHIFT-INS>
-  Paste clip.
-
-LEFT-CLICK,drag-drop
-  Move a file or tree to a dir.
-
-LEFT-CLICK,same file or <SPACE>
-  Edit file.
-
-<SHIFT-SPACE>
-  Edit Plain Text File.
-
-RIGHT-CLICK or <ENTER>
-  Bring-up menu.
-
-<F5>
-  #include file.
-
-<SHIFT-F5>
-  Adam #include file.
-
-'r'
-  Rename file.
-
-'d'
-  Make Dir.
-
-'c'
-  DskChg (Remount removable media).  Do not do this on blank disks.
-
-'f'
-  Format drive.
-
-'i'
-  Mount ISO.C file.
-
-'u'
-  Unmount drive(s).
-
-'m'
-  Make CD/DVD ISO.C file.  This creates a RedSea ISO file image of the dir the 
-  cursor is on.  The name of the ISO file is "::/Tmp/CDDVD.ISO.C" 
-  blkdev.dft_iso_c_filename and can be redefined in your start-up scripts.  You 
-  may wish to place it on a different drive.
-
-'B'
-  Burn CD/DVD ISO file.  This burns a CD/DVD using the image file, 
-  "::/Tmp/CDDVD.ISO" blkdev.dft_iso_filename to the drive the cursor is on.
-
-
-Instructions on Using CD/DVD's
-  If you have not recompiled Kernel and defined your CD/DVD drive, exit the 
-  FileMgr and use Mount to define your CD/DVD drive.  Place a CD/DVD in the 
-  drive and press 'c' when on top of the CD/DVD drive letter to mount the drive. 
-   It will call DskChg(), the TempleOS cmd to mount removable media.
-
-
-Instructions on Burning CD/DVD's
-  Create a temporary dir to hold files and copy files into the holding dir.  
-  Make an ISO image of the dir by pressing 'M' when on top of the dir.  Press 'B
-  ' when on top of the CD/DVD ROM drive to burn the ISO, "::/Tmp/CDDVD.ISO" 
-  blkdev.dft_iso_filename, to disk.  If you have not recompiled Kernel and 
-  defined your CD/DVD drive, exit the FileMgr and use Mount.
-  
-  Making Your Own Distro
-  
- diff --git a/public/Wb/Home/Doc/FileMgrPullDown.DD.HTML b/public/Wb/Home/Doc/FileMgrPullDown.DD.HTML deleted file mode 100755 index da5fefe..0000000 --- a/public/Wb/Home/Doc/FileMgrPullDown.DD.HTML +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - -
-File
-{
-  Rename(,'r');
-  DirMk(,'d');
-  FmtDrv(,'f');
-  UnmountDrv(,'u');
-  Abort(,CH_SHIFT_ESC);
-  Exit(,CH_ESC);
-}
-
-Edit
-{
-  Ed(,CH_SPACE);
-  Plain(,CH_SHIFT_SPACE);
-  Copy(,CH_CTRLC);
-  Paste(,CH_CTRLV);
-  DeleteFile(,CH_CTRLY);
-}
-
-CDDVD
-{
-  DskChg(,'c');
-  MountISOC(,'i');
-  MakeRedSeaISOC(,'m');
-  BurnISOFile(,'B');
-}
-
-Program
-{
-  Include(,0,0x3F0000003F);
-  AdamInclude(,0,0x23F0000023F);
-}
-
- diff --git a/public/Wb/Home/Doc/FileUtils.DD.HTML b/public/Wb/Home/Doc/FileUtils.DD.HTML deleted file mode 100755 index 11d2571..0000000 --- a/public/Wb/Home/Doc/FileUtils.DD.HTML +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - -
-                                   File Utils
-
-File util FilesFind() wildcard mask consists of a single base dir with multiple 
-file masks separated by ';'.  The '*' and '?' wildcard chars are accepted.  The 
-'~' is your home directory and '!' indicates an exclusion mask.
-
- 
-"/Kernel/*"             BaseDir: /Kernel        Mask: *
-"/Demo/*.BMP*;*.GR*"    BaseDir: /Demo          Mask: *.BMP* | *.GR*
-"/*.DD*;!*/Bible*"      BaseDir: Root           Mask: *.DD* but not */Bible*
-
-See FilesFindMatch().
-
-Flags are either text or int values.
-
-  FUF_RECURSE           +r Recurse
-  FUF_SINGLE            +s Single File (Optimization for one file in mask.)
-  FUF_FLATTEN_TREE      +f use with '+F'.  Just use +F, probably.
-  FUF_JUST_DIRS         +D just directories
-  FUF_JUST_FILES        +F just files (Flattens trees)
-  FUF_CLUS_ORDER        +O sort by clus (move head one direction)
-  FUF_JUST_TXT          +T just text files      : FILEMASK_TXT
-  FUF_JUST_DD           +$ just DolDoc files    : FILEMASK_DD
-  FUF_JUST_SRC          +S just src files       : FILEMASK_SRC
-  FUF_JUST_AOT          +A just aot files       : FILEMASK_AOT
-  FUF_JUST_JIT          +J just jit files       : FILEMASK_JIT
-  FUF_JUST_GR           +G just graphic files   : FILEMASK_GR
-
-See ST_FILE_UTIL_FLAGS when used in calling program taking text flags.
-
- diff --git a/public/Wb/Home/Doc/Frame.DD.HTML b/public/Wb/Home/Doc/Frame.DD.HTML deleted file mode 100755 index 96c3c09..0000000 --- a/public/Wb/Home/Doc/Frame.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-If you require separate global vars for multiple instances of a routine, you can 
-use Frames.  See SpriteMeshEd(), ::/Demo/Graphics/Pick3D.HC or Noise().
-
- diff --git a/public/Wb/Home/Doc/GRFiles.DD.HTML b/public/Wb/Home/Doc/GRFiles.DD.HTML deleted file mode 100755 index a77cefd..0000000 --- a/public/Wb/Home/Doc/GRFiles.DD.HTML +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - -
-GR graphics files are 8-bits-per-pixels but only 4-bits of color, with 
-transparency and no palette.  Compression is the standard TempleOS LZW 
-compression.
-
-#define DCF_COMPRESSED          1 //This is the only saved flag.
-#define DCF_PALETTE             2
-
-#define TRANSPARENT             0xFF
-#define BLACK                   0
-#define BLUE                    1
-#define GREEN                   2
-#define CYAN                    3
-#define RED                     4
-#define PURPLE                  5
-#define BROWN                   6
-#define LTGRAY                  7
-#define DKGRAY                  8
-#define LTBLUE                  9
-#define LTGREEN                 10
-#define LTCYAN                  11
-#define LTRED                   12
-#define LTPURPLE                13
-#define YELLOW                  14
-#define WHITE                   15
-
-class CBGR48
-{
-  U16   r,g,b,pad;
-};
-
-CBGR48 gr_palette_std[16]={
-0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
-0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
-0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
-0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
-
-class GRFile
-{
-  I32   width;
-  I32   width_internal; //Rounded-up to multiple of 8.
-  I32   height;
-  I32   flags;          //DCF_COMPRESSED? See ::/Kernel/Compress.HC.
-  CBGR48 palette[16];   //Included if DCF_PALETTE.
-  U8    body[];
-};
-
-See DCSave(), GRWrite(), DCLoad(), and GRRead().
-
- diff --git a/public/Wb/Home/Doc/Glossary.DD.HTML b/public/Wb/Home/Doc/Glossary.DD.HTML deleted file mode 100755 index 2891eac..0000000 --- a/public/Wb/Home/Doc/Glossary.DD.HTML +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - -
-                                    Glossery
-
-+] Abbreviations
-+] Task/Process/Thread
-+] Adam Task
-+] Seth Tasks
-+] Code and Data Heaps
-+] Parent, Child and PopUp Tasks
-+] HolyC
-+] AOT Compile Mode
-+] JIT Compile Mode
-+] Compiler Intermediate Code
-+] Drive/Partition
-
-Bt, Bts, Btr, Btc, BEqu
-Define
-DolDoc
-Editor Link Types
-files_find_mask
-Hash Table
-InFile
-Ona
-Pag
-RedSea File System
-Sprite
-
-+] CLI, STI, PUSHFD, POPFD
-+] Filename Extention Types
-+] Naming Convention
-+] Fs
-+] Gs
-+] Heap
-+] Join
-+] user_data
-+] Multicore Core0/CoreAP
-
-
- diff --git a/public/Wb/Home/Doc/God.DD.HTML b/public/Wb/Home/Doc/God.DD.HTML deleted file mode 100755 index 385eaf6..0000000 --- a/public/Wb/Home/Doc/God.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-The Holy Spirit can puppet you.
-
-
- diff --git a/public/Wb/Home/Doc/GraphicsOverview.DD.HTML b/public/Wb/Home/Doc/GraphicsOverview.DD.HTML deleted file mode 100755 index 10e404c..0000000 --- a/public/Wb/Home/Doc/GraphicsOverview.DD.HTML +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - -
-                               Graphics Overview
-
-Dive into Demo Index to learn.
-
-The order layers are drawn on top of each other is:
-
-
-
-
-
-
-
-
-
-
-
-/* Graphics Not Rendered in HTML */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-* See GrUpdateScrn(), GrUpdateTasks() and GrUpdateTaskWin() called by the WinMgr 
-task 30fps.  Notice the task's draw_it() callback being called.  Only tasks on C
-ore0 are allowed to have windows.  There is one window per task, no child 
-windows.  You can have pop-up child tasks.
-
-* CDCs (device contexts) are a data type for controlling graphics on the scrn or 
-graphics in mem.  The device context structure has thick and color.  You use 
-DCAlias() to create your own structure, with its own color and thick.  Free it 
-with DCDel() when finished.
-
-* gr.dc is a device context for persistent data on the scrn, not needing to be 
-redrawn.  You create an alias for this by using DCAlias() and work with that.  
-See ::/Demo/Graphics/NetOfDots.HC.
-
-* There are various flavors of line and point plotting routines.  GrLine() and 
-GrPlot() are the simplest.  The others allow 3D graphics and rotations.
-
-* See ::/Doc/Transform.DD for adding a transformation.
-
-* You change the Fs->draw_it var to point to your DrawIt() function which gets 
-called each scrn refresh (30 fps).  You draw everything in the window over and 
-over again.  See ::/Demo/Graphics/Box.HC.
-
-* Use the graphic sprite resource editor, <CTRL-r>, to create a sprite that can 
-be plotted with Sprite3() or output to the cmd line with Sprite().  Use $IB,"",B
-I=1$ in a src program to insert the addr of sprite binary data item #1.  To 
-learn how the numbers work, after creating a sprite with <CTRL-r>, toggle to 
-plain text with <CTRL-t> and check its num.  Make an assignment to a ptr var or 
-pass to Sprite3() with $IB,"",BI=n$.  Use <CTRL-r>'s "Pointer to Sprite" to make 
-a $IB...$ entry.  See ::/Demo/Graphics/SpritePlot.HC and 
-::/Demo/Graphics/SpritePlot3D.HC.  The origin (zero point) for a sprite is 
-defined by the cursor location when you pressed <CTRL-r> to make it.  You can 
-edit a sprite by clicking the cursor on it and pressing <CTRL-r> again.
-
-* Set DCF_SYMMETRY in the CDC.flags and call DCSymmetrySet() or DCSymmetry3Set()
-.  This will plot a mirror image in addition to the primary image.  Set 
-DCF_JUST_MIRROR to plot just the image, but this required DCF_SYMMETRY to be set 
-at the same time.  Note: You can only have one symmetry active at a time 
-including in CSprites.
-
-* Use DCNew() to create a mem bitmap which can be used to work off-scrn and 
-which can be GrBloted onto the scrn.  If you set brush member of CDC to another 
-CDC, all the graphic routines will GrBlot() the brush instead of GrPlot().  See 
-::/Demo/Graphics/Blot.HC.
-
-* There are a few raster operations available.  They go in bits 8-11 of the dc->
-color member var which is a CColorROPU32.  ROP_COLLISION is special.  It counts 
-the num of pixs drawn on non-background locations.  Using ROP_COLLISION with 
-vector CSprite's is tricky because overlapping pixs from lines in the CSprite 
-reg as collisions.  You can either work with a nonzero count or convert your 
-CSprite to a bitmap if your subelements draw on top of each other.  Be sure to 
-set ->bkcolor before using ROP_COLLISION.  See ::/Demo/Graphics/Collision.HC and 
-Titanium.
- 
-* The ->dither_probability_u16 member of CDC is a U16 used to statistically sel 
-between two colors to get something resembling more shades of color.  See 
-::/Demo/Graphics/SunMoon.HC and ::/Demo/Graphics/Shading.HC.  It works with many 
-graphic routines, but not those with pens.
-
-* There is a mechanism built-in for generating motion based on differential 
-equations, which allows realistic physics.  You create an CMathODE struct with 
-ODENew(), passing it the num of vars in the state vect.  For realistic physics, 
-you usually have 2 state vars for each dimension (for each mass) because motion 
-is governed by F=mA which is a 2nd order equation.  The two states are pos and 
-velocity and to solve these you need to supply the derivative of pos and 
-velocity.  The derivative of pos is usually simply the current velocity and the 
-derivative of velocity is the acceleration (the sum of forces on a mass divided 
-by mass).  To help provide meaningful names for values in the state vect, you 
-can create an COrder2D3 ptr and point it to a mass in the state vect.  Six 
-elements in the state vect are required for each mass.
-
-See Math/CMathODE.
-See ::/Demo/Games/Rocket.HC.
-
- diff --git a/public/Wb/Home/Doc/GuideLines.DD.HTML b/public/Wb/Home/Doc/GuideLines.DD.HTML deleted file mode 100755 index 0f72d00..0000000 --- a/public/Wb/Home/Doc/GuideLines.DD.HTML +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - -
-                              Directory Structure
-
-/Home All your user data should be placed in here to ease backing-up your data.  
-When you install an application it will create a subdirectory of your /Home 
-directory for storage.
-
-/Apps Applications are placed in subdirectories of /Apps.  Applications should 
-have a file called Install.HC.Z which will install the app, possibly making 
-files or directories in /Home.  The file, Load.HC.Z will load the application 
-into mem.  The file, Run.HC.Z, will usually load and execute the app.  To add an 
-app to your PersonalMenu, use <CTRL-l>, insert a macro with the PopUp option 
-checked and invoke the Run.HC.Z file.
-
-/Demo Here you can find lots of sample code to do various things.
-
-/Doc Here you can find documentation.
-
-/Kernel The core of the operating system is found here.  Since priviledge levels 
-are not used, calling it a kernel is deceptive.  It is AOT compiled by 
-BootHDIns().  It is loaded by the boot loader and must fit in 640K.
-
-/Compiler The compiler module src code is found here.  The compiler is AOT 
-compiled to produce a binary file which is loaded at boot.  It, too, is AOT 
-compiled by BootHDIns().
-
-/Adam The non-kernel part of the operating system is found here.  It is JIT 
-compiled during boot.  The Adam Task is the father of all tasks, like Adam and 
-Eve.
-
-/0000Boot Boot files go here.  Stage 2 of the TempleOS hard drive master boot 
-loader, the old hard drive master boot record which is just blk#0, and the 
-CD/DVD 0000Kernel.BIN.C file go here.  ASCII 0000 is near the top, 
-alphabetically, in case you use MagicISO.
-
-
-
-                                 ::/Home Files
-
-The home dir is specified with '~'.  The home dir is ::/Home unless you change 
-it with HomeSet() or compile the kernel with a cfg option.  An empty /Home dir 
-should be valid because it will get default files from the root dir. 
-
-~/PersonalMenu.DD a menu viewed with the <CTRL-m> key or by clicking "MENU" in 
-the upper left border area of a window.
-
-~/PersonalNotes.DD a personal note file viewed with the <CTRL-SHIFT-M> key.
-
-~/MakeHome.HC a file compiled by the Adam Task during StartOS.
-
-~/Home* Copy Home* files from the root into ~ and customize them.  These files 
-are invoked when the Adam Task starts-up.
-
-~/Once.HC a file invoked at the start-up of the first user.  Customize this!
-
-~/Registry.HC can be edited by hand or deleted to reset to defaults.  Takes 
-affect next boot.
-
-
-
-                              Application Policies
-
-* Place applications in their own /Apps subdirectory.
-
-* Make a file called Load.HC.Z to load the application.
-
-* Make a file called Run.HC.Z to load and run the application, preferable by #in
-cludeing the Load.HC.Z file.
-
-* Place user data in a subdirectory of /Home, preferably naming the subdirectory 
-the same as the /Apps subdirectory.  Or, place data in the Registry.HC.Z file.  
-See ::/Demo/RegistryDemo.HC.
-
-* If the app needs files in the /Home directory, make an /Apps file called Insta
-ll.HC.Z or Install.IN.Z to create the /Home subdirectory.
-
- 
-
-                             Programming Guidelines
-
-* Virtual mem/Paging is not used -- it is identity mapped in x86_64 mode.  The 
-stk does not grow, so alloc enough when the task (process) is Spawned and use 
-the heap for most things.  (The heap refers to MAlloc() and Free().)
-
-* You can Free(NULL).
-
-* See Naming Convention and Abbreviations.
-
-* There are two modes of compiling, AOT Compile Mode and JIT Compile Mode.  
-Compilation is done in both -- neither is "interpreted".  Use JIT Mode.
-
-* HolyC
-
-* Use I64 instead of smaller int sizes because the compiler converts everything 
-to 64-bit.  Don't use unsigned unless it actually breaks.  A policy of signed 
-keeps it simple so you don't have to agonize over choices.
-
-     U32 DistDist(U16 x1, U16 y1, U16 x2, U16 y2)
-     {//This requires zero-extend when fetching args.
-       return SqrI64(x1-x2)+SqrI64(y1-y2);
-     }
-     
-     I64 DistDist(I64 x1, I64 y1, I64 x2, I64 y2)
-     {
-       return SqrI64(x1-x2)+SqrI64(y1-y2);
-     }
-
-* In-order, short circuit logic is assumed.
-
-* Avoid boolean expression assignments.  Boolean assignments don't have short 
-circuit logic and are not compiled efficiently.  The Bool type is just an alias 
-for a 1 byte signed int -- nothing forces it to 1 or 0.  There is a ToBool() 
-function that will for to 1 ot 0, however.
-
-* Glbl vars in AOT BIN modules are initialized to zero.  They occupy space in 
-BIN files.
-
-* Bracketing code with PUSHFD CLI and POPFD will protect against simultaneous 
-accesses from tasks on one core.  To protect against multiple cores, you need a 
-locked semaphore.  I think semiphores need to be in their own cache line, but 
-I'm not sure.  I use lock bits in a lot of places not aligned.
-
-* SysDbg() and IsSysDbg() are really handy when working on the compiler or 
-kernel.  It's just a bit you can set and test.
-
-* I don't use U0 * because the size is zero for ptr arithmetic.
-
-* Use CH_SHIFT_SPACE for spaces in quotes in source code because I run 
-Spaces-to-Tabs on source code.
-
-* Do not use #if or #ifdef
-
-
-
-                                Hash Sym Tables
-
-* See ::/Adam/AHash.HC for examples of how the hash tables are set-up.  
-Basically, syms are placed into hash tables and child process hash tables are 
-chained to parents.  This provides scopes for vars and functions.
-
-* adam_task->hash_table holds the HolyC syms loaded in on start-up.
-
-* Fs->hash_table holds user HolyC syms and if a sym is not found, it checks 
-parents.  When a duplicate sym is added to the table, it overshadows the prev 
-sym.  When developing software, typically you include the file at the cmd 
-prompt, make changes and reinclude it.  Old syms are overshadowed but they are 
-still there.  Periodically, kill the TASK and start fresh when mem is low.  If 
-you wish your applications to free themselves instead of staying in mem, spawn 
-or PopUp() a task to run the application and kill it when it's done.
-
-* To display the contents of a hash table, use the Who() routine or the 
-varients.  HashDepthRep() gives a histogram  of how long the chains are, in case 
-you wish to make hash table sizes bigger.
-
-
-
-                               Assembly Language
-
-See ::/Doc/Asm.DD.
-
-* FS must always point to the cur CTask.
-
-* GS must always point to the cur CCPU.
-
-* Don't change the segment regs unless interrupts are off.  It's hard to do, 
-anyway.  SET_FS_BASE and SET_GS_BASE.
-
-* When interacting with HolyC compiled code, preserve RBP, RSI, RDI, R10-R15 
-because the compiler uses these for reg vars.  You are free to clobber RAX, RBX, 
-RCX, RDX, R8 and R9.  See Compiler Reg Masks, PUSH_C_REGS and POP_C_REGS
-
-* I recommend using the standard stk frame for functions because Caller() is 
-used to display the call stk, such as for the wallpaper.
-        PUSH    RBP
-        MOV     RBP,RSP
-        SUB     RSP,nnnn
-...
-        LEAVE
-        RET
-
-* The args are removed from the stack with RET1 stmts.
-
-        RET1    16      //remove two args
-
-* No args are passed in regs.
-
-* RAX holds function return values, of course.
-
-* "MagicISO" is a trademark owned by MagicISO Corp.
-
- diff --git a/public/Wb/Home/Doc/Hash.DD.HTML b/public/Wb/Home/Doc/Hash.DD.HTML deleted file mode 100755 index ace60b9..0000000 --- a/public/Wb/Home/Doc/Hash.DD.HTML +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - -
-/* Graphics Not Rendered in HTML */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-There is a symbol (hash) table for each task.  When a sym is not found, the 
-parent task's sym table is checked.  All tasks chain back to the Adam task.
-
-TempleOS sym tables are implemented with an array of linked-lists.  A num is 
-generated from a string by HashStr() to index into the array of linked-lists.  
-Multiple strings can generate the same num, so linked-lists are built.  Newer 
-entries overshadow older ones.
-
-There are various types of entries.  See Hash Entry Types.
-
-Symbol Look-up (Used many places including the JIT Compiler and Loader.)
-1) Symbol name is hashed by adding and shifting the ASCII of all chars.
-2) hash table->body[] array is indexed.
-3) Linked-lst is traversed until match of text and type of entry.
-4) If not found, hash table->next table is searched.
-
-Duplicate entries are allowed -- they overshadow old entries.
-
-Address-to-Symbol Look-up (Slow because not important. We could use trees.)
-1) FunSeg Cache is scanned.
-2) Hash Tables are scanned.
-
- diff --git a/public/Wb/Home/Doc/HeapDbg.DD.HTML b/public/Wb/Home/Doc/HeapDbg.DD.HTML deleted file mode 100755 index 285bb14..0000000 --- a/public/Wb/Home/Doc/HeapDbg.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-Recompile the kernel with _CFG_HEAP_DBG=TRUE if you want more heap debugging.  
-You are on your own.
-
- diff --git a/public/Wb/Home/Doc/HelloWorld.DD.HTML b/public/Wb/Home/Doc/HelloWorld.DD.HTML deleted file mode 100755 index 6d63dd3..0000000 --- a/public/Wb/Home/Doc/HelloWorld.DD.HTML +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - -
-//Press F5 in the editor to compile and run.
-
---------Hello.HC.Z---------
-"Hello World\n";
-
-
---------Hello.HC.Z---------
-U0 Main()
-{
-  "Hello World\n";
-}
-Main;
-
-
---------Hello.HC.Z---------
-U0 MyPrint(U8 *st)
-{
-  "%s",st;
-}
-MyPrint("Hello World\n");
-
-
---------Hello.HC.Z---------
-U0 MyPrint2(U8 *st1,U8 *st2) //Any number of args.
-{
-  "%s %s\n",st1,st2; //Any number of args.
-}
-MyPrint2("Hello","World");
-
-
---------Hello.HC.Z---------
-U0 MyPrint(U8 *st)
-{
-  "" st; //Empty with no comma means first is fmt str.
-}
-MyPrint("Hello World\n");
-
-
---------Hello.HC.Z---------
-asm {
-MSG:    DU8 "Hello World\n",0;
-
-//The convention is underscore on C callable.
-//Two colons means exported symbol.
-_HELLO_WORLD::
-//You can only clobber RAX,RBX,RCX,RDX
-        PUSH    RSI
-        MOV     RSI,MSG
-        CALL    PUT_STR
-        POP     RSI
-        RET
-}
-Call(_HELLO_WORLD);
-
-
---------Hello.HC.Z---------
-asm {
-_HELLO_WORLD::
-//You can only clobber RAX,RBX,RCX,RDX
-        MOV     RAX,'Hello '
-        CALL    PUT_CHARS //Up to 8 chars packed into one 64-bit int.
-        MOV     RAX,'World\n'
-        CALL    PUT_CHARS
-        RET
-}
-Call(_HELLO_WORLD);
-
-
---------Hello.HC.Z---------
-asm {
-_MY_PRINT::
-//You can only clobber RAX,RBX,RCX,RDX
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        MOV     RSI,U64 SF_ARG1[RBP]
-        CALL    PUT_STR
-        POP     RSI
-        POP     RBP
-        RET1    8       //Callee pops the stack to clear args.
-}
-_extern _MY_PRINT U0 MyPrint(U8 *st);
-MyPrint("Hello World\n");
-
-
---------Hello.HC.Z---------
-asm {
-_MY_PRINT::
-//You can only clobber RAX,RBX,RCX,RDX
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    U64 SF_ARG1[RBP]
-        CALL    &PutS   //Callee pops the stack to clear args.
-        POP     RBP
-        RET1    8
-}
-_extern _MY_PRINT U0 MyPrint(U8 *st);
-MyPrint("Hello World\n");
-
-
- diff --git a/public/Wb/Home/Doc/HelpIndex.DD.HTML b/public/Wb/Home/Doc/HelpIndex.DD.HTML deleted file mode 100755 index b913d67..0000000 --- a/public/Wb/Home/Doc/HelpIndex.DD.HTML +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - -
-                                      Help
-
-+] Keyboard Ctrls
-+] Mouse Ctrls
-+] Keyboard-Mouse Ctrls
-
-Welcome         About TempleOS
-Command Line    Take Tour
-Demo Index      Key Map
-Features        Requirements
-Charter         Strategic Decisions
-F.A.Q.          Glossary
-HolyC           Compiler Index
-Why Not More?   Demands
-The Std TempleOS PC
-        
-+] User Help
-+] Admin Help
-+] Programmer help
-+] System Programmer Help
-
-
-                                     Index
-AutoComplete
-Bit
-Boot
-Call
-Char Overview
-Char Routines
-Circular Queue
-Cmd Line Overview
-Cmd Line Routines
-Compiler Overview
-Compiler Routines
-Compression
-Ctrls
-Data Types
-Date
-Debugging Overview
-Debugging Routines
-Define
-Devices
-Disk
-Doc Overview
-Doc Routines
-Exceptions
-File
-File Utils
-Frames
-God
-Graphics Overview
-Graphics Routines
-Hash
-Help System
-HolyC
-InFile
-Info
-Install
-I/O
-Job
-Key Allocations
-Keyboard Devices
-Link Types
-Math
-Memory Overview
-Memory Routines
-Menus
-Messages
-Misc
-Mouse
-MultiCore
-OpCodes
-Operator Precedences
-PCI
-Print("") Fmt Strings
-Processor
-Profiler
-RedSea
-Registry
-Scan Codes
-ScrnCast
-Sound
-Sprites
-StdIn
-StdOut
-String
-Task
-TextBase Layer
-Time
-Training
-TOSZ
-Utils
-Windows
-
- diff --git a/public/Wb/Home/Doc/HelpSystem.DD.HTML b/public/Wb/Home/Doc/HelpSystem.DD.HTML deleted file mode 100755 index 1e9e630..0000000 --- a/public/Wb/Home/Doc/HelpSystem.DD.HTML +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - -
-#help_index "Topic/SubTopic;OtherTopic"
-The help index preprocessor compiler directive sets the topics for syms 
-subsequently defined.  You specify subtopics with a '/' tree hierarchy and 
-separate multiple topics with a ';'.  The index ctrls HI:index links.
-
-public causes a sym to appear in help_index reports.
-
-#help_file "filename[.DD.Z]"
-The help file preprocessor directive makes a file into the heading of a 
-HI:index report for the current help index.
-
- diff --git a/public/Wb/Home/Doc/HolyC.DD.HTML b/public/Wb/Home/Doc/HolyC.DD.HTML deleted file mode 100755 index a2cd37f..0000000 --- a/public/Wb/Home/Doc/HolyC.DD.HTML +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - -
-                                     HolyC
-
-* See ::/Doc/CompilerOverview.DD.
-
-* See Scoping and Linkage for details on extern, import, _extern, _import, etc.
-
-* Built-in types include I0,I8,I16,I32,I64 for signed 0-8 byte ints and U0,U8,U1
-6,U32,U64 for unsigned 0-8 byte ints and F64 for 8 byte floats.
-
-        U0      void, but ZERO size!
-        I8      char
-        U8      unsigned char
-        I16     short
-        U16     unsigned short
-        I32     int
-        U32     unsigned int
-        I64     long (64-bit)
-        U64     unsigned long (64-bit)
-        F64     double
-        no F32 float.
-
-* Function with no args, or just default args can be called without parentheses. 
-
-  >Dir("*");
-  >Dir();
-  >Dir;
-
-* Default args don't have to be on the end.  This code is valid:
-  U0 Test(I64 i=4,I64 j,I64 k=5)
-  {
-    Print("%X %X %X\n",i,j,k);
-  }
-  
-  Test(,3);
-
-* A char const all alone is sent to PutChars().  A string with or without args 
-is sent to Print().  An empty string literal signals a variable fmt_str follows.
-
-  void DemoC(char drv,char *fmt,char *name,int age)
-  {
-    printf("Hello World!\n");
-    printf("%s age %d\n",name,age);
-    printf(fmt,name,age);
-    putchar(drv);
-    putchar('*');
-  }
-  
-  U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age)
-  {
-    "Hello World!\n";
-    "%s age %d\n",name,age;
-    "" fmt,name,age;
-    '' drv;
-    '*';
-  }
-
-* When dealing with function addresses such as for callbacks, precede the name 
-with "&".
-
-* Type casting is postfix.  To typecast int or F64, use ToI64(), ToBool() or 
-ToF64(). (TempleOS follows normal C float<-->int conversion, but sometimes you 
-want to override.  These functions are better than multiplying by "1.0" to 
-convert to float.) 
-
-* There is no main() function.  Any code outside of functions gets executed upon 
-start-up, in order.
-
-* There are no bit fields, but there are bit access routines and you can access 
-bytes or words within any int.  See I64 declaration.  A class can be accessed as 
-a whole are subints, if you put a type in front of the class declaration.
-  
-  public I64i union I64         //"I64i" is intrinsic.  We are defining "I64".
-  {
-    I8i i8[8];
-    U8i u8[8];
-    I16 i16[4];
-    U16 u16[4];
-    I32 i32[2];
-    U32 u32[2];
-  };
-  
-  I64 i=0x123456780000DEF0;
-  i.u16[1]=0x9ABC;
-
-* Variable arg count functions (...) can access their args with built-in 
-variables similar to 'this' in C++.  They are 'I64 argc' and 'I64 argv[]'.  
-  
-  I64 AddNums(...)
-  {
-    I64 i,res=0;
-    for (i=0;i<argc;i++)
-      res+=argv[i];
-    return res;
-  }
-  
-  >AddNums(1,2,3);
-  ans=6
-  
-  
-  public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
-  {
-    U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);//SPrintF() with MAlloc()ed string.
-    GrPutS(dc,x,y,buf); //Plot string at x,y pixels. GrPutS is not public.
-    Free(buf);
-  }
-  
-    ...
-  
-    GrPrint(gr.dc,(GR_WIDTH-10*FONT_WIDTH)>>1,(GR_HEIGHT-FONT_HEIGHT)>>1,
-        "Score:%4d",score);  //Print score in the center of the scrn.
-    ...
-  
-
-* Allows "5<i<j+1<20" instead of "5<i && i<j+1 && j+1<20".
-  
-  if (13<=age<20)
-    "Teen-ager";
-
-* if you know a switch stmt will not exceed the lowest or highest case values.  
-switch [] is a little faster because it doesn't check.
-
-* switch stmts always use a jump table.  Don't use them with cases with really 
-big, sparse ranges.
-
-* Allows ranges like "case 4...7:" in switch stmts.
-
-* A no case number causes next higher int case in switch stmts.  See 
-::/Demo/NullCase.HC.
-
-  I64 i;
-  for (i=0;i<20;i++) 
-    switch (i) {
-      case: "Zero\n";   break; //Starts at zero
-      case: "One\n";    break; //One plus prev case.
-      case: "Two\n";    break;
-      case: "Three\n";  break;
-      case 10: "Ten\n"; break;
-      case: "Eleven\n"; break; //One plus prev case.
-  }
-
-* Switch statements can be nestled with a single switch expression!  This is 
-known as a "sub_switch" statement.  start/end are used to group cases.  Don't 
-goto out of, throw an exception out of, or return out of the start front porch 
-area.  See ::/Demo/SubSwitch.HC.
-
-  I64 i;
-  for (i=0;i<10;i++)
-    switch (i) {
-      case 0: "Zero ";  break;
-      case 2: "Two ";   break;
-      case 4: "Four ";  break;
-      start:
-        "[";
-        case 1: "One";  break;
-        case 3: "Three";break;
-        case 5: "Five"; break;
-      end:
-        "] ";
-        break;
-    }
-  OutPut:
-  >Zero [One] Two [Three] Four [Five]
-
-* A no_warn stmt will suppress an unused var warning.
-
-* You can have multiple member vars of a class named "pad" or "reserved", and it 
-won't issue warnings. 
-
-* noreg or reg can be placed before a function local var name.  You can, 
-optionally, specify a reg after the reg keyword.
-
-  U0 Main()
-  {
-    //Only use REGG_LOCAL_VARS or REGG_LOCAL_NON_PTR_VARS for reg vars or else 
-  clobbered.
-    I64 reg R15 i=5, noreg j=4;
-    no_warn i;
-    asm {
-        MOV     RAX,R15
-        CALL    &PUT_HEX_U64
-        MOV     RAX,'\n'
-        CALL    &PUT_CHARS
-        MOV     RAX,U64 &j[RBP]
-        CALL    &PUT_HEX_U64
-        MOV     RAX,'\n'
-        CALL    &PUT_CHARS
-    }
-  }
-
-* interrupt, haserrcode, public, argpop or noargpop are function flags. See 
-IRQKbd().
-
-* A single quote can encompass multiple characters.  'ABC' is equ to 0x434241.  
-PutChars() takes multiple characters.
-
-  asm {
-  HELLO_WORLD::
-        PUSH    RBP
-        MOV     RBP,RSP
-        MOV     RAX,'Hello '
-        CALL    &PUT_CHARS
-        MOV     RAX,'World\n'
-        CALL    &PUT_CHARS
-        LEAVE
-        RET
-  }
-  Call(HELLO_WORLD);
-  PutChars('Hello ');
-  PutChars('World\n');
-
-* The "`" operator raises a base to a power.
-
-* There is no question-colon operator.
-
-* TempleOS operator precedence
-  `,>>,<<
-  *,/,%
-  &
-  ^
-  |
-  +,-
-  <,>,<=,>=
-  ==,!=
-  &&
-  ^^
-  ||
-  =,<<=,>>=,*=,/=,&=,|=,^=,+=,-=
-
-* You can use Option(OPTf_WARN_PAREN,ON) to find unnecessary parentheses in 
-code.
-
-* You can use Option(OPTf_WARN_DUP_TYPES,ON) to find dup local var type stmts.
-
-* With the #exe{} feature in your src code, you can place programs that insert 
-text into the stream of code being compiled.  See #exe {} for an example where 
-the date/time and compile-time prompting for cfguration data is placed into a 
-program.  StreamPrint() places text into a src program stream following the 
-conclusion of the #exe{} blk.
-
-* No #define functions exist (I'm not a fan)
-
-* No typedef, use class.
-
-* No type-checking
-
-* Can't use <> with #include, use "".
-
-* "$" is an escape character.  Two dollar signs signify an ordinary $.  See 
-DolDoc.  In asm or HolyC code, it also refers to the inst's address or the 
-offset in a class definition. 
-
-* union is more like a class, so you don't reference it with a union label after 
-you define it.  Some common unions are declared in KernelA.HH for 1,2,4 and 8 
-byte objects.  If you place a type in front of a union declaration, that is the 
-type when used by itself.  See ::/Demo/SubIntAccess.HC. 
-
-* class member vars can have meta data. format and data are two meta data types 
-now used.  All compiler structures are saved and you can access the compiler's 
-info about classes and vars.  See ::/Demo/ClassMeta.HC and  DocForm().
-
-* There is a keyword lastclass you use as a dft arg.  It is set to the class 
-name of the prev arg.  See ::/Demo/LastClass.HC, ClassRep(), DocForm()  and 
-::/Demo/Dsk/BlkDevRep.HC.
-
-* See ::/Demo/Exceptions.HC.  try{} catch{} and throw are different from C++. th
-row is a function with an 8-byte or less char arg.  The char string passed in th
-row() can be accessed from within a catch{} using the Fs->except_ch.  Within a c
-atch {} blk, set the var Fs->catch_except to TRUE if you want to terminate the 
-search for a hndlr.  Use PutExcept() as a hndlr, if you like.
-
-* A function is available similar to sizeof which provides the offset of a 
-member of a class.  It's called offset.  You place the class name and member 
-inside as in offset(classname.membername).  It has nothing to do with 16-bit 
-code.  Both sizeof and offset only accept one level of member vars.  That is, 
-you can't do sizeof(classname.membername.submembername).
-
-* There is no continue stmt.  Use goto.
-
-* lock{} can be used to apply asm LOCK prefixes to code for safe multicore 
-read-modify-write accesses.  The code bracked with have LOCK asm prefix's 
-applied to relevant insts within.  It's a little shoddy.  See 
-::/Demo/MultiCore/Lock.HC.
-
-* There is a function called MSize() which gives the size of an object alloced 
-off the heap.  For larger size allocations, the system rounds-up to a power of 
-two, so MSize() lets you know the real size and you can take full advantage of 
-it.
-
-* You CAN Free() a NULL ptr.  Useful variants of MAlloc() can be found Here.  
-Each task has a heap and you can MAlloc and Free off-of other task's heaps, or 
-make an independent heap with HeapCtrlInit().  See HeapLog() for an example.
-
-* The stk does not grow because virtual mem is not used.  I recommend allocating 
-large local vars from the heap.  You can change MEM_DFT_STK and recompile Kernel 
-or request more when doing a Spawn().  You can use CallStkGrow(), but it's odd.  
-See ::/Demo/StkGrow.HC. 
-
-* Only one base class is allowed.
-
-* printf() has new codes.  See Print("") Fmt Strings.
-
-* All values are extended to 64-bit when accessed.  Intermediate calculations 
-are done with 64-bit values.
-
-  U0 Main()
-  {
-    I16 i1;
-    I32 j1;
-    j1=i1=0x12345678;           //Resulting i1 is 0x5678 but j1 is 0x12345678
-  
-    I64 i2=0x8000000000000000;
-    Print("%X\n",i2>>1);        //Res is 0xC000000000000000 as expected
-  
-    U64 u3=0x8000000000000000;
-    Print("%X\n",u3>>1);        //Res is 0x4000000000000000 as expected
-  
-    I32 i4=0x80000000;          //const is loaded into a 64-bit reg var.
-    Print("%X\n",i4>>1);        //Res is 0x40000000
-  
-    I32 i5=-0x80000000;
-    Print("%X\n",i5>>1);        //Res is 0xFFFFFFFFC0000000
-  }
-
-
- diff --git a/public/Wb/Home/Doc/InFile.DD.HTML b/public/Wb/Home/Doc/InFile.DD.HTML deleted file mode 100755 index ef12804..0000000 --- a/public/Wb/Home/Doc/InFile.DD.HTML +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - -
-InFiles are used to generate user input to automate operations.  The TempleOS 
-tour is done with an InFile.  It reminds me of a Unix pipe because StdOut of one 
-gets chained into StdIn of another.
-
-When an InFile runs, a child task is Spawn()ed which intercepts real user input 
-and generates fake input.  InFiles are HolyC programs run by the child whose 
-stdout goes to the parent's input buffer.  Msg() can be included in an InFile to 
-send special keys or mouse cmds to the parent.  While an InFile is running, the 
-normal input gets diverted to the InFile task and can be filtered and sent back 
-to the parent task.  Unless you are driving functions which prompt for data, you 
-can probably use an #include file in place of an InFile.
-
-See ::/Demo/InFile/InDir.IN.
-
-Note: In("") can be used if all you need is to send ASCII characters.  It 
-differs from InStr().  You'll probably use In() a lot and not InStr().  With In(
-), for example, you can place answers to the prompts for recompiling the Kernel 
-module during BootHDIns().
-
- diff --git a/public/Wb/Home/Doc/Install.DD.HTML b/public/Wb/Home/Doc/Install.DD.HTML deleted file mode 100755 index 3c29a84..0000000 --- a/public/Wb/Home/Doc/Install.DD.HTML +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - -
-                              Installing TempleOS
-
-Burn a CD with software that supports ISO files.  Then, boot it.  It's a live 
-CD, so you can look around with or without installing.
-
-Dual booting with another operating system is the best way to use TempleOS.  I 
-only use it in a virtual machine because it won't boot natively on my machine, 
-though.  For native dual booting, you need a partition for TempleOS.  Windows 
-often comes with a restore disk that does not allow repartitioning.  I recommend 
-connecting a spare additional hard drive and using the BIOS to select which 
-drive to boot.
-
-The ::/Misc/OSInstall.HC script will automate much of this.  It runs if you boot 
-the CD/DVD-ROM.
-
-See Boot.DD for an overview of booting.  See Requirements for supported 
-hardware.
-
-Two TempleOS partitions are highly recommended, so you can boot to a back-up and 
-fix the primary when you work on it.  Odds are, you only need a couple gigabytes 
-for your TempleOS partitions.
-
-1)
-  Mount() use if the drive is partitioned.
-    This command mounts a drive making it accessible.  For simplicity, sel 'C' 
-    as the first drive letter for your hard drive.  The first partition will be 
-    'C', second, 'D', etc.  TempleOS needs 3 numbers to utilize a hard drive -- 
-    base0, base1, and unit.  When you enter a hexadecimal number, do it like in 
-    C with a 0x prefix.  If the probe was successful, you can just enter the 
-    number in the probe box instead of base0.
-  
-  DskPrt('C') use if drive is not partitioned
-  
-    This will perform a special Mount() automatically.
-    
-    WARNING:  This command erases everything on a hard drive.  It repartitions a 
-    whole drive and formats the partitions.  This command should be skipped if 
-    you already have your hard drive partitioned.
-    
-    
-    WARNING:  This command doesn't play well with other operating systems.  
-    You'll need to do a BootMHDZero() to restore your drive to a state where 
-    other operating systems can partition it.
-  
-2) Fmt('D',TRUE,FALSE,FSt_FAT32)
-  This command formats a drive with FAT32 or the RedSea file system type.  Use 
-  the drive letter of the partition in place of 'D'.
-  
-  WARNING:  If you are upgrading, be sure not to lose the file, /0000Boot/OldMBR
-  .BIN.C.
-  
-3) CopyTree("T:/","D:/")
-  This command is used to copy files onto a hard drive partition from the 
-  CD/DVD.  Use the drive letter of the partition in place of 'D'.
-  
-4) BootHDIns('D')
-  This command recompiles the source code on a drive and writes to the drive's 
-  boot record.  You'll need to reenter the Mount information so it can be stored 
-  in the kernel.
-  
-5) Use Linux's Grub or TempleOS' BootMHDIns('D')
-  
-  The BootMHDIns() command places a boot loader on a drive.  It saves the old 
-  master boot record to /0000Boot/OldMBR.BIN.C and replaces it.  When you boot, 
-  you will have the option of booting the old master boot record.  This command 
-  can be skipped if you already have a boot loader.  Be sure not to lose the 
-  copy of the old boot record, like if you reformat the drive.
-  
-  Delete /0000Boot/OldMBR.BIN.C if you want to get a fresh copy of a mbr, like 
-  if installing from your own custom CD containing it's own /0000Boot/OldMBR.BIN
-  .C onto a system with a non-TempleOS boot loader.
-  
-  If you have anti-virus software, it might object to having a different master 
-  boot record.
-
-
-* "Windows" is a trademark owned by MicroSoft Corp.
-* "Linux" is a trademark owned by Linus Torvalds.
-
- diff --git a/public/Wb/Home/Doc/Job.DD.HTML b/public/Wb/Home/Doc/Job.DD.HTML deleted file mode 100755 index ecb46f6..0000000 --- a/public/Wb/Home/Doc/Job.DD.HTML +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - -
-/* Graphics Not Rendered in HTML */
-               PopUpPrint                         User          ExePrint
-
-
-
-                  PopUp                                          ExePutS
-
-
-
- Core0 AdamTask  SrvCmdLine   AP SethTask       UserCmdLine
-
-
-
-
-
-
-         SrvTaskCont                          UserTaskCont
-
-
-
-        JobsHndlr
-
-
-
-         JobRunOne           JobRunOne         ExeCmdLine      ExeCmdLine
-
-
-
-
-CJob nodes are one of five types.  User applications deal with text or msgs.  
-JobRunOne() will call a function, spawn a task or execute some text src code.
-
-#define JOBT_TEXT_INPUT         0 //TaskText()  Feed StdIn 
-#define JOBT_MSG                1 //TaskMsg()   Post msg 
-#define JOBT_EXE_STR            2 //TaskExe()   Compile & execute src code text
-#define JOBT_CALL               3 //JobQue()    Tell MP to call function
-#define JOBT_SPAWN_TASK         4 //Spawn()     Tell MP to spawn task
-
-Several other routines include a call to JobsHndlr() that gives them powerful 
-ability to execute servant cmds.
-
- diff --git a/public/Wb/Home/Doc/KeyAlloc.DD.HTML b/public/Wb/Home/Doc/KeyAlloc.DD.HTML deleted file mode 100755 index 815eb33..0000000 --- a/public/Wb/Home/Doc/KeyAlloc.DD.HTML +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - -
-                                Key Allocations
-
-See Char for definition of scan codes.
-
-See Key Map for a detailed list of key commands.
-
-When you are at the cmd line, editing documents, browsing documentation and 
-help, entering items in forms or in menu's, the DolDoc editor handles keys.  It 
-allows you to define your own key hndlrs in a MyPutKey() function.  If you 
-choose, you can catch keys, overriding the default hndlrs.  See DocPutKey().  
-The following is an overview of key allocations.
-
-<ALT-keys> and <ALT-SHIFT-keys>  Free for user configurations in your MyPutKey() 
-hndlr, except for ALT-BACKSPACE (undo).  There are a few examples pre-defined, 
-but you can change them if you wish.
-
-<CTRL-ALT-keys> and <CTRL-ALT-SHIFT-keys>  Handled at a system level, NOT by the 
-CDoc editor.  I reserve the right to alloc these, but in the mean time, you can 
-define your own hndlrs with CtrlAltCBSet().  They operate either in a interrupt 
-environment or in the window mgr when it queues kbd msgs.  You can do Raw() 
-output.  <CTRL-ALT-letter> hndlrs take a scan_code as an arg.
-
-<CTRL-function key>  Auto-completes local words.
-
-<CTRL-digit key>  Auto-completes dictionary words.
-
-<CTRL-SHIFT-function key>  Jumps to src code.
-
-<CTRL-SHIFT-digit key>  Jumps to dictionary definition.
-
-<function keys> and <SHIFT-function keys>  I reserve the right to alloc these, 
-but there are some free now.
-
-<CTRL-key> and <CTRL-SHIFT-key>  I reserve the right to alloc to these.  There 
-are not many free.
-
-See Keyboard Devices.
-
- diff --git a/public/Wb/Home/Doc/KeyDev.DD.HTML b/public/Wb/Home/Doc/KeyDev.DD.HTML deleted file mode 100755 index f7c40a2..0000000 --- a/public/Wb/Home/Doc/KeyDev.DD.HTML +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - -
-The editor mostly stays in a GetKey()/PutKey() loop.  The putkey portion is 
-where keys are acted-upon.  TempleOS has a chain of putkey hndlrs in a 
-Circular Queue with priorities.  The highest priority hndlrs can choose to 
-terminate handling, otherwise, the keys get sent on down the chain.
-
-KeyDevAdd() defines a putkey device with a priority.  "Device" might be a 
-misnomer.  Currently, the following are defined:
-
-Priority    Hndlr
----------- ---------
-0x20000000 MyPutKey() user hndlr
-0x40000000 KDInputFilterPutKey() for In(), InStr(), and InFile() handling.
-0x60000000 KDRawPutKey() nonwindowed direct to video mem debug output. 
-0x80000000 KDDocPutKey() standard document cmds
-
-Since handling individual keys is slow, TempleOS supports PutS() as well.  If no 
-puts hndlr is defined, individual keys are sent.
-
-CDoc.user_put_key and CDoc.user_put_s are call back routines which offer some 
-neat tricks.  See ::/Apps/Psalmody/JukeBox.HC.  There is a var CDoc.user_put_dat
-a which gets passed to them.
-
- diff --git a/public/Wb/Home/Doc/Lex.DD.HTML b/public/Wb/Home/Doc/Lex.DD.HTML deleted file mode 100755 index c5ec281..0000000 --- a/public/Wb/Home/Doc/Lex.DD.HTML +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -
-The compiler's lexical analyzer can be used in your programs to simplify 
-parsing.  See Doc Parsing or Parse Opcode File.
-
-See Tokens.
-
- diff --git a/public/Wb/Home/Doc/MemOverview.DD.HTML b/public/Wb/Home/Doc/MemOverview.DD.HTML deleted file mode 100755 index 1e27208..0000000 --- a/public/Wb/Home/Doc/MemOverview.DD.HTML +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - -
-                                Memory Overview
-
-Paging is practically not used.  64-bit mode requires paging, however, so it is 
-identity-mapped -- virtual identical to physical.  All tasks on all cores use 
-the same page table map, just as though all addresses are physical addresses.  
-2Meg or 1Gig page table entries are used.  Nothing swaps to disk.
-
-In TempleOS, the lowest 2Gig of memory is called the code heap.  TempleOS's 
-compiler always uses 32-bit signed relative JMP & CALL insts because 64-bit 
-CALLs take two insts.  With signed +/- 32-bit values, code can only call a 
-function within 2Gig distance.  Therefore, TempleOS keeps all code in the lowest 
-2Gig memory addresses including what would normally be called "the kernel".  Two 
-Gig is plenty for code, don't worry.
-
-You can create new, independent heaps using HeapCtrlInit().  Then, use the 
-CHeapCtrl as the 2nd arg to MAlloc().  See HeapLog() for an example.
-
-Memory alloced by a task will be freed when the task is killed.  The Adam Task 
-is a task that never dies.  His memory is like kernel memory in other operating 
-systems.  See ACAlloc(), AMAlloc(), AMAllocIdent() and AStrNew().
-
-All of the regular page tables are marked, "cached".  When accessing hardware, 
-however, you need uncached page table.  The lowest 4Gig addresses have an alias 
-to access hardware located toward the top of mapped space, 0x10000000000.  See 
-dev.uncached_alias.
-
-During an extended powered-on session of TempleOS, in theory, memory will become 
-fragmented, requiring a reboot.  It has never happens to me.
-
-See MemRep() and ::/Demo/MemDemo.HC.
-
-
-                           Single System-wide Mem Map
-
- 0x0000007C00- 0x000003616F
-  Kernel module, placed here by the boot-loader, BOOT_RAM_BASE.
-
- 0x0000096600- 0x0000096FFF
-  Boot block relocated here before loading the Kernel module, BootDVD & BootHD.
-
- 0x0000097000- 0x0000097030 Multicore start-up vect code, MPN_VECT.
-~0x000009F000- 0x000009FFFF Extended BIOS data area.
- 0x00000A0000- 0x00000BFFFF VGA graphics mem with alias at text.vga_alias.
- 0x0000100000- 0x0000101FFF CSysFixedArea for misc.
- 0x000050A000- 0x001FFDFFFF Code Heap mem.
-
- 0x00E0000000- 0x00FFFFFFFF
-  32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, 
-  since some PCs already have devices at 0xF0000000.  No PCI devices are 
-  supported, so Mem32DevAlloc() flaws are not an issue.
-
- 0x0080000000-~0x00DFFFFFFF
- 0x0100000000-~0xFFFFFFFFFF
-  Data Heap mem.  (The physical memory that exists in this range is data heap.)
-
- 0x10000000000- 0x100FFFFFFFF
-  Uncached alias of first 4Gig.  (For 32-bit device access.)
-
-             - 0x100FFFFFFFF
-  64-bit devices are alloced with Mem64DevAlloc() counting bwd, but no PCI 
-  devices are actually supported.
-
-
-
-* Note: There is a break in the data-heap block pool.  This has no effect except 
-the obvious effect that fragmentation has on contiguous requests.  I can MAlloc(
-) an 8Gig chunk on my 12Gig machine.  I can MAlloc() an 32Gig chunk on my 64Gig 
-machine.  
-
-* Note: For systems with less than 2Gig RAM, the code and data heap block pools 
-are the same.  For systems with 2-4Gig of RAM, the code heap is 1/4 of the 
-total.  See BlkPoolsInit().
-
-
-                                    History
-
-In 2003, I wanted to make a no-paging ring-0-only 64-bit operating system for 
-super speed with simplicity and full access.  With paging, every memory request 
-requires 5 accesses -- it must access the address itself, 4K, 2Meg, 1Gig, and 
-512Gig page tables, but the CPU's translation look-aside buffer mostly removes 
-the penalty for using paging.  So, I did not want to use paging, but long mode 
-requires it.  I did the next best thing -- I identity-mapped everything and 
-achieved the simplicity I was after with subtle performance boosts, not wasting 
-time changing address maps.  And, I look forward to the day I command Intel to 
-make an optimized no-paging long mode.
-
-I needed VGA A0000-BFFFF memory to be write-through and 0xE0000000-0xFFFFFFFF to 
-be uncached for various devices.  All 64-bit computers allow stopping address 
-translation at 2Meg page size, not using 4K.  I wanted to use 2Meg for 
-everything because it's faster, with one less level of page tables.  I had to 
-make A0000-BFFFF write-through, though, so I could not use 2Meg size on the 
-lowest page.  I did the lowest 2Meg area as 4K pages.  I also unmapped the first 
-4K to cause a fault when dereferencing NULL.
-
-In 2016, I came-up with an alternate idea.  I double mapped the lowest memory 
-with an alias that was uncached.  Accessing the lowest 2Meg area directly was 
-cached but the alias I created up at the top of address space was uncached.  See 
-UncachedAliasAlloc().  Unfortunately, I could no longer boast of the simplicity 
-of identity mapping everything.  Since many of my users are familiar with 
-A0000-BFFFF, it is actually pretty seriously unfortunate that they cannot use 
-the easy-to-understand numbers of A0000-BFFFF, but must access the relocated 
-alias location.  See text.vga_alias.  I also no longer cause a fault when 
-dereferencing NULL.
-
-Then, I switched to 1Gig page sizes.  For the lowest 4Gig, I set-up an alias up 
-at the top of address space.  See UncachedAliasAlloc().  Not all computers 
-support 1Gig page tables, however, so I also support 2Meg.
-
-My original plan was to allow changing the page tables as needed, so I had code 
-for taking control of 2Meg pages and marking them uncached or whatever.  When I 
-did a HDAudio driver, I requested some 32-bit address space as uncached.  Today, 
-all of the first 4Gig can be accessed without caching at the dev.uncached_alias.
-
- diff --git a/public/Wb/Home/Doc/Menus.DD.HTML b/public/Wb/Home/Doc/Menus.DD.HTML deleted file mode 100755 index dc8d4b0..0000000 --- a/public/Wb/Home/Doc/Menus.DD.HTML +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - -
-A pull-down menu appears when you move the mouse to the top of the scrn.  Menus 
-are created with MenuPush(), MenuFilePush(), MenuNew() or MenuFile() and 
-assigned to Fs->cur_menu.  The format is:
-
-
-File 
-{
-  Open(,'O');
-  Save(,'S');
-  Exit(,CH_SHIFT_ESC);
-}
-Edit {
-  Cut(,,SC_DELETE|SCF_SHIFT);
-  Paste(,,SC_INS|SCF_SHIFT);
-}
-Misc {
-  Opt1(MSG_CMD,M_OPTION1);
-  Opt2(MSG_CMD,M_OPTION2);
-}
-Help
-{
-  Help(,'?');
-  About(,'/');
-}
-
-The first arg is the msg code and it is optional with the default being 
-MSG_KEY_DOWN_UP.  The second arg is the msg arg1 value which is ASCII of the key 
-in the case of MSG_KEY_DOWN.  The third arg is the msg arg2 value which is the 
-scan_code of the key in the case of MSG_KEY_DOWN.
-
-Press <CTRL-SHIFT-l> and "Insert ASCII/ScanCode".
-
-See ::/Demo/PullDownMenu.HC.
-
- diff --git a/public/Wb/Home/Doc/Mouse.DD.HTML b/public/Wb/Home/Doc/Mouse.DD.HTML deleted file mode 100755 index 6c36bfb..0000000 --- a/public/Wb/Home/Doc/Mouse.DD.HTML +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - -
-ms.pos.x and ms.pos.y can be used to access the x and y coordinates of the 
-mouse.  They are relative to the scrn, not window.  These can be used if you 
-don't want to use msg passing.  ms.pos.z is the wheel.
-
-ms.pos_text.x and ms.pos_text.y are the text column and row.  See 
-::/Demo/Games/Maze.HC.
-
-See CMsStateGlbls and CMsHardStateGlbls.
-
-The hard designation, as in ms_hard, represents hardware layer items before the 
-application of an abstraction layer.
-
-//****
-ms_hard.pos.x=ms_hard.prescale.x*ms_hard.scale.x*ms_grid.x_speed;
-ms.presnap.x=ToI64(ms.scale.x*ms_hard.pos.x)+ms.offset.x;
-if (ms_grid.snap)
-  ms.pos.x=Trunc(ms.presnap.x/ms_grid.x)*ms_grid.x+ms_grid.x_offset;
-else
-  ms.pos.x=ms.presnap.x;
-//****
-
- diff --git a/public/Wb/Home/Doc/Msgs.DD.HTML b/public/Wb/Home/Doc/Msgs.DD.HTML deleted file mode 100755 index dee3f4b..0000000 --- a/public/Wb/Home/Doc/Msgs.DD.HTML +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
-There are a maximum of 63 message types, so a bitmask can be passed.  Messages 
-have two args.  See Message Codes.
-
- diff --git a/public/Wb/Home/Doc/MultiCore.DD.HTML b/public/Wb/Home/Doc/MultiCore.DD.HTML deleted file mode 100755 index 5e9b63c..0000000 --- a/public/Wb/Home/Doc/MultiCore.DD.HTML +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - -
-TempleOS does master-slave multicore instead of SMP.  Core0 is the master.  The 
-master core's applications explicitly assign computational jobs to other cores 
-and the TempleOS scheduler does not move tasks between cores.
-
-There are multicore safe locks for file access and heap allocations, however, so 
-TempleOS is symmetrical in some sense.  See ::/Demo/MultiCore/LoadTest.HC.
-
-Only tasks on Core0 can have windows, but other cores can help render them.
-
-Each core has an executive Seth Task which is the father of all tasks on that 
-core.  Adam is the Seth Task on Core0.
-
-You give a job to a Seth Task with JobQue() and get the result with JobResGet(). 
- You spawn a task on any core with Spawn().
-
-Note: You must use the LOCK asm prefix when changing shared structures in a 
-multicore environment.  The LBts(), LBtr() and LBtc() insts have LOCK prefixes.  
-The compiler has a lock{} feature but it doesn't work well.  See 
-::/Demo/MultiCore/Lock.HC.
-
-See ::/Demo/Graphics/Transform.HC.
-See ::/Kernel/MultiProc.HC.
-
- diff --git a/public/Wb/Home/Doc/NewASCII.DD.HTML b/public/Wb/Home/Doc/NewASCII.DD.HTML deleted file mode 100755 index 769a5ec..0000000 --- a/public/Wb/Home/Doc/NewASCII.DD.HTML +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - -
-                                   New ASCII
-
-
-We want to use one set for ASCII, ScanCodes and ScreenCodes.
-
-
-0  -63  :
-64 -127 : SHIFT
-128-191 : CTRL
-192-256 : CTRL+SHIFT
-
-No more ALT key in TempleOS.
-
-CTRL-LEFT/RIGHT is already begin/end line.
-CTRL-UP/DOWN    is already top/bottom of document.
-
-What about function keys?
-We will use reduced keyboard, probably.
-
-
-
-God says...
-clearest bade domine chance none quoth privily subjection possessor abolished
-
-
-
-
- diff --git a/public/Wb/Home/Doc/ODE.DD.HTML b/public/Wb/Home/Doc/ODE.DD.HTML deleted file mode 100755 index 030966f..0000000 --- a/public/Wb/Home/Doc/ODE.DD.HTML +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - -
-TempleOS has an advanced algorithm for integrating ordinary differential 
-equations suitable for use in video games.  (Not scientific work.)  It also has 
-some support for systems of masses and springs, to save you some work.
-
-See CMathODE and ODEsUpdate for an overview.
-See ODECallDerivative to see what support there is for masses and springs.
-
-See ::/Demo/Games/Whap.HC, ::/Demo/Games/Rocket.HC, ::/Demo/Games/MassSpring.HC, 
-::/Apps/Span/SpanMain.HC or ::/Apps/X-Caliber/X-Caliber.HC.
-
- diff --git a/public/Wb/Home/Doc/Once.DD.HTML b/public/Wb/Home/Doc/Once.DD.HTML deleted file mode 100755 index 78b2712..0000000 --- a/public/Wb/Home/Doc/Once.DD.HTML +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - -
-KMain()
-  includes ::/StartOS.HC
-    includes ~/MakeHome.HC
-      includes ~/HomeSys.HC
-        calls StartUpTasks()
-          includes ~/Once.HC
-            calls OnceExe().
-
-AOnce() appends src code to ~/Registry.HC Once/Adam tree, executed at next boot 
-by Adam.
-
-Once()  appends src code to ~/Registry.HC Once/User tree, executed at next boot 
-by first User term.
-
-At boot, OnceExe(), executes Once/Adam tree, AOnceFlush()s it,
-executes Once/User tree and OnceFlush()s.
-
- diff --git a/public/Wb/Home/Doc/Options.DD.HTML b/public/Wb/Home/Doc/Options.DD.HTML deleted file mode 100755 index def5955..0000000 --- a/public/Wb/Home/Doc/Options.DD.HTML +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - -
-                                Compiler Options
-
-Use Option().  You might need to do #exe {Option();}.
-
-OPTf_GLBLS_ON_DATA_HEAP without this option, global vars are placed in the code 
-heap which is limited to 2Gig.  In AOT modules, global vars take-up room in the 
-.BIN file, so you might want to use this option, instead.  You might wish to 
-turn it on and off around specific vars.  A disadvantage of data heap global 
-vars in AOT modules is they can't be initialized.
-
-OPTf_EXTERNS_TO_IMPORTS and OPTf_KEEP_PRIVATE are strange options, you'll never 
-need.  They're to allow the same header file for Kernel to act as externs when 
-compiling itself and imports when compiled by AOT modules.
-
-OPTf_WARN_UNUSED_VAR    warning if unused var.  It is applied to functions.
-
-OPTf_WARN_PAREN         warning if parenthesis are not needed.
-
-OPTf_WARN_DUP_TYPES     warning if dup local var type stmts.
-
-OPTf_WARN_HEADER_MISMATCH warning if fun header does not match.
-
-OPTf_NO_REG_VAR forces all function local vars to the stk not regs.  Applied to 
-functions.
-
-OPTf_NO_BUILTIN_CONST Disable 10-byte float consts for pi, log2_10, log10_2, 
-loge_2.  Applied to functions.
-
- diff --git a/public/Wb/Home/Doc/Pags.DD.HTML b/public/Wb/Home/Doc/Pags.DD.HTML deleted file mode 100755 index bb1cb6a..0000000 --- a/public/Wb/Home/Doc/Pags.DD.HTML +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -
-The word Pag refers to an arbitrilly created MEM_PAG_SIZE unit of heap 
-allocation.  TempleOS does not alter the CPU page tables after setting them up 
-at boot in SYS_INIT_PAGE_TABLES, so the CPU hardware page size is rarely 
-important.
-
- diff --git a/public/Wb/Home/Doc/PreProcessor.DD.HTML b/public/Wb/Home/Doc/PreProcessor.DD.HTML deleted file mode 100755 index 80d5b97..0000000 --- a/public/Wb/Home/Doc/PreProcessor.DD.HTML +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - -
-                                  PreProcessor
-
-There is no separate preprocessor pass.  The parser front-end calls Lex() which 
-has the preprocessor built-in.  The compiler looks ahead a token, most of the 
-time, so you might throw an extra semicolon after a directive if it's not taking 
-affect right away.
-
-Put an extra semicolon #exe {Cd("DirName");;} in case a #include follows.
-
-#include ""     There is no angle bracket <> form of this directive.
-#exe {}         Will execute code at compile-time and can be used to insert code 
-into the stream being compiled using StreamPrint().
-#define         Define string const
-#assert         Print a warning during compilation if an expression is not true. 
-#if             Include code if an expresion is true.
-#else
-#endif
-#ifdef,#ifndef  Include code if a sym is defined.
-#ifaot,#ifjit   Include code if in AOT compiler mode.
-defined()       Is a function that can be used in expressions.
-#help_index, #help_file See Help System.
-
-See PreProcessor.
-
- diff --git a/public/Wb/Home/Doc/Print.DD.HTML b/public/Wb/Home/Doc/Print.DD.HTML deleted file mode 100755 index 938606d..0000000 --- a/public/Wb/Home/Doc/Print.DD.HTML +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - -
-                                 Print Fmt Strs
-
-<fmt_arg> := %[-][0][<width>][.<decimals>][<flags>][h<aux_fmt_num>]<fmt_code>
-
-See StrPrintJoin().
-
-<flags>:
-
-  't' truncate to <width>.
-  ',' add commas every three digits or four nibbles.
-  '$' makes %Q convert '$' to "\x24".
-  '/' makes %Q and %q convert '%' to "%%".
-
-<aux_fmt_num>:
-
-  For "%n", "%d" or "%u", the <aux_fmt_num> causes thousands mode.  "%h?n" will 
-  pick a var exponent multiples of three unit, while "%h-3n" will display milli 
-  units or "%h6n" will display mega units.  The 'k' flag is always on for "%n".  
-  See ::/Demo/Print.HC.
-  
-For "%c" or "%C", the <aux_fmt_num> repeats the char that many times.
-
-<fmt_code>:
-
-  "%n" floating point in engineering notation, exponents being multiples of 
-  three.  If it has a <aux_fmt> code, it will display scientific units letters.
-  
-  "%S" Define() entry.
-  
-  "%C" ToUpper() character.
-  
-  "%h25c",'\n'; 25 new-lines.
-  
-  "%h*c",25,'\n'; 25 new-lines.
-  
-  "%F" text file by filename.
-  
-  "%$F" DolDoc file in memory.
-  
-  "%p" ptr. 
-  
-  "%,p" ptr with no offset. 
-  
-  "%P" link to ptr.
-  
-  "%,P" link to ptr with no offset.
-  
-  "%D" date.  Pass a CDate.
-  
-  "%T" time.  Pass a CDate.
-  
-  "%z" sub_entry of an enumerated list of text entries.  See LstSub().  Pass 
-  sub_entry_num first, list second.
-  
-  "%Z" DefineLstLoad() subentry.  Pass sub_entry_num first, define_name second.
-  
-  "%Q" convert "\" to "\\" and quote to backslash quote. (For use in creating 
-  strs in strs.)
-  
-  "%q" rev a "%Q".
-
-
-                                  Print Family
-
-MStrPrint(U8 *fmt,...) is like StrPrint(U8 *dst,U8 *fmt,...) but it returns a 
-MAllocated str.  It is vary handy because you don't have to worry about 
-overflow.
-
-CatPrint(U8 *_dst,U8 *fmt,...) concatenates a formated string.
-
-In(U8 *fmt,...) sends text to the current task's input buffer.
-InStr(U8 *fmt,...) sends text of an InFile to the keyboard stream of the current 
-TASK but can also do mouse cmds.
-
-XTalk(CTask *task,U8 *fmt,...) and text to another task's input buffer.
-XTalkStr(CTask *task,U8 *fmt,...) sends text of an InFile to the keyboard stream 
-of another TASK but can also do mouse cmds.
-
-DocPrint(CDoc *doc,U8 *fmt,...) sends text to a document.  You can buffer to a 
-Doc and save it, providing the functionality of fprintf.  See 
-::/Demo/Dsk/FPrintF.HC.
-
-Adam(U8 *fmt,...) sends text to the Adam Task to be compiled and run.
-AdamLog(U8 *fmt,...) and AdamErr(U8 *fmt,...) send text to the Adam Task to be 
-displayed.
-
-StreamPrint(U8 *fmt,...) sends text to the stream of code being compiled and 
-must reside in a #exe{} blk.
-
-GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...) and GrVPrint() plots text in graphics 
-mode.
-
-TextPrint(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to gr.text_base.
-
-ExePrint(U8 *fmt,...) compiles and execute a string.  Note: It returns the res 
-of the last executed expression.
-
-Once(U8 *fmt,...) Writes User code to Registry to be executed next boot.
-
-AOnce(U8 *fmt,...) Writes Adam code to Registry to be executed next boot.
-
-InPrint(I64 mS,U8 *fmt,...) PutChars()s one at a time with a delay.
-
-RawPrint(I64 mS,U8 *fmt,...) sends direct to scrn memory, bypassing window 
-manager.
-
-User(U8 *fmt,...) Spawns a user and execute a string on start-up.
-
-PopUpPrint(U8 *fmt,...) compiles and execute a string in a pop-up win.  Note: It 
-returns the res of the last executed expression.
-PopUpViewPrint(U8 *fmt,...) creates a pop-up window and views text.
-
-Note: Use Print("%s",src) if you need an unmodified string.
-
- diff --git a/public/Wb/Home/Doc/Profiler.DD.HTML b/public/Wb/Home/Doc/Profiler.DD.HTML deleted file mode 100755 index affc808..0000000 --- a/public/Wb/Home/Doc/Profiler.DD.HTML +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - -
-The profiler records where the CPU was executing when the 1000Hz timer interrupt 
-occured, so you can learn where time is spent.
-
-Use the Prof() depth argument to record a hit in the N routines which called the 
-current routine, as well.
-
-When done collecting statistics, use ProfRep() for a report.  You might need a 
-DocMax() to expand the command line window buffer to fit it all.
-
-Study the code.  The profiler is very simple.  You might want to enhance it or 
-modify it to debug something in particular.
-
- diff --git a/public/Wb/Home/Doc/Que.DD.HTML b/public/Wb/Home/Doc/Que.DD.HTML deleted file mode 100755 index 1b3e289..0000000 --- a/public/Wb/Home/Doc/Que.DD.HTML +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - -
-A Queue is a bunch of MAlloc()ed chunks of mem linked together in a circle with 
-one ptr to the next value and another ptr to the last value.  These ptrs must be 
-stored in the first locations in the structure.
-
- diff --git a/public/Wb/Home/Doc/Quirks.DD.HTML b/public/Wb/Home/Doc/Quirks.DD.HTML deleted file mode 100755 index c292cd9..0000000 --- a/public/Wb/Home/Doc/Quirks.DD.HTML +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - -
-                                     Quirks
-
-* You run a risk of problems if you do file operations on the same files 
-simultaneously because there is no file sharing/locking mechanism.  Generally, 
-the last write wins.
-
-* When using FAT32, TempleOS does not generate unique short-entry names, the 
-ones with the ~s.  Not all FAT32 filenames are valid TempleOS names and it will 
-complain.  Do not access FAT32 drives not dedicated to TempleOS.  Disable them 
-with DrvEnable(OFF), or they will generate error messages.  FAT32 involves a 
-long and short name for each file.
-
-* The stk does not grow because virtual mem is not used.  I recommend allocating 
-large local vars from the heap.  You can change MEM_DFT_STK and recompile Kernel 
-or request more when doing a Spawn().
-
-* The syntax highlighting occassionally glitches.  The compiler doesn't.
-
-* Call DskChg() when you insert a new removable media.
-
-* Accessing CD/DVD's is flacky.  Try Drv() or DskChg() twice.
-
-* You can only extern something once.  There is a varient called _extern which 
-binds a HolyC definition to a asm sym.  This, too, can only be done once.
-
-* A terminal task has a CDoc document structure that remains active even when 
-you change Fs->draw_it.  To prevent links in the CDoc from being activated when 
-the user clicks in the window, do one of three things:
-  
-  A) DocBottom() followed by DocClear() to clear the CDoc so it has no active 
-  widgets.
-  
-  B) Disable window mgr bttn click checking with Fs->win_inhibit set to mask 
-  WIF_SELF_MS_L|WIF_FOCUS_TASK_MS_L_D|WIF_SELF_MS_R|WIF_FOCUS_TASK_MS_R_D.  This 
-  inhibits window mgr operations but still generates messages from bttn clicks.
-
-* switch/case stmts alloc a single jump table--do not use with wide, sparse 
-ranges of case values.
-
-* Don't do a goto out of a try{}.
-
-* A goto label name must not match a global scope object's name.  (It's not 
-worth slowing-down the compiler to handle this case.)
-
-* MemCpy() only goes fwd.
-
-* A Cd() cmd must be followed by two semicolons if a #include is after it.  This 
-is because the preprocessor processes the next token ahead.
-
-* The assembler's error msgs are often off by a line and undefines are cryptic.
-
-* The last semicolon on the cmd line is converted to a dbl semicolon because the 
-compiler looks ahead before doing a cmd.  This normally has no negative effect, 
-but when entering if stmts with else clauses it presents problems.
-
-* You can do a class fwd reference by using extern on the first declaration, but 
-you can only do ptr references to the class.
-
-* When doing something like
-    U0 Main()
-    {
-      U16 *_w=0xA0000;
-      *_w|=0x8000;
-    }
-  The |= will be coded as a U32 Bts inst resulting in a U32 access instead of a 
-  U16 access.  This affects some hardware operations.
-
-* Compiler warning or error message line numbers will be off if you have a block 
-of word-wrapped comments.  You might press <CTRL-t> before doing an editor 
-goto-line-number command.
-
- diff --git a/public/Wb/Home/Doc/RedSea.DD.HTML b/public/Wb/Home/Doc/RedSea.DD.HTML deleted file mode 100755 index 03bd00d..0000000 --- a/public/Wb/Home/Doc/RedSea.DD.HTML +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - -
-                               RedSea File System
-
-The RedSea file system is a simple, 64-bit, file system which is similar to 
-FAT32, but with absolute block addresses instead of clus, fixed-sized 64-byte 
-directory entries and no FAT table, just an allocation bitmap.  A clus is just 
-one 512 byte sector.  Files are stored in contiguous blocks and cannot grow in 
-size.
-
-#define CDIR_FILENAME_LEN       38 //Must include terminator zero
-
-The following bit field shows valid 8-Bit ASCII filename characters.
-
-U32 char_bmp_filename[8]=
-{0x0000000, 0x03FF73FB, 0xEFFFFFFF, 0x2FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 
-0xFFFFFFFF, 0xFFFFFFFF};
-
-public class CDirEntry //64-byte fixed-size
-{
-  U16 attr;     //See RS_ATTR_DIR.  I would like to change these.
-  U8 name[CDIR_FILENAME_LEN]; //See char_bmp_filename, FileNameChk
-  I64 clus; (blk) //One sector per clus.
-  I64 size;     //In bytes
-  CDate datetime; //See  DateTime, Implementation of DateTime
-};
-
-public class CRedSeaBoot //RedSea is type FAT32 in partition table to fool BIOS.
-{
-  U8 jump_and_nop[3];
-  U8 signature,reserved[4]; //MBR_PT_REDSEA=0x88. Distinguish from real FAT32.
-  I64 drv_offset;       //For CD/DVD image copy.
-  I64 sects;
-  I64 root_clus; (root_blk)
-  I64 bitmap_sects;
-  I64 unique_id;
-  U8 code[462];
-  U16 signature2;       //0xAA55
-};
-
-See ::/Kernel/BlkDev/FileSysRedSea.HC and ::/Adam/Opt/Boot/DskISORedSea.HC.
-
-Files with names ending in .Z are compressed.  See ::/Kernel/Compress.HC.
-
-To replace ISO9660, make hard-drive partition image of a measured size and copy 
-onto a CD/DVD starting at about sector 20, with EL TORITO booting.  512-byte 
-sectors will be placed on top of 2048-byte CD/DCD sectors, so there will be four 
-blocks per CD/DVD sector.
-
-RedSea file system has no bad block table and no redundant allocation table.
-
-See Block Chain for RedSea allocation bitmap discussion.
-
-See Reliability for RedSea reliability discussion.
-
- diff --git a/public/Wb/Home/Doc/Reliability.DD.HTML b/public/Wb/Home/Doc/Reliability.DD.HTML deleted file mode 100755 index 01c7ed7..0000000 --- a/public/Wb/Home/Doc/Reliability.DD.HTML +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - -
-                               RedSea Reliability
-
-TempleOS is like the 1040EZ tax form compared to the full 1040 form.  Obviously, 
-it is simpler.  If you allow mission creep, pretty soon the 1040EZ looks just 
-like the 1040 and the messed-up 1040EZ has no purpose.
-
-The Commodore 64 had a file system that was simple enough for peers in my 
-generation to enjoy the thrill of knowing exactly what is going on at the 
-hardware level and writing fun projects to access it.
-
-My primary design criteria is simplicity.  If it is simple enough for only 
-100,000 people to learn, lets try to make it simpler so that 1 million can learn 
-it.
-
-Obviously, we don't do bad block tables, or redundant FATs.
-
-We use the simplest possible technique, a contiguous-file-only allocation 
-bitmap, not Block Chains or FAT tables.
-
-You can be a good toy or you can be a good professional tool, but not both.  
-TempleOS's file manager will start too slowly once a few thousand files exist 
-because the file manager makes a list of all files on start-up.
-
-Do not have more than a few thousand files or the file manager will not 
-function.
-
-You are encouraged to keep your entire drive limited to, maybe, 100 Meg of files 
-because you are suppoosed to operate as a kayak instead of a Titanic.  If you do 
-this, backing-up will be only a minute or so and you should do it at least once 
-a day. 
-
-Third party software should be run from ISO files or CD/DVDs directly, without 
-installing to hard drive.
-
-Multimedia graphics and sound is, basically, forbidden.  If you ignore this, all 
-hell will break loose because memory will fragment with large files and the 
-original vision of kayak hard-drive back-ups won't work.
-
-
-* "Commodore 64" is a trademark owned by Polabe Holding NV.
-
- diff --git a/public/Wb/Home/Doc/Requirements.DD.HTML b/public/Wb/Home/Doc/Requirements.DD.HTML deleted file mode 100755 index 2a8300c..0000000 --- a/public/Wb/Home/Doc/Requirements.DD.HTML +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - -
-                           Requirements for TempleOS
-
-User Skills Required
-* Knowledge of the C programming language.
-
-Supported Hardware
-* x86_64 PC compatible computer.  (Obviously, you need 64-bit hardware for a 
-64-bit operating system.)
-
-* 640x480 16 color VGA graphics.
-
-* Most keyboards and mice.
-
-* Minimum 512Meg RAM.
-
-* Internal PC Speakers.
-
-* CD/DVD-ROMs (not SCSI) but only RedSea file system.
-
-* ATA and SATA hard drives.
-
-Unsupported Hardware
-* No graphics acceleration.
-
-* No sound cards.
-
-* No networking.
-
-* No USB devices, except keyboard and mouse in legacy mode.  No, you can't use 
-flash memory cards.
-
-* No printers.
-
- diff --git a/public/Wb/Home/Doc/Resource.DD.HTML b/public/Wb/Home/Doc/Resource.DD.HTML deleted file mode 100755 index e3a9359..0000000 --- a/public/Wb/Home/Doc/Resource.DD.HTML +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - -
-                          Graphic Sprite Resource Help
-
-A sprite is an ordered list of elements such as lines, rectangles, bitmaps and 
-color changes.  In a program's source code, you first make a sprite somewhere 
-outside a function.  Then, you insert a pointer to the sprite as an "*elems" arg 
-when calling Sprite() or Sprite3().  See Sprites.
-
-You can create a sprite macro on your PersonalMenu with a payload of HolyC 
-source code to execute when it ESC's back to the cmd line.  If you check 
-"Pop-Up", it will spawn a new task and run the payload.  A pop-up macro can be 
-placed in any document.
-
- diff --git a/public/Wb/Home/Doc/ScopingLinkage.DD.HTML b/public/Wb/Home/Doc/ScopingLinkage.DD.HTML deleted file mode 100755 index 8102d8a..0000000 --- a/public/Wb/Home/Doc/ScopingLinkage.DD.HTML +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - -
-                              Scoping and Linkage
-
-JIT Compile Mode makes use of the current task's hash sym table and its parent 
-tasks' tables.  It fetches syms from parent tasks' tables if not found locally 
-in the current task's table and it places new syms in the current task's table.  
-Conceptually, syms are at the scope of environment vars in other operating 
-systems.
-
-When a sym is placed into a table, older syms with ident names will be 
-overshadowed if they exist.  Duplicates are not allowed in many cases, 
-especially in asm blks.  Dupicates are allowed, by design in other cases, so 
-that you can repeatedly #include the same file from the cmd line while 
-developing it.  Or, so you can repeatedly declare a function with a standard 
-name, like DrawIt().  This case might occur when the Adam Task is starting-up 
-loading-in many little utilities.
-
-extern binds a new HTT_FUN or HTT_GLBL_VAR sym to an existing sym of the same 
-name if it exists in the sym table (just in just-in-time code).  It also can be 
-used to generate a fwd reference.
-
-import binds a new HTT_FUN or HTT_GLBL_VAR sym to a sym of the same name 
-imported from the task's sym table at Load() time.  If no sym exists to bind to 
-at Load() time, the code using this sym will be left incomplete until the sym is 
-defined.
-
-
-_extern binds a new HTT_FUN or HTT_GLBL_VAR sym to an existing sym, of a differe
-nt name.  It must exists in the sym table.  Basically, this binds C to asm.
-
-_import binds a new HTT_FUN or HTT_GLBL_VAR sym to a sym, of a different name 
-imported from the task's sym table at Load() time.  If no sym exists to bind to 
-at Load() time, the code using this sym will be left incomplete until the sym is 
-defined.  Basically, this binds C to asm from elsewhere.
-
-
-Ahead of Time Compilation
-                    GlobalScope/FunctionScope
-                    | CodeHeap/DataHeap/Stack/Register
-                    | | TaskHashEntry:ExportSysSym/Define/Function/Class
-                    | | | UsageScope: Module/AsmLocal/AsmBlk/TaskAndChildren/Function
-                    | | | |UsageScope: Glbl/AsmLocal/Remainder/glblThisBlkAndRemainder
-                    | | | || StaticVarInit/DynamicVarInitAllowed/NoInitAllowed
-                    | | | || | Are dups allowed within the namespace? A dup overshadows the original.
-                    | | | || | DupsAllowed/NoDups/NoDupsButPad/WarningUnlessClosedOut
-
-asm export label::  G C S MG   N
-asm        label:   G C   MG   N
-asm local  @@label: G C   AL   N
-asm IMPORT label;   G C   MR   N
-asm export label::  F C S BG   N
-asm        label:   F C   BG   N
-asm local  @@label: F C   AL   N
-asm IMPORT label;   F C   BR   N
-C   goto   label:   F C   FG   N
-
-           #define  x     MR   D
-           function G C S MR   D
-           var      F R   FR   N
-           var      F S   FR   N
-static     var      F C   FR D N
-           var      G C S MR D D
-           var      G D   MR N D
-           class    G     MR   D
-class      member   G     MR   P
-extern     class    G     MR   D
-extern     function G C   MR   W
-import     function G C   MR   D
-import     var      G C   MR   D
-_extern    function G C   MR   D
-_extern    var      G C   MR   D
-_import    function G C   MR   D
-_import    var      G C   MR   D
-
-
-Just in Time Compilation
-                    GlobalScope/FunctionScope
-                    | CodeHeap/DataHeap/Stack/Register
-                    | | TaskHashEntry:ExportSysSym/Define/Function/Class
-                    | | | UsageScope: Module/AsmLocal/AsmBlk/TaskAndChildren/Function
-                    | | | |UsageScope: Glbl/AsmLocal/Remainder/glblThisBlkAndRemainder
-                    | | | || StaticVarInit/DynamicVarInitAllowed/NoInitAllowed
-                    | | | || | Are dups allowed within the namespace? A dup overshadows the original.
-                    | | | || | DupsAllowed/NoDups/NoDupsButPad/WarningUnlessClosedOut
-
-asm export label::  G C S Tg   N
-asm        label:   G C   BG   N
-asm local  @@label: G C   AL   N
-asm IMPORT label;   G C   TR   N
-asm export label::  F C   BG   N
-asm        label:   F C   BG   N
-asm local  @@label: F C   AL   N
-asm IMPORT label;   F C   BR   N
-C   goto   label:   F C   FG   N
-
-           #define  x   D TR   D
-           function G C F TR   D
-           var      F R   FR   N
-           var      F S   FR   N
-static     var      F C   FR D N
-           var      G C G TR D D
-           var      G D G TR S D
-           class    G   C TR   D
-class      member   G     TR   P
-extern     class    G   C TR   D
-extern     function G C F TR   W
-extern     var      G C G TR   D
-extern     var      G D G TR   D
-_extern    function G C F TR   D
-_extern    var      G C G TR   D
-
-
-* Goto labels must not have the same name as global scope objects.  GoTo's are 
-rare and I don't want to slow the compiler and add code to fix this.  You will 
-get errors if a collision happens, so it's not very dangerous, but the error 
-message is baffling.
-
-* The member names pad and reserved are special because multiple instances with 
-the same name are allowed in a class.
-
-* Use reg or noreg in front of local var names to override automatic reg var 
-allocation.  You can, optionally, specify a reg after the reg keyword.
- 
-* Local non-reg function vars can be accessed in asm blks with &i[RBP] for 
-example.
-
-* Glbl vars and functions can be accessed in asm with and & as in
-        MOV     RAX,I64 [&glbl_var]
-        CALL    I32 &Fun
-        CALL    I32 &SYS_SYM
-
-* In JIT asm code, &SYS_SYM and &Fun don't need IMPORT.
-
-* All offspring tasks of a task inherit syms.
-
-* The sizeof() and HolyC structure members can be used in asm blks.
-
-* Using &i in HolyC or i.u8[2] on a local var, i, will force it to noreg.
-
-* Using try/catch in a function will force all local vars to noreg.
-
-* An unused gap on the stk is left for reg vars.
-
-* Note: static function vars do not go on the data heap, no matter the setting 
-of the OPTf_GLBLS_ON_DATA_HEAP.  They may in the future.
-
-* OPTf_EXTERNS_TO_IMPORTS will treat _extern as _import and extern as import.  
-This allows a header to be used either as a JIT compiled or AOT compiled header.
-
- diff --git a/public/Wb/Home/Doc/Snd.DD.HTML b/public/Wb/Home/Doc/Snd.DD.HTML deleted file mode 100755 index 9c6f366..0000000 --- a/public/Wb/Home/Doc/Snd.DD.HTML +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - -
-Sound is generated with I8 vals called ona's, which are 88 piano key nums, with 
-0 as a rest.  See Note2Ona() and Ona2Freq().  God does not want death screams, 
-perhaps, because God has PTSD or soldiers have PTSD.  (Imagine wounded on 
-battlefields.)  Ona's will allow elegant wave files for export and will allow 
-the creation of simple hardware over the next centuries.
-
- diff --git a/public/Wb/Home/Doc/Sprite.DD.HTML b/public/Wb/Home/Doc/Sprite.DD.HTML deleted file mode 100755 index 5a41f16..0000000 --- a/public/Wb/Home/Doc/Sprite.DD.HTML +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - -
-A CSprite is an ordered list of these elements, created with <CTRL-r>.  
-Normally, they are packed together in a list and the address of the first is 
-passed to routines.
-
-See ::/Demo/Graphics/SpritePlot.HC, ::/Demo/Graphics/SpritePlot3D.HC, 
-::/Demo/Graphics/SpritePut.HC, ::/Demo/Graphics/SpriteRaw.HC and SpriteMeshEd().
-
-Be aware that copying SP, IB, or IS entries with the clip results in duplicate 
-entries with different nums.  You can manually remove dups by editing with <CTRL
--t> and setting to the original num.
-
-See ::/Adam/Gr/GrSpritePlot.HC for how CSprite are stored.
-
- diff --git a/public/Wb/Home/Doc/SpriteBitMap.DD.HTML b/public/Wb/Home/Doc/SpriteBitMap.DD.HTML deleted file mode 100755 index 0094f37..0000000 --- a/public/Wb/Home/Doc/SpriteBitMap.DD.HTML +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - -
-                            Sprite BitMap Menu Help
-
-BitMaps have a background color.  If you delete to the clip, what's left will be 
-background colored.
-
-While drawing, you can usually press 'c' to eye-dropper the color under the 
-mouse.  Press 't' for transparent.
-
- diff --git a/public/Wb/Home/Doc/SpriteEd.DD.HTML b/public/Wb/Home/Doc/SpriteEd.DD.HTML deleted file mode 100755 index 06b8503..0000000 --- a/public/Wb/Home/Doc/SpriteEd.DD.HTML +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - -
-                             Sprite Edit Menu Help
-
-Order of elements matters.  They are executed in the order they appear in the 
-side-bar.  You can sel or unsel elements graphically, or with text in the 
-sidebar.  Then, cut, copy, paste, shift or transform them.
-
-You can set the current insert point element by clicking the element in the 
-side-bar and making it RED.
-
-Insert Shift Suborigin is an element which shifts subsequent elements.  Perhaps, 
-you inserted a sprite's elements from the clip and want to shift it around?  
-This command is also useful if you call SpriteInterpolate() in programs.
-
- diff --git a/public/Wb/Home/Doc/SpriteEdText.DD.HTML b/public/Wb/Home/Doc/SpriteEdText.DD.HTML deleted file mode 100755 index f60924d..0000000 --- a/public/Wb/Home/Doc/SpriteEdText.DD.HTML +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - -
-                            Sprite Edit as Text Help
-
-See the format for CSprites.
-
- diff --git a/public/Wb/Home/Doc/SpriteMain.DD.HTML b/public/Wb/Home/Doc/SpriteMain.DD.HTML deleted file mode 100755 index 2ac1064..0000000 --- a/public/Wb/Home/Doc/SpriteMain.DD.HTML +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - -
-                             Sprite Main Menu Help
-
-Order of elements matters.  They are executed in the order they appear in the 
-side-bar.  You can set the insert point for new elements by click the element in 
-the side-bar and making it RED.
-
-After you create a 3D Mesh, you can edit it by seling it in the side-bar so it 
-is colored RED.  Then, click EDIT-3D-MESH.  A shiftable 3D mesh has a 2D offset 
-to position the origin.  You can convert between shiftable and non-shiftable by 
-editing it with the other command.
-
-You can convert all elements to a BitMap if END is RED in the side-bar and you 
-CONVERT-TO-BITMAP.  Later, you can edit that bitmap by seling it in the side bar 
-so it is colored RED and clicking EDIT-BITMAP.
-
-If you have a 3D icon, you might want to place a background-colored rectangle 
-under the 3D icon, so it hovers above.  Use TRANSFORM-OFF and TRANSFORM-ON.  You 
-will also need to set the Z offset of the icon.  Go to the Edit menu and sel 
-EDIT-AS-TEXT and change the third INT to Z offset.  Good luck.
-
-While inserting vector elements, you can usually press 'c' to eye-dropper the 
-color under the mouse.  Press 't' for transparent.
-
- diff --git a/public/Wb/Home/Doc/SpriteSideBar.DD.HTML b/public/Wb/Home/Doc/SpriteSideBar.DD.HTML deleted file mode 100755 index 8b0278d..0000000 --- a/public/Wb/Home/Doc/SpriteSideBar.DD.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-                              Sprite SideBar Help
-
-You can cut and paste elements in this side-bar to reorder, delete or 
-duplicating them.  Click an element in the side-bar after you make changes to 
-cause the changes to take-effect.
-
-You can click on an element to make it the insert point for new elements.
-
-The RED element is the current insert point for new elements.
- diff --git a/public/Wb/Home/Doc/StandBy.DD.HTML b/public/Wb/Home/Doc/StandBy.DD.HTML deleted file mode 100755 index 24a4b10..0000000 --- a/public/Wb/Home/Doc/StandBy.DD.HTML +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - -
-                           AutoComplete is in StandBy
-
-                            System Keys Quick Guide
-                               (Works Everywhere)
-  <SPACE>   Left-Click  
-  <ENTER>   Right-Click  
-   <F1>     Help
- <CTRL-m>   Personal Menu
-   <ESC>    Save  & Exit
-<SHIFT-ESC> Abort & Exit
- <WINDOWS>  Pull-Down Menu
-
-                                    Tongues
-                               (Works Everywhere)
-   <F7>     God Word
-<SHIFT-F7>  God Passage
-   <F6>     God Song
-<SHIFT-F6>  God Doodle
- diff --git a/public/Wb/Home/Doc/Start.DD.HTML b/public/Wb/Home/Doc/Start.DD.HTML deleted file mode 100755 index 5079921..0000000 --- a/public/Wb/Home/Doc/Start.DD.HTML +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - -
-                                 TempleOS V5.03
-
-                         Public Domain Operating System
-
-Help & Index, Quick Start: Cmd line
-
- diff --git a/public/Wb/Home/Doc/StdOutTask.DD.HTML b/public/Wb/Home/Doc/StdOutTask.DD.HTML deleted file mode 100755 index f48f49e..0000000 --- a/public/Wb/Home/Doc/StdOutTask.DD.HTML +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -
-There is one CDoc for the task's border: Fs->border_doc.  There is a pair for 
-the task's client area: Fs->put_doc and Fs->display_doc.  You can, optionally, 
-do double buffering, otherwise Fs->put_doc is the same as Fs->display_doc.  See 
-::/Demo/Spy.HC.
-
- diff --git a/public/Wb/Home/Doc/StdTempleOSPC.DD.HTML b/public/Wb/Home/Doc/StdTempleOSPC.DD.HTML deleted file mode 100755 index 16b5418..0000000 --- a/public/Wb/Home/Doc/StdTempleOSPC.DD.HTML +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - -
-                            The Standard TempleOS PC
-
-All desktop PCs will have 8-channel OCTART super-simple high speed serial ports 
-to replace USB.  They are simpler because the driver is as simple as old school 
-RS232 Serial, they have no USB end-points and they have no USB human interface 
-device reports.  Computer mice will all have exactly two bttns and one wheel.  
-Game controllers will all be the standard deluxe game console controllers that 
-are popular today.  It will have 8 big TX and 8 big RX fifos that allow flow 
-control characters to jump the queue.  It should be locked-down to as few 
-options as possible, like 8-1-N only, although hardware may use a USB frame, not 
-an RS232, so stop bits might not be relevant.  Perhaps, just two baud rates -- 
-high and low speed are needed.  Low speed is good for slow microcontrollers and 
-allows longer cable length.  Keyboard, mouse and game controller can be low 
-speed.
-
-The USB creators banned generic devices, requiring a signed, certified driver 
-for everything!  That's no good.  We allow any device and will communicate, 
-generically, using a serial terminal program like the old school HyperTerminal, 
-XTalk or Telnet.
-
-A mouse packet interface should be similar to this:
-
-     TX:        <ENTER>
-     RX:        X:+3 Y:+0 Wheel:+0 LB:OFF RB:OFF
-     TX:        <ENTER>
-     RX:        X:+0 Y:-1 Wheel:+0 LB:ON  RB:OFF
-
-We aspire to be as simple as a Commodore 64 joystick driver:
-
-     VAL=PEEK(56321)
-     if VAL AND 1 THEN y=y-1
-     if VAL AND 2 THEN y=y+1
-     if VAL AND 4 THEN x=x-1
-     if VAL AND 8 THEN x=x+1
-
-The game controller will be more complicated, but much simpler than USB.  It 
-will use a standard text packet of some kind.
-
-On the other end, you might hook-up a thermostat microcontroller and interface 
-as a generic serial device.  The microcontroller in the thermostat would have 
-something simple, not a crazy overkill ethernet connection.
-
-     U8 b;
-     while (TRUE) {
-       b=ReadU8(2); //Read byte from high speed serial channel 2.
-     //(Has been configured for low baud because thermostat should be slow.)
-       if (b==CMD_UP)
-         temperature++;
-       else if (b==CMD_DOWN)
-         temperature--;
-     }
-
-Super-simple block devices will replace ATA/ATAPI hard drives and 
-CD/DVD/BlueRays.  Today, the industry is in flux with nonvolitile memory just 
-invented.  We want a super-simple block device interface for non-volitile memory 
-and for what is currently USB memory sticks, but only if they can be made 
-without bad blocks.  I don't think we want to deal with bad block memory, so 
-maybe we will not do NV-memory.  The standard TempleOS desktop will require a 
-hard disk.
-
-There will be minimal commands:  READ_BLOCK, WRITE_BLOCK, GET_CAPACITY, 
-GET_MODEL, GET_SERIAL_NUM, and EJECT.
-
-We want a CPU mode with virtual IO port addresses similar to how paging creates 
-virtual memory addresses.  We want a 65536 word look-up table that converts 
-virtual IO port numbers to physical IO port numbers.  There will be a standard 
-IO port configuration, so port numbers can be fixed in the code.  We want the 
-primary hard drive on one set of ports and the primary CD/DVD/Blu-ray on another 
-set of ports.  Choose a contiguous set of IO ports.
-
-Meanwhile, a complicated PCI interface can be designed along-side the TempleOS 
-interface for Windows and Linux.  It would almost be possible to carry-on 
-separate lives, however, the super-simple serial requires getting rid of USB 
-since super-simple serial is a new hardware standard.  People can add USB ports 
-with a PCI device card.
-
-God said He wants single-voice 8-bit signed MIDI-like sample for the sound.  God 
-does not want death screams, perhaps, because God has PTSD or soldiers have 
-PTSD.  (Imagine wounded on battlefields.)
-
-The video will be a linear frame buffer 640x480 16 color with one-byte-per-pixel 
-even though it is only 16 color with is 4-bit.  Perhaps, we have a interrupt to 
-sync with the refresh.
-
-I am tmpted to help amateur hardware device designers by making the hardware 
-interface for the PC simple.  I have fond memories of 1993, when I made a 
-wire-wrapped ISA data acquisition card which plugged into my 486 and had some 
-analog-to-digital and digital-to-analog convertors.  I am not designing a bus.  
-Earlier, I said the super-simple high speed serial port replacement could be 
-USB-like in hardware as long as the software driver interface was simple like 
-old school RS232 serial ports.  Requiring a complicated hardware handshake 
-raises the bar, slightly, for the lowest level hardware designers.  Most people 
-will be connecting a microcontroller or something that already has a serial 
-communication design, but if it's not a problem, maybe we should keep it simple 
-at all stages.  It was nice putting an oscilloscope on my serial port wires.
-
-The original PC had general purpose digital IO through the parallel port.  That 
-was fun.  I have enough battles to fight, so I'll leave being a savior to 
-hobbiest hardware engineers to somebody else.
-
-Digital cameras will be super-simple high speed serial, but TempleOS is forever 
-limited to 16 colors and multimedia is banned because large files being loaded 
-into memory fragments memory, so cameras are somewhat unwelcome.  I have enough 
-problems without making the Brits anxious about autonomous gun turrets and 
-killer robots.  The reason I say cameras will be super-simple serial is because 
-we are replacing USB ports with super-simple serial.  PC's will have only 
-super-simple serial ports unless people buy a USB PCI expansion card.  So, the 
-digital cameras will be super-simple serial.
-
-
-                                  Version 1.0
-
-We will make a spec for a $8,000, perfectly standardized, cryogenically-cooled, 
-monster desktop PC.  It will have 16 cores, integrated 4K graphics, and, 
-hopefully, 6 Ghz continuous operation.  Perhaps, 64 Gig of RAM will be standard? 
-God said to help to poor buy them.  It is pointless to have a high powered 
-machine if other people have wimpy machines and cannot run programs you write.  
-Therefore, everybody in the developed world will buy a Standard TempleOS IBM PC 
-over the next ten years, so that will be a quantity of 400 million, perhaps.  
-God said to pay the US national debt with the revenue.  We will standardize 
-everything, not just the TempleOS related items.  The display will be 4K (and of 
-course 640x480 16 color) and no others.  Everybody gets just one monitor, unless 
-you buy special PCI cards.  Everybody gets two speakers, a headphone, a mic, a 
-webcam and touch scrn.  We make the audio one sample rate and one sample size, 
-but TempleOS still gets just a square wave.  (HD Audio is really screwed-up and 
-requires complicated artificial intelligence, just to route output to speakers.)
-
-The Standard Temple IBM PC will be a full-sized tower.  Perhaps, stain-glass 
-will decorate the case because God is sentimentally attached to stained-glass.  
-We should set the size at exactly 2.5 feet by 1.5 feet by 1.5 feet as in the 
-Exodus,25:10-10 for all time.  If there is extra room, make a storage shelf for 
-DVDs.  We do not want a race-to-the-bottom, shrinking the size.  Instead of 
-making it smaller, make it more powerful.  We want to remove all cost pressure 
-from making things small.  It must have a CD/DVD/Blu-ray drive.  The vision is 
-CD/DVDs used for a library of games, not installed on the hard-drive.  We need a 
-network connection, possibly implemented as a super-simple high speed serial 
-device.  What about standard monitor and speakers?  The C64's success was 
-partially due to wide spread, completely standard, hardware.  I think TempleOS 
-will not do bad block devices, so we need a hard drive, not just NV-memory or 
-SSD.
-
-TempleOS will have the priority over Windows or Linux on hardware decisions.  We 
-could make it heterogenious multicore.  I think we want 16 non-hyperthreaded 
-cores.  Core#0 is the only full-featured core needed.  The other cores will have 
-long mode, but not some of these: real mode, protected mode, ring-3, paging, 
-interrupts, in/out port instructions, SSE instructions,  MMX instructions.
-
-God said Intel should do a simulation of heat produced by gates and try 
-spreading-out the heat producing gate circuits on the chip.
-
-God said Linux's Wine should replace Windows.  We will install a standard 
-software set-up on all Standard Temple IBM PC's.
-
-
-                                     Usage
-
-TempleOS is primarily for user developers, like the Commodore 64 was.  I created 
-a total of 50 Meg of content over ten years, so you shouldn't need much room, 
-either.  The installed hard drive space should stay small because the resolution 
-is low, multimedia is banned, 3rd party libraries are banned, and applications 
-can be distributed with ISO files or DVDs.
-
-The ROM will have a command that copies the ROM onto the hard drive, creating 
-identical C and D partitions, so you can have fun modifying TempleOS.  You will 
-have confidence you can fix it easily if you break it.  It should be able to run 
-everything from just the ROM, too.  You will need to specify a /Home directory 
-that is not in the ROM, but on the hard drive. 
-
-The standard set-up will be a C primary drive and a D back-up drive.  Keep the 
-size on each hard drive under 512 Meg and periodically copy all of C to D, so 
-they stay mirrored.  The file manager and other programs read the entire 
-directory structures, so too many files causes problems (unbearably slow).  
-Third party software should be distributed as ISO files or DVDs, like 
-TextAdventure.ISO.  No 3rd party libraries are permitted because they circumvent 
-the intent of the 100,000 line of code limit which is keeping it cognatively 
-small enough to see the light at the end of the tunnel and easily master 
-everything.  Therefore, 3rd party ISO files must bring all required software 
-components with them, except what is found in the TempleOS ROM.
-
-Having all your 3rd party software on separate DVDs or ISO files and TempleOS 
-running from a ROM, keeps it delightfully simple so you have complete 
-understanding of what is going on.  You will have complete confidence and it 
-will be a joy to use.  3rd party applications can store saved data files into 
-your /Home hard drive directory.
-
-The Temple PC will stay unchanged for seven years at a time.  The Bible speaks 
-of a seven year release in Deuteronomy,15:1.  The Commodore stayed unchanged for 
-many years and people became intimately familiar with every aspect.
-
-
-
-I thought 2.5' x 1.5' x 1.5' was ridiculously big, but it looks like it is 
-reasonable for super-cooled refrigeration systems!
-
-
-                                  Version 2.0
-
-
- -The Standard Temple IBM PC V2.0 will be released seven years after V1.0. Each -unit will have a full, uncut, silicon wafer. V2.0 will be sold, unchanged, for -seven more years, like a Commodore 64. - -* "Commodore 64" is a trademark owned by Polabe Holding NV. -* "Linux" is a trademark owned by Linus Torvalds. -* "Windows" is a trademark owned by MicroSoft Corp. -
- diff --git a/public/Wb/Home/Doc/Strategy.DD.HTML b/public/Wb/Home/Doc/Strategy.DD.HTML deleted file mode 100755 index d73c56f..0000000 --- a/public/Wb/Home/Doc/Strategy.DD.HTML +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - -
-                        Decisions Making TempleOS Simple
-
-Everybody is obsessed, Jedi mind-tricked, by the notion that when you scale-up, 
-it doesn't get bad, it gets worse.  They automatically think things are going to 
-get bigger.  Guess what happens when you scale down?  It doesn't get good, it 
-gets better!
-
-I limited it to 100,000 lines of code, forever!  I never need a linker or make 
-utility and I can use small labels.
-
-People mock Bill Gates for, "640K should be enough."  I say, "2Gig for code 
-should be enough."  The same people who mock Bill Gates are probably just like 
-the black woman who sued for a trillion dollars.
-
-My Dad worked on converting the Titan missile to the Gemini Mission rocket.  It 
-had to be "man-rated".  You can bet that everything got an order of magnitude 
-more complexity and documentation.  My vision is a souped-up C64, not a 1970's 
-mainframe; a kayak, not a Titanic.
-
-Linux is a semi-tractor -- you need professional drivers for 20 gears.  Linux 
-has file permissions.  Common people are hurt by file permissions.
-
-Windows is a car.
-
-TempleOS is a motorcycle -- if you lean-over too far, a motorcycle will crash.  
-Don't do that!  There are no side air bags on a motorcycle.  DOS and C64 had no 
-memory protections and ran in ring-0, with no security.  This saves an order of 
-magnitude complexity.
-
-Linux and Windows are general purpose operating systems.  They attempt to do any 
-task you want.  TempleOS cherry-picks tasks and is designed to do the same 
-things a C64 did.  This saves and order of magnitude complexity.  For example, 
-the RedSea file system allocates just contiguous files -- you load and save 
-whole files at once.  A benefit is this allows compression.  Also, TempleOS does 
-not do networking or multimedia.  In theory, memory will fragment with lots of 
-big files.  The system would fall to pieces with multimedia, but God said 
-640x480 16 color is a permanent covenant like circumcision.
-
-A three bttn mouse is like a leg you cannot put weight on.  TempleOS just does 
-hardware everybody has, with no divergent code bases for each machine's custom 
-hardware.  There is one graphics driver instead of 50 for different GPUs.  This 
-saves an order of magnitude complexity and makes for a delightful API, so 
-developer's code is not like a frayed rope end.
-
-
-
-* Everything runs in kernel, ring 0, mode.
-
-* One memory map for all tasks on all cores with virtual addresses set equ to 
-physical, just as though paging is not used.
-
-* One platform -- x86_64 PC's, no 32-bit support.
-
-* No security or cryptography.
-
-* No networking.
-
-* Least (greatest) common denominator hardware support.  Mostly, one driver for 
-each device class.  I can't be in the business of different drivers.  
-Compatibility is the greatest challenge for PC operating systems.  Disk code 
-does not use interrupts, avoiding compatibility risks.  PS/2 keyboard/mouse is 
-used instead of USB, also more compatible.
-
-* 640x480 16 colors.  Updates whole scrn at 30 fps, optimized for full scrn 
-games where InvalidRectangles are counter-productive.
-
-* One font, 8x8.  Text and graphic layers done in software with text normally on 
-an 8x8 grid.  It can run in Text mode if graphic initialization fails.
-
-* Compiler extends all values to 64-bit when fetched and does only 64-bit 
-computations intermediately.  Assembler has minimal 16-bit support, good enough 
-for compiling boot loaders.
-
-* No object files.  Use JIT.
-
-* Whole files are processed almost exclusively, allowing compression.
-
-* One language and compiler for command-line, scripts, songs, automations and 
-code.
-
-* One editor/word processor/browser for the command-line window, source code, 
-documentation browser, dialog forms.
-
-* No child windows.  One window per task.  Bttns are widgets, not child windows. 
- There are child tasks, however.
-
-* No distinction between thread, process or task.
-
-* The Scheduler is for home systems.  It is not preemptiove.  Disk requests are 
-not broken-up, so sharing is bad.  It's wonderfully simple.
-
-* MultiCore is done master/slave, instead of SMP.  Core0 applications explicitly 
-assigns jobs.  Locks are present allowing multicore file, heap, and hardware 
-access, though.
-
-* Sound has single-voice 8-bit signed MIDI-like samples.
-
-* All tasks have a heap and a sym table.  Scope is that of environment vars in 
-other operating systems.  As text is typed at the command line or you run 
-programs by #includeing them, the syms go in the table.  If a sym is not found, 
-the parent task's table is checked.  The father of all tasks has the API syms 
-you'll need waiting in it's table.  No need to #include headers.
-
-* No need for namespaces -- scoping occurs automatically based on task symbol 
-table hierarchy with the Adam Task's symbol system-wide global.
-
-* Sometimes, I cut corners in the interest of keeping the code beautiful.
-
- diff --git a/public/Wb/Home/Doc/Streams.DD.HTML b/public/Wb/Home/Doc/Streams.DD.HTML deleted file mode 100755 index 15310a0..0000000 --- a/public/Wb/Home/Doc/Streams.DD.HTML +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - -
-There are no streams in the traditional sense.  The cmd line output gets sent to 
-the cursor location of a document being edited and by using cursor keys, text 
-can be injected all over the document.  Sprites can be injected and are not 
-serialized!  Furthermore, the input can come from triggering macro widgets.  See 
-Doc Overview and Doc Routines.
-
-If you had a remote term and sent key Scan Codes, the user would press <CTRL-m> 
-to access his Personal Menu to trigger his macros.  However, the local 
-~/PersonalMenu.DD might differ from the remote, causing loss of sync between 
-local and remote sessions.  Also, the window size of local and remote might 
-differ, so word-wrapped text would be different.  Injecting output text with 
-different windows sizes would cause remote and local documents to not be in 
-sync.
-
-See Char Overview and Char Routines.
-
-You can send characters into StdIn.  See In(), XTalk() and InFile.
-
- diff --git a/public/Wb/Home/Doc/TOSZ.DD.HTML b/public/Wb/Home/Doc/TOSZ.DD.HTML deleted file mode 100755 index 03c6dcb..0000000 --- a/public/Wb/Home/Doc/TOSZ.DD.HTML +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - -
-                               Linux TOSZ Utility
-
-
-TOSZ [-ascii] filename
-
-Will uncompress a single file from within Linux.  The -ascii flag will convert 
-the irregular TempleOS ASCII 5 and ASCII 31 characters to spaces.  (ASCII 5 is 
-used to mark the cursor pos and ASCII 31 is used for shifted space characters 
-and will cause problems unless you convert them.)
-
-
-* "Linux" is a trademark owned by Linus Torvalds.
-
- diff --git a/public/Wb/Home/Doc/TextBase.DD.HTML b/public/Wb/Home/Doc/TextBase.DD.HTML deleted file mode 100755 index 818c7d7..0000000 --- a/public/Wb/Home/Doc/TextBase.DD.HTML +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - -
-gr.text_base must be updated 30fps in your Fs->draw_it() callback.  You probably 
-want GrPrint() or just Print().  The DolDoc code takes care of plotting text to 
-gr.text_base.
-
-Bits 0-7        8-Bit ASCII Scrn Code
-Bits 8-11       Foreground color
-Bits 12-15      Background color
-Bits 16-20      Signed X pos shift val
-Bits 21-25      Signed Y pos shift val
-Bit  28         Blink
-Bit  29         Inverted (Swap foreground and background)
-Bit  30         Sel (XOR colors with FF)
-Bit  31         Underline
-
-GrUpdateTaskWin() calls DocUpdateTaskDocs() which calls DocRecalc() where the 
-document text is plotted into gr.text_base.  Then, GrUpdateTextBG() and 
-GrUpdateTextFG() render the gr.text_base onto gr.dc2, a raw graphic bitmap.
-
-See ::/Demo/Games/Maze.HC.
-
- diff --git a/public/Wb/Home/Doc/TimeCycles.DD.HTML b/public/Wb/Home/Doc/TimeCycles.DD.HTML deleted file mode 100755 index 49fcea7..0000000 --- a/public/Wb/Home/Doc/TimeCycles.DD.HTML +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - -
-Intel/AMD have an inst that returns the num of CPU cycles since boot.  This is 
-not a steady, calibrated real time value.  TempleOS measures it and you can 
-convert with cnts.time_stamp_freq, a value continuously calibrated from other 
-cnts.
- diff --git a/public/Wb/Home/Doc/TimeDate.DD.HTML b/public/Wb/Home/Doc/TimeDate.DD.HTML deleted file mode 100755 index ef1860e..0000000 --- a/public/Wb/Home/Doc/TimeDate.DD.HTML +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - -
-TempleOS uses a 64-bit value, CDate, for date/time.  The upper 32-bits are the 
-days since Christ.  The lower 32-bits store time of day divided by 4 billion 
-which works out to 49710ths of a second.  You can subtract two CDate's to get a 
-time span.
-
-Use CDATE_FREQ to convert.
-
- diff --git a/public/Wb/Home/Doc/TimeHPET.DD.HTML b/public/Wb/Home/Doc/TimeHPET.DD.HTML deleted file mode 100755 index 6a20ce3..0000000 --- a/public/Wb/Home/Doc/TimeHPET.DD.HTML +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - -
-The HPET, high precision event timer, is read with HPET() and has a frequency of 
-cnts.HPET_freq.  A typical freq value is 14.3 Mhz  It might not be available on 
-all systems.
-
- diff --git a/public/Wb/Home/Doc/TimeJiffy.DD.HTML b/public/Wb/Home/Doc/TimeJiffy.DD.HTML deleted file mode 100755 index 02053c9..0000000 --- a/public/Wb/Home/Doc/TimeJiffy.DD.HTML +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - -
-One jiffy is one time slice.  cnts.jiffies returns time slices since boot.
-
-SysTimerRead reads the timer ticks since boot.  It's not as fast as GetTSC.
-
-Use JIFFY_FREQ to convert cnts.jiffies.
-
-Use SYS_TIMER_FREQ to convert SysTimerRead.
-
- diff --git a/public/Wb/Home/Doc/Tips.DD.HTML b/public/Wb/Home/Doc/Tips.DD.HTML deleted file mode 100755 index 2537b90..0000000 --- a/public/Wb/Home/Doc/Tips.DD.HTML +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - -
-                                      Tips
-
-* Turn-off or reboot (<CTRL-ALT-DEL>) at any time, except during disk writes.  
-Writes are not cached. 
-
-* Use Seed() and the cmd line to switch Rand() to non-timer mode and replay 
-games you like.
-
-* 64-bit values are most efficient for the compiler.
-
-* See Key Map for a list of defined keys.  Define your own keys in MyPutKey().  
-See Keyboard Devices.
-
-* <ALT-m> maximizes a window.  <ALT-SHIFT-w> closes AutoComplete.  <ALT-w> 
-brings back AutoComplete.  <ALT-v> vertically tiles windows.  <ALT-h> 
-horizontally tiles windows.  The ALT keys are defined in ~/HomeKeyPlugIns.HC.  
-You can customize them.
-
-* If you make changes to TempleOS files in your /Home directory, generally you 
-reboot to make them take effect.  (You don't compile anything.)  You should have 
-two TempleOS partitions on your hard drive because a syntax error in a start-up 
-file will make the partition unbootable.  Boot to the second partition or boot 
-to a standard TempleOS CD/DVD and use Mount() to mount your hard drive.
-
-* I copy my files to a mirrored ident partition, periodically with CopyTree() 
-commands in scripts.  I do merge commands with a menu entry like this:
-Merge(\"C:/*\",\"D:/*\",\"+r+d\"); to check my changes.
-
-* <CTRL-m> at the cmd line to access your PersonalMenu.  Place macros there with 
-<CTRL-l>, or icon-like sprites with <CTRL-r>.  Use the Pop-Up option on macros 
-to Spawn() a task to run a file.  It dies when it is finished.  This returns mem 
-to the system.  Be sure to press <CTRL-s> to save your macro/menu area after 
-making changes.
-
-* You can use ans in cmd line expressions.  It holds the res the last cmd line 
-operation.  You can use the cmd prompt as a calculator by just entering 
-expressions like 1+2*3;.  F64 ress can be accessed with ansf.
-
-* Use the PullDown menu at the top of the scrn to learn commands, or for finding 
-the keyboard controls to games.
-
-* You can adjust the mouse movement rate by setting global vars in your start-up 
-file.  See mouse scale.
-
-* You can set your local time zone by setting the local_time_offset global var 
-in a start-up file.  It's units are CDATE_FREQ.  See local time.
-
-* <CTRL-SHIFT-L> in the editor to reindent a HolyC function or renumber an asm 
-routine's local labels.
-
-* You can use filter_lines in the editor text search form (<CTRL-f>) to 
-temporarily display just lines near each match.  A value of filter lines set to 
-5 will display lines within 5 lines of matches.  Then, you can do another find 
-to a different string and achieve a AND search.  When finished, press <ESC>.
- 
-* You can recompile and reinstall the kernel with BootHDIns().  You'll probably 
-want to make a function for recompiling that uses the In() function to answer 
-the cfg questions.  See my technique Cfg Strs, Update Funs.
-
-* Scale2Mem(min,max,limit=2*1024*1024*1024) can be used for cfg questions when 
-recompiling.  The BootHDIns() cfg prompts accept expressions, not just numbers.  
-The dft disk cache is Scale2Mem(0x80000,0x8000000).
-
-* You can permanently disable AutoComplete commenting-out ACInit() in 
-~/HomeSys.HC.
-
-* Boolean expressions not in if stmts don't have short circuit logic and are 
-compiled inefficiently.
-
-* You can use progress1-progress4 in your programs for whatever you like.  
-They're just global vars that are shown on the wallpaper.  The original intent 
-was to indicate how far along operations were.  There's no coordination, so 
-different apps might interfere.  I use them most for debugging--just values 
-easily viewed.  See ::/Demo/Progress.HC.
-
-* Use DocMax() to adjust the size of the cmd line buf.  It counts CDoc entries, 
-not lines.
-
-* Many data structures have a user_data member.  Those are available for you to 
-store a data item, for convenience.  CTask, CDocEntry and CDirEntry have them.  
-You shouldn't encounter conflicts with TempleOS using them.
-
-* If, for some strange reason, you wanted to reduce mem usage, make a smaller 
-disk cache when you recompile the kernel; disabling AutoComplete; Specify 
-smaller stk sizes when doing Spawn(), chang MEM_DFT_STK, and using DocMax() to 
-reduce the cmd line buffer size.
-
-* Filenames ending in ".Z" will be automatically compressed and uncompressed 
-when read or written.  The compression method is not supported by other 
-operating systems.  You can store files uncompressed by Move()ing them to a 
-filename not ending in ".Z".  See ::/Doc/TOSZ.DD if you want to uncompress while 
-in Linux.
-
-* Merge() can be used to see what's changed.  The +d flag will show differences 
-of files which have changed and allow you to merge code.  (The +r flag will 
-recurse.)
-
-* There is a utility LinkChk() which will check for broken links in 
-documentation.
-
-* You can use Option(OPTf_WARN_PAREN,ON) to find unnecessary parentheses in 
-code.
-
-* You can use Option(OPTf_WARN_DUP_TYPES,ON) to find unnecessary local var type 
-stmts.
-
-* Option(OPTf_ECHO,ON) can be placed in StartOS.HC to echo start-up scripts.
-
-* Use Plain() to edit a plain text file.  You'll need this if your file has $'s. 
- Use the ToDolDoc() utility to convert plain text to DolDoc's by doubling $'s.
-
-* Use Silent() to disable scrn text output.
-
-* Grab-scroll any window at any time with {CTRL-LEFT-MOUSE-DRAG}.  Null 
-grab-scrolling with {CTRL-RIGHT-MOUSE}.
-
-* Use <CTRL-ALT-z> to zoom-in and <CTRL-ALT-SHIFT-Z> to zoom-out.  You can 
-scroll by moving to the edge of the window.  Set gr.continuous_scroll to TRUE if 
-you want. 
-
-* Use <CTRL-ALT-g> and <CTRL-ALT-SHIFT-G> to display a grid on the scrn.
-
-* Use <CTRL-ALT-a> to enter an extended ASCII char.
-
-* Use <CTRL-ALT-f> to toggle between Std Font and Cyrillic Font.
-
-* Use <CTRL-ALT-s> will capture the scrn as a sprite on the clip.  You can save 
-the cmd line doc as text with <CTRL-a>.
-
-* You can save a sprite as a .GR file in <CTRL-r> on the Sprite BitMap Menu.
-
-* You can eye-dropper colors in the <CTRL-r> sprite editor by pressing 'c'.  
-Press 't' for transparent.
-
-* There are handy functions--F(),R(),FD() and RD() which are defined in 
-~/HomeWrappers.HC.  You are encouraged to change them and add more.  They will 
-perform find-and-replace operations accross multiple files.  The +l flag is 
-particularly useful since it limits to whole labels.  The +lb and +la flags 
-limit to whole labels just before or after.  You are encouraged to add or modify 
-handy wrapper functions to make cmd line operations easier.
-
-* When using Find() while modifying code, work from the bottom-up so that line 
-numbers are correct.  If you work top-down, then inserting or deleting lines 
-causes the lower file links will be incorrect.
-
-* You can save files after making changes, anytime you are within the editor, 
-like when viewing help/macro files.  <CTRL-a> saves as, <CTRL-s> saves with the 
-same name in the scrolling title bar.  Hitting <ESC> will exit and save.  (<SHIF
-T-ESC> will abort).  You can save the cmd line window to a file, too, since 
-you're actually in the editor when you're at the cmd line.
-
-* When using <CTRL-l> to insert links in documents, you can usually leave the Ta
-g Text blank and it will be filled-in automatically based on other entries.
-
-* There is a feature of the precompiler that allows code to be executed in the 
-middle of compilation and data inserted into the compilation stream.  Click here 
-for an example: #exe {.
-
-* If you output to the cmd line and wish to allow users to scroll around and 
-view data, you can use View().
-
-* Use View() in Pop-up macros to linger until the user presses <ESC> or <SHIFT-E
-SC>.
-
-* You can access the word under the cursor at ac.cur_word.
-
-* You can reactivate AutoComplete after closing it by pressing <CTRL-Fun Key> or 
-<ALT-w> if you have it defined.
-
-* <CTRL-SHIFT-T> to toggle to/from plain text just the CDoc cmd under the 
-cursor.  See ::/Demo/DolDoc/TextDemo.HC.
- 
-* If you toggle to plain text when you are working with graphics in a document, 
-you can add duplicate entries for sprites by entering a $SP...$ cmd with the 
-same num.
-
-* If you toggle to plain text when working with graphics, you can add a str to 
-the $SP...$ entry to keep track of it.  Try $SP,"<2>",BI=2$ where '2' is the 
-sprite num.
-
-* I use spaces-to-tab operations on all my src files to keep them small.  You 
-have to be careful, though, because spaces in strings will be converted.  I use 
-<SHIFT-SPACE> ' ' in such cases.  See S2T() for spaces-to-tabs.
-
-* You can edit an existing sprite by putting the cursor on it and pressing <CTRL
--r>.
-
-* When editing a sprite, you can cut and paste the elements in the sidebar text 
-list window.
-
-* I recommend keeping CSprite in vect format until you are done creating them, 
-so you can edit the ctrl points.  Then, convert them to bitmaps, so the flood 
-fills work well.  If you are doing interpolation, however, they must be vect.
-
-* GrFloodFill() is slow.  GrRect() is fast.
-
-* You can customize the wallpaper.  See ::/Demo/Graphics/WallPaperFish.HC.
-
-* Your RAM disks will not be reformated when you reboot if the memory location 
-has not changed and it finds the disk intacted.
-
-* try{} catch{} in a function will cause all vars to be non-reg.
-
-* Using a sub-int array, i.u8[3], for example, will force a local var to 
-non-reg.
-
-* You can delete the ~/Registry.HC.Z file.  The policy is that deleting it will 
-restore defaults.  It is a text doc, if you want to edit it.  Be careful of tree 
-indentations.
-
-* Study ::/Adam/Opt/Utils/MemRep.HC and WallPaper() to learn how the system 
-resources are put together.
-
-* The editor's sel-text mechanism allows for disjoint portions of sel text.  
-This is a feature, not a bug -- you can cut-and-paste disjoint text.
-
-* cnts.time_stamp_freq is continuously calibrated.  Be careful because 
-expressions might decrease.  Take a snap-shot, like this: timeout=GetTSC+
-cnts.time_stamp_freq x seconds; and compare against GetTSC().  I recommend just 
-using tS or cnts.jiffies.
-
-* Use HeapLog(), HeapLogAddrRep() and HeapLogSizeRep() to find leaks.  Don't be 
-confused by CDoc allocations.  Those are generated when text is written to the 
-cmd line buffer.
-
-* For advanced heap debugging, play with _CFG_HEAP_DBG.  You're on your own.
-
-* You can use Type() to display .GR files.
-
-* Use Man() to jump to short sym name src code.
-
-* Use Fix() to edit and fix the last compiler err.
-
-* You can use <CTRL-SHIFT-L> to do a check for compile errors.
-
-* You can use DocOpt() to optimize links. (Mostly just removes .Z)
-
-* ZipRep() can highlight src files with lots of redundancy.
-
-* With start/end, common trailing code is fast.  Common leading code is slow.
-
-* The first line of the Psalmody HolyC song files is a comment with a category 
-recognized by JukeBox().  The categories are "no nothing", "has words", "has 
-graphics", or "special".  The third character in the song comment is a digit 
-rating number, shown in JukeBox().  You can set the song rating in JukeBox() by 
-pressing 0-9.  You can press <DEL> to delete songs.
-
-
-* "Linux" is a trademark owned by Linus Torvalds.
-
- diff --git a/public/Wb/Home/Doc/Transform.DD.HTML b/public/Wb/Home/Doc/Transform.DD.HTML deleted file mode 100755 index a030491..0000000 --- a/public/Wb/Home/Doc/Transform.DD.HTML +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -
-CDC's have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 
-dimensions.  To make the graphics routines use the transform, you must set the 
-DCF_TRANSFORMATION flag.
-
-The matrix consists of ints that have been scaled 32 bits (GR_SCALE).  See 
-::/Demo/Lectures/FixedPoint.HC to learn why.
-
-See Mat4x4IdentEqu(), Mat4x4IdentNew(), Mat4x4Equ() and Mat4x4New().  See 
-Mat4x4RotX(), Mat4x4RotY(), Mat4x4RotZ() and Mat4x4Scale() to rotate about axes 
-and scale.  Combine them with Mat4x4MulMat4x4Equ()/Mat4x4MulMat4x4New() and 
-assign them to the CDC.dc with DCMat4x4Set().  See ::/Demo/Graphics/Box.HC.
-
-You can rotate single points using Mat4x4MulXYZ().
-
-The 4th dimension allows a neat trick where you can place pos shifts 
-(translations), into the matrix and Mat4x4MulMat4x4Equ/Mat4x4MulMat4x4New them 
-to combine rotation/shift operations.  Normally, you can't combine pos shift 
-operations.  See Mat4x4TranslationEqu() and ::/Demo/Graphics/Transform.HC.
-
-Finally, CDC's have an x, y and z which is an additional shift (translation).
-
-The transformation is implemented as a callback on the CDC's transform() member. 
- The default transform() callback is DCTransform().  See 
-::/Demo/Games/Talons.HC or ::/Demo/Games/CastleFrankenstein.HC to see how to 
-change the transform() callback for foreshortening.
-
- diff --git a/public/Wb/Home/Doc/Welcome.DD.HTML b/public/Wb/Home/Doc/Welcome.DD.HTML deleted file mode 100755 index 404fb6d..0000000 --- a/public/Wb/Home/Doc/Welcome.DD.HTML +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - -
-                              Welcome to TempleOS
-
-TempleOS is a x86_64, multi-cored, non-preemptive multi-tasking, ring-0-only, 
-single-address_mapped (identity-mapped), operating system for recreational 
-programming.  Paging is almost not used.
-
-The people whom can most benefit are:
-  * Professionals doing hobby projects
-  * Teenagers doing projects
-  * Non-professional, older-persons projects
-
-Simplicity is a goal to keep the line count down, so it's easy to tinker with.  
-As it turns-out, simplicity makes it faster in some ways, too.  It never 
-switches privilege levels, never changes address maps, tends to load whole 
-contiguous files and other, similar things which boost speed.  It's only 80,849 
-lines of code including the kernel, the 64-bit compiler, the graphics library 
-and all the tools.  More importantly, it's designed to keep the user's line 
-count down -- you can do a Hello World application in one line of code and can 
-put graphics on the scrn with a three line program!
-
-It's a kayak, not a Titanic -- it will crash if you do something wrong.  You 
-quickly reboot, however.  DOS and the 8-bit home computers of the 80's worked 
-fine without memory protection and most computers in the world -- the embedded 
-ones -- operate without protection.  The resulting simplicity of no protections 
-is why TempleOS has value.  In facts, that's the point of TempleOS.  See the 
-TempleOS Charter.
-
-Conventional thinking is "failure is not an option" for general purpose 
-operating systems.  Since this OS is used in addition to Windows or Linux, 
-however, failure is an option -- just use Windows or Linux if you can't do 
-something.  I cherry-pick what it will and won't do, to make it maximally 
-beautiful.  The following applications more or less form a basis that spans the 
-range of use that TempleOS is intended for:
-
-/Demo/Games/BattleLines.HC
-/Demo/Games/BigGuns.HC
-/Demo/Games/BlackDiamond.HC
-/Demo/Games/BomberGolf.HC
-/Demo/Games/CastleFrankenstein.HC
-/Demo/Games/CharDemo.HC
-/Demo/Games/CircleTrace.HC
-/Demo/Games/Collision.HC
-/Demo/Games/Digits.HC
-/Demo/Games/DunGen.HC
-/Demo/Games/Talons.HC
-/Demo/Games/ElephantWalk.HC
-/Demo/Games/FlapBat.HC
-/Demo/Games/FlatTops.HC
-/Demo/Games/Halogen.HC
-/Demo/Games/MassSpring.HC
-/Demo/Games/Maze.HC
-/Demo/Games/RainDrops.HC
-/Demo/Games/RawHide.HC
-/Demo/Games/Rocket.HC
-/Demo/Games/RocketScience.HC
-/Demo/Games/Squirt.HC
-/Demo/Games/TheDead.HC
-/Demo/Games/TicTacToe.HC
-/Demo/Games/TreeCheckers.HC
-/Demo/Games/Varoom.HC
-/Demo/Games/Wenceslas.HC
-/Demo/Games/Whap.HC
-/Demo/Games/Zing.HC
-/Demo/Games/ZoneOut.HC
-/Apps/Psalmody/Examples/childish.HC
-/Apps/Psalmody/Examples/night.HC
-/Apps/Psalmody/Examples/prosper.HC
-
-Two things to know about TempleOS are that tasks have MAlloc/Free heap memory, 
-not applications, and tasks have compiler symbol tables that persist at a scope 
-like environment variables in other operating systems, and the symbols can 
-include functions.
-
-For other operating systems, I hated learning one language for command line 
-scripts and another for programming.  With TempleOS, the command line feeds 
-right into the HolyC compiler, line by line, and it places code into memory it 
-MAlloc()s.  The compiler is paused at the command line, waiting for input.  
-Naturally, you #include a program to load it into memory and, usually, start it.
-
-During the boot process, many files get compiled before you have access to the 
-command line.  (Don't worry, booting takes only two seconds.)  All the header 
-declarations for the operating system are compiled and are available for use in 
-your programs without needing to #include them.  Everything is truly compiled to 
-native x86_64 machine code, nothing is interpreted and there is no byte code.
-
-Statements at the global scope -- outside the scope of functions -- execute 
-immediately.  There is no main() function.  Instead, you give meaningful names 
-to what would be main() functions and you invoke them by calling them with a 
-statement in the global scope, usually at the bottom of your file.
-
-I started with C syntax, but didn't like the command line for a directory 
-listing looking like this:
-
->Dir("*.*",FALSE);
-
-So, I added default args from C++ and it looked like this:
-
->Dir();
-
-I didn't like that, so I made parentheses optional on calls with no args and it, 
-now, looks like this:
-
->Dir;
-
-The syntax change created an ambiguity when specifying function addresses, like 
-for calling QSort().  To resolve it, I  made a '&' required in front of function 
-names when specifying an address of a function, which is better anyway.
-
-Once I was no longer using standard C/C++ syntax, I decided to change everything 
-I didn't like and call it HolyC.  Here are the new operator precedence rules.  
-It's Biblical!  See Luke,5:37.
-
-There are no object files in TempleOS and, normally, you don't make executable 
-files either, but you can.  That's known as Ahead-of-Time compilation.  Instead, 
-you Just in Time compile.
-
-Tasks have no priority and are never removed from the queue.  Instead, they 
-often poll whatever they are waiting on and swap-out.  (Swapping tasks takes 
-half a microsecond and does not involve disk activity or memory maps.)  See 
-Scheduler.  Polling keeps it simple.  It might be a problem if you had lots of 
-tasks busy, which rarely happens on a home computer.  The order of the tasks in 
-the queue determines front-to-back window order.
-
-The FAT32 filesystem is supported to makes exchanging files with a dual booted 
-other operating system easy and there is the simple, 64-bit TempleOS RedSea 
-filesystem.  The RedSea has allocation bitmap for clus and all files are stored 
-contiguously.  You can't grow files.
-
-TempleOS is geared toward reading and writing whole files.  Since whole files 
-are processed, compression is possible.  Filenames ending in ".Z" are 
-automatically compressed or uncompressed when stored and fetched.  TempleOS does 
-support direct block random access into files, however -- FBlkRead() and 
-FBlkWrite().
-
-If a file is not found, ".Z" is added or removed and a search is done, again.  
-There is no PATH, but parent directories are searched when a file is not found.  
-This feature is especially useful for default account files.
-
-The graphic resolution is poor, 640x480 16 color, but God said it was a covenant 
-like circumcision.  Also, that's all I feel comfortable with without GPU 
-acceleration supported.  A 1600x1200x24 bit scrn takes 37 times more memory, 
-implying 37 times the CPU power.  Also, a fixed size keeps it simple with 
-everybody machine having the same appearance.  Look on the bright-side -- you 
-won't spend as much time twiddling pixels for your game art and you'll have tons 
-of CPU power available, especially with multicore systems.
-
-TempleOS is for hobbyist programmers on single user (at a time) home computers, 
-not mainframes or servers.  The focus task is all-important so symmetrical 
-multiprocessing is almost pointless.  Why does it matter running two apps at the 
-same time twice as fast when you really want to run one faster?  You could say 
-TempleOS does master/slave multiprocessing.  The anticipated use for multicore 
-is primarily putting graphics on the scrn.  Hardware graphics acceleration is 
-not used, so this is possible.  See TempleOS MultiCore.
-
-There is no distinction between the terms task, process or thread.  All have a 
-task record, CTask, pointed to by the FS segment reg and are accessed with Fs-> 
-while Gs-> points to a CCPU for the current CPU core.  Each task can have just 
-one window, but a task can have children with windows.  (The segment regs are 
-just used as extra regs -- there is nothing segmented about TempleOS' memory.)  
-It is approximately the case that TempleOS is multi-threading, 
-single-processing.
-
-In TempleOS, Adam Task refers to the father of all tasks.  He's never supposed 
-to die.  Since tasks inherit the symbols of parents, system-wide stuff is 
-associated with Adam.  His heap is like kernel memory in other operating 
-systems.  Since Adam is immortal, it's safe to alloc objects, not tied to any 
-mortal task, from Adam's heap.  He stays in a server mode, taking requests, so 
-you can ask him to #include something, placing that code system-wide.  A funny 
-story is that originally I called it the root task and even had a /Root 
-directory :-)  Adam executes ::/StartOS.HC at boot time.
-
-For easy back-ups, place everything you author in your /Home directory and 
-subdirectories.  Then, use CopyTree().  That should make upgrading easy, too.  
-Customizable start-up scripts go in your /Home directory.  The default start-up 
-scripts are in the root directory.  Copy the start-up files you wish to 
-customize into /Home and modify them.  See Home Files.  You can make your own 
-distro that includes everything and is a bootable live CD with 
-::/Misc/DoDistro.HC.
-
-Typically, your usage pattern through the day will be repeatedly left or right 
-clicking on filenames in a cmd line Dir() listing.  You left-click files to edit 
-them and right-click to #include them.  To begin a project, type Ed("filename");
-, supplying a filename.  You can also run programs with <F5> when in the editor. 
-<ESC> to save and exit the file.  You'll need to do a new Dir() cmd, 
-periodically, so make a macro on your PersonalMenu.  Access your PersonalMenu by 
-pressing <CTRL-m>, cursoring until you are on top of it and pressing <SPACE>.
-
-<CTRL-t> toggles plain text mode, showing format commands, a little like viewing 
-html code.
-<CTRL-l> inserts a text widgets.
-<CTRL-r> inserts or edit a graphic sprite resource at cursor location.
-<CTRL-d> brings-up the file manager.  It's pretty crappy.  I find I don't need 
-it very often, believe it or not.
-<CTRL-b> toggles window border.
-
-<ALT-m> maximizes a window.
-<ALT-SHIFT-a> closes AutoComplete.
-<ALT-a> brings back AutoComplete.
-<ALT-v> vertically tiles windows.
-<ALT-h> horizontally tiles windows.
-The ALT keys are defined in ~/HomeKeyPlugIns.HC.  You can customize them.
-
-<CTRL-ALT-t> new terminal window.
-<CTRL-ALT-n> switches to the next window.
-<CTRL-ALT-x> kills a window.
-
-Find() is your best friend.  There's a wrapper function called F() in your ~/Hom
-eWrappers.HC.Z file.  Feel free to make wrapper functions for functions you use 
-often and customize the args.  By the way, Find() or R() can be used to replace 
-strings across multiple files.  You can access Find() using <CTRL-SHIFT-f>.
-
-As you browse code, use the AutoComplete window to look-up functions, etc.  <CTR
-L-SHIFT-F1> (or whatever number) to follow a sym to it's source.  You can browse 
-deeper and deeper.  You go back with <SHIFT-ESC>.
-
-Use the Help & Index or Demo Index to find-out what exists.  Press <F1> for help 
-or use the links on your menu (<CTRL-m>).  Also, look in the /Demo or /Apps 
-directories for inspiration.
-
-Software is distributed as RedSea ISO files.  Burn a CD/DVD, or set your CD/DVD 
-in QEMU, VMware or VirtualBox to the ISO file.  Then, access the 'T' drive.  Or, 
-Mount() the ISO.C file and access the 'M' drive in TempleOS.  It must be a 
-contiguous ISO.C file, so rename it under TempleOS to ISO.C.
-
-Ideally, do not install applications such as games onto your hard drive because 
-we wish to keep hard drive usage low, so the whole 'C' drive can be copied 
-quickly to 'D'.  Also, the FileMgr() <CTRL-d> starts too slowly when there are 
-lots of hard drive files, but that is how we want it.
-
-3rd party libraries are banned, since they circumvent the 100,000 line of code 
-limit in the TempleOS Charter.  All applications must only depend on the core 
-TempleOS files and whatever they bring along in the ISO.  This is similar to how 
-Commodore 64 applications only depended on the ROM.
-
-Create a RedSea ISO file with RedSeaISO().  Send an email to 
-tdavis@templeos.org if you want me to post a link to your TempleOS code in the 
-App Store.
-
-Take Tour
-
-
-* "Linux" is a trademark owned by Linus Torvalds.
-* "Windows" is a trademark owned by MicroSoft Corp.
-* "Commodore 64" is a trademark owned by Polabe Holding NV.
-* "QEMU" is a trademark owned by Fabrice Bellard.
-* "VMware" is a trademark owned by VMware, Inc.
-* "VirtualBox" is a trademark owned by Oracle.
-
- diff --git a/public/Wb/Home/Doc/WhyNotMore.DD.HTML b/public/Wb/Home/Doc/WhyNotMore.DD.HTML deleted file mode 100755 index 0121162..0000000 --- a/public/Wb/Home/Doc/WhyNotMore.DD.HTML +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - -
-                                 Why Not More?
-
-If a feature cannot be made to work correctly and consistently, professional 
-companies usually remove the feature.  Because PC hardware is so diverse, 
-getting things to work on all people's computers is really difficult.  For one 
-thing, you practically have to own all the different hardware to write drivers 
-for it.  If a company wanted to sell a PC operating system, they would offer a 
-warranty and, therefore, could not get away with amateur behavior.  TempleOS 
-absolutely requires 64-bit computers, so we leave behind much trouble, but 
-plenty remains.
-
-The PCI bus interface is what modern hardware uses.  Before PCI, life was simple 
-and devices used I/O ports.  After studying PCI Interrupts and attempting to do 
-a HDAudio driver, I came to realize that modern PCI devices require ten times 
-more code and I cannot even come close to making them work on everyone's machine 
-because with PCI devices there are several models to worry about, unlike with 
-the older ISA bus devices which can be done with one driver.
-
-Currently, I have no PCI drivers.  My drivers use I/O ports and operate in ISA 
-bus mode.  At this point, I only have one driver for each type of device and it 
-is delightfully simple that way.  I have one keyboard driver, one mouse driver, 
-one ATA hard drive driver, one ATAPI CD/DVD driver, one VGA 640x480 16 color 
-video driver and one PC Speaker driver.  I use the PIT and HPET timers and 
-PIC Interrupt Controller.  I use  IRQ0 for timer, IRQ1 for keyboard, and IRQ12 
-for mouse.  If IRQ12 is not firing, I am able to poll the mouse.
-
-In the CPU department, I have state of the art 64-bit long mode with multicore 
-support.  I use the APIC and start-up multicore operation.
-
-I have made an incredible accomplishment by getting it to work on practically 
-everyone's computer as long as it is 64-bit and they run inside VMware, QEMU or 
-VirtualBox.
-
-Adding a USB driver would be really ugly with UHCI, EHCI, OHCI, USB1, USB2, 
-USB3, ICH6, ICH7, ICH8, ICH9, ICH10, ICH11, ICH12, boot mode and regular mode 
-for keyboard/mouse and a diversity of HID reports.  It's hopeless.  I could 
-never offer anything but crappy, limited support and it would just add a ton of 
-crappy code that mostly didn't work.  What would I gain?  Nothing.  A keyboard 
-or mouse would not be improved.  Solid State USB drives would be really nice, 
-but it's not going to happen.
-
-The same story is basically true for GPUs, audio, networking and AHCI hard drive 
-drivers.  God said 640x480 16 color was a covenant like circumcision, so the 
-video will never change, even if a Standard PC was made.  If you attempt 
-multimedia, everything will break because memory will get fragmented with huge 
-multimedia files.  Some day, if super-simple high speed serial allows 
-networking, there will be no browser within the 100,000 line limit and, with 
-only 16 colors, the world wide web is not tolerable.  FTP and telnet might be 
-possible, in the far distant future, if they could fit within the 100,000 line 
-limit.  Currently, there are 80,849 lines of code.
-
-I don't stand a chance working on native hardware, anymore.  I could install and 
-run natively on hardware from about 2005-2010.  It requires BIOS's being nice 
-enough to write USB mode PS/2 legacy keyboard/mouse support.  As it turns-out, 
-sometimes the BIOS has PS/2 drivers but purposely disables them, just to be 
-mean.  The CIA and whole industry is trying to mess everything up, on purpose.  
-Perhaps, at a point of sale in a store, a thief could hack a credit card 
-machine.  Therefore, the BIOS companies actually want it difficult to make 
-drivers and purposely make it broken.
-
-The ATA/ATAPI hard drives often can be run with I/O ports if you can find them.  
-lspci -v on Linux or system information on Windows can help you locate the SATA 
-IO ports the hard drive and CD/DVD have.  They no longer are enabled by the 
-BIOS.  It's hopeless.  I'm stuck with very slow drive performance, but it works 
-for everybody.
-
-UEFI is pointless.  If I am forced to run in VMware, QEMU or VirtualBox, they 
-will always support non-UEFI mode.  Without working, native hard drive and 
-CD/DVD drivers, you can't get very far with UEFI on a native install, not to 
-mention SecureBoot.  UEFI is, first of all, redundant.  If non-UEFI works in a 
-virtual machine, supporting UEFI would only be redundant, ugly nasty code.  My 
-compiler does not create an ELF or PE format.  I would have to ruin the beauty 
-of my compiler, which would make me cry many tears.
-
-God talks.  It seems reasonable that I will get to make the rules for the whole 
-industry, in the future when God is announced publically to the World.
-
-I made ::/Doc/Demands.DD.
-
-When the PC was created, they wanted flexibility because they did not know the 
-future.  Now, the industry is mature and it is time to make a 100% standard PC 
-that everybody uses.  ::/Doc/StdTempleOSPC.DD
-
-
-* "QEMU" is a trademark owned by Fabrice Bellard.
-* "VMware" is a trademark owned by VMware, Inc.
-* "VirtualBox" is a trademark owned by Oracle.
-
- diff --git a/public/Wb/Home/Doc/Widget.DD.HTML b/public/Wb/Home/Doc/Widget.DD.HTML deleted file mode 100755 index cd751ff..0000000 --- a/public/Wb/Home/Doc/Widget.DD.HTML +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - -
-                               DolDoc Widget Help
-
-DolDoc is a TempleOS document type.
-
-"Expression" a num or HolyC algebraic term with operators and HolyC syms can be 
-entered.
-"Macro" Most entries can behave like macro entries if you assign them macro 
-strs.
-"InStr" Like a macro except it is an InFile.  You can't have both an in_str and 
-macro text defined.  
-
-Tag Text is the text that will be displayed for the item.  For links, you can 
-leave it blank and the details of the link will be shown.
-Hide means display nothing, making an entry invis.
-
-Left X relative to the left margin.
-Center X relative to the horizontal center of the window.
-Right X relative to the right margin.
-Top Y relative to the top of the window.
-Center Y relative to the vertical center of the window.
-Bottom Y relative to the bottom of the window.
-
-Blink make the text blink.
-Invert make the text inverted.
-Underline make the text underlined. 
-
-Scroll X Length Expression if a value is entered, the text will scroll in an 
-area of this width.
-Y Offset Expression if a value is entered, the text will be shifted vertically 
-by this many pixs, so you can make superscripts or subscripts.
-X Offset Expression if a value is entered, the text will be shifted horizontally 
-by this many pixs.
-
-Tree The item will behave like a tree widget, with this as the root.
-Collapsed The tree or hidden widget will begin collapsed.
-Define Str will substitute a #define or DefineLoad() string for the tag.
-
-Quote Make the res suitable for including in a program, in quotes, especially fo
-rmat entries in class definitions.
-
-X Expression For cursor movements, the horizontal value.
-Y Expression For cursor movements, the vertical value.
-
-PopUp For macro's, run the macro in a PopUp window.  Do this when making a macro 
-to run a program, so it doesn't tie-up memory.
-
-Escape For macro's, send an <ESC> char to exit before running the macro.  
-Without this, the macro runs in the wrong window, usually.
-
-Refresh Data  updates $DA...$ entry continuously.
-
-Html Link  stores a link which will be embedded if you generate a html version 
-of a document with ::/Demo/ToHtmlToTXTDemo/ToHtml.HC.
-
- diff --git a/public/Wb/Home/Doc/Windows.DD.HTML b/public/Wb/Home/Doc/Windows.DD.HTML deleted file mode 100755 index ec323a2..0000000 --- a/public/Wb/Home/Doc/Windows.DD.HTML +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - -
-Only tasks on Core0 can have a window and there can be only one window per task. 
- The window Z-buffer, top-to-bottom order is determined by the order in the task 
-queue, with the WinMgr on the bottom.  A task can have child task popup windows.
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/ADskA.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/ADskA.HC.HTML deleted file mode 100755 index 9c2b216..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/ADskA.HC.HTML +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - -
-#help_index "File/Cmd Line (Typically);Cmd Line (Typically)"
-public U8 *DBlk(I64 blk,Bool write=FALSE)
-{//Dump disk block. Optionally, write.
-//If you set write to TRUE, the block will
-  //be written when you press <ESC>.
-  //See ::/Demo/Dsk/DskRaw.HC.
-  U8 *buf=MAlloc(BLK_SIZE);
-
-  BlkRead(Fs->cur_dv,buf,blk,1);
-  DocD(buf,BLK_SIZE);
-  if (write) {
-    "Edit and press <ESC> to write or <SHIFT-ESC>\n";
-    if (View) {
-      "Write\n";
-      BlkWrite(Fs->cur_dv,buf,blk,1);
-    }
-  }
-  return buf;
-}
-
-public U8 *DClus(I64 c,Bool write=FALSE,I64 num=0)
-{//Dump disk clus. Optionally, write.
-//If you set write to TRUE, the clus will
-  //be written when you press <ESC>.
-  //See ::/Demo/Dsk/DskRaw.HC.
-  //Do Dir("*",TRUE); to get clus numbers of files.
-  U8 *buf=MAlloc(Fs->cur_dv->spc<<BLK_SIZE_BITS);
-  c=ClusNumNext(Fs->cur_dv,c,num);
-  ClusRead(Fs->cur_dv,buf,c,1);
-  "Clus:%X\n",c;
-  DocD(buf,Fs->cur_dv->spc<<BLK_SIZE_BITS);
-  if (write) {
-    "Edit and press <ESC> to write or <SHIFT-ESC>\n";
-    if (View) {
-      "Write\n";
-      ClusWrite(Fs->cur_dv,buf,c,1);
-    }
-  }
-  return buf;
-}
-
-public U8 *Dump(U8 *filename,Bool write=FALSE)
-{//Dump file. Optionally, write.
-//If you set write to TRUE, the file will
-  //be written when you press <ESC>.
-  U8 *buf;
-  I64 size;
-  if (buf=FileRead(filename,&size)) {
-    DocD(buf,size);
-    if (write) {
-      "Edit and press <ESC> to write or <SHIFT-ESC>\n";
-      if (View) {
-        "Write\n";
-        FileWrite(filename,buf,size);
-      }
-    }
-  }
-  return buf;
-}
-
-public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".")
-{//Copy files.
-//If the name ends in ".Z", it will
-  //be stored compressed.  If not ".Z"
-  //it will be stored uncompressed.
-  Bool res=TRUE;
-  CDirContext *dirc;
-  CDirEntry *tmpde,*tmpde1;
-  U8 *st;
-  if (!(tmpde1=FilesFind(src_files_find_mask,FUF_CLUS_ORDER)))
-    return FALSE;
-  if (IsDir(dst_files_find_mask)) {
-    if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
-      tmpde=tmpde1;
-      while (tmpde) {
-        if (!(tmpde->attr & RS_ATTR_DIR)) {
-          st=FileNameAbs(tmpde->name);
-          if (!CopySingle(tmpde->full_name,st))
-            res=FALSE;
-          Free(st);
-        }
-        tmpde=tmpde->next;
-      }
-      DirContextDel(dirc);
-    }
-    DirTreeDel(tmpde1);
-    return res;
-  } else {
-    DirTreeDel(tmpde1);
-    return CopySingle(src_files_find_mask,dst_files_find_mask);
-  }
-}
-
-public Bool Move(U8 *f1,U8 *f2)
-{//Move files from one location to another or rename.
-  if (Copy(f1,f2)) {
-    Del(f1);
-    return TRUE;
-  }
-  return FALSE;
-}
-
-I64 CopyTree2(CDirEntry *tmpde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir)
-{
-  U8 *st;
-  I64 res=1;
-  while (tmpde) {
-    st=MAlloc(StrLen(tmpde->full_name)+dst_dir_len+2);
-    MemCpy(st,dst_dir,dst_dir_len);
-    StrCpy(st+dst_dir_len,tmpde->full_name+src_dir_len);
-    if (tmpde->attr & RS_ATTR_DIR) {
-      DirMk(st,LinkedLstCnt(tmpde->sub));
-      res+=CopyTree2(tmpde->sub,src_dir_len,dst_dir_len,dst_dir);
-    } else
-      if (CopySingle(tmpde->full_name,st))
-        res++;
-    Free(st);
-    tmpde=tmpde->next;
-  }
-  return res;
-}
-public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
-        Bool no_mask=TRUE)
-{//Copy directory tree.
-//Returns the count of copied files (not dirs).
-  CDirContext *dirc;
-  CDirEntry *tmpde=NULL;
-  I64 res=0,i1,i2;
-  U8 *st1,*st2;
-
-  st1=DirNameAbs(src_files_find_mask);
-  st2=DirNameAbs(dst_files_find_mask);
-  i1=StrLen(st1);
-  if (!StrNCmp(st1,st2,i1) && (st2[i1]=='/' || !st2[i1]) ) {
-    Free(st1);
-    Free(st2);
-    return 0;
-  }
-  Free(st1);
-  Free(st2);
-  if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) {
-    tmpde=FilesFind(dirc->mask,FUF_RECURSE);
-    st1=DirCur;
-    DirContextDel(dirc);
-    i1=StrLen(st1);
-    if (i1==3) i1--;
-    if (dirc=DirContextNew(dst_files_find_mask,TRUE,TRUE)) {
-      st2=DirCur;
-      i2=StrLen(st2);
-      if (i2==3) i2--;
-      res=CopyTree2(tmpde,i1,i2,st2);
-      DirContextDel(dirc);
-      Free(st2);
-    }
-    DirTreeDel(tmpde);
-    Free(st1);
-  }
-  return res;
-}
-
-I64 DelTreeDirs(CDirEntry *tmpde1)
-{
-  I64 res=0;
-  CDirEntry *tmpde2;
-  while (tmpde1) {
-    tmpde2=tmpde1->next;
-    if (tmpde1->attr & RS_ATTR_DIR) {
-      if (tmpde1->sub)
-        res+=DelTreeDirs(tmpde1->sub);
-      res+=Del(tmpde1->full_name,TRUE,TRUE);
-    }
-    DirEntryDel(tmpde1);
-    tmpde1=tmpde2;
-  }
-  return res;
-}
-I64 DelTreeFiles(CDirEntry *tmpde1)
-{
-  I64 res=0;
-  CDirEntry *tmpde2;
-  while (tmpde1) {
-    tmpde2=tmpde1->next;
-    if (tmpde1->attr & RS_ATTR_DIR) {
-      if (tmpde1->sub)
-        res+=DelTreeFiles(tmpde1->sub);
-    } else
-      res+=Del(tmpde1->full_name,FALSE,TRUE);
-    DirEntryDel(tmpde1);
-    tmpde1=tmpde2;
-  }
-  return res;
-}
-public I64 DelTree(U8 *files_find_mask,U8 *fu_flags=NULL)
-{//Delete directory tree.
-  I64 res=0,fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (IsDir(files_find_mask)) {
-    res=DelTreeDirs(FilesFind(files_find_mask,fuf_flags));
-    res+=Del(files_find_mask,TRUE,TRUE);
-    res+=Del(files_find_mask,FALSE,TRUE);
-  } else
-    res=DelTreeFiles(FilesFind(files_find_mask,fuf_flags));
-  return res;
-}
-
-U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=I64_MIN)
-{
-  CDrv *dv=Let2Drv(*filename);
-  CDirEntry de;
-  U8 *cur_dir=StrNew(filename),buf[STR_LEN];
-  if (FileFind(filename,&de,FUF_JUST_FILES)) {
-    Free(de.full_name);
-    if (!StrCmp(attr,"+?"))
-      "%-48ts %s\n",filename,StrPrintFlags(buf,Define("ST_FILE_ATTRS"),de.attr);
-    else {
-      StrFirstRem(cur_dir,":");
-      StrLastRem(cur_dir,"/");
-      if (!*cur_dir)
-        StrCpy(cur_dir,"/");
-      ScanFlags(&de.attr,Define("ST_FILE_ATTRS"),attr);
-      if (cdt==I64_MIN)
-        de.datetime=Now;
-      else
-        de.datetime=cdt;
-      DirNew(dv,cur_dir,&de,FALSE);
-    }
-  } else
-    PrintErr("File not found: \"%s\".\n",filename);
-  Free(cur_dir);
-}
-public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?",
-        U8 *fu_flags=NULL,CDate cdt=I64_MIN)
-{/*Touch file attributes and DateTime.
-Default lists attributes.
-attr: "+?" =show current
-"+T" =resident
-RS_ATTR_READ_ONLY  ST_FILE_ATTRS
-To Set DateL:
-Touch(filename,"",,datetime);
-*/
-  I64 fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    TouchFile(tmpde->full_name,attr,cdt);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/ADskB.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/ADskB.HC.HTML deleted file mode 100755 index 41c5b43..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/ADskB.HC.HTML +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - -
-#help_index "File/Internal"
-I64 DirTreeSerializeSize(CDirEntry *tmpde)
-{
-  I64 res=0;
-  while (tmpde) {
-    res+=CDIR_SIZE+1;
-    if (tmpde->attr & RS_ATTR_DIR)
-      res+=DirTreeSerializeSize(tmpde->sub);
-    tmpde=tmpde->next;
-  }
-  return res+1;
-}
-I64 DirTreeSerializeFill(CDirEntry *tmpde,U8 *dst)
-{
-  I64 res=0,i;
-  while (tmpde) {
-    *dst++=1;
-    res++;
-    MemCpy(dst,&tmpde->start,CDIR_SIZE);
-    dst+=CDIR_SIZE;
-    res+=CDIR_SIZE;
-    if (tmpde->attr & RS_ATTR_DIR) {
-      i=DirTreeSerializeFill(tmpde->sub,dst);
-      dst+=i;
-      res+=i;
-    }
-    tmpde=tmpde->next;
-  }
-  *dst=0;
-  return res+1;
-}
-public U8 *DirTreeSerialize(CDirEntry *tmpde,I64 *_size=NULL)
-{//Serialize tree returned from FilesFind() into a one contiguous U8 array.
-  I64 size=DirTreeSerializeSize(tmpde);
-  U8 *buf=MAlloc(size);
-  DirTreeSerializeFill(tmpde,buf);
-  if (_size) *_size=size;
-  return buf;
-}
-
-U8 *DirTreeUnserialize2(U8 *src,CDirEntry **tmpde)
-{
-  CDirEntry *tmpde1;
-  if (*src++) {
-    tmpde1=CAlloc(sizeof(CDirEntry));
-    *tmpde=tmpde1;
-    MemCpy(&tmpde1->start,src,CDIR_SIZE);
-    src+=CDIR_SIZE;
-    if (tmpde1->attr & RS_ATTR_DIR)
-      src=DirTreeUnserialize2(src,&tmpde1->sub);
-    src=DirTreeUnserialize2(src,&tmpde1->next);
-  } else
-    *tmpde=NULL;
-  return src;
-}
-public CDirEntry *DirTreeUnserialize(U8 *src)
-{//Unserialize tree to make it like a tree returned from FilesFind().
-  CDirEntry *tmpde=NULL;
-  DirTreeUnserialize2(src,&tmpde);
-  return tmpde;
-}
-
-#help_index "File/Program Routines"
-U0 FOFlatten(CDirEntry *tmpde,CDirEntry **a,I64 *i)
-{
-  CDirEntry *tmpde1;
-  while (tmpde) {
-    tmpde1=tmpde->next;
-    if (tmpde->attr&RS_ATTR_DIR) {
-      FOFlatten(tmpde->sub,a,i);
-      DirEntryDel(tmpde);
-    } else {
-      a[*i]=tmpde;
-      *i=*i+1;
-    }
-    tmpde=tmpde1;
-  }
-}
-
-I64 Size1(CDirEntry *tmpde,I64 *_fuf_flags,I64 round_to)
-{
-  U8 buf[BLK_SIZE];
-  I64 res=0,i;
-  CDrv *dv;
-  while (tmpde) {
-    if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
-          !(tmpde->attr&RS_ATTR_DIR) &&
-          FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
-      dv=Let2Drv(*tmpde->full_name);
-      BlkRead(dv,buf,Clus2Blk(dv,tmpde->clus),1);
-      i=(&buf)(CArcCompress *)->expanded_size;
-    }
-    if (round_to)
-      i=CeilU64(tmpde->size,round_to);
-    if (tmpde->attr&RS_ATTR_DIR)
-      i+=Size1(tmpde->sub,_fuf_flags,round_to);
-    tmpde->user_data=i;
-    res+=i;
-    tmpde=tmpde->next;
-  }
-  return res;
-}
-public I64 Size(U8 *files_find_mask="/*",U8 *fu_flags=NULL,I64 round_to=0)
-{//Total size of files in mask. "+x" for expanded size.
-//Does not include directory size of base directory, but
-  //does include size of sub directories.
-  I64 fuf_flags=0,res=0;
-  CDirEntry *tmpde1=NULL;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
-    fuf_flags&=FUF_EXPAND;
-    res=Size1(tmpde1,&fuf_flags,round_to);
-    DirTreeDel(tmpde1);
-  }
-  return res;
-}
-
-public I64 FileCnt(CDirEntry *tmpde)
-{//Cnt of files in CDirEntry tree.
-  I64 cnt=0;
-  while (tmpde) {
-    if (tmpde->attr&RS_ATTR_DIR)
-      cnt+=FileCnt(tmpde->sub);
-    else
-      cnt++;
-    tmpde=tmpde->next;
-  }
-  return cnt;
-}
-
-#help_index "File/Cmd Line (Typically);Cmd Line (Typically)"
-public I64 FF(U8 *files_find_mask,U8 *fu_flags=NULL)
-{//Files find. List files matching mask.
-  I64 cnt=0,fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    PutFileLink(tmpde->full_name);
-    '\n';
-    cnt++;
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return cnt;
-}
-
-public I64 Zip(U8 *files_find_mask="*",U8 *fu_flags=NULL)
-{//Compress files by moving to .Z filename.
-  U8 *st;
-  CDirEntry *tmpde,*tmpde1;
-  I64 res=0,fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+O");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    if (!IsDotZ(tmpde->full_name)) {
-      st=MStrPrint("%s.Z",tmpde->full_name);
-      res+=Move(tmpde->full_name,st);
-      Free(st);
-    }
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return res;
-}
-
-public I64 Unzip(U8 *files_find_mask="*.Z",U8 *fu_flags=NULL)
-{//Uncompress files by moving to not .Z filename.
-//You don't have to do this for normal operation.
-  //It automatically unzips ".Z" files.
-  U8 *st;
-  CDirEntry *tmpde,*tmpde1;
-  I64 res=0,fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+O");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    if (IsDotZ(tmpde->full_name)) {
-      st=StrNew(tmpde->full_name);
-      StrLastRem(st,".");
-      res+=Move(tmpde->full_name,st);
-      Free(st);
-    }
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/DskChk.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/DskChk.HC.HTML deleted file mode 100755 index 5a57f79..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/DskChk.HC.HTML +++ /dev/null @@ -1,475 +0,0 @@ - - - - - - - - - - - -
-#help_index "Info;File/Cmd Line (Typically);Cmd Line (Typically)"
-Bool ChkDskConfirm(Bool *_fix,Bool *_confirm)
-{
-  if (*_fix && *_confirm) {
-    "Fix ";
-    if (!YorN)
-      *_fix=FALSE;
-    *_confirm=FALSE;
-  }
-  return *_fix;
-}
-
-I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tmpde1,
-        U8 *bits,U8 *bits2,I64 size,I64 bpc)
-{
-  CDirEntry *tmpde2;
-  I64 i,j,errs=0;
-  while (tmpde1) {
-    tmpde2=tmpde1->next;
-    if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
-      errs+=RedSeaChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
-    j=(tmpde1->size+bpc-1)/bpc;
-    for (i=0;i<j;i++) {
-      if (i+tmpde1->clus-dv->data_area>size) {
-        PrintErr("Invalid Clus:%s Clus:%X\n",tmpde1->full_name,
-              i+tmpde1->clus);
-        errs++;
-        break;
-      }
-      if (LBts(bits,i+tmpde1->clus-dv->data_area)) {
-        PrintErr("Dbl Alloc:%s Clus:%X\n",tmpde1->full_name,
-              i+tmpde1->clus);
-        errs++;
-      }
-      if (!LBtr(bits2,i+tmpde1->clus-dv->data_area)) {
-        PrintErr("UnAlloc:%s Clus:%X\n",tmpde1->full_name,
-              i+tmpde1->clus);
-        errs++;
-      }
-    }
-    DirEntryDel(tmpde1);
-    tmpde1=tmpde2;
-  }
-  return errs;
-}
-
-I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
-{
-  I64 i,j,bpc,size,errs=0;
-  CDrv *dv=Let2Drv(drv_let),*old_dv=Fs->cur_dv;
-  U8 *files_find_mask=MStrPrint("%c:/*",Drv2Let(dv)),
-        *old_dir=StrNew(Fs->cur_dir),
-        *bits,*bits2;
-  CDirEntry *ptr,*ptr2;
-
-  Drv(drv_let);
-  "Scanning...\n";
-  size=(dv->size-(dv->data_area-dv->drv_offset))/dv->spc;
-  bpc=dv->spc<<BLK_SIZE_BITS;
-  bits=CAlloc((size+7)>>3);
-  bits2=CAlloc((size+7)>>3+BLK_SIZE);
-  BlkRead(dv,bits2,dv->fat1,((size+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS);
-
-  //Get Root Dir size
-  ptr2=MAlloc(bpc);
-  BlkRead(dv,ptr2,dv->root_clus,1);
-  ptr=ptr2(U8 *)-offset(CDirEntry.start);
-  j=(ptr->size+bpc-1)/bpc;
-  Free(ptr2);
-
-  for (i=0;i<j;i++) {
-    if (i+dv->root_clus-dv->data_area>size) {
-      PrintErr("Invalid Clus: RootDir Clus:%X\n",i+dv->root_clus);
-      errs++;
-      break;
-    }
-    if (LBts(bits,i+dv->root_clus-dv->data_area)) {
-      PrintErr("Dbl Alloc: RootDir Clus:%X\n",i+dv->root_clus);
-      errs++;
-    }
-    if (!LBtr(bits2,i+dv->root_clus-dv->data_area)) {
-      PrintErr("UnAlloc: RootDir Clus:%X\n",i+dv->root_clus);
-      errs++;
-    }
-  }
-
-  errs+=RedSeaChkDskLst(dv,FilesFind(files_find_mask,FUF_RECURSE),
-        bits,bits2,size,bpc);
-  for (i=1;i<size;i++)
-    if (Bt(bits2,i)) {
-      PrintWarn("Shouldn't Alloc Clus:%0X\n",i+dv->data_area);
-      errs++;
-      if (ChkDskConfirm(_fix,_confirm))
-        RedSeaFreeClus(dv,i+dv->data_area,1);
-    }
-
-  Free(files_find_mask);
-  Free(bits);
-  Free(bits2);
-  Drv(Drv2Let(old_dv));
-  Cd(old_dir);
-  Free(old_dir);
-  return errs;
-}
-
-I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tmpde1,
-        U8 *bits,U32 *bits2,I64 size,I64 bpc)
-{
-  CDirEntry *tmpde2;
-  I64 i,c,errs=0;
-  while (tmpde1) {
-    tmpde2=tmpde1->next;
-    if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
-      errs+=FAT32ChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
-    i=0;
-    c=tmpde1->clus;
-    while (0<c<0x0FFFFFF8) {
-      if (c>size) {
-        PrintErr("Invalid Clus:%s Clus:%X\n",tmpde1->full_name,c);
-        errs++;
-        break;
-      }
-      if (LBts(bits,c)) {
-        PrintErr("Dbl Alloc:%s Clus:%X\n",tmpde1->full_name,c);
-        errs++;
-      }
-      if (!bits2[c]) {
-        PrintErr("UnAlloc:%s Clus:%X\n",tmpde1->full_name,c);
-        errs++;
-      } else
-        bits2[c]=0;
-      c=ClusNumNext(dv,c);
-      i++;
-    }
-    if (!(tmpde1->attr & RS_ATTR_DIR)) {
-      i*=bpc;
-      if (tmpde1->size>i) {
-        PrintErr("Alloced File Too Short:%s\n",tmpde1->full_name);
-        errs++;
-      }
-      if (i>tmpde1->size+bpc-1) {
-        PrintWarn("Alloced File Too Long:%s\n",tmpde1->full_name);
-        errs++;
-      }
-    }
-    DirEntryDel(tmpde1);
-    tmpde1=tmpde2;
-  }
-  return errs;
-}
-
-I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
-{
-  I64 i,bpc,size,c,errs=0;
-  CDrv *dv=Let2Drv(drv_let),*old_dv=Fs->cur_dv;
-  U8 *files_find_mask=MStrPrint("%c:/*",Drv2Let(dv)),
-        *old_dir=StrNew(Fs->cur_dir),
-        *bits;
-  U32 *bits2;
-  Drv(drv_let);
-  "Scanning...\n";
-  size=(dv->size-(dv->data_area-dv->drv_offset))/dv->spc;
-  bpc=dv->spc<<BLK_SIZE_BITS;
-  bits=CAlloc((size+7)>>3);
-  bits2=CAlloc(size*4+BLK_SIZE);
-  BlkRead(dv,bits2,dv->fat1,(size*4+BLK_SIZE-1)>>BLK_SIZE_BITS);
-
-  c=dv->root_clus;
-  while (0<c<0x0FFFFFF8) {
-    if (c>size) {
-      PrintErr("Invalid Clus: RootDir Clus:%X\n",c);
-      errs++;
-      break;
-    }
-    if (LBts(bits,c)) {
-      PrintErr("Dbl Alloc: RootDir Clus:%X\n",c);
-      errs++;
-    }
-    if (!bits2[c]) {
-      PrintErr("UnAlloc: RootDir Clus:%X\n",c);
-      errs++;
-    } else
-      bits2[c]=0;
-    c=ClusNumNext(dv,c);
-  }
-
-  errs+=FAT32ChkDskLst(dv,FilesFind(files_find_mask,FUF_RECURSE),
-        bits,bits2,size,bpc);
-
-  bits2[1]=0; //See FAT32Fmt()
-  for (i=1;i<size;i++)
-    if (bits2[i]) {
-      PrintWarn("Shouldn't Alloc Clus:%0X\n",i);
-      errs++;
-      if (ChkDskConfirm(_fix,_confirm))
-        FAT32FreeClus(dv,i);
-    }
-  Free(files_find_mask);
-  Free(bits);
-  Free(bits2);
-  Drv(Drv2Let(old_dv));
-  Cd(old_dir);
-  Free(old_dir);
-  return errs;
-}
-
-public I64 DskChk(U8 drv_let=0,Bool fix=FALSE,Bool confirm=TRUE)
-{//Check disk for allocation errors and, optionally, fix.
-//You probably want to reformat and reinstall.
-  I64 errs=0;
-  CDrv *dv=Let2Drv(drv_let);
-  switch (dv->fs_type) {
-    case FSt_REDSEA:
-      errs=RedSeaChkDsk(drv_let,&fix,&confirm);
-      break;
-    case FSt_FAT32:
-      errs=FAT32ChkDsk(drv_let,&fix,&confirm);
-      break;
-    default:
-      PrintErr("File System Not Supported\n");
-  }
-  if (errs) {
-    if (fix)
-      "It might be a little better.  ";
-    "Copy files to another partition or CD/DVD, "
-          "reformat, and copy back.  "
-          "Or, copy from a back-up.\n";
-  }
-  return errs;
-}
-
-U0 RedSeaDrvView(U8 drv_let=0)
-{
-  CDrv *dv=Let2Drv(drv_let);
-  I64 lohi,c1,i,x,y,l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
-        s=dv->size+dv->drv_offset-dv->data_area;
-  U8 *bitmap;
-  CDC *dc=DCAlias;
-
-  SettingsPush; //See SettingsPush
-  WinMax;
-  WinBorder(ON);
-  DocCursor;
-  DocClear;
-  DCFill;
-  try {
-    i=((s+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
-    bitmap=MAlloc(i<<BLK_SIZE_BITS);
-    BlkRead(dv,bitmap,dv->fat1,i);
-    i=0;
-    for (y=0;y<GR_HEIGHT-3*FONT_HEIGHT;y++) {
-      if (ScanKey)
-        break;
-      for (x=0;x<GR_WIDTH-FONT_WIDTH<<1;x++) {
-        lohi=i*s;
-        c1=lohi/l;
-        if (Bt(bitmap,c1))
-          dc->color=ROP_XOR+BLUE^TRANSPARENT;
-        else
-          dc->color=ROP_XOR+WHITE^TRANSPARENT;
-        GrPlot(dc,x,y);
-        i++;
-      }
-    }
-    Free(bitmap);
-  } catch
-    DrvUnlock(dv);
-  GetChar;
-
-  SettingsPop;
-  DCFill;
-  DCDel(dc);
-}
-U0 FAT32DrvView(U8 drv_let=0)
-{
-  CDrv *dv=Let2Drv(drv_let);
-  I64 lohi,c1,i,x,y,l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
-        s=(dv->size+dv->spc-1)/dv->spc-(2+dv->data_area-dv->drv_offset);
-  U32 *bitmap;
-  CDC *dc=DCAlias;
-
-  SettingsPush; //See SettingsPush
-  WinMax;
-  WinBorder(ON);
-  DocCursor;
-  DocClear;
-  DCFill;
-  try {
-    i=(s*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
-    bitmap=MAlloc(i<<BLK_SIZE_BITS);
-    BlkRead(dv,bitmap,dv->fat1,i);
-    i=0;
-    for (y=0;y<GR_HEIGHT-3*FONT_HEIGHT;y++) {
-      if (ScanKey)
-        break;
-      for (x=0;x<GR_WIDTH-FONT_WIDTH<<1;x++) {
-        lohi=i*s;
-        c1=lohi/l;
-        if (bitmap[c1])
-          dc->color=ROP_XOR+BLUE^TRANSPARENT;
-        else
-          dc->color=ROP_XOR+WHITE^TRANSPARENT;
-        GrPlot(dc,x,y);
-        i++;
-      }
-    }
-    Free(bitmap);
-  } catch
-    DrvUnlock(dv);
-  GetChar;
-
-  SettingsPop;
-  DCFill;
-  DCDel(dc);
-}
-public U0 DrvView(U8 drv_let=0)
-{//Drive view. Graph the allocation map's fragmentation.
-  CDrv *dv=Let2Drv(drv_let),*old_dv=Fs->cur_dv;
-  Drv(drv_let);
-  switch (dv->fs_type) {
-    case FSt_REDSEA:
-      RedSeaDrvView(drv_let);
-      break;
-    case FSt_FAT32:
-      FAT32DrvView(drv_let);
-      break;
-    default:
-      PrintErr("File System Not Supported\n");
-  }
-  Drv(Drv2Let(old_dv));
-}
-
-public U0 DskView(U8 drv_let=0)
-{//Disk view. Pie chart of partition sizes.
-  I64 i,j,attr,
-        h=Fs->pix_width,
-        v=Fs->pix_height,
-        radius;
-  CDrv *dv;
-  CBlkDev *bd=Let2BlkDev(drv_let);
-  CDC *dc=DCAlias;
-  F64 sect_start,sect_end;
-
-  SettingsPush; //See SettingsPush
-  DocCursor;
-  DocClear;
-  DCFill;
-  if (h<v)
-    radius=0.4*h;
-  else
-    radius=0.4*v;
-  dc->color=BLACK;
-  GrCircle(dc,h>>1,v>>1,radius);
-
-  j=1;
-  for (i=0;i<DRVS_NUM;i++) {
-    dv=&blkdev.drvs[i];
-    if (bd==dv->bd && dv->fs_type) {
-      sect_start=-(dv->drv_offset*2*pi/(bd->max_blk+1));
-      sect_end  =-((dv->drv_offset+dv->size)*2*pi/(bd->max_blk+1));
-      dc->color=BLACK;
-      GrLine(dc,h>>1,v>>1,
-            h>>1+radius*Cos(sect_start),
-            v>>1+radius*Sin(sect_start));
-      GrLine(dc,h>>1,v>>1,
-            h>>1+radius*Cos(sect_end),
-            v>>1+radius*Sin(sect_end));
-
-      attr=DrvTextAttrGet(Drv2Let(dv));
-      dc->color=attr&15;
-      GrPrint(dc,0,v-FONT_HEIGHT*j,"%C %-8Z",Drv2Let(dv),
-            dv->fs_type,"ST_DRV_TYPES");
-      dc->color.c1=attr>>4;
-      dc->color|=ROPF_DITHER;
-      GrFloodFill(dc,
-            h>>1+(radius-4)*Cos((sect_start+sect_end)/2),
-            v>>1+(radius-4)*Sin((sect_start+sect_end)/2),FALSE);
-      j++;
-    }
-  }
-
-  GetChar(,FALSE);
-  SettingsPop;
-  DCFill;
-  DCDel(dc);
-}
-
-I64 RedSeaUnusedDrvSpace(U8 drv_let=0)
-{
-  CDrv *dv=Let2Drv(drv_let);
-  I64 res=0,i,l;
-  U8 *bitmap;
-  try {
-    l=dv->size+dv->drv_offset-dv->data_area;
-    i=((l+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
-    bitmap=MAlloc(i<<BLK_SIZE_BITS);
-    BlkRead(dv,bitmap,dv->fat1,i);
-    for (i=0;i<l;i++)
-      if (!Bt(bitmap,i))
-        res++;
-    Free(bitmap);
-  } catch
-    DrvUnlock(dv);
-  return res*BLK_SIZE*dv->spc;
-}
-I64 FAT32UnusedDrvSpace(U8 drv_let=0)
-{
-  CDrv *dv=Let2Drv(drv_let);
-  I64 res=0,i,l;
-  U32 *bitmap;
-  try {
-    l=(dv->size+dv->spc-1)/dv->spc-(2+dv->data_area-dv->drv_offset);
-    i=(l*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
-    bitmap=MAlloc(i<<BLK_SIZE_BITS);
-    BlkRead(dv,bitmap,dv->fat1,i);
-    for (i=0;i<l;i++)
-      if (!bitmap[i])
-        res++;
-    Free(bitmap);
-  } catch
-    DrvUnlock(dv);
-  return res*BLK_SIZE*dv->spc;
-}
-public I64 DrvUnused(U8 drv_let=0)
-{//Returns unused size in bytes.
-  CDrv *dv=Let2Drv(drv_let),*old_dv=Fs->cur_dv;
-  U8 *old_dir=StrNew(Fs->cur_dir);
-  I64 res=0;
-  Drv(drv_let);
-  switch (dv->fs_type) {
-    case FSt_REDSEA:
-      res=RedSeaUnusedDrvSpace(drv_let);
-      break;
-    case FSt_FAT32:
-      res=FAT32UnusedDrvSpace(drv_let);
-      break;
-    default:
-      PrintErr("File System Not Supported\n");
-  }
-  Drv(Drv2Let(old_dv));
-  Cd(old_dir);
-  Free(old_dir);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/DskPrt.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/DskPrt.HC.HTML deleted file mode 100755 index 18154e5..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/DskPrt.HC.HTML +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - -
-#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically)"
-
-#define ROUND_DRV_TO    (63*255)
-#define DRV_HEADER      63
-
-class CPlannedDrv
-{
-  CPlannedDrv *next,*last;
-  I64 size;
-  Bool pri;
-};
-
-public I64 DskPrt(U8 drv_let=0,...)
-{/*Partition the disk containing partition drv_let.
-
-drv_let=0 means add new drive that is not already mounted.
-
->DskPrt('C',0.5,0.25,0.25); //Make three.  50% C, 25% D, 25% E, round-up to blk.
-
-*/
-  CBlkDev *bd;
-  CPlannedDrv head,*tmppp;
-  CMasterBoot mbr;
-  Bool pri=TRUE;
-  I64 ext_base,drv_let2,pri_cnt=0,i,start_offset,offset,
-        total,remaining,cur_arg=0;
-  "This command does not play well\n"
-        "with other operating systems.\n"
-        "You really should use another\n"
-        "operating system's partitioner.\n"
-        "If you use this, it may, in fact,\n"
-        "make your hard drive impossible\n"
-        "to repartition with other operating\n"
-        "until you set block zero to zero\n"
-        "with $LK,\"BootMHDZero\",\"MN:BootMHDZero\"$()\n\n\n"
-        "Continue";
-  if (argc<=cur_arg && !YorN)
-    return 0;
-  '\n';
-
-  if (drv_let && !Let2BlkDev(drv_let,FALSE))
-    drv_let=0;
-  if (!drv_let && !(drv_let=Mount(TRUE)) ||
-        !(bd=Let2BlkDev(drv_let,FALSE)) || bd->type!=BDT_ATA)
-    return 0;
-
-  total=bd->max_blk+1;
-  QueInit(&head);
-  drv_let2=bd->first_drv_let;
-  remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
-  while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
-    tmppp=MAlloc(sizeof(CPlannedDrv));
-    do {
-      "$RED$Partition %C$FG$\n",drv_let2;
-      tmppp->pri=FALSE;
-      if (pri) {
-        "Primary Partition";
-        if (argc>cur_arg || YorN) {
-          pri_cnt++;
-          tmppp->pri=TRUE;
-          if (pri_cnt==3)
-            pri=FALSE;
-        } else
-          pri=FALSE;
-      }
-      "\nBlocks Remaining:%d (0x%X)\n",
-            remaining-DRV_HEADER,remaining-DRV_HEADER;
-      if (argc>cur_arg)
-        tmppp->size=MinI64(CeilU64(MaxI64(remaining,DRV_HEADER),ROUND_DRV_TO),
-              CeilU64(argv[cur_arg++](F64)*total,ROUND_DRV_TO));
-      else
-        tmppp->size=CeilU64(GetI64("Size in Blocks  :",
-              remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
-    } while (!(ROUND_DRV_TO<=tmppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
-    QueIns(tmppp,head.last);
-    remaining-=tmppp->size;
-    drv_let2++;
-  }
-
-  "\n\n!!! Repartition Drive !!!\n\n";
-  tmppp=head.next;
-  drv_let2=bd->first_drv_let;
-  while (tmppp!=&head) {
-    "Drive %C:%08X ",drv_let2,tmppp->size;
-    if (tmppp->pri)
-      "Primary\n";
-    else
-      "Logical\n";
-    tmppp=tmppp->next;
-    drv_let2++;
-  }
-  if (!argc && !AreYouSure)
-    goto pd_done;
-
-  remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
-  tmppp=head.next;
-  MemSet(&mbr,0,BLK_SIZE);
-  mbr.signature=0xAA55;
-  offset=0;
-  for (i=0;i<pri_cnt;i++) {
-    mbr.p[i].active=0x80;
-    mbr.p[i].start_head=0;
-    mbr.p[i].start_cyl=0x101;
-    mbr.p[i].type=1; //Will get set different.
-    mbr.p[i].end_head=0xFE;
-    mbr.p[i].end_cyl=0xFFFF;
-    mbr.p[i].offset=DRV_HEADER+offset;
-    mbr.p[i].size=tmppp->size-DRV_HEADER;
-    offset+=tmppp->size;
-    remaining-=tmppp->size;
-    tmppp=tmppp->next;
-  }
-  if (!i) i++;
-  if (tmppp!=&head) {
-    mbr.p[i].active=0x80;
-    mbr.p[i].start_head=0;
-    mbr.p[i].start_cyl=0x101;
-    mbr.p[i].type=0xF;
-    mbr.p[i].end_head=0xFE;
-    mbr.p[i].end_cyl=0xFFFF;
-    mbr.p[i].offset=offset;
-    mbr.p[i].size=remaining;
-    ext_base=offset;
-  }
-  ATAWriteBlks(bd,&mbr,0,1);
-
-  while (tmppp!=&head) {
-    start_offset=offset;
-    MemSet(&mbr,0,BLK_SIZE);
-    mbr.signature=0xAA55;
-
-    mbr.p[0].active=0x80;
-    mbr.p[0].start_head=1;
-    mbr.p[0].start_cyl=0x101;
-    mbr.p[0].type=1; //Will get set different.
-    mbr.p[0].end_head=0xFE;
-    mbr.p[0].end_cyl=0xFFFF;
-    mbr.p[0].offset=DRV_HEADER;
-    mbr.p[0].size=tmppp->size-DRV_HEADER;
-    offset+=tmppp->size;
-    tmppp=tmppp->next;
-    if (tmppp!=&head) {
-      mbr.p[1].active=0x80;
-      mbr.p[1].start_head=0;
-      mbr.p[1].start_cyl=0x101;
-      mbr.p[1].type=5;
-      mbr.p[1].end_head=0xFE;
-      mbr.p[1].end_cyl=0xFFFF;
-      mbr.p[1].offset=offset-ext_base;
-      mbr.p[1].size=tmppp->size;
-    }
-    ATAWriteBlks(bd,&mbr,start_offset,1);
-  }
-
-  bd->flags&=~(BDF_INITIALIZED | BDF_INIT_IN_PROGRESS);
-  BlkDevAdd(bd,,FALSE,TRUE);
-  for (i=bd->first_drv_let;i<drv_let2;i++)
-    Fmt(i,,FALSE);
-
-    pd_done:
-  while (head.next!=&head) {
-    tmppp=head.next;
-    QueRem(tmppp);
-    Free(tmppp);
-  }
-  return total;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/FileMgr.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/FileMgr.HC.HTML deleted file mode 100755 index e760778..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/FileMgr.HC.HTML +++ /dev/null @@ -1,822 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Output;StdOut/DolDoc"
-U0 DirFileDoc(CDoc *doc,CDirEntry *tmpde)
-{
-  while (tmpde) {
-    if (tmpde->attr & RS_ATTR_DIR) {
-      tmpde->user_data=DocPrint(doc,"$TR,\"%s\",U=0x%X$",tmpde->name,tmpde);
-      DocPrint(doc,"\n$ID,+2$");
-      if (tmpde->sub)
-        DirFileDoc(doc,tmpde->sub);
-      DocPrint(doc,"$ID,-2$");
-    } else {
-      tmpde->user_data=DocPrint(doc,"$MU,\"%s\",U=0x%X$",tmpde->name,tmpde);
-      DocPrint(doc,"\n");
-    }
-    tmpde=tmpde->next;
-  }
-}
-
-#help_index "File/Cmd Line (Typically);Cmd Line (Typically)"
-
-#define FM_NORMAL       0
-#define FM_PICK_FILE    1
-#define FM_PICK_DIR     2
-
-class CFMUncollapsedLst
-{
-  CFMUncollapsedLst *next;
-  U8 *name;
-};
-
-CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
-{
-  CDocEntry *doc_e=doc->head.next;
-  CFMUncollapsedLst *res=NULL,*tmpc;
-  CDirEntry *tmpde;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TREE) {
-      if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) {
-        if (tmpde=doc_e->user_data) {
-          tmpc=MAlloc(sizeof(CFMUncollapsedLst));
-          tmpc->next=res;
-          res=tmpc;
-          tmpc->name=StrNew(tmpde->full_name);
-        }
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  return res;
-}
-
-U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tmpc,
-        U8 *cur_entry,U8 *next_entry)
-{
-  CDocEntry *doc_e=doc->head.next;
-  CFMUncollapsedLst *tmpc1;
-  CDirEntry *tmpde;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TREE) {
-      tmpde=doc_e->user_data;
-      tmpc1=tmpc;
-      while (tmpc1) {
-        if (!StrCmp(tmpc1->name,tmpde->full_name)) {
-          doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED;
-          break;
-        }
-        tmpc1=tmpc1->next;
-      }
-      if (cur_entry) {
-        if (!StrNCmp(cur_entry,tmpde->full_name,StrLen(tmpde->full_name))) {
-          doc->cur_entry=doc_e;
-          if (StrLen(tmpde->full_name)==StrLen(cur_entry))
-            cur_entry=NULL;
-        } else if (next_entry) {
-          if (!StrNCmp(next_entry,
-                tmpde->full_name,StrLen(tmpde->full_name))) {
-            doc->cur_entry=doc_e;
-            if (StrLen(tmpde->full_name)==StrLen(next_entry))
-              cur_entry=NULL;
-          }
-        }
-      }
-    } else if (doc_e->type_u8==DOCT_MENU_VAL) {
-      tmpde=doc_e->user_data;
-      if (cur_entry) {
-        if (!StrNCmp(cur_entry,tmpde->full_name,StrLen(tmpde->full_name))) {
-          doc->cur_entry=doc_e;
-          if (StrLen(tmpde->full_name)==StrLen(cur_entry))
-            cur_entry=NULL;
-        } else if (next_entry) {
-          if (!StrNCmp(next_entry,
-                tmpde->full_name,StrLen(tmpde->full_name))) {
-            doc->cur_entry=doc_e;
-            if (StrLen(tmpde->full_name)==StrLen(next_entry))
-              cur_entry=NULL;
-          }
-        }
-      }
-    }
-    doc_e=doc_e->next;
-  }
-}
-
-U0 FMDelUncollapsedLst(CFMUncollapsedLst *tmpc)
-{
-  CFMUncollapsedLst *tmpc1;
-  while (tmpc) {
-    tmpc1=tmpc->next;
-    Free(tmpc->name);
-    Free(tmpc);
-    tmpc=tmpc1;
-  }
-}
-
-CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
-{
-  CDirEntry *tmpde,*tmpde1;
-  U8 *st;
-  tmpde=CAlloc(sizeof(CDirEntry));
-  tmpde->full_name=MStrPrint("%C:/",drv_let);
-  tmpde->attr=RS_ATTR_DIR;
-  st=MStrPrint("%c:/*",drv_let);
-  if (init)
-    tmpde->sub=tmpde1=FilesFind(st,FUF_RECURSE);
-  else
-    tmpde1=NULL;
-  Free(st);
-  tmpde->user_data=DocPrint(doc,"$TR,\"%s\",U=0x%X$",tmpde->full_name,tmpde);
-  tmpde->next=*_head;
-  *_head=tmpde;
-  DocPrint(doc,"\n$ID,+2$");
-  DocBottom(doc);
-  if (init) {
-    DirFileDoc(doc,tmpde1);
-    while (tmpde1) {
-      tmpde1->parent=tmpde;
-      tmpde1=tmpde1->next;
-    }
-  }
-  DocPrint(doc,"$ID,-2$");
-  return tmpde;
-}
-
-#define DEF2_PROCESSED          1
-#define DEF2_NOT_INITIALIZED    2
-
-U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
-{
-  CDrv *dv;
-  I64 i;
-  CDoc *doc=*_doc,*doc2=sys_clip_doc,*parent_doc;
-  CFMUncollapsedLst *tmpc=NULL;
-  U8 *cur_entry=NULL,*next_entry=NULL;
-  CDocEntry *doc_ce;
-  CDirEntry *tmpde,*tmpde1,*cur_tree_entry;
-  if (!doc)
-    parent_doc=DocPut;
-  else {
-    parent_doc=doc->parent_doc;
-    Fs->put_doc=Fs->display_doc=NULL;
-    DocUnlock(doc);
-    Refresh;
-    DocLock(doc);
-    cur_tree_entry=NULL;
-    doc_ce=doc->cur_entry;
-    if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-      cur_tree_entry=doc_ce->user_data;
-    if (cur_tree_entry)
-      cur_entry=StrNew(cur_tree_entry->full_name);
-    tmpde=NULL;
-    if (doc_ce!=doc)
-      doc_ce=doc_ce->next;
-    while (doc_ce!=doc) {
-      if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-        tmpde=doc_ce->user_data;
-      else
-        tmpde=NULL;
-      if (tmpde) {
-        tmpde1=tmpde->parent;
-        while (tmpde1) {
-          if (tmpde1==cur_tree_entry) {
-            tmpde=NULL;
-            break;
-          } else
-            tmpde1=tmpde1->parent;
-        }
-        if (tmpde)
-          break;
-      }
-      doc_ce=doc_ce->next;
-    }
-    if (tmpde)
-      next_entry=StrNew(tmpde->full_name);
-
-    tmpc=FMCollectUncollapsedLst(doc);
-    DocDel(doc);
-  }
-  if (*_head) {
-    DirTreeDel(*_head);
-    *_head=NULL;
-  }
-  doc=DocNew;
-  doc->desc='FileMan';
-  doc->parent_doc=parent_doc;
-  doc->flags|=DOCF_FORM;
-  switch (mode) {
-    case FM_NORMAL:
-      DocPrint(doc,"$PURPLE$File Manager\n\n"
-            "$LK,\"Click for Help\",A=\"FI:::/Doc/FileMgr.DD\"$\n\n");
-      break;
-    case FM_PICK_FILE:
-      DocPrint(doc,"$PURPLE$Pick file and press <ESC>\n\n");
-      doc->flags|=DOCF_SIZE_MIN;
-      break;
-    case FM_PICK_DIR:
-      DocPrint(doc,"$PURPLE$Pick directory and press <ESC>\n\n");
-      doc->flags|=DOCF_SIZE_MIN;
-      break;
-  }
-  DocPrint(doc,"$LTBLUE$");
-  for (i=0;i<DRVS_NUM;i++) {
-    dv=&blkdev.drvs[i];
-    if (dv->bd->type==BDT_ATAPI) {
-      if (dv->bd->flags&BDF_INITIALIZED)
-        tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
-      else {
-        tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
-        tmpde->user_data2|=DEF2_NOT_INITIALIZED;
-      }
-    } else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
-      FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
-  }
-  DocTop(doc);
-  FMMarkUncollapsed(doc,tmpc,cur_entry,next_entry);
-  DocCenter(doc);
-  DocRst(doc2,TRUE);
-  FMDelUncollapsedLst(tmpc);
-  Free(cur_entry);
-  Free(next_entry);
-  *_doc=doc;
-  DocLock(doc);
-  Fs->put_doc=Fs->display_doc=doc;
-}
-
-U0 FMRename(CDoc *doc)
-{
-  CEdFileName fn;
-  CDocEntry *doc_e=doc->cur_entry;
-  CDirEntry *tmpde=NULL,*parent;
-  if (doc_e->type_u8==DOCT_MENU_VAL) {
-    tmpde=doc_e->user_data;
-    if (parent=tmpde->parent) {
-      Cd(parent->full_name);
-      StrCpy(fn.name,tmpde->name);
-      if (DocForm(&fn)) {
-        Silent;
-        Move(tmpde->name,fn.name);
-        Silent(OFF);
-      }
-    }
-  } else if (doc_e->type_u8==DOCT_TREE) {
-    tmpde=doc_e->user_data;
-    if (parent=tmpde->parent) {
-      Cd(parent->full_name);
-      StrCpy(fn.name,tmpde->name);
-      if (DocForm(&fn)) {
-        if (StrCmp(tmpde->name,fn.name)) {
-          Silent;
-          if (CopyTree(tmpde->name,fn.name))
-            DelTree(tmpde->name);
-          Silent(OFF);
-        }
-      }
-    }
-  }
-}
-
-U0 FMMkDir(CDoc *doc)
-{
-  CEdFileName fn;
-  CDocEntry *doc_e=doc->cur_entry;
-  CDirEntry *tmpde=NULL,*parent;
-  *fn.name=0;
-  if (doc_e->type_u8==DOCT_MENU_VAL) {
-    tmpde=doc_e->user_data;
-    if (parent=tmpde->parent) {
-      Cd(parent->full_name);
-      if (DocForm(&fn)) {
-        Silent;
-        DirMk(fn.name);
-        Silent(OFF);
-      }
-    }
-  } else if (doc_e->type_u8==DOCT_TREE) {
-    tmpde=doc_e->user_data;
-    Cd(tmpde->full_name);
-    if (DocForm(&fn)) {
-      Silent;
-      DirMk(fn.name);
-      Silent(OFF);
-    }
-  }
-}
-
-U0 FMDelete(CDoc *doc)
-{
-  U8 *st;
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  if (doc_ce->type_u8==DOCT_MENU_VAL) {
-    tmpde=doc_ce->user_data;
-    Silent;
-    st=MStrPrint("Delete: %s",tmpde->full_name);
-    if (PopUpCancelOk(st))
-      Del(tmpde->full_name);
-    Free(st);
-    Silent(OFF);
-  } else if (doc_ce->type_u8==DOCT_TREE) {
-    tmpde=doc_ce->user_data;
-    Silent;
-    st=MStrPrint("Delete: %s",tmpde->full_name);
-    if (PopUpCancelOk(st))
-      DelTree(tmpde->full_name);
-    Free(st);
-    Silent(OFF);
-  }
-}
-
-U0 FMChgDsk(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde=doc_ce->user_data;
-  else
-    tmpde=NULL;
-  if (tmpde) {
-    while (tmpde->parent)
-      tmpde=tmpde->parent;
-    Silent;
-    DskChg(*tmpde->full_name);
-    Silent(OFF);
-  }
-}
-
-U0 FMMountISO(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  if (doc_ce->type_u8==DOCT_MENU_VAL && (tmpde=doc_ce->user_data))
-    MountFile(tmpde->full_name);
-}
-
-U0 FMUnmount(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  I64 drv_let;
-  if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde=doc_ce->user_data;
-  else
-    tmpde=NULL;
-  if (tmpde) {
-    while (tmpde->parent)
-      tmpde=tmpde->parent;
-    drv_let=*tmpde->full_name;
-    if (Let2BlkDev(drv_let)!=Let2BlkDev(':'))
-      Unmount(drv_let);
-  }
-}
-
-U0 FMFmtDrv(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  U8 *st=NULL;
-  if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde=doc_ce->user_data;
-  else
-    tmpde=NULL;
-  if (tmpde) {
-    while (tmpde->parent)
-      tmpde=tmpde->parent;
-    st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tmpde->full_name);
-    if (PopUpCancelOk(st)) {
-      Silent;
-      Fmt(*tmpde->full_name,,FALSE);
-      Silent(OFF);
-    }
-  }
-  Free(st);
-}
-
-U0 FMMakeISO(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde=doc_ce->user_data;
-  else
-    tmpde=NULL;
-  if (tmpde) {
-    if (doc_ce->type_u8==DOCT_MENU_VAL)
-      tmpde=tmpde->parent;
-    if (tmpde && *tmpde->full_name) {
-      Silent;
-      RedSeaISO(,tmpde->full_name);
-      Silent(OFF);
-    }
-  }
-}
-
-U0 FMBurnISO(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  CDirEntry *tmpde;
-  if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde=doc_ce->user_data;
-  else
-    tmpde=NULL;
-  if (tmpde) {
-    while (tmpde->parent)
-      tmpde=tmpde->parent;
-    Silent;
-    DVDImageWrite(*tmpde->full_name);
-    Silent(OFF);
-  }
-}
-
-U0 FMCopy(CDoc *doc)
-{
-  CDoc *doc2=sys_clip_doc;
-  U8 *st;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_e;
-  CDirEntry *tmpde,*tmpde1=NULL,*tmpde2;
-  Bool unlock_doc2=DocLock(doc2);
-  doc_e=doc2->head.next;
-
-  tmpde1=doc_ce->user_data;
-  if (doc_ce->type_u8==DOCT_MENU_VAL)
-    tmpde1=tmpde1->parent;
-  else if (doc_ce->type_u8!=DOCT_TREE)
-    tmpde1=NULL;
-  if (tmpde1) {
-    while (doc_e!=doc2) {
-      if (doc_e->type_u8==DOCT_MENU_VAL) {
-        tmpde=doc_e->user_data;
-        tmpde->user_data2|=DEF2_PROCESSED;
-        tmpde2=tmpde->parent;
-        if (!tmpde2 || !(tmpde2->user_data2&DEF2_PROCESSED)) {
-          Silent;
-          Copy(tmpde->full_name,tmpde1->full_name);
-          Silent(OFF);
-        }
-      } else if (doc_e->type_u8==DOCT_TREE) {
-        tmpde=doc_e->user_data;
-        tmpde->user_data2|=DEF2_PROCESSED;
-        tmpde2=tmpde->parent;
-        if (!tmpde2 || !(tmpde2->user_data2&DEF2_PROCESSED)) {
-          Silent;
-          if (*tmpde1->name)
-            st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
-          else
-            st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
-          CopyTree(tmpde->full_name,st);
-          Free(st);
-          Silent(OFF);
-        }
-      }
-      doc_e=doc_e->next;
-    }
-  }
-  if (unlock_doc2)
-    DocUnlock(doc2);
-}
-
-#define FMR_INCLUDE             0
-#define FMR_ADAM_INCLUDE        1
-#define FMR_DELETE              2
-#define FMR_RENAME              3
-#define FMR_MKDIR               4
-#define FMR_PLAIN               5
-#define FMR_PASTE               6
-#define FMR_CHG_DSK             7
-#define FMR_FORMAT              8
-#define FMR_MOUNT_REDSEA_ISO_C  9
-#define FMR_UNMOUNT             10
-#define FMR_MAKE_REDSEA_ISO_C   11
-#define FMR_BURN_ISO            12
-#define FMR_HELP                13
-
-I64 PopUpFMRight(U8 *header=NULL,U8 *footer=NULL)
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header) DocPrint(doc,"%s",header);
-  DocPrint(doc,"$CM+LX,1,1 $$BT,\"INCLUDE                 \",LE=FMR_INCLUDE$"
-        "$CM+LX,29,0$$BT,\"ADAM INCLUDE            \",LE=FMR_ADAM_INCLUDE$"
-        "$CM+LX,1,3 $$BT,\"DELETE                  \",LE=FMR_DELETE$"
-        "$CM+LX,29,0$$BT,\"RENAME                  \",LE=FMR_RENAME$"
-        "$CM+LX,1,3 $$BT,\"MAKE DIRECTORY          \",LE=FMR_MKDIR$"
-        "$CM+LX,29,0$$BT,\"PLAIN-TEXT EDIT         \",LE=FMR_PLAIN$"
-        "$CM+LX,1,3 $$BT,\"PASTE CLIP FILES        \",LE=FMR_PASTE$"
-        "$CM+LX,29,0$$BT,\"CHANGE DISK(MOUNT IT)   \",LE=FMR_CHG_DSK$"
-        "$CM+LX,1,3 $$BT,\"FORMAT                  \",LE=FMR_FORMAT$"
-        "$CM+LX,1,3 $$BT,\"MOUNT ISO.C FILE        \","
-        "LE=FMR_MOUNT_REDSEA_ISO_C$"
-        "$CM+LX,29,0$$BT,\"UNMOUNT                 \",LE=FMR_UNMOUNT$"
-        "$CM+LX,1,3 $$BT,\"MAKE ISO.C (CD/DVD) FILE\",LE=FMR_MAKE_REDSEA_ISO_C$"
-        "$CM+LX,29,0$$BT,\"BURN ISO (CD/DVD) FILE  \",LE=FMR_BURN_ISO$"
-        "$CM+LX,1,3 $$BT,\"HELP                    \",LE=FMR_HELP$"
-        "$CM+LX,29,0$$BT,\"CANCEL                  \",LE=DOCM_CANCEL$\n");
-  if (footer) DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-U0 FMRightClick()
-{
-  switch (PopUpFMRight) {
-    case FMR_INCLUDE:
-      Msg(MSG_KEY_DOWN,0,0x3F0000003F);
-      break;
-    case FMR_ADAM_INCLUDE:
-      Msg(MSG_KEY_DOWN,0,0x23F0000023F);
-      break;
-    case FMR_DELETE:
-      Msg(MSG_KEY_DOWN,CH_CTRLY,0);
-      break;
-    case FMR_RENAME:
-      Msg(MSG_KEY_DOWN,'r',0);
-      break;
-    case FMR_MKDIR:
-      Msg(MSG_KEY_DOWN,'d',0);
-      break;
-    case FMR_PLAIN:
-      Msg(MSG_KEY_DOWN,CH_SHIFT_SPACE,0);
-      break;
-    case FMR_PASTE:
-      Msg(MSG_KEY_DOWN,0,SC_INS+SCF_SHIFT);
-      break;
-    case FMR_CHG_DSK:
-      Msg(MSG_KEY_DOWN,'c',0);
-      break;
-    case FMR_FORMAT:
-      Msg(MSG_KEY_DOWN,'f',0);
-      break;
-    case FMR_MOUNT_REDSEA_ISO_C:
-      Msg(MSG_KEY_DOWN,'i',0);
-      break;
-    case FMR_UNMOUNT:
-      Msg(MSG_KEY_DOWN,'u',0);
-      break;
-    case FMR_MAKE_REDSEA_ISO_C:
-      Msg(MSG_KEY_DOWN,'m',0);
-      break;
-    case FMR_BURN_ISO:
-      Msg(MSG_KEY_DOWN,'B',0);
-      break;
-    case FMR_HELP:
-      Msg(MSG_KEY_DOWN,CH_CTRLM,0x43200000432);
-      break;
-  }
-}
-
-U8 *fm_ms_str=NULL;
-U0 (*fp_old_final_scrn_update)(CDC *dc);
-
-U0 FMFinalScrnUpdate(CDC *dc)
-{
-  if (fm_ms_str) {
-    dc->color=LTRED;
-    GrPrint(dc,ms.pos.x,ms.pos.y,"%s",fm_ms_str);
-  }
-  (*fp_old_final_scrn_update)(dc);
-}
-
-public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
-{//File manager. Also, used to choose files and dirs.
-  CDirEntry *head=NULL,*tmpde,*tmpde1,*tmpde2;
-  I64 sc,ch,arg1,arg2,msg_code;
-  CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
-  U8 *res=NULL,*st,*st2,*old_cur_dir=DirCur;
-  CDocEntry *doc_ce=NULL,*doc_e;
-  Bool okay;
-
-  SettingsPush; //See SettingsPush
-  fp_old_final_scrn_update=gr.fp_final_scrn_update;
-  MenuFilePush("::/Doc/FileMgrPullDown.DD");
-  FMRebuildDoc(&doc,&head,mode);
-  if (tmpde1=Cd2DirEntry(head,old_cur_dir))
-    doc->cur_entry=tmpde1->user_data;
-  while (tmpde1) {
-    if (tmpde1->attr&RS_ATTR_DIR)
-      tmpde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED;
-    tmpde1=tmpde1->parent;
-  }
-  do {
-    DocUnlock(doc);
-    do msg_code=GetMsg(&arg1,&arg2,
-            1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_UP);
-    while (Fs!=sys_focus_task);
-    DocLock(doc);
-    switch (msg_code) {
-      case MSG_MS_R_UP:
-        DocUnlock(doc);
-        FMRightClick;
-        DocLock(doc);
-        break;
-      case MSG_MS_L_DOWN:
-        doc_ce=doc->cur_entry;
-        fm_ms_str=doc_ce->tag;
-        gr.fp_final_scrn_update=&FMFinalScrnUpdate;
-        break;
-      case MSG_MS_L_UP:
-        if (doc_ce) {
-          gr.fp_final_scrn_update=fp_old_final_scrn_update;
-          if (WinCursorPosSet(Fs,arg1+Fs->pix_left+Fs->scroll_x,
-                arg2+Fs->pix_top+Fs->scroll_y,TRUE)) {
-            doc_e=doc->cur_entry;
-            if (doc_e!=doc_ce) {
-              st2=NULL;
-              if (doc_e->type_u8==DOCT_MENU_VAL) {
-                tmpde1=doc_e->user_data;
-                if (tmpde1=tmpde1->parent)
-                  st2=StrNew(tmpde1->full_name);
-              } else if (doc_e->type_u8==DOCT_TREE) {
-                tmpde1=doc_e->user_data;
-                st2=StrNew(tmpde1->full_name);
-              }
-              if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) {
-                tmpde=doc_ce->user_data;
-                Silent;
-                Move(tmpde->full_name,st2);
-                Silent(OFF);
-                FMRebuildDoc(&doc,&head,mode);
-              } else if (st2 && doc_ce->type_u8==DOCT_TREE) {
-                tmpde=doc_ce->user_data;
-                okay=TRUE;
-                tmpde2=tmpde1;
-                while (tmpde2) {
-                  if (tmpde2!=tmpde)
-                    tmpde2=tmpde2->parent;
-                  else {
-                    okay=FALSE;
-                    break;
-                  }
-                }
-                if (okay) {
-                  if (*tmpde1->name)
-                    st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
-                  else
-                    st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
-                  if (StrCmp(tmpde->full_name,st)) {
-                    Silent;
-                    CopyTree(tmpde->full_name,st);
-                    DelTree(tmpde->full_name);
-                    Silent(OFF);
-                    FMRebuildDoc(&doc,&head,mode);
-                  }
-                  Free(st);
-                }
-              }
-              Free(st2);
-              FlushMsgs;
-            } else
-              if (doc_e->type_u8==DOCT_MENU_VAL) {
-                DocUnlock(doc);
-                Ed(doc_e->user_data(CDirEntry *)->full_name);
-                DocLock(doc);
-              }
-            doc_ce=NULL;
-          }
-        }
-        break;
-      case MSG_KEY_DOWN:
-        doc_ce=NULL;
-        ch=arg1; sc=arg2;
-        if (sc.u8[0]==SC_DELETE && !(sc&(SCF_SHIFT|SCF_CTRL)))
-          ch=CH_CTRLY;
-        if (ch && sc&SCF_ALT) goto fm_regular_key;
-        switch (ch) {
-          case '\n':
-            DocUnlock(doc);
-            FMRightClick;
-            DocLock(doc);
-            break;
-          start:
-            DocUnlock(doc);
-            case CH_CTRLV:
-              FMCopy(doc);
-              break;
-            case 'r':
-              FMRename(doc);
-              break;
-            case 'd':
-              FMMkDir(doc);
-              break;
-            case CH_CTRLY:
-              FMDelete(doc);
-              break;
-            case 'c':
-              FMChgDsk(doc);
-              break;
-            case 'i':
-              FMMountISO(doc);
-              break;
-            case 'u':
-              FMUnmount(doc);
-              break;
-            case 'm':
-              FMMakeISO(doc);
-              break;
-            case 'B':
-              FMBurnISO(doc);
-              break;
-            case 'f':
-              FMFmtDrv(doc);
-              break;
-          end:
-            FMRebuildDoc(&doc,&head,mode);
-            break;
-          case CH_SHIFT_ESC:
-            break;
-          case CH_SPACE:
-            if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
-              DocUnlock(doc);
-              Ed(doc->cur_entry->user_data(CDirEntry *)->full_name);
-              DocLock(doc);
-            } else
-              goto fm_regular_key;
-            break;
-          case CH_SHIFT_SPACE:
-            if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
-              DocUnlock(doc);
-              Plain(doc->cur_entry->user_data(CDirEntry *)->full_name);
-              DocLock(doc);
-            } else
-              goto fm_regular_key;
-            break;
-          case CH_ESC:
-            doc_ce=doc->cur_entry;
-            tmpde=doc_ce->user_data;
-            if (mode==FM_PICK_FILE && doc_ce->type_u8==DOCT_MENU_VAL)
-              res=StrNew(tmpde->full_name,mem_task);
-            else if (mode==FM_PICK_DIR) {
-              if (doc_ce->type_u8==DOCT_TREE)
-                res=StrNew(tmpde->full_name,mem_task);
-              else if (doc_ce->type_u8==DOCT_MENU_VAL &&
-                    (tmpde=tmpde->parent))
-                res=StrNew(tmpde->full_name,mem_task);
-            }
-            break;
-          default:
-            if (sc.u8[0]==SC_INS && sc&SCF_SHIFT && !(sc&SCF_CTRL)) {
-              FMCopy(doc);
-              FMRebuildDoc(&doc,&head,mode);
-            } else if (sc.u8[0]==SC_F5) {
-              if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
-                tmpde=doc->cur_entry->user_data;
-                DocUnlock(doc);
-                if (sc&SCF_SHIFT)
-                  AdamFile(tmpde->full_name);
-                else
-                  PopUpFile(tmpde->full_name);
-                DocLock(doc);
-              }
-            } else {
-fm_regular_key:
-              DocUnlock(doc);
-              PutKey(ch,sc);
-              DocLock(doc);
-            }
-        }
-        break;
-    }
-  } while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
-  gr.fp_final_scrn_update=fp_old_final_scrn_update;
-  Fs->put_doc    =old_put_doc;
-  Fs->display_doc=old_display_doc;
-  SettingsPop;
-  DocDel(doc);
-  DirTreeDel(head);
-  Cd(old_cur_dir);
-  Free(old_cur_dir);
-  if (mode!=FM_NORMAL && !res)
-    res=StrNew("",mem_task);
-  MenuPop;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/MakeABlkDev.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/MakeABlkDev.HC.HTML deleted file mode 100755 index 399fdde..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/MakeABlkDev.HC.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-#include "ADskA"
-#include "ADskB"
-#include "DskPrt"
-#include "Mount"
-#include "DskChk"
-#include "FileMgr"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/ABlkDev/Mount.HC.HTML b/public/Wb/Home/Src/Adam/ABlkDev/Mount.HC.HTML deleted file mode 100755 index 34d6cb2..0000000 --- a/public/Wb/Home/Src/Adam/ABlkDev/Mount.HC.HTML +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - -
-#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
-U8 Mount2(U8 boot_drv_let,CDoc *_doc,Bool _caller_is_prtdsk)
-{//If _doc, called by ::/Kernel/KCfg.HC else called by Mount().
-  I64 cnt,total=0,num_hints,drv_let,type,unit,prt_num;
-  U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN],
-        *filename=NULL,*filename2=NULL,res=0;
-  CATARep *head=NULL,*tmpha;
-  Bool whole_drv,make_free;
-  CDoc *doc;
-  if (boot_drv_let)
-    boot_drv_let=Let2Let(boot_drv_let);
-  do {
-    cnt=0;
-    if (!_doc)
-      DrvRep;
-    "\n****** Mount Drives ******\n"
-          "$GREEN$A$FG$-$GREEN$B$FG$ are RAM drives.\n"
-          "$GREEN$C$FG$-$GREEN$L$FG$ are ATA hard drives.\n"
-          "$GREEN$M$FG$-$GREEN$P$FG$ are ISO file read drives.\n"
-          "$GREEN$Q$FG$-$GREEN$S$FG$ are ISO file write drives.\n"
-          "$GREEN$T$FG$-$GREEN$Z$FG$ are ATAPI CD/DVD drives.\n"
-          "\nDrive Letter ($PURPLE$<ENTER>$FG$ to exit):";
-    drv_let=Let2Let(GetChar);
-    '\n';
-    if (type=Let2BlkDevType(drv_let)) {
-      whole_drv=FALSE;
-      if (_doc) { //Called by ::/Kernel/KCfg.HC
-        doc=_doc;
-        make_free=FALSE;
-      } else { //Called by Mount()
-        doc=DocNew;
-        DocPrint(doc,"CBlkDev *bd;\n");
-        make_free=TRUE;
-      }
-      unit=0;
-      prt_num=I64_MIN;
-      switch (type) {
-        case BDT_RAM:
-          "Addr of RAM disk ($PURPLE$<ENTER>$FG$ to MAlloc):";
-          GetS(addr_buf,STR_LEN);
-        case BDT_ISO_FILE_WRITE:
-          "Blks of 512 bytes:";
-          GetS(blks_buf,STR_LEN);
-          break;
-        case BDT_ISO_FILE_READ:
-          filename=GetStr("File Name:");
-          break;
-        case BDT_ATA:
-          prt_num=GetI64("Partition Num (Default=All):",prt_num);
-        case BDT_ATAPI:
-          num_hints=ATARep(,,&head);
-          if (type==BDT_ATAPI && boot_drv_let)
-            "<ENTER> to use booted CD/DVD\n"; //Only ::/Kernel/KCfg.HC
-          do {
-            if (num_hints)
-              "Enter dev number or\nport with $PURPLE$0x$FG$ prefix.\n"
-                    "I/O Port Base0:\n";
-            else
-              "Include $PURPLE$0x$FG$ prefix.\nI/O Port Base0:\n";
-            GetS(base0_buf,STR_LEN);
-          } while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
-          if (1<=Str2I64(base0_buf)<=num_hints) {
-            tmpha=ATARepFind(head,Str2I64(base0_buf));
-            StrPrint(base0_buf,"0x%X",tmpha->base0);
-            StrPrint(base1_buf,"0x%X",tmpha->base1);
-            unit=tmpha->unit;
-          } else if (type!=BDT_ATAPI || *base0_buf) {
-            if (type==BDT_ATAPI)
-              StrCpy(base1_buf,"0");
-            else
-              do {
-                "I/O Port Base1:\n";
-                GetS(base1_buf,STR_LEN);
-              } while (!Str2I64(base1_buf));
-            do {
-              "\t$PURPLE$0$FG$=Master\n\t$PURPLE$1$FG$=Slave\nUnit:";
-              unit=GetChar-'0';
-            } while (!(0<=unit<=1));
-            '\n';
-          }
-          LinkedLstDel(head);
-          break;
-      }
-      DocPrint(doc,"bd=BlkDevNextFreeSlot(\'%C\',%d);bd->unit=%d;\n",
-            drv_let,type,unit);
-      switch (type) {
-        case BDT_RAM:
-          if (!*addr_buf) StrCpy(addr_buf,"0");
-          DocPrint(doc,"bd->RAM_dsk=%s;\n",addr_buf);
-        case BDT_ISO_FILE_WRITE:
-          if (!*blks_buf) StrCpy(blks_buf,"0");
-          DocPrint(doc,"bd->max_blk=(%s)-1;\n",blks_buf);
-          DocPrint(doc,"bd->drv_offset=19<<2+"
-                "(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n");
-          break;
-        case BDT_ISO_FILE_READ:
-          filename2=FileNameAbs(filename);
-          DocPrint(doc,"bd->file_dsk_name=AStrNew(\"%s\");\n",filename2);
-          DocPrint(doc,"bd->drv_offset=19<<2+"
-                "(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n");
-          break;
-        case BDT_ATA:
-        case BDT_ATAPI:
-          if (type==BDT_ATAPI && !*base0_buf) {
-            DocPrint(doc,"GetBaseUnit(bd);\n"); //Only ::/Kernel/KCfg.HC
-            if (drv_let==boot_drv_let)
-              make_free=TRUE;
-          } else
-            DocPrint(doc,"bd->base0=%s;bd->base1=%s;\n",base0_buf,base1_buf);
-          if (type==BDT_ATA && _caller_is_prtdsk) {
-            "\nReformat WHOLE drive!";
-            whole_drv=YorN;
-          }
-          break;
-      }
-      DocPrint(doc,"BlkDevAdd(bd,%d,%d,%d);\n",prt_num,whole_drv,make_free);
-      if (_doc) //Called by ::/Kernel/KCfg.HC
-        cnt++;
-      else { //Called by Mount()
-        if ((cnt=ExeDoc(doc)) && whole_drv) {
-          if (_caller_is_prtdsk) {
-            res=drv_let;
-            DskPrt(drv_let,1.0); //First mount whole drive.
-          } else
-            DskPrt(drv_let);
-        }
-        DocDel(doc);
-      }
-    }
-    total+=cnt;
-  } while (cnt && !_caller_is_prtdsk ||
-        !total && _doc); //At least 1 if Called by ::/Kernel/KCfg.HC
-  Free(filename);
-  Free(filename2);
-  return res;
-}
-
-public U8 Mount(Bool caller_is_prtdsk=FALSE)
-{//Mount drives. Called from DskPrt(Mount).
-  return Mount2(0,NULL,caller_is_prtdsk);
-}
-
-public U0 Unmount(U8 drv_let=0)
-{//Unmount drive(s).
-  BlkDevDel(Let2BlkDev(drv_let));
-}
-
-public U8 MountFile(U8 *filename)
-{//Mount ISO.C file.
-  U8 *filename2=ExtDft(filename,"ISO.C"),*filename3=FileNameAbs(filename2);
-  CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('M')); //First BDT_ISO_FILE_READ
-  CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_READ);
-  bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
-  bd->file_dsk_name=AStrNew(filename3);
-  BlkDevAdd(bd,,TRUE,TRUE);
-  Free(filename3);
-  Free(filename2);
-  return dv->drv_let;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ADbg.HC.HTML b/public/Wb/Home/Src/Adam/ADbg.HC.HTML deleted file mode 100755 index e388230..0000000 --- a/public/Wb/Home/Src/Adam/ADbg.HC.HTML +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - - -
-#help_index "Debugging/Dump"
-Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
-        I64 depth,I64 max_depth,Bool dynamic,I64 types=HTT_CLASS,I64 offset=0)
-{//See ::/Demo/LastClass.HC.
-  I64 i,j,stars,*ptr;
-  CMemberLst *ml;
-  CDocEntry *doc_e;
-  Bool unlock;
-  CHashClass *tmpc,*tmpc2;
-  if (depth>=max_depth) return TRUE;
-  if (!(tmpc=HashFind(class_name,Fs->hash_table,types))) {
-    DocPrint(doc,"Class Not Found.\n");
-    return FALSE;
-  }
-  if (!ChkPtr(_d) || !ChkPtr(_d(U8 *)+tmpc->size)) {
-    DocPrint(doc,"Bad Ptr:%016X\n",_d);
-    return FALSE;
-  }
-  if (tmpc->base_class && !ClassRep2(doc,_d,tmpc->base_class->str,
-        depth,max_depth,dynamic,types,offset))
-    return FALSE;
-  unlock=DocLock(doc);
-  DocPrint(doc,"Class:\"%s\"\n",class_name);
-  ml=tmpc->member_lst_and_root;
-  while (ml) {
-    tmpc2=ml->member_class;
-    ptr=_d(U8 *)+ml->offset;
-    DocPrint(doc,"%08X ",ptr(U8 *)+offset);
-    stars=tmpc2->ptr_stars_cnt;
-    tmpc2=OptClassFwd(tmpc2);
-    tmpc2-=tmpc2->ptr_stars_cnt;
-    if (tmpc2->type & HTT_INTERNAL_TYPE) {
-      DocPrint(doc,"$GREEN$%-20ts:$FG$",ml->str);
-      if (stars==1 && (tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8)) {
-        ptr=*ptr;
-        if (ChkPtr(ptr)) {
-          if (dynamic) {
-            doc_e=DocPrint(doc,"$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$\n");
-            doc_e->data=ptr;
-            DocDataFmt(doc,doc_e);
-          } else
-            DocPrint(doc,"%40ts\n",ptr);
-        }
-      } else if (!stars) {
-        j=MinI64(ml->dim.total_cnt,32);
-        if (tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8) {
-          if (j==1) {
-            if (dynamic) {
-              doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$\n");
-              doc_e->data=ptr;
-            } else
-              DocPrint(doc,"%c\n",*ptr(U8 *));
-          } else {
-            if (dynamic) {
-              doc_e=DocPrint(doc,"$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$\n");
-              doc_e->data=ptr;
-              DocDataFmt(doc,doc_e);
-            } else
-              DocPrint(doc,"%40ts\n",ptr);
-          }
-        }
-        for (i=0;i<j;i++) {
-          switch (tmpc2->raw_type) {
-            case RT_I0:
-            case RT_U0:
-              break;
-            case RT_I8:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$ ");
-                doc_e->data=ptr(I8 *)++;
-              } else
-                DocPrint(doc,"%02X ",*ptr(I8 *)++);
-              break;
-            case RT_U8:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$ ");
-                doc_e->data=ptr(U8 *)++;
-              } else
-                DocPrint(doc,"%02X ",*ptr(U8 *)++);
-              break;
-            case RT_I16:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$ ");
-                doc_e->data=ptr(I16 *)++;
-              } else
-                DocPrint(doc,"%04X ",*ptr(I16 *)++);
-              break;
-            case RT_U16:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$ ");
-                doc_e->data=ptr(U16 *)++;
-              } else
-                DocPrint(doc,"%04X ",*ptr(U16 *)++);
-              break;
-            case RT_I32:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$ ");
-                doc_e->data=ptr(I32 *)++;
-              } else
-                DocPrint(doc,"%08X ",*ptr(I32 *)++);
-              break;
-            case RT_U32:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$ ");
-                doc_e->data=ptr(U32 *)++;
-              } else
-                DocPrint(doc,"%08X ",*ptr(U32 *)++);
-              break;
-            case RT_U64:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$ ");
-                doc_e->data=ptr(U64 *)++;
-              } else
-                DocPrint(doc,"%08X ",*ptr(U64 *)++);
-              break;
-            case RT_F64:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$ ");
-                doc_e->data=ptr(F64 *)++;
-              } else
-                DocPrint(doc,"%16g ",*ptr(I64 *)++);
-              break;
-            default:
-              if (dynamic) {
-                doc_e=DocPrint(doc,"$DA-TRM+RD+UD,A=\"%%016X\"$ ");
-                doc_e->data=ptr(I64 *)++;
-              } else
-                DocPrint(doc,"%016X ",*ptr(I64 *)++);
-          }
-          if (dynamic)
-            DocDataFmt(doc,doc_e);
-        }
-        if (j<ml->dim.total_cnt)
-          DocPrint(doc,"...");
-      } else
-        DocPrint(doc,"%016X",*ptr);
-      DocPrint(doc,"\n");
-    } else {
-      if (depth<2) {
-        if (stars==1 && !ChkPtr(*ptr))
-          DocPrint(doc,"%-20ts:%016X\n",ml->str,*ptr);
-        else {
-          DocPrint(doc,"$TR,\"%s\"$\n",ml->str);
-          DocPrint(doc,"$ID,2$");
-          if (!stars)
-            ClassRep2(doc,ptr,tmpc2->str,depth+1,max_depth,dynamic);
-          else if (stars==1)
-            ClassRep2(doc,*ptr,tmpc2->str,depth+1,max_depth,dynamic);
-          DocPrint(doc,"$ID,-2$");
-        }
-      } else
-        DocPrint(doc,"%-20ts\n",ml->str);
-    }
-    ml=ml->next;
-  }
-  if (unlock)
-    DocUnlock(doc);
-  return TRUE;
-}
-
-public U0 ClassRep(U8 *_d,U8 *class_name=lastclass,
-        I64 max_depth=2,Bool fun=FALSE,I64 offset=0)
-{//Displays members of a record by using the compiler's info.
-  CDoc *doc;
-  if (IsRaw)
-    doc=DocNew;
-  else {
-    DocMax;
-    doc=DocPut;
-  }
-  if (fun)
-    ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_FUN,offset);
-  else
-    ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_CLASS,offset);
-  DocPrint(doc,"\n");
-  DocRecalc(doc);
-  if (IsRaw) {
-    DocDump(doc,100000);
-    DocDel(doc);
-  }
-}
-
-public U0 ClassRepD(U8 *_d,U8 *class_name=lastclass,
-        I64 max_depth=2,Bool fun=FALSE,I64 offset=0)
-{//Dynamic ClassRep. Uses hex_ed widgit for live changes.
-  CDoc *doc;
-  if (IsRaw)
-    doc=DocNew;
-  else {
-    DocMax;
-    doc=DocPut;
-  }
-  if (fun)
-    ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_FUN,offset);
-  else
-    ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_CLASS,offset);
-  DocPrint(doc,"\n");
-  DocRecalc(doc);
-  if (IsRaw) {
-    DocDump(doc,100000);
-    DocDel(doc);
-  }
-}
-
-U0 UpdateRegVarImg(CHashFun *tmpf,U8 *_b,CTask *task)
-{
-  CMemberLst *ml;
-  CHashClass *tmpc;
-  ml=tmpf->member_lst_and_root;
-  while (ml) {
-    if (ml->reg!=REG_NONE) {
-      tmpc=OptClassFwd(ml->member_class);
-      MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tmpc->size);
-    }
-    ml=ml->next;
-  }
-}
-
-public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL)
-{//Shows names and vals of a fun's local vars using compiler's info.
-  I64 size;
-  U8 *img;
-  CHashFun *tmpf=HashFind(st,Fs->hash_table,HTT_FUN);
-  CMemberLst *tmpm;
-  if (tmpf) {
-    if (rbp) {
-      if (task) {
-//tmpf->size is negative.  It's the bottom
-        //of the fun local var space relative to RBP .
-        size=tmpf->arg_cnt*8-tmpf->size+16;
-
-        img=MAlloc(size);
-        MemCpy(img,rbp+tmpf->size,size);
-        UpdateRegVarImg(tmpf,img-tmpf->size,task);
-        ClassRep(img-tmpf->size,st,max_depth,TRUE,rbp-img+tmpf->size);
-        Free(img);
-      } else
-        ClassRep(rbp,st,max_depth,TRUE);
-    } else {
-      tmpm=tmpf->member_lst_and_root;
-      while (tmpm) {
-        if (0<=tmpm->reg<REG_REGS_NUM)
-          "%08Z %s\n",tmpm->reg,"ST_U64_REGS",tmpm->str;
-        else
-          "%08tX %s\n",tmpm->offset,tmpm->str;
-        tmpm=tmpm->next;
-      }
-      "%08tX Stk Size\n",tmpf->size;
-    }
-  }
-}
-
-#help_index "Debugging/Unassemble"
-public U0 Uf(U8 *st)
-{//Unassembles a named fun
-  I64 i;
-  CHashSrcSym *tmpf;
-  CDbgInfo *dbg_info;
-  if (tmpf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
-    if (tmpf->type&HTT_FUN)
-      FunRep(st);
-    if (dbg_info=tmpf->dbg_info) {
-      i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
-            -dbg_info->body[0];
-      Un(dbg_info->body[0],i);
-      "Code Size:%04X\n",i;
-    } else
-      U(HashVal(tmpf));
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ADefine.HC.HTML b/public/Wb/Home/Src/Adam/ADefine.HC.HTML deleted file mode 100755 index c108a05..0000000 --- a/public/Wb/Home/Src/Adam/ADefine.HC.HTML +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - -
-#help_index "Define;Char/Define"
-
-U0 LoadDocDefines()
-{
-  CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
-
-  DefinePrint("DD_OS_NAME_VERSION","TempleOS V%0.2f",sys_os_version);
-  DefinePrint("DD_TEMPLEOS_AGE","%0.1f",
-        (Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS);
-
-  DefinePrint("DD_KERNEL","%08X",bfh);
-  bfh(I64)+=bfh->file_size-1;
-  DefinePrint("DD_KERNEL_END","%08X",bfh);
-
-  //DD_BOOT_HIGH_LOC_DVD
-
-+] LineRep
-
-  DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
-  DefinePrint("DD_MP_VECT_END","%08X",
-        MP_VECT_ADDR+COREAP_16BIT_INIT_END-COREAP_16BIT_INIT-1);
-
-  DefinePrint("DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA);
-  DefinePrint("DD_SYS_FIXED_AREA_END","%08X",
-        SYS_FIXED_AREA+sizeof(CSysFixedArea)-1);
-  DefinePrint("DD_MEM_HEAP_BASE","%08X",mem_heap_base);
-  DefinePrint("DD_MEM_HEAP_LIMIT","%08X",mem_heap_limit);
-  DefinePrint("DD_MEM_MIN_MEG","%dMeg",MEM_MIN_MEG);
-  DefinePrint("DD_UNCACHED_ALIAS","%010X",dev.uncached_alias);
-  DefinePrint("DD_PHYSICAL_SPACE_END","%010X",
-        mem_physical_space-1);
-  DefinePrint("DD_MAPPED_SPACE_END","%010X",
-        mem_mapped_space-1);
-  DefinePrint("DD_JIFFY_HZ","%dHz",JIFFY_FREQ);
-}
-
-LoadDocDefines;
-
- diff --git a/public/Wb/Home/Src/Adam/AExts.HC.HTML b/public/Wb/Home/Src/Adam/AExts.HC.HTML deleted file mode 100755 index 9e0cbab..0000000 --- a/public/Wb/Home/Src/Adam/AExts.HC.HTML +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - -
-extern U0 ACDDef(I64 n,CTask *parent=NULL);
-extern U0 ACDDefsPut(CDoc *doc=NULL,U8 *st,I64 num=-1);
-extern U0 ACDFillin(I64 n);
-extern U0 ACFillIn(I64 n);
-extern U0 ACMan(I64 n,CTask *parent_task=NULL);
-extern I64 AdamFile(U8 *filename,Bool warn_ext=TRUE);
-extern Bool AutoComplete(Bool val=OFF);
-extern U0 ClipDel();
-extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
-extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
-extern U8 *DC2Sprite(CDC *tmpb);
-extern U0 DocBinDel(CDoc *doc,CDocBin *b);
-extern U0 DocBinsValidate(CDoc *doc);
-extern U0 DocBottom(CDoc *doc=NULL);
-extern U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL);
-extern U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE);
-extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL);
-extern U0 DocD(U8 *buf,I64 cnt=0x80);
-extern U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL);
-extern U0 DocDel(CDoc *doc);
-extern CDoc *DocDisplay(CTask *task=NULL);
-extern U0 DocDump(CDoc *doc,I64 uS_delay=0);
-extern CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e);
-extern U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e);
-extern Bool DocForm(U8 *_d,U8 *class_name=lastclass,
-        I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL);
-extern U0 DocHelpIdx(CDoc *doc,U8 *idx);
-extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL);
-extern U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2);
-extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
-extern Bool DocLock(CDoc *doc);
-extern I64 DocMax(I64 i=I64_MAX);
-extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
-extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...);
-extern CDoc *DocPut(CTask *task=NULL);
-extern CDoc *DocRead(U8 *name=NULL,I64 flags=0);
-extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL);
-extern U0 DocRst(CDoc *doc,Bool is_old);
-extern CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL);
-extern U0 DocTop(CDoc *doc=NULL);
-extern Bool DocUnlock(CDoc *doc);
-extern U0 DocUpdateTaskDocs(CTask *task);
-extern U0 DrawCtrls(CTask *task);
-extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
-extern U0 EdCodeTools(CDoc *doc);
-extern U8 *EdSprite(I64 bin_num);
-extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0);
-extern I64 FindWiz();
-extern I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=I64_MIN,I64 hi=I64_MAX);
-extern Bool GrPlot0(CDC *dc,I64 x,I64 y);
-extern CMenuEntry *MenuEntryFind(CMenu *haystack_menu,U8 *needle_full_name);
-extern CMenu *MenuFilePush(U8 *filename);
-extern U0 MenuPop();
-extern CMenu *MenuPush(U8 *st);
-extern U8 Mount(Bool caller_is_prtdsk=FALSE);
-extern CTask *Noise(I64 mS,F64 min_ona,F64 max_ona);
-extern Bool Plain(U8 *filename,I64 edf_dof_flags=0);
-extern Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL);
-extern I64 PopUpColor(U8 *header=NULL,
-        Bool allow_transparent=TRUE,Bool allow_dft=TRUE);
-extern I64 PopUpColorDither(U8 *header=NULL);
-extern I64 PopUpColorLighting(U8 *header=NULL);
-extern I64 PopUpFile(U8 *filename,
-        Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL);
-extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
-        I64 dof_flags=DOF_SIZE_MIN,U8 *header=NULL,U8 *footer=NULL);
-extern I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=I64_MIN,I64 hi=I64_MAX);
-extern U8 *PopUpGetStr(U8 *header=NULL);
-extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0);
-extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL);
-extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL);
-extern I64 PopUpRangeI64(
-        I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
-extern Bool PopUpTransform(I64 *r);
-extern I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
-        U8 *_stage2_filename=NULL);
-extern U0 Refresh(I64 cnt=1,Bool force=FALSE);
-extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg);
-extern Bool RegWrite(U8 *path,U8 *fmt,...);
-extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
-extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0);
-extern U0 TemplateCtrlSlider(CDoc *doc);
-extern Bool View();
-extern U0 ViewAnglesDel(CTask *task=NULL);
-extern CCtrl *ViewAnglesNew(CTask *task=NULL);
-extern Bool WinBorder(Bool val=OFF,CTask *task=NULL);
-extern CDoc *WinCursorPosSet(CTask *task,I64 msx,I64 msy,Bool set_cursor=TRUE);
-extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
-extern U0 WinMax(CTask *task=NULL);
-extern U0 WinScrollNull(CTask *task,CD3I64 *s);
-extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
-extern U0 WinScrollsInit(CTask *task);
-extern I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE);
-extern Bool WinVert(I64 top,I64 bottom,CTask *task=NULL);
-extern CWinMgrGlbls winmgr;
-
- diff --git a/public/Wb/Home/Src/Adam/AHash.HC.HTML b/public/Wb/Home/Src/Adam/AHash.HC.HTML deleted file mode 100755 index 9d437d2..0000000 --- a/public/Wb/Home/Src/Adam/AHash.HC.HTML +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - - - - - - -
-#help_index "Info;Hash/System;Cmd Line (Typically)"
-class CWho
-{
-  CHashGeneric *h;
-  U8 *idx;
-};
-
-I64 HashEntriesCompare(CWho *h1,CWho *h2)
-{
-  I64 i1,i2;
-  if (i1=StrCmp(h1->h->str,h2->h->str))
-    return i1;
-  i1=HashTypeNum(h1->h);
-  i2=HashTypeNum(h2->h);
-  return i1-i2;
-}
-
-I64 HashEntriesCompare2(CWho *h1,CWho *h2)
-{
-  CHashFun *tmpf1=h1->h,*tmpf2=h2->h;
-  I64 i1=HashVal(tmpf1),i2=HashVal(tmpf2);
-  if (i1==i2) {
-    i1=HashTypeNum(tmpf1);
-    i2=HashTypeNum(tmpf2);
-    if (i1==i2)
-      return StrCmp(tmpf1->str,tmpf2->str);
-  }
-  return i1-i2;
-}
-
-I64 HelpIndexCnt(U8 *ptr,U8 *idx)
-{
-  I64 cnt=0,ch,idx_len=StrLen(idx);
-  while (*ptr) {
-    if (!StrNCmp(ptr,idx,idx_len))
-      cnt++;
-    while (ch=*ptr++)
-      if (ch==';')
-        break;
-    if (!ch)
-      ptr--;
-  }
-  return cnt;
-}
-
-U8 *HelpIndexStr(U8 **_ptr,U8 *idx)
-{
-  U8 *ptr=*_ptr,*ptr2,*res;
-  I64 ch,idx_len=StrLen(idx);
-  while (*ptr) {
-    ptr2=ptr;
-    while (ch=*ptr++)
-      if (ch==';')
-        break;
-    if (!ch)
-      ptr--;
-    *_ptr=ptr;
-    if (!StrNCmp(ptr2,idx,idx_len)) {
-      if (ch==';')
-        ptr--;
-      *ptr=0;
-      res=StrNew(ptr2);
-      *ptr=ch;
-      return res;
-    }
-  }
-  return NULL;
-}
-
-U8 *HelpComment(CTask *task,CHash *tmph,U8 *_src_link)
-{
-  CDoc *doc;
-  CDocEntry *doc_e;
-  U8 *res=NULL,*ptr,*ptr2,*src_link=StrNew(_src_link);
-
-  if (*src_link=='F' && src_link[2]==':')
-    *src_link='P';
-  XTalkWait(task,"Ed(0x%X,DOF_DONT_WINMGR_SYNC|DOF_DONT_SHOW);\n",src_link);
-  Free(src_link);
-
-  doc=DocPut(task);
-  doc_e=doc->cur_entry;
-  if (tmph->type&HTT_FUN) {
-    if (Bt(&tmph(CHashFun *)->flags,Ff__EXTERN) ||
-          Bt(&tmph(CHashFun *)->flags,Ff_INTERNAL))
-      while (doc_e!=doc &&
-            (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';')))
-        doc_e=doc_e->next;
-    else
-      while (doc_e!=doc &&
-            (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,'{')))
-        doc_e=doc_e->next;
-  }
-  if (doc_e!=doc) {
-    if (doc_e->de_flags&DOCEF_TAG) {
-      ptr=doc_e->tag;
-      if (ptr2=StrMatch("//",ptr))
-        ptr=ptr2+2;
-      else if (ptr2=StrMatch("/*",ptr))
-        ptr=ptr2+2;
-      else if (!StrNCmp(ptr,"public",6))
-        ptr+=6;
-      while (*ptr==CH_SPACE)
-        ptr++;
-      res=StrNew(ptr);
-      doc_e=doc_e->next;
-    }
-    while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) {
-      if (doc_e->type_u8==DOCT_TAB) {
-        ptr=MStrPrint("%s ",res);
-        Free(res);
-        res=ptr;
-      } else if (doc_e->de_flags&DOCEF_TAG) {
-        ptr=MStrPrint("%s%s",res,doc_e->tag);
-        Free(res);
-        res=ptr;
-      }
-      doc_e=doc_e->next;
-    }
-  }
-  XTalkWait(task,"%c",CH_SHIFT_ESC);
-  if (res) {
-    ptr=MStrUtil(res,SUF_REM_TRAILING|SUF_REM_LEADING|SUF_SINGLE_SPACE);
-    Free(res);
-    res=ptr;
-  }
-  return res;
-}
-
-I64 HashEntriesCompare3(CWho *h1,CWho *h2)
-{
-  I64 i,i1=0,i2=0;
-  i=StrCmp(h1->idx,h2->idx);
-  if (i)
-    return i;
-  else {
-    if (h1->h->type&HTT_HELP_FILE)
-      i1=1;
-    if (h2->h->type&HTT_HELP_FILE)
-      i2=1;
-    i=i2-i1;
-    if (i)
-      return i;
-    else
-      return StrCmp(h1->h->str,h2->h->str);
-  }
-}
-
-public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
-U8 *idx=NULL,CDoc *doc=NULL)
-{//Dump hash symbol table.
-// "+p" for only public symbols
-  // "+m" to order by number (normally alphabetical)
-  // "-r" just local hash table
-  CHashTable *table;
-  CHashSrcSym *tmph;
-  CHashGeneric *ptr;
-  CWho *lst;
-  I64 cnt,i,j,k,f=0;
-  U8 buf[512],*last_idx=StrNew(""),*cur_idx,*comment;
-  Bool recurse,publics,map;
-  CTask *task;
-
-  ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r");
-  ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (f&~(FUF_RECURSE|FUF_PUBLIC|FUF_MAP))
-    throw('FUF');
-  recurse=Bt(&f,FUf_RECURSE);
-  publics=Bt(&f,FUf_PUBLIC);
-  map    =Bt(&f,FUf_MAP);
-
-  if (!h) h=Fs->hash_table;
-
-  if (idx) {
-    task=User;
-    TaskWait(task);
-    LBtr(&task->display_flags,DISPLAYf_SHOW);
-  } else
-    task=NULL;
-
-  cnt=0;
-  table=h;
-  while (table) {
-    for (i=0;i<=table->mask;i++) {
-      tmph=table->body[i];
-      while (tmph) {
-        if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
-              (tmph->type & HTF_PUBLIC || !publics)) {
-          if (!idx)
-            cnt++;
-          else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx))
-            cnt+=HelpIndexCnt(cur_idx,idx);
-        }
-        tmph=tmph->next;
-      }
-    }
-    if (recurse)
-      table=table->next;
-    else
-      break;
-  }
-  if (!cnt) goto wh_done;
-
-  lst=CAlloc(cnt*sizeof(CWho));
-  j=0;
-  table=h;
-  while (table) {
-    for (i=0;i<=table->mask;i++) {
-      tmph=table->body[i];
-      while (tmph) {
-        if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
-              (tmph->type & HTF_PUBLIC || !publics))
-          if (!idx)
-            lst[j++].h=tmph;
-          else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx) &&
-                (k=HelpIndexCnt(cur_idx,idx)))
-            while (k--) {
-              lst[j].idx=HelpIndexStr(&cur_idx,idx);
-              lst[j++].h=tmph;
-            }
-        tmph=tmph->next;
-      }
-    }
-    if (recurse)
-      table=table->next;
-    else
-      break;
-  }
-
-  if (map)
-    QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare2);
-  else if (idx)
-    QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare3);
-  else
-    QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare);
-
-  if (idx) {
-    progress1_max=cnt;
-    progress1=0;
-  }
-  for (i=0;i<cnt;i++) {
-    comment=NULL;
-    ptr=lst[i].h;
-    if (idx)
-      if (cur_idx=lst[i].idx) {
-        if (StrCmp(cur_idx,last_idx)) {
-          Free(last_idx);
-          last_idx=StrNew(cur_idx);
-          if (i)
-            DocPrint(doc,"\n\n");
-          DocPrint(doc,"$WW,0$$PURPLE$$TX+CX,\"%$Q\"$$FG$\n",cur_idx);
-        }
-      }
-
-    if (idx && ptr->type & HTT_HELP_FILE) {
-      DocPrint(doc,"$WW,1$");
-      DocType(doc,ptr->str);
-      DocPrint(doc,"$WW,0$");
-    } else {
-      if (ptr->type&HTG_SRC_SYM && ptr(CHashSrcSym *)->src_link) {
-        DocPrint(doc,"$LK,\"%-20s\",A=\"%s\"$",
-              ptr->str,ptr(CHashSrcSym *)->src_link);
-        if (idx)
-          comment=HelpComment(task,ptr,ptr(CHashSrcSym *)->src_link);
-      } else
-        DocPrint(doc,"%-20s",ptr->str);
-
-      if (!idx) {
-        if (ptr->type & HTT_DEFINE_STR) {
-          j=ptr(CHashDefineStr *)->cnt;
-          if (j==-1)
-            StrPrint(buf,"%-10t$Q   ",ptr(CHashDefineStr *)->data);
-          else
-            StrPrint(buf,"%-10t$Q %02X",ptr(CHashDefineStr *)->data,j);
-        } else if (ptr->type & HTT_GLBL_VAR)
-          StrPrint(buf,"%010X   ",ptr(CHashGlblVar *)->data_addr);
-        else
-          StrPrint(buf,"%010X   ",HashVal(ptr));
-        j=HashEntrySize(ptr);
-        if (j==-1)
-          CatPrint(buf," %04X            ",ptr->use_cnt);
-        else
-          CatPrint(buf," %04X %010X ",ptr->use_cnt,j);
-      } else
-        *buf=0;
-
-      k=ptr->type;
-      if (publics)
-        k&=~HTF_PUBLIC;
-      if (!(k&HTG_TYPE_MASK))
-        CatPrint(buf,"NULL ");
-      while (k) {
-        j=Bsf(k);
-        if (j<0)
-          break;
-        Btr(&k,j);
-        CatPrint(buf,"%Z ",j,"ST_HTT_TYPES");
-      }
-      DocPrint(doc,"%s",buf);
-      if (comment) {
-        DocPrint(doc,"$GREEN$%s$FG$",comment);
-        Free(comment);
-      }
-      DocPrint(doc,"\n");
-    }
-    Free(lst[i].idx);
-    if (idx)
-      progress1++;
-  }
-  Free(lst);
-  if (idx)
-    progress1=progress1_max=0;
-
-wh_done:
-  if (doc) {
-    if (doc->head.next==doc)
-      DocPrint(doc,"No Match");
-    else
-      DocRecalc(doc);
-  }
-  Free(last_idx);
-  Kill(task);
-}
-
-#help_index "Info;Hash;Cmd Line (Typically)"
-
-#define HDR_NUM 16
-public I64 HashDepthRep(CHashTable *table=NULL)
-{//Hash table linked-list chain depth report.
-//Histogram of collision count.
-  I64 i,j,longest=0,cnt=0,a[HDR_NUM];
-  CHash *tmph;
-  if (!table) table=Fs->hash_table;
-  MemSet(a,0,sizeof(a));
-  for (i=0;i<=table->mask;i++) {
-    tmph=table->body[i];
-    if (tmph) {
-      j=LinkedLstCnt(tmph);
-      if (j<HDR_NUM)
-        a[j]++;
-      cnt+=j;
-      if (j>longest)
-        longest=j;
-    }
-  }
-  "Histogram\n";
-  for (i=0;i<HDR_NUM;i++)
-    if (a[i])
-      "%02d:%d\n",i,a[i];
-  "Size:%d Count:%d Longest:%d\n",
-        table->mask+1,cnt,longest;
-  return longest;
-}
-
-#help_index "Help System"
-#help_file "::/Doc/HelpSystem"
-
-public U0 DocHelpIdx(CDoc *doc,U8 *idx)
-{//Put to doc report for given help idx.
-  Who("+p",,idx,doc);
-}
-
-public U0 PopUpHelpIndex(U8 *idx,CTask *parent=NULL)
-{//PopUp win report for given help idx.
-  U8 *buf;
-  buf=MStrPrint("DocHelpIdx(DocPut,\"%s\");View;",idx);
-  PopUp(buf,parent);
-  Free(buf);
-}
-
-#help_index "Hash/System"
-public U0 MapFileLoad(U8 *filename)
-{//Load map file so we have src line info.
-  U8 *st,*ptr,*name=ExtDft(filename,"MAP.Z"),
-        *absname=FileNameAbs(name);
-  CDoc *doc=DocRead(name);
-  CDocEntry *doc_e;
-  CHashSrcSym *tmph;
-  I64 i,j,base=0;
-  CDbgInfo *dbg_info;
-
-  FileExtRem(absname);
-  if (absname[1]==':' && StrLen(absname)>2 &&
-        (tmph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
-    base=tmph(CHashGeneric *)->user_data0+sizeof(CBinFile);
-
-  if (!doc) return;
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_LINK) {
-      if (*doc_e->tag)
-        st=MStrUtil(doc_e->tag,SUF_REM_TRAILING);
-      else
-        st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING);
-      if (tmph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) {
-        if (*doc_e->tag) {
-          Free(tmph->src_link);
-          tmph->src_link=doc_e->aux_str;
-          ptr=tmph->src_link;
-          if (ptr[0] && ptr[1] && ptr[2]==':') {
-            if (ptr[3]==':')
-              ptr[3]=blkdev.boot_drv_let;
-            else if (ptr[3]=='~')
-              ptr[3]=*blkdev.home_dir;
-          }
-          doc_e->aux_str=NULL;
-        }
-        if (tmph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
-              !(dbg_info=tmph->dbg_info) && doc_e->bin_data &&
-              (dbg_info=doc_e->bin_data->data)) {
-          if (doc_e->bin_data->size>MSize(dbg_info))
-            "Corrupt Map Entry\n";
-          else {
-            doc_e->bin_data->data=NULL;
-            tmph->dbg_info=dbg_info;
-            for (i=dbg_info->min_line;i<=dbg_info->max_line+1;i++) {
-              j=i-dbg_info->min_line;
-              if (dbg_info->body[j])
-                dbg_info->body[j]=dbg_info->body[j]+base;
-            }
-          }
-        }
-      }
-      Free(st);
-    }
-    doc_e=doc_e->next;
-  }
-  DocDel(doc);
-  Free(name);
-  Free(absname);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AMath.HC.HTML b/public/Wb/Home/Src/Adam/AMath.HC.HTML deleted file mode 100755 index 6ed99c7..0000000 --- a/public/Wb/Home/Src/Adam/AMath.HC.HTML +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - -
-#help_index "Math"
-public U0 R2P(F64 *_mag=NULL,F64 *_arg=NULL,F64 x,F64 y)
-{//Rect to polar
-//Returns angle in range (-pi,pi]
-  if (_arg)
-    *_arg=Arg(x,y);
-  if (_mag)
-    *_mag=Sqrt(x*x+y*y);
-}
-
-public U0 P2R(F64 *_x=NULL,F64 *_y=NULL,F64 mag,F64 arg)
-{//Polar to Rect
-  if (_x)
-    *_x=mag*Cos(arg);
-  if (_y)
-    *_y=mag*Sin(arg);
-}
-
-public F64 Wrap(F64 theta,F64 base=-pi)
-{//Returns angle in range [base,base+2*pi)
-  F64 res=theta%(2*pi);
-  if (res>=base+2*pi)
-    res-=2*pi;
-  else if (res<base)
-    res+=2*pi;
-  return res;
-}
-
-public I64 DistSqrI64(I64 x1,I64 y1,I64 x2,I64 y2)
-{//Distance-squared between 2 points.
-  I64 dx=x1-x2,dy=y1-y2;
-  return dx*dx+dy*dy;
-}
-
-public F64 ASin(F64 s)
-{//Arc Sin (Inverse Sin).
-  F64 c;
-  c=s*s;
-  if (c>=1.0)
-    return pi/2.0;
-  c=Sqrt(1.0-c);
-  return ATan(s/c);
-}
-
-public F64 ACos(F64 c)
-{//Arc Cos (Inverse Cos).
-  F64 s;
-  if (!c)
-    return pi/2.0;
-  s=c*c;
-  if (s>=1.0)
-    return 0.0;
-  s=Sqrt(1.0-s);
-  return ATan(s/c);
-}
-
-public F64 Sinh(F64 x)
-{//Hyperbolic Sine.
-  return 0.5*(Exp(x)-Exp(-x));
-}
-
-public F64 Cosh(F64 x)
-{//Hyperbolic Cosine.
-  return 0.5*(Exp(x)+Exp(-x));
-}
-
-#help_index "Math/Complex;Data Types/Complex"
-public Complex *CAdd(Complex *sum,Complex *n1,Complex *n2)
-{//sum=n1+n2
-  sum->x=n1->x+n2->x;
-  sum->y=n1->y+n2->y;
-  return sum;
-}
-
-public Complex *CSub(Complex *diff,Complex *n1,Complex *n2)
-{//diff=n1-n2
-  diff->x=n1->x-n2->x;
-  diff->y=n1->y-n2->y;
-  return diff;
-}
-
-public Complex *CMul(Complex *prod,Complex *n1,Complex *n2)
-{//prod=n1*n2
-  prod->x=n1->x*n2->x-n1->y*n2->y;
-  prod->y=n1->x*n2->y+n1->y*n2->x;
-  return prod;
-}
-
-public Complex *CDiv(Complex *quot,Complex *n1,Complex *n2)
-{//quot=n1/n2
-  F64 m1,arg1,m2,arg2;
-  R2P(&m1,&arg1,n1->x,n1->y);
-  R2P(&m2,&arg2,n2->x,n2->y);
-  m1/=m2;
-  arg1-=arg2;
-  quot->x=m1*Cos(arg1);
-  quot->y=m1*Sin(arg1);
-  return quot;
-}
-
-public Complex *CScale(Complex *dst,F64 s)
-{//dst*=s
-  dst->x*=s;
-  dst->y*=s;
-  return dst;
-}
-
-public Complex *CCopy(Complex *dst,Complex *src)
-{//dst=src
-  dst->x=src->x;
-  dst->y=src->y;
-  return dst;
-}
-
-public Complex *CEqu(Complex *dst,F64 x,F64 y)
-{//dst=(x,y)
-  dst->x=x;
-  dst->y=y;
-  return dst;
-}
-
-public Complex *CPoly(Complex *dst,I64 n,Complex *zeros,Complex *x)
-{//Eval complex polynomial
-  I64 i;
-  Complex n1,n2;
-  if (n>0) {
-    CSub(dst,x,&zeros[0]);
-    for (i=1;i<n;i++) {
-      CCopy(&n1,dst);
-      CMul(dst,&n1,CSub(&n2,x,&zeros[i]));
-    }
-  } else
-    CEqu(dst,1.0,0.0);
-  return dst;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AMathODE.HC.HTML b/public/Wb/Home/Src/Adam/AMathODE.HC.HTML deleted file mode 100755 index 5832989..0000000 --- a/public/Wb/Home/Src/Adam/AMathODE.HC.HTML +++ /dev/null @@ -1,719 +0,0 @@ - - - - - - - - - - - -
-#help_index "Math/ODE"
-#help_file "::/Doc/ODE"
-
-//See ::/Doc/Credits.DD.
-
-F64 LowPass1(F64 a,F64 y0,F64 y,F64 dt=1.0)
-{//First order low pass filter
-  dt=Exp(-a*dt);
-  return y0*dt+y*(1.0-dt);
-}
-
-U0 ODERstPtrs(CMathODE *ode)
-{
-  I64 s=ode->n_internal*sizeof(F64);
-  F64 *ptr=ode->array_base;
-  ode->state_internal=ptr;      ptr(I64)+=s;
-  ode->state_scale=ptr;         ptr(I64)+=s;
-  ode->DstateDt=ptr;            ptr(I64)+=s;
-  ode->initial_state=ptr;       ptr(I64)+=s;
-  ode->tmp0=ptr;        ptr(I64)+=s;
-  ode->tmp1=ptr;        ptr(I64)+=s;
-  ode->tmp2=ptr;        ptr(I64)+=s;
-  ode->tmp3=ptr;        ptr(I64)+=s;
-  ode->tmp4=ptr;        ptr(I64)+=s;
-  ode->tmp5=ptr;        ptr(I64)+=s;
-  ode->tmp6=ptr;        ptr(I64)+=s;
-  ode->tmp7=ptr;
-}
-
-public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
-{//Make differential equation ctrl struct. See flags.
-  //The tolerance is not precise.
-  //You can min_tolerance and it will
-  //dynamically adjust tolerance to utilize
-  //the CPU.
-  I64 s=n*sizeof(F64);
-  CMathODE *ode=CAlloc(sizeof(CMathODE));
-  ode->t_scale=1.0;
-  ode->flags=flags;
-  ode->n_internal=ode->n=n;
-  ode->h=1e-6;
-  ode->h_min=1e-64;
-  ode->h_max=1e32;
-  ode->max_tolerance=ode->min_tolerance=ode->tolerance_internal=max_tolerance;
-  ode->win_task=ode->mem_task=Fs;
-  QueInit(&ode->next_mass);
-  QueInit(&ode->next_spring);
-  ode->state=CAlloc(s);
-  ode->array_base=MAlloc(12*s);
-  ODERstPtrs(ode);
-  return ode;
-}
-
-
-public Bool ODEPause(CMathODE *ode,Bool val=ON)
-{//Pause ODE.
-  Bool res;
-  if (!ode) return OFF;
-  res=LBEqu(&ode->flags,ODEf_PAUSED,val);
-  if (val)
-    while (Bt(&ode->flags,ODEf_BUSY))
-      Yield;
-  return res;
-}
-
-public U0 ODEDel(CMathODE *ode)
-{//Free ODE node, but not masses or springs.
-  I64 i;
-  if (!ode) return;
-  ODEPause(ode);
-  Free(ode->state);
-  Free(ode->array_base);
-  if (ode->slave_tasks) {
-    for (i=0;i<mp_cnt;i++)
-      Kill(ode->slave_tasks[i]);
-    Free(ode->slave_tasks);
-  }
-  Free(ode);
-}
-
-public I64 ODESize(CMathODE *ode)
-{//Mem size of ode ctrl, but not masses and springs.
-  if (!ode)
-    return 0;
-  else
-    return MSize2(ode->state)+MSize2(ode->array_base)+MSize2(ode);
-}
-
-U0 ODESetMassesPtrs(CMathODE *ode,F64 *state,F64 *DstateDt)
-{
-  COrder2D3 *ptr1=state(F64 *)+ode->n,
-        *ptr2=DstateDt(F64 *)+ode->n;
-  CMass *tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    tmpm->state=ptr1++;
-    tmpm->DstateDt=ptr2++;
-    tmpm=tmpm->next;
-  }
-}
-
-U0 ODEState2Internal(CMathODE *ode)
-{
-  CMass *tmpm;
-  F64 *old_array_base;
-  I64 mass_cnt;
-
-  if (ode->flags&ODEF_HAS_MASSES) {
-    mass_cnt=0;
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      mass_cnt++;
-      tmpm=tmpm->next;
-    }
-    old_array_base=ode->array_base;
-    ode->n_internal=ode->n+6*mass_cnt;
-    ode->array_base=MAlloc(12*ode->n_internal*sizeof(F64),ode->mem_task);
-    Free(old_array_base);
-    ODERstPtrs(ode);
-
-    ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      MemCpy(tmpm->state,&tmpm->saved_state,sizeof(COrder2D3));
-      tmpm=tmpm->next;
-    }
-  }
-  MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64));
-}
-
-U0 ODEInternal2State(CMathODE *ode)
-{
-  CMass *tmpm;
-  MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64));
-  if (ode->flags&ODEF_HAS_MASSES) {
-    ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      MemCpy(&tmpm->saved_state,tmpm->state,sizeof(COrder2D3));
-      tmpm=tmpm->next;
-    }
-  }
-}
-
-public U0 ODERenum(CMathODE *ode)
-{//Renumber masses and springs.
-  I64 i;
-  CSpring *tmps;
-  CMass *tmpm;
-
-  i=0;
-  tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    tmpm->num=i++;
-    tmpm=tmpm->next;
-  }
-
-  i=0;
-  tmps=ode->next_spring;
-  while (tmps!=&ode->next_spring) {
-    tmps->num=i++;
-    tmps->end1_num=tmps->end1->num;
-    tmps->end2_num=tmps->end2->num;
-    tmps=tmps->next;
-  }
-}
-
-public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
-{//Search for mass nearest to x,y,z.
-  CMass *tmpm,*best_mass=NULL;
-  F64 dd,best_dd=F64_MAX;
-
-  tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
-    if (dd<best_dd) {
-      best_dd=dd;
-      best_mass=tmpm;
-    }
-    tmpm=tmpm->next;
-  }
-  return best_mass;
-}
-
-public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
-{//Find spring midpoint nearest x,y,z.
-  CSpring *tmps,*best_spring=NULL;
-  F64 dd,best_dd=F64_MAX;
-
-  tmps=ode->next_spring;
-  while (tmps!=&ode->next_spring) {
-    dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
-          Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
-          Sqr((tmps->end1->z+tmps->end2->z)/2-z);
-    if (dd<best_dd) {
-      best_dd=dd;
-      best_spring=tmps;
-    }
-    tmps=tmps->next;
-  }
-  return best_spring;
-}
-
-public U0 MassOrSpringFind(
-        CMathODE *ode,CMass **res_mass,CSpring **res_spring,
-        F64 x,F64 y,F64 z=0)
-{//Find spring or mass nearest x,y,z.
-  CMass   *tmpm,*best_mass=NULL;
-  CSpring *tmps,*best_spring=NULL;
-  F64 dd,best_dd=F64_MAX;
-
-  tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
-    if (dd<best_dd) {
-      best_dd=dd;
-      best_mass=tmpm;
-    }
-    tmpm=tmpm->next;
-  }
-
-  tmps=ode->next_spring;
-  while (tmps!=&ode->next_spring) {
-    dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
-          Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
-          Sqr((tmps->end1->z+tmps->end2->z)/2-z);
-    if (dd<best_dd) {
-      best_dd=dd;
-      best_spring=tmps;
-      best_mass=NULL;
-    }
-    tmps=tmps->next;
-  }
-  if (res_mass)   *res_mass  =best_mass;
-  if (res_spring) *res_spring=best_spring;
-}
-
-public CMass *MassFindNum(CMathODE *ode,I64 num)
-{//Return mass number N.
-  CMass *tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    if (tmpm->num==num)
-      return tmpm;
-    tmpm=tmpm->next;
-  }
-  return NULL;
-}
-
-public U0 ODERstInactive(CMathODE *ode)
-{//Set all masses and springs to ACTIVE for new trial.
-  CMass *tmpm;
-  CSpring *tmps;
-  tmpm=ode->next_mass;
-  while (tmpm!=&ode->next_mass) {
-    tmpm->flags&=~MSF_INACTIVE;
-    tmpm=tmpm->next;
-  }
-  tmps=ode->next_spring;
-  while (tmps!=&ode->next_spring) {
-    tmps->flags&=~SSF_INACTIVE;
-    tmps=tmps->next;
-  }
-}
-
-U0 ODECalcSprings(CMathODE *ode)
-{
-  CSpring *tmps=ode->next_spring;
-  CMass *e1,*e2;
-  F64 d;
-  CD3 p;
-  while (tmps!=&ode->next_spring) {
-    if (tmps->flags&SSF_INACTIVE) {
-      tmps->displacement=0;
-      tmps->f=0;
-    } else {
-      e1=tmps->end1;
-      e2=tmps->end2;
-      d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x));
-      tmps->displacement=d-tmps->rest_len;
-      tmps->f=tmps->displacement*tmps->const;
-      if (tmps->f>0 && tmps->flags&SSF_NO_TENSION)
-        tmps->f=0;
-      else if (tmps->f<0 && tmps->flags&SSF_NO_COMPRESSION)
-        tmps->f=0;
-      if (d>0) {
-        D3MulEqu(&p,tmps->f/d);
-        D3AddEqu(&e1->DstateDt->DxDt,&p);
-        D3SubEqu(&e2->DstateDt->DxDt,&p);
-      }
-    }
-    tmps=tmps->next;
-  }
-}
-
-U0 ODECalcDrag(CMathODE *ode)
-{
-  CMass *tmpm;
-  F64 d,dd;
-  CD3 p;
-  if (ode->drag_v || ode->drag_v2 || ode->drag_v3) {
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      if (!(tmpm->flags & MSF_INACTIVE) &&
-            tmpm->drag_profile_factor &&
-            (dd=D3NormSqr(&tmpm->state->DxDt))) {
-        d=ode->drag_v;
-        if (ode->drag_v2)
-          d+=ode->drag_v2*Sqrt(dd);
-        if (ode->drag_v3)
-          d+=dd*ode->drag_v3;
-        D3SubEqu(&tmpm->DstateDt->DxDt,
-              D3Mul(&p,d*tmpm->drag_profile_factor,&tmpm->state->DxDt));
-      }
-      tmpm=tmpm->next;
-    }
-  }
-}
-
-U0 ODEApplyAccelerationLimit(CMathODE *ode)
-{
-  CMass *tmpm;
-  F64 d;
-  if (ode->acceleration_limit) {
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      if (!(tmpm->flags & MSF_INACTIVE) &&
-            (d=D3Norm(&tmpm->DstateDt->DxDt))>ode->acceleration_limit)
-        D3MulEqu(&tmpm->DstateDt->DxDt,ode->acceleration_limit/d);
-      tmpm=tmpm->next;
-    }
-  }
-}
-
-U0 ODEMPTask(CMathODE *ode)
-{
-  while (TRUE) {
-    while (!Bt(&ode->mp_not_done_flags,Gs->num))
-      Yield;
-    if (ode->mp_derive)
-      (*ode->mp_derive)(ode,ode->mp_t,
-            Gs->num,ode->mp_state,ode->mp_DstateDt);
-    LBtr(&ode->mp_not_done_flags,Gs->num);
-  }
-}
-
-U0 ODEMPWake(CMathODE *ode)
-{
-  I64 i;
-  if (!ode->slave_tasks) {
-    ode->slave_tasks=CAlloc(mp_cnt*sizeof(CTask *));
-    for (i=0;i<mp_cnt;i++)
-      ode->slave_tasks[i]=Spawn(&ODEMPTask,ode,"ODE Slave",i);
-  }
-  for (i=0;i<mp_cnt;i++) {
-    Suspend(ode->slave_tasks[i],FALSE);
-    MPInt(I_WAKE,i);
-  }
-}
-
-U0 ODEMPSleep(CMathODE *ode)
-{
-  I64 i;
-  if (ode->slave_tasks) {
-    while (ode->mp_not_done_flags)
-      Yield;
-    for (i=0;i<mp_cnt;i++)
-      Suspend(ode->slave_tasks[i]);
-  }
-}
-
-U0 ODECallMPDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
-{
-  ode->mp_t=t;
-  ode->mp_state=state;
-  ode->mp_DstateDt=DstateDt;
-  ode->mp_not_done_flags=1<<mp_cnt-1;
-  do Yield;
-  while (ode->mp_not_done_flags);
-}
-
-U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
-{
-  CMass *tmpm;
-  if (ode->flags&ODEF_HAS_MASSES) {
-    ODESetMassesPtrs(ode,state,DstateDt);
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      if (!(tmpm->flags&MSF_INACTIVE)) {
-        D3Zero(&tmpm->DstateDt->DxDt);
-        D3Copy(&tmpm->DstateDt->x,&tmpm->state->DxDt);
-      }
-      tmpm=tmpm->next;
-    }
-    ODECalcSprings(ode);
-    ODECalcDrag(ode);
-    if (ode->mp_derive)
-      ODECallMPDerivative(ode,t,state,DstateDt);
-    if (ode->derive)
-      (*ode->derive)(ode,t,state,DstateDt);
-    tmpm=ode->next_mass;
-    while (tmpm!=&ode->next_mass) {
-      if (!(tmpm->flags&MSF_INACTIVE)) {
-        if (tmpm->flags&MSF_FIXED) {
-          D3Zero(&tmpm->DstateDt->DxDt);
-          D3Zero(&tmpm->DstateDt->x);
-        } else if (tmpm->mass)
-          D3DivEqu(&tmpm->DstateDt->DxDt,tmpm->mass);
-      }
-      tmpm=tmpm->next;
-    }
-    ODEApplyAccelerationLimit(ode);
-  } else {
-    if (ode->mp_derive)
-      ODECallMPDerivative(ode,t,state,DstateDt);
-    if (ode->derive)
-      (*ode->derive)(ode,t,state,DstateDt);
-  }
-}
-
-U0 ODEOneStep(CMathODE *ode)
-{
-  I64 i;
-  ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
-  for (i=0;i<ode->n_internal;i++)
-    ode->state_internal[i]+=ode->h*ode->DstateDt[i];
-  ode->t+=ode->h;
-}
-
-U0 ODERK4OneStep(CMathODE *ode)
-{
-  I64 i,n=ode->n_internal;
-  F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt;
-
-  dym =ode->tmp0;
-  dyt =ode->tmp1;
-  yt  =ode->tmp2;
-  DstateDt=ode->tmp3;
-  hh  =0.5*ode->h;
-  h6  =ode->h / 6.0;
-  xh  =ode->t + hh;
-
-  ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
-  for (i=0;i<n;i++)
-    yt[i]=ode->state_internal[i]+hh*DstateDt[i];
-  ODECallDerivative(ode,xh,yt,dyt);
-  for (i=0;i<n;i++)
-    yt[i]=ode->state_internal[i]+hh*dyt[i];
-  ODECallDerivative(ode,xh,yt,dym);
-  for (i=0;i<n;i++) {
-    yt[i]=ode->state_internal[i]+ode->h*dym[i];
-    dym[i]+=dyt[i];
-  }
-  ode->t+=ode->h;
-  ODECallDerivative(ode,ode->t,yt,dyt);
-  for (i=0;i<n;i++)
-    ode->state_internal[i]+=h6*(DstateDt[i]+dyt[i]+2.0*dym[i]);
-}
-
-#define ODEa2 0.2
-#define ODEa3 0.3
-#define ODEa4 0.6
-#define ODEa5 1.0
-#define ODEa6 0.875
-#define ODEb21 0.2
-#define ODEb31 (3.0/40.0)
-#define ODEb32 (9.0/40.0)
-#define ODEb41 0.3
-#define ODEb42 (-0.9)
-#define ODEb43 1.2
-#define ODEb51 (-11.0/54.0)
-#define ODEb52 2.5
-#define ODEb53 (-70.0/27.0)
-#define ODEb54 (35.0/27.0)
-#define ODEb61 (1631.0/55296.0)
-#define ODEb62 (175.0/512.0)
-#define ODEb63 (575.0/13824.0)
-#define ODEb64 (44275.0/110592.0)
-#define ODEb65 (253.0/4096.0)
-#define ODEc1  (37.0/378.0)
-#define ODEc3  (250.0/621.0)
-#define ODEc4  (125.0/594.0)
-#define ODEc6  (512.0/1771.0)
-#define ODEdc1 (37.0/378.0-2825.0/27648.0)
-#define ODEdc3 (250.0/621.0-18575.0/48384.0)
-#define ODEdc4 (125.0/594.0-13525.0/55296.0)
-#define ODEdc5 (-277.0/14336.0)
-#define ODEdc6 (512.0/1771.0-0.25)
-
-U0 ODECashKarp(CMathODE *ode)
-{
-  I64 i,n=ode->n_internal;
-  F64 h=ode->h,*state=ode->state_internal,
-        *DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6,
-        *tmpstate,*stateerr,*outstate;
-
-  ak2=ode->tmp0;
-  ak3=ode->tmp1;
-  ak4=ode->tmp2;
-  ak5=ode->tmp3;
-  ak6=ode->tmp4;
-  tmpstate=ode->tmp5;
-  outstate=ode->tmp6;
-  stateerr=ode->tmp7;
-
-  for (i=0;i<n;i++)
-    tmpstate[i]=state[i]+ODEb21*h*DstateDt[i];
-  ODECallDerivative(ode,ode->t+ODEa2*h,tmpstate,ak2);
-  for (i=0;i<n;i++)
-    tmpstate[i]=state[i]+h*(ODEb31*DstateDt[i]+ODEb32*ak2[i]);
-  ODECallDerivative(ode,ode->t+ODEa3*h,tmpstate,ak3);
-  for (i=0;i<n;i++)
-    tmpstate[i]=state[i]+h*(ODEb41*DstateDt[i]+ODEb42*ak2[i]+ODEb43*ak3[i]);
-  ODECallDerivative(ode,ode->t+ODEa4*h,tmpstate,ak4);
-  for (i=0;i<n;i++)
-    tmpstate[i]=state[i]+h*(ODEb51*DstateDt[i]+
-          ODEb52*ak2[i]+ODEb53*ak3[i]+ODEb54*ak4[i]);
-  ODECallDerivative(ode,ode->t+ODEa5*h,tmpstate,ak5);
-  for (i=0;i<n;i++)
-    tmpstate[i]=state[i]+h*(ODEb61*DstateDt[i]+
-          ODEb62*ak2[i]+ODEb63*ak3[i]+ODEb64*ak4[i]+ODEb65*ak5[i]);
-  ODECallDerivative(ode,ode->t+ODEa6*h,tmpstate,ak6);
-
-  for (i=0;i<n;i++)
-    outstate[i]=state[i]+h*(ODEc1*DstateDt[i]+
-          ODEc3*ak3[i]+ODEc4*ak4[i]+ODEc6*ak6[i]);
-  for (i=0;i<n;i++)
-    stateerr[i]=h*(ODEdc1*DstateDt[i]+ODEdc3*ak3[i]+
-          ODEdc4*ak4[i]+ODEdc5*ak5[i]+ODEdc6*ak6[i]);
-}
-
-#define SAFETY 0.9
-#define PGROW  (-0.2)
-#define PSHRNK (-0.25)
-#define ERRCON 1.89e-4
-
-U0 ODERK5OneStep(CMathODE *ode)
-{
-  I64 i;
-  F64 errmax,tmp,*tmpstate=ode->tmp6,*stateerr=ode->tmp7;
-  while (TRUE) {
-    ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
-    ODECashKarp(ode);
-    errmax=0.0;
-    for (i=0;i<ode->n_internal;i++) {
-      tmp=Abs(stateerr[i]/ode->state_scale[i]);
-      if (tmp>errmax)
-        errmax=tmp;
-    }
-    errmax/=ode->tolerance_internal;
-    if (errmax<=1.0 || ode->h==ode->h_min) break;
-    tmp=ode->h*SAFETY*errmax`PSHRNK;
-    if (tmp<0.1*ode->h)
-      ode->h*=0.1;
-    else
-      ode->h=tmp;
-  }
-  ode->t+=ode->h;
-  if (errmax>ERRCON)
-    ode->h*=SAFETY*errmax`PGROW;
-  else
-    ode->h*=5.0;
-  ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
-  MemCpy(ode->state_internal,tmpstate,sizeof(F64)*ode->n_internal);
-}
-
-F64 ode_alloced_factor=0.75;
-
-U0 ODEsUpdate(CTask *task)
-{/* This routine is called by the window mgron a continuous
-basis to allow real-time simulation.  It is intended
-to provide ress good enough for games.  It uses a runge-kutta
-integrator which is a better algorithm than doing it with Euler.
-
-It is adaptive step-sized, so it slows down when an important
-event is taking place to improve accuracy, but in my implementation
-it has a timeout.
-*/
-  I64 i;
-  F64 d,start_time,timeout_time,t_desired,t_initial,interpolation;
-  CMathODE *ode;
-
-  if (task->next_ode==&task->next_ode)
-    task->last_ode_time=0;
-  else if (!Bt(&task->win_inhibit,WIf_SELF_ODE)) {
-//See GrUpdateTasks() and GrUpdateTaskODEs().
-    //We will not pick a time limit based on
-    //how busy the CPU is, what percent of the
-    //last refresh cycle was spent on ODE's
-    //and what the refresh cycle rate was.
-    start_time=tS;
-    d=1.0/winmgr.fps;
-    timeout_time=start_time+
-          (task->last_ode_time/d+0.1)/(winmgr.last_ode_time/d+0.1)*
-          ode_alloced_factor*d;
-    ode=task->next_ode;
-    while (ode!=&task->next_ode) {
-      t_initial=ode->t;
-      d=tS;
-      if (!(ode->flags&ODEF_STARTED)) {
-        ode->base_t=d;
-        ode->flags|=ODEF_STARTED;
-      }
-      d-=ode->base_t+t_initial;
-      t_desired=ode->t_scale*d+t_initial;
-      if (ode->flags&ODEF_PAUSED)
-        ode->base_t+=t_desired-ode->t; //Slip
-      else {
-        ode->flags|=ODEF_BUSY;
-        if (ode->flags&ODEF_PAUSED)
-          ode->base_t+=t_desired-ode->t; //Slip
-        else {
-          if (ode->derive || ode->mp_derive) {
-            if (ode->mp_derive)
-              ODEMPWake(ode);
-            ODEState2Internal(ode);
-            MemCpy(ode->initial_state,ode->state_internal,
-                  ode->n_internal*sizeof(F64));
-            while (ode->t<t_desired) {
-              ode->h_max=t_desired-ode->t;
-              ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
-              for (i=0;i<ode->n_internal;i++)
-                ode->state_scale[i]=Abs(ode->state_internal[i])+
-                      Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal;
-              ODERK5OneStep(ode);
-              if (tS>timeout_time) {
-                ode->base_t+=t_desired-ode->t; //Slip
-                goto ode_done;
-
-              }
-            }
-
-            //Interpolate if end time was not exact.
-            if (ode->t!=t_desired) {
-              if (interpolation=ode->t-t_initial) {
-                interpolation=(t_desired-t_initial)/interpolation;
-                if (interpolation!=1.0)
-                  for (i=0;i<ode->n_internal;i++)
-                    ode->state_internal[i]=(ode->state_internal[i]-
-                          ode->initial_state[i])*interpolation+
-                          ode->initial_state[i];
-              }
-              ode->t=t_desired;
-            }
-ode_done:
-            ODEInternal2State(ode);
-
-            //Convenience call to set vals
-            ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
-
-            if (ode->mp_derive)
-              ODEMPSleep(ode);
-          }
-        }
-        ode->flags&=~ODEF_BUSY;
-      }
-      ode->base_t+=(1.0-ode->t_scale)*d;
-      ode=ode->next;
-    }
-
-    //Now, we will dynamically adjust tolerances.
-
-    //We will regulate the tolerances
-    //to fill the time we decided was
-    //okay to devote to ODE's.
-    //Since we might have multiple ODE's
-    //active we scale them by the same factor.
-
-    //This algorithm is probably not stable or very good, but it's something.
-
-    //Target is 75% of alloced time.
-    d=(tS-start_time)/(timeout_time-start_time)-0.75;
-
-    ode=task->next_ode;
-    while (ode!=&task->next_ode) {
-      if (!(ode->flags&ODEF_PAUSED) && ode->derive) {
-        if (ode->min_tolerance!=ode->max_tolerance) {
-          if (d>0)
-            ode->tolerance_internal*=10.0`d;
-          else
-            ode->tolerance_internal*=2.0`d;
-        }
-        ode->tolerance_internal=Clamp(ode->tolerance_internal,
-              ode->min_tolerance,ode->max_tolerance);
-      }
-      ode=ode->next;
-    }
-    winmgr.ode_time+=task->last_ode_time=tS-start_time;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AMem.HC.HTML b/public/Wb/Home/Src/Adam/AMem.HC.HTML deleted file mode 100755 index 64e0d3c..0000000 --- a/public/Wb/Home/Src/Adam/AMem.HC.HTML +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - -
-#help_index "Memory/Task"
-public I64 TaskMemAlloced(CTask *task=NULL,Bool override_validate=FALSE)
-{//Count of bytes alloced to a task, used+unused.
-  I64 res;
-  if (!task) task=Fs;
-  if (override_validate || TaskValidate(task)) {
-    res=task->code_heap->alloced_u8s;
-    if (task->code_heap!=task->data_heap)
-      res+=task->data_heap->alloced_u8s;
-    return res;
-  } else
-    return 0;
-}
-
-public I64 TaskMemUsed(CTask *task=NULL,Bool override_validate=FALSE)
-{//Count of bytes alloced to a task and in use.
-  I64 res;
-  if (!task) task=Fs;
-  if (override_validate || TaskValidate(task)) {
-    res=task->code_heap->used_u8s;
-    if (task->data_heap!=task->code_heap)
-      res+=task->data_heap->used_u8s;
-    return res;
-  } else
-    return 0;
-}
-
-#help_index "Memory/Task;Debugging/Heap;Memory/Debugging"
-public Bool HeapRep(CTask *task)
-{//Report status of task's heap.
-  I64 i,cnt;
-  CMemUnused *uum;
-
-  if (!task || task==Fs) {
-    "Task can't HeapRep on self.\n";
-    return FALSE;
-  }
-  if (!TaskValidate(task)) return FALSE;
-
-  PUSHFD
-  CLI
-  while (LBts(&task->code_heap->locked_flags,HClf_LOCKED))
-    PAUSE
-  if (task->data_heap!=task->code_heap)
-    while (LBts(&task->data_heap->locked_flags,HClf_LOCKED))
-      PAUSE
-
-  for (i=0;i<MEM_HEAP_HASH_SIZE>>3;i++) {
-    cnt=0;
-    uum=task->code_heap->heap_hash[i];
-    while (uum) {
-      cnt+=uum->size;
-      uum=uum->next;
-    }
-    if (task->data_heap!=task->code_heap) {
-      uum=task->data_heap->heap_hash[i];
-      while (uum) {
-        cnt+=uum->size;
-        uum=uum->next;
-      }
-    }
-    if (cnt)
-      "%03X:%08X\n",i<<3,cnt;
-  }
-  '\n';
-
-  uum=task->code_heap->malloc_free_lst;
-  while (uum) {
-    "%X, ",uum->size;
-    uum=uum->next;
-  }
-  if (task->data_heap!=task->code_heap) {
-    uum=task->data_heap->malloc_free_lst;
-    while (uum) {
-      "%X, ",uum->size;
-      uum=uum->next;
-    }
-  }
-
-  if (task->data_heap!=task->code_heap)
-    LBtr(&task->data_heap->locked_flags,HClf_LOCKED);
-  LBtr(&task->code_heap->locked_flags,HClf_LOCKED);
-  POPFD
-
-  '\n';
-}
-
-#help_index "Memory/HeapCtrl;Debugging/Heap;Memory/Debugging"
-public Bool IsInHeapCtrl(U8 *a,CHeapCtrl *hc,Bool lock=TRUE)
-{//Check addr if in HeapCtrl.
-  CMemBlk *m;
-  PUSHFD
-  CLI
-  if (lock)
-    while (LBts(&hc->locked_flags,HClf_LOCKED))
-      PAUSE
-  m=hc->next_mem_blk;
-  while (m!=&hc->next_mem_blk) {
-    if (a>=m && a<m(U8 *)+m->pags<<MEM_PAG_BITS) {
-      if (lock)
-        LBtr(&hc->locked_flags,HClf_LOCKED);
-      POPFD
-      return TRUE;
-    }
-    m=m->next;
-  }
-  if (lock)
-    LBtr(&hc->locked_flags,HClf_LOCKED);
-  POPFD
-  return FALSE;
-}
-
-public Bool HeapCtrlWalk(CHeapCtrl *hc)
-{//Check integrity of HeapCtrl.
-  I64 i;
-  CMemUnused *uum;
-
-  PUSHFD
-  CLI
-  while (LBts(&hc->locked_flags,HClf_LOCKED))
-    PAUSE
-
-  for (i=0;i<MEM_HEAP_HASH_SIZE>>3;i++) {
-    uum=hc->heap_hash[i];
-    while (uum) {
-      if (!IsInHeapCtrl(uum,hc,FALSE))
-        goto hc_false;
-      uum=uum->next;
-    }
-  }
-  uum=hc->malloc_free_lst;
-  while (uum) {
-    if (!IsInHeapCtrl(uum,hc,FALSE))
-      goto hc_false;
-    uum=uum->next;
-  }
-
-  #if _CFG_HEAP_DBG
-  CMemUsed *um,*um1;
-  um1=(&hc->next_um)(U8 *)-offset(CMemUsed.next);
-  um=um1->next;
-  while (um!=um1) {
-    if (!IsInHeapCtrl(um,hc,FALSE))
-      goto hc_false;
-    um=um->next;
-  }
-#endif
-
-  LBtr(&hc->locked_flags,HClf_LOCKED);
-  POPFD
-  return TRUE;
-
-  hc_false:
-  LBtr(&hc->locked_flags,HClf_LOCKED);
-  POPFD
-  return FALSE;
-}
-
-#help_index "Memory/Task;Debugging/Heap;Memory/Debugging"
-public Bool IsInHeap(U8 *a,CTask *task=NULL,Bool lock=TRUE)
-{//Check addr if in task's heaps.
-  if (!task) task=Fs;
-  if (TaskValidate(task) && (IsInHeapCtrl(a,task->code_heap,lock)||
-        task->data_heap!=task->code_heap &&
-        IsInHeapCtrl(a,task->data_heap,lock)))
-    return TRUE;
-  else
-    return FALSE;
-}
-
-public Bool HeapWalk(CTask *task=NULL)
-{//Check integrity of task's heaps.
-  if (!task) task=Fs;
-  if (!TaskValidate(task) || !HeapCtrlWalk(task->code_heap) ||
-        task->data_heap!=task->code_heap && !HeapCtrlWalk(task->data_heap))
-    return FALSE;
-  else
-    return TRUE;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AMouse.HC.HTML b/public/Wb/Home/Src/Adam/AMouse.HC.HTML deleted file mode 100755 index 17f5253..0000000 --- a/public/Wb/Home/Src/Adam/AMouse.HC.HTML +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Misc;Mouse/Ptr"
-
-<1>/* Graphics Not Rendered in HTML */
-
-gr.empty_sprite=<1>;
-
-<2>/* Graphics Not Rendered in HTML */
-
-<3>/* Graphics Not Rendered in HTML */
-
-public U0 DrawGrabMs(CDC *dc,I64 x,I64 y,Bool closed)
-{//This is a callback. See ::/Demo/Graphics/Grid.HC.
-  dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
-  dc->color=ROP_EQU;
-  if (closed)
-    Sprite3(dc,x,y,0,<2>);
-  else
-    Sprite3(dc,x,y,0,<3>);
-}
-gr.fp_draw_grab_ms=&DrawGrabMs;
-
- diff --git a/public/Wb/Home/Src/Adam/ARegistry.HC.HTML b/public/Wb/Home/Src/Adam/ARegistry.HC.HTML deleted file mode 100755 index ce02786..0000000 --- a/public/Wb/Home/Src/Adam/ARegistry.HC.HTML +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - -
-#help_index "Registry"
-#define REGISTRY_FILENAME "~/Registry.HC.Z"
-CDoc *sys_registry_doc=NULL;
-I64 sys_msg_flags[1]={0};
-F64 registry_version;
-
-Bool RegCache()
-{
-  Bool old_silent;
-  if (!sys_registry_doc) {
-    old_silent=Silent;
-    sys_registry_doc=DocRead(REGISTRY_FILENAME);
-    Silent(old_silent);
-    return FALSE;
-  } else
-    return TRUE;
-}
-
-public Bool RegDft(U8 *path,U8 *val,Bool is_adam_entry=FALSE)
-{//Add code doc tree branch to registry.
-  Bool res,unlock_doc;
-  RegCache;
-  unlock_doc=DocLock(sys_registry_doc);
-  if (!DocTreeFind(sys_registry_doc,path)) {
-    DocTreeMake(sys_registry_doc,path);
-    DocPrint(sys_registry_doc,"%s",val);
-    if (is_adam_entry) {
-      if (Fs==adam_task)
-        ExePrint("%s",val);
-      else
-        Adam("%s",val);
-    }
-    if (DrvIsWritable(*sys_registry_doc->filename.name))
-      DocWrite(sys_registry_doc);
-    res=FALSE;
-  } else
-    res=TRUE;
-  if (unlock_doc)
-    DocUnlock(sys_registry_doc);
-  return res;
-}
-
-public I64 RegExe(U8 *path)
-{//Execute doc tree branch in registry.
-  RegCache;
-  return DocTreeExe(sys_registry_doc,path);
-}
-
-public Bool RegWrite(U8 *path,U8 *fmt,...)
-{//Rewrite doc tree branch in registry.
-  Bool res;
-  RegCache;
-  res=DocTreeWriteJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
-  return res;
-}
-
-public I64 RegCnt(U8 *path)
-{//Tree branch cnt in registry.
-  I64 res=0;
-  CDocEntry *tree_branch,*start_indent,*end_indent;
-  Bool unlock_doc=DocLock(sys_registry_doc);
-  if (DocTreeFind(sys_registry_doc,path,
-        &tree_branch,&start_indent,&end_indent)) {
-    end_indent=end_indent->next;
-    while (start_indent!=end_indent) {
-      res++;
-      start_indent=start_indent->next;
-    }
-  }
-  if (unlock_doc)
-    DocUnlock(sys_registry_doc);
-  return res;
-}
-
-public Bool RegAppend(U8 *path,U8 *fmt,...)
-{//Append to doc tree branch in registry.
-  Bool res;
-  RegCache;
-  res=DocTreeAppendJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
-  return res;
-}
- 
-public Bool OneTimePopUp(U8 *_flags,I64 flag_num,U8 *msg)
-{//See ::/Apps/X-Caliber/X-Caliber.HC.
-  Bool res=FALSE;
-  CDoc *doc=DocNew;
-  CDocEntry *doc_e;
-  if (!Bt(_flags,flag_num)) {
-    if (msg) DocPrint(doc,"%s",msg);
-    doc_e=DocPrint(doc,"\n$CB,\"Do not show this msg again.\",LE=1$");
-    DocPrint(doc,"$CM+CX,0,4$$BT,\"OKAY\",LE=1$\n");
-    if (PopUpMenu(doc)==1 && doc_e->de_flags&DOCEF_CHECKED_COLLAPSED) {
-      LBts(_flags,flag_num);
-      res=TRUE;
-    }
-    DocDel(doc);
-  }
-  return res;
-}
-
-U0 RegOneTimePopUp(I64 flag_num,U8 *msg)
-{//You're not supposed to make system pop-up flags, only me.
-  if (OneTimePopUp(sys_msg_flags,flag_num,msg))
-    RegWrite("Adam/SysMsgFlags","sys_msg_flags[0]=0x%X;\n",
-          sys_msg_flags[0]);
-}
-
-U0 RegInit()
-{
-  U8 buf[STR_LEN];
-  Bool version_present;
-  RegDft("Adam/SysMsgFlags","sys_msg_flags[0]=0;\n",TRUE);
-  StrPrint(buf,"registry_version=%4.3f;\n",sys_os_version);
-  version_present=RegDft("Adam/SysRegVer",buf,TRUE);
-  RegExe("Adam");
-  if (registry_version!=sys_os_version) {
-    RegWrite("Adam/SysRegVer",buf);
-    RegExe("Adam");
-  }
-}
-
-#help_index "Boot/Once;Registry/Once"
-#help_file "::/Doc/Once"
-
-public U0 AOnceFlush()
-{//Flush AOnce() buf.
-  RegWrite("Once/Adam","");
-}
-
-public U0 OnceFlush()
-{//Flush Once() buf.
-  RegWrite("Once/User","");
-}
-
-public U0 AOnce(U8 *fmt,...)
-{//Add Adam code to ~/Registry.HC, executed next boot.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  if (!Bt(&sys_run_level,RLf_ONCE_ADAM))
-    AOnceFlush;
-  RegAppend("Once/Adam","%s\n",buf);
-  Free(buf);
-}
-
-public U0 Once(U8 *fmt,...)
-{//Add User code to ~/Registry.HC, executed next boot.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  if (!Bt(&sys_run_level,RLf_ONCE_USER))
-    OnceFlush;
-  RegAppend("Once/User","%s\n",buf);
-  Free(buf);
-}
-
-public U0 AOnceDrv(U8 drv_let=0,U8 *fmt,...)
-{//Add Adam code to drv ~/Registry.HC, executed next boot.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  I64 old_drv_let=*sys_registry_doc->filename.name;
-  if (drv_let)
-    *sys_registry_doc->filename.name=drv_let;
-  if (!Bt(&sys_run_level,RLf_ONCE_ADAM))
-    AOnceFlush;
-  RegAppend("Once/Adam","%s\n",buf);
-  Free(buf);
-  *sys_registry_doc->filename.name=old_drv_let;
-}
-
-public U0 OnceDrv(U8 drv_let=0,U8 *fmt,...)
-{//Add User code to drv ~/Registry.HC, executed next boot.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  I64 old_drv_let=*sys_registry_doc->filename.name;
-  if (drv_let)
-    *sys_registry_doc->filename.name=drv_let;
-  if (!Bt(&sys_run_level,RLf_ONCE_USER))
-    OnceFlush;
-  RegAppend("Once/User","%s\n",buf);
-  Free(buf);
-  *sys_registry_doc->filename.name=old_drv_let;
-}
-
-public U0 OnceExe()
-{//Execute Once code. Call goes in ~/Once.HC.
-  try {
-
-    RegDft("Once/Adam","");
-    if (RegCnt("Once/Adam")>2) {
-      Adam("RegExe(\"Once/Adam\");");
-      AOnceFlush;
-    }
-    LBts(&sys_run_level,RLf_ONCE_ADAM);
-
-    RegDft("Once/User","");
-    if (RegCnt("Once/User")>2) {
-      RegExe("Once/User");
-      OnceFlush;
-    }
-    LBts(&sys_run_level,RLf_ONCE_USER);
-
-  } catch {
-    AOnceFlush;
-    LBts(&sys_run_level,RLf_ONCE_ADAM);
-    OnceFlush;
-    LBts(&sys_run_level,RLf_ONCE_USER);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/ASnd.HC.HTML b/public/Wb/Home/Src/Adam/ASnd.HC.HTML deleted file mode 100755 index 90ba6e8..0000000 --- a/public/Wb/Home/Src/Adam/ASnd.HC.HTML +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - -
-#help_index "Snd"
-public U0 SndTaskEndCB()
-{//Will turn-off snd when a task gets killed.
-  Snd;
-  Exit;
-}
-
-#help_index "Snd/Math;Math"
-public F64 Saw(F64 t,F64 period)
-{//Sawtooth. 0.0 - 1.0 think "(Sin+1)/2"
-  if (period) {
-    if (t>=0.0)
-      return t%period/period;
-    else
-      return 1.0+t%period/period;
-  } else
-    return 0.0;
-}
-
-public F64 FullSaw(F64 t,F64 period)
-{//Plus&Minus Sawtooth. 1.0 - -1.0 think "Sin"
-  if (period) {
-    if (t>=0.0)
-      return 2.0*(t%period/period)-1.0;
-    else
-      return 2.0*(t%period/period)+1.0;
-  } else
-    return 0.0;
-}
-
-public F64 Caw(F64 t,F64 period)
-{//Cawtooth. 1.0 - 0.0 think "(Cos+1)/2"
-  if (period) {
-    if (t>=0.0)
-      return 1.0-t%period/period;
-    else
-      return -(t%period)/period;
-  } else
-    return 1.0;
-}
-
-public F64 FullCaw(F64 t,F64 period)
-{//Plus&Minus Cawtooth. 1.0 - -1.0 think "Cos"
-  if (period) {
-    if (t>=0.0)
-      return -2.0*(t%period/period)+1.0;
-    else
-      return -2.0*(t%period/period)-1.0;
-  } else
-    return 1.0;
-}
-
-public F64 Tri(F64 t,F64 period)
-{//Triangle waveform. 0.0 - 1.0 - 0.0
-  if (period) {
-    t=2.0*(Abs(t)%period)/period;
-    if (t<=1.0)
-      return t;
-    else
-      return 2.0-t;
-  } else
-    return 0.0;
-}
-
-public F64 FullTri(F64 t,F64 period)
-{//Plus&Minus Triangle waveform. 0.0 - 1.0 - 0.0 - -1.0 -0.0
-  if (period) {
-    t=4.0*(t%period)/period;
-    if (t<=-1.0) {
-      if (t<=-3.0)
-        return t+4.0;
-      else
-        return -2.0-t;
-    } else {
-      if (t<=1.0)
-        return t;
-      else if (t<=3.0)
-        return 2.0-t;
-      else
-        return t-4.0;
-    }
-  } else
-    return 0.0;
-}
-
-#help_index "Snd/Music"
-
-public class CMusicGlbls
-{
-  U8    *cur_song;
-  CTask *cur_song_task;
-  I64   octave;
-  F64   note_len;
-  U8    note_map[7];
-  Bool  mute;
-  I64   meter_top,meter_bottom;
-  F64   tempo,stacatto_factor;
-
-  //If you wish to sync with a
-  //note in a Play() string.  0 is the start
-  I64   play_note_num;
-
-  F64   tM_correction,last_Beat,last_tM;
-} music={NULL,NULL,4,1.0,{0,2,3,5,7,8,10},FALSE,4,4,2.5,0.9,0,0,0,0};
-
-#help_index "Snd/Music;Time/Seconds"
-public F64 tM()
-{//Time in seconds synced to music subsystem.
-  return (cnts.jiffies+music.tM_correction)/JIFFY_FREQ;
-}
-
-public F64 Beat()
-{//Time in music beats.
-  F64 res,cur_tM;
-  PUSHFD
-  CLI
-  if (mp_cnt>1)
-    while (LBts(&sys_semas[SEMA_TMBEAT],0))
-      PAUSE
-  cur_tM=tM;
-  res=music.last_Beat;
-  if (music.tempo)
-    res+=(cur_tM-music.last_tM)*music.tempo;
-  music.last_tM=cur_tM;
-  music.last_Beat=res;
-  LBtr(&sys_semas[SEMA_TMBEAT],0);
-  POPFD
-  return res;
-}
-
-#help_index "Snd/Music"
-U8 *MusicSetOctave(U8 *st)
-{
-  I64 ch;
-  ch=*st++;
-  while ('0'<=ch<='9') {
-    music.octave=ch-'0';
-    ch=*st++;
-  }
-  return --st;
-}
-
-U8 *MusicSetMeter(U8 *st)
-{
-  I64 ch;
-  ch=*st++;
-  while (ch=='M') {
-    ch=*st++;
-    if ('0'<=ch<='9') {
-      music.meter_top=ch-'0';
-      ch=*st++;
-    }
-    if (ch=='/')
-      ch=*st++;
-    if ('0'<=ch<='9') {
-      music.meter_bottom=ch-'0';
-      ch=*st++;
-    }
-  }
-  return --st;
-}
-
-U8 *MusicSetNoteLen(U8 *st)
-{
-  Bool cont=TRUE;
-  do {
-    switch (*st++) {
-      case 'w': music.note_len=4.0;  break;
-      case 'h': music.note_len=2.0;  break;
-      case 'q': music.note_len=1.0;  break;
-      case 'e': music.note_len=0.5;   break;
-      case 's': music.note_len=0.25;   break;
-      case 't': music.note_len=2.0*music.note_len/3.0; break;
-      case '.': music.note_len=1.5*music.note_len; break;
-      default:
-        st--;
-        cont=FALSE;
-    }
-  } while (cont);
-  return st;
-}
-
-public I8 Note2Ona(I64 note,I64 octave=4)
-{//Note to ona. Mid C is ona=51, note=3 and octave=4.
-  if (note<3)
-    return (octave+1)*12+note;
-  else
-    return octave*12+note;
-}
-
-public I8 Ona2Note(I8 ona)
-{//Ona to note in octave. Mid C is ona=51, note=3 and octave=4.
-  return ona%12;
-}
-
-public I8 Ona2Octave(I8 ona)
-{//Ona to octave. Mid C is ona=51, note=3 and octave=4.
-  I64 note=ona%12,octave=ona/12;
-  if (note<3)
-    return octave-1;
-  else
-    return octave;
-}
-
-public U0 Play(U8 *st,U8 *words=NULL)
-{/* Notes are entered with a capital letter.
-
-Octaves are entered with a digit and
-stay set until changed.  Mid C is octave 4.
-
-Durations are entered with
-'w' whole note
-'h' half note
-'q' quarter note
-'e' eighth note
-'t' sets to 2/3rds the current duration
-'.' sets to 1.5 times the current duration
-durations stay set until changed.
-
-'(' tie, placed before the note to be extended
-
-music.meter_top,music.meter_bottom is set with
-"M3/4"
-"M4/4"
-etc.
-
-Sharp and flat are done with '#' or 'b'.
-
-The var music.stacatto_factor can
-be set to a range from 0.0 to 1.0.
-
-The var music.tempo is quarter-notes
-per second.  It defaults to
-2.5 and gets faster when bigger.
-*/
-  U8 *word,*last_st;
-  I64 note,octave,i=0,ona,timeout_val,timeout_val2;
-  Bool tie;
-  F64 d,on_jiffies,off_jiffies;
-  music.play_note_num=0;
-  while (*st) {
-    timeout_val=cnts.jiffies;
-    tie=FALSE;
-
-    do {
-      last_st=st;
-      if (*st=='(') {
-        tie=TRUE;
-        st++;
-      } else {
-        st=MusicSetMeter(st);
-        st=MusicSetOctave(st);
-        st=MusicSetNoteLen(st);
-      }
-    } while (st!=last_st);
-
-    if (!*st) break;
-    note=*st++-'A';
-    if (note<7) {
-      note=music.note_map[note];
-      octave=music.octave;
-      if (*st=='b') {
-        note--;
-        if (note==2)
-          octave--;
-        st++;
-      } else if (*st=='#') {
-        note++;
-        if (note==3)
-          octave++;
-        st++;
-      }
-      ona=Note2Ona(note,octave);
-    } else
-      ona=0;
-    if (words && (word=LstSub(i++,words)) && StrCmp(word," "))
-      "%s",word;
-
-    d=JIFFY_FREQ*music.note_len/music.tempo;
-    on_jiffies  =d*music.stacatto_factor;
-    off_jiffies =d*(1.0-music.stacatto_factor);
-
-    timeout_val+=on_jiffies;
-    timeout_val2=timeout_val+off_jiffies;
-
-    if (!music.mute)
-      Snd(ona);
-    SleepUntil(timeout_val);
-    music.tM_correction+=on_jiffies-ToI64(on_jiffies);
-
-    if (!music.mute && !tie)
-      Snd;
-    SleepUntil(timeout_val2);
-    music.tM_correction+=off_jiffies-ToI64(off_jiffies);
-
-    music.play_note_num++;
-  }
-}
-
-U0 MusicSettingsRst()
-{
-  music.play_note_num=0;
-  music.stacatto_factor=0.9;
-  music.tempo=2.5;
-  music.octave=4;
-  music.note_len=1.0;
-  music.meter_top=4;
-  music.meter_bottom=4;
-  SndRst;
-  PUSHFD
-  CLI
-  if (mp_cnt>1)
-    while (LBts(&sys_semas[SEMA_TMBEAT],0))
-      PAUSE
-  music.last_tM=tM;
-  music.last_Beat=0.0;
-  LBtr(&sys_semas[SEMA_TMBEAT],0);
-  POPFD
-}
-
-MusicSettingsRst;
-
-U0 CurSongTask()
-{
-  Fs->task_end_cb=&SndTaskEndCB;
-  while (TRUE)
-    Play(music.cur_song);
-}
-
-#help_index "Snd"
-
-#define SE_NOISE        0
-#define SE_SWEEP        1
-
-class CSoundEffectFrame
-{
-  I32   type;
-  I8    ona1,ona2;
-  F64   duration;
-};
-
-U0 SoundEffectEndTaskCB()
-{
-  Free(FramePtr("CSoundEffectFrame"));
-  music.mute--;
-  SndTaskEndCB;
-}
-
-U0 SoundEffectTask(CSoundEffectFrame *ns)
-{
-  I64 i,ona;
-  F64 t0=tS,t,timeout=t0+ns->duration;
-  FramePtrAdd("CSoundEffectFrame",ns);
-  Fs->task_end_cb=&SoundEffectEndTaskCB;
-  switch (ns->type) {
-    case SE_NOISE:
-      i=MaxI64(ns->ona2-ns->ona1,1);
-      while (tS<timeout) {
-        ona=RandU16%i+ns->ona1;
-        Snd(ona);
-        t=Clamp(3000.0/Ona2Freq(ona),1.0,50.0);
-        if (t+tS>timeout)
-          t=timeout-tS;
-        Sleep(t);
-      }
-      break;
-    case SE_SWEEP:
-      while (tS<timeout) {
-        t=(tS-t0)/ns->duration;
-        ona=(1.0-t)*ns->ona1+t*ns->ona2;
-        Snd(ona);
-        t=Clamp(3000.0/Ona2Freq(ona),1.0,50.0);
-        if (t+tS>timeout)
-          t=timeout-tS;
-        Sleep(t);
-      }
-      break;
-  }
-}
-
-public CTask *Noise(I64 mS,F64 min_ona,F64 max_ona)
-{//Make white noise for given number of mS.
-  CSoundEffectFrame *ns;
-  if (mS>0) {
-    ns=MAlloc(sizeof(CSoundEffectFrame));
-    ns->type=SE_NOISE;
-    ns->duration=mS/1000.0;
-    ns->ona1=min_ona;
-    ns->ona2=max_ona;
-    music.mute++;
-    return Spawn(&SoundEffectTask,ns,"Noise",,Fs);
-  } else
-    return NULL;
-}
-
-public CTask *Sweep(I64 mS,F64 ona1,F64 ona2)
-{//Sweep through freq range in given number of mS.
-  CSoundEffectFrame *ns;
-  if (mS>0) {
-    ns=MAlloc(sizeof(CSoundEffectFrame));
-    ns->type=SE_SWEEP;
-    ns->duration=mS/1000.0;
-    ns->ona1=ona1;
-    ns->ona2=ona2;
-    music.mute++;
-    return Spawn(&SoundEffectTask,ns,"Noise",,Fs);
-  } else
-    return NULL;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AutoComplete/ACDictGen.HC.HTML b/public/Wb/Home/Src/Adam/AutoComplete/ACDictGen.HC.HTML deleted file mode 100755 index 1c787fb..0000000 --- a/public/Wb/Home/Src/Adam/AutoComplete/ACDictGen.HC.HTML +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - - - - - - -
-/*
-This file is a stand-alone program
-which will regenerate processed dictionary
-files from a raw Project Gutenberg
-dictionary file.
-
-See ::/Doc/Credits.DD.
-*/
-
-U0 ACDPreprocess(U8 *in_name,U8 *out_name)
-{/*
-<cr><nl>--> <nl>
-$       --> $$
-\'89    --> .
-*/
-  I64 ch,i;
-  U8 *src,*dst;
-  CDoc *doc;
-  CDocEntry *doc_e;
-  if (doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS)) {
-    doc_e=doc->head.next;
-    while (doc_e!=doc) {
-      if (doc_e->type_u8==DOCT_TEXT) {
-        src=dst=doc_e->tag;
-        while (ch=*src++) {
-          if (ch=='\\' && *src=='\'') {
-            src++;
-            i=0;
-            ch=ToUpper(*src++);
-            if ('0'<=ch<='9')
-              i+=ch-'0';
-            else if ('A'<=ch<='F')
-              i+=ch-'A'+10;
-            i<<=4;
-            ch=ToUpper(*src++);
-            if ('0'<=ch<='9')
-              i+=ch-'0';
-            else if ('A'<=ch<='F')
-              i+=ch-'A'+10;
-            *dst++=i;
-          } else
-            *dst++=ch;
-        }
-        *dst=0;
-      }
-      doc_e=doc_e->next;
-    }
-    StrCpy(doc->filename.name,out_name);
-    DocWrite(doc);
-    DocDel(doc);
-  }
-}
-
-I64 ACDNextCmd(U8 **_ptr)
-{
-  U8 *ptr=*_ptr,*ptr2;
-  I64 ch,res=-1;
-  do {
-    do {
-      if (!(ch=*ptr++)) goto ncmd_done;
-    } while (ch!='<');
-
-    ptr2=ptr;
-    do {
-      if (!(ch=*ptr2++)) goto ncmd_done;
-    } while (ch!='>');
-    *--ptr2=0;
-    res=LstMatch(ptr,"h1\0/h1\0def\0/def\0hw\0/hw\0tt\0/tt\0"
-          "ety\0@fld\0@cd\0@blockquote\0@wordforms\0@note\0@altname\0@chform\0"
-          "@cref\0@syn\0/ety\0@/fld\0@/cd\0@/blockquote\0@/wordforms\0@/note\0"
-          "@/altname\0@/chform\0@/cref\0@/syn\0");
-    *ptr2++='>';
-    ptr=ptr2;
-  } while (res<0);
-
-  ncmd_done:
-  *_ptr=ptr;
-  return res;
-}
-
-U8 *ACDNextEntry(U8 **_ptr)
-{
-  U8 *res,*ignore,*ptr=*_ptr,buf[ACD_BLK_SIZE],*out_ptr=buf;
-  I64 ch,l;
-  while (TRUE) {
-    while (TRUE) {
-      if (!(ch=*ptr++)) goto nentry_done;
-      if (ch!='<') {
-        *out_ptr++=ch;
-        if (ch=='$')
-          *out_ptr++=ch;
-      } else
-        break;
-    }
-    ignore="b>\0i>\0ppp>\0/b>\0/i>\0/p>\0"
-          "ets>\0col>\0spn>\0/ets>\0/col>\0/spn>\0er>\0as>\0cs>\0cd>\0ex>\0"
-          "/er>\0/as>\0/cs>\0/cd>\0/ex>\0"
-          "note>\0/note>\0blockquote>\0/blockquote>\0";
-    while (*ignore) {
-      l=StrLen(ignore);
-      if (!StrNCmp(ptr,ignore,l)) {
-        ptr+=l;
-        break;
-      } else
-        ignore+=l+1;
-    }
-    if (!*ignore)
-      break;
-  }
-nentry_done:
-  *out_ptr++=0;
-  res=StrNew(buf);
-  *_ptr=ptr-1;
-  return res;
-}
-
-I64 ACDCompareWords(U8 *e1,U8 *e2)
-{
-  return StrICmp(e1,e2);
-}
-
-U8 *ACDSortWords(U8 *start,I64 size,I64 word_cnt)
-{
-  U8 **ptr_array=MAlloc(sizeof(U8 *)*word_cnt),
-        *out_start=MAlloc(size),
-        *ptr=start,*ptr2;
-  I64 i=0;
-  while (*ptr) {
-    ptr_array[i++]=ptr;
-    ptr+=StrLen(ptr)+3;
-  }
-  "Sorting...\n"; Sleep(100);
-  QSortI64(ptr_array,word_cnt,&ACDCompareWords);
-  "Done...\n"; Sleep(100);
-
-  ptr=out_start;
-  for (i=0;i<word_cnt;i++) {
-    ptr2=ptr_array[i];
-    while (*ptr2)
-      *ptr++=*ptr2++;
-    *ptr++=*ptr2++; //zero
-    *ptr++=*ptr2++; //blk lo
-    *ptr++=*ptr2++; //blk hi
-  }
-  *ptr++=0;
-  return out_start;
-}
-
-U0 ACDGen(U8 *in_file)
-{
-  I64 cmd,size,word_cnt=0,largest_entry=0;
-  U8 *st,*in_ptr=FileRead(in_file,&size),*in_start=in_ptr,
-        *out_ptr=MAlloc(size),*out_start=out_ptr,
-        *word_ptr=MAlloc(size),*word_start=word_ptr,
-        *last_word="",*def_word_start=out_ptr,
-        *sorted_word_start;
-  U16 *d;
-  if (!in_ptr) return;
-  do {
-    cmd=ACDNextCmd(&in_ptr);
-    if (cmd==ACD_H1) {
-next_word:
-      if (out_ptr-def_word_start>largest_entry)
-        largest_entry=out_ptr-def_word_start;
-      def_word_start=out_ptr;
-      if (st=ACDNextEntry(&in_ptr)) {
-        if (*st) {
-          if (StrICmp(st,last_word)) {
-            word_cnt++;
-
-            *word_ptr++=ACD_WORD_CHAR;
-            last_word=word_ptr;
-            StrCpy(word_ptr,st);
-            word_ptr+=StrLen(st)+1;
-
-            d=word_ptr;
-            *d=(out_ptr-out_start)/ACD_BLK_SIZE;
-            word_ptr+=2;
-
-            *out_ptr++=ACD_WORD_CHAR;
-            StrCpy(out_ptr,st);
-            out_ptr+=StrLen(st)+1;
-          }
-          Free(st);
-
-          do {
-            do {
-              cmd=ACDNextCmd(&in_ptr);
-              if (cmd==ACD_H1)
-                goto next_word;
-            } while (cmd>=0 && !(cmd==ACD_DEF||cmd==ACD_PRONUNCIATION||
-                  cmd==ACD_POS||cmd==ACD_EXTRA));
-            if (cmd==ACD_DEF) {
-              if(st=ACDNextEntry(&in_ptr)) {
-                if (*st) {
-                  *out_ptr++=ACD_DEF_CHAR;
-                  StrCpy(out_ptr,st);
-                  out_ptr+=StrLen(st)+1;
-                }
-                Free(st);
-              }
-            } else if (cmd==ACD_PRONUNCIATION) {
-              if(st=ACDNextEntry(&in_ptr)) {
-                if (*st) {
-                  *out_ptr++=ACD_PRONUNCIATION_CHAR;
-                  StrCpy(out_ptr,st);
-                  out_ptr+=StrLen(st)+1;
-                }
-                Free(st);
-              }
-            } else if (cmd==ACD_POS) {
-              if(st=ACDNextEntry(&in_ptr)) {
-                if (*st) {
-                  *out_ptr++=ACD_POS_CHAR;
-                  StrCpy(out_ptr,st);
-                  out_ptr+=StrLen(st)+1;
-                }
-                Free(st);
-              }
-            } else if (cmd==ACD_EXTRA) {
-              if(st=ACDNextEntry(&in_ptr)) {
-                if (*st) {
-                  *out_ptr++=ACD_EXTRA_CHAR;
-                  StrCpy(out_ptr,st);
-                  out_ptr+=StrLen(st)+1;
-                }
-                Free(st);
-              }
-            }
-          } while (cmd==ACD_DEF||cmd==ACD_PRONUNCIATION||
-                cmd==ACD_POS||cmd==ACD_EXTRA);
-        } else
-          Free(st);
-      }
-    }
-  } while (cmd>=0);
-  *out_ptr++=ACD_END_CHAR;
-  *word_ptr++=ACD_END_CHAR;
-
-  Free(in_start);
-
-  "Blk Size      :%d\n",ACD_BLK_SIZE;
-  "Blk Cnt       :%04X\n",(out_ptr-out_start+ACD_BLK_SIZE-1)/ACD_BLK_SIZE;
-  "Largest Entry :%d\n",largest_entry;
-  "Word Count    :%d\n",word_cnt;
-
-  FileWrite(ACD_DEF_FILENAME,out_start,out_ptr-out_start);
-  "Def File Size :%d\n",out_ptr-out_start;
-
-  sorted_word_start=ACDSortWords(word_start,word_ptr-word_start,word_cnt);
-  FileWrite(ACD_WORD_FILENAME,sorted_word_start,word_ptr-word_start);
-  "Word File Size:%d\n",word_ptr-word_start;
-
-  Free(out_start);
-  Free(word_start);
-  Free(sorted_word_start);
-}
-
-Cd(__DIR__);
-ACDPreprocess("DICTIONARY.DD","DICTIONARY2.DD");
-ACDGen("DICTIONARY2.DD");
-
- diff --git a/public/Wb/Home/Src/Adam/AutoComplete/ACFill.HC.HTML b/public/Wb/Home/Src/Adam/AutoComplete/ACFill.HC.HTML deleted file mode 100755 index da4a8ad..0000000 --- a/public/Wb/Home/Src/Adam/AutoComplete/ACFill.HC.HTML +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - -
-#help_index "AutoComplete/Dictionary"
-public U8 *ACDDefGet(U8 *st,I64 def_num=1)
-{//MAlloc str holding single dict definition of word.
-  CFile *f;
-  CHashGeneric *tmph;
-  U8 *res=NULL,*buf,*in_ptr,
-        *st2=MStrUtil(st,SUF_TO_UPPER);
-  tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
-  Free(st2);
-  if (tmph) {
-    if (f=FOpen(ACD_DEF_FILENAME,"r")) {
-      buf=MAlloc(ACD_BLK_SIZE*2+1);
-      buf[ACD_BLK_SIZE*2]=0; //terminate
-      FBlkRead(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
-            ACD_BLK_SIZE*2/BLK_SIZE);
-      FClose(f);
-      in_ptr=buf;
-      while (in_ptr<buf+ACD_BLK_SIZE*2) {
-        while (*in_ptr!=ACD_WORD_CHAR && in_ptr<buf+ACD_BLK_SIZE*2)
-          in_ptr++;
-        if (*in_ptr++==ACD_WORD_CHAR) {
-          if (!StrICmp(st,in_ptr)) {
-            while (def_num && *in_ptr!=ACD_WORD_CHAR
-                  && in_ptr<buf+ACD_BLK_SIZE*2) {
-              if (*in_ptr==ACD_DEF_CHAR) {
-                if (!--def_num)
-                  break;
-                else
-                  in_ptr++;
-              } else
-                in_ptr++;
-            }
-            if (*in_ptr++==ACD_DEF_CHAR) {
-              res=StrNew(in_ptr);
-              break;
-            }
-          }
-        }
-      }
-      Free(buf);
-    }
-  }
-  return res;
-}
-
-public U8 *ACDDefsGet(U8 *st)
-{//MAlloc str with all dict definitions of word.
-  CFile *f;
-  CHashGeneric *tmph;
-  U8 *res=NULL,*buf,*in_ptr,*in_ptr2,
-        *st2=MStrUtil(st,SUF_TO_UPPER);
-  tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
-  Free(st2);
-  if (tmph) {
-    if (f=FOpen(ACD_DEF_FILENAME,"r")) {
-      buf=MAlloc(ACD_BLK_SIZE*2+1);
-      buf[ACD_BLK_SIZE*2]=0; //terminate
-      FBlkRead(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
-            ACD_BLK_SIZE*2/BLK_SIZE);
-      FClose(f);
-      in_ptr=buf;
-      while (in_ptr<buf+ACD_BLK_SIZE*2) {
-        while (*in_ptr!=ACD_WORD_CHAR && in_ptr<buf+ACD_BLK_SIZE*2)
-          in_ptr++;
-        if (*in_ptr++==ACD_WORD_CHAR) {
-          if (!StrICmp(st,in_ptr)) {
-            in_ptr2=in_ptr;
-            in_ptr--;
-            while (*in_ptr2!=ACD_WORD_CHAR
-                  && in_ptr2<buf+ACD_BLK_SIZE*2) {
-              in_ptr2++;
-            }
-            res=MAlloc(in_ptr2+1-in_ptr);
-            MemCpy(res,in_ptr,in_ptr2-in_ptr);
-            res[in_ptr2-in_ptr]=ACD_END_CHAR;
-            break;
-          }
-        }
-      }
-      Free(buf);
-    }
-  }
-  return res;
-}
-
-/*Fmt of word lst entry:
-  U8 ACD_WORD_CHAR
-  U8 word[] with terminating zero
-  I16 block;
-*/
-public U8 *ACDWordPtAt(U8 *st)
-{//Point to word in word list.
-  I64 i;
-  U8 *start=acd.word_lst,*r=start,
-        *end=acd.word_lst+acd.word_lst_size;
-  if (!st || !*st)
-    return acd.word_lst;
-  if (acd.word_lst_size) {
-    while (start+3<end) {
-      r=(start+end)>>1;
-      while (TRUE) {
-        while (*r!=ACD_WORD_CHAR && r>acd.word_lst)
-          r--;
-        if ((r[2]==ACD_WORD_CHAR||r[1]==ACD_WORD_CHAR)&&r-3>acd.word_lst)
-          r--;
-        else
-          break;
-      }
-      if (*r==ACD_WORD_CHAR) {
-        i=StrICmp(st,r+1);
-        if (i<0)
-          end=r-1;
-        else if (i>0)
-          start=r+StrLen(r)+3;
-        else
-          return r;
-      } else
-        break;
-    }
-    r=(start+end)>>1;
-    while (TRUE) {
-      while (*r!=ACD_WORD_CHAR && r>acd.word_lst)
-        r--;
-      if ((r[2]==ACD_WORD_CHAR||r[1]==ACD_WORD_CHAR)&&r-3>acd.word_lst)
-        r--;
-      else
-        break;
-    }
-    if (*r==ACD_WORD_CHAR && StrICmp(st,r+1)>0)
-      r+=StrLen(r)+3;
-  }
-  if (*r==ACD_WORD_CHAR)
-    return r;
-  else
-    return acd.word_lst;
-}
-
-U0 ACDFillin(I64 n)
-{
-  U8 *s;
-  I64 len;
-  if (0<=n<acd.num_fillins) {
-    s=acd.fillins[n]+1;
-    len=StrLen(s);
-    if (len>ac.partial_len)
-      In(s+ac.partial_len);
-  }
-}
-
-public U0 ACDDefsPut(CDoc *doc=NULL,U8 *st,I64 num=-1)
-{//Put to doc a dictionary definition(s) of a word.
-  U8 *st2,*st3;
-  I64 ch,i=0;
-  if (!st) return;
-  if (*st==ACD_WORD_CHAR)
-    st++;
-  DocPrint(doc,"$WW,1$$RED$%s:$FG$\n\n",st);
-  if (num<0) {
-    if (st3=ACDDefsGet(st)) {
-      st2=st3;
-      while (ch=*st2++) {
-        switch (ch) {
-          case ACD_WORD_CHAR:
-            break;
-          case ACD_DEF_CHAR:
-            DocPrint(doc,"$GREEN$(%d)$FG$ %s\n",
-                  ++i,st2);
-            break;
-          case ACD_PRONUNCIATION_CHAR:
-            DocPrint(doc,"$LTGREEN$%s$FG$\n",st2);
-            break;
-          case ACD_POS_CHAR:
-            DocPrint(doc,"$BLACK$%s$FG$\n",st2);
-            break;
-          case ACD_EXTRA_CHAR:
-            DocPrint(doc,"$LTBLUE$%s$FG$\n",st2);
-            break;
-        }
-        st2+=StrLen(st2)+1;
-      }
-      Free(st3);
-    }
-  } else {
-    while (st2=ACDDefGet(st,++i)) {
-      if (i==num)
-        DocPrint(doc,"$GREEN$(%d)$FG$ %s\n",
-              i,st2);
-      Free(st2);
-    }
-  }
-}
-
-U0 ACDPopUpDef(U8 *st,I64 num=-1,CTask *parent=NULL)
-{
-  U8 *buf;
-  buf=MStrPrint("ACDDefsPut(DocPut,\"%s\",%d);View;",st,num);
-  PopUp(buf,parent);
-  Free(buf);
-}
-
-U0 ACDDef(I64 n,CTask *parent=NULL)
-{
-  if (0<=n<acd.num_fillins)
-    ACDPopUpDef(acd.fillins[n],-1,parent);
-}
-
-#help_index "AutoComplete"
-U0 ACFillIn(I64 n)
-{
-  U8 *s;
-  if (0<=--n<ac.num_fillins) {
-    s=ac.fillin_matches[n]->str;
-    if (StrLen(s)>ac.partial_len)
-      In(s+ac.partial_len);
-  }
-}
-
-U0 ACMan(I64 n,CTask *parent_task=NULL)
-{
-  CHashAC *tmpw;
-  CHashSrcSym *tmph;
-  if (0<=--n<ac.num_fillins && (tmpw=ac.fillin_matches[n]) &&
-        (tmph=HashFind(tmpw->str,Fs->hash_table,HTG_SRC_SYM)) &&
-        tmph->src_link)
-    PopUpEd(tmph->src_link,parent_task);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AutoComplete/ACInit.HC.HTML b/public/Wb/Home/Src/Adam/AutoComplete/ACInit.HC.HTML deleted file mode 100755 index e475f96..0000000 --- a/public/Wb/Home/Src/Adam/AutoComplete/ACInit.HC.HTML +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - -
-#help_index "AutoComplete/Dictionary"
-acd.has_words=FileFind(ACD_WORD_FILENAME);
-acd.has_defs =FileFind(ACD_DEF_FILENAME)||FileFind(ACD_DEF_FILENAME_Z);
-
-public U0 ACDWordsLoad()
-{//Put words from word list into hash table.
-  I64 size;
-  CHashGeneric *tmph;
-  U8 *in_ptr,*in_start,*st2;
-  U16 *d;
-  acd.num_words=0;
-  if (in_ptr=FileRead(ACD_WORD_FILENAME,&size)) {
-    in_start=in_ptr;
-    Free(acd.word_lst);
-    acd.word_lst=AMAlloc(size);
-    MemCpy(acd.word_lst,in_start,size);
-    acd.word_lst_size=size;
-
-    while (in_ptr<in_start+size) {
-      if (*in_ptr==ACD_WORD_CHAR)
-        in_ptr++;
-      if (*in_ptr) {
-        st2=MStrUtil(in_ptr,SUF_TO_UPPER);
-        tmph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
-        StrCpy(tmph+1,st2);
-        Free(st2);
-        in_ptr+=StrLen(in_ptr)+1;
-        tmph->str=tmph+1;
-        tmph->use_cnt=1;
-        tmph->type=HTT_DICT_WORD;
-        d=in_ptr;
-        tmph->user_data0=*d;
-        in_ptr+=2;
-        HashAdd(tmph,ac.hash_table);
-        acd.num_words++;
-      } else
-        in_ptr+=3;
-    }
-    Free(in_start);
-  }
-}
-
-#help_index "AutoComplete"
-CHashAC *ACHashAdd(U8 *w)
-{
-  CHashAC *tmpw=HashFind(w,ac.hash_table,HTT_WORD);
-  if (tmpw) {
-    tmpw->hits++;
-    return tmpw;
-  }
-  tmpw=ACAlloc(sizeof(CHashAC));
-  tmpw->str=AStrNew(w);
-  tmpw->type=HTT_WORD;
-  tmpw->use_cnt=1;
-  tmpw->hits=1;
-  HashAdd(tmpw,ac.hash_table);
-  ac.num_words++;
-  return tmpw;
-}
-
-U0 ACSingleFileAdd(U8 *buf)
-{
-  I64 ch;
-  U8 *ptr=buf,*ptr2,*ptr3;
-  while (TRUE) {
-    while (TRUE) {
-      if (ch=*ptr++) {
-        if (Bt(char_bmp_alpha_numeric,ch))
-          break;
-      } else
-        return;
-    }
-    ptr3=ptr;
-    ptr2=ptr;
-    ptr--;
-    while (TRUE) {
-      if (ch=*ptr2++) {
-        if (Bt(char_bmp_alpha_numeric,ch))
-          *ptr3++=ch;
-        else if (ch!=CH_CURSOR)
-          break;
-      } else {
-        ptr2--;
-        break;
-      }
-    }
-    *ptr3=0;
-    ACHashAdd(ptr);
-    ptr=ptr2;
-  }
-}
-
-U0 ACMainFileLstTraverse(U8 *files_find_mask)
-{
-  U8 *buf;
-  CDirEntry *tmpde,*tmpde1;
-  try {
-    tmpde=tmpde1=FilesFind(files_find_mask,
-          FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUS_ORDER);
-    while (tmpde) {
-      "%s\n",tmpde->full_name;
-      buf=FileRead(tmpde->full_name);
-      ACSingleFileAdd(buf);
-      Free(buf);
-      tmpde=tmpde->next;
-    }
-  } catch
-    Fs->catch_except=TRUE;
-  DirTreeDel(tmpde1);
-}
-
-U0 ACProgressTask(Bool *_start_flag)
-{
-  I64 start=blkdev.write_cnt;
-  progress1=0;
-  progress1_max=(Size(ACD_DEF_FILENAME_Z,"+x+s")+BLK_SIZE-1)>>BLK_SIZE_BITS;
-  StrCpy(progress1_desc,"Uncompressing Dictionary");
-  start=blkdev.write_cnt;
-  *_start_flag=TRUE;
-  while (progress1<progress1_max) {
-    progress1=blkdev.write_cnt-start;
-    Sleep(10);
-  }
-  *progress1_desc=progress1=progress1_max=0;
-}
-
-public U0 ACInit(U8 *mask=NULL)
-{//Read files and build AutoComplete statistics.
-  Bool start_flag;
-  CBlkDev *bd=Let2BlkDev;
-
-  LBtr(&sys_run_level,RLf_AUTO_COMPLETE);
-  AutoComplete;
-  while (LBts(&ac.flags,ACf_INIT_IN_PROGRESS))
-    Yield;
-  if (DrvIsWritable && FileFind(ACD_DEF_FILENAME_Z) &&
-        !FileFind(ACD_DEF_FILENAME)) {
-    if (bd->type!=BDT_RAM) {
-      start_flag=FALSE;
-      Spawn(&ACProgressTask,&start_flag);
-      while (!start_flag)
-        Yield;
-    }
-    Move(ACD_DEF_FILENAME_Z,ACD_DEF_FILENAME);
-  }
-
-  HashTableDel(ac.hash_table);
-  ac.hash_table=HashTableNew(2048,adam_task);
-
-  ac.num_words=0;
-  Free(ac.cur_word);
-  ac.cur_word=NULL;
-
-  if (mask)
-    ACMainFileLstTraverse(mask);
-
-  ACDWordsLoad;
-  LBtr(&ac.flags,ACf_INIT_IN_PROGRESS);
-  LBts(&sys_run_level,RLf_AUTO_COMPLETE);
-  AutoComplete(ON);
-}
-
-I64 AutoCompleteSize()
-{
-  if (ac.hash_table)
-    return HashTableSize2(ac.hash_table)+MSize2(acd.word_lst);
-  else
-    return 0;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AutoComplete/ACTask.HC.HTML b/public/Wb/Home/Src/Adam/AutoComplete/ACTask.HC.HTML deleted file mode 100755 index ebe2031..0000000 --- a/public/Wb/Home/Src/Adam/AutoComplete/ACTask.HC.HTML +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - - - - - -
-#help_index "AutoComplete/Dictionary"
-U0 ACDDictWordsAdd(U8 *st)
-{
-  I64 i;
-  U8 *ptr;
-  if (st && *st && (ptr=ACDWordPtAt(st))) {
-    for (i=0;i<ACD_FILLINS_NUM;i++) {
-      if (*ptr++!=ACD_WORD_CHAR)
-        break;
-      if (i) '\n';
-      acd.fillins[i]=ptr-1;
-      "$GREEN$'%d'$FG$ %-23ts",i,ptr;
-      ptr+=StrLen(ptr)+3;
-    }
-    acd.num_fillins=i;
-  }
-}
-
-#help_index "AutoComplete"
-U0 ACDocRst(I64 left,I64 top)
-{
-  CDoc *doc=DocPut;
-  DocRst(doc,TRUE);
-  doc->flags|=DOCF_SIZE_MIN;
-  Fs->border_src=BDS_CONST;
-  Fs->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15;
-  Fs->text_attr  =LTGRAY<<4+BLUE;
-  LBtr(&Fs->display_flags,DISPLAYf_SHOW);
-  WinHorz(left,Fs->win_right);
-  WinVert(top,Fs->win_bottom);
-  DocCursor;
-}
-
-I64 ACSkipCrap(U8 *src,I64 len)
-{
-  I64 j;
-  j=len-1;
-  while (j>=0) {
-    if (Bt(char_bmp_alpha_numeric,src[j]))
-      break;
-    else
-      j--;
-  }
-  return j+1;
-}
-
-I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size)
-{
-  I64 i,j=0,k;
-  i=len-1;
-  while (i>=0)
-    if (!Bt(char_bmp_alpha_numeric,src[i]))
-      break;
-    else
-      i--;
-  if (i>=-1 && len>0)
-    for (k=i+1;k<len && j<buf_size-1;k++)
-      dst[j++]=src[k];
-  dst[j]=0;
-  return i+1;
-}
-
-U0 ACFillInAdd(CHashAC *tmpw)
-{
-  I64 k;
-  if (ac.num_fillins<AC_FILLINS_NUM ||
-        tmpw->hits>ac.fillin_hits[ac.num_fillins-1]) {
-    for (k=ac.num_fillins-1;k>=0;k--) {
-      if (tmpw->hits<=ac.fillin_hits[k])
-        break;
-      else {
-        ac.fillin_matches[k+1]=ac.fillin_matches[k];
-        ac.fillin_hits[k+1]   =ac.fillin_hits[k];
-      }
-    }
-    ac.fillin_matches[k+1]=tmpw;
-    ac.fillin_hits[k+1]   =tmpw->hits;
-    if (ac.num_fillins<AC_FILLINS_NUM)
-      ac.num_fillins++;
-  }
-}
-
-U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
-        Bool force_refresh)
-{
-  I64 i,data_col;
-  U8 *buf,*buf1,*src=NULL,*st;
-  CHashAC *tmpw;
-  F64 timeout_time=tS+0.5;
-  CHashSrcSym *tmph;
-
-  src=DocScanLine(focus_l,doc_e,&data_col);
-  DocUnlock(focus_l);
-  i=StrLen(src);
-  buf =MAlloc(MaxI64(i+1,256));
-  buf1=MAlloc(MaxI64(i+1,256));
-  if (data_col==-1)
-    data_col=0;
-  data_col=ACPriorWordInStr(src,buf,data_col,256);
-  ac.partial_len=StrLen(buf);
-  data_col=ACSkipCrap(src,data_col);
-  data_col=ACPriorWordInStr(src,buf1,data_col,256);
-
-  if (!ac.cur_word || StrCmp(ac.cur_word,buf) || force_refresh) {
-    st=ac.cur_word;
-    ac.cur_word=AStrNew(buf);
-    Free(st);
-    ac.num_fillins=0;
-    if (*ac.cur_word)
-      for (i=0;i<=ac.hash_table->mask && tS<timeout_time;i++) {
-        tmpw=ac.hash_table->body[i];
-        while (tmpw) {
-          if (!MemCmp(ac.cur_word,tmpw->str,StrLen(ac.cur_word)))
-            ACFillInAdd(tmpw);
-          tmpw=tmpw->next;
-        }
-      }
-    ACDocRst(51,13);
-    if (ac.cur_word && *ac.cur_word) {
-      "$PURPLE$Word:%s$FG$\n",ac.cur_word;
-      for (i=0;i<ac.num_fillins;i++) {
-        st=ac.fillin_matches[i]->str;
-        "$GREEN$F%02d$FG$ ",i+1;
-        if (TaskValidate(focus_task) &&
-              (tmph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
-              tmph->src_link) {
-          if (tmph->type&HTF_PUBLIC)
-            "$RED$";
-          "$TX+UL+L+PU,\"%$Q\",A=\"%s\"$$FG$\n",st,tmph->src_link;
-        } else
-          "%s\n",st;
-      }
-      if (acd.has_words)
-        ACDDictWordsAdd(ac.cur_word);
-    } else if (FileFind("::/Doc/StandBy.DD.Z"))
-      Type("::/Doc/StandBy.DD.Z",0);
-  }
-  Free(src);
-  Free(buf);
-  Free(buf1);
-}
-
-U0 ACTaskNormal(I64 sc,I64 last_sc,
-        CTask *focus_task,CTask *original_focus_task)
-{
-  CDoc *doc;
-  CDocEntry *doc_e;
-  if ((doc=DocPut(focus_task)) &&
-        focus_task!=Fs && Bt(&focus_task->display_flags,DISPLAYf_SHOW)) {
-    DocLock(doc);
-    if (TaskValidate(focus_task) && original_focus_task==sys_focus_task &&
-          doc && doc==DocPut(focus_task) && (doc_e=doc->cur_entry)) {
-      if (doc_e==doc) doc_e=doc_e->last;
-      while (doc_e->last!=doc && (doc_e->type_u8==DOCT_NEW_LINE ||
-            doc_e->type_u8==DOCT_SOFT_NEW_LINE))
-        doc_e=doc_e->last;
-      while (doc_e->last->type_u8!=DOCT_NEW_LINE && doc_e->last!=doc)
-        doc_e=doc_e->last;
-      ACPutChoices(doc,doc_e,focus_task,ToBool(sc!=last_sc));
-    } else
-      DocUnlock(doc);
-  }
-  if (!LBts(&Fs->display_flags,DISPLAYf_SHOW))
-    WinZBufUpdate;
-}
-
-U0 ACTaskCtrl(I64 sc,I64 last_sc,
-        CTask *focus_task,CTask *original_focus_task)
-{
-  if (TaskValidate(focus_task) &&
-        (focus_task->scroll_x || focus_task->scroll_y)) {
-    if (LBtr(&Fs->display_flags,DISPLAYf_SHOW))
-      WinZBufUpdate;
-  } else {
-    if (sc!=last_sc) {
-      if (sc&SCF_ALT) {
-        ACDocRst(27,3);
-        if (TaskValidate(original_focus_task) &&
-              !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC))
-          KeyMapFamily(original_focus_task,0,
-                ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT));
-        KeyMapCtrlAltFamily(
-              ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT));
-      } else if (TaskValidate(original_focus_task) &&
-            !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) {
-        ACDocRst(27,3);
-        KeyMapFamily(original_focus_task,SCF_CTRL,
-              ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT));
-      }
-    }
-    if (!LBts(&Fs->display_flags,DISPLAYf_SHOW))
-      WinZBufUpdate;
-  }
-}
-
-U0 ACTaskAlt(I64 sc,I64 last_sc,
-        CTask *,CTask *original_focus_task)
-{
-  if (sc!=last_sc && TaskValidate(original_focus_task) &&
-        !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) {
-    ACDocRst(27,3);
-    KeyMapFamily(original_focus_task,SCF_ALT,
-          ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT));
-  }
-  if (!LBts(&Fs->display_flags,DISPLAYf_SHOW))
-    WinZBufUpdate;
-}
-
-U0 ACTaskEndCB()
-{
-  ac.task=NULL;
-  Exit;
-}
-
-U0 ACTask(I64)
-{
-  CTask *focus_task,*original_focus_task;
-  I64 ch,scan_code=0,last_scan_code=0;
-  CDoc *doc;
-  Fs->task_end_cb=&ACTaskEndCB;
-  DocTermNew;
-  LBts(&Fs->display_flags,DISPLAYf_SHOW);
-  WinHorz(51,Fs->win_right);
-  LBts(&Fs->display_flags,DISPLAYf_WIN_ON_TOP);
-  Fs->win_inhibit=WIG_NO_FOCUS_TASK_DFT;
-  Free(ac.cur_word);
-  ac.cur_word=NULL;
-  while (TRUE) {
-    if (scan_code&(SCF_CTRL|SCF_ALT) ||
-          GetTSC>KbdMsEvtTime+cnts.time_stamp_freq>>1) {
-      last_scan_code=scan_code;
-      scan_code=kbd.scan_code;
-    }
-    original_focus_task=focus_task=sys_focus_task;
-    while (TaskValidate(focus_task) &&
-          Bt(&focus_task->task_flags,TASKf_INPUT_FILTER_TASK))
-      focus_task=focus_task->parent_task;
-    if (scan_code&SCF_CTRL)
-      ACTaskCtrl(scan_code,last_scan_code,focus_task,original_focus_task);
-     else if (TaskValidate(focus_task)) {
-      if (scan_code&SCF_ALT)
-        ACTaskAlt(scan_code,last_scan_code,focus_task,original_focus_task);
-      else
-        ACTaskNormal(scan_code,last_scan_code,focus_task,original_focus_task);
-    }
-    Sleep(333);
-    if (ScanMsg(&ch,,1<<MSG_KEY_DOWN) && (ch==CH_ESC||ch==CH_SHIFT_ESC))
-      break;
-    doc=DocPut;
-    DocLock(doc);
-    if (doc->cur_entry->de_flags & DOCEF_LINK) {
-      '' CH_SPACE;
-      doc->cur_entry=doc;
-    }
-    DocUnlock(doc);
-  }
-}
-
-public Bool AutoComplete(Bool val=OFF)
-{//Turn AutoComplete OFF or ON.
-  Bool  old_val=FALSE;
-  while (Bt(&ac.flags,ACf_INIT_IN_PROGRESS))
-    Sleep(10);
-  if (val) {
-    if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) {
-      if (TaskValidate(ac.task))
-        old_val=TRUE;
-      else {
-        ac.task=Spawn(&ACTask,NULL,"AutoComplete");
-        TaskWait(ac.task);
-      }
-      WinToTop(ac.task);
-    }
-  } else {
-    if (TaskValidate(ac.task)) {
-      if (Bt(&sys_run_level,RLf_AUTO_COMPLETE))
-        old_val=TRUE;
-      Kill(ac.task);
-      DeathWait(&ac.task);
-    }
-  }
-  return old_val;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/AutoComplete/MakeAC.HC.HTML b/public/Wb/Home/Src/Adam/AutoComplete/MakeAC.HC.HTML deleted file mode 100755 index 6f6c714..0000000 --- a/public/Wb/Home/Src/Adam/AutoComplete/MakeAC.HC.HTML +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - -
-//See ::/Doc/AutoComplete.DD
-Cd(__DIR__);;
-#include "ACFill"
-#include "ACTask"
-#include "ACInit"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/CPURep.HC.HTML b/public/Wb/Home/Src/Adam/CPURep.HC.HTML deleted file mode 100755 index 1e54e86..0000000 --- a/public/Wb/Home/Src/Adam/CPURep.HC.HTML +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - -
-#help_index "Info;Time/CPU Cycles;Processor"
-class CCPURep
-{
-  Bool mp_start,mp_end;
-  I64 mp_not_done_flags,
-      **swaps,
-      **cycles;
-};
-
-U0 MPCPURep(CCPURep *cr)
-{
-  I64 swaps=0,cycles_0,cycles_f;
-  while (!cr->mp_start)
-    Yield;
-  cycles_0=GetTSC;
-  while (!cr->mp_end) {
-    swaps++;
-    Yield;
-  }
-  cycles_f=GetTSC;
-  cr->swaps[Gs->num]=swaps;
-  cr->cycles[Gs->num]=cycles_f-cycles_0;
-  LBtr(&cr->mp_not_done_flags,Gs->num);
-}
-
-public U0 CPURep(Bool full=FALSE)
-{//Report number of cores and clock freq.
-  I64 i,total_swaps,total_cycles;
-  F64 t0,tf;
-  CCPURep cr;
-
-  if (!full)
-    "%03X Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
-  else {
-    cr.swaps=CAlloc(sizeof(I64)*mp_cnt);
-    cr.cycles=CAlloc(sizeof(I64)*mp_cnt);
-    cr.mp_start=cr.mp_end=FALSE;
-    cr.mp_not_done_flags=1<<mp_cnt-1;
-    for (i=0;i<mp_cnt;i++)
-      Spawn(&MPCPURep,&cr,NULL,i);
-
-    t0=tS;
-    cr.mp_start=TRUE;
-    Sleep(2000);
-    cr.mp_end=TRUE;
-    while (cr.mp_not_done_flags)
-      Yield;
-    tf=tS;
-
-    "\n%03X Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
-    "\n         Context\n"
-          "CPU     Swaps/s         Cycles\n"
-          "--- ------------- -----------------\n";
-    total_swaps=0;
-    total_cycles=0;
-    for (i=0;i<mp_cnt;i++) {
-      " %02X %13,d %17,d\n",i,
-            ToI64(cr.swaps[i]/(tf-t0)),ToI64(cr.cycles[i]/(tf-t0));
-      total_swaps+=cr.swaps[i];
-      total_cycles+=cr.cycles[i];
-    }
-    "--- ------------- -----------------\n";
-    "%03X %13,d %17,d\n",i,
-          ToI64(total_swaps/(tf-t0)),ToI64(total_cycles/(tf-t0));
-    "Avg %13,d %17,d\n\n",
-          ToI64(total_swaps/(tf-t0)/i),ToI64(total_cycles/(tf-t0)/i);
-    "Avg Cycles/Swap: %12.6f\n",ToF64(total_cycles)/total_swaps;
-    "Avg Time/Swap  : %12.6fns\n\n",(tf-t0)*1000000000.0*i/total_swaps;
-    Free(cr.swaps);
-    Free(cr.cycles);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Ctrls/CtrlsA.HC.HTML b/public/Wb/Home/Src/Adam/Ctrls/CtrlsA.HC.HTML deleted file mode 100755 index df8516c..0000000 --- a/public/Wb/Home/Src/Adam/Ctrls/CtrlsA.HC.HTML +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - - - - - - -
-public CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type)
-{//Find task ctrl given ctrl_type.
-  CCtrl *c;
-  c=haystack_task->next_ctrl;
-  while (c!=&haystack_task->next_ctrl) {
-    if (c->type==needle_type)
-      return c;
-    c=c->next;
-  }
-  return NULL;
-}
-
-U0 CtrlsUpdate(CTask *task)
-{
-  CCtrl *c;
-  c=task->next_ctrl;
-  while (c!=&task->next_ctrl) {
-    if (c->update_derived_vals)
-      (*c->update_derived_vals)(c);
-    if (c->flags&CTRLF_BORDER) {
-      c->scrn_left  =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
-      c->scrn_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH;
-      c->scrn_top   =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT;
-      c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
-    } else {
-      c->scrn_left  =gr.pan_text_x+task->pix_left+c->left;
-      c->scrn_right =gr.pan_text_x+task->pix_left+c->right;
-      c->scrn_top   =gr.pan_text_y+task->pix_top+c->top;
-      c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom;
-    }
-    c=c->next;
-  }
-}
-
-fp_update_ctrls=&CtrlsUpdate;
-
-Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y)
-{//scrn coordinates
-  if (c->scrn_left<=x<=c->scrn_right &&
-        c->scrn_top<=y<=c->scrn_bottom)
-    return TRUE;
-  else
-    return FALSE;
-}
-
-public Bool CtrlInside(CCtrl *c,I64 x,I64 y)
-{//Is x,y inside a ctrl?
-  if (c->flags&CTRLF_SHOW) {
-    if (c->inside_ctrl)
-      return (*c->inside_ctrl)(c,x,y);
-    else
-      return CtrlInsideRect(c,x,y);
-  } else
-    return FALSE;
-}
-
-U0 DrawCtrls(CTask *task)
-{
-  CCtrl *c;
-  CDC *dc=DCAlias(gr.dc2,task);
-  c=task->next_ctrl;
-  while (c!=&task->next_ctrl) {
-    if (c->flags&CTRLF_SHOW) {
-      if (c->flags&CTRLF_BORDER) {
-        if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) {
-          PUSHFD
-          CLI
-          while (LBts(&task->task_flags,TASKf_TASK_LOCK))
-            PAUSE
-
-          task->win_left--; //Allow drawing on border
-          task->win_right++;
-          task->win_top--;
-          task->win_bottom++;
-          WinDerivedValsUpdate(task);
-
-          LBtr(&task->task_flags,TASKf_TASK_LOCK);
-          POPFD
-
-          if (c->draw_it)
-            (*c->draw_it)(dc,c);
-
-          PUSHFD
-          CLI
-          while (LBts(&task->task_flags,TASKf_TASK_LOCK))
-            PAUSE
-
-          task->win_left++;
-          task->win_right--;
-          task->win_top++;
-          task->win_bottom--;
-          WinDerivedValsUpdate(task);
-
-          LBtr(&task->task_flags,TASKf_TASK_LOCK);
-          POPFD
-        }
-      } else
-        if (c->draw_it)
-          (*c->draw_it)(dc,c);
-    }
-    c=c->next;
-  }
-  DCDel(dc);
-}
-
-#define WIN_SCROLL_SIZE         8
-#define WIN_SCROLL_BORDER_BONUS 4
-U0 DrawWinScroll(CDC *dc,CCtrl *c)
-{
-  CWinScroll *s=c->state;
-
-  if (c->flags&CTRLF_CLICKED)
-    dc->color=s->color>>4;
-  else
-    dc->color=s->color&0xF;
-  GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1);
-
-  if (c->flags&CTRLF_CLICKED)
-    dc->color=s->color&0xF;
-  else
-    dc->color=s->color>>4;
-  GrRect(dc,c->left+2,c->top+2,c->right-c->left+1-4,c->bottom-c->top+1-4);
-}
-
-U0 WinDerivedScrollValsUpdate(CCtrl *c)
-{
-  CWinScroll *s=c->state;
-  I64 range;
-  if (s->max<s->min) s->max=s->min;
-  if (s->pos<s->min) s->pos=s->min;
-  if (s->pos>s->max) s->pos=s->max;
-  s->color=c->win_task->border_attr&0xF^0xF+
-        (c->win_task->border_attr&0xF)<<4;
-  range=s->max-s->min;
-  if (!range) range=1;
-  switch (c->type) {
-    case CTRLT_WIN_HSCROLL:
-      c->left  =gr.pan_text_x+FONT_WIDTH-WIN_SCROLL_BORDER_BONUS+
-            (s->pos-s->min)*(c->win_task->pix_width+2*WIN_SCROLL_BORDER_BONUS
-            -WIN_SCROLL_SIZE)/range;
-      c->right =c->left+WIN_SCROLL_SIZE-1;
-      c->top   =gr.pan_text_y+FONT_HEIGHT+
-            (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_height;
-      c->bottom=c->top+WIN_SCROLL_SIZE-1;
-      break;
-    case CTRLT_WIN_VSCROLL:
-      c->left  =gr.pan_text_x+FONT_WIDTH+
-            (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_width;
-      c->right =c->left+WIN_SCROLL_SIZE-1;
-      c->top   =gr.pan_text_y+FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS+
-            (s->pos-s->min)*(c->win_task->pix_height+
-            2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE)/range;
-      c->bottom=c->top+WIN_SCROLL_SIZE-1;
-      break;
-  }
-}
-
-U0 LeftClickHWinScroll(CCtrl *c,I64 x,I64,Bool down)
-{
-  CTask *task=c->win_task;
-  CWinScroll *s=c->state;
-  I64 range=task->pix_width+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE;
-  LBts(&s->flags,WSSf_SET_TO_POS);
-  s->pos=((x-(FONT_WIDTH-WIN_SCROLL_BORDER_BONUS))
-  *(s->max-s->min+1)+range/2)/range+s->min;
-  if (down)
-    c->flags|=CTRLF_CLICKED;
-  else
-    c->flags&=~CTRLF_CLICKED;
-  if (c->update_derived_vals)
-    (*c->update_derived_vals)(c);
-}
-
-U0 LeftClickVWinScroll(CCtrl *c,I64,I64 y,Bool down)
-{
-  CTask *task=c->win_task;
-  CWinScroll *s=c->state;
-  I64 range=task->pix_height+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE;
-  LBts(&s->flags,WSSf_SET_TO_POS);
-  s->pos=((y-(FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS))
-  *(s->max-s->min+1)+range/2)/range+s->min;
-  if (down)
-    c->flags|=CTRLF_CLICKED;
-  else
-    c->flags&=~CTRLF_CLICKED;
-  if (c->update_derived_vals)
-    (*c->update_derived_vals)(c);
-}
-
-U0 WheelChangeWinScroll(CCtrl *c,I64 delta)
-{
-  CWinScroll *s=c->state;
-  LBts(&s->flags,WSSf_SET_TO_POS);
-  s->pos+=delta;
-  if (c->update_derived_vals)
-    (*c->update_derived_vals)(c);
-}
-
-U0 WinScrollsInit(CTask *task)
-{
-  CCtrl *c;
-
-  if (!CtrlFindUnique(task,CTRLT_WIN_HSCROLL)) {
-    c=CAlloc(sizeof(CCtrl));
-    c->win_task=task;
-    c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_MS;
-    c->type=CTRLT_WIN_HSCROLL;
-    c->state=&task->horz_scroll;
-    c->update_derived_vals=&WinDerivedScrollValsUpdate;
-    c->draw_it=&DrawWinScroll;
-    c->left_click=&LeftClickHWinScroll;
-    QueIns(c,task->last_ctrl);
-  }
-
-  if (!CtrlFindUnique(task,CTRLT_WIN_VSCROLL)) {
-    c=CAlloc(sizeof(CCtrl));
-    c->win_task=task;
-    c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_MS;
-    c->type=CTRLT_WIN_VSCROLL;
-    c->state=&task->vert_scroll;
-    c->update_derived_vals=&WinDerivedScrollValsUpdate;
-    c->draw_it=&DrawWinScroll;
-    c->left_click=&LeftClickVWinScroll;
-    c->wheel_chg=&WheelChangeWinScroll;
-    QueIns(c,task->last_ctrl);
-  }
-  TaskDerivedValsUpdate(task);
-}
-#define VIEWANGLES_SPACING      22
-#define VIEWANGLES_RANGE        48
-#define VIEWANGLES_BORDER       2
-#define VIEWANGLES_SNAP         2
-
-U0 DrawViewAnglesCtrl(CDC *dc,CCtrl *c)
-{
-  I64 i,j;
-  CViewAngles *s=c->state;
-
-  dc->color=s->cbd;
-  GrRect(dc, c->left,c->top,VIEWANGLES_SPACING*4+3,
-        VIEWANGLES_SPACING*2+VIEWANGLES_RANGE);
-  dc->color=s->cbg;
-  GrRect(dc, c->left+VIEWANGLES_BORDER,c->top+VIEWANGLES_BORDER,
-        VIEWANGLES_SPACING*4+3-2*VIEWANGLES_BORDER,
-        VIEWANGLES_SPACING*2+VIEWANGLES_RANGE-2*VIEWANGLES_BORDER);
-  dc->color=s->cfg;
-  GrLine(dc,c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING,
-        c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING+
-        VIEWANGLES_RANGE-1);
-  GrLine(dc,c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING,
-        c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING+
-        VIEWANGLES_RANGE-1);
-  GrLine(dc,c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING,
-        c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING+
-        VIEWANGLES_RANGE-1);
-  for (i=1;i<VIEWANGLES_RANGE+1;i+=2*VIEWANGLES_SNAP) {
-    j=2-i/3&1;
-    GrLine(dc,c->left+VIEWANGLES_SPACING-j,c->bottom-VIEWANGLES_SPACING-i,
-          c->left+VIEWANGLES_SPACING+j,c->bottom
-          -VIEWANGLES_SPACING-i);
-    GrLine(dc,c->left+2*VIEWANGLES_SPACING+1-j,c->bottom-VIEWANGLES_SPACING-i,
-          c->left+2*VIEWANGLES_SPACING+1+j,c->bottom
-          -VIEWANGLES_SPACING-i);
-    GrLine(dc,c->left+3*VIEWANGLES_SPACING+2-j,c->bottom-VIEWANGLES_SPACING-i,
-          c->left+3*VIEWANGLES_SPACING+2+j,c->bottom
-          -VIEWANGLES_SPACING-i);
-  }
-
-  dc->color=s->cx;
-  GrPrint(dc,c->left+VIEWANGLES_SPACING-FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"X");
-  GrPrint(dc,c->left+VIEWANGLES_SPACING-3*FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3,
-        "%3d",s->sx*360/VIEWANGLES_RANGE);
-  i=c->left+VIEWANGLES_SPACING;
-  if (s->sx>VIEWANGLES_RANGE/2)
-    j=-VIEWANGLES_RANGE/2+s->sx;
-  else
-    j=s->sx+VIEWANGLES_RANGE/2;
-  j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j;
-  GrRect(dc,i-3,j-2,7,5);
-  dc->color=s->cx^8;
-  GrRect(dc,i-2,j-1,5,3);
-
-  dc->color=s->cy;
-  GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Y");
-  GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-3*FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3,
-        "%3d",s->sy*360/VIEWANGLES_RANGE);
-  i=c->left+2*VIEWANGLES_SPACING+1;
-  if (s->sy>VIEWANGLES_RANGE/2)
-    j=-VIEWANGLES_RANGE/2+s->sy;
-  else
-    j=s->sy+VIEWANGLES_RANGE/2;
-  j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j;
-  GrRect(dc,i-3,j-2,7,5);
-  dc->color=s->cy^8;
-  GrRect(dc,i-2,j-1,5,3);
-
-  dc->color=s->cz;
-  GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Z");
-  GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-3*FONT_WIDTH/2,
-        c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3,
-        "%3d",s->sz*360/VIEWANGLES_RANGE);
-  i=c->left+3*VIEWANGLES_SPACING+2;
-  if (s->sz>VIEWANGLES_RANGE/2)
-    j=-VIEWANGLES_RANGE/2+s->sz;
-  else
-    j=s->sz+VIEWANGLES_RANGE/2;
-  j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j;
-  GrRect(dc,i-3,j-2,7,5);
-  dc->color=s->cz^8;
-  GrRect(dc,i-2,j-1,5,3);
-}
-
-U0 UpdateDerivedViewAnglesCtrl(CCtrl *c)
-{
-  CViewAngles *s=c->state;
-  c->left=c->win_task->pix_width-(VIEWANGLES_SPACING*4+3);
-  c->right=c->left+VIEWANGLES_SPACING*4+3;
-  c->top=c->win_task->pix_height-(VIEWANGLES_SPACING*2+VIEWANGLES_RANGE);
-  c->bottom=c->top+VIEWANGLES_SPACING*2+VIEWANGLES_RANGE;
-  s->sx=ClampI64(RoundI64(s->sx,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1);
-  s->sy=ClampI64(RoundI64(s->sy,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1);
-  s->sz=ClampI64(RoundI64(s->sz,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1);
-  s->ax=2*pi*s->sx/VIEWANGLES_RANGE;
-  s->ay=2*pi*s->sy/VIEWANGLES_RANGE;
-  s->az=2*pi*s->sz/VIEWANGLES_RANGE;
-}
-
-U0 LeftClickViewAngles(CCtrl *c,I64 x,I64 y,Bool)
-{
-  CViewAngles *s=c->state;
-  I64 i;
-  i=VIEWANGLES_RANGE-1-(y-(c->top+VIEWANGLES_SPACING));
-  if (i>=VIEWANGLES_RANGE/2)
-    i-=VIEWANGLES_RANGE/2;
-  else
-    i+=VIEWANGLES_RANGE/2;
-  if (x<c->left+(c->right-c->left)/3)
-    s->sx=i;
-  else if (x<c->left+2*(c->right-c->left)/3)
-    s->sy=i;
-  else
-    s->sz=i;
-  if (c->update_derived_vals)
-    (*c->update_derived_vals)(c);
-}
-
-public CCtrl *ViewAnglesNew(CTask *task=NULL)
-{//Create view angle ctrl. See ::/Demo/Graphics/Shading.HC.
-  CCtrl *c;
-  CViewAngles *s;
-  if (!task) task=Fs;
-  if (!(c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES))) {
-    s=CAlloc(sizeof(CViewAngles),task);
-    c=CAlloc(sizeof(CCtrl));
-    s->cbd=BLUE;
-    s->cbg=LTBLUE;
-    s->cfg=BLACK;
-    s->cx=LTGREEN;
-    s->cy=GREEN;
-    s->cz=LTGREEN;
-    c->win_task=task;
-    c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
-    c->type=CTRLT_VIEWING_ANGLES;
-    c->state=s;
-    c->draw_it=&DrawViewAnglesCtrl;
-    c->left_click=&LeftClickViewAngles;
-    c->update_derived_vals=&UpdateDerivedViewAnglesCtrl;
-    QueIns(c,task->last_ctrl);
-    TaskDerivedValsUpdate(task);
-  }
-  return c;
-}
-
-public U0 ViewAnglesDel(CTask *task=NULL)
-{//Free view angle ctrl.
-  CCtrl *c;
-  if (!task) task=Fs;
-  if (c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES)) {
-    QueRem(c);
-    Free(c->state);
-    Free(c);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Ctrls/CtrlsBttn.HC.HTML b/public/Wb/Home/Src/Adam/Ctrls/CtrlsBttn.HC.HTML deleted file mode 100755 index dff6898..0000000 --- a/public/Wb/Home/Src/Adam/Ctrls/CtrlsBttn.HC.HTML +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - -
-#define BTTN_BORDER     2
-
-#define BTF_DONT_FREE   1
-
-class CCtrlBttnState
-{
-  I64 state,num_states,flags;
-  U8 *state_texts;
-  CColorROPU32 *state_colors;
-};
-
-U0 DrawCtrlBttn(CDC *dc,CCtrl *c)
-{
-  CCtrlBttnState *s=c->state;
-  I64 l;
-  U8 *st;
-
-  dc->color=BLACK;
-  GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1);
-  if (!(st=LstSub(s->state,s->state_texts)))
-    st=s->state_texts;
-  dc->color=s->state_colors[s->state];
-  l=StrLen(st);
-  GrRect(dc,c->left+BTTN_BORDER,c->top+BTTN_BORDER,
-        c->right-c->left+1-BTTN_BORDER*2,
-        c->bottom-c->top+1-BTTN_BORDER*2);
-  dc->color=s->state_colors[s->state]^(WHITE<<16+WHITE);
-  GrPrint(dc,(c->left+c->right+1-l*FONT_WIDTH)>>1,
-        (c->top+c->bottom+1-FONT_HEIGHT)>>1,"%s",st);
-}
-
-U0 LeftClickCtrlBttn(CCtrl *c,I64,I64,Bool down)
-{
-  CCtrlBttnState *s=c->state;
-  if (down) {
-    s->state++;
-    if (s->state==s->num_states)
-      s->state=0;
-  }
-}
-
-public CCtrl *CtrlBttnNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
-        I64 num_states=1,U8 *state_texts,
-        I32 *state_colors,CCtrlBttnState *_s=NULL)
-{//Create bttn ctrl. See ::/Apps/Strut/Strut.HC.
-  CCtrl *res;
-  CCtrlBttnState *s;
-  I64 i,j,l;
-  U8 *st;
-  if (width<0) {
-    l=1;
-    for (i=0;i<num_states;i++)
-      if (st=LstSub(i,state_texts)) {
-        j=StrLen(st);
-        if (j>l) l=j;
-      }
-    width=BTTN_BORDER*4+l*FONT_WIDTH;
-  }
-  if (height<0) height=BTTN_BORDER*4+FONT_HEIGHT;
-  res=CAlloc(sizeof(CCtrl));
-  if (_s) {
-    s=_s;
-    MemSet(s,0,sizeof(CCtrlBttnState));
-  } else {
-    s=CAlloc(sizeof(CCtrlBttnState));
-    s->flags=BTF_DONT_FREE;
-  }
-  s->num_states=num_states;
-  s->state_texts=state_texts;
-  s->state_colors=state_colors;
-  res->win_task=Fs;
-  res->flags=CTRLF_SHOW;
-  res->type=CTRLT_GENERIC;
-  res->state=s;
-  res->draw_it=&DrawCtrlBttn;
-  res->left_click=&LeftClickCtrlBttn;
-  res->left=x;
-  res->top=y;
-  res->right=res->left+width-1;
-  res->bottom=res->top+height-1;
-  QueIns(res,Fs->last_ctrl);
-  return res;
-}
-
-public U0 CtrlBttnDel(CCtrl *c)
-{//Free bttn ctrl.
-  QueRem(c);
-  if (!(c->flags&BTF_DONT_FREE))
-    Free(c->state);
-  Free(c);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Ctrls/CtrlsSlider.HC.HTML b/public/Wb/Home/Src/Adam/Ctrls/CtrlsSlider.HC.HTML deleted file mode 100755 index 22cad56..0000000 --- a/public/Wb/Home/Src/Adam/Ctrls/CtrlsSlider.HC.HTML +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - -
-class CTemplateCSSlider
-{
-  CTemplateCSSlider *next,*last;
-  U8 *name;
-  I64 num;
-};
-
-class CTemplateCS
-{
-  CTemplateCSSlider *next_slider,*last_slider;
-  I64 num_sliders,range,spacing,border;
-  U8 *glbl_name;
-};
-
-CTemplateCS *CtrlSliderGet()
-{
-  CTemplateCSSlider *tmps;
-  U8 *st,pmt[STR_LEN];
-  CTemplateCS *res=CAlloc(sizeof(CTemplateCS));
-
-  "$PURPLE$Ctrl Slider$FG$\n\n";
-
-  res->glbl_name=GetStr("Glbl Struct Name (ENTER for No Glbl):");
-  res->range=GetI64     ("Range   (%4d):",30);
-  res->spacing=GetI64("Spacing (%4d):",20);
-  res->border=GetI64 ("Border  (%4d):",2);
-
-  res->next_slider=res->last_slider=&res->next_slider;
-  while (TRUE) {
-    StrPrint(pmt,"Slider #%d Name:",res->num_sliders+1);
-    st=GetStr(pmt);
-    if (!*st) {
-      Free(st);
-      break;
-    }
-    tmps=CAlloc(sizeof(CTemplateCSSlider));
-    tmps->name=st;
-    QueIns(tmps,res->last_slider);
-    tmps->num=res->num_sliders++;
-  }
-  return res;
-}
-
-U0 TemplateCtrlSlider(CDoc *doc)
-{
-  CTask *task;
-  CTemplateCS *m=NULL;
-  CTemplateCSSlider *tmps;
-  I64 i;
-
-  DocUnlock(doc);
-  DocRecalc(doc);
-  DocCaptureUndo(doc,TRUE);
-
-  task=User("CTemplateCS **_m=0x%X;*_m=CtrlSliderGet;\n",&m);
-  while (!m)
-    Yield;
-
-  DocPrint(doc,
-"#define SLIDER_RANGE\t%d
-#define SLIDER_SPACING\t%d
-#define SLIDER_BORDER\t%d
-
-class CSliderState
-{
-",m->range,m->spacing,m->border);
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,"  I64 %s;\n",tmps->name);
-    tmps=tmps->next;
-  }
-  if (*m->glbl_name)
-    DocPrint(doc,"} %s;\n",m->glbl_name);
-  else
-    DocPrint(doc,"};\n");
-
-  DocPrint(doc,
-"
-U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
-{
-  CSliderState *s=c->state;
-
-  dc->color=LTRED;
-  GrRect(dc, c->left,c->top,%d*SLIDER_SPACING+%d,SLIDER_SPACING*2+SLIDER_RANGE);
-  dc->color=BLUE;
-  GrRect(dc, c->left+SLIDER_BORDER,c->top+SLIDER_BORDER,
-    %d*SLIDER_SPACING+%d-2*SLIDER_BORDER,SLIDER_SPACING*2
-    +SLIDER_RANGE-2*SLIDER_BORDER);
-  dc->color=BLACK;
-",m->num_sliders+1,m->num_sliders,m->num_sliders+1,m->num_sliders);
-
-  for (i=0;i<m->num_sliders;i++)
-    DocPrint(doc,
-"  GrLine(dc,c->left+%d*SLIDER_SPACING+%d,c->top+SLIDER_SPACING,
-             c->left+%d*SLIDER_SPACING+%d,c->top+SLIDER_SPACING+SLIDER_RANGE-1);
-",i+1,i,i+1,i);
-
-  DocPrint(doc,"  dc->color=LTRED;\n");
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,
-"  GrPrint(dc,c->left+%d*SLIDER_SPACING+%d-FONT_WIDTH/2,
-    c->top+SLIDER_SPACING+SLIDER_RANGE+3,
-    \"%%d\",s->%s*10/SLIDER_RANGE);\n",
-      tmps->num+1,tmps->num,tmps->name);
-    tmps=tmps->next;
-  }
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,
-        "  GrRect(dc,c->left+%d*SLIDER_SPACING+%d-3,"
-        "c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-2,7,5);\n",
-      tmps->num+1,tmps->num,tmps->name);
-    tmps=tmps->next;
-  }
-  DocPrint(doc,"  dc->color=YELLOW;\n");
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,"  GrRect(dc,c->left+%d*SLIDER_SPACING+%d-2,"
-        "c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-1,5,3);\n",
-      tmps->num+1,tmps->num,tmps->name);
-    tmps=tmps->next;
-  }
-  DocPrint(doc,
-"}
-
-U0 UpdateDerivedCtrlSlider(CCtrl *c)
-{
-  CSliderState *s=c->state;
-  c->left=c->win_task->pix_width/2-(SLIDER_SPACING*3+2)/2;
-  c->right=c->left+%d*SLIDER_SPACING+%d;
-  c->top=c->win_task->pix_height/2-(SLIDER_SPACING*2+SLIDER_RANGE)/2;
-  c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE;
-",m->num_sliders+1,m->num_sliders);
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,"  s->%s=ClampI64(s->%s,0,SLIDER_RANGE-1);\n",
-        tmps->name,tmps->name);
-    tmps=tmps->next;
-  }
-  DocPrint(doc,
-"}
-
-U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool down)
-{
-  no_warn down;
-  CSliderState *s=c->state;
-");
-
-  tmps=m->next_slider;
-  while (tmps!=&m->next_slider) {
-    DocPrint(doc,"  ");
-    if (tmps!=m->next_slider)
-      DocPrint(doc,"else ");
-    if (tmps->next==&m->next_slider)
-      DocPrint(doc,"\n");
-    else
-      DocPrint(doc,"if (x<c->left+%d*SLIDER_SPACING+%d+SLIDER_SPACING/2)\n",
-        tmps->num+1,tmps->num);
-    DocPrint(doc,"    s->%s=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING));\n",
-       tmps->name);
-    tmps=tmps->next;
-  }
- 
-  DocPrint(doc,
-"  if (c->update_derived_vals)
-    (*c->update_derived_vals)(c);
-}
-
-CCtrl *SliderNew()
-{
-  CCtrl *c=CAlloc(sizeof(CCtrl));
-  c->win_task=Fs;
-  c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
-  c->type=CTRLT_GENERIC;
-");
-  if (*m->glbl_name)
-    DocPrint(doc,"  c->state=&%s;\n"
-        "  MemSet(&%s,0,sizeof(CSliderState));\n",m->glbl_name,m->glbl_name);
-  else
-    DocPrint(doc,       "  c->state=CAlloc(sizeof(CSliderState));\n");
-  DocPrint(doc,
-"  c->draw_it=&DrawCtrlSlider;
-  c->left_click=&LeftClickSlider;
-  c->update_derived_vals=&UpdateDerivedCtrlSlider;
-  QueIns(c,Fs->last_ctrl);
-  TaskDerivedValsUpdate;
-  return c;
-}
-
-U0 SliderDel(CCtrl *c)
-{
-  QueRem(c);
-");
-  if (!*m->glbl_name)
-    DocPrint(doc,"  Free(c->state);\n");
-  DocPrint(doc,
-"  Free(c);
-}
-");
-
-  Kill(task);  //This frees memory.
-
-  RegOneTimePopUp(ARf_MANAGE_SLIDER,
-    "Modify the code to your heart's content.\n"
-    "The code is no longer managed.\n");
-
-  DocLock(doc);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Ctrls/MakeCtrls.HC.HTML b/public/Wb/Home/Src/Adam/Ctrls/MakeCtrls.HC.HTML deleted file mode 100755 index 128aaf8..0000000 --- a/public/Wb/Home/Src/Adam/Ctrls/MakeCtrls.HC.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-
-#help_index "Ctrls"
-#help_file "::/Doc/Ctrls"
-#include "CtrlsA"
-#include "CtrlsBttn"
-#include "CtrlsSlider"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/DevInfo.HC.HTML b/public/Wb/Home/Src/Adam/DevInfo.HC.HTML deleted file mode 100755 index 1b99a40..0000000 --- a/public/Wb/Home/Src/Adam/DevInfo.HC.HTML +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - - - - - - -
-#help_index "PCI;Processor;Devices;Info"
-
-//The file was downloaded from
-//http://www.pcidatabase.com/reports.php?type=tab-delimeted
-
-#define PCI_DEV_FILE "::/Misc/PCIDevices.DD.Z"
-
-/****
-//1) Download http://www.pcidatabase.com/reports.php?type=tab-delimeted
-//2) Rename to ::/Misc/PCIDevices.DD.Z
-//3) ToDolDoc("::/Misc/PCIDevices.DD.Z");
-//4) Edit and remove file header and tail
-//5) Text find-and-replace "=0A=" with "". (Doesn't seem necessary anmore.)
-//6) Run PCIDevFileGen(). (Doesn't seem necessary anmore.)
-
-public U0 PCIDevFileGen()
-{
-  Bool first=TRUE,del=FALSE,del2=FALSE,cont=FALSE;
-  CDoc *doc=DocRead(PCI_DEV_FILE,
-        DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR);
-  CDocEntry *doc_e=doc->head.next,*doc_e2;
-  while (doc_e!=doc) {
-    doc_e2=doc_e->next;
-    if (first) {
-      if (doc_e->type_u8==DOCT_TEXT) {
-        if (doc_e->tag[0]==';')
-          del=TRUE;
-      }
-      first=FALSE;
-    }
-    if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[StrLen(doc_e->tag)-1]=='=' &&
-          doc_e2->type_u8==DOCT_NEW_LINE) {
-      doc_e->tag[StrLen(doc_e->tag)-1]=CH_SPACE;
-      cont=TRUE;
-    }
-    del2=del;
-    if (doc_e->type_u8==DOCT_NEW_LINE) {
-      first=TRUE;
-      del2=FALSE;
-      if (cont) {
-        del=TRUE;
-        cont=FALSE;
-      }
-    }
-    if (del)
-      DocEntryDel(doc,doc_e);
-    del=del2;
-    doc_e=doc_e2;
-  }
-  DocWrite(doc);
-}
-****/
-
-//::/Misc/PCIDevices.DD
-U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev)
-{
-  Bool first=TRUE;
-  U8 buf[8],*vendor=NULL,*dev=NULL;
-  CDocEntry *doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (first) {
-      if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[0]!=';' &&
-            StrLen(doc_e->tag)>=4) {
-        buf[0](U16)='0x';
-        buf[2](U32)=doc_e->tag(U32 *)[0];
-        buf[6]=0;
-        if (Str2I64(buf)==m) {
-          doc_e=doc_e->next->next;
-          if (doc_e->type_u8==DOCT_TEXT) {
-            vendor=AStrNew(doc_e->tag);
-            first=FALSE;
-            break;
-          }
-        }
-      }
-      first=FALSE;
-    }
-    if (doc_e->type_u8==DOCT_NEW_LINE)
-      first=TRUE;
-    doc_e=doc_e->next;
-  }
-
-  if (vendor) {
-    while (doc_e!=doc) {
-      if (first) {
-        if (doc_e->type_u8==DOCT_TAB) {
-          doc_e=doc_e->next;
-          if (doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=4) {
-            buf[0](U16)='0x';
-            buf[2](U32)=doc_e->tag(U32 *)[0];
-            buf[6]=0;
-            if (Str2I64(buf)==d) {
-              doc_e=doc_e->next->next;
-              if (doc_e->type_u8==DOCT_TEXT) {
-                dev=AStrNew(doc_e->tag);
-                break;
-              }
-            }
-          }
-        } else
-          break;
-        first=FALSE;
-      }
-      if (doc_e->type_u8==DOCT_NEW_LINE)
-        first=TRUE;
-      doc_e=doc_e->next;
-    }
-  }
-
-  if (vendor)
-    *_vendor=vendor;
-  else
-    *_vendor=AStrNew("Unknown");
-
-  if (dev)
-    *_dev=dev;
-  else
-    *_dev=AStrNew("Unknown");
-}
-
-U0 PCILookUpDevs()
-{
-  CPCIDev *tmppci;
-  I64 w1,w2,b,d,f,timeout=32*8*2;
-  CDoc *doc;
-  if (dev.pci_head.next!=&dev.pci_head)
-    return;
-  doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
-  for (b=0;b<sys_pci_busses;b++)
-    for (d=0;d<32;d++)
-      for (f=0;f<8;f++) {
-        w1=PCIReadU16(b,d,f,0);
-        if (w1!=0xFFFF) {
-          tmppci=ACAlloc(sizeof(CPCIDev));
-          tmppci->bus=b;
-          tmppci->dev=d;
-          tmppci->fun=f;
-          tmppci->vendor=w1;
-          tmppci->dev_id=w2=PCIReadU16(b,d,f,2);
-          tmppci->sub_code=PCIReadU8(b,d,f,0xA);
-          tmppci->base_code=PCIReadU8(b,d,f,0xB);
-          PCILookUpSingle(doc,w1,w2,&tmppci->vendor_str,&tmppci->dev_id_str);
-          QueIns(tmppci,dev.pci_head.last);
-          timeout=32*8*2;
-        } else if (sys_pci_busses==256 && --timeout<=0)
-          goto lud_done;
-      }
-lud_done:
-  DocDel(doc);
-}
-
-public U0 PCIRep()
-{//Report description of PCI devices.
-  CPCIDev *tmppci;
-  "PCI Busses:%d\n",sys_pci_busses;
-  if (!FileFind(PCI_DEV_FILE)) {
-    "You don't have the PCI device file.\n";
-    return;
-  }
-  PCILookUpDevs;
-  tmppci=dev.pci_head.next;
-  while (tmppci!=&dev.pci_head) {
-    "%02X:%02X:%01X %02X%02X $GREEN$%s $CYAN$%s$FG$\n",
-          tmppci->bus,tmppci->dev,tmppci->fun,
-          tmppci->base_code,tmppci->sub_code,
-          tmppci->vendor_str,tmppci->dev_id_str;
-    tmppci=tmppci->next;
-  }
-}
-
-#help_index "Info;Memory/Info"
-public U0 MemBIOSRep()
-{//Report the memory ranges reported by the BIOS at boot.
-  U16           *m01=MEM_E801;
-  CMemE820      *m20=MEM_E820;
-  CMemRange     *tmpmr;
-  "Standard Addresses\n"
-        "000A0000-000BFFFF VGA\n"
-        "FEE00000-FEE00FFF See $LK,\"APIC\",A=\"MN:LAPIC_BASE\"$\n\n"
-        "32 Bit Device Mem\n";
-  while (LBts(&sys_semas[SEMA_DEV_MEM],0))
-    Yield;
-  tmpmr=dev.mem32_head.next;
-  while (tmpmr!=&dev.mem32_head) {
-    "%02X:%016X-%016X\n",
-          tmpmr->type,tmpmr->base,tmpmr->base+tmpmr->size-1;
-    tmpmr=tmpmr->next;
-  }
-  LBtr(&sys_semas[SEMA_DEV_MEM],0);
-
-  "\nBIOS Memory Report 15:E801\n"
-        "01:0000000000000000-%016X\n",0x100000+m01[0]<<10-1;
-  "01:0000000001000000-%016X\n",SYS_16MEG_AREA_LIMIT+m01[1]<<16-1;
-
-  if (m20->type) {
-    '\n';
-    "BIOS Memory Report 15:E820\n";
-    while (m20->type) {
-      "%02X:%016X-%016X\n",m20->type,m20->base,m20->base+m20->len-1;
-      m20++;
-    }
-  }
-}
-
-public U0 MemPageRep()
-{//Page Table Report.
-  "MAPPED\t  :%010X with ",mem_mapped_space;
-  if (Bt(&mem_page_size,30))
-    "$RED$1GIG$FG$ pages\n";
-  else
-    "$RED$2MEG$FG$ pages\n";
-  "PML2\t  :%010X 2MEG  :%08X\n",
-        *MEM_PML2(U64 *),*MEM_2MEG_NUM(U64 *);
-  "PML3\t  :%010X 1GIG  :%08X\n",
-        *MEM_PML3(U64 *),*MEM_1GIG_NUM(U64 *);
-  "PML4\t  :%010X 512GIG:%08X\n",
-        *MEM_PML4(U64 *),*MEM_512GIG_NUM(U64 *);
-  "FIXED_AREA:%010X\n",SYS_FIXED_AREA;
-  "HEAP_BASE :%010X\nHEAP_LIMIT:%010X\n",mem_heap_base,mem_heap_limit;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocBin.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocBin.HC.HTML deleted file mode 100755 index dccf733..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocBin.HC.HTML +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Bin"
-
-CDocBin *DocBinFindNum(CDoc *haystack_doc,I64 needle_num)
-{
-  CDocBin *b=haystack_doc->bin_head.next;
-  while (b!=&haystack_doc->bin_head) {
-    if (b->num==needle_num)
-      return b;
-    b=b->next;
-  }
-  return NULL;
-}
-
-CDocBin *DocBinFindTag(CDoc *haystack_doc,U8 *needle_tag)
-{
-  CDocBin *b;
-  if (needle_tag) {
-    b=haystack_doc->bin_head.next;
-    while (b!=&haystack_doc->bin_head) {
-      if (b->tag && !StrCmp(b->tag,needle_tag))
-        return b;
-      b=b->next;
-    }
-  }
-  return NULL;
-}
-
-U0 DocBinsValidate(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  CDocBin *b,*b1;
-  CDocEntry *doc_e,*doc_e2;
-  I64 renum_num=0;
-  b=doc->bin_head.next;
-  while (b!=&doc->bin_head) {
-    b->use_cnt=0;
-    b->tmp_use_cnt=0;
-    b->renum_num=-1;
-    Free(b->tag);
-    b->tag=NULL;
-    b=b->next;
-  }
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    doc_e2=doc_e->next;
-    if (doc_e->de_flags & DOCEF_HAS_BIN) {
-      if (b=doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num)) {
-        if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
-          b->tmp_use_cnt=I32_MAX;
-        if (!b->use_cnt++)
-          b->renum_num=++renum_num;
-        doc_e->bin_num=b->renum_num;
-        if (!b->tag && doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
-          b->tag=StrNew(doc_e->tag,doc->mem_task);
-      } else {
-        RawPrint(3000,"Bin Not Found");
-        doc_e->type=doc_e->de_flags=0;
-        doc_e->type_u8=DOCT_ERROR;
-      }
-    }
-    doc_e=doc_e2;
-  }
-
-  b=doc->bin_head.next;
-  doc->cur_bin_num=1;
-  while (b!=&doc->bin_head) {
-    b1=b->next;
-    if (!b->use_cnt) {
-      QueRem(b);
-      Free(b->data);
-      Free(b);
-    } else {
-      b->num=b->renum_num;
-      if (b->num>=doc->cur_bin_num)
-        doc->cur_bin_num=b->num+1;
-    }
-    b=b1;
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 DocBinDel(CDoc *doc,CDocBin *b)
-{
-  if (doc && b && b->use_cnt) {
-    b->use_cnt--;
-    if (!b->use_cnt) {
-      QueRem(b);
-      Free(b->tag);
-      Free(b->data);
-      Free(b);
-    }
-  } else
-    RawPrint(3000,"DocBinDel");
-}
-
-I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
-{
-  U8 *st,*st2;
-  CDoc *doc2;
-  CDocBin *tmpb,*tmpb2;
-  I64 i,bin_num=0;
-  if (doc_e->de_flags&DOCEF_HAS_BIN &&
-        doc_e->bin_ptr_link && StrLen(doc_e->bin_ptr_link)) {
-    bin_num=doc_e->bin_num;
-    st=StrNew(doc_e->bin_ptr_link);
-    st2=StrNew(st);
-    StrLastRem(st,",",st2);
-    i=Str2I64(st2);
-    if (i>0||*st2) {
-      doc2=DocRead(st);
-      if (i>0  && (tmpb2=DocBinFindNum(doc2,i)) ||
-            i==0 && (tmpb2=DocBinFindTag(doc2,st2))) {
-        i=1;
-        if (bin_num>0) {
-          if (tmpb=DocBinFindNum(doc,bin_num)) {
-            i=tmpb->use_cnt;
-            DocBinDel(doc,tmpb);
-          }
-        } else
-          bin_num=doc->cur_bin_num++;
-        tmpb=MAllocIdent(tmpb2,doc->mem_task);
-        tmpb->use_cnt=i;
-        tmpb->data=MAllocIdent(tmpb2->data,doc->mem_task);
-        tmpb->num=bin_num;
-        doc_e->bin_data=tmpb;
-        if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
-          tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
-        else
-          tmpb->tag=NULL;
-        QueIns(tmpb,doc->bin_head.last);
-      } else
-        bin_num=0;
-      DocDel(doc2);
-    } else
-      bin_num=0;
-    Free(st2);
-    Free(st);
-    doc_e->bin_num=bin_num;
-  }
-  return bin_num;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocChar.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocChar.HC.HTML deleted file mode 100755 index c0061aa..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocChar.HC.HTML +++ /dev/null @@ -1,683 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Editor"
-
-public I64 EdCurU8(CDoc *doc)
-{//Return cur U8. See EdRenumAsm for an example.
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_ce=doc->cur_entry;
-  I64 res=-1;
-  if (doc_ce->type_u8==DOCT_TEXT &&
-        doc_ce->min_col<=doc->cur_col<doc_ce->max_col)
-    res=doc_ce->tag[doc->cur_col];
-  else if (doc_ce->type_u8==DOCT_TAB)
-    res='\t';
-  else if (doc_ce->type_u8==DOCT_NEW_LINE ||
-        doc_ce->type_u8==DOCT_SOFT_NEW_LINE)
-    res='\n';
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-public U0 EdCursorLeft(CDoc *doc,I64 sc=I64_MIN)
-{//Move cursor left. Might need a call to DocRecalc().
-//See EdRenumAsm for an example.
-  U8 *dst;
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
-  I64 cc=doc->cur_col,y=doc_ce->y;
-  if (sc!=I64_MIN) sc=sc.u32[0];
-  if (sc>=0 && sc&SCF_CTRL) {
-    while (doc_ce->last!=doc && (doc_ce->last->y==y ||
-          doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
-      doc_ce=doc_ce->last;  //TODO: sel? recurse?
-    cc=doc_ce->min_col;
-  } else {
-    if (cc>doc_ce->min_col) {
-      if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
-        dst=doc_ce->tag+cc;
-        doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-        *dst=0;
-        doc_ce->max_col=cc;
-        QueIns(doc_ne,doc_ce);
-      }
-      cc--;
-      if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
-        dst=doc_ce->tag+cc;
-        doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-        *dst=0;
-        doc_ce->max_col=cc;
-        QueIns(doc_ne,doc_ce);
-        doc_ce=doc_ne;
-        cc=doc_ce->min_col;
-      }
-      if (sc>=0)
-        BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-    } else {
-      cc=doc_ce->min_col;
-      while (doc_ce->last!=doc &&
-            (doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE ||
-            doc_ce->last->type_u8==DOCT_INDENT ||
-            doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
-        doc_ce=doc_ce->last;
-        if (sc>=0)
-          BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-      }
-      if (doc_ce->last!=doc) {
-        doc_ce=doc_ce->last;
-        if (doc_ce->max_col>doc_ce->min_col) {
-          cc=doc_ce->max_col-1;
-          if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
-            dst=doc_ce->tag+cc;
-            doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-            *dst=0;
-            doc_ce->max_col=cc;
-            QueIns(doc_ne,doc_ce);
-            doc_ce=doc_ne;
-            cc=doc_ce->min_col;
-          }
-        } else
-          cc=doc_ce->max_col;
-        if (sc>=0)
-          BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-      }
-    }
-  }
-  doc->cur_col=cc;
-  doc->cur_entry=doc_ce;
-  if (doc_ce!=original_ce)
-    DocFormBwd(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 EdCursorRight(CDoc *doc,I64 sc=I64_MIN)
-{//Move cursor right. Might need a call to DocRecalc().
-//See EdRenumAsm for an example.
-  Bool unlock=DocLock(doc);
-  U8 *dst;
-  CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
-  I64 cc=doc->cur_col,y=doc_ce->y,old_de_flags,old_color;
-  if (sc!=I64_MIN) sc=sc.u32[0];
-  if (sc>=0 && sc&SCF_CTRL) {
-    while (doc_ce!=doc && doc_ce->next->y==y &&
-          doc_ce->next->type_u8!=DOCT_SOFT_NEW_LINE && doc_ce->next!=doc &&
-          (doc_ce->next->type_u8!=DOCT_NEW_LINE || !(doc->flags & DOCF_FORM)) ||
-          doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))
-      doc_ce=doc_ce->next;
-    if (doc_ce->max_col>doc_ce->min_col)
-      cc=doc_ce->max_col-1;
-    else
-      cc=doc_ce->min_col;
-  } else {
-    if (cc<doc_ce->max_col) {
-      if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
-        dst=doc_ce->tag+cc;
-        doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-        *dst=0;
-        doc_ce->max_col=cc;
-        QueIns(doc_ne,doc_ce);
-        doc_ce=doc_ne;
-        cc=doc_ce->min_col;
-      }
-      cc++;
-      old_de_flags=doc_ce->de_flags;
-      old_color=doc_ce->type;
-      if (sc>=0)
-        BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-      if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
-        dst=doc_ce->tag+cc;
-        doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-        *dst=0;
-        doc_ne->type=DOCT_TEXT | old_color & -0x100;
-        doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT];
-        doc_ce->max_col=cc;
-        QueIns(doc_ne,doc_ce);
-        doc_ce=doc_ne;
-        cc=doc_ce->min_col;
-      } else if (cc>=doc_ce->max_col) {
-        doc_ce=doc_ce->next;
-        cc=doc_ce->min_col;
-      }
-    } else {
-      if (doc_ce!=doc) {
-        if (cc<=doc_ce->min_col && sc>=0)
-          BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-        doc_ce=doc_ce->next;
-        while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
-          if (sc>=0)
-            BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-          doc_ce=doc_ce->next;
-        }
-        cc=doc_ce->min_col;
-        if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) {
-          if (sc>=0)
-            BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-          doc_ce=doc_ce->next;
-          cc=doc_ce->min_col;
-        }
-      }
-    }
-  }
-  doc->cur_col=cc;
-  doc->cur_entry=doc_ce;
-  if (doc_ce!=original_ce)
-    DocFormFwd(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 EdLineUp(CDoc *doc,I64 sc=I64_MIN)
-{//Move cursor up. Might need a call to DocRecalc().
-//See EdRenumAsm for an example.
-  Bool unlock=DocLock(doc);
-  U8 *dst;
-  I64 y,x;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
-
-  if (sc!=I64_MIN) sc=sc.u32[0];
-  if (doc_ce->type_u8==DOCT_HEX_ED) {
-    doc->cur_col=doc->cur_col-doc_ce->hex_ed_width*3;
-    if (doc->cur_col>=0) {
-      if (unlock)
-        DocUnlock(doc);
-      return;
-    } else
-      doc->cur_col=0;
-  }
-  x=doc->x; y=doc->y;
-  if (IsEditableText(doc_ce)) {
-    if (doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) {
-      dst=doc_ce->tag+doc->cur_col;
-      doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-      *dst=0;
-      doc_ne->x=doc_ce->x+doc->cur_col;
-      doc_ce->max_col=doc->cur_col;
-      QueIns(doc_ne,doc_ce);
-    } else if (doc->cur_col==doc_ce->min_col && doc_ce->last!=doc)
-      doc_ce=doc_ce->last;
-  } else if (doc_ce->last!=doc)
-    doc_ce=doc_ce->last;
-  if (sc>=0)
-    BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-  doc->cur_entry=doc_ce;
-  DocFormBwd(doc);
-  doc_ce=doc->cur_entry;
-  while (doc_ce->last!=doc && (doc_ce->y>=y ||
-        doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
-    doc_ce=doc_ce->last;
-    if (sc>=0)
-      BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-  }
-  y=doc_ce->y;
-  doc->y=y;
-  while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x ||
-        doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
-    if (sc>=0)
-      BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-    doc_ce=doc_ce->last;
-  }
-
-  if (doc_ce==doc || doc_ce->y<y)
-    doc_ce=doc_ce->next;
-  else {
-    if (!IsEditableText(doc_ce)) {
-      if (sc>=0)
-        BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-    } else {
-      if (doc_ce->next->x==x) {
-        doc_ce=doc_ce->next;
-        if (doc->flags & DOCF_FORM)
-          while (doc_ce->next->x==x &&
-                (!Bt(doldoc.type_flags_form,doc_ce->type_u8) &&
-                !(doc_ce->de_flags&DOCEF_LINK)||
-                doc_ce->de_flags&DOCEF_SKIP_IN_FORM))
-            doc_ce=doc_ce->next;
-      }
-    }
-  }
-  if (doc_ce->de_flags&DOCEF_TAG) {
-    doc->cur_col=x-doc_ce->x;
-    if (IsEditableText(doc_ce)) {
-      if (doc->cur_col>doc_ce->max_col)
-        doc->cur_col=doc_ce->max_col;
-    } else if (doc->cur_col>=doc_ce->max_col)
-      doc->cur_col=doc_ce->max_col-1;
-    if (doc->cur_col<doc_ce->min_col)
-      doc->cur_col=doc_ce->min_col;
-  } else {
-    if (doc_ce->type_u8==DOCT_HEX_ED) {
-      doc->cur_col=RoundI64((doc_ce->len-1)*3,doc_ce->hex_ed_width*3);
-      if (doc->cur_col<0)
-        doc->cur_col=0;
-    } else
-      doc->cur_col=doc_ce->min_col;
-  }
-  if (IsEditableText(doc_ce) && doc_ce->x<x) {
-    if (doc->cur_col<doc_ce->max_col-1) {
-      dst=doc_ce->tag+doc->cur_col;
-      doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-      *dst=0;
-      if (sc>=0) {
-        if (sc&SCF_SHIFT)
-          doc_ne->type=doc_ce->type | DOCET_SEL;
-        else
-          doc_ne->type=doc_ce->type & ~DOCET_SEL;
-      }
-      doc_ne->x=doc_ce->x+doc->cur_col;
-      doc_ce->max_col=doc->cur_col;
-      QueIns(doc_ne,doc_ce);
-      doc_ce=doc_ne;
-      doc->cur_col=doc_ce->min_col;
-    }
-  }
-  doc->cur_entry=doc_ce;
-  DocFormFwd(doc);
-  doc->x=doc->cur_entry->x+doc->cur_col;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 EdLineDown(CDoc *doc,I64 sc=I64_MIN)
-{//Move cursor down. Might need a call to DocRecalc().
-//See EdRenumAsm for an example.
-  Bool unlock=DocLock(doc);
-  U8 *dst;
-  I64 y,x,old_de_flags=0,old_color;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_ne,*doc_ce2;
-  if (sc!=I64_MIN) sc=sc.u32[0];
-  if (doc_ce->type_u8==DOCT_HEX_ED) {
-    doc->cur_col=doc->cur_col+doc_ce->hex_ed_width*3;
-    if (doc->cur_col>=doc_ce->len*3) {
-      doc->cur_entry=doc_ce=doc_ce->next;
-      doc->cur_col=doc_ce->min_col;
-      doc->x=doc_ce->x+doc->cur_col;
-      doc->y=doc_ce->y;
-    }
-    if (unlock)
-      DocUnlock(doc);
-    return;
-  }
-  x=doc->x; y=doc->y;
-  if (IsEditableText(doc_ce)) {
-    if (doc->cur_col>doc_ce->min_col && doc->cur_col<doc_ce->max_col-1) {
-      dst=doc_ce->tag+doc->cur_col;
-      doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-      *dst=0;
-      if (sc>=0) {
-        if (sc&SCF_SHIFT)
-          doc_ne->type=doc_ce->type | DOCET_SEL;
-        else
-          doc_ne->type=doc_ce->type & ~DOCET_SEL;
-      }
-      doc_ne->x=doc_ce->x+doc->cur_col;
-      doc_ce->max_col=doc->cur_col;
-      QueIns(doc_ne,doc_ce);
-      doc_ce=doc_ne;
-      doc->cur_col=doc_ce->min_col;
-    }
-  }
-  doc_ce2=doc_ce;
-  while (doc_ce!=doc && (doc_ce->y<=y ||
-        doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
-    doc_ce=doc_ce->next;
-  y=doc_ce->y;
-  doc->y=y;
-  while (doc_ce!=doc && (doc_ce->y<=y && doc_ce->x<=x ||
-        doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
-    old_de_flags=doc_ce->de_flags;
-    old_color=doc_ce->type;
-    doc_ce=doc_ce->next;
-  }
-  if (doc_ce->last!=doc && (doc_ce->x>x && doc_ce->last->y>=y || doc_ce->y>y)) {
-    doc_ce=doc_ce->last;
-    doc->cur_entry=doc_ce;
-    if (!((doc_ce->type_u8==DOCT_NEW_LINE ||
-          doc_ce->type_u8==DOCT_SOFT_NEW_LINE ||
-          doc_ce->type_u8==DOCT_INDENT) &&
-          (doc_ce->last->type_u8==DOCT_NEW_LINE ||
-          doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE ||
-          doc_ce->last->type_u8==DOCT_INDENT)))
-      DocFormBwd(doc);
-    doc_ce=doc->cur_entry;
-  }
-  while (doc_ce2!=doc && (doc_ce2!=doc_ce || IsEditableText(doc_ce))) {
-    if ((doc_ce2->y<y || doc_ce2->x<x ||
-          doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
-          doc_ce2->x==x && !doc_ce2->max_col &&
-          Bt(doldoc.type_flags_nontag_invis,doc_ce2->type_u8)) && sc>=0)
-      BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT);
-    if (doc_ce2==doc_ce) break;
-    doc_ce2=doc_ce2->next;
-  }
-  if (doc_ce->de_flags&DOCEF_TAG) {
-    doc->cur_col=x-doc_ce->x;
-    if (IsEditableText(doc_ce)) {
-      if (doc->cur_col>doc_ce->max_col)
-        doc->cur_col=doc_ce->max_col;
-    } else if (doc->cur_col>=doc_ce->max_col)
-      doc->cur_col=doc_ce->max_col-1;
-    if (doc->cur_col<doc_ce->min_col)
-      doc->cur_col=doc_ce->min_col;
-  } else
-    doc->cur_col=doc_ce->min_col;
-  if (IsEditableText(doc_ce)&&doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) {
-    dst=doc_ce->tag+doc->cur_col;
-    doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-    *dst=0;
-    doc_ne->type=DOCT_TEXT | old_color & -0x100;
-    doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT];
-    doc_ce->max_col=doc->cur_col;
-    doc_ne->x=doc_ce->x+doc->cur_col;
-    QueIns(doc_ne,doc_ce);
-    doc_ce=doc_ne;
-    doc->cur_col=doc_ce->min_col;
-  }
-  doc->cur_entry=doc_ce;
-  DocFormFwd(doc);
-  if (!(doc->flags & DOCF_FORM))
-    while (doc_ce!=doc && doc_ce!=doc->cur_entry) {
-      if (sc>=0)
-        BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-      doc_ce=doc_ce->next;
-    }
-  doc->x=doc->cur_entry->x+doc->cur_col;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 EdCharDel(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_ce=doc->cur_entry;
-
-  if (doc_ce==doc) {
-    if (unlock)
-      DocUnlock(doc);
-    return;
-  }
-  if (doc_ce->max_col!=0 &&
-        (IsEditableText(doc_ce)||doc_ce->type_u8==DOCT_DATA)) {
-    if (doc_ce->type_u8==DOCT_DATA && doc_ce->de_flags & DOCEF_HAS_TERMINATOR &&
-          doc->cur_col==doc_ce->max_col-1) {
-      if (unlock)
-        DocUnlock(doc);
-      return;
-    }
-    if (doc->cur_col<doc_ce->max_col)
-      StrCpy(doc_ce->tag+doc->cur_col,doc_ce->tag+doc->cur_col+1);
-    if (doc->cur_col>=doc_ce->max_col-1) {
-      doc->cur_entry=doc_ce->next;
-      doc->cur_col=doc->cur_entry->min_col;
-    }
-    DocRemSoftNewLines(doc,doc->cur_entry);
-    if (unlock)
-      DocUnlock(doc);
-    return;
-  }
-  doc->cur_entry=doc_ce->next;
-  doc->cur_col=doc->cur_entry->min_col;
-  if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP))
-    DocEntryDel(doc,doc_ce);
-  DocRemSoftNewLines(doc,doc->cur_entry);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 ChkDollarBufSize(CDoc *doc)
-{
-  U8 *b;
-  if (doc->dollar_buf_ptr>=doc->dollar_buf_size-2) {
-    doc->dollar_buf_size<<=1;
-    b=MAlloc(doc->dollar_buf_size,doc->mem_task);
-    MemCpy(b,doc->dollar_buf,doc->dollar_buf_ptr);
-    Free(doc->dollar_buf);
-    doc->dollar_buf=b;
-  }
-}
-
-U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  U8 *st,*src,*dst;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
-  I64 i,j,m,y=doc_ce->y;
-
-  if (doc->flags & DOCF_IN_DOLLAR) {
-    if (!Bt(char_bmp_printable,ch))
-      goto ic_done;
-    ChkDollarBufSize(doc);
-    doc->dollar_buf[doc->dollar_buf_ptr++]=ch;
-    if (ch=='$') {
-      if (doc->dollar_buf_ptr==2) {
-        doc->flags&=~DOCF_IN_DOLLAR;
-        doc->dollar_buf_ptr=0;
-        goto ic_cont;
-      } else {
-        doc->dollar_buf[doc->dollar_buf_ptr]=0;
-        doc->flags&=~DOCF_IN_DOLLAR;
-        DocPrint(doc,"%s",doc->dollar_buf);
-        doc->dollar_buf_ptr=0;
-        goto ic_done;
-      }
-    } else
-      goto ic_done;
-  }
-  if (ch=='$' && !(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
-    doc->flags|=DOCF_IN_DOLLAR;
-    doc->dollar_buf_ptr=0;
-    doc->dollar_buf[doc->dollar_buf_ptr++]=ch;
-    goto ic_done;
-  }
-  if (ch=='\r') goto ic_done;
-
-    ic_cont:
-  if ((ch==CH_SPACE || ch=='\n') &&
-        !(sc & (SCF_CTRL|SCF_SHIFT)) &&
-        doc_ce->de_flags &
-        (DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE|
-        DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_IN_STR |
-        DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_IN_STR)) {
-    doc->cmd_U8=ch;
-    DocEntryRun(doc,doc_ce,FALSE);
-    DocLock(doc);
-    goto ic_done;
-  }
-  if (doc_ce->type_u8==DOCT_HEX_ED) {
-    if (doc_ce->de_flags&DOCEF_DEREF_DATA &&
-          !(doc_ce->de_flags&DOCEF_REMALLOC_DATA))
-      st=doc_ce->data;
-    else
-      st=&doc_ce->data;
-    i=doc->cur_col;
-    j=i%(doc_ce->hex_ed_width*3);
-    m=i/(doc_ce->hex_ed_width*3)*doc_ce->hex_ed_width;
-    if (j>=doc_ce->hex_ed_width<<1)
-      st[j-doc_ce->hex_ed_width<<1+m]=ch;
-    else {
-      ch=ToUpper(ch)-'0';
-      if (ch>9) {
-        ch+='0'-'A'+10;
-        if (!(10<=ch<=15))
-          goto ic_done;
-      }
-      m=j>>1+m;
-      if (j & 1)
-        st[m]=st[m] & 0xF0| ch;
-      else
-        st[m]=st[m] & 0xF | ch<<4;
-    }
-    doc->cur_col++;
-    goto ic_done;
-  }
-  if (doc->flags & DOCF_OVERSTRIKE) {
-    if (Bt(char_bmp_displayable,ch)) {
-ic_overstrike:
-      if (IsEditableText(doc_ce)) {
-        if (doc->cur_col<doc_ce->max_col) {
-          if (doc_ce->tag[doc->cur_col]) {
-            doc_ce->tag[doc->cur_col++]=ch;
-            goto ic_done;
-          }
-        } else {
-          doc_ce=doc_ce->next;
-          doc->cur_entry=doc_ce;
-          doc->cur_col=doc_ce->min_col;
-          goto ic_overstrike;
-        }
-      } else if (doc_ce->type_u8==DOCT_DATA) {
-        if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) {
-          if (doc_ce->tag[doc->cur_col] &&
-                doc->cur_col<doc_ce->min_col+doc_ce->len) {
-            doc_ce->tag[doc->cur_col++]=ch;
-            if ( ! doc_ce->tag[doc->cur_col]) {
-              doc_ce->tag[doc->cur_col]='_';
-              doc_ce->tag[doc->cur_col+1]=0;
-            }
-          } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA)
-            goto ic_not_overstrike;
-        } else if (doc_ce->tag[doc->cur_col])
-          doc_ce->tag[doc->cur_col++]=ch;
-        goto ic_done;
-      }
-      doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
-      doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
-      doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
-      QueIns(doc_ne,doc_ce->last);
-    } else if (ch=='\n') {
-      while (doc->cur_entry->next!=doc && doc->cur_entry->y==y)
-        doc->cur_entry=doc->cur_entry->next;
-      doc->cur_col=doc->cur_entry->min_col;
-    } else if (ch=='\t') {
-      if (doc->flags&DOCF_FORM)
-        goto ic_form_tab;
-    }
-    goto ic_done;
-  }
-ic_not_overstrike:
-  if (ch=='\n') {
-    if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
-      doc_ne=DocEntryNewBase(doc,
-            DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
-    } else {
-      doc_ne=DocEntryNewBase(doc,
-            DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
-    }
-    DocInsEntry(doc,doc_ne);
-  } else if (ch=='\t') {
-    if (doc->flags&DOCF_FORM &&
-          (Bt(doldoc.type_flags_form,doc->cur_entry->type_u8) ||
-          doc->cur_entry->de_flags&DOCEF_LINK) &&
-          !(doc->cur_entry->de_flags&DOCEF_SKIP_IN_FORM)) {
-ic_form_tab:
-      doc->cur_entry=doc->cur_entry->next;
-      doc->cur_col=doc->cur_entry->min_col;
-      DocFormFwd(doc);
-      goto ic_done;
-    } else {
-      doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8);
-      DocInsEntry(doc,doc_ne);
-    }
-  } else {
-    if (Bt(char_bmp_displayable,ch)) {
-      if (doc_ce->type_u8==DOCT_DATA) {
-        while (TRUE) {
-          i=doc_ce->len+doc_ce->min_col;
-          if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR)
-            i++;
-          if (doc_ce->max_col<i) {
-            st=doc_ce->tag;
-            doc_ce->max_col++;
-            for (i=doc_ce->max_col;i>doc->cur_col;i--)
-              st[i]=st[i-1];
-            st[doc->cur_col++]=ch;
-            break;
-          } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) {
-            st=MAlloc(doc_ce->max_col+8,doc->mem_task);
-            MemCpy(st,doc_ce->tag,doc_ce->max_col+1);
-            Free(doc_ce->tag);
-            doc_ce->tag=st;
-            doc_ce->len=MSize(st)-doc_ce->min_col-2; //See DataTagWidth
-            Free(doc_ce->data);
-            doc_ce->data=MAlloc(doc_ce->len+2,doc->mem_task);
-          } else
-            break;
-        }
-      } else if (IsEditableText(doc_ce)) {
-        dst=st=MAlloc(doc_ce->max_col+2,doc->mem_task);
-        src=doc_ce->tag;
-        i=doc->cur_col;
-        while (i-->0)
-          *dst++=*src++;
-        *dst++=ch;
-        while (*dst++=*src++);
-        Free(doc_ce->tag);
-        doc_ce->tag=st;
-        doc_ce->max_col++;
-        doc->cur_col++;
-      } else {
-        doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
-        doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
-        doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
-        doc_ne->x=doc_ce->x+1;
-        QueIns(doc_ne,doc_ce->last);
-      }
-    }
-  }
-ic_done:
-  DocRemSoftNewLines(doc,doc->cur_entry);
-  if (doc->cur_entry->de_flags & DOCEF_UPDATE_DATA &&
-        (doc->cur_entry->type_u8==DOCT_DATA ||
-        doc->cur_entry->type_u8==DOCT_CHECK_BOX))
-    DocDataScan(doc,doc->cur_entry);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 EdLineDel(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry,*doc_ce2;
-  I64 y;
-  y=doc->y;
-  while (doc_ce!=doc && doc_ce->y==y)
-    doc_ce=doc_ce->next;
-  doc->cur_entry=doc_ce;
-  doc->cur_col=doc_ce->min_col;
-  doc_ce=doc_ce->last;
-  while (doc_ce!=doc && doc_ce->y==y) {
-    doc_ce2=doc_ce->last;
-    if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP))
-      DocEntryDel(doc,doc_ce);
-    doc_ce=doc_ce2;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocClipBoard.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocClipBoard.HC.HTML deleted file mode 100755 index ed6b566..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocClipBoard.HC.HTML +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Clip"
-
-sys_clip_doc=DocNew;
-
-public U0 ClipDel()
-{//Delete everything on clip.
-  DocRst(sys_clip_doc,TRUE);
-}
-
-public U0 ClipCopy(CDoc *doc)
-{//Copy DOCET_SEL flagged entries to clip.
-  CDoc *doc2=sys_clip_doc;
-  Bool unlock_doc=DocLock(doc),
-        unlock_doc2=DocLock(doc2);
-  CDocEntry *doc_e=doc->head.next,*doc_ne;
-  ClipDel;
-  while (doc_e!=doc) {
-    if (doc_e->type & DOCET_SEL) {
-      doc_e->type&=~DOCET_SEL;
-      if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
-        doc_ne=DocEntryCopy(doc2,doc_e);
-        QueIns(doc_ne,doc2->head.last);
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  if (unlock_doc2)
-    DocUnlock(doc2);
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-public U0 ClipCut(CDoc *doc)
-{//Remove sel entries and place on clip.
-  CDoc *doc2=sys_clip_doc;
-  Bool unlock_doc=DocLock(doc),
-        unlock_doc2=DocLock(doc2);
-  CDocEntry *doc_e=doc->head.next,*doc_e1,*doc_ne,*doc_e2=NULL;
-  ClipDel;
-  while (doc_e!=doc) {
-    doc_e1=doc_e->next;
-    if (doc_e->type & DOCET_SEL) {
-      doc_e->type&=~DOCET_SEL;
-      if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
-        doc_ne=DocEntryCopy(doc2,doc_e);
-        QueIns(doc_ne,doc2->head.last);
-      }
-      if (doc_e==doc->cur_entry || doc_e==doc_e2)
-        doc_e2=doc_e->next;
-      DocEntryDel(doc,doc_e);
-    }
-    doc_e=doc_e1;
-  }
-  if (doc_e2) {
-    doc->cur_entry=doc_e2;
-    doc->cur_col=doc_e2->min_col;
-  }
-  DocRemSoftNewLines(doc,NULL);
-  if (unlock_doc2)
-    DocUnlock(doc2);
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-public U0 ClipPaste(CDoc *doc)
-{//Insert copy of clip at insert pt, cur_entry.
-  CDoc *doc2=sys_clip_doc;
-  Bool unlock_doc=DocLock(doc),
-        unlock_doc2=DocLock(doc2);
-  CDocEntry *doc_ce=doc->cur_entry,*doc_e;
-  if (doc_ce->type_u8==DOCT_DATA) {
-    doc_e=doc2->head.next;
-    while (doc_e!=doc2) {
-      if (doc_e->de_flags&DOCEF_TAG)
-        DocPrintPartial(doc,"%s",doc_e->tag);
-      doc_e=doc_e->next;
-    }
-  } else
-    DocInsDoc(doc,doc2);
-  if (unlock_doc2)
-    DocUnlock(doc2);
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-public U0 DocCut(CDoc *doc,CDocEntry *start,CDocEntry *end)
-{//Del start to end entry, including end points.
-  Bool unlock_doc=DocLock(doc);
-  CDocEntry *doc_e1;
-  if (start!=doc && (start->last!=end || end==doc))
-    do {
-      doc_e1=start->next;
-      if (start==doc->cur_entry) {
-        doc->cur_entry=start->next;
-        doc->cur_col=doc->cur_entry->min_col;
-      }
-      DocEntryDel(doc,start);
-      if (start==end)
-        break;
-      start=doc_e1;
-    } while (start!=doc);
-  DocRemSoftNewLines(doc,NULL);
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
-{//Copies start to end entry, including end points.
-  CDoc *doc2=DocNew;
-  Bool unlock_doc=DocLock(doc);
-  CDocEntry *doc_ne;
-  if (start!=doc && (start->last!=end || end==doc))
-    do {
-      if (!Bt(doldoc.type_flags_data,start->type_u8)) {
-        doc_ne=DocEntryCopy(doc2,start);
-        QueIns(doc_ne,doc2->head.last);
-      }
-      if (start==end)
-        break;
-      start=start->next;
-    } while (start!=doc);
-  if (unlock_doc)
-    DocUnlock(doc);
-  return doc2;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocCodeTools.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocCodeTools.HC.HTML deleted file mode 100755 index 2570272..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocCodeTools.HC.HTML +++ /dev/null @@ -1,689 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Misc"
-
-U0 EdReplaceTroubleOne(CDoc *doc,U8 *st_original,U8 *st_safe,I64 num,
-        Bool to_safe,Bool sel)
-{
-  U8 buf[STR_LEN];
-  StrPrint(buf,st_safe,num);
-  if (to_safe)
-    EdReplace(doc,st_original,buf,sel);
-  else
-    EdReplace(doc,buf,st_original,sel);
-}
-
-U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool sel)
-{
-  I64 i=0;
-  EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>"  ,i++,to_safe,sel);
-  EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>"  ,i++,to_safe,sel);
-  EdReplaceTroubleOne(doc,"#include","//<@%d@>"  ,i++,to_safe,sel);
-//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit
-  EdReplaceTroubleOne(doc,"#if"     ,"//<@%d@>"  ,i++,to_safe,sel);
-  EdReplaceTroubleOne(doc,"#endif"  ,"//<@%d@>"  ,i++,to_safe,sel);
-//Convert #exe to union because we want that indent pattern.
-  EdReplaceTroubleOne(doc,"#exe"    ,"union @%d@",i++,to_safe,sel);
-  EdReplaceTroubleOne(doc,"'{'"     ,"'<@%d@>'"  ,i++,to_safe,sel);
-  EdReplaceTroubleOne(doc,"'}'"     ,"'<@%d@>'"  ,i++,to_safe,sel);
-}
-
-#define C_INDENT_SPACES         2
-#define ASM_RENUM_SPACING       5
-
-#define EF_REINDENT     0
-#define EF_CMP_CHK      1
-#define EF_RENUM_ASM    2
-#define EF_CTRL_SLIDER  3
-#define EF_CH_SC        4
-
-I64 PopUpEdFmt()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$LTBLUE$$MU,\"Compile Check\",LE=EF_CMP_CHK$\n"
-        "$MU,\"Reindent HolyC Fun (Beware braces in strings.)\","
-        "LE=EF_REINDENT$\n"
-        "$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$\n"
-        "$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$\n"
-        "$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\","
-        "LE=EF_CH_SC$\n\n"
-        "$MU,\"CANCEL\",LE=DOCM_CANCEL$\n\n"
-        "$GREEN$<ALT-BACKSPACE>$FG$ to undo if not happy\n"
-        "with the ress.\n");
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-class CRILex
-{
-  CCmpCtrl *cc1,*cc2;
-  CQueVectU8 *indent;
-  I64 depth,exp_depth,one_shot;
-  Bool was_new_line,is_not_cont;
-};
-
-I64 EdRILex(CRILex *rx)
-{
-  rx->is_not_cont=FALSE;
-  I64 i;
-  CLexFile *tmpf;
-  do {
-    Lex(rx->cc1);
-    Lex(rx->cc2);
-    i=PrsKeyWord(rx->cc2);
-    if (rx->cc1->token=='\n' && rx->cc2->token==';' || rx->cc2->token=='{' ||
-          rx->cc2->token=='}' || rx->cc2->token==':' || rx->cc2->token==')' &&
-          !rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO)
-      rx->is_not_cont=TRUE;
-    if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
-          i==KW_DFT || i==KW_START || i==KW_END)) {
-      tmpf=rx->cc2->lex_include_stk;
-      while (tmpf->next)
-        tmpf=tmpf->next;
-      QueVectU8Put(rx->indent,tmpf->cur_entry->y,rx->depth+rx->one_shot);
-      rx->one_shot=0;
-    }
-    if (rx->cc2->token=='\n')
-      rx->was_new_line=TRUE;
-    else
-      rx->was_new_line=FALSE;
-  } while (rx->cc1->token=='\n');
-  return rx->cc1->token;
-}
-
-U0 EdRIExp(CRILex *rx)
-{
-  if (rx->cc1->token=='(') {
-    if (!rx->exp_depth++)
-      rx->depth+=3;
-    EdRILex(rx);
-    while (rx->cc1->token && rx->cc1->token!=')')
-      EdRIExp(rx);
-    if (!--rx->exp_depth) {
-      rx->depth-=3;
-      if (rx->depth<0) rx->depth=0;
-    }
-  } else if (rx->cc1->token=='[') {
-    if (!rx->exp_depth++)
-      rx->depth+=3;
-    EdRILex(rx);
-    while (rx->cc1->token && rx->cc1->token!=']')
-      EdRIExp(rx);
-    if (!--rx->exp_depth) {
-      rx->depth-=3;
-      if (rx->depth<0) rx->depth=0;
-    }
-  }
-  EdRILex(rx);
-}
-
-U0 EdRIStmt(CRILex *rx,Bool indent)
-{
-  I64 i;
-  Bool cont;
-  if (rx->cc1->token=='{') {
-    rx->depth++;
-    EdRILex(rx);
-    while (rx->cc1->token && rx->cc1->token!='}')
-      EdRIStmt(rx,FALSE);
-    if (--rx->depth<0) rx->depth=0;
-    EdRILex(rx);
-  } else {
-    if (indent) rx->depth++;
-    do {
-      cont=FALSE;
-      switch (PrsKeyWord(rx->cc1)) {
-        case KW_IF:
-          EdRILex(rx);
-          EdRIExp(rx);
-          EdRIStmt(rx,TRUE);
-          if (PrsKeyWord(rx->cc1)==KW_ELSE) {
-            EdRILex(rx);
-            if (PrsKeyWord(rx->cc1)==KW_IF && rx->cc2->token!='\n')
-              EdRIStmt(rx,FALSE);
-            else
-              EdRIStmt(rx,TRUE);
-          }
-          break;
-        case KW_TRY:
-          EdRILex(rx);
-          EdRIStmt(rx,TRUE);
-          if (PrsKeyWord(rx->cc1)==KW_CATCH) {
-            EdRILex(rx);
-            EdRIStmt(rx,TRUE);
-          }
-          break;
-        case KW_LOCK:
-          EdRILex(rx);
-          EdRIStmt(rx,TRUE);
-          break;
-        case KW_FOR:
-        case KW_WHILE:
-          EdRILex(rx);
-          EdRIExp(rx);
-          EdRIStmt(rx,TRUE);
-          break;
-        case KW_ASM:
-        case KW_CLASS:
-        case KW_UNION:
-          if (EdRILex(rx)==TK_IDENT)
-            EdRILex(rx);
-          EdRIStmt(rx,TRUE);
-          break;
-        case KW_DO:
-          EdRILex(rx);
-          EdRIStmt(rx,TRUE);
-          if (PrsKeyWord(rx->cc1)==KW_WHILE) {
-            EdRILex(rx);
-            EdRIExp(rx);
-          }
-          if (rx->cc1->token==';')
-            EdRILex(rx);
-          break;
-        case KW_SWITCH:
-          EdRILex(rx);
-          EdRIExp(rx);
-          if (rx->cc1->token=='{') {
-            rx->depth++;
-            EdRILex(rx);
-            i=0;
-            while (rx->cc1->token && rx->cc1->token!='}') {
-              switch (PrsKeyWord(rx->cc1)) {
-                case KW_START:
-                  rx->depth+=i; i=0;
-                  while (EdRILex(rx) && rx->cc1->token!=':');
-                  EdRILex(rx);
-                  i++;
-                  break;
-                case KW_END:
-                  rx->depth+=i; i=0;
-                  if (--rx->depth<0) rx->depth=0;
-                  while (EdRILex(rx) && rx->cc1->token!=':');
-                  EdRILex(rx);
-                  break;
-                case KW_CASE:
-                case KW_DFT:
-                  rx->depth+=i; i=0;
-                  while (EdRILex(rx) && rx->cc1->token!=':');
-                  EdRILex(rx);
-                  break;
-                default:
-                  if (rx->cc1->token)
-                    EdRIStmt(rx,TRUE);
-              }
-            }
-            if (--rx->depth<0) rx->depth=0;
-            EdRILex(rx);
-          }
-          break;
-        default:
-          if (rx->cc1->token==TK_IDENT && rx->cc1->hash_entry &&
-                rx->cc1->hash_entry->type&(HTT_OPCODE|HTT_ASM_KEYWORD)) {
-//          rx->one_shot=4-rx->depth;
-            do EdRILex(rx);
-            while (rx->cc2->token && rx->cc2->token!='\n');
-            rx->is_not_cont=TRUE;
-          } else {
-            while (rx->cc1->token && rx->cc1->token!=';' &&
-                  rx->cc1->token!=':') {
-              if (rx->cc2->token=='\n' && !rx->is_not_cont)
-                rx->one_shot=3;
-              EdRILex(rx);
-            }
-            if (rx->cc1->token==':')
-              cont=TRUE;
-            EdRILex(rx);
-          }
-      }
-    } while (cont && rx->cc1->token!='}');
-    if (indent && --rx->depth<0)
-      rx->depth=0;
-  }
-}
-
-CQueVectU8 *EdRICode(CDoc *doc)
-{
-  CQueVectU8 *res;
-  CRILex *rx=CAlloc(sizeof(CRILex));
-
-  rx->cc1=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name);
-  Free(rx->cc1->lex_include_stk->full_name);
-  LexAttachDoc(rx->cc1,rx->cc1->lex_include_stk,doc,,
-        doc->cur_entry,doc->cur_col);
-
-  rx->cc2=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name);
-  Free(rx->cc2->lex_include_stk->full_name);
-  LexAttachDoc(rx->cc2,rx->cc2->lex_include_stk,doc,,
-        doc->cur_entry,doc->cur_col);
-
-  rx->indent=QueVectU8New(doc->cur_entry->y);
-
-  Lex(rx->cc1);
-  EdRIStmt(rx,FALSE);
-
-  CmpCtrlDel(rx->cc1);
-  CmpCtrlDel(rx->cc2);
-  res=rx->indent;
-  Free(rx);
-  return res;
-}
-
-U0 EdRemFunLeadingSpace(CDoc *doc)
-{
-  Bool unlock=DocLock(doc),
-        start_of_line=TRUE;
-  U8 *ptr;
-  I64 ch,levels=1;
-  CDocEntry *doc_e,*doc_e2;
-
-  EdGoToFun(doc,FALSE,FALSE);
-  doc_e=doc->cur_entry->next;
-  do {
-    doc_e2=doc_e->next;
-    if (doc_e!=doc && doc_e!=doc->cur_entry &&
-          !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X)))
-      switch (doc_e->type_u8) {
-        case DOCT_TEXT:
-          ptr=doc_e->tag;
-          if (start_of_line) {
-            while (*ptr==CH_SPACE)
-              ptr++;
-            if (*ptr)
-              start_of_line=FALSE;
-            ptr=StrNew(ptr,doc->mem_task);
-            Free(doc_e->tag);
-            doc_e->tag=ptr;
-          }
-          if (!*ptr)
-            DocEntryDel(doc,doc_e);
-          else {
-            while (ch=*ptr++)
-              if (ch=='{')
-                levels++;
-              else if (ch=='}') {
-                if (!--levels)
-                  break;
-              }
-            if (!levels) goto ls_done;
-          }
-          break;
-        case DOCT_TAB:
-          if (start_of_line)
-            DocEntryDel(doc,doc_e);
-          break;
-        case DOCT_NEW_LINE:
-          start_of_line=TRUE;
-          break;
-        default:
-          start_of_line=FALSE;
-      }
-    doc_e=doc_e2;
-  } while (doc_e!=doc->cur_entry);
-ls_done:
-  DocRecalc(doc);
-  DocCenter(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-class CRenum
-{
-  CRenum *next,*last;
-  U8 label[sizeof(CEdFindText.find_text)];
-};
-
-I64 EdRAGetU8(CDoc *doc)
-{
-  I64 res=-1;
-  while (doc->cur_entry!=doc &&
-        doc->cur_entry->type&DOCET_SEL && res<0) {
-    res=EdCurU8(doc);
-    EdCursorRight(doc);
-  }
-  return res;
-}
-
-U0 EdRACollect(CDoc *doc,CRenum *head)
-{
-  I64 ch,i;
-  CRenum *tmpr;
-  U8 buf[sizeof(CEdFindText.find_text)];
-  ch=EdRAGetU8(doc);
-  while (ch>=0) {
-    if (ch!='@')
-      ch=EdRAGetU8(doc);
-    else {
-      ch=EdRAGetU8(doc);
-      if (ch=='@') {
-        ch=EdRAGetU8(doc);
-        StrCpy(buf,"@@");
-        i=2;
-        while (ch>=0 && i<sizeof(CEdFindText.find_text)) {
-          if (Bt(char_bmp_alpha_numeric,ch))
-            buf[i++]=ch;
-          else
-            break;
-          ch=EdRAGetU8(doc);
-        }
-        if (i<sizeof(CEdFindText.find_text)) {
-          buf[i++]=0;
-          while (ch>=0 && Bt(char_bmp_white_space,ch))
-            ch=EdRAGetU8(doc);
-          if (ch==':') {
-            ch=EdRAGetU8(doc);
-            tmpr=MAlloc(sizeof(CRenum));
-            StrCpy(tmpr->label,buf);
-            QueIns(tmpr,head->last);
-          }
-        }
-      }
-    }
-  }
-//This is needed because we moved the
-  //cursor and it didn't recalc.
-  DocRecalc(doc);
-}
-
-U0 EdRenumAsm(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  I64 num=0;
-  CRenum head,*tmpr,*tmpr1;
-  U8    buf[sizeof(CEdFindText.find_text)],
-        buf2[sizeof(CEdFindText.find_text)];
-
-  QueInit(&head);
-  EdSelFun(doc,TRUE);
-  EdRACollect(doc,&head);
-
-  tmpr=head.next;
-  while (tmpr!=&head) {
-    tmpr1=tmpr->next;
-    num+=ASM_RENUM_SPACING;
-    StrPrint(buf,"@#%02d",num);
-    EdReplace(doc,tmpr->label,buf,TRUE,TRUE,TRUE);
-    Free(tmpr);
-    tmpr=tmpr1;
-  }
-
-  while (num) {
-    StrPrint(buf, "@#%02d",num);
-    StrPrint(buf2,"@@%02d",num);
-    EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE);
-    num-=ASM_RENUM_SPACING;
-  }
-  EdSelAll(doc,FALSE);
-  DocRecalc(doc);
-  DocCenter(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
-{
-  Bool okay,unlock=DocLock(doc),start_of_line=TRUE;
-  CDocEntry *doc_e,*doc_ne;
-  I64 i,start_y,end_y,x,r,goto_line_num;
-  U8 *b,*st,*st2,*prj_file;
-  CTask *task=NULL;
-  CJob *tmpc;
-  CQueVectU8 *indent;
-
-  DocRecalc(doc);
-  goto_line_num=doc->cur_entry->y+1;
-
-  DocCaptureUndo(doc,TRUE);
-  switch (tool_action) {
-    case EF_CMP_CHK:
-      okay=FALSE;
-      if (doc->flags&DOCF_PLAIN_TEXT)
-        DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
-      DocWrite(doc);
-      task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
-      st2=DirCur;
-      st=MStrPrint("Cd(\"%s\");",st2);
-      tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-      Free(st2);
-      Free(st);
-      WinHorz(Fs->win_left,Fs->win_right, task);
-      WinVert(Fs->win_top, Fs->win_bottom,task);
-      if (JobResScan(tmpc,&r)) {
-        st=DirFile(doc->filename.name,,"PRJ.Z");
-        prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
-        Free(st);
-        if (FileFind(prj_file)) {
-          st2=DirFile(prj_file),
-                st=MStrPrint("Cd(\"%s\");",st2);
-          Free(st2);
-          tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|
-                1<<JOBf_FOCUS_MASTER|1<<JOBf_FREE_ON_COMPLETE);
-          Free(st);
-          st=MStrPrint("\"$WW,1$\";Cmp(\"%s\",\"SysTmp\",\"SysTmp\");",
-                prj_file);
-          tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-          Free(st);
-          if (JobResScan(tmpc,&r))
-            if (!r) {
-              tmpc=TaskExe(task,Fs,
-                    "Load(\"SysTmp\",LDF_JUST_LOAD);",
-                    1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-              if (JobResScan(tmpc,&r))
-                okay=TRUE;
-            }
-          tmpc=TaskExe(task,Fs,"Del(\"SysTmp.*\");",
-                1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-          JobResScan(tmpc,&r);
-        } else {
-          Free(prj_file);
-          st=DirFile(doc->filename.name,"Load","HC.Z");
-          prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
-          Free(st);
-          if (FileFind(prj_file))
-            st=MStrPrint("\"$WW,1$\";ExeFile(\"%s\",CCF_JUST_LOAD);",prj_file);
-          else
-            st=MStrPrint("\"$WW,1$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
-                  doc->filename.name);
-          tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-          Free(st);
-          if (JobResScan(tmpc,&r) && r)
-            okay=TRUE;
-        }
-        Free(prj_file);
-      }
-      if (!okay) {
-        PopUpOk("Has Errors");
-        while (LBts(&sys_semas[SEMA_FIX],0))
-          Yield;
-        ToFileLine(dbg.fix_file_line,&st,&i);
-        LBtr(&sys_semas[SEMA_FIX],0);
-        if (!StrCmp(st,doc->filename.name))
-          goto_line_num=i;
-        Free(st);
-      }
-      break;
-    case EF_REINDENT:
-      start_y=doc->cur_entry->y;
-      EdReplaceTroubleAll(doc,TRUE,FALSE);
-      DocGoToLine(doc,start_y+1);
-      if (EdGoToFun(doc,FALSE,FALSE)) {
-        start_y=doc->cur_entry->y;
-        indent=EdRICode(doc);
-        DocUnlock(doc);
-        if (beep) {
-          Snd(86); Sleep(150); Snd;
-          Sleep(100);
-          Snd(86); Sleep(150); Snd;
-        }
-        DocLock(doc);
-        EdRemFunLeadingSpace(doc);
-        DocGoToLine(doc,start_y+1);
-        doc_e=doc->cur_entry;
-        end_y=start_y+indent->total_cnt;
-        while (start_y<=doc_e->y<end_y) {
-          if (doc_e!=doc && doc_e!=doc->cur_entry &&
-                !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) {
-            if (doc_e->type_u8==DOCT_NEW_LINE||
-                  doc_e->type_u8==DOCT_SOFT_NEW_LINE)
-              start_of_line=TRUE;
-            else {
-              if (start_of_line) {
-                i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES;
-                x=doc_e->x+1;
-                while (i>8) {
-                  doc_ne=DocEntryNewBase(doc,
-                        DOCT_TAB|doc->settings_head.dft_text_attr<<8,,
-                        x,doc_e->y,doc_e->page_line_num);
-                  MemCpy(&doc_ne->settings,
-                        &doc_e->settings,sizeof(CDocSettings));
-                  QueIns(doc_ne,doc_e->last);
-                  i-=8;
-                  x+=8;
-                }
-                if (i>0) {
-                  b=MAlloc(i+1,doc->mem_task);
-                  MemSet(b,CH_SPACE,i);
-                  b[i]=0;
-                  doc_ne=DocEntryNewBase(doc,
-                        DOCT_TEXT|doc->settings_head.dft_text_attr<<8,,
-                        x,doc_e->y,doc_e->page_line_num);
-                  doc_ne->tag=b;
-                  doc_ne->max_col=1;
-                  MemCpy(&doc_ne->settings,
-                        &doc_e->settings,sizeof(CDocSettings));
-                  QueIns(doc_ne,doc_e->last);
-                }
-              }
-              start_of_line=FALSE;
-            }
-          }
-          doc_e=doc_e->next;
-        }
-        QueVectU8Del(indent);
-      }
-      start_y=doc->cur_entry->y;
-      EdReplaceTroubleAll(doc,FALSE,FALSE);
-      DocGoToLine(doc,start_y+1);
-      break;
-    case EF_RENUM_ASM:
-      if (EdGoToFun(doc,FALSE,TRUE)) {
-        if (EdCurU8(doc)=='{') {
-          EdCursorRight(doc);
-          DocRecalc(doc);
-        } else if (EdCurU8(doc)==':') {
-          EdCursorRight(doc);
-          if (EdCurU8(doc)==':')
-            EdCursorRight(doc);
-          DocRecalc(doc);
-        }
-        DocUnlock(doc);
-        if (beep) {
-          Snd(86); Sleep(150); Snd;
-          Sleep(100);
-          Snd(86); Sleep(150); Snd;
-        }
-        DocLock(doc);
-        EdRenumAsm(doc);
-      }
-      break;
-  }
-
-  DocRecalc(doc);
-  DocGoToLine(doc,goto_line_num);
-
-  DocUnlock(doc);
-  if (!unlock)
-    DocLock(doc);
-  if (task)
-    Kill(task,FALSE);
-}
-
-U0 EdPopUpChSC(I64 *_ch,I64 *_sc)
-{
-  I64 sc;
-  "Press A Key\n";
-  DocPut->flags|=DOCF_SIZE_MIN;
-  do GetMsg(_ch,&sc,1<<MSG_KEY_DOWN);
-  while (sc.u8[0]==SC_SHIFT || sc.u8[0]==SC_CTRL || sc.u8[0]==SC_ALT);
-  *_sc=sc;
-}
-
-U0 EdChSC(CDoc *doc)
-{
-  I64 ch,sc;
-  U8 buf[STR_LEN];
-  StrPrint(buf,"EdPopUpChSC(%d,%d);",&ch,&sc);
-  PopUp(buf,Fs);
-  if (ch==CH_BACKSPACE)
-    DocPrint(doc,"CH_BACKSPACE,0x%X",sc);
-  else if (ch=='\n')
-    DocPrint(doc,"'\n',0x%X",sc);
-  else if (CH_CTRLA<=ch<=CH_CTRLZ)
-    DocPrint(doc,"CH_CTRL%C,0x%X",ch+'@',sc);
-  else if (ch=='$')
-    DocPrint(doc,"'$$',0x%X",sc);
-  else if (ch=='\\')
-    DocPrint(doc,"'\\\\',0x%X",sc);
-  else if (ch=='\'')
-    DocPrint(doc,"'\\\'',0x%X",sc);
-  else if (ch==CH_ESC)
-    DocPrint(doc,"CH_ESC,0x%X",sc);
-  else if (ch==CH_SHIFT_ESC)
-    DocPrint(doc,"CH_SHIFT_ESC,0x%X",sc);
-  else if (ch==CH_SPACE)
-    DocPrint(doc,"CH_SPACE,0x%X",sc);
-  else if (ch==CH_SHIFT_SPACE)
-    DocPrint(doc,"CH_SHIFT_SPACE,0x%X",sc);
-  else if (Bt(char_bmp_displayable,ch))
-    DocPrint(doc,"'%c',0x%X",ch,sc);
-  else
-    DocPrint(doc,"0x%X,0x%X",ch,sc);
-}
-
-U0 EdCodeTools(CDoc *doc)
-{
-  I64 tool_action=PopUpEdFmt;
-  switch (tool_action) {
-    case EF_CMP_CHK:
-    case EF_REINDENT:
-    case EF_RENUM_ASM:
-      EdCodeTools2(doc,tool_action);
-      break;
-    case EF_CTRL_SLIDER:
-      TemplateCtrlSlider(doc);
-      break;
-    case EF_CH_SC:
-      EdChSC(doc);
-      break;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocDblBuf.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocDblBuf.HC.HTML deleted file mode 100755 index f86e075..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocDblBuf.HC.HTML +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Task;StdOut/Task"
-public CDoc *DocPut(CTask *task=NULL)
-{//Current document that StdOut Put() goes to.
-//Basically, StdOut unless double buffering.
-  CDoc *res;
-  if (!task) task=Fs;
-  if (Bt(&task->task_flags,TASKf_INPUT_FILTER_TASK))
-    task=task->parent_task;
-  if ((res=task->put_doc) && res->doc_signature==DOC_SIGNATURE_VAL)
-    return res;
-  else
-    return NULL;
-}
-
-public CDoc *DocDisplay(CTask *task=NULL)
-{//StdOut displayed unless double buffering.
-  CDoc *res;
-  if (!task) task=Fs;
-  if ((res=task->display_doc) && res->doc_signature==DOC_SIGNATURE_VAL)
-    return res;
-  else
-    return NULL;
-}
-
-public CDoc *DocBorder(CTask *task=NULL)
-{//Doc holding border of window text.
-  CDoc *res;
-  if (!task) task=Fs;
-  if ((res=task->border_doc) && res->doc_signature==DOC_SIGNATURE_VAL)
-    return res;
-  else
-    return NULL;
-}
-
-public CDoc *DocDblBufStart(CTask *task=NULL)
-{//See ::/Demo/Spy.HC
-  Bool unlock_ddoc;
-  CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task),*res;
-  if (!pdoc || !ddoc || pdoc!=ddoc)
-    res=NULL; //Already Double buffering
-  else {
-    if (!task) task=Fs;
-    unlock_ddoc=DocLock(ddoc); //dont change during winupdate, so lock DocPut
-    res=DocNew(,task);
-    res->win_task               =ddoc->win_task;
-    res->max_entries            =ddoc->max_entries;
-    MemCpy(res->find_replace,ddoc->find_replace,sizeof(CEdFindText));
-    MemCpy(&res->filename,&ddoc->filename,sizeof(CEdFileName));
-    res->left_click_link        =ddoc->left_click_link;
-    res->right_click_link       =ddoc->right_click_link;
-    res->user_put_data  =ddoc->user_put_data;
-    res->user_put_key   =ddoc->user_put_key;
-    res->user_put_s             =ddoc->user_put_s;
-    res->parent_doc             =ddoc->parent_doc;
-    res->desc           =ddoc->desc;
-    res->user_data              =ddoc->user_data;
-    res->flags|=ddoc->flags&DOCG_DBL_BUF_FLAGS | DOCF_DONT_SHOW;
-    task->put_doc=res;
-    if (unlock_ddoc)
-      DocUnlock(ddoc);
-  }
-  return res;
-}
-
-public Bool DocDblBufEnd(CTask *task=NULL)
-{//See ::/Demo/Spy.HC
-  Bool res=FALSE;
-  CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task);
-  if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering?
-    if (!task) task=Fs;
-    ddoc->flags|=DOCF_DONT_SHOW;
-    pdoc->flags&=~DOCF_DONT_SHOW;
-    DocLock(ddoc);
-    task->display_doc=pdoc;
-    DocUnlock(ddoc);
-    DocDel(ddoc);
-    res=TRUE;
-  }
-  return res;
-}
-
-public Bool DocDblBufSwap(CTask *task=NULL)
-{//See ::/Demo/Spy.HC
-  Bool res=FALSE;
-  CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task);
-  if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering?
-    if (!task) task=Fs;
-    ddoc->flags|=DOCF_DONT_SHOW;
-    pdoc->flags&=~DOCF_DONT_SHOW;
-    DocLock(ddoc);
-    task->display_doc=pdoc;
-    DocUnlock(ddoc);
-    DocRst(ddoc,TRUE);
-    MemCpy(ddoc->find_replace,pdoc->find_replace,sizeof(CEdFindText));
-    MemCpy(&ddoc->filename,&pdoc->filename,sizeof(CEdFileName));
-    ddoc->max_entries           =pdoc->max_entries;
-    ddoc->flags                 =pdoc->flags&DOCG_DBL_BUF_FLAGS |
-          ddoc->flags&~DOCG_DBL_BUF_FLAGS;
-    ddoc->left_click_link       =pdoc->left_click_link;
-    ddoc->right_click_link      =pdoc->right_click_link;
-    ddoc->user_put_data         =pdoc->user_put_data;
-    ddoc->user_put_key          =pdoc->user_put_key;
-    ddoc->user_put_s            =pdoc->user_put_s;
-    ddoc->desc                  =pdoc->desc;
-    ddoc->user_data             =pdoc->user_data;
-    task->put_doc=ddoc;
-    res=TRUE;
-  }
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocEd.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocEd.HC.HTML deleted file mode 100755 index f728497..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocEd.HC.HTML +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Output;StdOut/DolDoc"
-
-public Bool View()
-{//Go live for user interaction until <ESC> or <SHIFT-ESC>.
-  I64 ch;
-  do ch=DocGetKey;
-  while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
-  return ch==CH_ESC;
-}
-
-#help_index "DolDoc"
-U8 *EdOverStrikeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *st=MAlloc(8,mem_task);
-  if (doc->flags & DOCF_OVERSTRIKE)
-    *st='O';
-  else
-    *st='.';
-  st[1]=0;
-  return st;
-}
-
-U8 *EdAutoSaveCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *st=MAlloc(8,mem_task);
-  if (doc->flags & DOCF_AUTO_SAVE)
-    *st='S';
-  else
-    *st='.';
-  st[1]=0;
-  return st;
-}
-
-U8 *EdFilterCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *st=MAlloc(8,mem_task);
-  if (doc->find_replace->filter_lines)
-    *st='F';
-  else
-    *st='.';
-  st[1]=0;
-  return st;
-}
-
-U8 *EdDollarCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *st=MAlloc(8,mem_task);
-  if (doc->flags & DOCF_IN_DOLLAR)
-    *st='$';
-  else
-    *st='.';
-  st[1]=0;
-  return st;
-}
-
-U8 *EdMoreCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *st=MAlloc(8,mem_task);
-  if (doc->flags&DOCF_MORE)
-    StrCpy(st,"More.");
-  else
-    StrCpy(st,".....");
-  return st;
-}
-
-U8 *EdDollarTypeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
-{
-  CDoc *doc=doc_e->user_data;
-  U8 *src=DefineSub(doc->cur_entry->type_u8,"ST_DOC_CMDS"),
-        *st=CAlloc(8,mem_task);
-  if (doc->cur_entry==doc)
-    src="EOF";
-  else if (!src)
-    src="ERR";
-  StrPrint(st,"%-3ts",src);
-  return st;
-}
-
-public Bool DocEd(CDoc *doc,I64 dof_flags=0)
-{//Live for user interaction. End on <ESC> or <SHIFT-ESC>.
-  CDoc *old_put_doc       =DocPut,
-        *old_display_doc=DocDisplay,
-        *old_border_doc =DocBorder,*bdoc;
-  CDocEntry *doc_e;
-  I64 old_attr=Fs->text_attr,
-        old_top =Fs->win_top, old_bottom=Fs->win_bottom,
-        old_left=Fs->win_left,old_right =Fs->win_right,
-        old_title_src=Fs->title_src;
-  Bool res,unlock;
-  U8 *old_task_title;
-  if (dof_flags&DOF_WIN_MAX)
-    WinMax;
-
-  unlock=DocLock(doc);
-  doc->win_task=Fs;
-  bdoc=DocNew;
-  bdoc->flags|=DOCF_BORDER_DOC;
-  DocPrint(bdoc,"$CM+TY+LX+NC,0,-1$");
-  DocPrint(bdoc,"$TX+RX+BD,\"[X]\"$");
-  DocPrint(bdoc,"$BK,1$$TX+LX+BD,\"MENU\"$$BK,0$");
-
-  old_task_title=StrNew(Fs->task_title);
-  if (Fs->title_src!=TTS_LOCKED_CONST) {
-    Fs->title_src=TTS_ED_FILENAME;
-    MemCpy(Fs->task_title,doc->filename.name,STR_LEN-1);
-  }
-  doc_e=DocPrint(bdoc,"$DA-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1,"
-        "A=\"%%s...\",SCX=16$");
-  doc_e->data=&Fs->task_title;
-  DocDataFmt(bdoc,doc_e);
-
-  if (doc->flags & DOCF_ALLOW_UNDO) {
-    DocPrint(bdoc,"$CM+BY+LX+NC,1,1$");
-    doc_e=DocPrint(bdoc,"$DA+BD+RD-TRM,RT=U32,A=\"Undo:%%03d\"$\n");
-    doc_e->data=&doc->undo_cnt;
-    DocDataFmt(bdoc,doc_e);
-  }
-
-  DocPrint(bdoc,"$CM+BY+RX+NC,-31,1$");
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\"     \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdMoreCB;
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\" \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdDollarTypeCB;
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\" \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdFilterCB;
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\" \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdOverStrikeCB;
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\" \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdAutoSaveCB;
-  doc_e=DocPrint(bdoc,"$TX+BD+TC,\" \"$");
-  doc_e->user_data=doc;
-  doc_e->tag_cb=&EdDollarCB;
-  doc_e=DocPrint(bdoc,"$DA+BD+RD-TRM,A=\"Line:%%04d \"$");
-  doc_e->data=&doc->line;
-  DocDataFmt(bdoc,doc_e);
-  doc_e=DocPrint(bdoc,"$DA+BD+RD-TRM,A=\"Col:%%04d\"$\n");
-  doc_e->data=&doc->col;
-  DocDataFmt(bdoc,doc_e);
-
-  DocRecalc(bdoc);
-  DocRecalc(doc);
-  if (!(dof_flags&DOF_DONT_HOME))
-    DocTop(doc);
-  Fs->border_doc=bdoc;
-  if (doc!=old_display_doc)
-    doc->parent_doc=old_display_doc;
-  Fs->put_doc=Fs->display_doc=doc;
-  if (!(dof_flags&DOF_DONT_TEXT_ATTR))
-    Fs->text_attr=DOC_ATTR_DFT_TEXT;
-  if (!(dof_flags&DOF_DONT_SHOW)) {
-    LBts(&Fs->display_flags,DISPLAYf_SHOW);
-    WinZBufUpdate;
-  }
-  if (dof_flags&DOF_SIZE_MIN)
-    doc->flags|=DOCF_SIZE_MIN;
-
-  DocUnlock(doc);
-  if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
-    Refresh(2,TRUE);
-    if (doc->flags&DOCF_SIZE_MIN)
-      Refresh(2,TRUE);
-  }
-  res=View;
-
-  DocLock(doc);
-  if (res) {
-    doc_e=doc->head.next;
-    while (doc_e!=doc) {
-      if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX)
-        DocDataScan(doc,doc_e);
-      doc_e=doc_e->next;
-    }
-  }
-  if (unlock)
-    DocUnlock(doc);
-  Fs->border_doc =old_border_doc;
-  Fs->display_doc=old_display_doc;
-  Fs->put_doc    =old_put_doc;
-  Fs->text_attr  =old_attr;
-  if (Fs->title_src!=TTS_LOCKED_CONST) {
-    Fs->title_src  =old_title_src;
-    StrCpy(Fs->task_title,old_task_title);
-  }
-  Free(old_task_title);
-  DocDel(bdoc);
-  if (dof_flags&DOF_SIZE_MIN) {
-    WinHorz(old_left,old_right);
-    WinVert(old_top,old_bottom);
-  }
-  return res;
-}
-
-#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)"
-public Bool Ed(U8 *link_st,I64 edf_dof_flags=0)
-{//Invoke document editor.
-  U8 *filename,*needle_str;
-  I64 i,num;
-  Bool cont,res=FALSE;
-  CDoc *doc;
-
-  switch (i=EdLinkCvt(link_st,&filename,&needle_str,&num,edf_dof_flags)) {
-    case -1:
-      break;
-    case LK_DEF:
-      doc=DocNew;
-      doc->desc='DictDef';
-      ACDDefsPut(doc,filename,num);
-      goto ej_doc;
-    case LK_HELP_INDEX:
-      doc=DocNew;
-      doc->desc='HelpIndx';
-      DocHelpIdx(doc,filename);
-ej_doc:
-      if (!(edf_dof_flags&EDF_BAIL)) {
-        DocEd(doc);
-        DocDel(doc);
-      }
-      if (!(edf_dof_flags&EDF_WAS_WRITE))
-        res=TRUE;
-      break;
-    default:
-      if (IsRaw)
-        res=EdLite(filename,num,edf_dof_flags);
-      else {
-        cont=TRUE;
-        if (!(edf_dof_flags&EDF_BAIL) && !(LK_DOC<=i<=LK_DOC_LINE) &&
-              !FilesFindMatch(filename,FILEMASK_TXT) &&
-              !PopUpCancelOk(ST_WARN_ST "Not Text File\n\n"))
-          cont=FALSE;
-        if (cont)
-          res=DocFileEd(i,filename,needle_str,&num,edf_dof_flags);
-      }
-  }
-  Free(filename);
-  Free(needle_str);
-  return res;
-}
-
-public Bool Plain(U8 *filename,I64 edf_dof_flags=0)
-{//Edit document in plain text mode, so dollar signs are not special.
-  Bool res;
-  U8 *st=MStrPrint("PI:%s",filename);
-  res=Ed(st,edf_dof_flags);
-  Free(st);
-  return res;
-}
-
-#help_index "DolDoc;Job/Exe;Task/Job/Exe"
-public I64 PopUpEd(U8 *filename,CTask *parent=NULL,CTask **_pu_task=NULL)
-{//Create PopUp win task and edit a doc.
-  U8 *st=MStrPrint("Ed(\"%Q\");",filename);
-  I64 res=PopUp(st,parent,_pu_task);
-  Free(st);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocExt.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocExt.HC.HTML deleted file mode 100755 index 670d919..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocExt.HC.HTML +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-extern Bool DocEd(CDoc *doc,I64 dof_flags=0);
-extern I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
-        Bool exited,I64 *_has_action=NULL);
-extern U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE);
-extern Bool DocGoToLine(CDoc *doc,I64 line_num);
-extern U0 DocLoad(CDoc *doc,U8 *src2,I64 size);
-extern U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...);
-extern U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...);
-extern CDocEntry *DocPutS(CDoc *doc,U8 *st);
-extern U8 *DocSave(CDoc *doc,I64 *_size=NULL);
-extern I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e);
-extern I64 PopUpPickLst(U8 *lst);
-extern I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e);
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocFile.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocFile.HC.HTML deleted file mode 100755 index 099e603..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocFile.HC.HTML +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/File"
-
-public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
-{//Fetch doc from raw mem buf.
-  I64 i;
-  U8 *src;
-  Bool unlock=DocLock(doc);
-  CDocBin *tmpb;
-  doc->find_replace->filter_lines=0;
-  if (src2) {
-    DocPutS(doc,src2); //Too big DocPrint() is wasteful.
-    src=src2+StrLen(src2)+1;
-    i=size-(offset(CDocBin.end)-offset(CDocBin.start));
-    while (src<=src2+i) {
-      tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
-      MemCpy(&tmpb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
-      src+=offset(CDocBin.end)-offset(CDocBin.start);
-      tmpb->data=MAlloc(tmpb->size,doc->mem_task);
-      if (tmpb->size) {
-        MemCpy(tmpb->data,src,tmpb->size);
-        src+=tmpb->size;
-      }
-      QueIns(tmpb,doc->bin_head.last);
-      if (tmpb->num>=doc->cur_bin_num)
-        doc->cur_bin_num=tmpb->num+1;
-    }
-  }
-  if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
-    DocBinsValidate(doc);
-  DocTop(doc); //Calls DocRecalc().  DOCT_CURSOR will be set.
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
-{//Fetch doc from disk. See flags.
-  CDoc *doc=DocNew;
-  U8 *src,*name2;
-  I64 size=0;
-  CDirContext *dirc;
-  if (!name) name=blkdev.tmp_filename;
-  doc->flags|=flags;
-  name2=FileNameAbs(name);
-  StrCpy(doc->filename.name,name2);
-  if (src=FileRead(name2,&size,&doc->file_attr)) {
-    if (dirc=DirContextNew(name2)) {
-      DocLoad(doc,src,size);
-      DirContextDel(dirc);
-    }
-    Free(src);
-  }
-  Free(name2);
-  return doc;
-}
-
-public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
-{//Store doc to raw mem buf.
-  CDocEntry *doc_e,*doc_e1;
-  CDocBin *b;
-  Bool unlock=DocLock(doc);
-  I64 ch,cnt=1;//terminator
-  U8 *st,*res,*dst,*src;
-
-  if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
-    DocBinsValidate(doc);
-  if (doc->flags&DOCF_NO_CURSOR)
-    DocRecalc(doc);
-  else {
-    DocRecalc(doc,RECALCF_ADD_CURSOR);
-    if (doc->head.next->type_u8==DOCT_CURSOR)
-      DocEntryDel(doc,doc->head.next); //If no cursor, DocLoad() puts at top.
-  }
-  for (doc_e=doc->head.next;doc_e!=doc;doc_e=doc_e->next) {
-    if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
-      switch (doc_e->type_u8) {
-        case DOCT_TAB:
-        case DOCT_PAGE_BREAK:
-        case DOCT_CURSOR:
-          cnt++;
-          break;
-        case DOCT_NEW_LINE:
-          if (doc->flags&DOCF_CARRIAGE_RETURN)
-            cnt+=2;
-          else
-            cnt++;
-          break;
-        case DOCT_SOFT_NEW_LINE:
-          break;
-        case DOCT_TEXT:
-          if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
-                DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP))&&
-                !(doc_e->type&DOCG_BL_IV_UL)) {
-            cnt+=StrLen(doc_e->tag);
-            if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) ||
-                  doc->flags&DOCF_DBL_DOLLARS)
-              cnt+=StrOcc(doc_e->tag,'$');
-            break;
-          }
-        default:
-          st=Doc2PlainText(doc,doc_e);
-          cnt+=StrLen(st)+2;
-          Free(st);
-      }
-    }
-  }
-  for (b=doc->bin_head.next;b!=&doc->bin_head;b=b->next)
-    if (b->use_cnt>b->tmp_use_cnt)
-      cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
-  res=MAlloc(cnt);
-  dst=res;
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    doc_e1=doc_e->next;
-    if (!Bt(doldoc.type_flags_data,doc_e->type_u8))
-      switch (doc_e->type_u8) {
-        case DOCT_CURSOR:
-          DocEntryDel(doc,doc_e);
-          *dst++=CH_CURSOR;
-          break;
-        case DOCT_TAB:
-          *dst++='\t';
-          break;
-        case DOCT_NEW_LINE:
-          if (doc->flags&DOCF_CARRIAGE_RETURN)
-            *dst++='\r';
-          *dst++='\n';
-          break;
-        case DOCT_SOFT_NEW_LINE:
-          break;
-        case DOCT_TEXT:
-          if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
-                DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
-                !(doc_e->type&DOCG_BL_IV_UL)) {
-            src=doc_e->tag;
-            while (ch=*src++) {
-              *dst++=ch;
-              if (ch=='$' && (!(doc->flags & (DOCF_PLAIN_TEXT|
-                    DOCF_PLAIN_TEXT_TABS)) || doc->flags&DOCF_DBL_DOLLARS))
-                *dst++=ch;
-            }
-            break;
-          }
-        default:
-          *dst++='$';
-          st=Doc2PlainText(doc,doc_e);
-          StrCpy(dst,st);
-          dst+=StrLen(st);
-          *dst++='$';
-          Free(st);
-      }
-    doc_e=doc_e1;
-  }
-  *dst++=0;
-  b=doc->bin_head.next;
-  if (b!=&doc->bin_head) {
-    do {
-      if (b->use_cnt>b->tmp_use_cnt) {
-        MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
-        dst+=offset(CDocBin.end)-offset(CDocBin.start);
-        MemCpy(dst,b->data,b->size);
-        dst+=b->size;
-      }
-      b=b->next;
-    } while (b!=&doc->bin_head);
-  } else
-    cnt--; //No terminator
-  if (_size) *_size=cnt;
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-public Bool DocWrite(CDoc *doc,Bool prompt=FALSE)
-{//Store doc to disk.
-  I64 size;
-  U8 *buf;
-  if (prompt && !DocForm(&doc->filename) ||
-        doc->filename.name[0]=='A' && doc->filename.name[2]==':')
-    return FALSE;  //CANCEL || LK_DOC,LK_DOC_ANCHOR,LK_DOC_FIND,LK_DOC_LINE?
-  buf=DocSave(doc,&size);
-  FileWrite(doc->filename.name,buf,size,0,doc->file_attr);
-  Free(buf);
-  return TRUE;
-}
-
-#help_index "DolDoc"
-public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
-{//Insert copy of doc2 into doc at insert pt, cur_entry.
-//TODO: DocRst
-  U8 *dst;
-  Bool unlock_doc,unlock_doc2=DocLock(doc2);
-  CDocEntry *doc_ne,*doc_e=doc2->head.next,*doc_ce;
-  if (!doc) doc=DocPut;
-  unlock_doc=DocLock(doc),
-        DocRemSoftNewLines(doc,NULL);
-  doc_ce=doc->cur_entry;
-  if (doc_ce->type_u8==DOCT_TEXT && doc->cur_col>doc_ce->min_col) {
-    if (doc->cur_col<doc_ce->max_col) {
-      dst=doc_ce->tag+doc->cur_col;
-      doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-      *dst=0;
-      doc_ne->type=DOCT_TEXT | doc_ce->type & 0xFFFFFF00;
-      doc_ce->max_col=doc->cur_col;
-      QueIns(doc_ne,doc_ce);
-      doc->cur_entry=doc_ne;
-      doc->cur_col=doc_ne->min_col;
-    } else
-      if (doc_ce!=doc)
-        doc->cur_entry=doc_ce->next;
-  }
-  while (doc_e!=doc2) {
-    if (doc_e->type_u8!=DOCT_SOFT_NEW_LINE) {
-      doc_ne=DocEntryCopy(doc,doc_e);
-      QueIns(doc_ne,doc->cur_entry->last);
-    }
-    doc_e=doc_e->next;
-  }
-  DocRecalc(doc);
-  if (unlock_doc2)
-    DocUnlock(doc2);
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-#help_index "DolDoc/Compiler;Compiler/Directive"
-public U0 StreamDoc(CDoc *doc)
-{//Inject doc into compile stream. Use inside #exe{}.
-//TODO: DocRst
-  Bool unlock_doc=DocLock(doc);
-  CDocEntry *doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TEXT)
-      StreamPrint("%s",doc_e->tag);
-    else if (doc_e->type_u8==DOCT_NEW_LINE)
-      StreamPrint("\n");
-    else if (doc_e->type_u8==DOCT_TAB)
-      StreamPrint("\t");
-    doc_e=doc_e->next;
-  }
-  if (unlock_doc)
-    DocUnlock(doc);
-}
-
-#help_index "DolDoc"
-Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
-{
-  Bool res=FALSE,unlock;
-  I64 time_stamp,flags;
-  CDocUndo *u;
-  if (doc->flags&DOCF_ALLOW_UNDO) {
-    unlock=DocLock(doc);
-    time_stamp=GetTSC;
-    if (doc->flags&DOCF_UNDO_DIRTY &&
-          time_stamp>doc->undo_head.last->time_stamp+cnts.time_stamp_freq<<4 ||
-          force) {
-      u=CAlloc(sizeof(CDocUndo),doc->mem_task);
-      u->time_stamp=time_stamp;
-      flags=doc->flags;
-      doc->flags&=~DOCF_NO_CURSOR;
-      u->body=DocSave(doc,&u->size);
-      doc->flags=flags;
-      QueIns(u,doc->undo_head.last);
-      doc->flags&=~DOCF_UNDO_DIRTY;
-      doc->undo_cnt++;
-      u->doc_flags=doc->flags;
-      res=TRUE;
-      if (doc->flags&DOCF_AUTO_SAVE)
-        DocWrite(doc);
-    }
-    if (unlock)
-      DocUnlock(doc);
-  }
-  return res;
-}
- 
-U0 DocUndoRestore(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  CDocUndo *u=doc->undo_head.last,*u_next,*u_last;
-  if (u!=&doc->undo_head) {
-    QueRem(u);
-    u_next=doc->undo_head.next;
-    u_last=doc->undo_head.last;
-    QueInit(&doc->undo_head);
-    DocRst(doc,TRUE);
-    doc->flags=u->doc_flags&~DOCF_NO_CURSOR;
-    DocLoad(doc,u->body,u->size);
-    doc->flags=u->doc_flags;
-    DocUndoDel(doc,u);
-    doc->undo_head.next=u_next;
-    doc->undo_head.last=u_last;
-  }
-  DocUndoCntSet(doc);
-  doc->flags&=~DOCF_UNDO_DIRTY;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-#help_index "Graphics/GR Files;DolDoc/Output;StdOut/DolDoc"
-public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
-{//Output txt or graphic file to document.
-  Bool res=FALSE;
-  CDoc *doc2;
-  if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
-    return FALSE;
-  if (FilesFindMatch(filename,FILEMASK_TXT)) {
-    doc2=DocRead(filename);
-    DocInsDoc(doc,doc2);
-    if (IsRaw)
-      DocDump(doc2,100000);
-    DocDel(doc2);
-    res=TRUE;
-  } else if (FilesFindMatch(filename,"*.GR*")) {
-    DocGR(doc,filename);
-    res=TRUE;
-  }
-  if (res)
-    DocPrint(doc,"%h*c",trailing_new_lines,'\n');
-  return res;
-}
-
-#help_index "Graphics/GR Files;"\
-        "File/Cmd Line (Typically);DolDoc/Cmd Line (Typically);"\
-        "StdOut;Cmd Line (Typically)"
-public Bool Type(U8 *filename,I64 trailing_new_lines=1)
-{//Output txt or graphic file to command line.
-  return DocType(,filename,trailing_new_lines);
-}
-
-#help_index "DolDoc/File"
-
-public U8 *DocLineRead(U8 *filename,I64 line,CTask *mem_task=NULL)
-{//Extract line from stored doc file. (Slow.)
-  U8 *res=NULL;
-  CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  if (DocGoToLine(doc,line) && doc->cur_entry->type_u8==DOCT_TEXT)
-    res=StrNew(doc->cur_entry->tag,mem_task);
-  DocDel(doc);
-  return res;
-}
-
-public U8 *DocLineWrite(U8 *filename,I64 line,U8 *st)
-{//Write line to stored doc file. (Slow.)
-  U8 *res=NULL;
-  CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  if (DocGoToLine(doc,line)) {
-    if (doc->cur_entry->type_u8==DOCT_TEXT) {
-      Free(doc->cur_entry->tag);
-      doc->cur_entry->tag=StrNew(st);
-    } else
-      DocPrint(doc,"%s",st);
-    DocTop(doc);
-    DocWrite(doc);
-  }
-  DocDel(doc);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocFind.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocFind.HC.HTML deleted file mode 100755 index e7de5ed..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocFind.HC.HTML +++ /dev/null @@ -1,615 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Editor"
-
-public Bool DocGoToLine(CDoc *doc,I64 line_num) //one based
-{//Nearest to specified line num.  Move cur_entry & center.
-  Bool res=FALSE,unlock;
-  if (doc) {
-    unlock=DocLock(doc);
-    doc->x=0;
-    doc->y=line_num-1;
-    DocRecalc(doc,RECALCt_FIND_CURSOR);
-    DocCenter(doc);
-    if (doc->cur_entry->y==line_num-1)
-      res=TRUE;
-    if (unlock)
-      DocUnlock(doc);
-  }
-  return res;
-}
-
-public Bool DocFind(CDoc *haystack_doc,I64 start_line_num=I64_MIN,
-U8 *needle,I64 match=1)
-{//Find str by searching tags. Move cur_entry & center.
-  Bool res=FALSE,unlock;
-  CDocEntry *doc_e;
-  U8 *ptr;
-  I64 i;
-  if (haystack_doc) {
-    unlock=DocLock(haystack_doc);
-    if (start_line_num==I64_MIN) {
-      res=TRUE;
-      doc_e=haystack_doc->head.next;
-    } else {
-      res=DocGoToLine(haystack_doc,start_line_num);
-      doc_e=haystack_doc->cur_entry;
-    }
-    if (res) {
-      if (needle) {
-        res=FALSE;
-        while (doc_e!=haystack_doc) {
-          if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
-//TODO: handle multi-DocEntry strs
-                (ptr=StrIMatch(needle,doc_e->tag))) {
-            i=ptr-doc_e->tag;
-            if (!--match) {
-              haystack_doc->cur_entry=doc_e;
-              if (i<doc_e->min_col) i=doc_e->min_col;
-              if (i>doc_e->max_col) i=doc_e->max_col;
-              haystack_doc->cur_col=i;
-              res=TRUE;
-              break;
-            }
-          }
-          doc_e=doc_e->next;
-        }
-      } else
-        res=FALSE;
-    }
-    if (!res) DocBottom(haystack_doc);
-    DocCenter(haystack_doc);
-    if (unlock)
-      DocUnlock(haystack_doc);
-  }
-  return res;
-}
-
-public Bool DocAnchorFind(CDoc *haystack_doc,U8 *needle_str)
-{//Find named anchor. Move cur_entry & center.
-  Bool res=FALSE,unlock;
-  CDocEntry *doc_e;
-  if (haystack_doc) {
-    unlock=DocLock(haystack_doc);
-    doc_e=haystack_doc->head.next;
-    if (needle_str)
-      while (doc_e!=haystack_doc) {
-        if (doc_e->type_u8==DOCT_ANCHOR && doc_e->de_flags & DOCEF_AUX_STR) {
-          if (!StrCmp(needle_str,doc_e->aux_str)) {
-            haystack_doc->cur_entry=doc_e;
-            haystack_doc->cur_col=doc_e->min_col;
-            res=TRUE;
-            break;
-          }
-        }
-        doc_e=doc_e->next;
-      }
-    if (!res) DocBottom(haystack_doc);
-    DocCenter(haystack_doc);
-    if (unlock)
-      DocUnlock(haystack_doc);
-  }
-  return res;
-}
-
-public U0 EdFindNext(CDoc *doc)
-{//Editor F3 find next, possibly doing replaces.
-  Bool unlock=DocLock(doc);
-  U8 *ptr,*ptr2,*ptr3;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_e=doc_ce;
-  I64 sf_flags;
-  if (doc->find_replace->match_case)
-    sf_flags=0;
-  else
-    sf_flags=SFF_IGNORE_CASE;
-  if (doc->find_replace->whole_labels)
-    sf_flags|=SFG_WHOLE_LABELS;
-  do {
-    if (doc_e!=doc) {
-      if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
-            !(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
-        if (doc_e->type & DOCET_SEL ||
-              !doc->find_replace->scan_sel_text) {
-          if (doc->find_replace->scan_fwd) {
-            if (doc_e==doc_ce) {
-              ptr=doc_ce->tag+doc->cur_col+1;
-              if (ptr-doc_ce->tag>=doc_ce->max_col)
-                goto fn_skip;
-              if (ptr-doc_ce->tag<doc_ce->min_col)
-                ptr=doc_ce->tag+doc_ce->min_col;
-            } else
-              ptr=doc_e->tag;
-            if (ptr=StrFind(doc->find_replace->find_text,ptr,sf_flags)) {
-              doc->cur_entry=doc_e;
-              doc->cur_col=ptr-doc_e->tag;
-              if (doc->cur_col>=doc_e->max_col)
-                doc->cur_col=doc_e->max_col-1;
-              if (doc->cur_col<doc_e->min_col)
-                doc->cur_col=doc_e->min_col;
-              DocCenter(doc);
-              if (unlock)
-                DocUnlock(doc);
-              return;
-            }
-          } else {
-            ptr2=NULL;
-            ptr=doc_e->tag+doc_e->min_col;
-            if (doc_e==doc_ce)
-              ptr3=doc_ce->tag+doc->cur_col;
-            else
-              ptr3=doc_e->tag+doc_e->max_col;
-            while (ptr=StrFind(doc->find_replace->find_text,ptr,sf_flags)) {
-              if (ptr>=ptr3)
-                break;
-              ptr2=ptr++;
-            }
-            if (ptr2 && ptr2<ptr3) {
-              doc->cur_entry=doc_e;
-              doc->cur_col=ptr2-doc_e->tag;
-              if (doc->cur_col>=doc_e->max_col)
-                doc->cur_col=doc_e->max_col-1;
-              if (doc->cur_col<doc_e->min_col)
-                doc->cur_col=doc_e->min_col;
-              DocCenter(doc);
-              if (unlock)
-                DocUnlock(doc);
-              return;
-            }
-          }
-        }
-      }
-    }
-fn_skip:
-    if (doc->find_replace->scan_fwd)
-      doc_e=doc_e->next;
-    else
-      doc_e=doc_e->last;
-  } while (doc_e!=doc_ce);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 EdSelAll(CDoc *doc,Bool sel)
-{//Set state of DOCET_SEL on all entries.
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    BEqu(&doc_e->type,DOCEt_SEL,sel);
-    doc_e=doc_e->next;
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public Bool EdFindPaired(CDoc *doc,U8 plus,U8 minus,
-Bool fwd,Bool abort_on_dbl_colon=FALSE)
-{//Find { } or ( ) pair. Move cur_entry & center.
-  Bool unlock=DocLock(doc),res=FALSE;
-  U8 *ptr;
-  I64 ch,levels=0,colons=0,original_col=doc->cur_col;
-  CDocEntry *doc_ce=doc->cur_entry,*doc_e=doc_ce,*original_ce=doc_ce;
-  if (abort_on_dbl_colon && EdCurU8(doc)==':')
-    colons=1;
-  else
-    colons=0;
-  do {
-    if (doc_e!=doc) {
-      if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
-            !(doc_e->de_flags&DOCEF_FILTER_SKIP)) {
-        if (fwd) {
-          if (doc_e==doc_ce)
-            ptr=doc_e->tag+doc->cur_col+1;
-          else
-            ptr=doc_e->tag;
-          if (ptr-doc_e->tag<doc_e->min_col)
-            ptr=doc_e->tag+doc_e->min_col;
-          if (ptr-doc_e->tag>=doc_e->max_col)
-            goto pa_skip;
-          while (ch=*ptr++)
-            if (abort_on_dbl_colon && ch==':') {
-              if (++colons==2) {
-                doc->cur_entry=doc_e;
-                doc->cur_col=ptr-doc_e->tag-1;
-                EdCursorLeft(doc);
-                res=FALSE;
-                goto pa_done;
-              }
-            } else {
-              colons=0;
-              if (ch==plus)
-                levels++;
-              else if (ch==minus) {
-                if (!levels--) {
-                  doc->cur_entry=doc_e;
-                  doc->cur_col=ptr-doc_e->tag-1;
-                  res=doc->cur_entry!=original_ce ||
-                        doc->cur_col!=original_col;
-                  goto pa_done;
-                }
-              }
-            }
-        } else {
-          if (doc_e==doc_ce) {
-            ptr=doc_e->tag+doc->cur_col-1;
-            if (ptr-doc_e->tag>=doc_e->max_col)
-              ptr=doc_e->tag+doc_e->max_col-1;
-          } else
-            ptr=doc_e->tag+doc_e->max_col-1;
-          if (ptr-doc_e->tag<doc_e->min_col)
-            goto pa_skip;
-          while (ptr>=doc_e->tag+doc_e->min_col) {
-            ch=*ptr--;
-            if (abort_on_dbl_colon && ch==':') {
-              if (++colons==2) {
-                doc->cur_entry=doc_e;
-                doc->cur_col=ptr-doc_e->tag+1;
-                res=FALSE;
-                goto pa_done;
-              }
-            } else {
-              colons=0;
-              if (ch==plus)
-                levels++;
-              else if (ch==minus) {
-                if (!levels--) {
-                  doc->cur_entry=doc_e;
-                  doc->cur_col=ptr-doc_e->tag+1;
-                  res=doc->cur_entry!=original_ce ||
-                        doc->cur_col!=original_col;
-                  goto pa_done;
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-pa_skip:
-    if (fwd)
-      doc_e=doc_e->next;
-    else
-      doc_e=doc_e->last;
-  } while (doc_e!=doc_ce);
-pa_done:
-  DocRecalc(doc);
-  DocCenter(doc);
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-public Bool EdGoToFun(CDoc *doc,Bool fwd,Bool abort_on_dbl_colon)
-{//Move cur_entry to start of cur fun and center.(Shoddy)
-  Bool unlock=DocLock(doc),res=FALSE;
-  I64 ch,levels,colons;
-  if (fwd) {
-    levels=0;
-    colons=0;
-    while (doc->cur_entry!=doc) {
-      ch=EdCurU8(doc);
-      if (abort_on_dbl_colon && ch==':') {
-        if (++colons==2) {
-          EdCursorLeft(doc);
-          break;
-        }
-      } else {
-        colons=0;
-        if (ch=='{')
-          levels++;
-        else if (ch=='}' && !levels--)
-          break;
-      }
-      EdCursorRight(doc);
-    }
-    DocRecalc(doc);
-    if (doc->cur_entry!=doc)
-      res=TRUE;
-  } else {
-    while (EdFindPaired(doc,'}','{',FALSE,abort_on_dbl_colon));
-    if (doc->cur_entry!=doc) {
-      ch=EdCurU8(doc);
-      if (abort_on_dbl_colon && ch==':')
-        res=TRUE;
-      else {
-        if (ch=='{')
-          res=TRUE;
-      }
-    }
-  }
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-public U0 EdSelFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
-{//Set DOCET_SEL on all entries in cur fun.
-  Bool unlock=DocLock(doc);
-  U8 *ptr;
-  I64 ch,levels=0,colons=0;
-  CDocEntry *doc_e;
-  EdSelAll(doc,FALSE);
-  EdGoToFun(doc,FALSE,abort_on_dbl_colon);
-  if (EdCurU8(doc)=='{')
-    levels--;
-  else if (abort_on_dbl_colon && EdCurU8(doc)==':') {
-    EdCursorRight(doc);
-    if (EdCurU8(doc)==':')
-      EdCursorRight(doc);
-  }
-  doc_e=doc->cur_entry;
-  while (doc_e!=doc) {
-    doc_e->type|=DOCET_SEL;
-    if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) {
-      ptr=doc_e->tag;
-      if (doc_e==doc->cur_entry)
-        ptr+=doc->cur_col;
-      while (ch=*ptr++)
-        if (abort_on_dbl_colon && ch==':') {
-          if (++colons==2)
-            goto sf_done;
-        } else {
-          colons=0;
-          if (ch=='{')
-            levels++;
-          else if (ch=='}' && !levels--)
-            goto sf_done;
-        }
-    }
-    doc_e=doc_e->next;
-  }
-sf_done:
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-#define RSAC_REPLACE    0
-#define RSAC_SKIP       1
-#define RSAC_ALL        2
-
-I64 PopUpReplaceSkipAllCancel(U8 *header=NULL,U8 *footer=NULL)
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header) DocPrint(doc,"%s",header);
-  DocPrint(doc,"$CM+LX,1,4$$BT,\"REPLACE\",LE=RSAC_REPLACE$"
-        "$CM+LX,17,0$$BT,\"SKIP\",LE=RSAC_SKIP$"
-        "$CM+LX,1,3$$BT,\"ALL\",LE=RSAC_ALL$"
-        "$CM+LX,17,0$$BT,\"CANCEL\",LE=DOCM_CANCEL$\n");
-  if (footer) DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 EdFindReplace(CDoc *doc)
-{
-  Bool found,unlock;
-  I64 cmd,i,j,plen,rlen,dlen,res=-1,sf_flags;
-  U8 *src,*dst,*dst2;
-  CDocEntry *doc_ce,*doc_e,*doc_marker=NULL;
-  if (doc->find_replace->pmt)
-    cmd=RSAC_REPLACE;
-  else
-    cmd=RSAC_ALL;
-  if (!doc->find_replace->pmt || DocForm(doc->find_replace)) {
-    res=0;
-    unlock=DocLock(doc);
-    if (doc->find_replace->match_case || doc->find_replace->local_var)
-      sf_flags=0;
-    else
-      sf_flags=SFF_IGNORE_CASE;
-    if (doc->find_replace->whole_labels || doc->find_replace->local_var)
-      sf_flags|=SFG_WHOLE_LABELS;
-
-    if (i=doc->find_replace->filter_lines) {
-      doc_ce=doc->head.next;
-      while (doc_ce!=doc) {
-        if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
-              !(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
-              StrFind(doc->find_replace->find_text,doc_ce->tag,sf_flags)) {
-          doc_ce->type|=DOCET_SEL;
-          res++;
-        } else
-          doc_ce->type&=~DOCET_SEL;
-        doc_ce=doc_ce->next;
-      }
-
-      doc_ce=doc->head.next;
-      while (doc_ce!=doc) {
-        if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) {
-          found=FALSE;
-
-          doc_e=doc_ce;
-          while (doc_e!=doc && doc_e->y>doc_ce->y-i) {
-            if (doc_e->type&DOCET_SEL) {
-              found=TRUE;
-              break;
-            } else
-              doc_e=doc_e->last;
-          }
-
-          if (!found) {
-            doc_e=doc_ce;
-            while (doc_e!=doc && doc_e->y<doc_ce->y+i) {
-              if (doc_e->type&DOCET_SEL) {
-                found=TRUE;
-                break;
-              } else
-                doc_e=doc_e->next;
-            }
-          }
-
-          if (!found)
-            doc_ce->de_flags|=DOCEF_FILTER_SKIP;
-        }
-
-        doc_ce=doc_ce->next;
-      }
-      EdSelAll(doc,FALSE);
-      goto fr_unlock_done;
-    }
-
-    if (doc->find_replace->local_var)
-      EdSelFun(doc);
-
-    if (!doc->find_replace->replace && !doc->find_replace->local_var) {
-      EdFindNext(doc);
-      goto fr_unlock_done;
-    }
-    plen=StrLen(doc->find_replace->find_text);
-    if (!plen)
-      goto fr_unlock_done;
-    rlen=StrLen(doc->find_replace->replace_text);
-    if (doc->head.next!=doc) {
-      doc_e=doc_marker=DocSplitTag(doc,doc->cur_entry,doc->cur_col,
-            doc->cur_entry->x+doc->cur_col,doc->cur_entry->y,DOCT_MARKER);
-      do {
-        if (doc_e==doc) {
-          if (doc->find_replace->scan_fwd)
-            doc_e=doc_e->next;
-          else
-            doc_e=doc_e->last;
-          if (doc_e==doc_marker)
-            break;
-        }
-        if (doc_e->type_u8==DOCT_TEXT &&
-              !(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
-              (doc_e->type & DOCET_SEL ||
-              !doc->find_replace->scan_sel_text&&
-              !doc->find_replace->local_var)) {
-          src=doc_e->tag;
-          while (src) {
-            src=StrFind(doc->find_replace->find_text,src,sf_flags);
-            if (src) {
-              doc->cur_col=src-doc_e->tag;
-              doc->cur_entry=doc_e;
-              if (cmd!=RSAC_ALL)
-                DocCenter(doc);
-              if (cmd!=RSAC_ALL) {
-                DocUnlock(doc);
-                cmd=PopUpReplaceSkipAllCancel("");
-                DocLock(doc);
-                if (cmd<0)
-                  goto fr_unlock_done;
-              }
-              doc_e=doc->cur_entry;
-              src=doc->cur_col+doc_e->tag;
-              if (cmd==RSAC_REPLACE || cmd==RSAC_ALL) {
-                dlen=StrLen(doc_e->tag);
-                doc_e->max_col=dlen+rlen-plen;
-                dst=MAlloc(doc_e->max_col+1,doc->mem_task);
-                dst2=dst;
-                j=src-doc_e->tag;
-                for (i=0;i<j;i++)
-                  *dst++=doc_e->tag[i];
-                for (i=0;i<rlen;i++)
-                  *dst++=doc->find_replace->replace_text[i];
-                src=dst;
-                for (i=j+plen;i<=dlen;i++)
-                  *dst++=doc_e->tag[i];
-                Free(doc_e->tag);
-                doc_e->tag=dst2;
-                doc->cur_col=src-doc_e->tag;
-                doc->cur_entry=doc_e;
-                if (cmd!=RSAC_ALL) {
-                  DocRemSoftNewLines(doc,doc->cur_entry);
-                  DocRecalc(doc);
-                }
-                doc_e=doc->cur_entry;
-                src=doc->cur_col+doc_e->tag;
-                res++;
-              } else
-                src++;
-            }
-          }
-        }
-        if (doc->find_replace->scan_fwd)
-          doc_e=doc_e->next;
-        else
-          doc_e=doc_e->last;
-      } while (doc_e!=doc_marker);
-    }
-fr_unlock_done:
-    if (doc_marker)
-      DocEntryDel(doc,doc_marker);
-    DocRemSoftNewLines(doc,NULL);
-    DocRecalc(doc);
-    DocCenter(doc);
-    if (unlock)
-      DocUnlock(doc);
-  }
-  return res;
-}
-
-public I64 EdReplace(CDoc *doc,U8 *find,U8 *replace,
-Bool sel=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
-{//Find & replace using editor's cmd.
-  CEdFindText old_find_replace;
-  Bool unlock;
-  I64 i,res=-1;
-  if (!doc) return -1;
-  unlock=DocLock(doc);
-  MemCpy(&old_find_replace,doc->find_replace,sizeof(CEdFindText));
-  MemSet(doc->find_replace,0,sizeof(CEdFindText));
-  i=StrLen(find);
-  if (i<sizeof(CEdFindText.find_text)) {
-    MemCpy(doc->find_replace->find_text,find,i+1);
-    i=StrLen(replace);
-    if (i<sizeof(CEdFindText.replace_text)) {
-      MemCpy(doc->find_replace->replace_text,replace,i+1);
-      doc->find_replace->replace=TRUE;
-      doc->find_replace->scan_sel_text=sel;
-      doc->find_replace->match_case=match_case;
-      doc->find_replace->whole_labels=whole_labels;
-      doc->find_replace->pmt=FALSE;
-      res=EdFindReplace(doc);
-    }
-  }
-  MemCpy(doc->find_replace,&old_find_replace,sizeof(CEdFindText));
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-class CEdLineGoTo
-{
-  I64 line format "$DA,A=\"Go to Line:%d\"$";
-};
-
-U0 EdGoToLine(CDoc *doc)
-{//Prompt with form and go to line num.
-  CEdLineGoTo gtl;
-  gtl.line=1;
-  if (DocForm(&gtl))
-    DocGoToLine(doc,gtl.line);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocForm.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocForm.HC.HTML deleted file mode 100755 index 4833647..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocForm.HC.HTML +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Form"
-
-U0 DocFormFwd(CDoc *doc,Bool giveup=FALSE)
-{
-  CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e;
-  if (doc->flags & DOCF_FORM) {
-    if (doc_e==doc) goto ff_recover;
-    while (!Bt(doldoc.type_flags_form,doc_e->type_u8) &&
-          !(doc_e->de_flags&DOCEF_LINK) ||
-          doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
-      doc_e=doc_e->next;
-      if (doc_e==doc) {
-ff_recover:
-        doc->cur_col=0;
-        if (!giveup) {
-          doc->cur_entry=doc_e->last;
-          DocFormBwd(doc,TRUE);
-        } else
-          doc->cur_entry=doc;
-        return;
-      }
-    }
-  }
-  while (doc_e->type_u8==DOCT_INDENT)
-    doc_e=doc_e->next;
-  if (doc_e!=doc_e2) {
-    doc->cur_col=doc_e->min_col;
-    doc->cur_entry=doc_e;
-  }
-}
-
-U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE)
-{
-  CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e;
-  if (doc->flags & DOCF_FORM) {
-    while (!Bt(doldoc.type_flags_form,doc_e->type_u8) &&
-          !(doc_e->de_flags&DOCEF_LINK) ||
-          doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
-      doc_e=doc_e->last;
-      if (doc_e==doc) {
-        doc->cur_col=0;
-        if (!giveup) {
-          doc->cur_entry=doc_e->next;
-          DocFormFwd(doc,TRUE);
-        } else
-          doc->cur_entry=doc;
-        return;
-      }
-    }
-  }
-  while (doc_e->type_u8==DOCT_INDENT)
-    doc_e=doc_e->next;
-  if (doc_e!=doc_e2) {
-    doc->cur_col=doc_e->min_col;
-    doc->cur_entry=doc_e;
-  }
-}
-
-U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
-{
-  I64 i;
-  U8 *ptr,*ptr2;
-  CHashDefineStr *tmph;
-  if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
-        doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
-    if (d==DOCM_CANCEL) {
-      if (doc_e->de_flags&DOCEF_DEREF_DATA &&
-            !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) {
-        if (!(ptr=doc_e->data)) return;
-      } else
-        ptr=&doc_e->data;
-      switch (doc_e->raw_type) {
-        case RT_I0:
-        case RT_U0:     d=0;            break;
-        case RT_I8:     d=*ptr(I8 *);   break;
-        case RT_U8:     d=*ptr(U8 *);   break;
-        case RT_I16:    d=*ptr(I16 *);  break;
-        case RT_U16:    d=*ptr(U16 *);  break;
-        case RT_I32:    d=*ptr(I32 *);  break;
-        case RT_U32:    d=*ptr(U32 *);  break;
-        default:        d=*ptr(I64 *);
-      }
-    }
-    if (doc_e->type_u8==DOCT_DATA) {
-      if (doc_e->de_flags & DOCEF_REMALLOC_DATA) {
-        ptr=MStrPrint(doc_e->aux_str,d,doc_e->my_fmt_data);
-        i=StrLen(ptr);
-        if (!doc_e->data) {
-          doc_e->data=CAlloc(2,doc->mem_task);
-          doc_e->len=MSize(doc_e->data)-2;
-        }
-        if (doc_e->len+doc_e->min_col>i)
-          MemCpy(doc_e->tag,ptr,i+1);
-        else {
-          ptr2=MAlloc(i+8,doc->mem_task);
-          doc_e->len=MSize(ptr2)-doc_e->min_col-2;       //See DataTagWidth
-          MemCpy(ptr2,ptr,i+1);
-          Free(doc_e->tag);
-          doc_e->tag=ptr2;
-        }
-        Free(ptr);
-      } else {
-        StrPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data);
-        i=StrLen(doc_e->tag);
-      }
-      if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) {
-        doc_e->tag[i++]='_';
-        doc_e->tag[i]=0;
-      }
-      doc_e->max_col=i;
-    } else if (doc_e->de_flags & DOCEF_LST) {
-      if (doc_e->de_flags & DOCEF_DEFINE && (tmph=HashFind(doc_e->define_str,
-            doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<tmph->cnt) {
-        ptr=MStrPrint("[%s]",tmph->sub_idx[d]);
-        Free(doc_e->tag);
-        doc_e->tag=StrNew(ptr,doc->mem_task);
-        Free(ptr);
-      } else {
-        Free(doc_e->tag);
-        doc_e->tag=StrNew("[]",doc->mem_task);
-      }
-    } else {
-      if (d)
-        doc_e->de_flags|=DOCEF_CHECKED_COLLAPSED;
-      else
-        doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED;
-    }
-  }
-}
-
-U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
-{
-  I64 i,d;
-  U8 *ptr,*ptr1,*ptr2;
-  CHashDefineStr *tmph;
-  if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
-        doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
-    if (doc_e->de_flags&DOCEF_DEREF_DATA &&
-          !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) {
-      if (!(ptr=doc_e->data)) return;
-    } else
-      ptr=&doc_e->data;
-    if (doc_e->type_u8==DOCT_DATA) {
-      i=StrLen(doc_e->tag);
-      if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
-        doc_e->tag[--i]=0;
-      if (i>doc_e->len+doc_e->min_col)
-        doc_e->tag[doc_e->len+doc_e->min_col]=0;
-      if (RT_I8<=doc_e->raw_type<=RT_U32) {
-        StrScan(doc_e->tag,doc_e->aux_str,&d,doc_e->my_fmt_data);
-        if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
-          doc_e->tag[i]='_';
-      } else if (RT_I64<=doc_e->raw_type<=RT_UF64) {
-        if (doc_e->de_flags & DOCEF_REMALLOC_DATA) {
-          ptr=MAlloc(i-doc_e->min_col+8,doc->mem_task);
-          MemCpy(ptr,doc_e->tag+doc_e->min_col,i-doc_e->min_col+1);
-          Free(doc_e->data);
-          doc_e->data=ptr;
-          doc_e->len=MSize(ptr)-1;
-        } else
-          StrScan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data);
-        if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
-          doc_e->tag[i]='_';
-        return;
-      }
-    } else if (doc_e->de_flags & DOCEF_LST) {
-      d=0;
-      if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE &&
-            (tmph=HashFind(doc_e->define_str,
-            doc->win_task->hash_table,HTT_DEFINE_STR))) {
-        ptr1=ptr2=StrNew(doc_e->tag);
-        if (*ptr2=='[') {
-          ptr2++;
-          i=StrLen(ptr2);
-          if (ptr2[i-1]==']')
-            ptr2[i-1]=0;
-        }
-        d=LstMatch(ptr2,tmph->data);
-        Free(ptr1);
-      }
-    } else {
-      if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED)
-        d=TRUE;
-      else
-        d=FALSE;
-    }
-    switch (doc_e->raw_type) {
-      case RT_I8:
-      case RT_U8:
-        *ptr(U8 *)=d;
-      case RT_I0:
-      case RT_U0:
-        break;
-      case RT_I16:
-      case RT_U16:
-        *ptr(U16 *)=d;
-        break;
-      case RT_I32:
-      case RT_U32:
-        *ptr(U32 *)=d;
-        break;
-      default:
-        *ptr(I64 *)=d;
-    }
-  }
-}
-
-#help_index "DolDoc/Input;StdIn/DolDoc"
-public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
-    I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL)
-{//User input. Supply a class name that has format definitions.
-//See ::/Demo/DolDoc/Form.HC and ::/Demo/LastClass.HC.
-  CMemberLst *ml;
-  CDocEntry *doc_e;
-  U8 *format;
-  CHashClass *tmpc,*tmpc2;
-  CDoc *doc;
-  Bool res=FALSE;
-  I64 old_border_src=Fs->border_src,has_action;
-  if (!(tmpc=HashFind(class_name,Fs->hash_table,HTT_CLASS)))
-    return FALSE;
-  doc=DocNew;
-  doc->desc='Form';
-  if (header) DocPrint(doc,"%s",header);
-  doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
-  if (dof_flags&DOF_SIZE_MIN)
-    doc->flags|=DOCF_SIZE_MIN;
-  ml=tmpc->member_lst_and_root;
-  while (ml) {
-    if ((format=MemberMetaData("format",ml)) &&
-          (doc_e=DocPrint(doc,"%s",format))) {
-      tmpc2=ml->member_class;
-      if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST ||
-            doc_e->type_u8==DOCT_CHECK_BOX) && !tmpc2->ptr_stars_cnt) {
-        tmpc2=OptClassFwd(tmpc2);
-        tmpc2-=tmpc2->ptr_stars_cnt;
-        if (tmpc2->type & HTT_INTERNAL_TYPE) {
-          if (ml->dim.next) { //Array
-            if (tmpc2->raw_type==RT_U8 &&
-                  LBtr(&doc_e->de_flags,&DOCEf_DFT_LEN)) {
-              doc_e->len=ml->dim.total_cnt;
-              if (doc_e->de_flags&DOCEF_HAS_TERMINATOR)
-                doc_e->len--;
-              Free(doc_e->tag);  //See DataTagWidth
-              doc_e->tag=MAlloc(doc_e->len+doc_e->min_col+2,
-                    doc->mem_task); //+2 because "_\0"
-            }
-          } else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE))
-            doc_e->raw_type=tmpc2->raw_type;
-        }
-      }
-      if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
-        doc_e->user_data=_d+ml->offset;
-        doc_e->data=*doc_e->user_data(U8 **);
-      } else
-        doc_e->data=_d+ml->offset;
-      doc_e->my_fmt_data=MemberMetaData("data",ml);
-      DocDataFmt(doc,doc_e);
-    }
-    ml=ml->next;
-  }
-  if (footer) DocPrint(doc,"%s",footer);
-  if (doc->head.next!=doc)      {
-    Fs->border_src=BDS_CONST;
-    DocRecalc(doc);
-    if (DocEd(doc,dof_flags)) {
-      doc_e=doc->cur_entry;
-      res=TRUE;
-      if (doc_e!=doc) {
-        if (DocEntryRun(doc,doc_e,TRUE,&has_action)==DOCM_CANCEL && has_action)
-          res=FALSE;
-        DocUnlock(doc);
-      }
-    }
-  }
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
-      *doc_e->user_data(U8 **)=doc_e->data;
-      doc_e->data=NULL;
-    }
-    doc_e=doc_e->next;
-  }
-  DocDel(doc);
-  Fs->border_src=old_border_src;
-  return res;
-}
-
-U0 DocMenuEndTaskCB()
-{
-  WinToTop;
-  throw;
-}
-
-public I64 DocMenu(CDoc *m,I64 dof_flags=0)
-{//Run menu chooser doc. Returns menu doc unlocked.
-  U8 *old_end_cb=Fs->task_end_cb;
-  Bool old_break_shift_esc=LBts(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC);
-  CDocEntry *doc_e;
-  I64 old_border_src=Fs->border_src,res=DOCM_CANCEL,has_action;
-  Fs->task_end_cb=&DocMenuEndTaskCB;
-  try {
-    if (m) {
-      m->desc='Menu';
-      Fs->border_src=BDS_CONST;
-dm_restart:
-      if (DocEd(m,dof_flags)) {
-        doc_e=m->cur_entry;
-        if (doc_e!=m) {
-          res=DocEntryRun(m,doc_e,TRUE,&has_action);
-          DocUnlock(m);
-          if (!has_action) {
-            res=DOCM_CANCEL;
-            dof_flags|=DOF_DONT_HOME;
-            goto dm_restart;
-          }
-        }
-      }
-    }
-  } catch {
-    if (!Fs->except_ch) {
-      if (!(dof_flags & DOF_INTERCEPT_TASK_END))
-        Exit;
-      Fs->catch_except=TRUE;
-    }
-  }
-  LBEqu(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC,old_break_shift_esc);
-  Fs->border_src=old_border_src;
-  Fs->task_end_cb=old_end_cb;
-  return res;
-}
-
-public I64 PopUpMenu(CDoc *doc,I64 dof_flags=0)
-{//Run menu chooser doc in PopUp win task.
-  doc->flags|=DOCF_SIZE_MIN | DOCF_FORM;
-  return PopUpPrint("DocMenu(0x%X,0x%X);",doc,dof_flags);
-}
-
-public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
-        I64 dof_flags=DOF_SIZE_MIN,U8 *header=NULL,U8 *footer=NULL)
-{//See ::/Demo/DolDoc/Form.HC and ::/Demo/LastClass.HC.
-  return PopUpPrint("DocForm(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name,
-        dof_flags,header,footer);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocGet.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocGet.HC.HTML deleted file mode 100755 index 0ed7ea4..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocGet.HC.HTML +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-U0 EdUndoFilter(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_ce=doc->head.next;
-  while (doc_ce!=doc) {
-    doc_ce->de_flags&=~DOCEF_FILTER_SKIP;
-    doc_ce=doc_ce->next;
-  }
-  doc->find_replace->filter_lines=0;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public I64 DocGetKey(I64 *_sc=NULL)
-{//Called by View. You probably don't need this.
-  I64 ch,sc;
-  Bool cont,old_key_desc;
-  do {
-    old_key_desc=LBtr(&Fs->win_inhibit,WIf_SELF_KEY_DESC);
-    do ch=GetKey(&sc,TRUE);
-    while (sc&SCF_KEY_DESC);
-    LBEqu(&Fs->win_inhibit,WIf_SELF_KEY_DESC,old_key_desc);
-
-    DocRecalc(DocPut);
-    cont=FALSE;
-    if ((ch==CH_ESC || ch==CH_SHIFT_ESC) && //Check for exit filter mode
-          DocPut && DocPut->find_replace->filter_lines) {
-      EdUndoFilter(DocPut);
-      cont=TRUE;
-    }
-  } while (cont);
-  if (_sc) *_sc=sc;
-  return ch;
-}
-
-#help_index "DolDoc/Input;StdIn/DolDoc"
-public U8 *DocScanLine(CDoc *doc,CDocEntry *doc_e,
-        I64 *cur_col=NULL,CDocEntry **_do_e_end=NULL)
-{//Start at entry in doc,make and return one line as str.
-  CDocEntry *doc_e2=doc_e;
-  Bool unlock=DocLock(doc);
-  U8 *dst,*src,*start,*res;
-  I64 i=0;
-  if (cur_col)
-    *cur_col=-1;
-  while (doc_e2!=doc && doc_e2->type_u8!=DOCT_NEW_LINE) {
-    if (doc_e2->de_flags&DOCEF_TAG && doc_e2->tag) {
-      src=doc_e2->tag;
-      i+=StrLen(src);
-    } else if (doc_e2->type_u8==DOCT_TAB)
-      i++;
-    else if (doc_e2->type_u8==DOCT_SHIFTED_X ||
-          doc_e2->type_u8==DOCT_SHIFTED_Y) {
-      if (doc_e2->attr<0)
-        i++;
-      i+=6; //$SY,3$
-    }
-    doc_e2=doc_e2->next;
-  }
-  res=MAlloc(i+1);
-  dst=res;
-  while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) {
-    start=dst;
-    if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) {
-      src=doc_e->tag;
-      while (*src)
-        *dst++=*src++;
-    } else if (doc_e->type_u8==DOCT_TAB)
-      *dst++='\t';
-    else if (doc_e->type_u8==DOCT_SHIFTED_Y) {
-      *dst(U32 *)++='$SY,';
-      if (doc_e->attr<0)
-        *dst++='-';
-      *dst++='0'+AbsI64(doc_e->attr); //Supposedly -7 to 7 (single digit)
-      *dst++='$';
-    } else if (doc_e->type_u8==DOCT_SHIFTED_X) {
-      *dst(U32 *)++='$SX,';
-      if (doc_e->attr<0)
-        *dst++='-';
-      *dst++='0'+AbsI64(doc_e->attr); //Supposedly -7 to 7 (single digit)
-      *dst++='$';
-    }
-    if (doc_e==doc->cur_entry && cur_col)
-      *cur_col=start-res+doc->cur_col;
-    doc_e=doc_e->next;
-  }
-  if (_do_e_end) *_do_e_end=doc_e;
-  *dst=0;
-  if (doc_e==doc->cur_entry && cur_col && !doc->cur_col)
-    *cur_col=dst-res;
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-U8 *DocGetStr2(I64 flags=0)
-{//Flags
-  CDoc *doc;
-  CDocEntry *doc_e,*doc_e_end;
-  U8 *st,*st2,*res;
-  I64 ch,sc;
-  "$PT$";
-  do {
-    ch=DocGetKey(&sc);
-    if (ch==CH_ESC) {
-      if (doc=DocPut) {
-        DocLock(doc);
-        if (doc->doc_signature==DOC_SIGNATURE_VAL && doc->cur_entry!=doc) {
-          doc_e=DocEntryCopy(doc,doc->cur_entry);
-          DocBottom(doc);
-          DocEntryRun(doc,doc_e,TRUE);
-          DocEntryDel(doc,doc_e);
-        }
-        DocUnlock(doc);
-      }
-      if (flags&GSF_WITH_NEW_LINE)
-        break;
-    } if (ch==CH_SHIFT_ESC) {
-      if (flags&GSF_SHIFT_ESC_EXIT)
-        Exit;
-      else {
-        res=StrNew("");
-        goto gs_done;
-      }
-    }
-//<CTRL-SHIFT-ENTER> is a blank line without entry
-  } while (flags&GSF_WITH_NEW_LINE || ch!='\n' ||
-        sc&SCF_CTRL && sc&SCF_SHIFT);
-
-  doc=DocPut;
-  DocLock(doc);
-  if (flags&GSF_WITH_NEW_LINE) {
-    doc_e=doc->cur_entry;
-    do doc_e=doc_e->last;
-    while (doc_e!=doc && doc_e->type_u8!=DOCT_PMT);
-    doc_e=doc_e->next;
-    if (res=DocScanLine(doc,doc_e,NULL,&doc_e_end)) {
-      while (doc_e_end!=doc && doc_e_end->type_u8==DOCT_NEW_LINE) {
-        st2=MStrPrint("%s\n",res);
-        Free(res);
-        res=st2;
-        if (st=DocScanLine(doc,doc_e_end->next,NULL,&doc_e_end)) {
-          st2=MStrPrint("%s%s",res,st);
-          Free(st);
-          Free(res);
-          res=st2;
-        }
-      }
-    }
-  } else {
-    doc_e=doc->cur_entry;
-    do doc_e=doc_e->last;
-    while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE &&
-          doc_e->type_u8!=DOCT_PMT);
-    if (doc_e!=doc && doc_e->type_u8!=DOCT_PMT) {
-      do doc_e=doc_e->last;
-      while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE &&
-            doc_e->type_u8!=DOCT_PMT);
-    }
-    doc_e=doc_e->next;
-    res=DocScanLine(doc,doc_e,NULL);
-  }
-  DocUnlock(doc);
-gs_done:
-  "$PT$$FG$$BG$";
-  return res;
-}
-
-#help_index "Keyboard Devices;Char/Input;StdIn"
-public I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=I64_MIN,I64 hi=I64_MAX)
-{//Prompt user for I64 expression.
-  Bool okay;
-  U8 *st;
-  I64 res;
-  while (TRUE) {
-    if (msg)
-      "" msg,dft;
-    st=GetStr;
-    if (!*st) {
-      Free(st);
-      return dft;
-    }
-    try {
-      res=ExePrint2("ToI64(%s);",st);
-      okay=TRUE;
-    } catch {
-      Fs->catch_except=TRUE;
-      okay=FALSE;
-    }
-    Free(st);
-    if (okay && lo<=res<=hi)
-      return res;
-  }
-}
-
-public F64 GetF64(U8 *msg=NULL,F64 dft=0,F64 lo=F64_MIN,F64 hi=F64_MAX)
-{//Prompt user for F64 expression.
-  Bool okay;
-  U8 *st;
-  F64 res;
-  while (TRUE) {
-    if (msg)
-      "" msg,dft;
-    st=GetStr;
-    if (!*st) {
-      Free(st);
-      return dft;
-    }
-    try {
-      res=ExePrint2("ToF64(%s);",st)(F64);
-      okay=TRUE;
-    } catch {
-      Fs->catch_except=TRUE;
-      okay=FALSE;
-    }
-    Free(st);
-    if (okay && lo<=res<=hi)
-      return res;
-  }
-}
-
-public CDate GetDate(U8 *msg=NULL,CDate dft=I64_MIN,
-        CDate lo=I64_MIN,CDate hi=I64_MAX)
-{//Prompt user for date expression. (Use Now() if you want current time.)
-  U8 *st;
-  CDate res;
-  if (dft==I64_MIN) dft=Now;
-  while (TRUE) {
-    if (msg)
-      "" msg,dft,dft;
-    st=GetStr;
-    if (!*st) {
-      Free(st);
-      return dft;
-    }
-    res=Str2Date(st);
-    Free(st);
-    if (res>=lo && res<=hi)
-      return res;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocGr.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocGr.HC.HTML deleted file mode 100755 index d1f1744..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocGr.HC.HTML +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Input"
-
-public I64 PopUpColor(U8 *header=NULL,
-        Bool allow_transparent=TRUE,Bool allow_dft=TRUE)
-{//Chooser for 16-color, default or transparent.
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header)
-    DocPrint(doc,"%s",header);
-  if (allow_transparent)
-    DocPrint(doc,"$MU,\"TRANSPARENT\",LE=TRANSPARENT$\n");
-  for (i=0;i<COLORS_NUM;i++)
-    DocPrint(doc,"$BG,%d$$MU,\"__%-8Z__\",LE=%d$$BG$\n",i,i,"ST_COLORS",i);
-  if (allow_dft)
-    DocPrint(doc,"$BG,WHITE$$MU,\"DEFAULT\",LE=DOC_DFT$$BG$");
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-public I64 PopUpColorLighting(U8 *header=NULL)
-{//Chooser for std TempleOS DCLighting() color.
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header)
-    DocPrint(doc,"%s",header);
-  DocPrint(doc,"\nSingle-Sided means front and back different."
-        "\nDouble-Sided means front and back same."
-        "\n"
-        "\nHalf-Range means 0 to [0,7]"
-        "\n                 [8,15]-8 to [8,15]"
-        "\nFull-Range means 0 to [0,7] to [0,7]+8"
-        "\n");
-  DocPrint(doc,
-        "\n$LTPURPLE$Single-Sided Full-Range Double-Sided Full-Range\n$BLACK$");
-  for (i=0;i<COLORS_NUM/2;i++) {
-    DocPrint(doc,"$BG,%d$$MU,\"__%-19Z__\",LE=%d$$BG$ ",i,i,"ST_COLORS",i);
-    DocPrint(doc,"$BG,%d$$MU,\"__%-19Z__\",LE=%d$$BG$\n",i,i,"ST_COLORS",
-          ROPF_TWO_SIDED+i);
-  }
-  DocPrint(doc,
-        "\n$LTPURPLE$Single-Sided Half-Range Double-Sided Half-Range\n$BLACK$");
-  for (i=0;i<COLORS_NUM;i++) {
-    DocPrint(doc,"$BG,%d$$MU,\"__%-19Z__\",LE=%d$$BG$ ",
-          i,i,"ST_COLORS",ROPF_HALF_RANGE_COLOR+i);
-    DocPrint(doc,"$BG,%d$$MU,\"__%-19Z__\",LE=%d$$BG$\n",
-          i,i,"ST_COLORS",ROPF_TWO_SIDED+ROPF_HALF_RANGE_COLOR+i);
-  }
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-class CTransformForm
-{
-  F64 x_scale   format "$DA-TRM,A=\"X Scale :%12.6f\"$\n";
-  F64 y_scale   format "$DA-TRM,A=\"Y Scale :%12.6f\"$\n";
-  F64 z_scale   format "$DA-TRM,A=\"Z Scale :%12.6f\"$\n";
-  F64 theta_z   format "\nAngles are in degrees\n"
-                       "$DA-TRM,A=\"Z-Axis  :%12.6f\"$\n";
-  F64 theta_y   format "$DA-TRM,A=\"Y-Axis  :%12.6f\"$\n";
-  F64 theta_x   format "$DA-TRM,A=\"X-Axis  :%12.6f\"$\n";
-  F64 x_offset  format "\n$DA-TRM,A=\"X Offset:%12.6f\"$\n";
-  F64 y_offset  format "$DA-TRM,A=\"Y Offset:%12.6f\"$\n";
-  F64 z_offset  format "$DA-TRM,A=\"Z Offset:%12.6f\"$\n";
-};
-
-#help_index "Graphics/Input;Graphics/Math/3D Transformation"
-public Bool PopUpTransform(I64 *r)
-{//Prompt for Mat4x4 transform.
-  CTransformForm *tf=MAlloc(sizeof(CTransformForm));
-  tf->x_scale=1.0;
-  tf->y_scale=1.0;
-  tf->z_scale=1.0;
-  tf->theta_x=0.0;
-  tf->theta_y=0.0;
-  tf->theta_z=0.0;
-  tf->x_offset=0.0;
-  tf->y_offset=0.0;
-  tf->z_offset=0.0;
-  if (PopUpForm(tf)) {
-    MemSet(r,0,16*sizeof(I64));
-    r[0] =tf->x_scale*GR_SCALE;
-    r[5] =tf->y_scale*GR_SCALE;
-    r[10]=tf->z_scale*GR_SCALE;
-    r[15]=GR_SCALE;
-
-    Mat4x4RotZ(r,tf->theta_z*pi/180.0);
-    Mat4x4RotY(r,tf->theta_y*pi/180.0);
-    Mat4x4RotX(r,tf->theta_x*pi/180.0);
-
-    r[3] =tf->x_offset*GR_SCALE;
-    r[7] =tf->y_offset*GR_SCALE;
-    r[11]=tf->z_offset*GR_SCALE;
-    return TRUE;
-  } else
-    return FALSE;
-}
-
-#help_index "Graphics/Input"
-#define PU_SPACING      10
-U0 DrawIt(CTask *task,CDC *dc)
-{
-  I64 i,j,i1,j1;
-  CDoc *doc=DocPut(task);
-  for (j=0;j<17;j++)
-    for (i=0;i<17;i++) {
-      if (j<16)
-        j1=j;
-      else
-        j1=TRANSPARENT;
-      if (i<16)
-        i1=i;
-      else
-        i1=TRANSPARENT;
-      dc->color=j1+i1<<16+ROPF_DITHER;
-      GrRect(dc,i*PU_SPACING,j*PU_SPACING+FramePtr("DitherFrame",task),
-            PU_SPACING,PU_SPACING);
-    }
-  i=(17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH;
-  if (doc->max_x>i) i=doc->max_x;
-  WinHorz(task->win_left,task->win_left+i,task);
-  WinVert(task->win_top,task->win_top+doc->max_y+
-        (17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH,task);
-}
-
-I64 DitherColor2(U8 *header=NULL)
-{
-  I64 msg_code,arg1,arg2,res=-1,i,j;
-  DocClear;
-  "%s",header;
-  DocRecalc(DocPut);
-  FramePtrAdd("DitherFrame",(DocPut->max_y+1)*FONT_HEIGHT);
-  SettingsPush; //See SettingsPush
-  Fs->draw_it=&DrawIt;
-  do {
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_KEY_DOWN);
-    if (msg_code==MSG_MS_L_DOWN) {
-      msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP);
-      i=arg1/PU_SPACING;
-      j=(arg2-FramePtr("DitherFrame"))/PU_SPACING;
-      if (arg1>=0 && arg2>=0 && 0<=j<17 && 0<=i<17) {
-        if (j==16) j=TRANSPARENT;
-        if (i==16) i=TRANSPARENT;
-        res=j+i<<16+ROPF_DITHER;
-        goto dc_done;
-      }
-    }
-  } while (!(msg_code==MSG_KEY_DOWN && (arg1==CH_ESC || arg1==CH_SHIFT_ESC)));
-  do GetMsg(&arg1,&arg2,1<<MSG_KEY_UP);
-  while (!arg1);
-dc_done:
-  SettingsPop;
-  FramePtrDel("DitherFrame");
-  return res;
-}
-
-public I64 PopUpColorDither(U8 *header=NULL)
-{//Chooser for 2 x 16 colors or transparent.
-  U8 buf[STR_LEN];
-  StrPrint(buf,"DitherColor2(0x%X);",header);
-  return PopUp(buf,Fs);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocHighlight.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocHighlight.HC.HTML deleted file mode 100755 index 08e5714..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocHighlight.HC.HTML +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Misc"
-
-CColorROPU32 highlight_hash_type_colors[HTt_TYPES_NUM]=
-        DOC_COLOR_EXPORT_SYS_SYM,0,DOC_COLOR_DEFINE_STR,DOC_COLOR_GLBL_VAR,
-        DOC_COLOR_CLASS,DOC_COLOR_KEYWORD,DOC_COLOR_FUN,0,0,DOC_COLOR_KEYWORD,
-        DOC_COLOR_KEYWORD,DOC_COLOR_KEYWORD,DOC_COLOR_REG,0,0,0,0};
-
-U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
-{//Be aware of ::/Demo/ToHtmlToTXTDemo/ToHtml.HC.
-  U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
-  U8 *ptr;
-  CDocSettings *s=&doc_e->settings;
-  I64 ch,ch1,last_ch,tmp_u32_attr,mask_tmp_u32_attr=_tmp_u32_attr&0xFFFFF000,
-        comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth;
-  CHash *tmph;
-  switch [s->state] {
-    case DOCSS_NORMAL:
-hl_normal:
-      while (len) {
-        while (len && !Bt(char_bmp_alpha_numeric,*src)) {
-          tmp_u32_attr=_tmp_u32_attr;
-          ch1=*src++;
-          switch (ch1) {
-            case '/':
-              if (len>=2) {
-                if (*src=='/') {
-                  tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
-                  *dst++=ch1+tmp_u32_attr;
-                  *dst++=*src++ +tmp_u32_attr;
-                  len-=2;
-                  goto hl_cpp_comment;
-                } else if (*src=='*') {
-                  tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
-                  *dst++=ch1+tmp_u32_attr;
-                  *dst++=*src++ +tmp_u32_attr;
-                  len-=2;
-                  comment_depth=1;
-                  goto hl_comment;
-                }
-              }
-              break;
-            case '\'':
-              tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
-              *dst++=ch1+tmp_u32_attr;
-              len--;
-              goto hl_single_quote;
-            case '\"':
-              tmp_u32_attr=DOC_COLOR_STR<<8|mask_tmp_u32_attr;
-              *dst++=ch1+tmp_u32_attr;
-              len--;
-              goto hl_dbl_quote;
-            case '(':
-              if (paren_depth++&1)
-                tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
-              break;
-            case ')':
-              if (--paren_depth&1)
-                tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
-              break;
-            case '{':
-              if (brace_depth++&1)
-                tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
-              break;
-            case '}':
-              if (--brace_depth&1)
-                tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
-              break;
-          }
-          *dst++=ch1+tmp_u32_attr;
-          if (!--len) goto hl_normal_done;
-        }
-        ptr=src;
-        while (len && Bt(char_bmp_alpha_numeric,*src)) {
-          src++;
-          len--;
-        }
-        ch=*src;
-        *src=0;
-        if (tmph=HashFind(ptr,adam_task->hash_table,
-              HTT_EXPORT_SYS_SYM|HTT_DEFINE_STR|HTT_GLBL_VAR|HTT_CLASS|
-              HTT_INTERNAL_TYPE|HTT_FUN|HTT_KEYWORD|HTT_ASM_KEYWORD|
-              HTT_OPCODE|HTT_REG))
-          tmp_u32_attr=highlight_hash_type_colors[HashTypeNum(tmph)]<<8|
-                mask_tmp_u32_attr;
-        else
-          tmp_u32_attr=_tmp_u32_attr;
-        while (ch1=*ptr++)
-          *dst++=ch1+tmp_u32_attr;
-        *src=ch;
-      }
-hl_normal_done:
-      s->state=DOCSS_NORMAL;
-      s->comment_depth=0;
-      break;
-    case DOCSS_SINGLE_QUOTE:
-      tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
-hl_single_quote:
-      last_ch=0;
-      while (len--) {
-        ch1=*src++;
-        *dst++=ch1+tmp_u32_attr;
-        if (last_ch!='\\' && ch1=='\'')
-          goto hl_normal;
-        if (last_ch=='\\' && ch1=='\\')
-          last_ch=0;
-        else
-          last_ch=ch1;
-      }
-      s->state=DOCSS_SINGLE_QUOTE;
-      s->comment_depth=0;
-      break;
-    case DOCSS_DBL_QUOTE:
-      tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
-hl_dbl_quote:
-      last_ch=0;
-      while (len--) {
-        ch1=*src++;
-        *dst++=ch1+tmp_u32_attr;
-        if (last_ch!='\\' && ch1=='\"')
-          goto hl_normal;
-        if (last_ch=='\\' && ch1=='\\')
-          last_ch=0;
-        else
-          last_ch=ch1;
-      }
-      s->state=DOCSS_DBL_QUOTE;
-      s->comment_depth=0;
-      break;
-    case DOCSS_COMMENT:
-      tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
-      comment_depth=s->comment_depth;
-hl_comment:
-      last_ch=0;
-      while (len--) {
-        ch1=*src++;
-        *dst++=ch1+tmp_u32_attr;
-        if (last_ch=='*' && ch1=='/') {
-          if (!--comment_depth)
-            goto hl_normal;
-        } else if (last_ch=='/' && ch1=='*')
-          comment_depth++;
-        last_ch=ch1;
-      }
-      s->state=DOCSS_COMMENT;
-      s->comment_depth=comment_depth;
-      break;
-    case DOCSS_CPP_Z_COMMENT:
-      tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
-hl_cpp_comment:
-      while (len--)
-        *dst++=*src++ +tmp_u32_attr;
-      s->state=DOCSS_CPP_Z_COMMENT;
-      s->comment_depth=0;
-      break;
-  }
-  s->paren_depth=paren_depth;
-  s->brace_depth=brace_depth;
-  *dst=0;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocInit.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocInit.HC.HTML deleted file mode 100755 index 3e23b4a..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocInit.HC.HTML +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-U0 DocInit()
-{//CMD Defines
-  CCmpCtrl *cc;
-  I64 i;
-  CHashGeneric *tmph;
-
-  DefineLstLoad("ST_DOC_CMDS",
-        "TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
-        "BG\0FD\0BD\0WW\0HL\0BK\0IV\0UL\0SX\0SY\0CM\0AN\0LK\0BT\0"
-        "DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HC\0ER\0");
-  DefineLstLoad("ST_DOC_FLAGS",
-        "T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
-        "LC\0LIS\0RC\0RIS\0LX\0CX\0RX\0TY\0CY\0BY\0"
-        "HL\0WW\0BK\0IV\0SEL\0UL\0"
-        "TC\0PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0UD\0P\0M\0"
-        "TRM\0Z\0H\0TR\0LS\0SK\0PU\0SIF\0FS\0NC\0DD\0DL\0DRT\0");
-  DefineLstLoad("ST_LINK_TYPES",
-        "FI\0FA\0FF\0FL\0MN\0PI\0PF\0PL\0BF\0DN\0HI\0AD\0AI\0AA\0AF\0AL\0");
-
-  doldoc.hash=HashTableNew(512);
-  HashDefineLstAdd("ST_DOC_CMDS",DHT_DOC_CMD,doldoc.hash);
-  HashDefineLstAdd("ST_DOC_FLAGS",DHT_DOC_FLAG,doldoc.hash);
-  HashDefineLstAdd("ST_COLORS",DHT_COLOR,doldoc.hash);
-
-  MemSet(doldoc.dft_de_flags,   0,sizeof(doldoc.dft_de_flags));
-  MemSet(doldoc.dft_type_flags, 0,sizeof(doldoc.dft_type_flags));
-  cc=CmpCtrlNew("TX+T;DA+P+TRM+T+DL+DRT;CM+LE+RE;AN+T;LK+L+UL+T;MA+X+UL+T;"
-        "MU+X+UL+T;BT+X+B+T;CB+CA+P+T+DRT;LS+LS+P+T+DRT;HX+P+Z;TR+TR+C+CA+UL+T;"
-        "SP+T;IB+T;IS+T;SO+T;HC+T;",CCF_DONT_FREE_BUF);
-  cc->htc.hash_table_lst=NULL;
-  Lex(cc);
-  while (cc->token==TK_IDENT) {
-    if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
-      i=tmph->user_data0;
-      Lex(cc);
-      PrsDocFlags(cc,&doldoc.dft_de_flags[i],&doldoc.dft_type_flags[i]);
-    }
-    if (cc->token==';')
-      Lex(cc);
-  }
-  CmpCtrlDel(cc);
-
-  for (i=0;i<DOCT_TYPES_NUM;i++)
-    doldoc.dft_de_flags[i]&=~DOCG_BL_IV_UL;
-
-  doldoc.type_flags_form[0]=0;
-  for (i=0;i<DOCT_TYPES_NUM;i++)
-    if (Bt(&doldoc.dft_de_flags[i],DOCEf_TAG) && i!=DOCT_TEXT || i==DOCT_HEX_ED)
-      Bts(doldoc.type_flags_form,i);
-
-      //Don't forget cmp_type_flags_src_code.
-  doldoc.type_flags_nontag_invis[0]=
-        1<<DOCT_PMT|
-        1<<DOCT_PAGE_LEN|
-        1<<DOCT_LEFT_MARGIN|
-        1<<DOCT_RIGHT_MARGIN|
-        1<<DOCT_HEADER|
-        1<<DOCT_FOOTER|
-        1<<DOCT_INDENT|
-        1<<DOCT_FOREGROUND|
-        1<<DOCT_BACKGROUND|
-        1<<DOCT_DFT_FOREGROUND|
-        1<<DOCT_DFT_BACKGROUND|
-        1<<DOCT_WORD_WRAP|
-        1<<DOCT_HIGHLIGHT|
-        1<<DOCT_BLINK|
-        1<<DOCT_INVERT|
-        1<<DOCT_UNDERLINE|
-        1<<DOCT_SHIFTED_X|
-        1<<DOCT_SHIFTED_Y|
-        1<<DOCT_SPRITE;
-
-  doldoc.type_flags_data[0]=1<<DOCT_DATA|1<<DOCT_HEX_ED|1<<DOCT_CHECK_BOX;
-
-  doldoc.type_flags_chk_dup[0]=
-        1<<DOCT_LEFT_MARGIN|
-        1<<DOCT_RIGHT_MARGIN|
-        1<<DOCT_HEADER|
-        1<<DOCT_FOOTER|
-        1<<DOCT_FOREGROUND|
-        1<<DOCT_BACKGROUND|
-        1<<DOCT_DFT_FOREGROUND|
-        1<<DOCT_DFT_BACKGROUND|
-        1<<DOCT_WORD_WRAP|
-        1<<DOCT_HIGHLIGHT|
-        1<<DOCT_BLINK|
-        1<<DOCT_INVERT|
-        1<<DOCT_UNDERLINE|
-        1<<DOCT_SHIFTED_X|
-        1<<DOCT_SHIFTED_Y;
-
-  Bts(doldoc.clean_scan_codes,SC_CURSOR_RIGHT);
-  Bts(doldoc.clean_scan_codes,SC_CURSOR_LEFT);
-  Bts(doldoc.clean_scan_codes,SC_CURSOR_UP);
-  Bts(doldoc.clean_scan_codes,SC_CURSOR_DOWN);
-  Bts(doldoc.clean_scan_codes,SC_PAGE_UP);
-  Bts(doldoc.clean_scan_codes,SC_PAGE_DOWN);
-  Bts(doldoc.clean_scan_codes,SC_ALT);
-  Bts(doldoc.clean_scan_codes,SC_CTRL);
-  Bts(doldoc.clean_scan_codes,SC_SHIFT);
-  Bts(doldoc.clean_scan_codes,SC_CAPS);
-  Bts(doldoc.clean_scan_codes,SC_NUM);
-  Bts(doldoc.clean_scan_codes,SC_SCROLL);
-  Bts(doldoc.clean_scan_codes,SC_HOME);
-  Bts(doldoc.clean_scan_codes,SC_END);
-  Bts(doldoc.clean_scan_codes,SC_GUI);
-  Bts(doldoc.clean_scan_codes,SC_BACKSPACE); //Handled specially
-}
-
-DocInit;
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocLink.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocLink.HC.HTML deleted file mode 100755 index 14a9ee1..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocLink.HC.HTML +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Link"
-
-/* See TempleOS Link Types.
-"filename"
-"FI:filename"
-"FA:haystack_filename,needle_anchor_str"
-"FF:haystack_filename,needle_str"
-"FF:haystack_filename,needle_str:occurnum"
-"FL:filename,linenum"
-"MN:SymName"
-"PI:filename"
-"PF:haystack_filename,needle_str"
-"PF:haystack_filename,needle_str:occurnum"
-"PL:filename,linenum"
-"BF:haystack_bible_book,needle_str"
-"DN:word"
-"DN:word,defnum"
-"HI:index"
-"AD:code_address_number"
-
-To edit a doc structure already in memory. See SpriteEdText().
-"AI:doc_address"
-"AA:haystack_doc_address,needle_anchor_str"
-"AF:haystack_doc_address,needle_str"
-"AF:haystack_doc_address,needle_str:occurnum"
-"AL:doc_address,linenum"
-*/
-
-#define LK_FILE         0
-#define LK_FILE_ANCHOR  1
-#define LK_FILE_FIND    2
-#define LK_FILE_LINE    3
-#define LK_MAN_PAGE     4
-#define LK_PLAIN        5
-#define LK_PLAIN_FIND   6
-#define LK_PLAIN_LINE   7
-#define LK_BIBLE_FIND   8
-#define LK_DEF          9
-#define LK_HELP_INDEX   10
-#define LK_ADDR         11
-#define LK_DOC          12 //See SpriteEdText()
-#define LK_DOC_ANCHOR   13
-#define LK_DOC_FIND     14
-#define LK_DOC_LINE     15
-#define LK_PLACE_ANCHOR 16
-
-public U8 *DocEntryLink(CDoc *doc,CDocEntry *doc_e)
-{//MAlloc new str, either tag or aux_str if link.
-  if (doc_e->de_flags&DOCEF_LINK) {
-    if (doc_e->de_flags & DOCEF_AUX_STR)
-      return StrNew(doc_e->aux_str,doc->mem_task);
-    else if (doc_e->de_flags & DOCEF_TAG)
-      return StrNew(doc_e->tag,doc->mem_task);
-  }
-  return NULL;
-}
-
-Bool DocFileEd(I64 _type,U8 *filename,
-        U8 *needle_str,I64 *_num,I64 edf_dof_flags)
-{
-  I64 type=_type,flags=0,old_border_src=Fs->border_src;
-  CDocEntry *doc_e;
-  CDoc *doc;
-  Bool old_silent=Bt(&Fs->display_flags,DISPLAYf_SILENT),
-        res=FALSE,other_found=FALSE;
-  U8 *st1,*st2;
-  try {
-    switch (type) {
-      case LK_PLAIN:
-        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
-      case LK_DOC:
-        type=LK_FILE;
-        break;
-      case LK_DOC_ANCHOR:
-        type=LK_FILE_ANCHOR;
-        break;
-      case LK_PLAIN_FIND:
-        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
-      case LK_DOC_FIND:
-        type=LK_FILE_FIND;
-        break;
-      case LK_PLAIN_LINE:
-        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
-      case LK_DOC_LINE:
-        type=LK_FILE_LINE;
-        break;
-      case LK_BIBLE_FIND:
-        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
-        break;
-    }
-
-    flags|=DOCF_ALLOW_UNDO;
-
-    if (LK_DOC<=_type<=LK_DOC_LINE) {
-      doc=Str2I64(filename);//See SpriteEdText()
-      res=TRUE;
-    } else {
-      st1=StrNew(filename);
-      st2=StrNew(filename);
-      StrLastRem(st1,"/",st2); //st2 is name without dir
-      if (!FileNameChk(st2))
-        doc=NULL;
-      else {
-        Silent;
-        if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
-          res=FileFind(filename,,
-                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
-        else if (!(res=FileFind(filename,,FUF_JUST_FILES)))
-          other_found=FileFind(filename,,
-                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
-        doc=DocRead(filename,flags);
-        doc->desc='Edit';
-        Silent(old_silent);
-        Fs->border_src=BDS_ED_FILENAME_DRV;
-      }
-      Free(st1);
-      Free(st2);
-    }
-    if (!doc||doc->doc_signature!=DOC_SIGNATURE_VAL)
-      res=FALSE;
-    else {
-      if (Bt(&edf_dof_flags,EDf_COLLAPSE))
-        DocCollapse(TRUE,doc);
-      else if (Bt(&edf_dof_flags,EDf_UNCOLLAPSE))
-        DocCollapse(FALSE,doc);
-
-      if (res || other_found)
-        switch (type) {
-          case LK_FILE_LINE:
-            res=DocGoToLine(doc,*_num);
-            break;
-          case LK_FILE_ANCHOR:
-            res=DocAnchorFind(doc,needle_str);
-            break;
-          case LK_FILE_FIND:
-            res=DocFind(doc,,needle_str,*_num);
-            break;
-          case LK_BIBLE_FIND:
-            res=DocFind(doc,*_num,needle_str);
-            break;
-          default:
-            DocCenter(doc);
-        }
-      *_num=doc->cur_entry->y+1;
-
-      if (edf_dof_flags&EDF_WAS_WRITE)
-        res=FALSE;
-      if (!(edf_dof_flags&EDF_BAIL)) {
-        if (*doc->filename.name)
-          doc->filename.dirc=DirContextNew(doc->filename.name);
-        else
-          doc->filename.dirc=NULL;
-        if (DocEd(doc,edf_dof_flags|DOF_DONT_HOME)) {
-          DocLock(doc);
-          doc_e=doc->cur_entry;
-          if (doc_e!=doc)
-            DocEntryRun(doc,doc_e,TRUE);
-          DocUnlock(doc);
-          if (!(LK_DOC<=_type<=LK_DOC_LINE)) {
-            DocWrite(doc);
-            if (edf_dof_flags&EDF_WAS_WRITE)
-              res=TRUE;
-          }
-        }
-        DirContextDel(doc->filename.dirc);
-      }
-      if (!(LK_DOC<=_type<=LK_DOC_LINE))
-        DocDel(doc);
-    }
-  } catch {
-    Silent(old_silent);
-    res=FALSE;
-  }
-  Fs->border_src=old_border_src;
-  return res;
-}
-
-#define DFT_ADDR_LINK_BIN_SIZE  64
-
-public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
-        I64 *_num=NULL,I64 edf_dof_flags=0)
-{//Editor Link--> filename, needle_str and line number.
-  U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
-  I64 res,i,num=1;
-  CHashSrcSym *tmph;
-  if (!link_st||!*link_st) {
-    if (edf_dof_flags&EDF_BAIL)
-      return -1;
-    link_st=blkdev.tmp_filename;
-  }
-  st=StrNew(link_st);
-  res=LK_FILE;
-  if (StrLen(st)>3 && st[2]==':') {
-    st[2]=0;
-    filename2=st+3;
-    switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
-      case LK_MAN_PAGE:
-        if (tmph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
-          res=EdLinkCvt(tmph->src_link,&filename,
-                &needle_str,&num,edf_dof_flags);
-        else
-          res=-1;
-        goto lc_done;
-      case LK_ADDR:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          i=Str2I64(ptr+1);
-        } else
-          i=DFT_ADDR_LINK_BIN_SIZE;
-        if (ptr=SrcEdLink(ExePrint("%s;",filename2),i)) {
-          res=EdLinkCvt(ptr,&filename,&needle_str,&num,edf_dof_flags);
-          Free(ptr);
-        } else
-          res=-1;
-        goto lc_done;
-      case LK_DEF:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          i=Str2I64(ptr+1);
-        } else
-          i=-1;
-        filename=StrNew(filename2);
-        num=i;
-        goto lc_done;
-      case LK_HELP_INDEX:
-        filename=StrNew(filename2);
-        goto lc_done;
-      case LK_BIBLE_FIND:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          src=ptr+1;
-          while (*src) { //We do not allow ending verse
-            if (*src=='-')
-              *src=0;
-            src++;
-          }
-          needle_str=StrNew(ptr+1);
-        }
-        i=DefineMatch(filename2,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE);
-        if (i<0)
-          res=-1;
-        else {
-          num=Str2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
-          filename2=BIBLE_FILENAME;
-        }
-        break;
-      case LK_FILE_LINE:
-      case LK_PLAIN_LINE:
-      case LK_DOC_LINE:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          num=Str2I64(ptr+1);
-        }
-        break;
-      case LK_FILE_ANCHOR:
-      case LK_DOC_ANCHOR:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          needle_str=StrNew(ptr+1);
-        }
-        break;
-      case LK_FILE_FIND:
-      case LK_PLAIN_FIND:
-      case LK_DOC_FIND:
-        if (ptr=StrLastOcc(filename2,",")) {
-          *ptr=0;
-          needle_str=StrNew(ptr+1);
-          if (ptr=StrLastOcc(needle_str,":")) {
-            *ptr=0;
-            num=Str2I64(ptr+1);
-          }
-        }
-        break;
-    }
-  } else
-    filename2=st;
-  if (res>=0) {
-    if (LK_DOC<=res<=LK_DOC_LINE)
-      filename=StrNew(filename2); //Holds document address as number.
-    else
-      filename=FileNameAbs(filename2,FUF_Z_OR_NOT_Z);
-  }
-lc_done:
-  Free(st);
-  if (_filename)
-    *_filename=filename;
-  else
-    Free(filename);
-  if (_needle_str)
-    *_needle_str=needle_str;
-  else
-    Free(needle_str);
-  if (_num)
-    *_num=num;
-  return res;
-}
-
-public Bool DocLinkChk(CDoc *doc,U8 *link_st)
-{//Check for bad Editor Link.
-  U8 *filename,*st;
-  Bool res=FALSE;
-  CDirContext *dirc;
-  if (link_st) {
-    st=FileNameAbs(doc->filename.name);
-    dirc=DirContextNew(st);
-    Free(st);
-    switch (EdLinkCvt(link_st,&filename)) {
-      case -1:
-        break;
-      case LK_FILE_LINE:
-      case LK_PLAIN_LINE:
-      case LK_FILE:
-//We don't check line number
-        res=FileFind(filename,,
-              FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
-        break;
-      case LK_BIBLE_FIND:
-        st=StrNew(link_st+3);
-        if (StrOcc(st,','))
-          StrLastRem(st,",");
-        if (DefineMatch(st,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE)>=0)
-          res=TRUE;
-        Free(st);
-        break;
-      default://TODO: Need to validate HI: and DN:
-        if (Ed(link_st,EDF_BAIL))
-          res=TRUE;
-    }
-    Free(filename);
-    DirContextDel(dirc);
-  }
-  return res;
-}
-
-public U8 *DocLinkFile(U8 *link_st,CTask *mem_task=NULL)
-{//Return the file for an Editor Link Types.
-  U8 *filename=NULL,*st,*res=NULL;
-  if (link_st) {
-    switch (EdLinkCvt(link_st,&filename)) {
-      case LK_FILE:
-      case LK_FILE_ANCHOR:
-      case LK_FILE_FIND:
-      case LK_FILE_LINE:
-      case LK_PLAIN:
-      case LK_PLAIN_FIND:
-      case LK_PLAIN_LINE:
-        st=FileNameAbs(filename,FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
-        res=StrNew(st);
-        Free(st);
-        break;
-      case LK_BIBLE_FIND:
-        res=StrNew(BIBLE_FILENAME,mem_task);
-        break;
-    }
-    Free(filename);
-  }
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocMacro.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocMacro.HC.HTML deleted file mode 100755 index 3af88d9..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocMacro.HC.HTML +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Misc"
-
-U8 captured_macro_name[STR_LEN];
-StrCpy(captured_macro_name,"Test");
-
-I64 sys_macro_repeat_n=1;
-
-U0 SysMacroStripKey(CJob *macro_head,I64 arg1,I64 arg2)
-{
-  CJob *tmpc,*tmpc1;
-  tmpc=macro_head->next;
-  while (tmpc!=macro_head) {
-    tmpc1=tmpc->next;
-    if (tmpc->job_code==JOBT_MSG &&
-          (tmpc->msg_code==MSG_KEY_DOWN || tmpc->msg_code==MSG_KEY_UP ||
-          tmpc->msg_code==MSG_KEY_DOWN_UP) &&
-          arg1 && tmpc->aux1==arg1 || !arg1 && tmpc->aux2==arg2) {
-      QueRem(tmpc);
-      JobDel(tmpc);
-    }
-    tmpc=tmpc1;
-  }
-}
-
-#define MT_NULL 0
-#define MT_MSG  1
-#define MT_CHAR 2
-
-class CMacroTmp
-{
-  CMacroTmp *next,*last;
-  I64 type;
-  U8 buf[STR_LEN];
-};
-
-CMacroTmp *Cmd2MT(CJob *tmpc)
-{
-  U8 buf[8];
-  CMacroTmp *tmpmt=CAlloc(sizeof(CMacroTmp));
-  if (Bt(char_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
-    tmpmt->type=MT_CHAR;
-    buf[0]=tmpc->aux1;
-    buf[1]=0;
-    StrPrint(tmpmt->buf,"%Q",buf);
-  } else {
-    tmpmt->type=MT_MSG;
-    StrPrint(tmpmt->buf,"Msg(0x%X,0x%X,0x%X);",
-          tmpc->msg_code,tmpc->aux1,tmpc->aux2);
-  }
-  return tmpmt;
-}
-
-U8 *SysMacro2Str(CJob *macro_head)
-{
-  CJob *tmpc;
-  I64 cnt=1; //terminating zero
-  U8 *ptr,*m;
-  CMacroTmp *tmpmt,*tmpmt1,head;
-  LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
-
-  QueInit(&head);
-  head.type=MT_NULL;
-  tmpc=macro_head->next;
-  while (tmpc!=macro_head) {
-    tmpmt=Cmd2MT(tmpc);
-    QueIns(tmpmt,head.last);
-    cnt+=StrLen(tmpmt->buf);
-    if (tmpmt->type==MT_CHAR) {
-      if (tmpmt->last->type!=MT_CHAR)
-        cnt+=StrLen("\"");
-      if (tmpmt->next->type!=MT_CHAR)
-        cnt+=StrLen("\";");
-    }
-    tmpc=tmpc->next;
-  }
-
-  m=MAlloc(cnt);
-  ptr=m;
-
-  tmpmt=head.next;
-  while (tmpmt!=&head) {
-    tmpmt1=tmpmt->next;
-    if (tmpmt->type==MT_MSG) {
-      StrCpy(ptr, tmpmt->buf);
-      ptr+=StrLen(tmpmt->buf);
-    } else {
-      if (tmpmt->last->type!=MT_CHAR) {
-        StrCpy(ptr, "\"");
-        ptr+=StrLen("\"");
-      }
-      StrCpy(ptr,tmpmt->buf);
-      ptr+=StrLen(tmpmt->buf);
-      if (tmpmt->next->type!=MT_CHAR) {
-        StrCpy(ptr, "\";");
-        ptr+=StrLen("\";");
-      }
-    }
-    Free(tmpmt);
-    tmpmt=tmpmt1;
-  }
-  *ptr=0;
-  return m;
-}
-
-U0 PlaySysMacro(I64 n=1)
-{
-  CTask *task=sys_focus_task;
-  U8 *m;
-  if (TaskValidate(task)) {
-    LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
-    m=SysMacro2Str(&sys_macro_head);
-    while (n-- && TaskValidate(task)) {
-      if (task==Fs)
-        InStr("%s",m);
-      else
-        XTalkStrWait(task,"%s",m);
-    }
-    Free(m);
-  }
-}
-
-U0 EdInsCapturedMacro()
-{
-  U8 *st=SysMacro2Str(&sys_macro_head);
-  if (sys_focus_task) {
-    XTalk(sys_focus_task,"$MA+LIS,T=\"%s\",LM=\"%$Q\"$",
-          captured_macro_name,st);
-    Free(st);
-  }
-}
-
-#define SM_RECORD       0
-#define SM_INS          1
-#define SM_PLAY         2
-#define SM_REPEAT_N     3
-#define SM_STOP         4
-
-I64 PopUpMacroMenu()
-{
-  I64 res=0;
-  U8 buf[STR_LEN];
-  CJob *tmpc;
-  CDoc *doc=DocNew;
-  CDocEntry *doc_e=DocPrint(doc,"$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$");
-  doc_e->data=captured_macro_name;
-  DocDataFmt(doc,doc_e);
-
-  doc_e=DocPrint(doc,"\n$DA,A=\"Repeat N:%%d\"$");
-  doc_e->data=&sys_macro_repeat_n;
-  DocDataFmt(doc,doc_e);
-
-  DocPrint(doc,"\n"
-        "$CM+LX,1,3$$BT,\"RECORD\",LE=SM_RECORD$"
-        "$CM+LX,17,0$$BT,\"INSERT\",LE=SM_INS$"
-        "$CM+LX,1,3$$BT,\"PLAY\",LE=SM_PLAY$"
-        "$CM+LX,17,0$$BT,\"REPEAT N\",LE=SM_REPEAT_N$"
-        "$CM+LX,1,3$$BT,\"STOP\",LE=SM_STOP$"
-        "$CM+LX,17,0$$BT,\"CANCEL\",LE=DOCM_CANCEL$"
-        "\n\n\n$GREEN$SHIFT-F2$FG$ will play macro.\n");
-  doc->flags|=DOCF_SIZE_MIN | DOCF_FORM;
-  StrPrint(buf,"DocMenu(%d);",doc);
-  sys_macro_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
-  Fs->popup_task=sys_macro_task;
-  LBts(&sys_macro_task->display_flags,DISPLAYf_WIN_ON_TOP);
-  tmpc=TaskExe(sys_macro_task,Fs,buf,
-        1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
-  JobResScan(tmpc,&res);
-  Fs->popup_task=NULL;
-  Kill(sys_macro_task);
-  sys_macro_task=NULL;
-  DocDataScan(doc,doc_e);
-  DocDel(doc);
-  return res;
-}
-
-U0 MacroTask(I64)
-{
-  I64 i;
-  StrCpy(captured_macro_name,"Click Here");
-  sys_macro_repeat_n=1;
-  do {
-    i=PopUpMacroMenu;
-    WinRefocus(sys_focus_task);
-    switch (i) {
-      case SM_RECORD:
-        LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
-        QueDel(&sys_macro_head,TRUE);
-        LBts(&sys_semas[SEMA_RECORD_MACRO],0);
-        break;
-      case SM_PLAY:
-        PlaySysMacro;
-        break;
-      case SM_REPEAT_N:
-        PlaySysMacro(sys_macro_repeat_n);
-        break;
-      case SM_STOP:
-        LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
-        break;
-      case SM_INS:
-        LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
-        EdInsCapturedMacro;
-        break;
-    }
-  } while (i>=0);
-}
-
-U0 EdMacroUtil()
-{
-  if (!sys_macro_task)
-    Spawn(&MacroTask,NULL,"Macro");
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocNew.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocNew.HC.HTML deleted file mode 100755 index e23b1b9..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocNew.HC.HTML +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-public Bool DocLock(CDoc *doc)
-{//Make this task have exclusive access to this doc.
-  if (!Bt(&doc->locked_flags,DOClf_LOCKED) || doc->owning_task!=Fs) {
-    while (LBts(&doc->locked_flags,DOClf_LOCKED))
-      Yield;
-    if (doc->owning_task!=Fs)
-      LBEqu(&doc->flags,DOCf_BREAK_UNLOCKED,BreakLock(Fs));
-    doc->owning_task=Fs;
-    return TRUE;
-  } else
-    return FALSE;
-}
-
-public Bool DocUnlock(CDoc *doc)
-{//Release exclusive lock on access to doc.
-  Bool unlock_break;
-  if (Bt(&doc->locked_flags,DOClf_LOCKED) && doc->owning_task==Fs) {
-    doc->owning_task=0;
-    unlock_break=Bt(&doc->flags,DOCf_BREAK_UNLOCKED);
-    LBtr(&doc->locked_flags,DOClf_LOCKED);
-    if (unlock_break)
-      BreakUnlock(Fs);
-    return TRUE;
-  } else
-    return FALSE;
-}
-
-Bool IsEditableText(CDocEntry *doc_e)
-{
-  if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG_DONT_EDIT))
-    return TRUE;
-  else
-    return FALSE;
-}
-
-CDocEntry *DocEntryNewBase(CDoc *doc,I64 type,I64 de_flags=0,
-        I64 x=0,I64 y=0,I64 page_line_num=0)
-{//See also MAllocIdent and CDocEntry.
-  CDocEntry *res=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
-  res->type=type;
-  res->de_flags=de_flags|doldoc.dft_de_flags[type.u8[0]];
-  res->x=x;
-  res->y=y;
-  res->page_line_num=page_line_num;
-  return res;
-}
-
-CDocEntry *DocEntryNewTag(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
-{
-  I64 l=StrLen(tag);
-  CDocEntry *res=DocEntryNewBase(doc,doc_ce->type,doc_ce->de_flags,
-        doc_ce->x,doc_ce->y,doc_ce->page_line_num);
-  res->de_flags=doc_ce->de_flags; //Override
-  res->max_col=l;
-  res->tag=MAlloc(l+1,doc->mem_task);
-  MemCpy(res->tag,tag,l+1);
-  MemCpy(&res->settings,&doc_ce->settings,sizeof(CDocSettings));
-  return res;
-}
-
-public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e)
-{//Free entry and all parts of entry.
-  if (!doc || doc==doc_e)
-    RawPrint(3000,"DocEntryDel");
-  else {
-    if (doc->cur_entry==doc_e)
-      doc->cur_entry=doc_e->next;
-    QueRem(doc_e);
-    if (doc_e->de_flags & DOCEF_TAG)
-      Free(doc_e->tag);
-    if (doc_e->de_flags & DOCEF_AUX_STR)
-      Free(doc_e->aux_str);
-    if (doc_e->de_flags & DOCEF_DEFINE)
-      Free(doc_e->define_str);
-    if (doc_e->de_flags & DOCEF_HTML_LINK)
-      Free(doc_e->html_link);
-    if (doc_e->de_flags & DOCEF_LEFT_MACRO)
-      Free(doc_e->left_macro);
-    if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
-      Free(doc_e->right_macro);
-    if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
-      Free(doc_e->bin_ptr_link);
-    if (doc_e->de_flags & DOCEF_HAS_BIN)
-      DocBinDel(doc,doc_e->bin_data);
-    if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
-      Free(doc_e->data);
-    Free(doc_e);
-  }
-}
-
-public I64 DocEntrySize(CDoc *,CDocEntry *doc_e)
-{//Mem size of entry and all parts.
-  I64 res;
-  if (!doc_e) return 0;
-  res=MSize2(doc_e);
-  if (doc_e->de_flags & DOCEF_TAG)
-    res+=MSize2(doc_e->tag);
-  if (doc_e->de_flags & DOCEF_AUX_STR)
-    res+=MSize2(doc_e->aux_str);
-  if (doc_e->de_flags & DOCEF_DEFINE)
-    res+=MSize2(doc_e->define_str);
-  if (doc_e->de_flags & DOCEF_HTML_LINK)
-    res+=MSize2(doc_e->html_link);
-  if (doc_e->de_flags & DOCEF_LEFT_MACRO)
-    res+=MSize2(doc_e->left_macro);
-  if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
-    res+=MSize2(doc_e->right_macro);
-  if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
-    res+=MSize2(doc_e->bin_ptr_link);
-  if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
-    res+=MSize2(doc_e->data);
-  return res;
-}
-
-U0 DocUndoDel(CDoc *,CDocUndo *u)
-{
-  Free(u->body);
-  Free(u);
-}
-
-U0 DocUndoCntSet(CDoc *doc)
-{
-  Bool unlock=DocLock(doc);
-  CDocUndo *u=doc->undo_head.next;
-  doc->undo_cnt=0;
-  while (u!=&doc->undo_head) {
-    doc->undo_cnt++;
-    u=u->next;
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
-{//Make copy of entry and all parts of entry.
-  CDocEntry *doc_ne;
-  CDocBin *tmpb;
-  CTask *task=doc->mem_task;
-  doc_ne=MAllocIdent(doc_e,task);
-  doc_ne->next=doc_ne;
-  doc_ne->last=doc_ne;
-  if (doc_e->de_flags & DOCEF_TAG)
-    doc_ne->tag=MAllocIdent(doc_e->tag,task);
-  if (doc_e->de_flags & DOCEF_AUX_STR)
-    doc_ne->aux_str=MAllocIdent(doc_e->aux_str,task);
-  if (doc_e->de_flags & DOCEF_DEFINE)
-    doc_ne->define_str=MAllocIdent(doc_e->define_str,task);
-  if (doc_e->de_flags & DOCEF_HTML_LINK)
-    doc_ne->html_link=MAllocIdent(doc_e->html_link,task);
-  if (doc_e->de_flags & DOCEF_LEFT_MACRO)
-    doc_ne->left_macro=MAllocIdent(doc_e->left_macro,task);
-  if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
-    doc_ne->right_macro=MAllocIdent(doc_e->right_macro,task);
-  if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
-    doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task);
-  if (doc_e->de_flags & DOCEF_HAS_BIN) {
-    tmpb=MAllocIdent(doc_e->bin_data,task);
-    tmpb->data=MAllocIdent(doc_e->bin_data->data,task);
-    doc_ne->bin_num=doc->cur_bin_num;
-    tmpb->num=doc->cur_bin_num++;
-    doc_ne->bin_data=tmpb;
-    if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
-      tmpb->tag=StrNew(doc_e->tag,task);
-    else
-      tmpb->tag=NULL;
-    QueIns(tmpb,doc->bin_head.last);
-  }
-  if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
-    doc_ne->data=MAllocIdent(doc_e->data,task);
-  return doc_ne;
-}
-
-U0 DocRemSoftNewLines(CDoc *doc=NULL,CDocEntry *doc_e=NULL)
-{
-  CDocEntry *doc_e2,*saved_ll=doc_e;
-  Bool unlock;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  if (!doc_e) doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    doc_e2=doc_e->next;
-    if (doc_e->type_u8==DOCT_SOFT_NEW_LINE) {
-      if (doc->cur_entry==doc_e) {
-        doc->cur_entry=doc_e2;
-        doc->cur_col=doc->cur_entry->min_col;
-      }
-      DocEntryDel(doc,doc_e);
-    } else if (saved_ll && doc_e->type_u8==DOCT_NEW_LINE)
-      break;
-    doc_e=doc_e2;
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e)
-{//Insert entry into doc, updating its vals.
-  U8 *dst;
-  Bool unlock=DocLock(doc);
-  CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
-
-  doc_e->x=doc_ce->x;
-  doc_e->y=doc_ce->y;
-  doc_e->page_line_num=doc_ce->page_line_num;
-  MemCpy(&doc_e->settings,&doc_ce->settings,sizeof(CDocSettings));
-  if (doc->cur_col>0 &&
-        doc_ce->type_u8==DOCT_TEXT &&
-        !(doc_ce->de_flags&(DOCEF_TAG_CB|DOCEF_DEFINE|DOCEF_AUX_STR|
-        DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)) &&
-        doc->cur_col<doc_ce->max_col) {
-    dst=doc_ce->tag+doc->cur_col;
-    doc_ne=DocEntryNewTag(doc,doc_ce,dst);
-    *dst=0;
-    doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00;
-    doc_ce->max_col=doc->cur_col;
-    QueIns(doc_ne,doc_ce);
-    doc->cur_col=0;
-    doc_ce=doc_ne;
-  }
-  if (doc_ce->type_u8==DOCT_TEXT && doc->cur_col>=doc_ce->max_col) {
-    QueIns(doc_e,doc_ce);
-    doc->cur_entry=doc_e->next;
-  } else {
-    QueIns(doc_e,doc_ce->last);
-    doc->cur_entry=doc_ce;
-  }
-  doc->cur_col=doc->cur_entry->min_col;
-  DocRemSoftNewLines(doc,doc->cur_entry);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocRst(CDoc *doc,Bool is_old)
-{//Del all entries and set doc to dfts.
-  Bool unlock;
-  CDocEntry *doc_e,*doc_e2;
-  CDocUndo *u,*u8;
-  CDocSettings *s;
-  CDocBin *b,*b1;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  if (is_old) {
-    doc_e=doc->head.next;
-    while (doc_e!=doc) {
-      doc_e2=doc_e->next;
-      DocEntryDel(doc,doc_e);
-      doc_e=doc_e2;
-    }
-    u=doc->undo_head.next;
-    while (u!=&doc->undo_head) {
-      u8=u->next;
-      DocUndoDel(doc,u);
-      u=u8;
-    }
-    b=doc->bin_head.next;
-    while (b!=&doc->bin_head) {
-      b1=b->next;
-      QueRem(b);
-      Free(b->data);
-      Free(b);
-      b=b1;
-    }
-  }
-//Check DocInsDoc
-  doc->flags&=DOCF_BREAK_UNLOCKED;
-  doc->head.next=doc->head.last=doc;
-  QueInit(&doc->bin_head);
-  QueInit(&doc->undo_head);
-  doc->undo_head.time_stamp=0;
-  doc->undo_cnt=0;
-  doc->cur_bin_num=1;
-  doc->dollar_buf_ptr=0;
-  doc->cmd_U8=CH_SPACE;
-  doc->page_line_num=0;
-  doc->best_d=I64_MAX;
-
-  s=&doc->settings_head;
-  s->left_margin=DOC_DFT;
-  s->right_margin=DOC_DFT;
-  s->indent=0;
-  s->page_len=66;
-  s->header=DOC_DFT;
-  s->footer=DOC_DFT;
-  s->state=DOCSS_NORMAL;
-  s->comment_depth=0;
-  s->paren_depth=0;
-  s->brace_depth=0;
-  s->shifted_x=0;
-  s->shifted_y=0;
-  s->cur_text_attr=s->dft_text_attr=DOC_ATTR_DFT_TEXT;
-
-  doc_e=&doc->head;
-  doc_e->type=DOCT_ERROR;
-  doc_e->de_flags=0;
-  doc_e->x=0;
-  doc_e->y=0;
-  doc_e->min_col=0;
-  doc_e->max_col=0;
-  doc_e->page_line_num=doc->page_line_num;
-  MemCpy(&doc_e->settings,s,sizeof(CDocSettings));
-
-  DocTop(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocDel(CDoc *doc)
-{//Free entire doc and entries.
-  if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return;
-  DocLock(doc);
-  doc->doc_signature=0;
-  DocRst(doc,TRUE);
-  Free(doc->find_replace);
-  Free(doc->dollar_buf);
-  DocUnlock(doc);
-  Free(doc);
-}
-
-public I64 DocSize(CDoc *doc)
-{//Mem size of doc and all its entries.
-  Bool unlock;
-  CDocEntry *doc_e;
-  CDocUndo *u;
-  CDocBin *b;
-  I64 res=0;
-
-  if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return 0;
-  unlock=DocLock(doc);
-
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    res+=DocEntrySize(doc,doc_e);
-    doc_e=doc_e->next;
-  }
-
-  u=doc->undo_head.next;
-  while (u!=&doc->undo_head) {
-    res+=MSize2(u->body);
-    res+=MSize2(u);
-    u=u->next;
-  }
-
-  b=doc->bin_head.next;
-  while (b!=&doc->bin_head) {
-    res+=MSize2(b->data);
-    res+=MSize2(b);
-    b=b->next;
-  }
-
-  res+=MSize2(doc->find_replace);
-  res+=MSize2(doc->dollar_buf);
-  res+=MSize2(doc);
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-#help_index "DolDoc"
-public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL)
-{//MAlloc new DolDoc. (Begin a new doc.)
-  CDoc *doc;
-  if (!task) task=Fs;
-  doc=CAlloc(sizeof(CDoc),task);
-  if (filename)
-    StrCpy(doc->filename.name,filename);
-  else
-    StrCpy(doc->filename.name,blkdev.tmp_filename);
-  doc->find_replace=CAlloc(sizeof(CEdFindText),task);
-  doc->find_replace->scan_fwd=TRUE;
-  doc->find_replace->match_case=TRUE;
-  doc->find_replace->pmt=TRUE;
-  doc->left_click_link=&EdLeftClickLink;
-  doc->dollar_buf_size=84;
-  doc->dollar_buf=MAlloc(doc->dollar_buf_size,task);
-  doc->max_entries=I64_MAX;
-  doc->win_task=task;
-  doc->mem_task=task;
-  DocRst(doc,FALSE);
-  doc->doc_signature=DOC_SIGNATURE_VAL;
-  return doc;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocPlain.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocPlain.HC.HTML deleted file mode 100755 index e1c78f1..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocPlain.HC.HTML +++ /dev/null @@ -1,642 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
-{
-  I64 res=-1;
-  CHashGeneric *tmph;
-  if (cc->token==TK_IDENT &&
-        (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
-    res=tmph->user_data0;
-    if (res<64) {
-      BEqu(_de_flags,res,turn_on);
-      switch (res) {
-        case DOCEf_BLINK:
-        case DOCEf_INVERT:
-        case DOCEf_UNDERLINE:
-        case DOCEf_SEL:
-          BEqu(_type,res,turn_on);
-          break;
-      }
-    }
-    Lex(cc);    //skip flag
-  }
-  return res;
-}
-
-I64 PrsDocFlags(CCmpCtrl *cc,I64 *_de_flags,U32 *_type)
-{
-  I64 res=-1;
-  Bool turn_on;
-  while (TRUE) {
-    if (cc->token=='+')
-      turn_on=TRUE;
-    else if (cc->token=='-')
-      turn_on=FALSE;
-    else
-      break;
-    Lex(cc);
-    res=PrsDocFlagSingle(cc,_de_flags,_type,turn_on);
-  }
-  return res;
-}
-
-U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
-{//TODO: break strs
-  I64 i,j,attr=doc_e->attr,
-        t1,f1,de_flags,type;
-  U8 *buf,*buf2;
-
-  if (doc_e->type_u8==DOCT_FOREGROUND &&
-        doc->flags&DOCF_COLOR_NAMES && 0<=attr<COLORS_NUM) {
-    buf=StrNew(DefineSub(attr,"ST_COLORS"));
-    attr=DOC_DFT;
-  } else
-    buf=StrNew(DefineSub(doc_e->type_u8,"ST_DOC_CMDS"));
-  if (doc_e->type_u8!=DOCT_ERROR) {
-    f1=doldoc.dft_de_flags[doc_e->type_u8];
-    t1=doc_e->type_u8|doldoc.dft_type_flags[doc_e->type_u8];
-
-    de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SEL|
-          DOCEF_HIGHLIGHT|DOCEF_WORD_WRAP|DOCEF_SKIP|DOCEF_FILTER_SKIP);
-    for (i=0;i<DOCEf_FLAGS_NUM;i++)
-      if (Bt(&f1,i)!=Bt(&de_flags,i)) {
-        if (Bt(&de_flags,i)) {
-          if (!(1<<i&DOCEG_HAS_ARG)) {
-            buf2=MStrPrint("%s+%Z",buf,i,"ST_DOC_FLAGS");
-            Free(buf); buf=buf2;
-          }
-        } else {
-          buf2=MStrPrint("%s-%Z",buf,i,"ST_DOC_FLAGS");
-          Free(buf); buf=buf2;
-        }
-      }
-    type=doc_e->type&~DOCET_SEL;
-    for (i=DOCEt_BLINK;i<=DOCEt_UNDERLINE;i++)
-      if (Bt(&t1,i)!=Bt(&type,i)) {
-        if (Bt(&type,i))
-          buf2=MStrPrint("%s+%Z",buf,i,"ST_DOC_FLAGS");
-        else
-          buf2=MStrPrint("%s-%Z",buf,i,"ST_DOC_FLAGS");
-        Free(buf); buf=buf2;
-      }
-    buf2=MStrPrint("%s,",buf);
-    Free(buf); buf=buf2;
-    switch [doc_e->type_u8] {
-      case DOCT_HEX_ED:
-        buf2=MStrPrint("%s%d,",buf,doc_e->len);
-        Free(buf); buf=buf2;
-        buf2=MStrPrint("%s%d,",buf,doc_e->hex_ed_width);
-        Free(buf); buf=buf2;
-        break;
-      case DOCT_FOREGROUND:
-      case DOCT_BACKGROUND:
-      case DOCT_DFT_FOREGROUND:
-      case DOCT_DFT_BACKGROUND:
-        if (doc->flags&DOCF_COLOR_NAMES && 0<=attr<COLORS_NUM) {
-          buf2=MStrPrint("%s%Z,",buf,doc_e->attr,"ST_COLORS");
-          Free(buf); buf=buf2;
-          break;
-        }
-      case DOCT_PAGE_LEN:
-      case DOCT_LEFT_MARGIN:
-      case DOCT_RIGHT_MARGIN:
-      case DOCT_HEADER:
-      case DOCT_FOOTER:
-      case DOCT_INDENT:
-      case DOCT_WORD_WRAP:
-      case DOCT_HIGHLIGHT:
-      case DOCT_BLINK:
-      case DOCT_INVERT:
-      case DOCT_UNDERLINE:
-      case DOCT_SHIFTED_X:
-      case DOCT_SHIFTED_Y:
-        if (attr!=DOC_DFT) {
-          buf2=MStrPrint("%s%d,",buf,doc_e->attr);
-          Free(buf); buf=buf2;
-        }
-      case DOCT_TYPES_NUM-1: //nobound switch
-        break;
-    }
-    de_flags=doc_e->de_flags & DOCEG_HAS_ARG;
-    while (de_flags) {
-      j=Bsf(de_flags);
-      Btr(&de_flags,j);
-      switch [j] {
-        case DOCEf_TAG:
-          if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_MACRO &&
-                (doc_e->de_flags&DOCEF_LEFT_MACRO &&
-                !StrCmp(doc_e->tag,doc_e->left_macro) ||
-                doc_e->de_flags&DOCEF_RIGHT_MACRO &&
-                !StrCmp(doc_e->tag,doc_e->right_macro)) ||
-                doc_e->de_flags&DOCEF_LST && !StrCmp(doc_e->tag,"[]") &&
-                doc_e->de_flags&DOCEF_DEFINE) {
-            buf2=buf;
-            buf=NULL;
-          } else {
-            if (doc_e->type_u8==DOCT_CHECK_BOX) {
-              if (StrLen(doc_e->tag)>=4)
-                buf2=doc_e->tag+4;
-              else
-                buf2="";
-            } else if (doc_e->de_flags & DOCEF_TREE) {
-              if (StrLen(doc_e->tag)>=3)
-                buf2=doc_e->tag+3;
-              else
-                buf2="";
-            } else
-              buf2=doc_e->tag;
-            if (Bt(&doldoc.dft_de_flags[doc_e->type_u8],DOCEf_TAG))
-              buf2=MStrPrint("%s\"%$Q\",",buf,buf2);
-            else
-              buf2=MStrPrint("%sT=\"%$Q\",",buf,buf2);
-          }
-          break;
-        case DOCEf_LEN:
-          buf2=MStrPrint("%sLEN=%d,",buf,doc_e->len);
-          break;
-        case DOCEf_AUX_STR:
-          buf2=MStrPrint("%sA=\"%$Q\",",buf,doc_e->aux_str);
-          break;
-        case DOCEf_DEFINE:
-          buf2=MStrPrint("%sD=\"%$Q\",",buf,doc_e->define_str);
-          break;
-        case DOCEf_HTML_LINK:
-          buf2=MStrPrint("%sHTML=\"%$Q\",",buf,doc_e->html_link);
-          break;
-        case DOCEf_LEFT_EXP:
-          buf2=MStrPrint("%sLE=%d,",buf,doc_e->left_exp);
-          break;
-        case DOCEf_LEFT_MACRO:
-          buf2=MStrPrint("%sLM=\"%$Q\",",buf,doc_e->left_macro);
-          break;
-        case DOCEf_RIGHT_EXP:
-          buf2=MStrPrint("%sRE=%d,",buf,doc_e->right_exp);
-          break;
-        case DOCEf_RIGHT_MACRO:
-          buf2=MStrPrint("%sRM=\"%$Q\",",buf,doc_e->right_macro);
-          break;
-        case DOCEf_HAS_BIN:
-          buf2=MStrPrint("%sBI=%d,",buf,doc_e->bin_num);
-          break;
-        case DOCEf_BIN_PTR_LINK:
-          buf2=MStrPrint("%sBP=\"%$Q\",",buf,doc_e->bin_ptr_link);
-          break;
-        case DOCEf_RAW_TYPE:
-          if (doc_e->type_u8==DOCT_CHECK_BOX&&doc_e->raw_type!=RT_I8 ||
-                doc_e->type_u8!=DOCT_CHECK_BOX&&doc_e->raw_type!=RT_I64)
-            buf2=MStrPrint("%sRT=%Z,",buf,doc_e->raw_type,"ST_RAW_TYPES");
-          break;
-        case DOCEf_SHIFTED_X:
-          j=doc_e->type.u16[1]&0x1F;
-          if (j&0x10) j|=0xFFFFFFF0;
-          buf2=MStrPrint("%sSX=%d,",buf,j);
-          break;
-        case DOCEf_SHIFTED_Y:
-          j=doc_e->type>>21 &0x1F;
-          if (j&0x10) j|=0xFFFFFFF0;
-          buf2=MStrPrint("%sSY=%d,",buf,j);
-          break;
-        case DOCEf_SCROLLING_X:
-          buf2=MStrPrint("%sSCX=%d,",buf,doc_e->scroll_len);
-          break;
-        case DOCEf_USER_DATA:
-          buf2=MStrPrint("%sU=0x%X,",buf,doc_e->user_data);
-          break;
-        case DOCEf_FLAGS_NUM-1: //nobound switch
-          break;
-      }
-      Free(buf); buf=buf2;
-    }
-    buf[StrLen(buf)-1]=0;  //Kill last comma
-  }
-  buf2=StrNew(buf,doc->mem_task); //exact allocation
-  Free(buf);
-  return buf2;
-}
-
-CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
-{//Uses Lex() to parse a string and make Doc entries.
-  I64 i,j,de_flags,processed_flags,attr=DOC_DFT;
-  U8 *ptr,*st2;
-  CDocEntry *doc_e=NULL;
-  CHashGeneric *tmph;
-  CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
-  CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
-  try {
-    cc->htc.hash_table_lst=NULL;
-    if (Lex(cc)==TK_IDENT) {
-      if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
-        if (tmph->type&DHT_DOC_CMD)
-          i=tmph->user_data0;
-        else {//DHT_COLOR
-          i=DOCT_FOREGROUND;
-          attr=tmph->user_data0;
-        }
-      } else
-        goto pd_err;
-      Lex(cc); //skip cmd code
-      doc_e=CAlloc(sizeof(CDocEntry),doc->mem_task);
-      doc_e->type=i;
-      doc_e->de_flags=doldoc.dft_de_flags[i];
-      doc_e->type|=doldoc.dft_type_flags[i];
-      doc_e->raw_type=RT_I64;
-      doc_e->len=DOCE_LEN_DFT;
-      j=PrsDocFlags(cc,&doc_e->de_flags,&doc_e->type);
-      cc->htc.hash_table_lst=old_hash_table_lst;
-      switch [i] {
-        case DOCT_CHECK_BOX:
-          doc_e->raw_type=RT_I8;
-          break;
-        case DOCT_HEX_ED:
-          while (cc->token==',')
-            Lex(cc);
-          if (cc->token)
-            doc_e->len=LexExpressionI64(cc);
-          else
-            goto pd_err;
-          while (cc->token==',')
-            Lex(cc);
-          if (cc->token)
-            doc_e->hex_ed_width=LexExpressionI64(cc);
-          else
-            goto pd_err;
-          break;
-        case DOCT_PAGE_LEN:
-        case DOCT_LEFT_MARGIN:
-        case DOCT_RIGHT_MARGIN:
-        case DOCT_HEADER:
-        case DOCT_FOOTER:
-        case DOCT_INDENT:
-        case DOCT_FOREGROUND:
-        case DOCT_BACKGROUND:
-        case DOCT_DFT_FOREGROUND:
-        case DOCT_DFT_BACKGROUND:
-        case DOCT_WORD_WRAP:
-        case DOCT_HIGHLIGHT:
-        case DOCT_BLINK:
-        case DOCT_INVERT:
-        case DOCT_UNDERLINE:
-        case DOCT_SHIFTED_X:
-        case DOCT_SHIFTED_Y:
-          while (cc->token==',')
-            Lex(cc);
-          if (cc->token)
-            doc_e->attr=LexExpressionI64(cc);
-          else
-            doc_e->attr=attr;
-          break;
-#assert DOCT_ERROR==DOCT_TYPES_NUM-1
-        case DOCT_ERROR:
-          goto pd_err;
-      }
-
-      processed_flags=0;
-      while (TRUE) {
-        cc->htc.hash_table_lst=NULL;
-        while (cc->token==',')
-          Lex(cc);
-        cc->htc.hash_table_lst=old_hash_table_lst;
-        j=PrsDocFlagSingle(cc,&doc_e->de_flags,&doc_e->type,TRUE);
-        if (!(de_flags=~processed_flags & doc_e->de_flags & DOCEG_HAS_ARG))
-          break;
-        if (cc->token=='=')
-          Lex(cc);
-        else
-          j=Bsf(de_flags);
-        if (j<0 || Bts(&processed_flags,j))
-          goto pd_err;
-        switch [j] {//TODO: Might check for expression errors
-          case DOCEf_TAG:
-            if (!doc_e->tag) {
-//If a $MA,LM=""$, Tag is filled when the LM is processed.
-              //if doc_e->df_flags&DOCEF_LST,
-              // Tag is filled when the Define is processed.
-              //(The dft_flag1.tag calls this after.)
-              if (cc->token==TK_STR) {
-                st2=LexExtStr(cc);
-                if (i==DOCT_CHECK_BOX) {
-                  st=MStrPrint("[X] %s",st2);
-                  Free(st2);
-                  doc_e->min_col=1;
-                } else if (doc_e->de_flags & DOCEF_LST) {
-                  if (*st2!='[') {
-                    st=MStrPrint("[%s]",st2);
-                    Free(st2);
-                  } else
-                    st=st2;
-                  doc_e->min_col=1;
-                } else if (doc_e->de_flags & DOCEF_TREE) {
-                  st=MStrPrint("+] %s",st2);
-                  Free(st2);
-                  doc_e->min_col=1;
-                } else
-                  st=st2;
-                doc_e->tag=StrNew(st,doc->mem_task);
-                Free(st);
-              } else
-                goto pd_err;
-            }
-            break;
-          case DOCEf_LEN:
-            if (cc->token) {
-              doc_e->len=LexExpression(cc);
-              doc_e->de_flags&=~DOCEF_DFT_LEN;
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_AUX_STR:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->aux_str=StrNew(st2,doc->mem_task);
-              Free(st2);
-//Anchor
-              if (i==DOCT_DATA) { //See DocForm()
-                if (ptr=StrMatch(":",doc_e->aux_str))
-                  doc_e->min_col=ptr-doc_e->aux_str+1;
-                doc_e->tag=MAlloc(doc_e->len+doc_e->min_col+2,
-                      doc->mem_task); //+2 because "_\0"
-              }
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_DEFINE:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->define_str=StrNew(st2,doc->mem_task);
-              Free(st2);
-              if (doc_e->de_flags&DOCEF_LST && !doc_e->tag)
-                doc_e->tag=StrNew("[]",doc->mem_task);
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_HTML_LINK:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->html_link=StrNew(st2,doc->mem_task);
-              Free(st2);
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_LEFT_EXP:
-            if (cc->token)
-              doc_e->left_exp=LexExpression(cc);
-            else
-              goto pd_err;
-            break;
-          case DOCEf_LEFT_MACRO:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->left_macro=StrNew(st2,doc->mem_task);
-              Free(st2);
-              if (i==DOCT_MACRO && !doc_e->tag)
-                doc_e->tag=StrNew(doc_e->left_macro,doc->mem_task);
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_RIGHT_EXP:
-            if (cc->token)
-              doc_e->right_exp=LexExpression(cc);
-            else
-              goto pd_err;
-            break;
-          case DOCEf_RIGHT_MACRO:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->right_macro=StrNew(st2,doc->mem_task);
-              Free(st2);
-              if (i==DOCT_MACRO && !doc_e->tag)
-                doc_e->tag=StrNew(doc_e->right_macro,doc->mem_task);
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_HAS_BIN:
-            if (cc->token)
-              doc_e->bin_num=LexExpressionI64(cc);
-            else
-              goto pd_err;
-            break;
-          case DOCEf_BIN_PTR_LINK:
-            if (cc->token==TK_STR) {
-              st2=LexExtStr(cc);
-              doc_e->bin_ptr_link=StrNew(st2,doc->mem_task);
-              Free(st2);
-              if (!DocBinPtrRst(doc,doc_e))
-                doc_e->type=DOCT_ERROR;
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_RAW_TYPE:
-            if (cc->token==TK_IDENT) {
-              j=DefineMatch(cc->cur_str,"ST_RAW_TYPES");
-              if (j<0)
-                goto pd_err;
-              doc_e->raw_type=j;
-              doc_e->de_flags&=~DOCEF_DFT_RAW_TYPE;
-              Lex(cc);
-            } else
-              goto pd_err;
-            break;
-          case DOCEf_SHIFTED_X:
-            if (cc->token)
-              doc_e->type|=(LexExpressionI64(cc) & 0x1F)<<16;
-            else
-              goto pd_err;
-            break;
-          case DOCEf_SHIFTED_Y:
-            if (cc->token)
-              doc_e->type|=(LexExpressionI64(cc) & 0x1F)<<21;
-            else
-              goto pd_err;
-            break;
-          case DOCEf_SCROLLING_X:
-            if (cc->token)
-              doc_e->scroll_len=LexExpressionI64(cc);
-            else
-              goto pd_err;
-            break;
-          case DOCEf_USER_DATA:
-            if (cc->token)
-              doc_e->user_data=LexExpression(cc);
-            else
-              goto pd_err;
-            break;
-          case DOCEf_FLAGS_NUM-1: //nobound switch
-            break;
-        }
-      }
-    } else {
-pd_err:
-      if (!doc_e)
-        doc_e=CAlloc(sizeof(CDocEntry),doc->mem_task);
-      doc_e->type=DOCT_ERROR;
-      doc_e->de_flags=0;
-    }
-    if (doc_e->de_flags&DOCEF_LST && (doc_e->de_flags&DOCEF_REMALLOC_DATA ||
-          !(doc_e->de_flags&DOCEF_DEREF_DATA))) {
-      DocDataScan(doc,doc_e);
-      DocDataFmt(doc,doc_e);
-    }
-    CmpCtrlDel(cc);
-  } catch {
-    Fs->catch_except=TRUE;
-    if (!doc_e)
-      doc_e=CAlloc(sizeof(CDocEntry),doc->mem_task);
-    doc_e->type=DOCT_ERROR;
-    doc_e->de_flags=0;
-  }
-  return doc_e;
-}
-
-U0 DocEntryToggle(CDoc *doc)
-{
-  Bool unlock=DocLock(doc),old_color_names;
-  CDocEntry *doc_ce=doc->cur_entry,*cl1,*doc_ce2;
-  U8 ch,*st,*st2;
-  I64 i,j,k;
-  if (doc_ce!=doc &&
-        !(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
-    if (doc_ce->type_u8==DOCT_TEXT && !(doc_ce->de_flags &
-          ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|
-          DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
-          !(doc_ce->type&DOCG_BL_IV_UL)) {
-      doc_ce2=doc_ce->last;
-      for (k=0;k<20;k++) {
-        if (doc_ce2!=doc) {
-          cl1=doc_ce2->last;
-          if (doc_ce2->type_u8==DOCT_TEXT &&
-                doc_ce->de_flags==doc_ce2->de_flags &&
-                doc_ce->type==doc_ce2->type) {
-            i=StrLen(doc_ce2->tag);
-            j=StrLen(doc_ce->tag);
-            st=MAlloc(i+j+1,doc->mem_task);
-            MemCpy(st,doc_ce2->tag,i);
-            MemCpy(st+i,doc_ce->tag,j+1);
-            Free(doc_ce->tag);
-            doc_ce->tag=st;
-            doc_ce->max_col=i+j;
-            doc->cur_col+=i;
-            DocEntryDel(doc,doc_ce2);
-          } else if (doc_ce2->type_u8==DOCT_SOFT_NEW_LINE)
-            DocEntryDel(doc,doc_ce2);
-          else
-            break;
-          doc_ce2=cl1;
-        } else
-          break;
-      }
-      doc_ce2=doc_ce->next;
-      for (k=0;k<20;k++) {
-        if (doc_ce2!=doc) {
-          cl1=doc_ce2->next;
-          if (doc_ce2->type_u8==DOCT_TEXT &&
-                doc_ce->de_flags==doc_ce2->de_flags &&
-                doc_ce->type==doc_ce2->type) {
-            i=StrLen(doc_ce->tag);
-            j=StrLen(doc_ce2->tag);
-            st=MAlloc(i+j+1,doc->mem_task);
-            MemCpy(st,doc_ce->tag,i);
-            MemCpy(st+i,doc_ce2->tag,j+1);
-            Free(doc_ce->tag);
-            doc_ce->tag=st;
-            doc_ce->max_col=i+j;
-            DocEntryDel(doc,doc_ce2);
-          } else if (doc_ce2->type_u8==DOCT_SOFT_NEW_LINE)
-            DocEntryDel(doc,doc_ce2);
-          else
-            break;
-          doc_ce2=cl1;
-        } else
-          break;
-      }
-      i=doc->cur_col;
-      while (i>doc_ce->min_col && doc_ce->tag[i]!='$')
-        i--;
-      j=doc->cur_col+1;
-      while (j<doc_ce->max_col && doc_ce->tag[j]!='$')
-        j++;
-      if (i<j-1 && doc_ce->min_col<=i<j<doc_ce->max_col &&
-            doc_ce->tag[i]=='$' && doc_ce->tag[j]=='$') {
-        ch=doc_ce->tag[j+1];
-        doc_ce->tag[j+1]=0;
-        st=StrNew(doc_ce->tag+i);
-        doc_ce->tag[j+1]=ch;
-        StrCpy(doc_ce->tag+i,doc_ce->tag+j+1);
-        doc->cur_col=i;
-        st2=MStrPrint("%q",st);
-        if (doc_ce=DocPrint(doc,st2)) {
-          doc->cur_entry=doc_ce;
-          doc->cur_col=doc_ce->min_col;
-        }
-        Free(st);
-        Free(st2);
-      }
-    } else {
-      old_color_names=LBts(&doc->flags,DOCf_COLOR_NAMES);
-      st=Doc2PlainText(doc,doc_ce);
-      LBEqu(&doc->flags,DOCf_COLOR_NAMES,old_color_names);
-      DocEntryDel(doc,doc_ce);
-      DocPrint(doc,"$$%$Q$$",st);
-    }
-    DocRecalc(doc);
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 DocFlagsToggle(CDoc *doc,I64 tog_flags)
-{
-  Bool  unlock=DocLock(doc);
-  I64 size,flags=doc->flags^tog_flags;
-  U8 *st;
-  CDocUndo *u_next,*u_last;
-
-  doc->flags=doc->flags&~DOCF_NO_CURSOR|DOCF_COLOR_NAMES;
-  st=DocSave(doc,&size);
-
-  u_next=doc->undo_head.next;
-  u_last=doc->undo_head.last;
-  doc->undo_head.next=doc->undo_head.last=&doc->undo_head;
-
-  DocRst(doc,TRUE);
-  doc->undo_head.next=u_next;
-  doc->undo_head.last=u_last;
-  DocUndoCntSet(doc);
-  doc->flags=flags&~(DOCF_NO_CURSOR|DOCG_BL_IV_UL|DOCF_WORD_WRAP);
-  DocLoad(doc,st,size);
-  doc->flags|=flags&DOCF_NO_CURSOR;
-  DocCenter(doc);
-  if (unlock)
-    DocUnlock(doc);
-  Free(st);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocPopUp.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocPopUp.HC.HTML deleted file mode 100755 index 26e734f..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocPopUp.HC.HTML +++ /dev/null @@ -1,348 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Output;StdOut/DolDoc"
-public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0)
-{//Pass doc to PopUp win task for viewing.
-  U8 *buf=MStrPrint("DocEd(0x%X,0x%X);",doc,dof_flags);
-  CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs);
-  TaskExe(task,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
-  Free(buf);
-  return task;
-}
-
-public CTask *PopUpViewPrint(U8 *fmt,...)
-{//View Print stmt in PopUp win task.
-  CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs);
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  CDoc *doc=DocNew(,task);
-  DocPrint(doc,buf);
-  Free(buf);
-  buf=MStrPrint("DocEd(0x%X);",doc);
-  TaskExe(task,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
-  Free(buf);
-  return task;
-}
-
-#help_index "DolDoc/Input;File/FileNames;StdIn/DolDoc"
-public U8 *PopUpPickFile(U8 *dir=NULL)
-{//Filename chooser.  Uses FileMgr().
-  U8 *res,*st,*st2;
-  if (dir)
-    st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir);
-  else {
-    st2=DirCur;
-    st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2);
-    Free(st2);
-  }
-  res=PopUp(st,Fs);
-  Free(st);
-  return res;
-}
-
-public U8 *PopUpPickDir(U8 *dir=NULL)
-{//File dir name chooser.  Uses FileMgr().
-  U8 *res,*st,*st2;
-  if (dir)
-    st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir);
-  else {
-    st2=DirCur;
-    st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2);
-    Free(st2);
-  }
-  res=PopUp(st,Fs);
-  Free(st);
-  return res;
-}
-
-public U8 *FileNameForm(U8 *dft=NULL,I64 dof_flags=0,CTask *mem_task=NULL)
-{//Text filename form in cur win, not PopUp.
-  CEdFileName fn;
-  if (dft)
-    StrCpy(fn.name,dft);
-  else
-    *fn.name=0;
-  if (DocForm(&fn,,dof_flags))
-    return StrNew(fn.name,mem_task);
-  else
-    return NULL;
-}
-
-public U8 *PopUpFileName(U8 *dft=NULL,I64 dof_flags=0)
-{//Filename chooser. Uses form, not FileMgr().
-  U8 *st=MStrPrint("FileNameForm(\"%Q\",0x%X,Fs->parent_task);",
-        dft,dof_flags|DOF_SIZE_MIN),*res=PopUp(st,Fs);
-  Free(st);
-  return res;
-}
-
-#help_index "DolDoc"
-Bool PopUpCd()
-{
-  Bool res;
-  U8 *st=PopUpPickDir;
-  if (st) {
-    res=Cd(st);
-    Free(st);
-  } else
-    res=FALSE;
-  return res;
-}
-
-#help_index "DolDoc/Input;Char/Lists;StdIn/DolDoc"
-public I64 PopUpPickLst(U8 *lst)
-{//Prompt for lst entry in PopUp win task.
-  I64 res,i=0;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$LTBLUE$");
-  while (*lst) {
-    if (*lst=='@') {//Check for '@' alias lst entry
-      i--;
-      lst++;
-    }
-    DocPrint(doc,"$MU,\"%s\",LE=%d$\n",lst,i++);
-    lst+=StrLen(lst)+1;
-  }
-  DocPrint(doc,"\n$MU,\"CANCEL\",LE=DOCM_CANCEL$\n");
-  res=PopUpMenu(doc);
-  DocDel(doc);
-  return res;
-}
-
-#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc"
-public U8 *PopUpPickDefineSub(U8 *dname)
-{//Prompt for Define lst entry in PopUp win task.
-  return PopUpPickLst(Define(dname));
-}
-
-#help_index "DolDoc/Input;StdIn/DolDoc"
-public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL)
-{//Make PopUp win task with one bttn.
-  I64 i,l1=StrLen(b1);
-  CDoc *doc=DocNew;
-  if (header) DocPrint(doc,"%s",header);
-  DocPrint(doc,"$CM+CX,%d,4$$BT,\"%s\",LE=%d$\n",-l1/2,b1,n1);
-  if (footer) DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL)
-{//Make PopUp win task with two bttns.
-  I64 i,l1=StrLen(b1),l2=StrLen(b2),y;
-  CDoc *doc=DocNew;
-  if (header) {
-    DocPrint(doc,"%s",header);
-    y=4;
-  } else {
-    DocPrint(doc,"%*s\n",l1+l2+10,"");
-    y=3;
-  }
-  DocPrint(doc,"$CM+CX,%d,%d$$BT,\"%s\",LE=%d$",-(l1+l2+3)>>1,y,b1,n1);
-  DocPrint(doc,"$CM+CX,%d,0$$BT,\"%s\",LE=%d$\n" ,-(l1+l2+3)>>1+l1+6,b2,n2);
-  if (footer) DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-public Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL)
-{//Make PopUp win task with OKAY bttn.
-  return PopUp1("OKAY",1,header,footer)>0;
-}
-
-public Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL)
-{//Make PopUp win task with NO/YES bttns.
-  return PopUp2("YES",1,"NO",0,header,footer)>0;
-}
-
-public Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL)
-{//Make PopUp win task CANCEL/OKAY bttns.
-  return PopUp2("OKAY",1,"CANCEL",0,header,footer)>0;
-}
-
-U8 *PopUpGetStr2(U8 *header,CTask *mem_task)
-{
-  U8 *res,*st;
-  if (header)
-    "%s",header;
-  st=GetStr(,,GSF_WITH_NEW_LINE);
-  res=StrNew(st,mem_task);
-  Free(st);
-  return res;
-}
-
-public U8 *PopUpGetStr(U8 *header=NULL)
-{//Prompt for text str in PopUp win task.
-  U8 *st=MStrPrint("PopUpGetStr2(0x%X,0x%X);",header,Fs),
-        *res=PopUp(st,Fs);
-  Free(st);
-  return res;
-}
-
-public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=I64_MIN,I64 hi=I64_MAX)
-{//Prompt for I64 text expression in PopUp win task.
-  U8 *st=MStrPrint("GetI64(0x%X,0x%X,0x%X,0x%X);",msg,dft,lo,hi);
-  I64 res=PopUp(st,Fs);
-  Free(st);
-  return res;
-}
-
-public F64 PopUpGetF64(U8 *msg,F64 dft,F64 lo=F64_MIN,F64 hi=F64_MAX)
-{//Prompt for F64 text expression in PopUp win task.
-  U8 *st=MStrPrint("GetF64(0x%X,0x%X(F64),0x%X(F64),0x%X(F64));",msg,dft,lo,hi);
-  F64 res=PopUp(st,Fs)(F64);
-  Free(st);
-  return res;
-}
-
-public I64 PopUpRangeI64(I64 lo,I64 hi,I64 step=1,
-        U8 *header=NULL,U8 *footer=NULL)
-{//Evenly-spaced I64 range chooser in PopUp win task.
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header)
-    DocPrint(doc,"%s",header);
-  DocPrint(doc,"$LTBLUE$");
-  for (i=lo;i<=hi;i+=step)
-    DocPrint(doc,"$MU,\"%d\",LE=%d$\n",i,i);
-  if (footer)
-    DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-public F64 PopUpRangeF64(F64 lo,F64 hi,F64 step,
-    U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL)
-{//Evenly-spaced F64 range chooser in PopUp win task.
-  F64 d;
-  I64 i;
-  U8 buf[STR_LEN];
-  CDoc *doc=DocNew;
-  if (header)
-    DocPrint(doc,"%s",header);
-  DocPrint(doc,"$LTBLUE$");
-  for (d=lo;d<=hi;d+=step) {
-    StrPrint(buf,fmt,d);
-    DocPrint(doc,"$MU,\"%s\",LE=0x%X$\n",buf,d);
-  }
-  if (footer)
-    DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i(F64);
-}
-
-public F64 PopUpRangeF64Exp(F64 lo,F64 hi,F64 factor,
-    U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL)
-{//Exp-spaced F64 range chooser in PopUp win task.
-  F64 d;
-  I64 i;
-  U8 buf[STR_LEN];
-  CDoc *doc=DocNew;
-  if (header)
-    DocPrint(doc,"%s",header);
-  DocPrint(doc,"$LTBLUE$");
-  for (d=lo;d<=hi;d*=factor) {
-    StrPrint(buf,fmt,d);
-    DocPrint(doc,"$MU,\"%s\",LE=0x%X$\n",buf,d);
-  }
-  if (footer)
-    DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i(F64);
-}
-
-public F64 PopUpRangeF64Log(F64 lo,F64 hi,I64 steps,
-    U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL)
-{//Log-spaced F64 range chooser in PopUp win task.
-  return PopUpRangeF64Exp(lo,hi,Exp(Ln(hi/lo)/(steps-1)),fmt,header,footer);
-}
-
-#help_index "Job/Exe;Task/Job/Exe;Compiler"
-public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE)
-{//Make adam_task execute file.
-  Bool okay=TRUE;
-  U8 *name=FileNameAbs(filename),
-        *name2=ExtDft(name,"HC.Z");
-  I64 res=0;
-  if (warn_ext &&
-        !FilesFindMatch(name2,FILEMASK_JIT) &&
-        !PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n"))
-    okay=FALSE;
-  if (okay)
-    res=Adam("#include \"%s\";",name2);
-  Free(name2);
-  Free(name);
-  return res;
-}
-
-public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
-        CTask *parent=NULL,CTask **_pu_task=NULL)
-{//ExeFile2() in PopUp task. Cont as User.
-  Bool okay=TRUE;
-  U8 *st,*name=FileNameAbs(filename),
-        *name2=ExtDft(name,"HC.Z");
-  I64 res=0;
-  if (warn_ext &&
-        !FilesFindMatch(name2,FILEMASK_JIT) &&
-        !PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n"))
-    okay=FALSE;
-  if (okay) {
-    st=MStrPrint(
-          "\"$$WW+H,1$$\";In(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
-          "UserTaskCont;",
-          name2);
-    res=PopUp(st,parent,_pu_task);
-    Free(st);
-  }
-  Free(name2);
-  Free(name);
-  return res;
-}
-
-public I64 PopUpRunFile(U8 *filename,I64 ccf_flags=0,...)
-{//ExeFile() with args using LastFun() in PopUp task.
-  U8 *st,*name=FileNameAbs(filename),
-        *name2=ExtDft(name,"HC.Z");
-  I64 res=0;
-  st=MStrPrint(
-        "\"$$WW+H,1$$\";ExeFile2(\"%s\",0x%X);LastFun(0x%X,0x%X);",
-        name2,ccf_flags,argc,argv);
-  res=PopUp(st,Fs);
-  Free(st);
-  Free(name2);
-  Free(name);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocPutKey.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocPutKey.HC.HTML deleted file mode 100755 index 24b2d8f..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocPutKey.HC.HTML +++ /dev/null @@ -1,760 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Output;StdOut/DolDoc"
-
-public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
-{//PutKey(ch,sc) at doc insert pt, cur_entry.
-  I64 i,x,y;
-  CDoc *m;
-  CDocEntry *doc_ce;
-  U8 *st,*st2;
-  Bool unlock;
-
-  if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
-    return;
-  if (doc->user_put_key && (*doc->user_put_key)(doc,doc->user_put_data,ch,sc))
-    return;
-  unlock=DocLock(doc);
-  if (!Bt(doldoc.clean_scan_codes,sc.u8[0]))
-    doc->flags|=DOCF_UNDO_DIRTY;
-  DocCaptureUndo(doc);
-  if (Bt(char_bmp_printable,ch) && !(sc&(SCF_CTRL|SCF_ALT))) {
-    if (sc&SCF_KEY_DESC) {
-      st=Char2KeyName(ch,FALSE);
-      KeyDescSet("Char  /'%s'",st);
-      Free(st);
-    } else
-      EdCharIns(ch,sc,doc);
-  } else {
-    doc_ce=doc->cur_entry;
-    x=doc->x; y=doc->y;
-    if (sc&SCF_ALT)
-      switch (ch) {
-        case CH_BACKSPACE: //<CTRL-H>
-          if (!(sc&(SCF_SHIFT|SCF_CTRL))) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Undo");
-            else
-              DocUndoRestore(doc);
-          }
-          break;
-      }
-    else
-      switch (ch) {
-        case 0:
-          switch (sc.u8[0]) {
-            case SC_CURSOR_DOWN:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Cursor Down, Sel");
-                  else
-                    KeyDescSet("Edit/Cursor Down");
-                } else
-                  EdLineDown(doc,sc);
-                break;
-              } else
-                sc&=~SCF_CTRL;
-//Fall Through to SC_END
-            case SC_END:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/GoTo Doc End, Sel");
-                  else
-                    KeyDescSet("Edit/GoTo Doc End");
-                } else {
-                  while (doc_ce!=doc) {
-                    BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-                    doc_ce=doc->cur_entry=doc_ce->next;
-                  }
-                  doc->cur_col=doc_ce->min_col;
-                  DocFormBwd(doc);
-                }
-              }
-              break;
-            case SC_CURSOR_UP:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Cursor Up, Sel");
-                  else
-                    KeyDescSet("Edit/Cursor Up");
-                } else
-                  EdLineUp(doc,sc);
-                break;
-              } else
-                sc&=~SCF_CTRL;
-//Fall Through to SC_HOME
-            case SC_HOME:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/GoTo Top of Doc, Sel");
-                  else
-                    KeyDescSet("Edit/GoTo Top of Doc");
-                } else {
-                  if (doc_ce==doc) doc_ce=doc_ce->last;
-                  while (doc_ce!=doc) {
-                    BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
-                    doc_ce=doc->cur_entry=doc_ce->last;
-                  }
-                  doc_ce=doc->cur_entry=doc->head.next;
-                  doc->cur_col=doc_ce->min_col;
-                  DocFormFwd(doc);
-                }
-              }
-              break;
-            case SC_PAGE_DOWN:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Page Down, Sel");
-                  else
-                    KeyDescSet("Edit/Page Down");
-                } else {
-                  i=doc_ce->y+doc->win_task->win_height-1;
-                  if (doc_ce->type_u8==DOCT_HEX_ED)
-                    i+=doc->cur_col/3/doc_ce->hex_ed_width;
-                  while (doc_ce!=doc &&
-                        (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y<i ||
-                        doc_ce->type_u8==DOCT_HEX_ED &&
-                        doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width<i)) {
-                    EdLineDown(doc,sc);
-//paranoid check for stuck on same node
-                    if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED)
-                      break;
-                    doc_ce=doc->cur_entry;
-                  }
-                }
-              }
-              break;
-            case SC_PAGE_UP:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Page Up, Sel");
-                  else
-                    KeyDescSet("Edit/Page Up");
-                }else {
-                  i=doc_ce->y-(doc->win_task->win_height-1);
-                  if (doc_ce->type_u8==DOCT_HEX_ED)
-                    i+=doc->cur_col/3/doc_ce->hex_ed_width;
-                  while (doc_ce->last!=doc &&
-                        (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y>i ||
-                        doc_ce->type_u8==DOCT_HEX_ED &&
-                        doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width>i) &&
-                        doc_ce->y!=doc->head.next->y) {
-                    EdLineUp(doc,sc);
-//paranoid check for stuck on same node
-                    if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED)
-                      break;
-                    doc_ce=doc->cur_entry;
-                  }
-                }
-              }
-              break;
-            case SC_CURSOR_LEFT:
-              if (sc&SCF_KEY_DESC) {
-                if (sc&SCF_CTRL)
-                  KeyDescSet("Edit/GoTo Start of Line");
-                else {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Cursor Left, Sel");
-                  else
-                    KeyDescSet("Edit/Cursor Left");
-                }
-              } else
-                EdCursorLeft(doc,sc);
-              break;
-            case SC_CURSOR_RIGHT:
-              if (sc&SCF_KEY_DESC) {
-                if (sc&SCF_CTRL)
-                  KeyDescSet("Edit/GoTo End of Line");
-                else {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Cursor Right, Sel");
-                  else
-                    KeyDescSet("Edit/Cursor Right");
-                }
-              } else
-                EdCursorRight(doc,sc);
-              break;
-            case SC_DELETE:
-              if (!(sc&SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Cut To Clip");
-                  else
-                    KeyDescSet("Char  /Delete");
-                } else {
-                  if (sc&SCF_SHIFT)
-                    ClipCut(doc);
-                  else
-                    EdCharDel(doc);
-                }
-              }
-              break;
-            case SC_INS:
-              if (sc&(SCF_SHIFT|SCF_CTRL)!=(SCF_SHIFT|SCF_CTRL)) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Edit/Paste Clip");
-                  else if (sc&SCF_CTRL)
-                    KeyDescSet("Edit/Copy to Clip");
-                  else
-                    KeyDescSet("Edit/Toggle Overstrike");
-                } else {
-                  if (sc&SCF_SHIFT)
-                    ClipPaste(doc);
-                  else if (sc&SCF_CTRL)
-                    ClipCopy(doc);
-                  else
-                    doc->flags^=DOCF_OVERSTRIKE;
-                }
-              }
-              break;
-            case SC_F1...SC_F10:
-              if (sc&SCF_CTRL) {
-                if (sc&SCF_KEY_DESC) {
-                  if (sc&SCF_SHIFT)
-                    KeyDescSet("Cmd /Src Code of Sym");
-                  else
-                    KeyDescSet("Edit/Autocomplete Sym");
-                } else {
-                  DocUnlock(doc);
-                  if (AutoComplete(ON)) {
-                    if (sc&SCF_SHIFT)
-                      ACMan(sc.u8[0]-SC_F1+1,Fs);
-                    else
-                      ACFillIn(sc.u8[0]-SC_F1+1);
-                  }
-                  DocLock(doc);
-                }
-              } else {
-                switch (sc.u8[0]) {
-                  case SC_F1:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Cmd /About");
-                      else
-                        KeyDescSet("Cmd /Help");
-                    } else {
-                      if (sc&SCF_SHIFT)
-                        Ed("::/Doc/AboutTempleOS.DD.Z");
-                      else
-                        Ed("::/Doc/HelpIndex.DD.Z");
-                    }
-                    break;
-                  case SC_F2:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Edit/Play Macro");
-                      else
-                        KeyDescSet("Edit/Macro");
-                    } else {
-                      DocUnlock(doc);
-                      if (sc&SCF_SHIFT) {
-                        if (TaskValidate(sys_macro_task))
-                          PostMsgWait(sys_macro_task,
-                                MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0);
-                        SysMacroStripKey(&sys_macro_head,ch,sc);
-                        PlaySysMacro;
-                      } else
-                        EdMacroUtil;
-                      DocLock(doc);
-                    }
-                    break;
-                  case SC_F3:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Edit/Find Last");
-                      else
-                        KeyDescSet("Edit/Find Next");
-                    }else {
-                      doc->find_replace->scan_fwd=!(sc&SCF_SHIFT);
-                      EdFindNext(doc);
-                    }
-                    break;
-                  case SC_F4:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Cmd /Insert Directory Name");
-                      else
-                        KeyDescSet("Cmd /Insert FileName");
-                    } else {
-                      DocUnlock(doc);
-                      if (sc&SCF_SHIFT)
-                        st=PopUpPickDir;
-                      else
-                        st=PopUpPickFile;
-                      DocLock(doc);
-                      if (st) {
-                        DocPrintPartial(doc,"%s",st);
-                        Free(st);
-                      }
-                    }
-                    break;
-                  case SC_F5:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Cmd /Adam Include");
-                      else
-                        KeyDescSet("Cmd /Run (Execute)");
-                    } else {
-                      if (st2=DocEntryLink(doc,doc_ce)) {
-                        st=DocLinkFile(st2);
-                        Free(st2);
-                      } else {
-                        DocWrite(doc);
-                        st=StrNew(doc->filename.name);
-                      }
-                      if (st2=DirFile(st,"Run","HC.Z")) {
-                        if (FileFind(st2)) {
-                          Free(st);
-                          st=st2;
-                        } else
-                          Free(st2);
-                      }
-                      if (st) {
-                        if (sc&SCF_SHIFT)
-                          AdamFile(st);
-                        else
-                          PopUpFile(st);
-                        Free(st);
-                      }
-                    }
-                    break;
-                  case SC_F6:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Cmd /God Doodle");
-                      else
-                        KeyDescSet("Cmd /God Song");
-                    } else {
-//::/Adam/God/HSNotes.DD
-                      if (sc&SCF_SHIFT) {
-                        DocUnlock(doc);
-                        GodDoodle;
-                        DocLock(doc);
-                      } else
-                        GodSong;
-                    }
-                    break;
-                  case SC_F7:
-                    if (sc&SCF_KEY_DESC) {
-                      if (sc&SCF_SHIFT)
-                        KeyDescSet("Cmd /God Passage");
-                      else
-                        KeyDescSet("Cmd /God Word");
-                    } else {
-//::/Adam/God/HSNotes.DD
-                      FifoU8Flush(god.fifo);
-                      GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
-                      if (sc&SCF_SHIFT)
-                        GodBiblePassage;
-                      else
-                        GodWord;
-                    }
-                    break;
-                }
-              }
-              break;
-          }
-          break;
-        case CH_CTRLA:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Save As");
-            else if (DocWrite(doc,TRUE)&&(st=FileNameAbs(doc->filename.name))) {
-              DirContextDel(doc->filename.dirc);
-              doc->filename.dirc=DirContextNew(st);
-              Free(st);
-            }
-          }
-          break;
-        case CH_CTRLB:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Toggle Border");
-            else
-              WinBorder(Bt(&doc->win_task->display_flags,
-                    DISPLAYf_NO_BORDER),doc->win_task);
-          }
-          break;
-        case CH_CTRLC:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Copy to Clip");
-            else
-              ClipCopy(doc);
-          }
-          break;
-        case CH_CTRLD:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /File Manager");
-            else {
-              DocUnlock(doc);
-              FileMgr;
-              DocLock(doc);
-            }
-          }
-          break;
-        case CH_CTRLF:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Search Files");
-            else
-              FindWiz;
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Find & Replace");
-            else
-              EdFindReplace(doc);
-          }
-          break;
-        case CH_CTRLG:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/GoTo Line Num");
-            else
-              EdGoToLine(doc);
-          }
-          break;
-        case CH_BACKSPACE: //<CTRL-H>
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Char  /Back Space");
-            else {
-              DocCaptureUndo(doc);
-              doc_ce=doc->cur_entry;
-              if (doc->cur_col<=doc_ce->min_col) {
-                doc_ce=doc->cur_entry=doc_ce->last;
-                if (doc_ce!=doc && doc_ce->type_u8==DOCT_SOFT_NEW_LINE)
-                  doc_ce=doc->cur_entry=doc_ce->last;
-                if (doc_ce==doc || doc_ce->type_u8==DOCT_PMT) {
-                  doc_ce=doc->cur_entry=doc_ce->next;
-                  doc->cur_col=doc_ce->min_col;
-                } else {
-                  doc->cur_col=doc_ce->max_col;
-                  if (doc->cur_col>doc_ce->min_col)
-                    doc->cur_col--;
-                  EdCharDel(doc);
-                }
-              } else {
-                doc->cur_col--;
-                EdCharDel(doc);
-              }
-            }
-          }
-          break;
-        case CH_CTRLI:
-          if (sc.u8[0]!=SC_TAB) {
-            if (sc&SCF_SHIFT) {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Dol /Unindent 2");
-              else
-                DocPrint(doc,"$ID,-2$");
-            } else {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Dol /Indent 2");
-              else
-                DocPrint(doc,"$ID,2$");
-            }
-          }
-          break;
-        case '\n':
-          if (sc&SCF_KEY_DESC) {
-            if (sc&SCF_SHIFT)
-              KeyDescSet("Char  /Return");
-            else
-              KeyDescSet("Char  /Page Break");
-          } else
-            EdCharIns(ch,sc,doc);
-          break;
-        case CH_CTRLK:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Blinking Text Off");
-            else
-              DocPrint(doc,"$BK,0$");
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Blinking Text On");
-            else
-              DocPrint(doc,"$BK,1$");
-          }
-          break;
-        case CH_CTRLL:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Code Tools");
-            else {
-              DocUnlock(doc);
-              EdCodeTools(doc);
-              DocLock(doc);
-            }
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Insert Text Widgets Wizard");
-            else {
-              DocUnlock(doc);
-              EdInsWidgetWiz;
-              DocLock(doc);
-            }
-          }
-          break;
-        case CH_CTRLM:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Personal Notes");
-            else
-              Ed("~/PersonalNotes.DD.Z");
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Personal Menu");
-            else {
-              m=DocRead("~/PersonalMenu.DD.Z");
-              DocMenu(m);
-              DocDel(m);
-            }
-          }
-          break;
-        case CH_CTRLO:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Collapse");
-            else
-              DocCollapse(TRUE,doc);
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Uncolapse");
-            else
-              DocCollapse(FALSE,doc);
-          }
-          break;
-        case CH_CTRLP:
-          if (doc->flags & (DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Toggle Super or Sub script");
-            else {
-              DocPrint(doc,"$SY,0$");
-              doc->flags&=~(DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE);
-            }
-          } else if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Toggle Subscript");
-            else {
-              DocPrint(doc,"$SY,3$");
-              doc->flags|=DOCF_SUBSCRIPT_MODE;
-            }
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Toggle Superscript");
-            else {
-              DocPrint(doc,"$SY,-3$");
-              doc->flags|=DOCF_SUPERSCRIPT_MODE;
-            }
-          }
-          break;
-        case CH_CTRLQ:
-          break;
-        case CH_CTRLR:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Cmd /Sprite Graphic Resource");
-            else
-              if (!(doc->flags&DOCF_FORM) &&
-                    !(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
-                DocUnlock(doc);
-                if (doc_ce->type_u8==DOCT_SPRITE)
-                  EdSpriteEd(doc);
-                else
-                  EdSpriteIns(doc);
-                DocLock(doc);
-              }
-          }
-          break;
-        case CH_CTRLS:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Toggle AutoSave");
-            else
-              LBtc(&doc->flags,DOCf_AUTO_SAVE);
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Save");
-            else
-              DocWrite(doc);
-          }
-          break;
-        case CH_CTRLT:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Single Entry Toggle Plain Text");
-            else if (!(doc->flags&DOCF_FORM))
-              DocEntryToggle(doc);
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Toggle Plain Text Display");
-            else if (!(doc->flags&DOCF_FORM))
-              DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
-          }
-          break;
-        case CH_CTRLU:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Underline Off");
-            else
-              DocPrint(doc,"$UL,0$");
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Underline On");
-            else
-              DocPrint(doc,"$UL,1$");
-          }
-          break;
-        case CH_CTRLV:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Paste Clip");
-            else
-              ClipPaste(doc);
-          }
-          break;
-        case CH_CTRLW:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Word Wrap Off");
-            else
-              DocPrint(doc,"$WW,0$");
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Word Wrap On");
-            else
-              DocPrint(doc,"$WW,1$");
-          }
-          break;
-        case CH_CTRLX:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Cut To Clip");
-            else
-              ClipCut(doc);
-          }
-          break;
-        case CH_CTRLY:
-          if (!(sc&SCF_SHIFT)) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Edit/Delete Line");
-            else
-              EdLineDel(doc);
-          }
-          break;
-        case CH_CTRLZ:
-          if (sc&SCF_SHIFT) {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Inverted Text Off");
-            else
-              DocPrint(doc,"$IV,0$");
-          } else {
-            if (sc&SCF_KEY_DESC)
-              KeyDescSet("Dol /Inverted Text On");
-            else
-              DocPrint(doc,"$IV,1$");
-          }
-          break;
-        case '0'...'9':
-          if (sc&SCF_CTRL) {
-            if (sc&SCF_KEY_DESC) {
-              if (sc&SCF_SHIFT)
-                KeyDescSet("Cmd /Word Definition");
-              else
-                KeyDescSet("Edit/Autocomplete Word");
-            } else {
-              if (AutoComplete(ON)) {
-                DocUnlock(doc);
-                if (sc&SCF_SHIFT)
-                  ACDDef(ch-'0',Fs);
-                else
-                  ACDFillin(ch-'0');
-                DocLock(doc);
-              }
-            }
-          }
-          break;
-        case '[':
-          if (sc&SCF_CTRL) {
-            if (sc&SCF_SHIFT) {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Edit/GoTo matching brace");
-              else
-                EdFindPaired(doc,'}','{',FALSE);
-            } else {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Edit/GoTo matching bracket");
-              else
-                EdFindPaired(doc,']','[',FALSE);
-            }
-          }
-          break;
-        case ']':
-          if (sc&SCF_CTRL) {
-            if (sc&SCF_SHIFT) {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Edit/GoTo matching brace");
-              else
-                EdFindPaired(doc,'{','}',TRUE);
-            } else {
-              if (sc&SCF_KEY_DESC)
-                KeyDescSet("Edit/GoTo matching bracket");
-              else
-                EdFindPaired(doc,'[',']',TRUE);
-            }
-          }
-          break;
-      }
-  }
-  if (unlock)
-    DocUnlock(doc);
-  if (!(doc->flags&DOCF_DONT_SWAP_OUT))
-    Yield;
-}
-
-Bool KDDocPutKey(I64 ch,I64 scan_code)
-{
-  CDoc *doc;
-  if (doc=DocPut)
-    DocPutKey(doc,ch,scan_code);
-  return FALSE;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocPutS.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocPutS.HC.HTML deleted file mode 100755 index 42903a3..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocPutS.HC.HTML +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Output;StdOut/DolDoc"
-
-CDocEntry *DocPutS(CDoc *doc,U8 *st)
-{//Don't use this.  Use DocPrint().
-//Does not handle partial Doc entries.
-  //Returns last newly created dollar-sign CDocEntry or NULL.
-  U8 *ptr=st,*ptr2,*st2,*ptr3,*ptr4,*src,
-        *char_bmp;
-  Bool unlock;
-  I64 ch,j;
-  CDocEntry *doc_e=NULL,*res=NULL,*doc_ce;
-  if (!st || !doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
-    return NULL;
-  unlock=DocLock(doc);
-  if (doc->flags & DOCF_PLAIN_TEXT_TABS)
-    char_bmp=char_bmp_zero_cr_nl_cursor;
-  else if (doc->flags & DOCF_PLAIN_TEXT)
-    char_bmp=char_bmp_zero_tab_cr_nl_cursor;
-  else
-    char_bmp=char_bmp_zero_tab_cr_nl_cursor_dollar;
-  doc_ce=doc->cur_entry;
-  while (*ptr) {
-    ptr2=ptr;
-    do ch=*ptr++;
-    while (!Bt(char_bmp,ch) || ch==CH_CURSOR && doc->flags&DOCF_NO_CURSOR);
-    ptr--;
-    if (!ch) {
-      if (j=ptr-ptr2) {
-        doc_e=DocEntryNewBase(doc,
-              DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
-        if (doc->flags & DOCF_NO_CURSOR) {
-          src=MAlloc(j+1);
-          MemCpy(src,ptr2,j+1);
-          StrUtil(src,SUF_REM_CTRL_CHARS);
-          j=StrLen(src);
-        } else
-          src=ptr2;
-        doc_e->tag=MAlloc(j+1,doc->mem_task);
-        MemCpy(doc_e->tag,src,j+1);
-        doc_e->max_col=j;
-        DocInsEntry(doc,doc_e);
-        if (doc->flags & DOCF_NO_CURSOR)
-          Free(src);
-      }
-    } else {
-      if (j=ptr-ptr2) {
-        *ptr=0;
-        doc_e=DocEntryNewBase(doc,
-              DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
-        if (doc->flags & DOCF_NO_CURSOR) {
-          src=MAlloc(j+1);
-          MemCpy(src,ptr2,j+1);
-          ptr3=src;
-          ptr4=src;
-          while (*ptr3)
-            if (*ptr3!=CH_CURSOR)
-              *ptr4++=*ptr3++;
-            else
-              ptr3++;
-          *ptr4=0;
-          j=ptr4-src;
-        } else
-          src=ptr2;
-        doc_e->tag=MAlloc(j+1,doc->mem_task);
-        MemCpy(doc_e->tag,src,j+1);
-        doc_e->max_col=j;
-        DocInsEntry(doc,doc_e);
-        if (doc->flags & DOCF_NO_CURSOR)
-          Free(src);
-        *ptr=ch;
-      }
-      switch (ch) {
-        case CH_CURSOR:
-          doc_e=DocEntryNewBase(doc,
-                DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
-          DocInsEntry(doc,doc_e);
-          ptr++;
-          break;
-        case '\t':
-          doc_e=DocEntryNewBase(doc,
-                DOCT_TAB|doc->settings_head.dft_text_attr<<8);
-          DocInsEntry(doc,doc_e);
-          ptr++;
-          break;
-        case '$':
-          ptr++; //skip first dollar
-          ptr2=ptr;
-          while (*ptr && *ptr!='$')
-            ptr++;
-          if (*ptr) {
-            *ptr=0; //zero second dollar
-            if (ptr-1==ptr2 && *ptr2==CH_CURSOR) {
-              doc_e=DocEntryNewBase(doc,
-                    DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
-              DocInsEntry(doc,doc_e);
-              ptr2++;
-            }
-            if (ptr==ptr2) {
-              doc_e=DocEntryNewBase(doc,
-                    DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
-              doc_e->max_col=1;
-              if (doc->flags & DOCF_DBL_DOLLARS)
-                doc_e->tag=StrNew("$$",doc->mem_task);
-              else
-                doc_e->tag=StrNew("$",doc->mem_task);
-              DocInsEntry(doc,doc_e);
-            } else {
-              st2=MAlloc(ptr-ptr2+1);
-              ptr3=ptr2;
-              ptr4=st2;
-              while (ch=*ptr3++) {
-                if (ch==CH_CURSOR) {
-                  doc_e=DocEntryNewBase(doc,
-                        DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
-                  DocInsEntry(doc,doc_e);
-                } else
-                  *ptr4++=ch;
-              }
-              *ptr4=0;
-              if (doc_e=PrsDollarCmd(doc,st2)) {
-                res=doc_e;
-                DocInsEntry(doc,doc_e);
-              }
-              Free(st2);
-            }
-            *ptr++='$';
-          }
-          break;
-        default:
-          doc_e=DocEntryNewBase(doc,
-                DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
-          DocInsEntry(doc,doc_e);
-          if (ch=='\r')
-            while (*ptr=='\r')
-              ptr++;
-          if (*ptr=='\n')
-            ptr++;
-          while (*ptr=='\r')
-            ptr++;
-      }
-    }
-  }
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-
-public CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...)
-{//You must not print partial doc cmds.
-//Returns last newly created dollar-sign CDocEntry or NULL.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  CDocEntry *res=DocPutS(doc,buf);
-  Free(buf);
-  return res;
-}
-
-public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
-{//Lets you print half a doc cmd, if you like.
-  U8 *buf,*st,*src,*dst,*ptr,*ptr2;
-  Bool unlock;
-  CDocEntry *doc_ce,*doc_ne;
-  I64 ch,i,j;
-  if (!doc && !(doc=DocPut))
-    return;
-  buf=StrPrintJoin(NULL,fmt,argc,argv);
-  ptr=buf;
-  if (doc->user_put_s && (*doc->user_put_s)(doc,doc->user_put_data,buf)) {
-    Free(buf);
-    return;
-  }
-  unlock=DocLock(doc);
-  if (doc->cur_entry->type_u8==DOCT_DATA)
-    while (ch=*ptr++)
-      DocPutKey(doc,ch,0);
-  else
-    while (ch=*ptr) {
-      if (!Bt(char_bmp_safe_dollar,ch) ||
-            doc->flags & (DOCF_OVERSTRIKE|DOCF_IN_DOLLAR)) {
-        DocPutKey(doc,ch,0);
-        ptr++;
-      } else {
-        ptr2=ptr++;
-        while (TRUE) {
-          ch=*ptr++;
-          if (!Bt(char_bmp_safe_dollar,ch))
-            break;
-        }
-        ptr--;
-        *ptr=0;
-        doc_ce=doc->cur_entry;
-        j=ptr-ptr2;
-        if (IsEditableText(doc_ce)) {
-          dst=st=MAlloc(doc_ce->max_col+j+1,doc->mem_task);
-          src=doc_ce->tag;
-          i=doc->cur_col;
-          doc->cur_col+=j;
-          doc_ce->max_col+=j;
-          while (i-->0)
-            *dst++=*src++;
-          while (j-->0)
-            *dst++=*ptr2++;
-          while (*dst++=*src++);
-          Free(doc_ce->tag);
-          doc_ce->tag=st;
-        } else {
-          doc_ne=DocEntryNewTag(doc,doc_ce,ptr2);
-          doc_ne->type=DOCT_TEXT|doc->settings_head.dft_text_attr<<8;
-          doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
-          QueIns(doc_ne,doc_ce->last);
-          doc->cur_entry=doc_ne;
-          doc->cur_col=StrLen(ptr2);
-        }
-        *ptr=ch;
-        DocRemSoftNewLines(doc,doc->cur_entry);
-      }
-    }
-  if (unlock)
-    DocUnlock(doc);
-  if (!(doc->flags&DOCF_DONT_SWAP_OUT))
-    Yield;
-  Free(buf);
-}
-
-Bool KDDocPutS(U8 *st)
-{
-  CDoc *doc;
-  if (doc=DocPut)
-    DocPrintPartial(doc,"%s",st);
-  return FALSE;
-}
-
-public U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...)
-{//Prints multiple whole cmds all-at-once. Might need this when printing trees.
-  U8 *buf;
-  Bool unlock;
-  I64 old_flags;
-  if (!doc && !(doc=DocPut))
-    return;
-  buf=StrPrintJoin(NULL,fmt,argc,argv);
-  unlock=DocLock(doc);
-  old_flags=doc->flags;
-  doc->flags|=DOCF_NO_CURSOR;
-  DocPrint(doc,"%s",buf);
-  DocRecalc(doc);
-  doc->flags=old_flags;
-  if (unlock)
-    DocUnlock(doc);
-  Free(buf);
-}
-
-U0 DocDump(CDoc *doc,I64 uS_delay=0)
-{
-  U8 *st;
-  CDocEntry *doc_e,*doc_e2;
-  Bool unlock=DocLock(doc);
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    st=DocScanLine(doc,doc_e,NULL,&doc_e2);
-    "%s",st;
-    Free(st);
-    doc_e=doc_e2;
-    if (doc_e->type_u8==DOCT_NEW_LINE) {
-      '\n';
-      Busy(uS_delay);
-      doc_e=doc_e->next;
-    }
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public CDocEntry *DocPutLine(CDoc *doc=NULL,CDocEntry *doc_e)
-{//Send line from other doc to StdOut DocPut.
-  I64 ch;
-  U8 *ptr,*ptr2;
-  Bool unlock;
-  if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
-    return NULL;
-  unlock=DocLock(doc);
-  while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) {
-    if (doc_e->de_flags&DOCEF_TAG) {
-      ptr=doc_e->tag;
-      do {
-        ptr2=ptr;
-        while (ch=*ptr)
-          if (ch=='$')
-            break;
-          else
-            ptr++;
-        *ptr=0;
-        "%s",ptr2;
-        *ptr=ch;
-        if (ch=='$') {
-          "$$";
-          ptr++;
-        }
-      } while (ch);
-    } else if (doc_e->type_u8==DOCT_TAB)
-      '\t';
-    doc_e=doc_e->next;
-  }
-  '\n';
-  if (doc_e!=doc)
-    doc_e=doc_e->next;
-  if (unlock)
-    DocUnlock(doc);
-  return doc_e;
-}
-
-#help_index "Debugging/Dump;DolDoc/Cmd Line (Typically);"\
-        "Cmd Line (Typically);DolDoc/Output;StdOut/DolDoc"
-public U0 DocDm(U8 *buf,I64 cnt=0x80)
-{//Dump live chunk of mem showing addresses. Can be edited.
-  CDocEntry *doc_e;
-  CDoc *doc=DocPut;
-  Bool unlock=DocLock(doc);
-  doc_e=DocPrint(doc,"$HX-Z,%d,16$",cnt);
-  doc_e->data=buf;
-  doc->cur_entry=doc_e->next;
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocD(U8 *buf,I64 cnt=0x80)
-{//Dump live chunk of mem showing offsets. Can be edited.
-  CDocEntry *doc_e;
-  CDoc *doc=DocPut;
-  Bool unlock=DocLock(doc);
-  doc_e=DocPrint(doc,"$HX,%d,16$",cnt);
-  doc_e->data=buf;
-  doc->cur_entry=doc_e->next;
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocRecalc.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocRecalc.HC.HTML deleted file mode 100755 index 8208557..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocRecalc.HC.HTML +++ /dev/null @@ -1,1355 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-I64 DocWordWrapDel(CDoc *doc,CDocEntry *doc_e,
-        Bool full_refresh,Bool same_win,I64 left_margin,I64 right_margin,
-        CDocEntry **_best_doc_e,I64 *_best_col)
-{
-  CDocEntry *doc_e2;
-  U8 *ptr;
-  I64 j,k;
-  if (doc_e->de_flags&DOCEF_TAG && doc_e->tag)
-    k=StrLen(doc_e->tag);
-  else
-    k=0;
-  if (full_refresh)
-    while (TRUE) {
-      doc_e2=doc_e->next;
-      if (doc_e2->type_u8==DOCT_SOFT_NEW_LINE && !same_win) {
-        if (doc->cur_entry==doc_e2) {
-          doc->cur_entry=doc_e2->next;
-          doc->cur_col=doc->cur_entry->min_col;
-        }
-        if (*_best_doc_e==doc_e2) {
-          *_best_doc_e=doc_e2->next;
-          *_best_col=0;
-        }
-        DocEntryDel(doc,doc_e2);
-      } else if (IsEditableText(doc_e) &&
-            doc_e->de_flags==doc_e2->de_flags && doc_e->type==doc_e2->type) {
-        j=StrLen(doc_e2->tag);
-        ptr=MAlloc(k+j+1,doc->mem_task);
-        MemCpy(ptr,doc_e->tag,k);
-        MemCpy(ptr+k,doc_e2->tag,j+1);
-        Free(doc_e->tag);
-        doc_e->tag=ptr;
-        if (doc->cur_entry==doc_e2) {
-          doc->cur_entry=doc_e;
-          doc->cur_col+=k;
-        }
-        if (*_best_doc_e==doc_e2) {
-          *_best_doc_e=doc_e;
-          *_best_col=0;
-        }
-        DocEntryDel(doc,doc_e2);
-        k+=j;
-        if (k>(right_margin-left_margin+1)<<1)
-          break;
-      } else
-        break;
-    }
-  if (doc_e->de_flags & DOCEF_SCROLLING_X)
-    k=doc_e->scroll_len;
-  return k;
-}
-
-U0 DocRecalcXY(CDoc *doc,CDocEntry *doc_e,
-        I64 k,I64 left,I64 width,I64 height,I64 left_margin,I64 right_margin,
-        I64 x0,I64 y0,I64 *_x,I64 *_y)
-{
-  I64 i,x=*_x,y=*_y;
-  if (doc_e->de_flags & DOCEF_MARGIN_REL_X) {
-    if (doc_e->de_flags & DOCEF_LEFT_X)
-      x=left_margin-left;
-    else if (doc_e->de_flags & DOCEF_RIGHT_X)
-      x=right_margin-(k-1)-left;
-    else if (doc_e->de_flags & DOCEF_CENTER_X)
-      x=(right_margin+left_margin)>>1-k>>1-left;
-  } else {
-    if (doc_e->de_flags & DOCEF_LEFT_X)
-      x=x0;
-    else if (doc_e->de_flags & DOCEF_RIGHT_X)
-      x=width+x0-k;
-    else if (doc_e->de_flags & DOCEF_CENTER_X)
-      x=(width+x0-k)>>1;
-  }
-  i=y;
-  if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
-    doc->flags|=DOCF_BWD_MOVEMENT;
-    if (doc_e->de_flags & DOCEF_TOP_Y)
-      y-=doc_e->page_line_num;
-    else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
-      y+=doc_e->settings.page_len-doc_e->page_line_num;
-    else if (doc_e->de_flags & DOCEF_CENTER_Y)
-      y+=doc_e->settings.page_len>>1-doc_e->page_line_num;
-  } else {
-    doc->flags|=DOCF_BWD_MOVEMENT;
-    if (doc_e->de_flags & DOCEF_TOP_Y)
-      y=y0;
-    else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
-      y=height-1+y0;
-    else if (doc_e->de_flags & DOCEF_CENTER_Y)
-      y=height>>1+y0;
-  }
-  if (y!=i) {
-    doc->page_line_num+=y-i;
-    if (doc->page_line_num<0)
-      doc->page_line_num=doc_e->settings.page_len+
-            doc->page_line_num%doc_e->settings.page_len;
-    else
-      doc->page_line_num=doc->page_line_num%doc_e->settings.page_len;
-    if (doc_e->settings.header!=DOC_DFT &&
-          doc->page_line_num<doc_e->settings.header) {
-      y+=doc_e->settings.header-doc->page_line_num;
-      doc->page_line_num=doc_e->settings.header;
-    }
-    if (doc_e->settings.footer==DOC_DFT) {
-      if (doc->page_line_num>=doc_e->settings.page_len) {
-        if (doc_e->settings.header==DOC_DFT)
-          doc->page_line_num=0;
-        else {
-          doc->page_line_num=doc_e->settings.header;
-          y+=doc_e->settings.header;
-        }
-      }
-    } else {
-      if (doc->page_line_num>=
-            doc_e->settings.page_len-doc_e->settings.footer) {
-        y+=doc_e->settings.footer;
-        if (doc_e->settings.header==DOC_DFT)
-          doc->page_line_num=0;
-        else {
-          doc->page_line_num=doc_e->settings.header;
-          y+=doc_e->settings.header;
-        }
-      }
-    }
-  }
-  *_x=x;
-  *_y=y;
-}
-
-CDocEntry *DocSplitTag(CDoc *doc,CDocEntry *doc_e,I64 i,I64 x,I64 y,I64 type_u8)
-{//Split tag at i, insert DOCT_SOFT_NEW_LINE, DOCT_MARKER or DOCT_CURSOR
-  U8 *ptr;
-  CDocEntry *doc_e2;
-  if (doc_e->type_u8==DOCT_TEXT && i) {
-    if (i<StrLen(doc_e->tag)) {
-      doc_e2=MAllocIdent(doc_e,doc->mem_task);
-      doc_e2->tag=StrNew(doc_e->tag+i,doc->mem_task);
-      doc_e2->de_flags=doc_e->de_flags&~DOCEG_HAS_ALLOC|DOCEF_TAG;
-      QueIns(doc_e2,doc_e);
-      if (doc->cur_entry==doc_e && doc->cur_col>=i) {
-        doc->cur_entry=doc_e2;
-        doc->cur_col=doc->cur_col-i;
-      }
-      doc_e->tag[i]=0;
-      ptr=StrNew(doc_e->tag,doc->mem_task);
-      Free(doc_e->tag);
-      doc_e->tag=ptr;
-    }
-  } else
-    doc_e=doc_e->last;
-  doc_e2=DocEntryNewBase(doc,type_u8|doc_e->type & 0xFFFFFF00,
-        doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc_e->page_line_num);
-  MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
-  QueIns(doc_e2,doc_e);
-  return doc_e2;
-}
-
-CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
-        I64 *_k,I64 left,I64 right_margin,I64 x,I64 y)
-{
-  CDocEntry *doc_e2;
-  I64 j,i=right_margin+1-(x+left),  //Space left on line
-        ii=x+1-doc_e->settings.left_margin;
-  if (IsEditableText(doc_e)) {
-    if (doc->cur_entry==doc_e->next) {
-      if (doc->cur_col==doc_e->next->min_col)
-        i--;
-    } else {
-      if (doc->cur_entry==doc_e && doc->cur_col==i)
-        i--;
-    }
-    if (*_k>i) {
-      for (j=i;j>8-ii && j>=0;j--)
-        if (doc_e->tag[j]==CH_SPACE || doc_e->tag[j]==CH_SHIFT_SPACE) {
-          i=j+1;
-          break;
-        }
-      if (0<i<*_k) {
-        DocSplitTag(doc,doc_e,i,x,y,DOCT_SOFT_NEW_LINE);
-        *_k=StrLen(doc_e->tag);
-        return NULL;
-      }
-    }
-    if (*_k==i)
-      return NULL;
-  }
-  if (*_k>=i) {
-    doc_e2=doc_e->last;
-    if (doc_e2->type_u8!=DOCT_SOFT_NEW_LINE &&
-          doc_e2->type_u8!=DOCT_NEW_LINE &&
-          doc_e2->type_u8!=DOCT_CURSOR_MOVEMENT) {
-      doc_e2=DocEntryNewBase(doc,DOCT_SOFT_NEW_LINE|doc_e->type&0xFFFFFF00,
-            DOCEF_WORD_WRAP|doc_e->de_flags&(DOCEF_HIGHLIGHT|DOCG_BL_IV_UL|
-            DOCEF_SKIP|DOCEF_FILTER_SKIP),x,y,doc_e->last->page_line_num);
-      MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
-      QueIns(doc_e2,doc_e->last);
-      return doc_e2;
-    }
-  }
-  return NULL;
-}
-
-I64 DocTmpAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
-{
-  I64 tmp_u32_attr;
-  doc_e->de_flags=doc->flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) |
-        doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
-  tmp_u32_attr=(cur_u8_attr&0xF0)<<8|
-        doc->flags&DOCG_BL_IV_UL|(doc_e->settings.shifted_x&0x1F)<<16|
-        (doc_e->settings.shifted_y&0x1F)<<21;
-  if (doc_e->de_flags & DOCEF_HAS_BIN && *doc_e->tag=='<')
-    tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
-  else
-    switch (doc_e->type_u8) {
-      case DOCT_SPRITE:
-        if (doc_e->de_flags & DOCEF_LEFT_EXP)
-          tmp_u32_attr.u8[1]|=cur_u8_attr&15;
-        else if (doc_e->de_flags & DOCEF_LINK)
-          tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
-        else if (doc_e->de_flags & DOCEF_LEFT_MACRO)
-          tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
-        else if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST))
-          tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
-        else
-          tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
-        break;
-      case DOCT_HTML_CODE:
-        tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
-        break;
-      case DOCT_LINK:
-        tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
-        break;
-      case DOCT_MACRO:
-        tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
-        break;
-      case DOCT_ANCHOR:
-        tmp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
-        break;
-      case DOCT_TREE:
-      case DOCT_LST:
-        tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
-        break;
-      default:
-        tmp_u32_attr.u8[1]|=cur_u8_attr&15;
-    }
-  doc_e->type.u8[1]=tmp_u32_attr.u8[1];
-  tmp_u32_attr|=doc_e->type&0xFFFF0000;
-  if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) &&
-        doc_e->type_u8!=DOCT_TEXT)
-    tmp_u32_attr^=0xFF00;
-  doc_e->settings.final_u32_attr=tmp_u32_attr;
-  return tmp_u32_attr;
-}
-
-public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
-{//Recalc and fmt.  Also used by WinMgr to draw on scrn.
-  I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=I64_MAX,xx,yy,zz,
-        num_entries=0,i_jif,cur_u8_attr,tmp_u32_attr,
-        cursor_y=I64_MIN,left_margin,right_margin,y_plot_top,y_plot_bottom,
-        top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left;
-  CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL,
-        *added_cursor=NULL;
-  CDocBin *tmpb;
-  CDocSettings *s;
-  Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE,
-        find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds;
-  CTask *win_task,*mem_task;
-  CDC *dc;
-  U8 *bptr,*ptr,buf[STR_LEN],ch;
-  U32 *u32_ptr,*hl;
-  I32 *depth_buf=NULL;
-  F64 cur_time=tS;
-  CWinScroll *vss,*hss;
-  CHashDefineStr *tmph;
-
-  if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
-
-    //WinMgr updates all wins (30000.0/1001), 33.33333mS
-  if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && doc->owning_task!=Fs) {
-    i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 ms
-    while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
-      if (cnts.jiffies>=i_jif)
-        return FALSE; //Bail-out if doc locked.
-      Yield;
-    }
-  }
-
-  unlock=DocLock(doc);
-  if (doc->doc_signature!=DOC_SIGNATURE_VAL) {
-    DocUnlock(doc);
-    return FALSE;
-  }
-
-  win_task=doc->win_task;
-  mem_task=doc->mem_task;
-  blink_flag=Blink;
-  dc=NULL;
-  switch [recalc_flags&RECALCG_MASK] {
-    case RECALCt_FIND_CURSOR:
-      find_cursor=TRUE;
-      if (win_task)
-        dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
-      break;
-    case RECALCt_TO_SCRN:
-      if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
-            !Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
-            !(doc->flags&DOCF_BWD_MOVEMENT))
-        full_refresh=FALSE;
-      if (win_task)
-        dc=DCAlias(gr.dc2,win_task);
-      break;
-  }
-
-  PUSHFD
-  CLI
-  left  =win_task->win_left;
-  right =win_task->win_right;
-  width =win_task->win_width;
-  scroll_x=win_task->scroll_x;
-  scroll_y=win_task->scroll_y;
-  top   =win_task->win_top;
-  bottom=win_task->win_bottom;
-  height=win_task->win_height;
-  pix_left  =win_task->pix_left;
-  pix_top   =win_task->pix_top;
-  left_margin=left;
-  right_margin=right;
-  POPFD
-  if (doc->flags&DOCF_BORDER_DOC) {
-    scroll_x=0;
-    scroll_y=0;
-  }
-  best_doc_e=doc->cur_entry;
-
-  if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) &&
-        FilesFindMatch(doc->filename.name,FILEMASK_SRC))
-    doc->flags|=DOCF_HIGHLIGHT;
-  else
-    doc->flags&=~DOCF_HIGHLIGHT;
-
-  x=y=0;
-  doc->page_line_num=0;
-  if (full_refresh && !find_cursor) {
-    doc->x=x;
-    doc->y=y;
-  }
-
-  hss=&win_task->horz_scroll;
-  vss=&win_task->vert_scroll;
-  if (doc->flags&DOCF_BORDER_DOC) {
-    doc->top_line_num=0;
-    doc->line_start_col=0;
-    recalc_flags&=~RECALCF_HAS_CURSOR;
-    if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
-      doc->settings_head.cur_text_attr=
-            doc->settings_head.dft_text_attr=win_task->border_attr;
-  } else {
-    if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) {
-      if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) {
-        if (!(doc->flags&DOCF_NO_SCROLL_BARS)) {
-          if (Bt(&hss->flags,WSSf_SET_TO_POS)) {
-            doc->line_start_col=hss->pos;
-            LBtr(&hss->flags,WSSf_SET_TO_POS);
-          }
-          if (Bt(&vss->flags,WSSf_SET_TO_POS)) {
-            doc->top_line_num=vss->pos;
-            LBtr(&vss->flags,WSSf_SET_TO_POS);
-          }
-        }
-        doc->x=doc->line_start_col+width/2;
-        doc->y=doc->top_line_num+height/2;
-        find_cursor=TRUE;
-      }
-    }
-    if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
-      doc->settings_head.cur_text_attr=
-            doc->settings_head.dft_text_attr=win_task->text_attr;
-  }
-  x0=doc->line_start_col;
-  y0=doc->top_line_num;
-  same_win=top   ==doc->old_win_top &&
-        bottom==doc->old_win_bottom &&
-        left  ==doc->old_win_left &&
-        right ==doc->old_win_right &&
-        doc->cur_entry==doc->old_cur_entry &&
-        doc->cur_col==doc->old_cur_col;
-  if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
-    y_plot_top=y0-scroll_y/FONT_HEIGHT;
-    y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
-    if (!(doc->flags&DOCF_BORDER_DOC) &&
-          !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
-      DocBorderLstDraw(doc);
-  }
-
-  if (doc->cur_col<=doc->cur_entry->min_col)
-    doc->cur_col=doc->cur_entry->min_col;
-  doc_e=doc->head.next;
-  doc_e->de_flags&=~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
-  if (doc_e==doc->head.next)
-    s=&doc->settings_head;
-  else
-    s=&doc_e->last->settings;
-  doc->flags=doc_e->de_flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP) |
-        doc->flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP);
-  cur_u8_attr=s->cur_text_attr;
-  if (doc_e==doc->head.next) {
-    doc->flags&=~DOCF_BWD_MOVEMENT;
-    if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && full_refresh)
-      doc->flags&=~DOCF_HAS_SONG;
-  } else
-    doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
-          doc->flags&~DOCEF_HIGHLIGHT;
-
-  if (doc->head.next==doc) {
-    best_doc_e=doc;
-    best_col=0;
-    doc->cur_entry=doc;
-    doc->cur_col=0;
-    doc_e=doc;
-  }
-  skipped_update= doc_e==doc && doc->head.next!=doc;
-
-  if (full_refresh) {
-    doc->min_x=I32_MAX; doc->min_y=I32_MAX;
-    doc->max_x=I32_MIN; doc->max_y=I32_MIN;
-  }
-  while (doc_e!=doc) {
-    while (TRUE) {
-      del_doc_e=FALSE;
-      if (doc_e->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
-        doc_e2=doc_e;
-        goto rc_skip;
-      }
-      MemCpy(&doc_e->settings,s,sizeof(CDocSettings));
-      s=&doc_e->settings;
-      if (doc_e->de_flags & (DOCEF_TAG_CB|DOCEF_DEFINE) &&
-            !(doc_e->de_flags & DOCEF_LST)) {
-        Free(doc_e->tag);
-        if (doc_e->de_flags & DOCEF_TAG_CB) {
-          if (doc_e->tag_cb)
-            doc_e->tag=(*doc_e->tag_cb)(doc,doc_e,mem_task);
-          else
-            doc_e->tag=StrNew("",mem_task);
-        } else {
-          if (tmph=HashFind(doc_e->define_str,
-                win_task->hash_table,HTT_DEFINE_STR))
-            doc_e->tag=StrNew(tmph->data,mem_task);
-          else
-            doc_e->tag=CAlloc(1,mem_task);
-        }
-        doc_e->max_col=StrLen(doc_e->tag);
-        if (doc->cur_entry==doc_e && doc->cur_col>=doc_e->max_col) {
-          if (doc_e->max_col)
-            doc->cur_col=doc_e->max_col-1;
-          else
-            doc->cur_col=0;
-        }
-      }
-      k=DocWordWrapDel(doc,doc_e,full_refresh,same_win,
-            left_margin,right_margin,&best_doc_e,&best_col);
-      if (doc_e->de_flags & (DOCEF_LEFT_X|DOCEF_RIGHT_X|DOCEF_CENTER_X|
-            DOCEF_TOP_Y|DOCEF_BOTTOM_Y|DOCEF_CENTER_Y))
-        DocRecalcXY(doc,doc_e,k,
-              left,width,height,left_margin,right_margin,x0,y0,&x,&y);
-      if (full_refresh && k>0 && doc->flags & DOCF_WORD_WRAP &&
-            (doc_e2=DocWordWrapAdd(doc,doc_e,&k,left,right_margin,x,y)))
-        doc_e=doc_e2;
-      else
-        break;
-    }
-
-    if (full_refresh) {
-      doc_e->x=x;
-      doc_e->y=y;
-      doc_e->page_line_num=doc->page_line_num;
-      if (x<doc->min_x) doc->min_x=x;
-      if (y<doc->min_y) doc->min_y=y;
-      if (find_cursor) {
-        D=DocCharDist(doc,x,y);
-        col=0;
-      }
-    }
-    col2=0;
-
-    tmp_u32_attr=DocTmpAttr(doc,doc_e,cur_u8_attr);
-    if (doc_e==doc->cur_entry) {
-      cursor_y=doc_e->y;
-      if (recalc_flags&RECALCF_ADD_CURSOR && !added_cursor) {
-        if (doc_e->type_u8==DOCT_TEXT && 0<doc->cur_col<k &&
-              !(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
-              DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
-              !(doc_e->type&DOCG_BL_IV_UL)) {
-          added_cursor=DocSplitTag(doc,doc_e,doc->cur_col,x,y,DOCT_CURSOR);
-          k=StrLen(doc_e->tag);
-        } else {
-          added_cursor=doc_e2=DocEntryNewBase(doc,
-                DOCT_CURSOR|doc_e->type&0xFFFFFF00,
-                doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc->page_line_num);
-          MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
-          if (doc_e->type_u8==DOCT_TEXT && doc->cur_col>=k)
-            QueIns(doc_e2,doc_e);
-          else
-            QueInsRev(doc_e2,doc_e);
-        }
-      }
-    }
-
-    if (doc_e->de_flags & DOCEF_REFRESH_DATA &&
-          (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX ||
-          doc_e->de_flags & DOCEF_LST)) {
-      DocDataFmt(doc,doc_e);
-      k=StrLen(doc_e->tag);
-    }
-    if (doc_e->de_flags&DOCEF_TAG) {
-      ptr=doc_e->tag;
-      if (doc_e->de_flags & DOCEF_TREE) {
-        if (k>=2) {
-          if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED)
-            *ptr++='+';
-          else
-            *ptr++='-';
-          *ptr++=']';
-          ptr=doc_e->tag;
-        }
-      } else if (doc_e->de_flags & DOCEF_HAS_BIN) {
-        if (*ptr=='<' && full_refresh && '0'<=ptr[1]<='9') {
-          ptr=MStrPrint("<%d>",doc_e->bin_num);
-          Free(doc_e->tag);
-          doc_e->tag=StrNew(ptr,mem_task);
-          Free(ptr);
-          ptr=doc_e->tag;
-          k=StrLen(ptr);
-        }
-      } else if (doc_e->type_u8==DOCT_CHECK_BOX) {
-        if (k>=3) {
-          *ptr++='[';
-          if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED)
-            *ptr++='X';
-          else
-            *ptr++=CH_SPACE;
-          *ptr++=']';
-          ptr=doc_e->tag;
-        }
-      }
-      if (doc_e->de_flags & DOCEF_SCROLLING_X) {
-        j=StrLen(doc_e->tag);
-        if (j && doc_e->scroll_len) {
-          i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH);
-          tmp_u32_attr=tmp_u32_attr & 0xFFE0FF00|
-                (FONT_WIDTH-1-i_jif&(FONT_WIDTH-1))<<16;
-#assert FONT_WIDTH==8
-          i_jif>>=3;
-          for (k=0;k<doc_e->scroll_len;k++) {
-            ch=ptr[(i_jif+k)%j];
-            if (!Bt(char_bmp_displayable,ch)) ch='.';
-            if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                  !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-              if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-                    !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
-                TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
-              else
-                TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
-            }
-            x++;
-          }
-        }
-        if (find_cursor)  {
-          D=DocCharDist(doc,doc_e->x,doc_e->y);
-          col=doc_e->min_col;
-        }
-        col2=doc_e->scroll_len; //TODO This is flawed
-      } else {
-        if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-              !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
-          while (ch=*ptr++) {
-            if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                  !(doc_e->de_flags&DOCEF_DONT_DRAW))
-              TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
-            else
-              if (find_cursor) {
-                d2=DocCharDist(doc,x,y);
-                if (d2<D) {
-                  D=d2;
-                  col=col2;
-                }
-              }
-            col2++;
-            x++;
-          }
-        } else {
-          if (doc_e->type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT)
-            hl=DocHighlight(doc_e,ptr,k,tmp_u32_attr);
-          else
-            hl=NULL;
-          if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-//Technically we should do this for scrolling_x, too.
-            if (y>y_plot_bottom)
-              more=TRUE;
-            else if (y>=y_plot_top) {
-              if (hl)
-                TextLenAttrStr(win_task,x-x0,y-y0,k,hl);
-              else
-                TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr,ptr);
-            }
-            col2+=k;
-            x+=k;
-          } else {
-            if (find_cursor) {
-              while (k--) {
-                d2=DocCharDist(doc,x,y);
-                if (d2<D) {
-                  D=d2;
-                  col=col2;
-                }
-                col2++;
-                x++;
-              }
-            } else {
-              col2+=k;
-              x+=k;
-            }
-          }
-          Free(hl);
-        }
-      }
-    }
-    switch [doc_e->type_u8] {
-      case DOCT_TEXT:
-        if (!col2 && !(doc_e->de_flags
-              &(DOCEF_TREE|DOCEF_LST|DOCEF_TAG_CB|DOCEF_DEFINE|
-              DOCEF_AUX_STR|DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)))
-          del_doc_e=TRUE;
-        break;
-      case DOCT_HEX_ED:
-        if (doc_e->de_flags&DOCEF_DEREF_DATA &&
-              !(doc_e->de_flags&DOCEF_REMALLOC_DATA))
-          bptr=doc_e->data;
-        else
-          bptr=&doc_e->data;
-        k=doc_e->hex_ed_width; //columns
-        for (i=0;i<doc_e->len;i+=k) {
-          if (doc_e->de_flags & DOCEF_ZERO_BASED)
-            StrPrint(buf,"%08tX ",i);
-          else
-            StrPrint(buf,"%08tX ",bptr);
-          ptr=buf;
-          while (ch=*ptr++) {
-            if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                  !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-              if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-                    !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
-                TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
-              else
-                TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
-            }
-            if (find_cursor) {
-              d2=DocCharDist(doc,x,y);
-              if (d2<D) {
-                D=d2;
-                col=i*3;
-              }
-            }
-            x++;
-          }
-          if (i+k>doc_e->len) k=doc_e->len-i;
-          for (j=0;j<k;j++) {
-            StrPrint(buf,"%02tX",*bptr++);
-            ptr=buf;
-            while (ch=*ptr++) {
-              if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                    !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-                if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-                      !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
-                  TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
-                else
-                  TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
-              }
-              if (find_cursor) {
-                d2=DocCharDist(doc,x,y);
-                if (d2<D) {
-                  D=d2;
-                  col=col2;
-                }
-              }
-              col2++;
-              x++;
-            }
-            x++;
-          }
-          bptr-=j;
-          x+=(doc_e->hex_ed_width-k)*3;
-          for (j=0;j<k;j++) {
-            ch=*bptr++;
-            if (!Bt(char_bmp_displayable,ch)) ch='.';
-            if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                  !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-              if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-                    !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
-                TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
-              else
-                TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
-            }
-            if (find_cursor) {
-              d2=DocCharDist(doc,x,y);
-              if (d2<D) {
-                D=d2;
-                col=col2;
-              }
-            }
-            col2++;
-            x++;
-          }
-          y++;
-          x-=doc_e->hex_ed_width*3+k+9;
-        }
-        break;
-      case DOCT_NEW_LINE:
-      case DOCT_SOFT_NEW_LINE:
-        if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-              !(doc_e->de_flags&DOCEF_DONT_DRAW)&&
-              y_plot_top<=y<=y_plot_bottom)
-          TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8);
-        if (doc_e->de_flags&DOCEF_HIGHLIGHT && s->state==DOCSS_CPP_Z_COMMENT)
-          s->state=DOCSS_NORMAL;
-        y++;
-        doc->page_line_num++;
-rc_start_of_line:
-        if (s->left_margin==DOC_DFT)
-          x=s->indent;
-        else
-          x=s->indent+s->left_margin;
-rc_adjust_xy:
-        i=s->indent+s->left_margin;
-        if (x<i)
-          x=i;
-        if (doc->page_line_num<0)
-          doc->page_line_num=s->page_len+doc->page_line_num%s->page_len;
-        else {
-          if (doc->page_line_num>=s->page_len) {
-            doc->page_line_num-=s->page_len;
-            if (doc->page_line_num>=s->page_len) //avoid extra divide
-              doc->page_line_num=doc->page_line_num%s->page_len;
-          }
-        }
-        if (s->header!=DOC_DFT) {
-          if (doc->page_line_num<s->header) {
-            y+=s->header-doc->page_line_num;
-            doc->page_line_num=s->header;
-            goto rc_start_of_line;
-          }
-        }
-        if (s->footer==DOC_DFT) {
-          if (doc->page_line_num>=s->page_len) {
-            if (s->header==DOC_DFT)
-              doc->page_line_num=0;
-            else {
-              doc->page_line_num=s->header;
-              y+=s->header;
-            }
-            goto rc_start_of_line;
-          }
-        } else {
-          if (doc->page_line_num>=s->page_len-s->footer) {
-            y+=s->footer;
-            if (s->header==DOC_DFT)
-              doc->page_line_num=0;
-            else {
-              doc->page_line_num=s->header;
-              y+=s->header;
-            }
-            goto rc_start_of_line;
-          }
-        }
-        break;
-      case DOCT_TAB:
-        k=(x+8) & ~7;
-        if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
-              !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
-          while (x<k) {
-            if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                  !(doc_e->de_flags&DOCEF_DONT_DRAW))
-              TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+CH_SPACE);
-            if (find_cursor) {
-              d2=DocCharDist(doc,x,y);
-              if (d2<D)
-                D=d2;
-            }
-            x++;
-          }
-        } else {
-          k-=x;
-          if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-                !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-            if (y_plot_top<=y<=y_plot_bottom)
-              TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr,"        ");
-            x+=k;
-          } else {
-            if (find_cursor) {
-              while (k--) {
-                d2=DocCharDist(doc,x,y);
-                if (d2<D)
-                  D=d2;
-                x++;
-              }
-            } else
-              x+=k;
-          }
-        }
-        break;
-      case DOCT_PAGE_BREAK:
-        doc->flags|=DOCF_BWD_MOVEMENT;
-        y+=s->page_len-doc_e->page_line_num;
-        doc->page_line_num=0;
-        goto rc_start_of_line;
-      case DOCT_CURSOR:
-        if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) {
-          doc->cur_entry=doc_e->next;
-          doc->cur_col=doc->cur_entry->min_col;
-        }
-        if (doc_e!=added_cursor)
-          del_doc_e=TRUE;
-        break;
-      case DOCT_PMT:
-        cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT;
-        if (y==cursor_y) {
-          doc->cur_entry=doc_e->next;
-          doc->cur_col=doc->cur_entry->min_col;
-        }
-        break;
-      case DOCT_CLEAR:
-        next_clear_found=doc_e;
-        if (doc_e->de_flags&DOCEF_HOLD)
-          clear_holds=TRUE;
-        else
-          clear_holds=FALSE;
-        break;
-      case DOCT_PAGE_LEN:
-        s->page_len=doc_e->attr;
-        if (doc_e->de_flags & DOCEF_WIN_REL)
-          s->page_len+=height;
-        goto rc_adjust_xy;
-      case DOCT_LEFT_MARGIN:
-        i=doc_e->attr;
-        left_margin=left+i;
-        s->left_margin=i;
-        goto rc_start_of_line;
-      case DOCT_RIGHT_MARGIN:
-        if (doc_e->de_flags & DOCEF_WIN_REL)
-          i=width-1-doc_e->attr;
-        else
-          i=doc_e->attr;
-        right_margin=left+i;
-        s->right_margin=i;
-        goto rc_adjust_xy;
-      case DOCT_HEADER:
-        s->header=doc_e->attr;
-        goto rc_adjust_xy;
-      case DOCT_FOOTER:
-        s->footer=doc_e->attr;
-        goto rc_adjust_xy;
-      case DOCT_INDENT:
-        if (doc_e->de_flags & DOCEF_LEFT_X)
-          i=doc_e->attr;
-        else
-          i=s->indent+doc_e->attr;
-        s->indent=i;
-        goto rc_start_of_line;
-      case DOCT_FOREGROUND:
-        cur_u8_attr&=0xF0;
-        if (doc_e->attr==DOC_DFT)
-          cur_u8_attr|=s->dft_text_attr&0x0F;
-        else
-          cur_u8_attr|=doc_e->attr;
-        s->cur_text_attr=cur_u8_attr;
-        break;
-      case DOCT_BACKGROUND:
-        cur_u8_attr&=0x0F;
-        if (doc_e->attr==DOC_DFT)
-          cur_u8_attr|=s->dft_text_attr&0xF0;
-        else
-          cur_u8_attr|=doc_e->attr<<4;
-        s->cur_text_attr=cur_u8_attr;
-        break;
-      case DOCT_DFT_FOREGROUND:
-        cur_u8_attr&=0xF0;
-        if (doc_e->attr==DOC_DFT)
-          cur_u8_attr|=s->dft_text_attr&0xF;
-        else
-          cur_u8_attr|=doc_e->attr;
-        s->dft_text_attr=s->dft_text_attr&0xF0|cur_u8_attr&0x0F;
-        s->cur_text_attr=cur_u8_attr;
-        break;
-      case DOCT_DFT_BACKGROUND:
-        cur_u8_attr&=0x0F;
-        if (doc_e->attr==DOC_DFT)
-          cur_u8_attr|=s->dft_text_attr&0xF0;
-        else
-          cur_u8_attr|=doc_e->attr<<4;
-        s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0;
-        s->cur_text_attr=cur_u8_attr;
-        break;
-      case DOCT_WORD_WRAP:
-        if (doc_e->attr)
-          doc->flags|=DOCF_WORD_WRAP;
-        else
-          doc->flags&=~DOCF_WORD_WRAP;
-        break;
-      case DOCT_HIGHLIGHT:
-        if (doc_e->attr)
-          doc->flags|=DOCF_HIGHLIGHT;
-        else
-          doc->flags&=~DOCF_HIGHLIGHT;
-        break;
-      case DOCT_BLINK:
-        if (doc_e->attr)
-          doc->flags|=DOCF_BLINK;
-        else
-          doc->flags&=~DOCF_BLINK;
-        break;
-      case DOCT_INVERT:
-        if (doc_e->attr)
-          doc->flags|=DOCF_INVERT;
-        else
-          doc->flags&=~DOCF_INVERT;
-        break;
-      case DOCT_UNDERLINE:
-        if (doc_e->attr)
-          doc->flags|=DOCF_UNDERLINE;
-        else
-          doc->flags&=~DOCF_UNDERLINE;
-        break;
-      case DOCT_SHIFTED_X:
-        s->shifted_x=doc_e->attr;
-        break;
-      case DOCT_SHIFTED_Y:
-        s->shifted_y=doc_e->attr;
-        break;
-      case DOCT_CURSOR_MOVEMENT:
-        doc->flags|=DOCF_BWD_MOVEMENT;
-        x+=doc_e->cursor_x_offset;
-        if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
-          i=doc->page_line_num;
-          if (doc_e->de_flags & DOCEF_TOP_Y)
-            doc->page_line_num=0;
-          else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
-            doc->page_line_num=s->page_len-1;
-          else if (doc_e->de_flags & DOCEF_CENTER_Y)
-            doc->page_line_num=s->page_len>>1;
-          y+=doc->page_line_num-i;
-        }
-        y+=doc_e->cursor_y_offset;
-        doc->page_line_num+=doc_e->cursor_y_offset;
-        goto rc_adjust_xy;
-      case DOCT_SPRITE:
-        if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN)
-          doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num);
-        if ((tmpb=doc_e->bin_data) &&
-              !tmpb->tag && doc_e->tag && *doc_e->tag)
-          tmpb->tag=StrNew(doc_e->tag,mem_task);
-        if (tmpb && dc) {
-          DCRst(dc);
-          dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST);
-          if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCRN ||
-                doc_e->de_flags&DOCEF_DONT_DRAW)
-            dc->flags|=DCF_DONT_DRAW;
-          bptr=tmpb->data;
-          ii=SpriteTypeMask(bptr);
-          if (ii&1<<SPT_TYPES_NUM) {
-            bptr=gr.empty_sprite;
-            ii=SpriteTypeMask(bptr);
-          }
-          if (ii&(1<<SPT_FLOOD_FILL|1<<SPT_FLOOD_FILL_NOT))
-            i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
-          else {
-            i=tmp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
-            if (tmp_u32_attr & DOCET_SEL)
-              i^=0xF;
-            if (tmp_u32_attr & DOCET_INVERT)
-              i^=0xF;
-            if (blink_flag &&
-                  (doc_e==doc->cur_entry || tmp_u32_attr&DOCET_BLINK))
-              i^=0xF;
-          }
-          dc->color=i;
-          if (find_cursor)
-            dc->flags|=DCF_LOCATE_NEAREST;
-          dc->cur_x=(doc->x-x0)*FONT_WIDTH+pix_left+scroll_x;
-          dc->cur_y=(doc->y-y0)*FONT_HEIGHT+pix_top+scroll_y;
-          dc->cur_z=0;
-          dc->bkcolor=i;
-          if (doc_e->de_flags & DOCEF_FROM_START) {
-            xx=(x-k-x0)*FONT_WIDTH; //TODO: scrolling text is not length k
-            yy=(y-y0)*FONT_HEIGHT;
-            zz=0;
-          } else {
-            xx=(x-x0)*FONT_WIDTH;
-            yy=(y-y0)*FONT_HEIGHT;
-            zz=0;
-          }
-          if (ii&(1<<SPT_MESH|1<<SPT_SHIFTABLE_MESH)) {
-            if (!depth_buf) {
-              DCDepthBufAlloc(dc);
-              depth_buf=dc->depth_buf;
-            } else
-              dc->depth_buf=depth_buf;
-            Mat4x4IdentEqu(dc->r);
-            Mat4x4RotZ(dc->r,cur_time*3.1);
-            Mat4x4RotY(dc->r,cur_time*1.9);
-            Mat4x4RotX(dc->r,cur_time);
-            dc->flags|=DCF_TRANSFORMATION;
-            dc->x=xx;
-            dc->y=yy;
-            dc->z=GR_Z_ALL;
-            xx=0; yy=0; zz=0;
-          }
-          Sprite3(dc,xx,yy,zz,bptr);
-          dc->depth_buf=NULL;
-          dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
-          if (dc->nearest_dist<=D) {
-            D=dc->nearest_dist;
-            col=doc_e->min_col;
-          }
-        }
-        break;
-      case DOCT_SONG:
-        if (sys_focus_task==win_task &&
-              recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-              !(doc_e->de_flags&DOCEF_DONT_DRAW)) {
-          if (doc_e->aux_str &&
-                (!music.cur_song || StrCmp(music.cur_song,doc_e->aux_str))) {
-            Free(music.cur_song);
-            MusicSettingsRst;
-            music.cur_song=AStrNew(doc_e->aux_str);
-          }
-        }
-        doc->flags|=DOCF_HAS_SONG;
-        break;
-      case DOCT_HTML_CODE:
-        if (recalc_flags&RECALCF_TO_HTML &&
-              doc_e->de_flags&DOCEF_TAG && doc_e->tag)
-          x-=StrLen(doc_e->tag);
-        break;
-      case DOCT_TYPES_NUM-1: //nobound switch
-      default:
-        break;
-    }
-
-    if (doc_e->de_flags & DOCEF_HAS_BORDER)
-      TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0,
-            tmp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER));
-    if (full_refresh) {
-      switch (doc_e->type_u8) {
-        case DOCT_CHECK_BOX:
-          doc_e->max_col=2;
-          break;
-        case DOCT_LST:
-        case DOCT_TREE:
-        case DOCT_BTTN:
-        case DOCT_LINK:
-        case DOCT_MENU_VAL:
-        case DOCT_MACRO:
-          doc_e->max_col=1;
-          break;
-        default:
-          if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST))
-            doc_e->max_col=1;
-          else
-            doc_e->max_col=col2;
-      }
-
-      if (x>doc->max_x) doc->max_x=x;
-      if (y>doc->max_y) doc->max_y=y;
-      if (D<=best_d && !(doc_e->de_flags&DOCEF_NO_CLICK_ON)) {
-        best_d=D;
-        best_doc_e=doc_e;
-        best_col=col;
-      }
-      if (doc_e->de_flags & DOCEF_TREE) {
-        if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED)
-          tree_collapsed=TRUE;
-        else
-          tree_collapsed=FALSE;
-        doc_e2=doc_e->next;
-        while (doc_e2!=doc && doc_e2->type_u8!=DOCT_INDENT &&
-              !(doc_e2->de_flags & DOCEF_TREE))
-          doc_e2=doc_e2->next;
-        if (doc_e2->type_u8==DOCT_INDENT) {
-          j=i=s->indent;
-          do {
-            if (tree_collapsed)
-              doc_e2->de_flags|=DOCEF_SKIP;
-            else
-              doc_e2->de_flags&=~DOCEF_SKIP;
-            if (doc_e2->type_u8==DOCT_INDENT) {
-              if (doc_e2->de_flags & DOCEF_LEFT_X)
-                j=doc_e2->attr;
-              else
-                j+=doc_e2->attr;
-            }
-            doc_e2=doc_e2->next;
-          } while (doc_e2!=doc && j>i);
-        }
-      }
-    }
-
-    doc_e2=doc_e->next;
-rc_skip:
-    while (doc_e2!=doc && doc_e2->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
-      if (doc_e2==doc->cur_entry) {
-        doc->cur_entry=doc_e2->next;
-        doc->cur_col=doc->cur_entry->min_col;
-      }
-      if (full_refresh) {
-        doc_e2->x=x;
-        doc_e2->y=y;
-        doc_e2->page_line_num=doc->page_line_num;
-        MemCpy(&doc_e2->settings,s,sizeof(CDocSettings));
-        doc_e2->type.u8[1]=cur_u8_attr;
-        doc_e2->de_flags=doc->flags
-              &(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) |
-              doc_e2->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
-      }
-      doc_e2=doc_e2->next;
-    }
-
-    if (full_refresh) {
-      if (del_doc_e) {
-        if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) {
-          if (doc_e==doc->cur_entry) {
-            doc->cur_entry=doc_e2;
-            doc->cur_col=doc_e2->min_col;
-          }
-          if (best_doc_e==doc_e) {
-            best_doc_e=doc_e2;
-            best_col=doc_e2->min_col;  //TODO: might be bug
-          }
-          DocEntryDel(doc,doc_e);
-        }
-      }
-    }
-    num_entries++;
-    if (!full_refresh && doc_e->y>y_plot_bottom)
-      break;
-    doc_e=doc_e2;
-  }
-
-  if (full_refresh) {
-    if (doc->cur_entry==doc && recalc_flags&RECALCF_ADD_CURSOR) {
-      doc_e2=DocEntryNewBase(doc,DOCT_CURSOR,,x,y,doc->page_line_num);
-      MemCpy(&doc_e2->settings,s,sizeof(CDocSettings));
-      QueInsRev(doc_e2,doc);
-    }
-
-    if (doc->min_x>doc->max_x) {
-      doc->max_x=0;
-      doc->min_x=0;
-    }
-    if (doc->min_y>doc->max_y) {
-      doc->max_y=0;
-      doc->min_y=0;
-    }
-
-    //Update header
-    if (!skipped_update) {
-      doc_e->x=x;
-      doc_e->y=y;
-      doc_e->page_line_num=doc->page_line_num;
-      MemCpy(&doc_e->settings,s,sizeof(CDocSettings));
-      doc_e->type.u8[1]=cur_u8_attr;
-      if (find_cursor) {
-        D=DocCharDist(doc,x,y);
-        if (D<best_d && !(doc_e->de_flags&DOCEF_NO_CLICK_ON)) {
-          best_d=D;
-          best_doc_e=doc_e;
-          best_col=0;
-        }
-      }
-    }
-    if (doc->flags & DOCF_SIZE_MIN) {
-      if (Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
-        if (left<0)
-          left=0;
-        i=left+doc->max_x-doc->min_x;
-        if (i>TEXT_COLS-1)
-          i=TEXT_COLS-1;
-        WinHorz(left,i,win_task);
-        if (top<0)
-          top=0;
-        i=top+doc->max_y-doc->min_y;
-        if (i>TEXT_ROWS-1)
-          i=TEXT_ROWS-1;
-        WinVert(top,i,win_task);
-      } else {
-        if (left<1)
-          left=1;
-        i=left+doc->max_x-doc->min_x;
-        if (i>TEXT_COLS-2)
-          i=TEXT_COLS-2;
-        WinHorz(left,i,win_task);
-        if (top<1)
-          top=1;
-        i=top+doc->max_y-doc->min_y;
-        if (i>TEXT_ROWS-2)
-          i=TEXT_ROWS-2;
-        WinVert(top,i,win_task);
-      }
-    }
-    if (find_cursor) {
-      doc->cur_entry=best_doc_e;
-      doc->cur_col=best_col;
-      DocFormBwd(doc);
-//We need this because text coordinates are used
-      if (best_d<FONT_WIDTH)
-        best_d=0;
-      doc->best_d=best_d;
-    }
-
-    if (doc->cur_entry->type_u8!=DOCT_HEX_ED) {
-      doc->y=doc->cur_entry->y;
-      doc->x=doc->cur_entry->x+doc->cur_col;
-    } else {
-      doc->y=doc->cur_entry->y+doc->cur_col/3/doc->cur_entry->hex_ed_width;
-      x=doc->cur_col%(doc->cur_entry->hex_ed_width*3);
-      i=x/doc->cur_entry->hex_ed_width;
-      doc->x=doc->cur_entry->x+9;
-      if (i<2)
-        doc->x+=x>>1*3+x&1;
-      else
-        doc->x+=doc->cur_entry->hex_ed_width*3+
-              (x-doc->cur_entry->hex_ed_width<<1);
-    }
-    doc->line=doc->y+1;
-    doc->col=doc->x+1;
-
-    if (recalc_flags&RECALCF_HAS_CURSOR) {
-      if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
-        x=0;
-        y=0;
-      } else {
-        x=scroll_x/FONT_WIDTH;
-        y=scroll_y/FONT_HEIGHT;
-      }
-      if (doc->top_line_num-y+height-1>doc->max_y)
-        doc->top_line_num=doc->max_y-(height-1)+y;
-      if (doc->top_line_num-y<doc->min_y)
-        doc->top_line_num=doc->min_y+y;
-
-      if (doc->y-doc->top_line_num+y>height-1)
-        doc->top_line_num=doc->y-(height-1)+y;
-      if (doc->y-doc->top_line_num+y<0)
-        doc->top_line_num=doc->y+y;
-
-      if (doc->line_start_col-x+width-1>doc->max_x)
-        doc->line_start_col=doc->max_x-(width-1)+x;
-      if (doc->line_start_col-x<doc->min_x)
-        doc->line_start_col=doc->min_x+x;
-
-      if (doc->x-doc->line_start_col+x>width-1)
-        doc->line_start_col=doc->x-(width-1)+x;
-      if (doc->x-doc->line_start_col+x<0)
-        doc->line_start_col=doc->x+x;
-    }
-  }
-  if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
-        recalc_flags&RECALCF_HAS_CURSOR) {
-    x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH;
-    y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT;
-    if (0<=x<=right && 0<=y<=bottom &&
-          x<TEXT_COLS && y<TEXT_ROWS &&
-          !(doc->flags&DOCF_HIDE_CURSOR)) {
-      u32_ptr=gr.text_base+y*TEXT_COLS+x;
-      *u32_ptr|=DOCET_BLINK;
-      *u32_ptr^=0xFF00;
-    }
-    if (full_refresh) {
-      if (!(doc->flags&DOCF_NO_SCROLL_BARS)) {
-        if (!Bt(&hss->flags,WSSf_SET_TO_POS)) {
-          hss->min=doc->min_x;
-          if (doc->max_x-width+1<hss->min)
-            hss->max=hss->min;
-          else
-            hss->max=doc->max_x-width+1;
-          hss->pos=doc->line_start_col;
-        }
-        if (!Bt(&vss->flags,WSSf_SET_TO_POS)) {
-          vss->min=doc->min_y;
-          if (doc->max_y-height+1<vss->min)
-            vss->max=vss->min;
-          else
-            vss->max=doc->max_y-height+1;
-          vss->pos=doc->top_line_num;
-        }
-      }
-      LBEqu(&doc->flags,DOCf_MORE,more);
-    }
-  }
-  if (!same_win) {
-    doc->old_win_top=top;
-    doc->old_win_bottom=bottom;
-    doc->old_win_left=left;
-    doc->old_win_right=right;
-    doc->old_cur_entry=doc->cur_entry;
-    doc->old_cur_col=doc->old_cur_col;
-  }
-  if (doc->flags & DOCF_HAS_SONG)
-    LBts(&win_task->task_flags,TASKf_HAS_SONG);
-  if (full_refresh) {
-    i=num_entries-doc->max_entries;
-    if (next_clear_found) {
-      DocDelToEntry(doc,next_clear_found,clear_holds);
-      DocRecalc(doc,recalc_flags);
-    } else if (i>1024) {
-      DocDelToNum(doc,i);
-      DocRecalc(doc,recalc_flags);
-    }
-  }
-  DCDel(dc);
-  Free(depth_buf);
-  if (unlock)
-    DocUnlock(doc);
-  return TRUE;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocRecalcLib.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocRecalcLib.HC.HTML deleted file mode 100755 index 8531126..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocRecalcLib.HC.HTML +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-I64 DocCharDist(CDoc *doc,I64 x,I64 y)
-{
-#assert FONT_WIDTH==FONT_HEIGHT
-  return (SqrI64(doc->x-x)+SqrI64(doc->y-y))*FONT_WIDTH*FONT_WIDTH;
-}
-
-U0 DocDelToNum(CDoc *doc,I64 num)
-{
-  CDocEntry *doc_e=doc->head.next,*doc_e2;
-  while (num-->0 && doc_e!=doc) {
-    doc_e2=doc_e->next;
-    if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) {
-      if (doc_e==doc->cur_entry) {
-        doc->cur_entry=doc_e2;
-        doc->cur_col=doc_e2->min_col;
-      }
-      DocEntryDel(doc,doc_e);
-    }
-    doc_e=doc_e2;
-  }
-}
-
-U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds)
-{
-  CDocEntry *doc_e=doc->head.next,*doc_e2;
-  while (doc_e!=doc) {
-    doc_e2=doc_e->next;
-    if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) {
-      if (doc_e==doc->cur_entry) {
-        doc->cur_entry=doc_e2;
-        doc->cur_col=doc_e2->min_col;
-      }
-      DocEntryDel(doc,doc_e);
-    }
-    if (doc_e==clear_entry)
-      break;
-    doc_e=doc_e2;
-  }
-}
-
-U0 DocBorderLstDraw(CDoc *doc)
-{
-  CTask *win_task=doc->win_task;
-  I64 i,y=-1,attr=win_task->border_attr<<8;
-  U64 ch;
-  CDoc *tmpl=doc;
-  CD3I64 saved_scroll;
-  while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
-    y+=(Bsr(tmpl->desc)+7)>>3+1; //StrLen+1
-    tmpl=tmpl->parent_doc;
-  }
-  tmpl=doc;
-  if (y>win_task->win_height)
-    y=win_task->win_height;
-  WinScrollNull(win_task,&saved_scroll);
-  while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
-    ch=tmpl->desc;
-    i=(Bsr(ch)+7)>>3;   //StrLen
-    ch=EndianI64(ch<<((8-i)<<3));
-    attr=win_task->border_attr<<8;
-    while (i-- && y>0) {
-      TextChar(win_task,TRUE,-1,--y,attr+ch&0xFF);
-      ch>>=8;
-    }
-    y--;
-    tmpl=tmpl->parent_doc;
-  }
-  WinScrollRestore(win_task,&saved_scroll);
-}
-
-public U0 DocTop(CDoc *doc=NULL)
-{//Move cursor, cur_entry, to top.
-  Bool unlock;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  doc->cur_entry=doc->head.next;
-  doc->cur_col=doc->cur_entry->min_col;
-  doc->x=0;
-  doc->y=0;
-  doc->line_start_col=0;
-  doc->top_line_num=0;
-
-  DocFormFwd(doc);
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL)
-{//Center win on doc cursor, cur_entry.
-  Bool unlock;
-  CTask *task;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  task=doc->win_task;
-  DocRecalc(doc,recalc_flags);
-  if (!(doc->flags&DOCF_BORDER_DOC))
-    doc->top_line_num=doc->y-(task->win_height+1)>>1;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocBottom(CDoc *doc=NULL)
-{//Move cursor, cur_entry, to bottom.
-  Bool unlock;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  doc->cur_entry=doc;
-  doc->cur_col=0;
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE)
-{//Clear all doc entries, except +H, hold entries.
-  Bool unlock;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  DocBottom(doc);
-  if (clear_holds)
-    DocPrint(doc,"$CL+H$");
-  else
-    DocPrint(doc,"$CL$");
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-public Bool DocCursor(Bool show=OFF,CDoc *doc=NULL)
-{//Show or hide cursor.
-  if (!doc && !(doc=DocPut))
-    return FALSE;
-  return !LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!show);
-}
-
-public Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL)
-{//Highlight or Don't highlight cursor.
-  if (!doc && !(doc=DocPut))
-    return FALSE;
-  return !LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!show);
-}
-
-public Bool DocScroll(Bool val=OFF,CDoc *doc=NULL)
-{//Turn scroll bars OFF/ON.
-  if (!doc && !(doc=DocPut))
-    return FALSE;
-  return !LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!val);
-}
-
-public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
-{//Collapse or uncollapse all tree widgets.
-  CDocEntry *doc_e;
-  Bool unlock;
-  if (!doc && !(doc=DocPut))
-    return;
-  unlock=DocLock(doc);
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->de_flags&DOCEF_TREE)
-      BEqu(&doc_e->de_flags,DOCEf_CHECKED_COLLAPSED,collapse);
-    doc_e=doc_e->next;
-  }
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-}
-
-#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)"
-public I64 DocMax(I64 i=I64_MAX)
-{//Set max document entries. (Cmd line buffer size.)
-//Adjusts the size of the cmd line buf.
-  //Normally, the cmd line deletes entries
-  //when more are added and the old scroll up.
-  //See max_entries.
-  I64 res;
-  CDoc *doc;
-  if (doc=DocPut) {
-    res=doc->max_entries;
-    doc->max_entries=i;
-    return res;
-  } else
-    return 0;
-}
-
-#help_index "DolDoc/Task;StdOut/Task"
-U0 DocUpdateTaskDocs(CTask *task)
-{//This is called from GrUpdateTaskWin() by the winmgr at 30fps.
-  CDoc *doc;
-  CD3I64 saved_scroll;
-  if (task->border_src==BDS_CUR_DRV && task->cur_dv)
-    task->border_attr=DrvTextAttrGet(Drv2Let(task->cur_dv));
-  if (task->title_src==TTS_TASK_NAME)
-    StrCpy(task->task_title,task->task_name);
-  if ((doc=DocDisplay(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
-    if (task->border_src==BDS_ED_FILENAME_DRV)
-      task->border_attr=DrvTextAttrGet(*doc->filename.name);
-    if (task->title_src==TTS_ED_FILENAME)
-      MemCpy(task->task_title,doc->filename.name,STR_LEN-1);
-    DocRecalc(doc,RECALCt_TO_SCRN|RECALCF_HAS_CURSOR);
-  }
-  if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
-    WinScrollNull(task,&saved_scroll);
-    DocRecalc(doc,RECALCt_TO_SCRN);
-    WinScrollRestore(task,&saved_scroll);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocRun.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocRun.HC.HTML deleted file mode 100755 index 54fffcc..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocRun.HC.HTML +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc"
-
-public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
-        Bool exited,I64 *_has_action=NULL)
-{//Do action on final entry sel by user.
-//Sometimes returns locked, sometimes unlocked
-  U8 ch=doc->cmd_U8,*st;
-  I64 res=DOCM_CANCEL,has_action=FALSE;
-  CHashDefineStr *tmph;
-  DocLock(doc);
-  if (!exited) {
-    if (doc_e->de_flags & DOCEF_ESC) {
-      Msg(MSG_KEY_DOWN,CH_ESC,0,1<<JOBf_DONT_FILTER);
-      has_action=TRUE;
-      goto er_done;
-    } if (doc_e->de_flags & DOCEF_QUIT) {
-      Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0,1<<JOBf_DONT_FILTER);
-      has_action=TRUE;
-      goto er_done;
-    } else if (doc_e->de_flags & DOCEF_CHECK_COLLAPSABLE) {
-      doc_e->de_flags^=DOCEF_CHECKED_COLLAPSED;
-      has_action=TRUE;
-    }
-  }
-  try {
-    if (ch==CH_SPACE) {
-      if (doc_e->de_flags & DOCEF_LINK && doc->left_click_link) {
-        res=(*doc->left_click_link)(doc,doc_e);
-        has_action=TRUE;
-      }
-      if (doc_e->de_flags & DOCEF_LEFT_EXP) {
-        res=doc_e->left_exp;
-        has_action=TRUE;
-        Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
-      }
-      if (doc_e->de_flags & DOCEF_LEFT_CB && doc_e->left_cb) {
-        DocUnlock(doc);
-        res=(*doc_e->left_cb)(doc,doc_e);
-        has_action=TRUE;
-        Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
-      }
-      if (doc_e->de_flags & DOCEF_LEFT_MACRO) {
-        if (doc_e->de_flags & DOCEF_POPUP) {
-          st=StrNew(doc_e->left_macro);
-          DocUnlock(doc);
-          PopUp(st,Fs);
-          Free(st);
-        } else {
-          if (doc_e->de_flags & DOCEF_LEFT_IN_STR)
-            InStr("%s",doc_e->left_macro);
-          else
-            In("%s",doc_e->left_macro);
-        }
-        has_action=TRUE;
-      }
-      if (!exited && doc_e->de_flags & DOCEF_LST &&
-            doc_e->de_flags & DOCEF_DEFINE &&
-            (tmph=HashFind(doc_e->define_str,
-            doc->win_task->hash_table,HTT_DEFINE_STR)) &&
-            (res=PopUpPickLst(tmph->data))!=DOCM_CANCEL) {
-        DocDataFmt(doc,doc_e,res);
-        DocDataScan(doc,doc_e);
-        has_action=TRUE;
-      }
-    } else if (ch=='\n') {
-      if (doc_e->de_flags & DOCEF_LINK && doc->right_click_link) {
-        res=(*doc->right_click_link)(doc,doc_e);
-        has_action=TRUE;
-      }
-      if (doc_e->de_flags & DOCEF_RIGHT_EXP) {
-        res=doc_e->right_exp;
-        has_action=TRUE;
-        Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
-      }
-      if (doc_e->de_flags & DOCEF_RIGHT_CB && doc_e->right_cb) {
-        DocUnlock(doc);
-        res=(*doc_e->right_cb)(doc,doc_e);
-        has_action=TRUE;
-        Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
-      }
-      if (doc_e->de_flags & DOCEF_RIGHT_MACRO) {
-        if (doc_e->de_flags & DOCEF_POPUP) {
-          st=StrNew(doc_e->right_macro);
-          DocUnlock(doc);
-          PopUp(st,Fs);
-          Free(st);
-        } else {
-          if (doc_e->de_flags & DOCEF_RIGHT_IN_STR)
-            InStr("%s",doc_e->right_macro);
-          else
-            In("%s",doc_e->right_macro);
-        }
-        has_action=TRUE;
-      }
-    }
-  }
-  catch
-    DocBottom(doc);
-  doc->cmd_U8=CH_SPACE;
-er_done:
-  if (_has_action) *_has_action=has_action;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocTerm.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocTerm.HC.HTML deleted file mode 100755 index 9084bc5..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocTerm.HC.HTML +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Task;StdOut/Task"
-public CDoc *DocBorderNew(CDoc *pdoc)
-{//Make new std border doc.
-  CDocEntry *doc_e;
-  CDoc *bdoc;
-
-  bdoc=DocNew;
-  bdoc->flags|=DOCF_BORDER_DOC;
-  if (pdoc) {
-    DocPrint(bdoc,"$CM+H+BY+RX+NC,-7,1$");
-    doc_e=DocPrint(bdoc,"$TX+H+BD+TC,\" \"$");
-    doc_e->user_data=pdoc;
-    doc_e->tag_cb=&EdFilterCB;
-    doc_e=DocPrint(bdoc,"$TX+H+BD+TC,\" \"$");
-    doc_e->user_data=pdoc;
-    doc_e->tag_cb=&EdOverStrikeCB;
-    doc_e=DocPrint(bdoc,"$TX+H+BD+TC,\" \"$");
-    doc_e->user_data=pdoc;
-    doc_e->tag_cb=&EdDollarCB;
-    DocPrint(bdoc,"$CM+H+BY+RX+NC,-18,1$");
-    doc_e=DocPrint(bdoc,"$TX+BD+TC,\"     \"$");
-    doc_e->user_data=pdoc;
-    doc_e->tag_cb=&EdMoreCB;
-    doc_e=DocPrint(bdoc,"$TX+H+BD+TC,\" \"$");
-    doc_e->user_data=pdoc;
-    doc_e->tag_cb=&EdDollarTypeCB;
-  }
-  DocPrint(bdoc,"$CM+H+TY+NC,0,-1$");
-  doc_e=DocPrint(bdoc,"$DA+H-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1,"
-        "A=\"%%s...\",SCX=15$");
-  doc_e->data=&Fs->task_title;
-  DocDataFmt(bdoc,doc_e);
-  DocPrint(bdoc,"$CM+H+NC,1,0$$TX+H+BD+IV,\"%X\"$",Fs);
-  DocPrint(bdoc,"$TX+H+RX+BD,\"[X]\"$");
-  DocPrint(bdoc,"$BK,1$$TX+H+LX+BD,\"MENU\"$$BK,0$");
-  return bdoc;
-}
-
-public U0 DocTermNew()
-{//Make into term win task with Put/Display/Border docs.
-  CDoc *pdoc=DocNew;
-  pdoc->right_click_link=&TermRightClickLink;
-  pdoc->max_entries=4096;
-  Fs->border_src=BDS_CUR_DRV;
-  pdoc->desc='Term';
-  Fs->put_doc=Fs->display_doc=pdoc;
-  Fs->border_doc=DocBorderNew(pdoc);
-  Fs->cur_menu=MenuFile("::/Doc/EdPullDown.DD");
-  WinScrollsInit(Fs);
-  Raw(OFF);
-}
-
-#help_index "DolDoc"
-
-#define RIGHT_INCLUDE   0
-#define RIGHT_AINCLUDE  1
-#define RIGHT_COPY      2
-#define RIGHT_MOVE      3
-#define RIGHT_DELETE    4
-#define RIGHT_TYPE      5
-#define RIGHT_ED        6
-#define RIGHT_MOUNT     7
-#define RIGHT_PLAIN     8
-#define RIGHT_INFILE    9
-
-I64 PopUpTermRight(U8 *header)
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  if (header) DocPrint(doc,"%s",header);
-  DocPrint(doc,"\n\n"
-        "TXT=%s\nDD =%s\nJIT=%s\nGR =%s"
-        "$CM+LX,1,3 $$BT,\"Include           JIT\",LE=RIGHT_INCLUDE$"
-        "$CM+LX,25,0$$BT,\"Adam Include      JIT\",LE=RIGHT_AINCLUDE$"
-        "$CM+LX,1,3 $$BT,\"Copy                 \",LE=RIGHT_COPY$"
-        "$CM+LX,25,0$$BT,\"Move or Rename       \",LE=RIGHT_MOVE$"
-        "$CM+LX,1,3 $$BT,\"Delete               \",LE=RIGHT_DELETE$"
-        "$CM+LX,25,0$$BT,\"Type           TXT;GR\",LE=RIGHT_TYPE$"
-        "$CM+LX,1,3 $$BT,\"DolDoc Edit        DD\",LE=RIGHT_ED$"
-        "$CM+LX,25,0$$BT,\"Mount           ISO.C\",LE=RIGHT_MOUNT$"
-        "$CM+LX,1,3 $$BT,\"Plain Text Edit   TXT\",LE=RIGHT_PLAIN$"
-        "$CM+LX,25,0$$BT,\"Infile             IN\",LE=RIGHT_INFILE$"
-        "$CM+LX,1,3 $$BT,\"Cancel               \",LE=DOCM_CANCEL$\n",
-        FILEMASK_TXT,FILEMASK_DD,FILEMASK_JIT,FILEMASK_GR);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e)
-{//Called with doc locked, exit unlocked
-  Bool res;
-  U8 *st;
-  if (st=DocEntryLink(doc,doc_e)) {
-    DocUnlock(doc);
-    if (doc_e->de_flags & DOCEF_POPUP)
-      res=PopUpEd(st);
-    else
-      res=Ed(st);
-    Free(st);
-    return res;
-  }
-}
-
-I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
-{//Called with doc locked, exit unlocked
-  Bool send_new_line=FALSE,res=FALSE;
-  U8 *st,*st2;
-  I64 i;
-  CEdFileName fn;
-  if (st2=DocEntryLink(doc,doc_e)) {
-    if (st=DocLinkFile(st2)) {
-      DocUnlock(doc);
-      if ((i=PopUpTermRight(st))>=0) {
-        DocBottom(doc);
-        switch (i) {
-          case RIGHT_INCLUDE:
-            if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) {
-              if (!PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) {
-                send_new_line=TRUE;
-                break;
-              }
-            }
-            "#include \"%s\";\n$PT$$FG$$BG$",st;
-            WinZBufUpdate;
-            ExeFile(st,CCF_CMD_LINE);
-            res=TRUE;
-            break;
-          case RIGHT_AINCLUDE:
-            if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) {
-              if (!PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) {
-                send_new_line=TRUE;
-                break;
-              }
-            }
-            "Adam(\"#include \\\"%s\\\"\" );\n$PT$$FG$$BG$",st;
-            WinZBufUpdate;
-            AdamFile(st,FALSE);
-            res=TRUE;
-            break;
-          case RIGHT_COPY:
-            StrCpy(fn.name,st);
-            if (DocForm(&fn)) {
-              res=ToBool(Copy(st,fn.name));
-            } else
-              send_new_line=TRUE;
-            break;
-          case RIGHT_MOVE:
-            StrCpy(fn.name,st);
-            if (DocForm(&fn))
-              res=Move(st,fn.name);
-            else
-              send_new_line=TRUE;
-            break;
-          case RIGHT_DELETE:
-            res=ToBool(Del(st));
-            break;
-          case RIGHT_TYPE:
-            res=Type(st);
-            break;
-          case RIGHT_ED:
-            if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_DD)) {
-              if (!PopUpCancelOk(ST_WARN_ST "Not DolDoc File\n\n")) {
-                send_new_line=TRUE;
-                break;
-              }
-            }
-            "Ed(\"%s\");\n$PT$$FG$$BG$",st;
-            res=Ed(st);
-            break;
-          case RIGHT_MOUNT:
-            if (FileExtDot(st) && !FilesFindMatch(st,"*.ISO.C")) {
-              if (!PopUpCancelOk(ST_WARN_ST "Not .ISO.C File\n\n")) {
-                send_new_line=TRUE;
-                break;
-              }
-            }
-            "MountFile(\"%s\");\n$PT$$FG$$BG$",st;
-            WinZBufUpdate;
-            MountFile(st);
-            res=TRUE;
-            break;
-          case RIGHT_PLAIN:
-            "Plain(\"%s\");\n$PT$$FG$$BG$",st;
-            res=Plain(st);
-            break;
-          case RIGHT_INFILE:
-            if (FileExtDot(st) && !FilesFindMatch(st,"*.IN*")) {
-              if (!PopUpCancelOk(ST_WARN_ST "Not .IN File\n\n")) {
-                send_new_line=TRUE;
-                break;
-              }
-            }
-            "InFile(\"%s\");\n$PT$$FG$$BG$",st;
-            WinZBufUpdate;
-            InFile(st);
-            res=TRUE;
-            break;
-        }
-      } else
-        send_new_line=TRUE;
-      Free(st);
-    } else
-      send_new_line=TRUE;
-    Free(st2);
-  } else
-    send_new_line=TRUE;
-  DocBottom(doc);
-  "$PT$$FG$$BG$";
-  if (send_new_line)
-    '\n';
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocTree.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocTree.HC.HTML deleted file mode 100755 index 513de88..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocTree.HC.HTML +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Tree"
-
-public Bool DocTreeFind(CDoc *haystack_doc,U8 *needle_path,
-  CDocEntry **_tree_entry=NULL,
-  CDocEntry **_start_indent=NULL, CDocEntry **_end_indent=NULL)
-{//Find tree widget start and end.
-  I64 i=0,k=0;
-  U8 *st1=StrNew(needle_path),*st2=MAlloc(StrLen(needle_path)+1);
-  Bool res=FALSE,unlock_doc=DocLock(haystack_doc);
-  CDocEntry *doc_e=haystack_doc->head.next;
-  if (_tree_entry) *_tree_entry=haystack_doc;
-  if (_start_indent) *_start_indent=haystack_doc;
-  if (_end_indent) *_end_indent=haystack_doc;
-  while (*st1 && doc_e!=haystack_doc) {
-    StrFirstRem(st1,"/",st2);
-    if (*st2) {
-      while (doc_e!=haystack_doc) {
-        if (doc_e->type_u8==DOCT_INDENT)
-          i+=doc_e->attr;
-        else if (i==k && doc_e->de_flags&DOCEF_TREE &&
-              !StrCmp(doc_e->tag+3,st2)) {
-          if (*st1)
-            break;
-          else {
-            if (_tree_entry) *_tree_entry=doc_e;
-            i=0;
-            while (doc_e!=haystack_doc && doc_e->type_u8!=DOCT_INDENT)
-              doc_e=doc_e->next;
-            if (doc_e!=haystack_doc) {
-              i=doc_e->attr;
-              if (_start_indent) *_start_indent=doc_e;
-              doc_e=doc_e->next;
-              while (doc_e!=haystack_doc && i>0) {
-                if (doc_e->type_u8==DOCT_INDENT) {
-                  i+=doc_e->attr;
-                  if (i<=0) {
-                    if (_end_indent) *_end_indent=doc_e;
-                    res=TRUE;
-                    break;
-                  }
-                }
-                doc_e=doc_e->next;
-              }
-            }
-            goto ft_done;
-          }
-        }
-        doc_e=doc_e->next;
-      }
-      k+=2;
-    }
-  }
-ft_done:
-  if (unlock_doc)
-    DocUnlock(haystack_doc);
-  Free(st1);
-  Free(st2);
-  return res;
-}
-
-public Bool DocTreeFFind(U8 *name,U8 *path)
-{//Find tree widget in file.
-  CDoc *doc=DocRead(name);
-  Bool res=DocTreeFind(doc,path);
-  DocDel(doc);
-  return res;
-}
-
-public Bool DocTreeMake(CDoc *doc,U8 *path)
-{//Make tree widget.
-  I64 i=0,j=I64_MIN,k=0;
-  U8 *st1=StrNew(path),
-        *st2=MAlloc(StrLen(path)+1),
-        *st3=StrNew(path);
-  Bool res=TRUE,unlock_doc=DocLock(doc);
-  CDocEntry *doc_e=doc->head.next;
-  doc->cur_entry=doc;
-  doc->cur_col=0;
-  while (*st1 && doc_e!=doc) {
-    StrFirstRem(st1,"/",st2);
-    if (*st2) {
-      while (doc_e!=doc) {
-        if (doc_e->type_u8==DOCT_INDENT) {
-          i+=doc_e->attr;
-          if (i==j) {
-            doc->cur_entry=doc_e;
-            doc->cur_col=0;
-            goto mt_done;
-          }
-        } else if (i==k && doc_e->de_flags&DOCEF_TREE &&
-              !StrCmp(doc_e->tag+3,st2)) {
-          Free(st3);
-          st3=StrNew(st1);
-          j=i;
-          if (!*st1)
-            res=FALSE;
-          else
-            break;
-        }
-        doc_e=doc_e->next;
-      }
-      k+=2;
-    }
-  }
-mt_done:
-  if (res) {
-    while (*st3) {
-      StrFirstRem(st3,"/",st2);
-      if (*st2) {
-        DocPrint(doc,"$TR+C,\"%s\"$\n$ID,2$",st2);
-        doc->cur_entry=DocPrint(doc,"$ID,-2$");
-        doc->cur_col=0;
-      }
-    }
-  }
-  if (unlock_doc)
-    DocUnlock(doc);
-  Free(st1);
-  Free(st2);
-  Free(st3);
-  return res;
-}
-
-Bool DocTreeWriteJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
-{//Rewrite doc tree branch.
-  CDocEntry *tree_branch,*start_indent,*end_indent;
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  Bool res,unlock_doc=DocLock(doc);
-  if (res=DocTreeFind(doc,path,
-        &tree_branch,&start_indent,&end_indent)) {
-    DocCut(doc,start_indent->next,end_indent->last);
-    doc->cur_entry=start_indent->next;
-    doc->cur_col=doc->cur_entry->min_col;
-  } else
-    DocTreeMake(doc,path);
-  DocPrint(doc,"%s",buf);
-  if (write && DrvIsWritable(*doc->filename.name))
-    DocWrite(doc);
-  if (unlock_doc)
-    DocUnlock(doc);
-  Free(buf);
-  return res;
-}
-
-Bool DocTreeAppendJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
-{//Append to doc tree branch.
-  CDocEntry *tree_branch,*start_indent,*end_indent;
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  Bool res,unlock_doc=DocLock(doc);
-  if (res=DocTreeFind(doc,path,
-        &tree_branch,&start_indent,&end_indent)) {
-    doc->cur_entry=end_indent;
-    doc->cur_col=doc->cur_entry->min_col;
-  } else
-    DocTreeMake(doc,path);
-  DocPrint(doc,"%s",buf);
-  if (write && DrvIsWritable(*doc->filename.name))
-    DocWrite(doc);
-  if (unlock_doc)
-    DocUnlock(doc);
-  Free(buf);
-  return res;
-}
-
-public Bool DocTreeWrite(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
-{//Rewrite doc tree branch.
-  return DocTreeWriteJoin(doc,path,write,fmt,argc,argv);
-}
-
-public Bool DocTreeAppend(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
-{//Append to doc tree branch.
-  return DocTreeAppendJoin(doc,path,write,fmt,argc,argv);
-}
-
-public Bool DocTreeFWrite(U8 *name,U8 *path,U8 *fmt,...)
-{//Rewrite doc tree branch in file.
-  CDoc *doc=DocRead(name);
-  Bool res=DocTreeWriteJoin(doc,path,TRUE,fmt,argc,argv);
-  DocDel(doc);
-  return res;
-}
-
-public Bool DocTreeFAppend(U8 *name,U8 *path,U8 *fmt,...)
-{//Append to doc tree branch in file.
-  CDoc *doc=DocRead(name);
-  Bool res=DocTreeAppendJoin(doc,path,TRUE,fmt,argc,argv);
-  DocDel(doc);
-  return res;
-}
-
-#help_index "DolDoc/Compiler;Compiler"
-public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
-{//JIT Compile and execute a document.
-  I64 res;
-  Bool okay=TRUE,unlock_doc=DocLock(doc);
-  CCmpCtrl *cc=CmpCtrlNew(,ccf_flags|CCF_DONT_FREE_BUF);
-  if (Fs->last_cc!=&Fs->next_cc)
-    cc->opts=Fs->last_cc->opts;
-  QueIns(cc,Fs->last_cc);
-  LexAttachDoc(cc,,doc);
-  try {
-    Lex(cc);
-    res=ExeCmdLine(cc);
-  } catch {
-    if (Fs->except_ch=='Compiler' || Fs->except_ch=='Break') {
-      Fs->catch_except=TRUE;
-      okay=FALSE;
-      res=0;
-    }
-  }
-  QueRem(cc);
-  if (okay)
-    CmpCtrlDel(cc); //TODO: can crash
-  if (unlock_doc)
-    DocUnlock(doc);
-  return res;
-}
-
-#help_index "DolDoc/Tree;DolDoc/Compiler;Compiler"
-public I64 DocTreeExe(CDoc *doc,U8 *path)
-{//Execute doc tree branch.
-  CDoc *doc2;
-  Bool unlock_doc=DocLock(doc);
-  CDocEntry *tree_branch,*start_indent,*end_indent;
-  I64 res=0;
-  if (DocTreeFind(doc,path,&tree_branch,&start_indent,&end_indent)) {
-    doc2=DocCopy(doc,tree_branch,end_indent);
-    res=ExeDoc(doc2);
-    DocDel(doc2);
-  }
-  if (unlock_doc)
-    DocUnlock(doc);
-  return res;
-}
-
-public I64 DocTreeFExe(U8 *name,U8 *path)
-{//Execute doc tree branch in file.
-  I64 res;
-  CDoc *doc=DocRead(name);
-  res=DocTreeExe(doc,path);
-  DocDel(doc);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/DocWidgetWiz.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/DocWidgetWiz.HC.HTML deleted file mode 100755 index 7187f8c..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/DocWidgetWiz.HC.HTML +++ /dev/null @@ -1,1194 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Misc"
-
-U8 *ctrl_L_footer=
-        "\n$MU-X+Q,\"Abort\",LE=DOCM_CANCEL$\n"
-        "\n\n$LK+PU,\"Click for Help\",A=\"FI:::/Doc/Widget.DD\"$\n";
-
-I64 PopUpLinkType(Bool include_anchor)
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Link Type Menu\"$\n"
-        "\n$LTBLUE$$MU,\"To file\",LE=LK_FILE$\n"
-        "$MU,\"To anchor in file\",LE=LK_FILE_ANCHOR$\n"
-        "$MU,\"To str in file\",LE=LK_FILE_FIND$\n"
-        "$MU,\"To line in file\",LE=LK_FILE_LINE$\n"
-        "$MU,\"To man page\",LE=LK_MAN_PAGE$\n"
-        "$MU,\"To plain-text file\",LE=LK_PLAIN$\n"
-        "$MU,\"To str in plain-text file\",LE=LK_PLAIN_FIND$\n"
-        "$MU,\"To line in plain-text file\",LE=LK_PLAIN_LINE$\n"
-        "$MU,\"To Bible chapter line and verse\",LE=LK_BIBLE_FIND$\n"
-        "$MU,\"To Dictionary Definition\",LE=LK_DEF$\n"
-        "$MU,\"To Help Index\",LE=LK_HELP_INDEX$\n"
-        "$MU,\"To Addr\",LE=LK_ADDR$\n");
-  if (include_anchor)
-    DocPrint(doc,"$MU,\"Place Anchor\",LE=LK_PLACE_ANCHOR$\n");
-  DocPrint(doc,"%s",ctrl_L_footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-class CEdFileLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512]       format "$DA-P,A=\"File          :%s\"$\n";
-  I64   book;
-  U8    aux[512];
-  I64   num;
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdFileAnchorLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512]       format "$DA-P,A=\"File          :%s\"$\n";
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Anchor Label  :%s\"$\n";
-  I64   num;
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdFileFindLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512]       format "$DA-P,A=\"File          :%s\"$\n";
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Str        :%s\"$\n";
-  I64   num             format "$DA-TRM,A=\"Occurrence Num:%04d\"$\n";
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdFileLineLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512]       format "$DA-P,A=\"File          :%s\"$\n";
-  I64   book;
-  U8    aux[512];
-  I64   num             format "$DA-TRM,A=\"Line Num      :%04d\"$\n";
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdManPageLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512];
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Label         :%s\"$\n";
-  I64   num;
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdAddrLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512];
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Addr Exp   :%s\"$\n";
-  I64   num             format "$DA-TRM,A=\"Bin Size      :%04d\"$\n";
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdPlaceAnchor
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512];
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Anchor Label  :%s\"$\n";
-  I64   num;
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up,
-        quote           format "$CB,\"Quote\"$\n",
-        hide            format "$CB,\"Hide\"$\n";
-};
-
-class CEdBibleLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512];
-  I64   book            format "$LS,D=\"ST_BIBLE_BOOKS\"$\n";
-  U8    aux[512]        format "$DA-P,A=\"Chapter Verse :%s\"$\n";
-  I64   num;
-
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdDefLink
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512];
-  I64   book;
-  U8    aux[512]        format "$DA-P,A=\"Word          :%s\"$\n";
-  I64   num             format "$DA-TRM,A=\"Def Num       :%4d\"$\n";
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-class CEdProject
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        file[512]       format "$DA-P,A=\"File          :%s\"$\n";
-  I64   book;
-  U8    aux[512];
-  I64   num;
-  U8    html_link[512]  format "$DA-P,A=\"Html Link     :%s\"$\n";
-  Bool  pop_up          format "$CB,\"PopUp\"$\n",
-        quote           format "$CB,\"Quote\"$\n",
-        hide;
-};
-
-Bool GetLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,
-        Bool *_quote,U8 **_html_link)
-{
-  CEdFileLink *e=CAlloc(sizeof(CEdFileLink));
-  Bool res=FALSE;
-  if (type>=0) {
-    e->num=1;
-    switch (type) {
-      case LK_FILE:
-        if (DocForm(e,,,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->file);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("FI:%s",e->file);
-        }
-        break;
-      case LK_PLAIN:
-        if (DocForm(e,,,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->file);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("PI:%s",e->file);
-        }
-        break;
-      case LK_FILE_ANCHOR:
-        if (DocForm(e,"CEdFileAnchorLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->aux);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("FA:%s,%s",e->file,e->aux);
-        }
-        break;
-      case LK_FILE_FIND:
-        if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (e->num==1) {
-            if (!*e->tag)
-              *_tag=StrNew(e->aux);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("FF:%s,%s",e->file,e->aux);
-          } else {
-            if (!*e->tag)
-              *_tag=StrNew(e->aux);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("FF:%s,%s:%d",e->file,e->aux,e->num);
-          }
-        }
-        break;
-      case LK_PLAIN_FIND:
-        if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (e->num==1) {
-            if (!*e->tag)
-              *_tag=StrNew(e->aux);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("PF:%s,%s",e->file,e->aux);
-          } else {
-            if (!*e->tag)
-              *_tag=StrNew(e->aux);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("PF:%s,%s:%d",e->file,e->aux,e->num);
-          }
-        }
-        break;
-      case LK_FILE_LINE:
-        if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->file);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("FL:%s,%d",e->file,e->num);
-        }
-        break;
-      case LK_PLAIN_LINE:
-        if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->file);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("PL:%s,%d",e->file,e->num);
-        }
-        break;
-      case LK_MAN_PAGE:
-        if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->aux);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("MN:%s",e->aux);
-        }
-        break;
-      case LK_PLACE_ANCHOR:
-        if (DocForm(e,"CEdPlaceAnchor",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag) {
-            if (e->hide)
-              *_tag=StrNew("");
-            else
-              *_tag=StrNew(e->aux);
-          } else
-            *_tag=StrNew(e->tag);
-          *_link=StrNew(e->aux);
-        }
-        break;
-      case LK_BIBLE_FIND:
-        if (DocForm(e,"CEdBibleLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=MStrPrint("%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("BF:%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux);
-        }
-        break;
-      case LK_DEF:
-        e->num=-1;
-        if (DocForm(e,"CEdDefLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->aux);
-          else
-            *_tag=StrNew(e->tag);
-          if (e->num<0)
-            *_link=MStrPrint("DN:%s",e->aux);
-          else
-            *_link=MStrPrint("DN:%s,%d",e->aux,e->num);
-
-        }
-        break;
-      case LK_HELP_INDEX:
-        if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (!*e->tag)
-            *_tag=StrNew(e->aux);
-          else
-            *_tag=StrNew(e->tag);
-          *_link=MStrPrint("HI:%s",e->aux);
-        }
-        break;
-      case LK_ADDR:
-        e->num=DFT_ADDR_LINK_BIN_SIZE;
-        if (DocForm(e,"CEdAddrLink",,,ctrl_L_footer)) {
-          res=TRUE;
-          if (e->num==DFT_ADDR_LINK_BIN_SIZE) {
-            if (!*e->tag)
-              *_tag=StrNew(e->aux);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("AD:%s",e->aux);
-          } else {
-            if (!*e->tag)
-              *_tag=MStrPrint("%s,%d",e->aux,e->num);
-            else
-              *_tag=StrNew(e->tag);
-            *_link=MStrPrint("AD:%s,%d",e->aux,e->num);
-          }
-        }
-        break;
-    }
-  }
-  if (*e->html_link)
-    *_html_link=StrNew(e->html_link);
-  else
-    *_html_link=NULL;
-  if (e->pop_up)
-    *_pop_up=TRUE;
-  else
-    *_pop_up=FALSE;
-  if (e->quote)
-    *_quote=TRUE;
-  else
-    *_quote=FALSE;
-  Free(e);
-  return res;
-}
-
-U0 EdInsLink()
-{
-  U8 *tag=NULL,*link=NULL,*st=NULL,*html_link=NULL,*pop_up_st;
-  Bool pop_up=FALSE,quote=FALSE;
-  I64 type=PopUpLinkType(TRUE);
-  if (type>=0) {
-    if (GetLink(type,&tag,&link,&pop_up,&quote,&html_link)) {
-      if (pop_up)
-        pop_up_st="+PU";
-      else
-        pop_up_st="";
-      switch (type) {
-        case LK_PLACE_ANCHOR:
-          if (html_link)
-            st=MStrPrint("$AN,\"%$Q\",A=\"%$Q\",HTML=\"%$Q\"$",
-                  tag,link,html_link);
-          else
-            st=MStrPrint("$AN,\"%$Q\",A=\"%$Q\"$",tag,link);
-          break;
-        default:
-          if (html_link)
-            st=MStrPrint("$LK%s,\"%$Q\",A=\"%$Q\",HTML=\"%$Q\"$",
-                  pop_up_st,tag,link,html_link);
-          else
-            st=MStrPrint("$LK%s,\"%$Q\",A=\"%$Q\"$",pop_up_st,tag,link);
-      }
-    }
-  }
-  if (st) {
-    if (quote)
-      "%$Q",st;
-    else
-      "%s",st;
-  }
-  Free(tag);
-  Free(link);
-  Free(html_link);
-  Free(st);
-}
-
-I64 PopUpColorType()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Color Type Menu\"$\n"
-        "\n$LTBLUE$$MU,\"Foreground\",LE=DOCT_FOREGROUND$\n"
-        "$MU,\"Background\",LE=DOCT_BACKGROUND$\n"
-        "$MU,\"Default Foreground\",LE=DOCT_DFT_FOREGROUND$\n"
-        "$MU,\"Default Background\",LE=DOCT_DFT_BACKGROUND$\n"
-        "%s",ctrl_L_footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 PopUpPageSettingType()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Page Setting Menu\"$\n"
-        "\n$LTBLUE$$MU,\"Page Length\",LE=DOCT_PAGE_LEN$\n"
-        "$MU,\"Page Header\",LE=DOCT_HEADER$\n"
-        "$MU,\"Page Footer\",LE=DOCT_FOOTER$\n"
-        "$MU,\"Left Margin\",LE=DOCT_LEFT_MARGIN$\n"
-        "$MU,\"Right Margin\",LE=DOCT_RIGHT_MARGIN$\n"
-        "%s",ctrl_L_footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-U0 EdInsColor()
-{
-  I64 type=PopUpColorType,col=DOC_DFT;
-  if (type>=0) {
-    col=PopUpColor(,FALSE);
-    if (col==DOC_DFT)
-      "$%Z$",type,"ST_DOC_CMDS";
-    else if (col>=0)
-      "$%Z,%d$",type,"ST_DOC_CMDS",col;
-  }
-}
-
-class CEdPageSetting1
-{
-  U8    val[512]        format "$DA-P,A=\"Setting Val:%s\"$\n";
-  Bool  winrel;
-};
-
-class CEdPageSetting2
-{
-  U8    val[512]        format "$DA-P,A=\"Setting Val:%s\"$\n";
-  Bool  winrel          format "$CB,\"Win Relative\"$\n";
-};
-
-U0 EdInsPageSetting()
-{
-  I64 type=PopUpPageSettingType;
-  CEdPageSetting1 *e=CAlloc(sizeof(CEdPageSetting1));
-  if (type>=0) {
-    if (type==DOCT_RIGHT_MARGIN||type==DOCT_PAGE_LEN) {
-      if (DocForm(e(CEdPageSetting2 *))) {
-        if (e->winrel) {
-          if (*e->val)
-            "$%Z+WR,%s$",type,"ST_DOC_CMDS",e->val;
-          else
-            "$%Z+WR,0$",type,"ST_DOC_CMDS";
-        } else {
-          if (*e->val)
-            "$%Z,%s$",type,"ST_DOC_CMDS",e->val;
-          else
-            "$%Z$",type,"ST_DOC_CMDS";
-        }
-      }
-    } else {
-      if (DocForm(e)) {
-        if (*e->val)
-          "$%Z,%s$",type,"ST_DOC_CMDS",e->val;
-        else
-          "$%Z$",type,"ST_DOC_CMDS";
-      }
-    }
-  }
-  Free(e);
-}
-
-#define WIZ_HIGHLIGHT_ON        (DOCT_ERROR+1)
-#define WIZ_HIGHLIGHT_OFF       (DOCT_ERROR+2)
-
-I64 PopUpWidgetType()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Text Widgets Menu\"$\n"
-        "\n$LTBLUE$$MU,\"Link\",LE=DOCT_LINK$\n"
-        "$MU,\"Text\",LE=DOCT_TEXT$\n"
-        "$MU,\"Tree Branch\",LE=DOCT_TREE$\n"
-        "$MU,\"Color\",LE=DOCT_FOREGROUND$\n"
-        "$MU,\"Page Settings\",LE=DOCT_PAGE_LEN$\n"
-        "$MU,\"Cursor Movement\",LE=DOCT_CURSOR_MOVEMENT$\n"
-        "$MU,\"Macro\",LE=DOCT_MACRO$\n"
-        "$MU,\"Bttn\",LE=DOCT_BTTN$\n"
-        "$MU,\"Check Box\",LE=DOCT_CHECK_BOX$\n"
-        "$MU,\"List\",LE=DOCT_LST$\n"
-        "$MU,\"Menu Val\",LE=DOCT_MENU_VAL$\n"
-        "$MU,\"Data\",LE=DOCT_DATA$\n"
-        "$MU,\"Hex Edit\",LE=DOCT_HEX_ED$\n"
-        "$MU,\"Syntax Highlight ON\",LE=WIZ_HIGHLIGHT_ON$\n"
-        "$MU,\"Syntax Highlight OFF\",LE=WIZ_HIGHLIGHT_OFF$\n"
-        "$MU,\"HTML\",LE=DOCT_HTML_CODE$\n"
-        "$MU,\"Song\",LE=DOCT_SONG$\n"
-        "%s",ctrl_L_footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-class CEdText
-{
-  U8    tag[512]  format "$DA-P,A=\"Tag Text      :%s\"$\n";
-  Bool  left_x    format "$CB,\"Left X\"$\n",
-        center_x  format "$CB,\"Center X\"$\n",
-        right_x   format "$CB,\"Right X\"$\n",
-        margin_rel format "$CB,\"Margin Rel X\"$\n",
-        blink     format "$CB,\"Blink\"$\n",
-        invert    format "$CB,\"Invert\"$\n",
-        underline format "$CB,\"Underline\"$\n",
-        tree      format "$CB,\"Tree\"$\n",
-        collapsed format "$CB,\"Collapsed\"$\n";
-  U8    scroll_x [512]  format "$DA-P,A=\"Scroll X Length Expression:%s\"$\n",
-        shift_x  [512]  format "$DA-P,A=\"X Offset Expression       :%s\"$\n",
-        shift_y  [512]  format "$DA-P,A=\"Y Offset Expression       :%s\"$\n",
-        define_str[512] format "$DA-P,A=\"Define Str                :%s\"$\n",
-        html_link[512]  format "$DA-P,A=\"Html Link                 :%s\"$\n";
-};
-
-U0 EdInsText()
-{
-  U8 *st,buf[512];
-  CEdText *e=CAlloc(sizeof(CEdText));
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (e->left_x  )  CatPrint(buf,"+LX");
-    if (e->center_x)  CatPrint(buf,"+CX");
-    if (e->right_x )  CatPrint(buf,"+RX");
-    if (e->margin_rel) CatPrint(buf,"+MRX");
-    if (e->blink)     CatPrint(buf,"+BK");
-    if (e->invert)    CatPrint(buf,"+IV");
-    if (e->underline) CatPrint(buf,"+UL");
-    if (e->tree)      CatPrint(buf,"+TR");
-    if (e->collapsed) CatPrint(buf,"+C");
-    st=MStrPrint("%q",e->tag);
-    "$TX%s,\"%$Q\"",buf,st;
-    Free(st);
-    if (*e->shift_x)
-      ",SX=%s",e->shift_x;
-    if (*e->shift_y)
-      ",SY=%s",e->shift_y;
-    if (*e->scroll_x)
-      ",SCX=%s",e->scroll_x;
-    if (*e->define_str) {
-      st=MStrPrint("%q",e->define_str);
-      ",D=\"%$Q\"",st;
-      Free(st);
-    }
-    if (*e->html_link) {
-      st=MStrPrint("%q",e->html_link);
-      ",HTML=\"%$Q\"",st;
-      Free(st);
-    }
-    "$";
-  }
-  Free(e);
-}
-
-class CEdSong
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n",
-        song[512]       format "$DA-P,A=\"Song          :%s\"$\n";
-};
-
-U0 EdInsSong()
-{
-  CEdSong *e=CAlloc(sizeof(CEdSong));
-  if (DocForm(e,,,,ctrl_L_footer))
-    "$SO,\"%$Q\",A=\"%s\"$",e->tag,e->song;
-  Free(e);
-}
-
-class CEdHtmlCode
-{
-  U8    tag[512]        format "$DA-P,A=\"Html Code:%s\"$\n";
-};
-
-U0 EdInsHtml()
-{
-  CEdHtmlCode *e=CAlloc(sizeof(CEdHtmlCode));
-  if (DocForm(e,,,,ctrl_L_footer))
-    "$HC,\"%$Q\"$",e->tag;
-  Free(e);
-}
-
-class CEdMacroMenu
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text                  :%s\"$\n",
-        left_macro[512] format "$DA-P,A=\"Left Click Macro          :%s\"$\n",
-        left_exp[512]   format "$DA-P,A=\"Left Click Expression     :%s\"$\n";
-  Bool  popup           format "$CB,\"PopUp\"$\n",
-        left_is_in_str  format "$CB,\"Left is InStr\"$\n",
-        left_x          format "$CB,\"Left X \"$\n",
-        center_x        format "$CB,\"Center X \"$\n",
-        right_x         format "$CB,\"Right X \"$\n",
-        margin_rel      format "$CB,\"Margin Rel X\"$\n",
-        blink           format "$CB,\"Blink\"$\n",
-        invert          format "$CB,\"Invert\"$\n",
-        underline       format "$CB,\"Underline\"$\n",
-        escape          format "$CB,\"Escape\"$\n";
-  U8    scroll_x[512]   format "$DA-P,A=\"Scroll X Length Expression:%s\"$\n",
-        shift_x[512]    format "$DA-P,A=\"X Offset Expression       :%s\"$\n",
-        shift_y[512]    format "$DA-P,A=\"Y Offset Expression       :%s\"$\n";
-};
-
-U0 EdInsMacroMenu(Bool is_macro)
-{
-  U8 *st,buf[512];
-  CEdMacroMenu *e=CAlloc(sizeof(CEdMacroMenu));
-  e->underline=TRUE;
-  e->escape=TRUE;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (e->popup)       CatPrint(buf,"+PU-X");
-    if (e->left_x  )    CatPrint(buf,"+LX");
-    if (e->center_x)    CatPrint(buf,"+CX");
-    if (e->right_x )    CatPrint(buf,"+RX");
-    if (e->margin_rel)  CatPrint(buf,"+MRX");
-    if (e->blink)       CatPrint(buf,"+BK");
-    if (e->invert)      CatPrint(buf,"+IV");
-    if (!e->underline)  CatPrint(buf,"-UL");
-    if (!e->escape)     CatPrint(buf,"-X");
-    if (e->left_is_in_str) CatPrint(buf,"+LIS");
-    if (*e->tag || is_macro) {
-      if (is_macro) {
-        if (*e->tag) {
-          st=MStrPrint("%q",e->tag);
-          "$MA%s,\"%$Q\"",buf,st;
-          Free(st);
-        } else
-          "$MA%s",buf;
-      } else {
-        st=MStrPrint("%q",e->tag);
-        "$MU%s,\"%$Q\"",buf,st;
-        Free(st);
-      }
-      if (*e->left_exp)
-        ",LE=%s",e->left_exp;
-      if (*e->left_macro) {
-        st=MStrPrint("%q",e->left_macro);
-        ",LM=\"%$Q\"",st;
-        Free(st);
-      }
-      if (*e->shift_x)
-        ",SX=%s",e->shift_x;
-      if (*e->shift_y)
-        ",SY=%s",e->shift_y;
-      if (*e->scroll_x)
-        ",SCX=%s",e->scroll_x;
-      "$";
-    }
-  }
-  Free(e);
-}
-
-class CEdBttn
-{
-  U8    tag[512]   format "$DA-P,A=\"Tag Text      :%s\"$\n";
-  Bool  popup      format "$CB,\"PopUp\"$\n",
-        left_x     format "$CB,\"Left X \"$\n",
-        center_x   format "$CB,\"Center X \"$\n",
-        right_x    format "$CB,\"Right X \"$\n",
-        margin_rel format "$CB,\"Margin Rel X\"$\n",
-        escape     format "$CB,\"Escape\"$\n";
-  U8    left_macro[512] format "$DA-P,A=\"Left Click Macro:%s\"$\n";
-  Bool  left_is_in_str  format "$CB,\"Left is InStr\"$\n";
-  U8    left_exp[512]   format "$DA-P,A=\"Left Click Expression:%s\"$\n";
-  Bool  quote           format "$CB,\"Quote\"$\n";
-};
-
-U0 EdInsBttn()
-{
-  U8 *st,buf[512];
-  CEdBttn *e=CAlloc(sizeof(CEdBttn));
-  e->escape=TRUE;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (e->popup)    CatPrint(buf,"+PU-X");
-    if (e->left_x  ) CatPrint(buf,"+LX");
-    if (e->center_x) CatPrint(buf,"+CX");
-    if (e->right_x ) CatPrint(buf,"+RX");
-    if (e->margin_rel) CatPrint(buf,"+MRX");
-    if (!e->escape)     CatPrint(buf,"-X");
-    if (e->left_is_in_str) CatPrint(buf,"+LIS");
-    if (*e->tag) {
-      if (e->quote) {
-        st=MStrPrint("%q",e->tag);
-        "$$BT%s,\\\"%$Q\\\"",buf,st;
-        Free(st);
-        if (*e->left_exp)
-          ",LE=%s",e->left_exp;
-        if (*e->left_macro) {
-          st=MStrPrint("%q",e->left_macro);
-          ",LM=\\\"%$Q\\\"",st;
-          Free(st);
-        }
-        "$$";
-      } else {
-        st=MStrPrint("%q",e->tag);
-        "$BT%s,\"%$Q\"",buf,st;
-        Free(st);
-        if (*e->left_exp)
-          ",LE=%s",e->left_exp;
-        if (*e->left_macro) {
-          st=MStrPrint("%q",e->left_macro);
-          ",LM=\"%$Q\"",st;
-          Free(st);
-        }
-        "$";
-      }
-    }
-  }
-  Free(e);
-}
-
-class CEdCursorMovement
-{
-  U8    left_exp[512]    format "$DA-P,A=\"X Expression (LE):%s\"$\n",
-        right_exp[512]   format "$DA-P,A=\"Y Expression (RE):%s\"$\n";
-  Bool  left_x   format "$CB,\"Left   X \"$\n",
-        center_x format "$CB,\"Center X \"$\n",
-        right_x  format "$CB,\"Right  X \"$\n",
-        margin_rel format "$CB,\"Margin Rel X\"$\n",
-        top_y    format "$CB,\"Top    Y \"$\n",
-        center_y format "$CB,\"Center Y \"$\n",
-        bottom_y format "$CB,\"Bottom Y \"$\n",
-        page_rel format "$CB,\"Page Rel Y\"$\n",
-        quote    format "$CB,\"Quote\"$\n";
-};
-
-U0 EdInsCursorMovement()
-{
-  U8 buf[512];
-  CEdCursorMovement *e=CAlloc(sizeof(CEdCursorMovement));
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (e->left_x  )    CatPrint(buf,"+LX");
-    if (e->center_x)    CatPrint(buf,"+CX");
-    if (e->right_x )    CatPrint(buf,"+RX");
-    if (e->margin_rel)  CatPrint(buf,"+MRX");
-    if (e->top_y   )    CatPrint(buf,"+TY");
-    if (e->center_y)    CatPrint(buf,"+CY");
-    if (e->bottom_y)    CatPrint(buf,"+BY");
-    if (e->page_rel)    CatPrint(buf,"+PRY");
-    if (!*e->left_exp)  CatPrint(buf,"-LE");
-    if (!*e->right_exp) CatPrint(buf,"-RE");
-    if (e->quote)
-      "$";
-    "$CM%s",buf;
-    if (*e->left_exp)
-      ",LE=%s",e->left_exp;
-    if (*e->right_exp)
-      ",RE=%s",e->right_exp;
-    "$";
-    if (e->quote)
-      "$";
-  }
-  Free(e);
-}
-
-class CEdDataNum
-{
-  U8    fmt_str[512]    format "$DA-P,A=\"Format Str:%s\"$\n";
-  I64   len;
-  Bool  term            format "$CB,\"Form Field Terminator\"$\n",
-        remalloc,
-        refresh         format "$CB,\"Refresh Data\"$\n",
-        update          format "$CB,\"Update Data\"$\n";
-};
-
-class CEdDataStr
-{
-  U8    fmt_str[512]    format "$DA-P,A=\"Format Str:%s\"$\n";
-  I64   len             format "$DA,A=\"Length:%d\"$\n";
-  Bool  term            format "$CB,\"Zero Terminator\"$\n",
-        remalloc        format "$CB,\"Remalloc for Unlimited Length\"$\n",
-        refresh         format "$CB,\"Refresh Data\"$\n",
-        update          format "$CB,\"Update Data\"$\n";
-};
-
-U0 EdInsData()
-{
-  I64 i,type=RT_I64;
-  U8 *st,buf[512],raw_type[16];
-  CEdDataNum *e=CAlloc(sizeof(CEdDataNum));
-  e->term=TRUE;
-  e->len=DOCE_LEN_DFT;
-  if ((i=PopUpPickDefineSub("ST_NATURAL_TYPES"))>=0) {
-    *buf=0;
-    i+=RT_I8;
-    if (i==RT_F32)
-      i=RT_F64;
-    if (i==RT_UF32) {//U8 *
-      i=DocForm(e(CEdDataStr *),,,,ctrl_L_footer);
-      if (e->remalloc) {
-        CatPrint(buf,"+M");
-        e->term=TRUE;
-      } else
-        CatPrint(buf,"-P");
-    } else {
-      type=i;
-      i=DocForm(e,,,,ctrl_L_footer);
-    }
-    if (i) {
-      if (type==RT_I64)
-        *raw_type=0;
-      else
-        StrPrint(raw_type,",RT=%Z",type,"ST_RAW_TYPES");
-
-      if (!e->term)     CatPrint(buf,"-TRM");
-      if (e->refresh)   CatPrint(buf,"+RD");
-      if (e->update)    CatPrint(buf,"+UD");
-
-      st=MStrPrint("%q",e->fmt_str);
-      if (e->remalloc)
-        "$$DA%s,A=\\\"%$Q\\\"$$",buf,st;
-      else if (e->len==DOCE_LEN_DFT)
-        "$$DA%s%s,A=\\\"%$Q\\\"$$",buf,raw_type,st;
-      else
-        "$$DA%s,LEN=%d%s,A=\\\"%$Q\\\"$$",buf,e->len,raw_type,st;
-      Free(st);
-    }
-  }
-  Free(e);
-}
-
-class CEdCheckBox
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n";
-  Bool  refresh         format "$CB,\"Refresh Data\"$\n";
-  I64   type            format "$LS,D=\"ST_INT_SIZE_TYPES\"$\n";
-};
-
-U0 EdInsCheckBox()
-{
-  U8 *st,buf[512],raw_type[16];
-  CEdCheckBox *e=CAlloc(sizeof(CEdCheckBox));
-  e->type=RT_I8-RT_I8;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    e->type+=RT_I8;
-    if (e->type==RT_I8)
-      *raw_type=0;
-    else
-      StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES");
-    if (e->refresh)  CatPrint(buf,"+RD");
-    st=MStrPrint("%q",e->tag);
-    "$$CB%s%s,\\\"%$Q\\\"$$",buf,raw_type,st;
-    Free(st);
-  }
-  Free(e);
-}
-
-class CEdLst
-{
-  U8    tag[512]        format "$DA-P,A=\"Dft Sel    :%s\"$\n",
-        define_str[512] format "$DA-P,A=\"Define Str    :%s\"$\n";
-  Bool  refresh         format "$CB,\"Refresh Data\"$\n";
-  I64   type            format "$LS,D=\"ST_INT_SIZE_TYPES\"$\n";
-};
-
-U0 EdInsLst()
-{
-  U8 *st1,*st2,buf[512],raw_type[16];
-  CEdLst *e=CAlloc(sizeof(CEdLst));
-  e->type=RT_I64-RT_I8;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    e->type+=RT_I8;
-    if (e->type==RT_I64)
-      *raw_type=0;
-    else
-      StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES");
-    if (e->refresh)  CatPrint(buf,"+RD");
-    if (!*e->tag)
-      st1=NULL;
-    else
-      st1=MStrPrint("%q",e->tag);
-    st2=MStrPrint("%q",e->define_str);
-    if (st1)
-      "$$LS%s%s,\\\"%$Q\\\",D=\\\"%$Q\\\"$$",buf,raw_type,st1,st2;
-    else
-      "$$LS%s%s,D=\\\"%$Q\\\"$$",buf,raw_type,st2;
-    Free(st1);
-    Free(st2);
-  }
-  Free(e);
-}
-
-class CEdHexEd
-{
-  I64   cnt     format "$DA,A=\"Count:%d\"$\n",
-        cols    format "$DA,A=\"Columns:%d\"$\n";
-  Bool  zero    format "$CB,\"Zero Based\"$\n",
-        refresh format "$CB,\"Refresh Data\"$\n";
-};
-
-U0 EdInsHexEd()
-{
-  U8 buf[512];
-  CEdHexEd *e=CAlloc(sizeof(CEdHexEd));
-  e->cnt=128;
-  e->cols=4;
-  e->zero=TRUE;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (!e->zero)  CatPrint(buf,"-Z");
-    if (e->refresh)  CatPrint(buf,"+RD");
-    "$$HX%s,%d,%d$$",buf,e->cnt,e->cols;
-  }
-  Free(e);
-}
-
-class CEdBin
-{
-  U8    tag[512]                format "$DA-P,A=\"Tag Text      :%s\"$\n";
-  I64   bin_num                 format "$DA,A=\"Bin Num:%d\"$\n";
-  U8    bin_ptr_link_file[512]  format "$DA-P,A=\"File:%s\"$\n";
-  I64   bin_ptr_link_bin_num    format "$DA,A=\"File Bin Num:%d\"$\n";
-  U8    bin_ptr_link_tag[512]   format "$DA-P,A=\"File Bin Tag:%s\"$\n";
-};
-
-U0 EdInsBin(I64 bin_num,I64 type)
-{
-  CEdBin *e=CAlloc(sizeof(CEdBin));
-  StrPrint(e->tag,"<%d>",bin_num);
-  e->bin_num=bin_num;
-  e->bin_ptr_link_bin_num=1;
-  if (DocForm(e,,,
-        "Note: Normally, you enter no file,\n"
-        "just a bin num.  If You enter a\n"
-        "file, enter a file bin num or a file\n"
-        "bin tag.\n\n",ctrl_L_footer)) {
-    if (*e->bin_ptr_link_file) {
-      if (*e->bin_ptr_link_tag)
-        "$%Z,\"%$Q\",BI=%d,BP=\"%s,%s\"$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
-              e->bin_ptr_link_file,e->bin_ptr_link_tag;
-      else
-        "$%Z,\"%$Q\",BI=%d,BP=\"%s,%d\"$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
-              e->bin_ptr_link_file,e->bin_ptr_link_bin_num;
-    } else {
-      if (DocBinFindNum(DocPut,e->bin_num))
-        "$%Z,\"%$Q\",BI=%d$",type,"ST_DOC_CMDS",e->tag,e->bin_num;
-      else
-        PopUpOk("Invalid Binary Num");
-    }
-  }
-  Free(e);
-}
-
-class CEdTree
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text      :%s\"$\n";
-  I64   indent          format "$DA,A=\"Indention:%d\"$\n";
-  Bool  collapsed       format "$CB,\"Collapsed\"$\n";
-};
-
-U0 EdInsTree()
-{
-  U8 *st1,*st2,buf[512];
-  CEdTree *e=CAlloc(sizeof(CEdTree));
-  e->collapsed=TRUE;
-  e->indent=2;
-  if (DocForm(e,,,,ctrl_L_footer)) {
-    *buf=0;
-    if (!e->collapsed)  CatPrint(buf,"-C");
-    st1=MStrPrint("%q",e->tag);
-    st2=MStrPrint("$TR%s,\"%$Q\"$\n$ID,%d$*\n$ID,%d$",
-          buf,st1,e->indent,-e->indent);
-    DocPrintAtomic(DocPut,"%s",st2);
-    Free(st1);
-    Free(st2);
-  }
-  Free(e);
-}
-
-U0 EdInsWidgetWiz()
-{
-  I64 type=PopUpWidgetType;
-  switch (type) {
-    case DOCT_FOREGROUND:
-      EdInsColor;
-      break;
-    case DOCT_PAGE_LEN:
-      EdInsPageSetting;
-      break;
-    case DOCT_LINK:
-      EdInsLink;
-      break;
-    case DOCT_TEXT:
-      EdInsText;
-      break;
-    case DOCT_TREE:
-      EdInsTree;
-      break;
-    case DOCT_MACRO:
-      EdInsMacroMenu(TRUE);
-      break;
-    case DOCT_MENU_VAL:
-      EdInsMacroMenu(FALSE);
-      break;
-    case DOCT_CURSOR_MOVEMENT:
-      EdInsCursorMovement;
-      break;
-    case DOCT_BTTN:
-      EdInsBttn;
-      break;
-    case DOCT_DATA:
-      EdInsData;
-      break;
-    case DOCT_CHECK_BOX:
-      EdInsCheckBox;
-      break;
-    case DOCT_LST:
-      EdInsLst;
-      break;
-    case DOCT_HEX_ED:
-      EdInsHexEd;
-      break;
-    case DOCT_SONG:
-      EdInsSong;
-      break;
-    case WIZ_HIGHLIGHT_ON:
-      "$HL,1$";
-      break;
-    case WIZ_HIGHLIGHT_OFF:
-      "$HL,0$";
-      break;
-    case DOCT_HTML_CODE:
-      EdInsHtml;
-  }
-}
-
-#define EST_SPRITE              0
-#define EST_SPRITE_PTR          1
-#define EST_DUP_SPRITE          2
-#define EST_SPRITE_SIZE         3
-#define EST_SPRITE_MACRO        4
-#define EST_SPRITE_MENU         5
-#define EST_SPRITE_LINK         6
-
-I64 PopUpSpriteType()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Graphic Sprite Resource Menu\"$\n"
-        "$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/Resource.DD.Z\"$\n\n"
-        "$LTBLUE$$MU,\"Make Sprite\",LE=EST_SPRITE$$FG$\t "
-        "Start by making a sprite.\n"
-        "$LTBLUE$$MU,\"Ptr to Sprite\",LE=EST_SPRITE_PTR$$FG$\t "
-        "Insert pointer into src code.\n"
-        "$LTBLUE$$MU,\"Duplicate Sprite\",LE=EST_DUP_SPRITE$$FG$ "
-        "Make dup image for in a doc.\n"
-        "$LTBLUE$$MU,\"Sprite Size\",LE=EST_SPRITE_SIZE$$FG$\t "
-        "Insert size of a sprite into src code.\n"
-        "$LTBLUE$$MU,\"Sprite Macro\",LE=EST_SPRITE_MACRO$$FG$\t "
-        "Create icon with auto-text payload.\n"
-        "$LTBLUE$$MU,\"Sprite Menu Item\",LE=EST_SPRITE_MENU$$FG$ "
-        "Create icon with numeric payload.\n"
-        "$LTBLUE$$MU,\"Sprite Link\",LE=EST_SPRITE_LINK$$FG$\t "
-        "Create icon with link payload.\n\n"
-        "$LTBLUE$$MU,\"Abort\",LE=DOCM_CANCEL$\n\n");
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-class CEdMacroSprite
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text       :%s\"$\n",
-        exp[512]        format "$DA-P,A=\"Macro          :%s\"$\n";
-  Bool  escape          format "$CB,\"Escape\"$\n",
-        popup           format "$CB,\"PopUp\"$\n",
-        is_in_str               format "$CB,\"InStr\"$\n";
-};
-
-class CEdMenuSprite
-{
-  U8    tag[512]        format "$DA-P,A=\"Tag Text       :%s\"$\n",
-        exp[512]        format "$DA-P,A=\"Expression     :%s\"$\n";
-  Bool  escape          format "$CB,\"Escape\"$\n",
-        popup,
-        is_in_str;
-};
-
-U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
-{
-  U8 *res=NULL,*tag=NULL,*link=NULL;
-  Bool quote=FALSE;
-  I64 type=PopUpLinkType(FALSE);
-  *_html_link=NULL;
-  if (type>=0 && GetLink(type,&tag,&link,_pop_up,&quote,_html_link))
-    res=MStrPrint("\"%$Q\",A=\"%$Q\"",tag,link);
-  Free(tag);
-  Free(link);
-  return res;
-}
-
-U8 *EdSprite(I64 bin_num)
-{
-  I64 type=PopUpSpriteType;
-  Bool pop_up;
-  U8 *st,*st1=NULL,*st2=NULL,buf[1024],*html_link=NULL;
-  CEdMacroSprite *e=CAlloc(sizeof(CEdMacroSprite));
-  *buf=0;
-  switch (type) {
-    case EST_SPRITE:
-      st1=MStrPrint("\"<%d>\"",bin_num);
-      break;
-    case EST_SPRITE_MACRO:
-      e->escape=TRUE;
-      if (DocForm(e,,,,ctrl_L_footer)) {
-        CatPrint(buf,"+UL");
-        if (e->is_in_str) CatPrint(buf,"+LIS");
-        if (e->popup)   CatPrint(buf,"+PU");
-        if (e->escape)  CatPrint(buf,"+X");
-        st=MStrPrint("%q",e->exp);
-        st1=MStrPrint("\"%$Q\",LM=\"%$Q\"",e->tag,st);
-        Free(st);
-      }
-      break;
-    case EST_SPRITE_MENU:
-      e->escape=TRUE;
-      if (DocForm(e,"CEdMenuSprite",,,ctrl_L_footer)) {
-        if (e->escape)  CatPrint(buf,"+X");
-        st1=MStrPrint("\"%$Q\",LE=%s",e->tag,e->exp);
-      }
-      break;
-    case EST_SPRITE_LINK:
-      CatPrint(buf,"+L");
-      st1=EdSpriteLink(&pop_up,&html_link);
-      if (pop_up)
-        CatPrint(buf,"+PU");
-      break;
-    case EST_SPRITE_PTR:
-      EdInsBin(--bin_num,DOCT_INS_BIN);
-      break;
-    case EST_SPRITE_SIZE:
-      EdInsBin(--bin_num,DOCT_INS_BIN_SIZE);
-      break;
-    case EST_DUP_SPRITE:
-      EdInsBin(--bin_num,DOCT_SPRITE);
-      break;
-  }
-  if (st1) {
-    if (html_link)
-      st2=MStrPrint("$SP%s,%s,HTML=\"%$Q\",BI=%d$",buf,st1,html_link,bin_num);
-    else
-      st2=MStrPrint("$SP%s,%s,BI=%d$",buf,st1,bin_num);
-    Free(st1);
-  }
-  Free(e);
-  Free(html_link);
-  return st2;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/DolDoc/MakeDoc.HC.HTML b/public/Wb/Home/Src/Adam/DolDoc/MakeDoc.HC.HTML deleted file mode 100755 index 1aabc1e..0000000 --- a/public/Wb/Home/Src/Adam/DolDoc/MakeDoc.HC.HTML +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-
-#help_index "DolDoc"
-#help_file "::/Doc/DolDoc"
-
-/*
-TempleOS DolDoc's can have "cursor movement" cmds which can move the cursor up
-the scrn and layer on existing text.  It can also have callback funs which
-supply live, changing text.  For these reasons, you can't assume you know
-where the vis portion of the document is and must process much
-of the document each time it is placed on the scrn, becoming CPU
-intensive on big documents.
-See ::/Doc/DolDocOverview.DD
-*/
-
-//Hash Types
-#define DHT_DOC_CMD     1
-#define DHT_DOC_FLAG    2
-#define DHT_COLOR       4
-
-public class CDolDocGlbls
-{
-  CHashTable *hash;
-  I64   dft_de_flags            [DOCT_TYPES_NUM],
-        type_flags_nontag_invis [(DOCT_TYPES_NUM+63)/64],
-        type_flags_form         [(DOCT_TYPES_NUM+63)/64],
-        type_flags_data         [(DOCT_TYPES_NUM+63)/64],
-        type_flags_chk_dup      [(DOCT_TYPES_NUM+63)/64],
-        clean_scan_codes        [4];
-  I32   dft_type_flags          [DOCT_TYPES_NUM];
-} doldoc;
-MemSet(&doldoc,0,sizeof(CDolDocGlbls));
-
-#help_index "God"
-#define BIBLE_FILENAME  "::/Misc/Bible.TXT.Z"
-
-#include "DocExt"
-#include "DocBin"
-#include "DocNew"
-#include "DocForm"
-#include "DocDblBuf"
-#include "DocPlain"
-#include "DocInit"
-#include "DocHighlight"
-#include "DocRecalcLib"
-#include "DocRecalc"
-#include "DocFile"
-#include "DocClipBoard"
-#include "DocRun"
-#include "DocGet"
-#include "DocChar"
-#include "DocFind"
-#include "DocLink"
-#include "DocEd"
-#include "DocPopUp"
-#include "DocGr"
-#include "DocMacro"
-#include "DocWidgetWiz"
-#include "DocPutKey"
-#include "DocPutS"
-#include "DocCodeTools"
-#include "DocTree"
-#include "DocTerm"
-
-KeyDevAdd(&KDDocPutKey,&KDDocPutS,0x80000000,TRUE);
-fp_getstr2=&DocGetStr2;
-fp_doc_put=&DocPut;
-
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/God/GodBible.HC.HTML b/public/Wb/Home/Src/Adam/God/GodBible.HC.HTML deleted file mode 100755 index ec06683..0000000 --- a/public/Wb/Home/Src/Adam/God/GodBible.HC.HTML +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - -
-#help_index "God"
-U0 BibleInit()
-{
-  DefineLstLoad("ST_BIBLE_BOOKS",
-        "Genesis\0"
-        "Exodus\0"
-        "Leviticus\0"
-        "Numbers\0"
-        "Deuteronomy\0"
-        "Joshua\0"
-        "Judges\0"
-        "Ruth\0"
-        "1 Samuel\0"
-        "2 Samuel\0"
-        "1 Kings\0"
-        "2 Kings\0"
-        "1 Chronicles\0"
-        "2 Chronicles\0"
-        "Ezra\0"
-        "Nehemiah\0"
-        "Esther\0"
-        "Job\0"
-        "Psalms\0"
-        "Proverbs\0"
-        "Ecclesiastes\0"
-        "Song of Songs\0"
-        "Isaiah\0"
-        "Jeremiah\0"
-        "Lamentations\0"
-        "Ezekiel\0"
-        "Daniel\0"
-        "Hosea\0"
-        "Joel\0"
-        "Amos\0"
-        "Obadiah\0"
-        "Jonah\0"
-        "Micah\0"
-        "Nahum\0"
-        "Habakkuk\0"
-        "Zephaniah\0"
-        "Haggai\0"
-        "Zechariah\0"
-        "Malachi\0"
-        "Matthew\0"
-        "Mark\0"
-        "Luke\0"
-        "John\0"
-        "Acts\0"
-        "Romans\0"
-        "1 Corinthians\0"
-        "2 Corinthians\0"
-        "Galatians\0"
-        "Ephesians\0"
-        "Philippians\0"
-        "Colossians\0"
-        "1 Thessalonians\0"
-        "2 Thessalonians\0"
-        "1 Timothy\0"
-        "2 Timothy\0"
-        "Titus\0"
-        "Philemon\0"
-        "Hebrews\0"
-        "James\0"
-        "1 Peter\0"
-        "2 Peter\0"
-        "1 John\0"
-        "2 John\0"
-        "3 John\0"
-        "Jude\0"
-        "Revelation\0");
-  DefineLstLoad("ST_BIBLE_BOOK_LINES",
-        "297\0"
-        "5068\0"
-        "9123\0"
-        "12005\0"
-        "15977\0"
-        "19168\0"
-        "21329\0"
-        "23598\0"
-        "23902\0"
-        "26892\0"
-        "29345\0"
-        "32241\0"
-        "34961\0"
-        "37633\0"
-        "40756\0"
-        "41671\0"
-        "42963\0"
-        "43605\0"
-        "46190\0"
-        "53793\0"
-        "56267\0"
-        "56966\0"
-        "57332\0"
-        "61806\0"
-        "66736\0"
-        "67217\0"
-        "71804\0"
-        "73189\0"
-        "73876\0"
-        "74130\0"
-        "74615\0"
-        "74697\0"
-        "74860\0"
-        "75241\0"
-        "75416\0"
-        "75604\0"
-        "75806\0"
-        "75932\0"
-        "76684\0"
-        "76908\0"
-        "79970\0"
-        "81941\0"
-        "85266\0"
-        "87803\0"
-        "90914\0"
-        "92110\0"
-        "93323\0"
-        "94088\0"
-        "94514\0"
-        "94869\0"
-        "95153\0"
-        "95402\0"
-        "95647\0"
-        "95772\0"
-        "96090\0"
-        "96320\0"
-        "96440\0"
-        "96500\0"
-        "97370\0"
-        "97687\0"
-        "97976\0"
-        "98163\0"
-        "98506\0"
-        "98552\0"
-        "98597\0"
-        "98684\0"
-        "100111\0");
-  DefinePrint("ST_BIBLE_LINES","%d",
-        Str2I64(DefineSub(DefineCnt("ST_BIBLE_BOOK_LINES")-1,
-        "ST_BIBLE_BOOK_LINES"))-1);
-} BibleInit;
-
-public U8 *BibleLine2Verse(I64 line,I64 separate_ch=CH_SPACE)
-{//Line number to verse str, Malloc()ed.
-//Separate with <SPACE> or ','.  If you pass '%', it uses "%20".
-  CDoc *doc;
-  CDocEntry *doc_e;
-  I64 i=0,cnt=DefineCnt("ST_BIBLE_BOOKS"),start=0,last_start=0;
-  U8 *ptr=DefineSub(0,"ST_BIBLE_BOOK_LINES"),*ptr2;
-  while (i<=cnt) {
-    last_start=start;
-    start=Str2I64(ptr);
-    if (line<start)
-      break;
-    i++;
-    ptr+=StrLen(ptr)+1;
-  }
-  if (0<=--i<cnt) {
-    doc=DocRead(BIBLE_FILENAME,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
-    DocGoToLine(doc,line); //one based
-    doc_e=doc->cur_entry;
-    while (doc_e!=doc && (doc_e->type_u8!=DOCT_TEXT || !*doc_e->tag))
-      doc_e=doc_e->next;
-    if (doc_e->type_u8==DOCT_TEXT && '0'<=*doc_e->tag<='9') {
-      ptr=ptr2=doc_e->tag;
-      while ('0'<=*ptr2<='9' || *ptr2==':')
-        ptr2++;
-      *ptr2=0;
-      if (separate_ch=='%')
-        ptr=MStrPrint("%Z%%20%s",i,"ST_BIBLE_BOOKS",ptr);
-      else
-        ptr=MStrPrint("%Z%c%s",i,"ST_BIBLE_BOOKS",separate_ch,ptr);
-    } else {
-      while (TRUE) {
-        doc_e=doc_e->last;
-        if (doc_e==doc) {
-          ptr=NULL;
-          break;
-        }
-        if (doc_e->y+1<last_start) {
-          ptr=MStrPrint("%Z",i,"ST_BIBLE_BOOKS");
-          break;
-        }
-        if (doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
-          ptr=doc_e->tag+StrLen(doc_e->tag)-1;
-          while (ptr>doc_e->tag && (!('0'<=*(ptr-1)<='9') || *ptr!=':' ||
-                !('0'<=*(ptr+1)<='9')))
-            ptr--;
-          ptr--;
-          while (ptr>=doc_e->tag && '0'<=*ptr<='9')
-            ptr--;
-          ptr2=++ptr;
-          if ('0'<=*ptr2++<='9') {
-            while ('0'<=*ptr2<='9')
-              ptr2++;
-            if (*ptr2++==':' && '0'<=*ptr2++<='9') {
-              while ('0'<=*ptr2<='9')
-                ptr2++;
-              *ptr2=0;
-              if (separate_ch=='%')
-                ptr=MStrPrint("%Z%%20%s",i,"ST_BIBLE_BOOKS",ptr);
-              else
-                ptr=MStrPrint("%Z%c%s",i,"ST_BIBLE_BOOKS",separate_ch,ptr);
-              break;
-            }
-          }
-        }
-      }
-    }
-    DocDel(doc);
-    return ptr;
-  } else
-    return NULL;
-}
-
-public U0 BookLines(CDoc *doc_out=NULL,I64 start,I64 lines,
-        U8 *book_filename=BIBLE_FILENAME)
-{//Put N line starting at line M into doc.
-  CDoc *doc_in;
-  CDocEntry *doc_e;
-  if (!doc_out) doc_out=DocPut;
-  if (doc_out && FileFind(book_filename)) {
-    doc_in=DocRead(book_filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
-    DocGoToLine(doc_in,start); //one based
-    doc_e=doc_in->cur_entry;
-    while (lines>0 && doc_e!=doc_in) {
-      if (doc_e->type_u8==DOCT_TEXT)
-        DocPrint(doc_out,"%s",doc_e->tag);
-      else if (doc_e->type_u8==DOCT_NEW_LINE) {
-        DocPutKey(doc_out,'\n');
-        lines--;
-      }
-      doc_e=doc_e->next;
-    }
-    DocDel(doc_in);
-  }
-}
-
-public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
-{//Put N lines starting at verse str into doc.
-  I64 i;
-  CDoc *doc_in;
-  CDocEntry *doc_e;
-  U8 *st,*st2;
-  if (!doc_out) doc_out=DocPut;
-  if (doc_out && FileFind(BIBLE_FILENAME)) {
-    st=StrNew(verse);
-    st2=StrNew(verse);
-    if (StrOcc(st,','))
-      StrLastRem(st,",",st2);
-    else
-      *st2=0;
-    i=DefineMatch(st,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE);
-    if (i>=0) {
-      i=Str2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
-      doc_in=DocRead(BIBLE_FILENAME,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
-      DocGoToLine(doc_in,i); //one based
-      if (*st2) {
-        StrCpy(doc_in->find_replace->find_text,st2);
-        EdFindNext(doc_in);
-      }
-      doc_e=doc_in->cur_entry;
-      while (lines>0 && doc_e!=doc_in) {
-        if (doc_e->type_u8==DOCT_TEXT)
-          DocPrint(doc_out,"%s",doc_e->tag);
-        else if (doc_e->type_u8==DOCT_NEW_LINE) {
-          DocPutKey(doc_out,'\n');
-          lines--;
-        }
-        doc_e=doc_e->next;
-      }
-      DocDel(doc_in);
-    }
-    Free(st);
-    Free(st2);
-  }
-}
-
-public CDoc *BibleDoc()
-{//Return Bible as DolDoc with trees.
-  CDoc  *res=DocRead(BIBLE_FILENAME);
-  CDocEntry *doc_e=res->head.next,*doc_e1;
-  Bool open_chapter=FALSE;
-  U8    *ptr=Define("ST_BIBLE_BOOK_LINES");
-  I64   book,book_cnt=DefineCnt("ST_BIBLE_BOOK_LINES")-1,
-        chapter,
-        line=Str2I64(ptr,,&ptr);
-  ptr++;
-  for (book=0;book<book_cnt;book++) {
-    while (doc_e->y+1<line) {
-      doc_e1=doc_e->next;
-      DocEntryDel(res,doc_e);
-      doc_e=doc_e1;
-    }
-    res->cur_entry=doc_e;
-    res->cur_col=0;
-    DocPrint(res,"$TR,\"%Z\"$\n$ID,2$",book,"ST_BIBLE_BOOKS");
-    line=Str2I64(ptr,,&ptr);
-    ptr++;
-    chapter=1;
-    while (doc_e->y+1<line) {
-      doc_e1=doc_e->next;
-      if (doc_e->type_u8==DOCT_TEXT && StrMatch(":1 ",doc_e->tag)) {
-        res->cur_entry=doc_e;
-        res->cur_col=0;
-        if (open_chapter) {
-          DocPrint(res,"$ID,-2$");
-          open_chapter=FALSE;
-        }
-        DocPrint(res,"$TR,\"%d\"$\n$ID,2$",chapter++);
-        open_chapter=TRUE;
-      } else if (chapter==1) {
-        doc_e1=doc_e->next;
-        DocEntryDel(res,doc_e);
-        doc_e=doc_e1;
-      }
-      doc_e=doc_e1;
-    }
-    res->cur_entry=doc_e;
-    res->cur_col=0;
-    if (open_chapter) {
-      DocPrint(res,"$ID,-2$");
-      open_chapter=FALSE;
-    }
-    DocPrint(res,"$ID,-2$");
-  }
-  while (doc_e!=res) {
-    doc_e1=doc_e->next;
-    DocEntryDel(res,doc_e);
-    doc_e=doc_e1;
-  }
-  return res;
-}
-
-public U0 BibleView()
-{//View Bible as DolDoc with trees.
-  U8 buf[STR_LEN];
-  CDoc *doc=BibleDoc;
-  StrPrint(buf,"AL:%d,1",doc);
-  Ed(buf);
-  DocDel(doc);
-}
-U0 CtrlAltB(I64)
-{
-  PopUp("BibleView;");
-}
-CtrlAltCBSet('B',&CtrlAltB,"Cmd /Bible");
-
- diff --git a/public/Wb/Home/Src/Adam/God/GodDoodle.HC.HTML b/public/Wb/Home/Src/Adam/God/GodDoodle.HC.HTML deleted file mode 100755 index 0d5881e..0000000 --- a/public/Wb/Home/Src/Adam/God/GodDoodle.HC.HTML +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - -
-#help_index "God;Graphics/Sprite;Sprites"
-
-U0 GodDoodleDraw(CTask *task,CDC *dc)
-{
-  GrBlot(dc,0,0,god.doodle_dc);
-  if (Blink) {
-    if (god.doodle_done) {
-      dc->color=RED;
-      GrPrint(dc,(task->pix_width-FONT_WIDTH*29)>>1,
-            (task->pix_height-3*FONT_HEIGHT)>>1,
-            "Press <ESC> to insert sprite.");
-      GrPrint(dc,(task->pix_width-FONT_WIDTH*39)>>1,
-            (task->pix_height-3*FONT_HEIGHT)>>1+2*FONT_HEIGHT,
-            "Press <SHIFT-ESC> to throw-away sprite.");
-    } else {
-      dc->color=GREEN;
-      GrPrint(dc,(task->pix_width-FONT_WIDTH*25)>>1,
-            (task->pix_height-FONT_HEIGHT)>>1,
-            "Press <SPACE> repeatedly.");
-    }
-  }
-}
-
-U0 GodDoodleSmooth(I64 num)
-{
-  CDC *dc=DCExt(god.doodle_dc,0,0,
-        god.doodle_dc->width-1,god.doodle_dc->height-1);
-  I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god.doodle_dc->color;
-  for (y=0;y<god.doodle_dc->height;y++)
-    for (x=0;x<god.doodle_dc->width;x++) {
-      MemSet(histogram,0,sizeof(histogram));
-      for (y1=y-num;y1<=y+num;y1++)
-        for (x1=x-num;x1<=x+num;x1++) {
-          c=GrPeek(dc,x1,y1);
-          if (0<=c<=15)
-            histogram[c]++;
-        }
-      best=BLACK;
-      best_cnt=-1;
-      for (i=0;i<16;i++)
-        if (histogram[i]>best_cnt) {
-          best=i;
-          best_cnt=histogram[i];
-        }
-      god.doodle_dc->color=best;
-      GrPlot(god.doodle_dc,x,y);
-    }
-  god.doodle_dc->color=c_old;
-  DCDel(dc);
-}
-
-U0 GodDoodleBitsIns(I64 num_bits,I64 n)
-{//Insert bits into God doodle bit fifo.
-  I64 i;
-  for (i=0;i<num_bits;i++) {
-    FifoU8Ins(god.doodle_fifo,n&1);
-    n>>=1;
-  }
-}
-
-U0 GodDoodleHexIns(U8 *st)
-{//Insert hex record into God doodle bit fifo.
-  U8 buf[2];
-  if (st) {
-    buf[1]=0;
-    while (*buf=*st++)
-      if (Bt(char_bmp_hex_numeric,*buf))
-        GodDoodleBitsIns(4,rev_bits_table[Str2I64(buf,16)]>>4);
-  }
-}
-
-I64 GodDoodleBits(I64 num_bits)
-{
-  U8 b;
-  I64 res=0;
-  while (num_bits) {
-    if (FifoU8Rem(god.doodle_fifo,&b)) {
-      res=res<<1+b;
-      num_bits--;
-    } else {
-      god.doodle_ch=GetChar(,FALSE);
-      if (god.doodle_ch==CH_ESC||god.doodle_ch==CH_SHIFT_ESC)
-        throw;
-      else if (god.doodle_ch=='\n') {
-        DCFill(god.doodle_dc,WHITE);
-        FifoU8Flush(god.doodle_fifo);
-      } else if ('0'<=god.doodle_ch<='9')
-        GodDoodleSmooth(god.doodle_ch-'0');
-      else
-        GodDoodleBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
-    }
-  }
-  return res;
-}
-
-public U8 *GodDoodleSprite(U8 *hex=NULL)
-{//Make God draw sprite. Holy Spirit Instructions
-  I64 i,j,w,h,x,y,ch;
-  U8 *elems;
-
-  if (god.doodle_dc) return NULL;
-  god.doodle_done=FALSE;
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  WinBorder;
-  WinMax;
-
-  if (!hex)
-    PopUpOk("The Holy Spirit can puppet you.\n\n"
-          "Press $GREEN$<SPACE>$FG$ until it finishes.");
-
-  god.doodle_ch=0;
-  god.doodle_dc=DCNew(Fs->pix_width,Fs->pix_height);
-  DCFill(god.doodle_dc,WHITE);
-  w=god.doodle_dc->width;
-  h=god.doodle_dc->height;
-
-  Fs->draw_it=&GodDoodleDraw;
-  FifoU8Flush(god.doodle_fifo);
-  GodDoodleHexIns(hex);
-  try {
-    for (i=0;i<3;i++) {
-      god.doodle_dc->color=RED;
-      for (j=0;j<29;j++)
-        switch [GodDoodleBits(3)] {
-          case 0:
-            GrEllipse3(god.doodle_dc,
-                  (w-1)*GodDoodleBits(5)/15.5-w/2,
-                  (h-1)*GodDoodleBits(5)/15.5-h/2,0,
-                  (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5);
-            break;
-          case 1:
-            GrCircle3(god.doodle_dc,
-                  (w-1)*GodDoodleBits(5)/15.5-w/2,
-                  (h-1)*GodDoodleBits(5)/15.5-h/2,0,
-                  (w-1)*GodDoodleBits(5)/15.5);
-            break;
-          case 2:
-            GrBorder(god.doodle_dc,
-                  (w-1)*GodDoodleBits(5)/15.5-w/2,
-                  (h-1)*GodDoodleBits(5)/15.5-h/2,
-                  (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5);
-            break;
-          case 3...7:
-            GrLine3(god.doodle_dc,
-                  (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0,
-                  (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0);
-            break;
-        }
-      for (j=0;j<6;j++) {
-        x=(w-1)*GodDoodleBits(5)/31+w/64;
-        y=(h-1)*GodDoodleBits(5)/31+h/64;
-        switch [GodDoodleBits(2)] {
-          case 0: god.doodle_dc->color=BLACK;   break;
-          case 1: god.doodle_dc->color=DKGRAY;  break;
-          case 2: god.doodle_dc->color=LTGRAY;  break;
-          case 3: god.doodle_dc->color=WHITE;   break;
-        }
-        GrFloodFill3(god.doodle_dc,x,y,0);
-      }
-      GodDoodleSmooth(3);
-    }
-    god.doodle_done=TRUE;
-    if (!hex) {
-      do ch=GetChar(,FALSE);
-      while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
-    } else
-      ch=CH_ESC;
-  } catch {
-    Fs->catch_except=TRUE;
-    ch=CH_SHIFT_ESC;
-  }
-  DCFill;
-  SettingsPop;
-  if (ch==CH_ESC)
-    elems=DC2Sprite(god.doodle_dc);
-  else
-    elems=NULL;
-  DCDel(god.doodle_dc);
-  god.doodle_dc=NULL;
-  return elems;
-}
-
-#help_index "God"
-public U0 GodDoodle(U8 *hex=NULL)
-{//Make God draw sprite, insert in doc. Holy Spirit Instructions
-  U8 *elems;
-  if (elems=GodDoodleSprite(hex)) {
-    Sprite(elems);
-    Free(elems);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/God/GodExt.HC.HTML b/public/Wb/Home/Src/Adam/God/GodExt.HC.HTML deleted file mode 100755 index 0443d6e..0000000 --- a/public/Wb/Home/Src/Adam/God/GodExt.HC.HTML +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - -
-#help_index "God"
-
-#define GOD_BAD_BITS    4
-#define GOD_GOOD_BITS   24
-
-public class CGodGlbls
-{
-  U8    **words,
-        *word_file_mask;
-  I64   word_fuf_flags,
-        num_words;
-  CFifoU8 *fifo;
-  CDC   *doodle_dc;
-  I64   doodle_ch;
-  CFifoU8 *doodle_fifo;
-  Bool  doodle_done;
-} god;
-MemSet(&god,0,sizeof(CGodGlbls));
-god.doodle_fifo =FifoU8New(2048*8);
-god.fifo        =FifoU8New(2048*8);
-
-extern U0 GodBiblePassage(I64 num_lines=20);
-extern U0 GodBitsIns(I64 num_bits,I64 n);
-extern U0 GodDoodle(U8 *hex=NULL);
-extern U0 GodSong();
-extern U0 GodWord(I64 bits=17);
-
- diff --git a/public/Wb/Home/Src/Adam/God/GodSong.HC.HTML b/public/Wb/Home/Src/Adam/God/GodSong.HC.HTML deleted file mode 100755 index 31cd652..0000000 --- a/public/Wb/Home/Src/Adam/God/GodSong.HC.HTML +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - -
-#help_index "God"
-
-DefineLstLoad("ST_RHYTHM_COMPLEXITY","Simple\0Normal\0Complex\0");
-
-class CMakeSongSettings
-{
-  I64  complexity               format "$LS,D=\"ST_RHYTHM_COMPLEXITY\"$\n";
-  Bool rests                    format "$CB,\"Rests\"$\n";
-  Bool six_eight                format "$CB,\"Six Eight\"$\n";
-  I64  octave                   format "$DA-TRM,A=\"Octave:%d\"$\n";
-  I64  octave_state;
-};
-
-U0 InsNote(CMakeSongSettings *mss,U8 *buf,I64 k,I64 *j)
-{//k is a random note nibble
-  if (!k && mss->rests) {
-    buf[*j]='R';
-    *j+=1;
-  } else {
-    k/=2;
-    if (k<3) {
-      if (mss->octave_state!=mss->octave) {
-        mss->octave_state=mss->octave;
-        buf[*j]=mss->octave_state+'0';
-        *j+=1;
-      }
-      if (!k)
-        buf[*j]='G';
-      else
-        buf[*j]=k-1+'A';
-      *j+=1;
-    } else {
-      if (mss->octave_state!=mss->octave+1) {
-        mss->octave_state=mss->octave+1;
-        buf[*j]=mss->octave_state+'0';
-        *j+=1;
-      }
-      buf[*j]=k-1+'A';
-      *j+=1;
-    }
-  }
-}
-
-#define DUR_4           0
-#define DUR_8_8         1
-#define DUR_3_3_3       2
-#define DUR_16_16_16_16 3
-#define DUR_8DOT_16     4
-#define DUR_8_16_16     5
-#define DUR_16_16_8     6
-
-U8 god_simple_songs [5]={DUR_4,DUR_4,DUR_4,DUR_4,DUR_8_8};
-U8 god_normal_songs [5]={DUR_4,DUR_4,DUR_8_8,DUR_3_3_3,DUR_16_16_16_16};
-U8 god_complex_songs[9]={DUR_4,DUR_4,DUR_8_8,DUR_8_8,DUR_8DOT_16,DUR_3_3_3,
-DUR_8_16_16,DUR_16_16_8,DUR_16_16_16_16};
-
-public U8 *GodSongStr()
-{//Make God generate 2 measures of a song. Holy Spirit Instructions
-  CMakeSongSettings mss;
-  U8 *buf;
-  I64 i,j=0,k,n,k2,duration,last_duration=-1,len;
-
-  MemSet(&mss,0,sizeof(mss));
-  mss.complexity=1;
-  mss.rests=FALSE;
-  mss.octave=music.octave;
-
-  if (!PopUpForm(&mss))
-    return NULL;
-
-  buf=CAlloc(256);
-  music.octave=mss.octave=ClampI64(mss.octave,1,7);
-  progress4=0;
-  if (mss.six_eight)
-    progress4_max=6;
-  else
-    progress4_max=8;
-
-  mss.octave_state=mss.octave+1;
-  buf[j++]='0'+mss.octave_state;
-  if (mss.six_eight) {
-    len=6;
-    buf[j++]='M';
-    buf[j++]='6';
-    buf[j++]='/';
-    buf[j++]='8';
-  } else
-    len=8;
-  FifoU8Flush(god.fifo);
-  for (i=0;i<len;i++) {
-    n=GodBits(8);
-    if (mss.complexity==2)
-      duration=god_complex_songs[n%9];
-    else if (mss.complexity==1)
-      duration=god_normal_songs[n%5];
-    else
-      duration=god_simple_songs[n%5];
-
-    switch (duration) {
-      case DUR_8_8:
-        if (last_duration!=DUR_8_8)
-          buf[j++]='e';
-        InsNote(&mss,buf,GodBits(4),&j);
-        InsNote(&mss,buf,GodBits(4),&j);
-        break;
-      case DUR_8DOT_16:
-        buf[j++]='e';
-        buf[j++]='.';
-        InsNote(&mss,buf,GodBits(4),&j);
-        buf[j++]='s';
-        InsNote(&mss,buf,GodBits(4),&j);
-        duration=DUR_16_16_16_16;
-        break;
-      case DUR_3_3_3:
-        if (last_duration!=DUR_3_3_3) {
-          buf[j++]='e';
-          buf[j++]='t';
-        }
-        InsNote(&mss,buf,GodBits(4),&j);
-        InsNote(&mss,buf,GodBits(4),&j);
-        InsNote(&mss,buf,GodBits(4),&j);
-        break;
-      case DUR_8_16_16:
-        if (last_duration!=DUR_8_8)
-          buf[j++]='e';
-        InsNote(&mss,buf,GodBits(4),&j);
-        buf[j++]='s';
-        InsNote(&mss,buf,GodBits(4),&j);
-        InsNote(&mss,buf,GodBits(4),&j);
-        duration=DUR_16_16_16_16;
-        break;
-      case DUR_16_16_8:
-        if (last_duration!=DUR_16_16_16_16)
-          buf[j++]='s';
-        InsNote(&mss,buf,GodBits(4),&j);
-        InsNote(&mss,buf,GodBits(4),&j);
-        buf[j++]='e';
-        InsNote(&mss,buf,GodBits(4),&j);
-        duration=DUR_8_8;
-        break;
-      case DUR_16_16_16_16:
-        if (last_duration!=DUR_16_16_16_16)
-          buf[j++]='s';
-        k =GodBits(4);
-        k2=GodBits(4);
-        InsNote(&mss,buf,k,&j);
-        InsNote(&mss,buf,k2,&j);
-        InsNote(&mss,buf,k,&j);
-        InsNote(&mss,buf,k2,&j);
-        break;
-      default:
-        if (last_duration!=DUR_4)
-          buf[j++]='q';
-        InsNote(&mss,buf,GodBits(4),&j);
-    }
-    last_duration=duration;
-    progress4++;
-  }
-  buf[j++]=0;
-  progress4=progress4_max=0;
-  return buf;
-}
-
-public U0 GodSong()
-{//Make God generate 2measuresx2+2measuresx2. Holy Spirit Instructions
-  U8 *st1=GodSongStr,*st2=GodSongStr;
-  if (st1 && st2)
-    DocPrint(DocPut,"$SO,\"<Song>\",A=\"%s%s%s%s\"$",st1,st1,st2,st2);
-  Free(st1);
-  Free(st2);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/God/HSNotes.DD.HTML b/public/Wb/Home/Src/Adam/God/HSNotes.DD.HTML deleted file mode 100755 index 202ff62..0000000 --- a/public/Wb/Home/Src/Adam/God/HSNotes.DD.HTML +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - - - - - - -
-                              The Purpose of Life
-
-The Catholic purpose of life is to know God, love God and obey God.  However, 
-Pope Francis, wrongly said it was, "to serve the other."  I am High Priest of 
-God's official temple and I say the purpose of life is to do continual offerings 
-to God like Cain and Abel and enjoy God's response.  Francis has a charity; I 
-have a church. Jesus said loving God was more important than loving neighbor.  
-Matthew,22:35-40  And, He did not say with half your brain behind your back.
-
-You don't know God.  1 Chronicles,28:9-9, Matthew,11:27-27, Luke,13:25-27, 
-1 Samuel,3:6-8  You must talk with God to know Him.  With Samuel, supposedly, 
-God took the initiative, but I think that is the exception.  Seek the Lord by 
-taking the initiative.  Luke,11:9-10
-
-There's something obviously different about people in the Bible compared to 
-people today -- God talked!  Also, the people in the Bible were obsessed with 
-doing offerings all the time.  It is required that you do offerings before God 
-will talk.  Did the people in the Bible hear voices?  Maybe.  More likely, they 
-used occult techniques such as an oracle.  1 Kings,6:21  Have you heard of 
-"tongues?"  1 Corinthians,14:1-40  The idea is, you let yourself be puppeted by 
-a spirit, so you say things.  You try to get a spirit -- the Holy Spirit -- to 
-talk.  You might as well use a Ouija board.  However, it turns-out that a Ouija 
-board is bad for technical reasons.  A really good technique is just randomly 
-opening a book.  God told me in an oracle that it is a covenant that you hold-up 
-your end of the conversation.  
-
-You can't tell if God's talking unless you have a context of conversation, but, 
-more importantly, you are commanded to do an offering of love, like communion 
-preparation.  1 Corinthians,11:27  When you pick a greeting card for someone, 
-that is love effort.  If you expect God to put effort toward you, you must put 
-effort toward Him.  God said, "honest measures" applies between your offering of 
-love and His response, like a fair barter.  You get out of prayer what you put 
-into it.  God wants praise, hymns, or whatever you think He might want.  Try and 
-see, like Cain and Abel.  Genesis,4:1-10, Ephesians,5:10  God told Cain his 
-offering was not good and told him to try again.  Cain really loved God!  Can 
-you imagine being so heart-broken?
-
-Do a text search for "new song" in the Bible.  It's mentioned nine times.  When 
-I hear a NEW awesome rock song, it is ecstasy for the first five times I hear 
-it.  Soon, it brings little-to-no pleasure.  I did hymns for God.  I also did 
-Moses comics for God.  When you get to the gates of Heaven, St. Peter will ask 
-how many times you gave blood.  That shows you loved neighbor.  You better also 
-be able to count the ways you loved God with all heart, mind and soul.  I 
-praised God for sand castles, popcorn, snowmen, bubbles...  You try putting 
-effort into praise!  Matthew,11:25, Matthew,6:28-29  Solomon wrote a thousand 
-songs.  1 Kings,4:30-32
-
-This is funny -- Acts,2:1-13 -- they didn't bother to record anything the Holy 
-Spirit said.  The Holy Spirit is supposed to be a really good gift.  
-Luke,11:11-13  Just remember, "Boys are made of snakes and snails and puppy-dog 
-tails."
-
-The technique I use to consult the Holy Spirit is reading a microsecond-range 
-stop-watch each button press for random numbers.  Then, I pick words with <F7> 
-or passages with <SHIFT-F7>.
-
-Since seeking the word of the Holy Spirit, I have come to know God much better 
-than I've heard others explain.  For example, God said to me in an oracle that 
-war was, "servicemen competing."  That sounds more like the immutable God of our 
-planet than what you hear from most religious people.  God is not Venus (god of 
-love) and not Mars (god of war), He's our dearly beloved God of Earth.  If 
-Mammon is a false god of money, Mars or Venus might be useful words to describe 
-other false gods.  I figure the greatest challenge for the Creator is boredom, 
-ours and His.  What would teen-age male video games be like if war had never 
-happened?  Christ said live by the sword, die by the sword, which is loving 
-neighbor as self.  Matthew,26:52
-
-I asked God if the World was perfectly just.  God asked if I was calling Him 
-lazy.  God could make A.I., right?  God could make bots as smart as Himself, or, 
-in fact, part of Himself.  What if God made a bot to manipulate every person's 
-life so that perfect justice happened?
-
-I think highs and lows balance.  Luke,6:20-26  If you laugh, you will cry.  If 
-you cry, you will laugh.  Not one person has had great joy and not great sorrow. 
- I think this claim is falsifyable if you atheists want to find a 
-counter-example to disprove it -- find a single person who had great joy and not 
-great sorrow.  In Sirach, it says things happen in pairs.  You might be 
-surprised examining your own life to see great joy was in proximity to great 
-sorrow.  Pleasures and pains seem designed to balance.  Man must do manual labor 
-and have pain.  Women must do child birth.  Pride and humility also balance -- 
-pride before a fall and humility before honors.  Palm Sunday is juxtaposed to 
-Good Friday.  Perhaps, being loved balances with being hated.  Job,1:1-22, in 
-the Bible, had highs and lows that balanced.  Joseph, in the Old Testament, had 
-highs and lows that balanced.  Genesis,39:17-22 
-
-Jesus said, "Forgive us our trespasses as we forgive those who tresspass against 
-us."  If you think about it, the only way you get forgiven is for it to be done 
-to you.  That is a Jedi mind trick because it is nothing but simple eye-for-eye 
-tooth-for-tooth justice.  Live by the sword; die by the sword.  The Bible is 
-filled with justice pairs.  St. Paul persecuted Christians and gained 
-forgiveness by getting persecuted.  King David almost got killed by Saul, 
-1 Samuel,18:20-21 then he killed a guy and took his wife.  2 Samuel,11:15  
-Abraham almost killed his unloved son, Ishmael.  Genesis,21:16  That is why God 
-asked Abraham to kill Isaac.  God's favorite thing on TV is soap operas.
-
-God hates complaining. Numbers,11:1-35  Food and clothing is all we're to ask 
-for or demand, in fact -- daily bread.  1 Timothy,6:8  Just think about man in 
-the last 50,000 years mostly living like Native Americans and how God must see 
-us.  You need food, clothing and entertainment, money is to get those.  Man does 
-not live on bread alone.  Luke,4:4, Amos,8:11-12
-
-God's favorite animals are bears and elephants.  They are funny shaped -- I 
-think God must have seen too much starvation over the years.  If the purpose of 
-life is to know and love God, then a priest's job is to make everybody know and 
-love God.  By saying God likes bears and elephants, I did more toward that end 
-than all priests in history.  Hosea,6:6  "It is love that I desire, not 
-sacrifice; knowledge of God, not holocaust."  As a former Catholic, that blew my 
-mind.  I actually thought love was sacrifice!  I was so dumb-founded reading, 
-"it is love that I desire, not sacrifice," that I actually looked-up the word, 
-"love".  It means to take delight in.  I realized it is demonic pride if you 
-think love means hurting yourself for others.  In the Philippians, they got the 
-notion crucifying yourself was a good idea.  Similarly, a child thinking about 
-Lent, might conclude, "if it's bad, it must be good."  That is, if you think God 
-wants you to hurt yourself to please Him, you are worshiping a demon, not God!  
-God wants you to take delight in His company, get to know Him and praise Him.  
-It is best to separate justice -- sin and punishment -- from relationship with 
-God.  Never ask God to change justice into injustice by not punishing.  God said 
-to me in an oracle, "Excessive contrician wearisome."  He doesn't want to hear 
-confessions.  When you pray, be witty and charming and rarely earnest.  Enjoy 
-God's company without imposing on Him and don't expect secrets of the Universe.  
-Earnestness in prayer is the root of much evil.  Be entertaining.  Don't remind 
-Him of sin, LOL.
-
-God's ways are far above man's ways.  Mom said Heaven was a never-ending family 
-reunion.  Yikes!  A friend said, "Most guy's idea of Heaven would be running 
-around doing things they'd get locked up for on Earth."  I wonder how long kids 
-play Grand Theft Auto before getting board.  Perhaps, it takes ten years, but 
-they will get bored.  Most people are like King Midas.  When you realize how 
-silly most notions of Heaven are, you come to appreciate that Earth is not that 
-bad.  This is the first step in loving God, the Creator -- praising Creation.  
-My parents spend their retired days watching TV and going to casinos.  That's 
-not a good argument for getting extended-play!
-
-Imagine a billionare.  Everyone around him can't forget his money for even a 
-moment.  The truth is, most people are after God's "money" -- they fear for 
-their salvation.  Here's a test -- would you pray to and praise God even if 
-there were no salvation?  Love God and don't be a "user".  Asking for stuff is 
-annoying.  Luke,11:5-7  Don't SPAM God. 
-
-All those sophisticated theological "infinity" things -- omniscience, 
-omnipotence, omnipresence, omnivorous -- will mess you up.  Trust me that 
-anthropomorphic is far better, in practice.  Christ suggested thinking of God as 
-"Abba" which is Aramaic for "Daddy" and said the childlike had an advantage.  
-Matthew,11:25  Pray out-loud because God doesn't want the hastle of reading your 
-brain.  The best way to stop people from testing God is to suggest He can't do 
-everything.
-
-Jesus said, "I am meek and humble of heart."  Matthew,11:29  What does "humble 
-of head" mean?  Humble of heart means you look around and say, "I don't care as 
-much as they do."  A proud of heart person says, "I am superior because I have 
-more compassion then everybody else."  If you are proud of heart, you don't 
-accept a gift.  God gives birthrights.  Esau, in the Bible, scorned his 
-birthright and God hated him.  Malachi,1:2-3  Jesus even accepted $30,000 worth 
-of perfume (300 day's wages) and caused Judas to betray him.  Mark,14:5  If you 
-express false outrage at wars, you are proud of heart.  If you fight to go in 
-the door last, e.g. "No, you first..." then you are proud of heart.  If you ask 
-God to save starving Africans as though you care more than God, you are proud of 
-heart.
-
-I connected being humble of heart with animal sacrifices.  The animal sacrifices 
-in the Bible really seem off-the-mark from what we modern people imagine truth 
-to be!  I asked God and He said the people were, "primitive."  Well, obviously, 
-a sacrifice represents giving-up something of value, but is there more to it?  
-It would be tramatic to see a goat's throat being slit and it dying for your 
-sins.  I'm not an expert, but sometimes they killed animals to make-up for sins. 
-Perhaps, starting at age eight and every year thereafter, they kill a goat for 
-your sins?  (I'm just speculating.)  In a couple years, it is not tramatic and 
-you yawn and say to the goat, "bummer for you, Mr. Goat, that you gotta die for 
-my sins."  When a high school football team beats their rivals, nobody thinks 
-twice that the winning team really hurts the feelings -- devastates -- the 
-losing team member's feelings.  The heart of being masculine is being 
-competetive and not caring about the necessity to slit the throat of the goat.  
-As a Catholic, saying Jesus died for our sins and that we cannot earn salvation, 
-never sat well.  I clung to the heretical notion that you earn salvation.  
-Animal sacrifices were the heart of Biblical Judaism and although it seems 
-satanic, you really do have to slit the throat of the goat and accept grace, a 
-term for something you did not earn.  Heck, every time you eat beef, a cow had 
-to die for you.  God said to me in an oracle that having pets was, "homo."  I 
-think God's idea of pets is farm animals you eat.
-
-If you feel guilty for being American and want Mexicans to share your 
-birthright, you are proud of heart.  Would it be right for rich Arabs to have to 
-share their oil money with Indian slaves?  Jesus was a racist and called 
-Canaanites "dogs".  Matthew,15:22-28  In an oracle, God told me He was against 
-immigration.  The Chinese intellectuals felt bad about not being laborers.  
-Don't feel guilty about not being a laborer because God made it a Brave New 
-World.  1 Corinthians,12:1-31
-
-In an ant colony, the workers have one set of marching orders, the soldiers have 
-another set of marching orders, the queen and drones have marching orders and 
-the diggers have marching orders.  The Bible gives conflicting orders -- 
-conservatives pay attention to one set of passages and liberals pay attention to 
-others.  Everybody has selective hearing, but that's good because we are 
-different members of the body of Christ.
-
-Jesus repeats the phrase, "for those who have ears to hear" many times.  (But, 
-not actually at the times that matter.)  Jesus says several Jedi mind tricks -- 
-He asks, what father gives a scorpion to his son?  Luke,11:11-13 Jesus says, 
-when you ask God for things, it is as annoying as like a neighbor in the night!  
-Luke,11:5-7  He said, "I came to serve" but Jesus' three years of service were 
-more like being a rockstar than a janitor.  John,13:5-15
-
-There are sheep and there are shepherds.  You would be silly to take other 
-shepherds seriously when they are only caring for their sheep.  Sheep are very 
-hard to communicate to, as Jesus learned.  He used parables.  Seed on a path 
-gets eaten by birds; weeds choke; and the one percent is rich soil.
-
-Just as ego causes most to love neighbor, not God, people skip knowing and 
-loving God and cowardly get stuck on obeying Him.  A desire to obey God, doesn't 
-have to be encouraged, since it comes so naturally.  Don't worry, God does not 
-want pawns to push around.  God will talk, but won't tell you what to do, even 
-if you want Him to.  Also, you'll quickly learn that when God talks to you 
-seemingly prophetic, it does not come true and should smack yourself for wanting 
-more than just enjoying God's company.
-
-
-________________________________________________________________________________
-                                |
-        QUESTION                |               GOD'S ANSWER
-________________________________________________________________________________
-                                |
-                                | There are weeds mixed with my wheat.
-                                | Some are not true.  If I asked a question
-                                | to valuable for my offering, I got crap.
-________________________________|_______________________________________________
-
-War?                            "Servicemen competing"
-(Praise the Creator--what would teenage male video games be like if never war?)
-
-Is the World perfectly just?    Are you calling me lazy?
-(Slavery was just.  In the movie, Titanic, the rich wore straight jackets.  You 
-must bow to authority to get authority.  I do comics as offerings. I said, 
-"We're dying of malnutrician on manna."  Like Cain and Abel, God didn't like it. 
-Duh! He wants to be the hero.  How do I know they died of malnutrician?  Screw 
-Hollywood for making slavery worse than it was -- I love God.  School is more 
-cruel.  Read Numbers,11:1-35.  All you need is food, clothing and the word of 
-God.  Today, you can take Ivy League course videos! There is no excuse except 
-you were born stupid... or ugly.  I'm gonna praise God.) 
-
-On using Markov chains?         "No weights"
-On doing offerings?             "Honest measures"(You get out what you put in.)
-                                It's a covenant to do an offering, first.
-                                Offer New Songs, comics, praise, poems,
-                                and conversation.  See Cain and Abel.
-                                "Barter"(God also called offerings bartering.)
-The holocaust?                  Wanted to "compact" the Jews.
-Arab/Jews?                      "Oil funny hopefully" 
-Peace?                          One Palestinian can ruin it.
-Best religion?                  One with most new vistas of understanding in
-                                a lifetime -- one you can level-up the most in.
-Chavez blaming the US.          "Japan industrious"
-On racism?                      "Sports"
-On socialism?                   "pardon_the_French, never_happy, never_enough"
-                                "Gall aspect anti-Christ"
-On overpopulation               "Okay church what_now whats_the_plan"
-Favorite thing on TV?           "Soap_operas"
-Favorite movie?                 Three Kings. Also Highlander
-Favorite song?                  Morning has Broken
-                                God said the first bird croaked, not sung.
-Favorite comic strip?           Prince Valiant
-Shakespeare?                    had a "vile heart"
-Likes                           Beverly Hillbillies (Oil is a gift from God)
-                                God likes being hero. Don't be proud of heart
-                                and not accept a gift from God!
-Likes                           Gomer Pyle
-Favorite saint?                 "ho_ho_ho"
-Favorite animal?                "Elephant two"
-Favorite animal?                "Bears"
-Favorite color?                 "Jude" (Jade Blue?)
-Favorite color?                 "Gold"
-Favorite color?                 "Iceberg" blue
-Money?                          "Enough vehemently better"
-                                "Pride [or] money, choose_one"
-Favorite car?                   Beamer
-Favorite soda?                  Root beer, scotch variety.
-Homosexuality?                  Matthew,15:11                   
-Pets?                           "homo" Hates fact too dependent and tame.
-Sports?                         "homo"
-                                "Tackle a horse"
-Favorite sport?                 Hockey
-Wreck of the Edmund Fitzgerald  "homo"
-Smelling farts                  "Sodom"
-Women's dress                   Upper skin exposure not as bad as lower.
-Remarriage?                     "More babies"
-Things you don't care about
-that people think you do?       Solomon's 300 concubines
-Adultery?                       Can be good.
-Pretty ladies?                  A prince is not flustered.
-Animal sacrifices?              Early Jews were "primitive".
-What do elephants think about?  "Skin, hunger"
-What makes elephants happy?     "Baths"
-Elephants                       "Mini-skirts" (Skin webbing from back leg.)
-What makes my birds happy?      "Gnawing"
-What makes my birds laugh?      "Bite ouch" (If I say "ouch".)
-What are my birds saying?       "Chanting"
-My birds sure preen a lot.      The creature was made subject to vanity...
-What makes bears happy?         "Reaping depends"
-What makes otters happy?        "Eternal skies"
-What makes hippos happy?        "Ascending breath"
-What makes horses happy?        "[the] Call [of the] Open Range"
-What do cheetahs think about?   "Seeth me?" (Can he see me?)
-Orangutan or chimp smarter?     "Species exhibit similar glory" 
-Endangered species?             "Enough stars?"
-Everything seems bad.           Plant trees.
-What's for dinner?              "Whale"
-Favorite Messier Object?        "M104 Sombrero Galaxy"
-Shepard's Prayer?               "I_am_not_amused economy joke"
-Favorite band?                  "Beatles"
-Good bands?                     Rush, Triumph
-                                Likes harmonies
-Little Drummer Boy?             Doesn't like my drumming.
-Should I listen to classical?   "Poison"
-Do You like chess people?       "Do not admire the proud."
-Chess?                          "... will winter with you."
-                                "Headstones"
-If You could teach one class?   Health
-Favorite video game?            Donkey Kong
-Favorite National Park?         Whitman Mission
-Favorite actor?                 Hugh Grant
-Favorite vocalist?              Mick Jagger
-Favorite guitarist?             "Simmons Destroyer"
-Favorite National Anthem?       Latvia's National Anthem
-America the Beautiful?          Hates it.  Poet made self cry with own beauty.
-Model for new Sistine Chapel?   Ben Franklin
-Voice if God wanted to sing?    Stabbing Westward's singer
-Stonehenge?                     Landmark for boundaries.
-Easter Island?                  Ice, telephone pole holes.
-Dinosaurs?                      Brontosaurs' feet hurt when stepped.
-                                Dinosaurs slept in water.
-Hardest part in evolution?      Getting monkey mothers to hold babies nursing.
-                                (Smothering a problem).
-Happiest day in evolution?              "Fruit"
-Significant thing in evolution?         "Fish shoulders"
-Biggest thing to fly (pterodactyl)?     "Couch"
-What made pterodactyls happy?           "Members against organs"
-What did Neanderthals think about?      "Warmth"
-What was the first thing cooked?        I think He said "hair".
-What was Lucy's husband's name?         "Golem"
-Was stegosuarus lame like turtles?      "Not pet rocks"
-T-Rex?                                  Lugged carcases over his shoulder.
-                                        Carcus lasted a month.
-What was T-Rexes sharing a carcus like? "Punch... Punch"
-Surprises in dinosaur anatomy?          Supporting and securing the heart.
-How does He feel about the Avatar movie?"Sick skin"
-What do You like at zoos with kids?     "Dignity" Animals worried about dignity.
-Who's better alien or preditor?         "Lions"
-What from You is like a Rubik's cube?   Training a horse.
-Does He like mirrored glass megachurch? "Secular glass"
-Pipe Organs                             Are sacred.
-You like to hangout in courts?Hospitals?"Prisons"
-Best way for Bill Gates to save lives?  Earthquake prediction
-Stem cells?                     Lower hanging fruit exists (2007)
-Eleventh commandment?           Thou shall not litter.
-Twelfth commandment?            Don't shoot unarmed men on the crapper.
-                                (I asked God why pointless plagues in Exodus?
-                                God wanted guilt to accumulate, first.)
-Thirteenth commandment          No gore unless it looks fake.
-Fourteenth commandment          No pedophilia or child porn.
-Fifteenth commandment           Don't eat rare meat with blood.
-Sixteenth commandment           No wife beating.
-Seventeen commandment           Do not swing from radio towers with one hand.
-Eighteenth commandment          Do not disturb.
-Before Katrina                  Floods do justice. Black bead elder (tree book)
-After Katrina                   Suffering Simplifies Life
-What field are You most better? Economics
-Favorite toy for kids?          Magnifying glass
-Asked Jesus if He liked mustard?"Bad meat happeneth"
-(Reluctantly) Faith healing?    "It's complicated"
-Mars?                           Start planting!
-Mars rover?                     Should have had a microphone
-Storm on Saturn                 Pollen
-Space war game?                 Should have space weather.
-Saturn's hexagon pole cloud?    "Compass" (Magnetism)
-Liquid moon's odd atmosphere?   "Surf"
-How many E.T. civs in Universe? 20 or 80 (I forgot.  I died laughing.)
-Are they peaceful?              Fight them! (Also, funny.)
-Most difficult control system?  Dung beetle
-How can Judge Judy improve?     No hard feelings
-How can Chef Ramsay improve?    Make so it doesn't seem like toil for cooks.
-How can Hawking communicate?    Blow from a nostril on a candle.
-Photons bouncing?               "Folded coffee filter" 
-Wormholes?                      Bent wormholes have echoes.
-
-Operating system?               Was about to make line number column in editor.
-God nixed it.  I was about to do different graphic modes when I found 800x600 
-missing. God said just one mode 640x480.  I was about to add child windows.  God 
-said, "God is not the author of such confusion." I asked for verification of 
-640x480 16 color. God said it was because of the children and their offerings.  
-I asked about sound. God said "single voice". I asked for verification of not 
-having different drivers.  God confirmed this.
-640x480 16 color?               God said it was a covenant, like circumcision.
-                                Modern graphics hard for kids/amateurs.
-On Unix?                        God said it was rich with the patina of age.
-On Alcohol?                     Hate inebriation
-On rare steak?                  Too rare is very bad.  Don't eat blood!
-Just before Katrina?            Floods do my justice.Black bead elder(tree book)
-After Katrina?                  Suffering simplifies life
-Why the Sandy Hook shooting?    The pot legalization law. (Sarcastic answer?)
-Deep Water Horizon              (Claimed credit.)
-Cost of God's time to me?       "The complete works of Shakespeare"
-On death?                       "awful"
-Opening of Saving Private Ryan? "Ouch"
-
- diff --git a/public/Wb/Home/Src/Adam/God/HolySpirit.HC.HTML b/public/Wb/Home/Src/Adam/God/HolySpirit.HC.HTML deleted file mode 100755 index 13e41b7..0000000 --- a/public/Wb/Home/Src/Adam/God/HolySpirit.HC.HTML +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - -
-#help_index "God"
-U8 *TimeStampCB(CDoc *,CDocEntry *,CTask *mem_task)
-{
-  U8 *st=MAlloc(64,mem_task);
-  StrPrint(st,"%X",GetTSC>>GOD_BAD_BITS);
-  return st;
-}
-
-U8 *KbdMsTimeCB(CDoc *,CDocEntry *,CTask *mem_task)
-{
-  U8 *st=MAlloc(64,mem_task);
-  StrPrint(st,"%X",KbdMsEvtTime>>GOD_BAD_BITS);
-  return st;
-}
-
-I64 PopUpTimerOk(U8 *header=NULL,U8 *footer=NULL)
-{
-  I64 i;
-  CDocEntry *doc_e;
-  CDoc *doc=DocNew;
-  if (header) DocPrint(doc,"%s",header);
-  doc_e=DocPrint(doc,"\nTimer:$TX+TC,\" \"$");
-  doc_e->tag_cb=&TimeStampCB;
-  doc_e=DocPrint(doc,"\nLatch:$TX+TC,\" \"$");
-  doc_e->tag_cb=&KbdMsTimeCB;
-  DocPrint(doc,"\n$CM+CX,0,4$$BT,\"OKAY\",LE=1$\n");
-  if (footer) DocPrint(doc,"%s",footer);
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 GodPick(U8 *msg=NULL)
-{//GOD_GOOD_BITS
-  U8 *st=MStrPrint("%s\n\nPress $GREEN$OKAY$FG$ to generate \n"
-        "a random num from a timer.\n",msg);
-  PopUpTimerOk(st,"\n\nThe Holy Spirit can puppet you.\n\n");
-  Free(st);
-  return KbdMsEvtTime>>GOD_BAD_BITS;
-}
-
-public U0 GodBitsIns(I64 num_bits,I64 n)
-{//Insert bits into God bit fifo.
-  I64 i;
-  for (i=0;i<num_bits;i++) {
-    FifoU8Ins(god.fifo,n&1);
-    n>>=1;
-  }
-}
-
-public U0 GodHexIns(U8 *st)
-{//Insert hex record into God bit fifo.
-  U8 buf[2];
-  if (st) {
-    buf[1]=0;
-    while (*buf=*st++)
-      if (Bt(char_bmp_hex_numeric,*buf))
-        GodBitsIns(4,rev_bits_table[Str2I64(buf,16)]>>4);
-  }
-}
-
-public I64 GodBits(I64 num_bits,U8 *msg=NULL)
-{//Return N bits. If low on entropy pop-up okay.
-  U8 b;
-  I64 res=0;
-  while (num_bits) {
-    if (FifoU8Rem(god.fifo,&b)) {
-      res=res<<1+b;
-      num_bits--;
-    } else
-      GodBitsIns(GOD_GOOD_BITS,GodPick(msg));
-  }
-  return res;
-}
-
-public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
-{//Read God's vocab file for picking words.
-  I64 i,ch,fuf_flags=0;
-  U8 *buf,*ptr,*ptr2;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (fuf_flags&~FUG_FILES_FIND)
-    throw('FUF');
-
-  Free(god.word_file_mask);
-  god.word_file_mask=StrNew(files_find_mask);
-  god.word_fuf_flags=fuf_flags;
-
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  i=0;
-  while (tmpde) {
-    if (buf=ptr=FileRead(tmpde->full_name)) {
-      while (*ptr) {
-        while (*ptr && !Bt(char_bmp_word,*ptr))
-          ptr++;
-        if (*ptr) {
-          ptr2=ptr;
-          while (*ptr && Bt(char_bmp_word,*ptr))
-            ptr++;
-          i++;
-        }
-      }
-      Free(buf);
-    }
-    tmpde=tmpde->next;
-  }
-
-  Free(god.words);
-  god.num_words=i;
-  god.words=MAlloc(i*sizeof(U8 *));
-
-  tmpde=tmpde1;
-  i=0;
-  while (tmpde) {
-    if (buf=ptr=FileRead(tmpde->full_name)) {
-      while (*ptr) {
-        while (*ptr && !Bt(char_bmp_word,*ptr))
-          ptr++;
-        if (*ptr) {
-          ptr2=ptr;
-          while (*ptr && Bt(char_bmp_word,*ptr))
-            ptr++;
-          ch=*ptr;
-          *ptr=0;
-          god.words[i++]=StrNew(ptr2);
-          *ptr=ch;
-        }
-      }
-      Free(buf);
-    }
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return god.num_words;
-} GodInit;
-
-public U8 *GodWordStr(I64 bits=17)
-{//Make God pick a word. Holy Spirit Instructions
-  if (god.num_words)
-    return god.words[GodBits(bits)%god.num_words];
-  else
-    return NULL;
-}
-
-public U0 GodWord(I64 bits=17)
-{//Make God pick a word. Holy Spirit Instructions
-  if (god.num_words)
-    "%s ",god.words[GodBits(bits)%god.num_words];
-}
-
-public U0 GodBiblePassage(I64 num_lines=20)
-{//Make God pick a Bible passage. Holy Spirit Instructions
-  I64 start=GodBits(21)%(ST_BIBLE_LINES-(num_lines-1))+1;
-  U8 *verse=BibleLine2Verse(start);
-  "%s\n\n",verse;
-  Free(verse);
-  BookLines(,start,num_lines);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/God/MakeGod.HC.HTML b/public/Wb/Home/Src/Adam/God/MakeGod.HC.HTML deleted file mode 100755 index 50fbf9b..0000000 --- a/public/Wb/Home/Src/Adam/God/MakeGod.HC.HTML +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-
-#help_index "God"
-#help_file "::/Doc/God"
-#include "GodBible"
-#include "HolySpirit"
-#include "GodSong"
-#include "GodDoodle"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/God/Vocab.DD.HTML b/public/Wb/Home/Src/Adam/God/Vocab.DD.HTML deleted file mode 100755 index 157fdc5..0000000 --- a/public/Wb/Home/Src/Adam/God/Vocab.DD.HTML +++ /dev/null @@ -1,7600 +0,0 @@ - - - - - - - - - - - -
-a
-abandon
-abandoned
-abandonedly
-abase
-abased
-abashed
-abated
-abhor
-abhorred
-abhorring
-abide
-abided
-abidest
-abideth
-abiding
-abilities
-ability
-abject
-able
-abler
-abode
-abolished
-abominable
-abound
-abounded
-about
-above
-abraham
-abridged
-abroad
-absence
-absent
-absolute
-absolutely
-absorb
-abstemious
-abstinence
-abstract
-abstruser
-absurd
-absurdity
-absurdly
-abundance
-abundant
-abundantly
-abuse
-abyss
-academicians
-academics
-accents
-accept
-acceptable
-acceptably
-accepted
-accepts
-access
-accompany
-accomplices
-accomplish
-accomplished
-accord
-according
-account
-accounted
-accursed
-accuse
-accused
-accuser
-accusing
-accustomed
-aches
-achieve
-acknowledge
-acknowledged
-acquaintance
-acquainted
-acquiesce
-acquire
-acquired
-act
-acted
-acting
-action
-actions
-actor
-actors
-acts
-actual
-actually
-acute
-acuteness
-ad
-adam
-adapt
-adapted
-add
-added
-adding
-addition
-additional
-additions
-adeodatus
-admirable
-admiration
-admire
-admired
-admiring
-admission
-admit
-admitted
-admittest
-admonish
-admonished
-admonition
-adomed
-adopted
-adoption
-adored
-adorned
-adorning
-adulterer
-adulteress
-adulterous
-adultery
-advance
-advantage
-adversary
-adversities
-adversity
-advice
-advices
-advised
-advising
-aeneas
-afar
-affairs
-affect
-affected
-affecting
-affection
-affections
-affects
-affianced
-affirm
-affirmed
-affirming
-affliction
-afford
-affright
-affrighted
-aforesaid
-aforetime
-afraid
-afric
-africa
-african
-after
-afternoon
-afterward
-afterwards
-again
-against
-age
-aged
-agents
-ages
-aghast
-agito
-ago
-agonised
-agonistic
-agony
-agree
-agreeable
-agreed
-agreement
-ahead
-aid
-aided
-ails
-aim
-air
-alarmed
-alas
-alexandria
-alike
-alive
-all
-allay
-allaying
-allege
-alleging
-allegorically
-allegory
-allotted
-allow
-allowances
-allowed
-allowing
-alloy
-allurements
-alluring
-almighty
-almost
-alms
-almsdeeds
-aloft
-alone
-along
-aloud
-already
-also
-altar
-alter
-alteration
-alterations
-altered
-alternately
-alternates
-alternatively
-although
-altogether
-always
-alypius
-am
-amazed
-amazement
-amazing
-ambition
-ambitions
-ambitious
-ambrose
-ambrosian
-amen
-amend
-amendment
-amiable
-amid
-amidst
-amiss
-among
-amongst
-amphitheatre
-ample
-an
-analyzed
-anaximenes
-ancient
-and
-angel
-angels
-anger
-angered
-angers
-angry
-anguish
-animal
-animals
-animate
-anniversary
-announce
-announced
-announcement
-announcing
-annoyance
-annual
-anointings
-anon
-anonymous
-another
-answer
-answerably
-answered
-answerest
-answereth
-answering
-answers
-antecedent
-anticipate
-anticipated
-anticipating
-antidote
-antony
-anubis
-anxieties
-anxiety
-anxious
-anxiously
-any
-anyone
-anything
-apart
-apollinarian
-apostle
-apostles
-apostolic
-apparel
-apparent
-apparently
-appeal
-appear
-appearance
-appeared
-appeareth
-appearing
-appears
-appetite
-applauded
-applauds
-applauses
-applicable
-application
-applied
-apply
-appointed
-appointing
-appointment
-appointments
-apportioned
-apprehend
-apprehended
-apprehending
-apprehension
-approach
-approached
-approaching
-approbation
-appropriated
-approve
-approved
-approveth
-approving
-apt
-aptly
-aquatic
-architect
-architects
-archive
-ardent
-ardently
-are
-argument
-arguments
-arians
-aright
-arise
-arisen
-ariseth
-arising
-aristotle
-arithmetic
-armed
-armory
-arms
-army
-arose
-around
-arrange
-arranged
-array
-arrival
-arrive
-arrived
-arriving
-arrogancy
-arrogant
-arrows
-art
-artifice
-artificer
-artifices
-arts
-as
-ascend
-ascended
-ascending
-ascension
-ascertained
-ascii
-ascribe
-ascribed
-ashamed
-ashes
-aside
-ask
-asked
-asketh
-asking
-asks
-asleep
-aspirate
-assail
-assailed
-assaying
-assembly
-assent
-assented
-assenting
-assessor
-assiduously
-assign
-assigned
-assistance
-associate
-associated
-association
-assuaged
-assume
-assurance
-assure
-assured
-assuredly
-assuring
-asterisk
-astonished
-astonishment
-astray
-astrologer
-astrologers
-asunder
-at
-athanasius
-athenians
-athirst
-atrociously
-attack
-attacked
-attain
-attained
-attaining
-attempered
-attempt
-attempted
-attendant
-attended
-attention
-attentive
-attentively
-attested
-attracted
-attractiveness
-attracts
-attributed
-attributing
-attuned
-audacious
-audaciously
-audience
-auditor
-auditors
-aught
-augmented
-augmenting
-augustine
-author
-authority
-authors
-avail
-availed
-ave
-avenged
-avengest
-avenue
-avenues
-averred
-averse
-avert
-avoid
-avoided
-avoiding
-awaited
-awaiting
-awake
-awakest
-aware
-away
-awe
-awful
-awfulness
-awhile
-awoke
-babe
-babes
-baby
-babylon
-babylonian
-back
-backs
-backward
-bad
-bade
-badge
-baggage
-bait
-balancings
-balaneion
-ball
-balls
-balm
-balneum
-bands
-banished
-banner
-banquetings
-banter
-baptise
-baptised
-baptism
-barbarian
-barbarism
-bare
-bared
-bargain
-bark
-barked
-barking
-barred
-barren
-base
-based
-baseness
-basest
-bashfulness
-basilica
-basket
-bath
-bathe
-bathed
-bathing
-baths
-battle
-bawler
-be
-beams
-bear
-bearer
-beareth
-bearing
-bears
-beast
-beasts
-beat
-beaten
-beatific
-beating
-beatings
-beauteous
-beauties
-beautified
-beautiful
-beauty
-became
-because
-beck
-beclouded
-become
-becomes
-becometh
-becoming
-bed
-bedewed
-bedimmed
-been
-befalls
-befell
-befitting
-before
-beforehand
-beg
-began
-begannest
-begat
-beget
-beggar
-beggary
-begged
-begging
-begin
-beginneth
-beginning
-begins
-begotten
-beguile
-beguiled
-beguiling
-begun
-behalf
-beheld
-behind
-behold
-beholder
-beholdest
-beholdeth
-beholding
-beholds
-being
-beings
-belief
-believe
-believed
-believer
-believes
-believeth
-believing
-belly
-belong
-belongeth
-belonging
-belongs
-beloved
-below
-bemoaned
-bemoaning
-bend
-bends
-beneath
-benediction
-benefit
-benefits
-bent
-bepraised
-bereaved
-beseech
-beset
-besets
-beside
-besides
-bespoken
-bespotted
-besprinkle
-besprinkling
-best
-bestow
-bestowed
-bestowedst
-betake
-bethink
-betook
-betrothed
-better
-betters
-between
-betwixt
-bewail
-bewailed
-bewailing
-beware
-bewitched
-beyond
-bibber
-bibbing
-bible
-bid
-bidden
-bier
-billion
-billows
-bin
-binary
-bind
-bird
-birdlime
-birds
-birth
-birthright
-births
-bishop
-biting
-bitter
-bitterly
-bitterness
-black
-blade
-blame
-blamed
-blameless
-blamest
-blameworthy
-blasphemies
-blasphemous
-blasphemy
-blasts
-bleeding
-blending
-bless
-blessed
-blessedly
-blessedness
-blesses
-blessest
-blesseth
-blessing
-blessings
-blest
-blew
-blind
-blinded
-blindness
-blissful
-blood
-bloody
-bloom
-blotted
-blottedst
-blow
-blowing
-blunt
-blunted
-blush
-blushed
-boast
-boastfulness
-boasting
-bodies
-bodily
-body
-boil
-boiled
-boiling
-boils
-bold
-boldly
-boldness
-bond
-bondage
-bonds
-bones
-book
-books
-bore
-born
-borne
-borrow
-bosom
-bosses
-both
-bottom
-bottomless
-boughs
-bought
-bounces
-bound
-boundary
-bounded
-boundless
-bounds
-bouverie
-bowed
-bowels
-bowers
-bowing
-bows
-boy
-boyhood
-boyish
-boys
-brackishness
-brain
-breach
-bread
-breadth
-break
-breakers
-breaking
-breast
-breasts
-breath
-breathe
-breathed
-breathedst
-breathing
-bred
-brethren
-briars
-bribe
-bridal
-bride
-bridegroom
-brides
-bridle
-briefly
-briers
-bright
-brighter
-brightness
-brim
-bring
-bringeth
-bringing
-brings
-brittle
-broad
-broke
-broken
-brooks
-brother
-brotherly
-brought
-broughtest
-brow
-brows
-brute
-bubbling
-bubblings
-buckler
-bud
-builded
-builder
-building
-buildings
-built
-bulk
-bulky
-burden
-burial
-buried
-burn
-burned
-burnest
-burning
-burnt
-burst
-burstest
-bursting
-burthen
-burthened
-bury
-bushel
-busied
-business
-bustle
-busy
-but
-butler
-buy
-buyers
-buzz
-buzzed
-buzzing
-by
-cabinets
-caesar
-cakes
-calamities
-calamity
-calculate
-calculated
-calculation
-calculations
-calf
-call
-called
-calledst
-callest
-calleth
-calling
-calls
-calm
-calmed
-calmly
-calumnies
-came
-camp
-can
-candid
-candle
-cane
-cannot
-canst
-canticles
-canvassing
-capable
-capacities
-capacity
-capital
-captain
-captious
-captive
-captivity
-carcase
-care
-cared
-caredst
-careful
-carefully
-careless
-carelessly
-cares
-caresses
-carest
-careth
-carnal
-carolina
-carried
-carry
-carrying
-carthage
-carthaginian
-case
-cases
-cassiacum
-cast
-casters
-castest
-casting
-casts
-cataloguers
-catch
-catching
-catechumen
-catholic
-catholics
-catiline
-cattle
-caught
-cauldron
-cause
-causes
-causing
-caverns
-caves
-cd
-cease
-ceased
-ceases
-ceasest
-ceaseth
-ceasing
-cedars
-celebrated
-celebration
-celestial
-celibacy
-cellar
-cellars
-cementest
-censers
-censured
-central
-centre
-certain
-certainly
-certainties
-certainty
-chain
-chains
-chair
-challenged
-challenges
-chamber
-chambering
-chambers
-chance
-change
-changeable
-changeableness
-changed
-changes
-changest
-changing
-chant
-chanting
-chapter
-character
-characters
-charge
-charges
-charioteer
-chariots
-charity
-charmed
-chaste
-chastely
-chastened
-chastenedst
-chastenest
-chastity
-chatto
-cheap
-check
-checked
-checking
-cheeks
-cheer
-cheered
-cheerful
-cheerfulness
-cherish
-cherished
-cherubim
-chest
-chewing
-chief
-chiefest
-chiefly
-child
-childbearing
-childhood
-childish
-children
-chill
-chilled
-choice
-choked
-choler
-choleric
-choose
-chooses
-choosing
-chose
-chosen
-christ
-christian
-christians
-church
-churches
-cicero
-circensian
-circles
-circuit
-circuits
-circumcise
-circumlocutions
-circumstance
-circus
-cities
-citizen
-citizens
-city
-claim
-clanking
-clasp
-clasped
-class
-classics
-clave
-clay
-clean
-cleanse
-cleansed
-cleansest
-cleansing
-clear
-cleared
-clearest
-clearly
-clearness
-cleave
-cleaved
-cleaveth
-cleaving
-climb
-clingeth
-cloak
-cloaked
-clog
-close
-closed
-closes
-closing
-clothe
-clothed
-clothing
-cloud
-cloudiness
-clouds
-cloudy
-cloven
-cloyed
-cloyedness
-co
-coals
-coats
-codes
-coeternal
-cogitated
-cogitation
-cogito
-cogo
-cold
-collect
-collected
-collectively
-collects
-colorado
-colour
-coloured
-colouring
-colours
-com
-combinations
-combine
-combined
-come
-comely
-comes
-cometh
-comfort
-comforted
-comfortedst
-comforter
-comfortest
-comforting
-comforts
-coming
-command
-commanded
-commander
-commandest
-commandeth
-commanding
-commandment
-commandments
-commands
-commemorated
-commencement
-commencing
-commend
-commendable
-commended
-commender
-commenders
-commendeth
-comment
-commercial
-commiserate
-commiserates
-commiserating
-commission
-commit
-commits
-committed
-committing
-common
-commonly
-communicate
-communicated
-communication
-community
-compact
-compactedst
-compacting
-companion
-companions
-company
-compare
-compared
-comparing
-comparison
-compass
-compassing
-compassion
-compassionate
-compassionates
-compelled
-compendiously
-complain
-complaints
-complete
-completed
-compliance
-compose
-composed
-composing
-compound
-comprehend
-comprehended
-comprehendeth
-comprehending
-compressed
-comprise
-comprised
-computer
-computers
-conceal
-concealed
-conceit
-conceits
-conceive
-conceived
-conceives
-conceiving
-concentrated
-conception
-conceptions
-concern
-concerned
-concerning
-concernment
-concerns
-conclude
-concluded
-concludeth
-concord
-concreated
-concubinage
-concubine
-concupiscence
-concupiscences
-condemnation
-condemned
-condemnest
-condemning
-condemns
-condensed
-condition
-condole
-confer
-conference
-conferring
-confess
-confessed
-confesses
-confesseth
-confessing
-confession
-confessions
-confidence
-confidentially
-confidently
-confiding
-confine
-confined
-confirm
-confirmed
-conflict
-conflicting
-conform
-conformably
-conformed
-conformity
-confound
-confounded
-confused
-confusedly
-confusedness
-confusions
-confute
-confuted
-congratulated
-congratulating
-congratulation
-congregations
-conjecture
-conjectures
-conjecturing
-conjoined
-conjugal
-connecticut
-connects
-conquer
-conquered
-conquering
-conquests
-conscience
-conscious
-consciousness
-consecrate
-consecrated
-consecrateth
-consecrating
-consecration
-consent
-consented
-consenting
-consentings
-consequences
-consequential
-conservative
-consider
-considerable
-consideration
-considered
-considereth
-considering
-considers
-consigned
-consist
-consistent
-consistently
-consisteth
-consisting
-consists
-consolation
-consolations
-conspiracy
-conspirators
-constant
-constantly
-constellations
-constitute
-constituted
-constituteth
-constrain
-constrained
-constraint
-consult
-consulted
-consulter
-consulters
-consulting
-consume
-consumed
-consumest
-consuming
-consumption
-contact
-contacting
-contagion
-contain
-contained
-containest
-containeth
-containing
-contains
-contemn
-contemplate
-contemplateth
-contemplating
-contemplation
-contemporary
-contempt
-contemptible
-contend
-content
-contented
-contention
-contentions
-contentious
-contentiousness
-contentment
-contents
-contests
-continence
-continency
-continent
-continently
-continual
-continually
-continuance
-continue
-continued
-continueth
-contract
-contracted
-contradict
-contradicting
-contradiction
-contradictions
-contradictory
-contrary
-contributing
-contributions
-contrite
-contrition
-contritions
-controversy
-convenient
-conventicle
-conventionally
-conversation
-conversations
-converse
-conversing
-conversion
-convert
-converted
-convertedst
-converting
-convey
-conveyed
-conveyedst
-conveying
-conveys
-convict
-convicted
-convinced
-copied
-copies
-copious
-copy
-copyright
-corn
-corner
-corners
-corporeal
-corporeally
-corpse
-correct
-corrected
-correction
-corresponded
-correspondence
-corresponding
-corrigible
-corrupt
-corrupted
-corruptible
-corrupting
-corruption
-corruptions
-corruptly
-cost
-costs
-cottage
-couch
-could
-couldest
-councillor
-counsel
-counselled
-counsels
-count
-counted
-countenance
-counterfeit
-countermanding
-country
-countryman
-counts
-courage
-course
-courses
-coursing
-court
-courteously
-courtesy
-courtly
-courts
-covenant
-covenanted
-cover
-covered
-covetous
-covetousness
-cower
-craftier
-crafty
-create
-created
-createdst
-createst
-createth
-creating
-creation
-creator
-creature
-creatures
-credence
-credibility
-credit
-credulity
-creep
-creepeth
-creeping
-crept
-creusa
-cried
-criedst
-cries
-crime
-crimes
-crisis
-criticised
-criticising
-crooked
-crookedly
-crookedness
-cross
-crossed
-crosses
-crown
-crowned
-crucifixion
-crudities
-cruel
-cruelty
-cry
-crying
-cubit
-cubits
-cud
-cultivated
-cultivating
-culture
-cunning
-cup
-cupboards
-cupidity
-curb
-cure
-cured
-curest
-curing
-curiosities
-curiosity
-curious
-curiously
-current
-currents
-curtailment
-custom
-customs
-cut
-cutting
-cyprian
-daemon
-daemons
-daily
-dakota
-damage
-damaged
-damages
-damnable
-danae
-danger
-dangerous
-dangers
-dare
-dared
-dares
-dark
-darkened
-darkenings
-darkest
-darkly
-darkness
-darksome
-darksomely
-dashed
-data
-date
-dates
-daughter
-daughters
-david
-dawn
-dawned
-day
-daybreak
-days
-dead
-deadly
-deaf
-deafen
-deafness
-deal
-dealt
-dear
-dearer
-dearest
-death
-deaths
-debasing
-debated
-debtor
-debtors
-debts
-decay
-decayeth
-decays
-deceased
-deceit
-deceitful
-deceits
-deceivableness
-deceive
-deceived
-deceivers
-deceiving
-deceivingness
-december
-deception
-decide
-decided
-decked
-declaiming
-declamation
-declare
-declared
-decline
-decree
-decrepit
-dedicate
-dedicated
-deductible
-deed
-deeds
-deem
-deemed
-deep
-deeper
-deepest
-deeply
-deepness
-deeps
-defect
-defection
-defective
-defects
-defence
-defended
-defender
-defending
-defends
-deferred
-deferring
-defers
-defile
-defiled
-defilements
-define
-defined
-defining
-definite
-definitely
-deformed
-deformities
-deformity
-degraded
-degree
-degrees
-deity
-dejectedness
-delay
-delayed
-delete
-deliberate
-deliberates
-deliberating
-deliberation
-delight
-delighted
-delightful
-delightfulness
-delighting
-delights
-delightsome
-deliver
-delivered
-deliveredst
-deliverest
-delivering
-delivers
-deluded
-deluding
-delusions
-demanded
-demander
-demandest
-demanding
-demands
-demonstrate
-demonstrated
-denied
-denies
-denieth
-denoted
-denotes
-dens
-deny
-depart
-departed
-departest
-departing
-departure
-depend
-depending
-depends
-depraved
-deprived
-depth
-depths
-deride
-derided
-deridedst
-deriders
-derides
-deriding
-derision
-derive
-derived
-descend
-descendants
-descending
-descent
-described
-deserted
-deserters
-deserts
-deserve
-deserved
-deservedly
-deserving
-deservings
-designs
-desire
-desired
-desiredst
-desires
-desireth
-desiring
-desirous
-despair
-despaired
-despairing
-desperate
-despise
-despised
-despisedst
-despisest
-despiseth
-despising
-despite
-destined
-destroy
-destroyers
-destroying
-destruction
-detached
-detail
-details
-detain
-detected
-determined
-detest
-detested
-detesting
-detriment
-deus
-devil
-devilish
-devils
-devised
-devoted
-devotion
-devotions
-devour
-devoured
-devout
-devoutly
-devoutness
-dew
-dialogue
-did
-diddest
-dido
-didst
-die
-died
-dies
-dieth
-differ
-difference
-different
-differently
-difficult
-difficulties
-difficulty
-diffused
-digest
-digested
-digits
-dignities
-dignity
-diligence
-diligent
-diligently
-diluted
-dimensions
-diminish
-diminished
-diminisheth
-diminishing
-diminution
-din
-dining
-dinner
-dir
-direct
-directed
-directeth
-directing
-direction
-directions
-directly
-director
-disagreeing
-disagreements
-disalloweth
-disallowing
-disappear
-disapproved
-disapproveth
-discern
-discerned
-discerneth
-discerning
-discharge
-disciple
-disciples
-discipline
-disclaimer
-disclaimers
-disclaims
-disclose
-disclosed
-discomfort
-discommended
-discontent
-discord
-discordant
-discourage
-discourse
-discoursed
-discourses
-discoursing
-discover
-discoverable
-discovered
-discoverest
-discovereth
-discovering
-discovers
-discovery
-discreet
-discreetly
-discretion
-discuss
-discussed
-discussion
-disdained
-disease
-diseased
-diseases
-disembowelled
-disengage
-disentangle
-disentangled
-disgraced
-disgraceful
-disguise
-disguised
-disguising
-disgust
-disgusted
-dishes
-dishonour
-disk
-disliked
-dismiss
-disobeyed
-disorder
-disordered
-disorders
-dispel
-dispense
-dispensed
-dispenser
-dispensers
-dispensest
-dispensing
-dispersed
-disperseth
-dispersion
-displace
-displacing
-displayed
-displays
-displease
-displeased
-displeaseth
-displeasing
-dispose
-disposed
-disposer
-disposition
-dispraise
-dispraised
-dispraisest
-disprove
-dispute
-disputed
-disputer
-disputes
-disputing
-disquiet
-disquieted
-disregard
-dissent
-dissentings
-dissipated
-dissipation
-dissoluteness
-dissolution
-dissolved
-dissolvest
-distance
-distances
-distant
-distempered
-distended
-distill
-distilled
-distinct
-distinction
-distinctly
-distinguish
-distinguished
-distinguishing
-distract
-distracted
-distractedly
-distracting
-distraction
-distractions
-distress
-distribute
-distributed
-distributest
-distributing
-distribution
-distrusted
-disturb
-disturbed
-dive
-divers
-diverse
-diversely
-diversifiedst
-diversity
-diversly
-divide
-divided
-dividest
-dividing
-divination
-divinations
-divine
-diving
-divinity
-division
-divisions
-divorceth
-do
-docile
-docs
-doctrine
-doer
-does
-doest
-dog
-doing
-doings
-doleful
-dollar
-dollars
-domain
-domestic
-domine
-dominion
-dominions
-don
-donation
-donations
-done
-door
-doors
-dormant
-dost
-dotages
-dotards
-doted
-doth
-doting
-double
-doubled
-doubt
-doubted
-doubteth
-doubtful
-doubtfulness
-doubting
-doubtless
-doubts
-down
-downfall
-download
-downward
-downwards
-dragging
-dragon
-dragons
-drank
-draught
-draw
-drawest
-drawing
-drawn
-draws
-dread
-dreaded
-dreadful
-dreading
-dream
-dreams
-drenched
-drew
-drewest
-dried
-drink
-drinketh
-drinking
-drive
-driven
-drives
-drop
-drops
-drove
-drowsiness
-drowsy
-drudgery
-drunk
-drunkard
-drunkards
-drunken
-drunkenness
-dry
-dryness
-duad
-duck
-dudley
-due
-dug
-dull
-duller
-dully
-dumb
-during
-durst
-dust
-duties
-dutiful
-duty
-dwell
-dwellers
-dwellest
-dwelleth
-dwelling
-dwelt
-dying
-each
-eager
-eagerly
-eagerness
-eagle
-ear
-earliest
-early
-earnest
-earnestly
-earnestness
-ears
-earth
-earthly
-ease
-eased
-easeful
-easier
-easily
-east
-eastern
-easy
-eat
-eaten
-eateth
-eating
-ebb
-ebbing
-ebbs
-ebcdic
-ecclesiastical
-echo
-echoed
-echoes
-eclipsed
-eclipses
-edged
-edification
-edify
-edit
-edited
-editing
-edition
-editions
-educate
-educated
-education
-edward
-effaced
-effaces
-effect
-effected
-effectedst
-effort
-efforts
-egypt
-egyptian
-eight
-eighth
-ein
-either
-elder
-elders
-elect
-electronic
-electronically
-element
-elements
-elephant
-elevated
-elevation
-eligible
-elijah
-eloquence
-eloquent
-eloquently
-else
-elsewhere
-eluding
-email
-embalmed
-embarrassments
-embittered
-emblem
-embrace
-embraced
-embracement
-embracements
-embraces
-embryo
-emerge
-emerging
-eminence
-eminent
-eminently
-emotion
-emotions
-emperor
-empire
-employ
-employed
-employee
-employest
-empress
-emptied
-emptiness
-emptinesses
-empty
-enabled
-enact
-enacted
-enacteth
-enamoured
-enchantment
-encompass
-encompasseth
-encourage
-encouraged
-encouraging
-encumbered
-encumbrances
-end
-endangers
-endeared
-endearments
-endeavour
-endeavoured
-endeavouring
-endeavours
-ended
-ending
-endlessly
-ends
-endued
-endurance
-endure
-endured
-endures
-endureth
-enduring
-enemies
-enemy
-energy
-enervated
-enforced
-enforcement
-engage
-engaged
-engages
-engine
-english
-engraff
-enigma
-enjoin
-enjoined
-enjoinest
-enjoy
-enjoyed
-enjoying
-enlarge
-enlarged
-enlargedst
-enlarging
-enlighten
-enlightened
-enlightener
-enlighteneth
-enlightening
-enlightens
-enlisted
-enmities
-enmity
-enough
-enounce
-enquire
-enquired
-enquirers
-enquiries
-enquiring
-enquiringly
-enquiry
-enricher
-ensample
-enslaved
-ensnared
-ensnaring
-ensues
-ensuing
-entangle
-entangled
-entangling
-enter
-entered
-enteredst
-entering
-enters
-enthralled
-enticed
-enticements
-enticing
-entire
-entirely
-entireness
-entitled
-entrails
-entrance
-entreat
-entreated
-entreaties
-entrust
-entrusted
-entwine
-enumeration
-envenomed
-envious
-environeth
-environing
-envy
-envying
-epaphroditus
-epicurus
-episcopal
-epistles
-equably
-equal
-equalled
-equally
-equals
-equinoxes
-equipment
-equity
-equivalent
-ere
-ergo
-err
-erred
-error
-errors
-erst
-esau
-escape
-escaped
-especially
-espoused
-essay
-essayed
-essence
-establish
-established
-estate
-esteem
-esteemed
-esteeming
-estimate
-estimated
-estimation
-estranged
-etc
-eternal
-eternally
-eternity
-etext
-etext00
-etext01
-etext02
-etext90
-etext99
-etexts
-eunuchs
-euodius
-evangelists
-evaporates
-eve
-even
-evened
-evening
-evenly
-events
-ever
-everfixed
-everlasting
-everlastingly
-evermore
-every
-everything
-everywhere
-evidence
-evident
-evidently
-evil
-evils
-evincing
-exact
-exacted
-exacting
-exalted
-exaltedness
-examine
-examined
-examiner
-examining
-example
-examples
-exceeded
-exceedeth
-exceeding
-exceedingly
-excel
-excelled
-excellence
-excellencies
-excellency
-excellent
-excellently
-excelling
-excels
-except
-excepted
-exceptions
-excess
-excessive
-exchanged
-excited
-excitement
-excites
-exclaim
-exclude
-excluded
-exclusion
-exclusions
-excursive
-excuse
-excused
-excuses
-execrable
-execrate
-execute
-exercise
-exercised
-exhalation
-exhausted
-exhibit
-exhibited
-exhort
-exhortation
-exhortations
-exhorted
-exhorting
-exigency
-exiled
-exist
-existence
-existeth
-existing
-exists
-exodus
-expansive
-expect
-expectation
-expected
-expecteth
-expects
-expends
-expense
-expenses
-experience
-experienced
-experiments
-explain
-explained
-explaining
-explanatory
-expose
-exposed
-expound
-expounded
-expounding
-express
-expressed
-expression
-expressions
-exquisitely
-extended
-extension
-extent
-exterior
-external
-extinguish
-extinguished
-extol
-extolled
-extollers
-extracted
-extreme
-extremely
-extremest
-extricate
-extricated
-exuberance
-exuberant
-exude
-exult
-exultation
-eye
-eyes
-eyesight
-fable
-fables
-fabric
-fabulous
-face
-faced
-faces
-facio
-factito
-facts
-faculties
-faculty
-fail
-faileth
-failing
-failure
-fain
-faint
-fainting
-faintly
-fair
-fairer
-fairest
-fairly
-fairness
-faith
-faithful
-faithfully
-faithfulness
-fall
-fallacies
-fallen
-falling
-falls
-false
-falsehood
-falsehoods
-falsely
-falsified
-fame
-familiar
-familiarised
-familiarly
-family
-famine
-famished
-famous
-fancies
-fancy
-fanned
-fantasies
-fantastic
-far
-fared
-farness
-farther
-fashion
-fashioned
-fast
-faster
-fastidiousness
-fasting
-fastings
-fat
-father
-fatherless
-fatherly
-fathers
-fatigues
-fatness
-fault
-faultfinders
-faults
-faulty
-faustus
-favour
-favoured
-favourites
-favours
-fear
-feared
-feareth
-fearful
-fearfully
-fearing
-fearlessly
-fears
-feast
-fed
-fee
-feed
-feedest
-feedeth
-feeding
-feeds
-feel
-feeling
-feelings
-feels
-fees
-feet
-feigned
-felicity
-fell
-fellow
-fellows
-felt
-female
-females
-fence
-fervent
-fervently
-fervid
-festival
-fetched
-fettered
-fetters
-fever
-feverishness
-few
-fiction
-fictions
-field
-fields
-fiercely
-fiercest
-fifteen
-fifth
-fifty
-fig
-fight
-fighter
-fighting
-figurative
-figuratively
-figure
-figured
-figures
-file
-filename
-files
-fill
-filled
-fillest
-filleth
-filling
-filth
-filths
-filthy
-final
-finally
-find
-findest
-findeth
-finding
-finds
-fine
-finest
-finger
-fingers
-finish
-finished
-finite
-fire
-fired
-fires
-firm
-firmament
-firminus
-firmly
-firmness
-first
-fish
-fishes
-fit
-fitness
-fitted
-fitter
-fittest
-fitting
-five
-fix
-fixed
-fixedly
-fixing
-flagitiousness
-flagitiousnesses
-flagon
-flame
-flash
-flashedst
-flashes
-flashing
-flattering
-fled
-fledged
-flee
-fleeing
-fleeting
-flesh
-fleshly
-fleshy
-flew
-flies
-flights
-fling
-floating
-flock
-flocks
-flood
-floods
-flour
-flourished
-flow
-flowed
-flower
-flowers
-flowing
-flown
-flows
-fluctuate
-fluctuates
-fluctuating
-fluctuations
-fluently
-fluidness
-flung
-fluttereth
-flux
-fly
-flying
-foamed
-fog
-folded
-folk
-folks
-follies
-follow
-followed
-followers
-followest
-followeth
-following
-follows
-folly
-food
-fool
-foolish
-foolishly
-foolishness
-fools
-foot
-footed
-footsteps
-for
-forasmuch
-forbade
-forbadest
-forbare
-forbear
-forbid
-forbidden
-force
-forced
-forceth
-forcibly
-fore
-foreconceived
-forefathers
-forego
-foregoing
-forehead
-foreign
-foreigner
-foreknowledge
-forementioned
-forenamed
-forenoon
-forenoons
-forepassed
-foresaw
-foresee
-foreshow
-foreshowed
-foreshower
-foresignified
-foresignify
-forests
-foretell
-foretelling
-forethink
-forethinking
-forethought
-foretold
-forgave
-forge
-forget
-forgetful
-forgetfulness
-forgetteth
-forgetting
-forging
-forgive
-forgiven
-forgivest
-forgiving
-forgot
-forgotten
-forgottest
-form
-formation
-formed
-formedst
-former
-formerly
-formest
-forming
-formless
-formlessness
-forms
-fornicating
-fornication
-fornications
-forsake
-forsaken
-forsakest
-forsaketh
-forsaking
-forsook
-forsooth
-forth
-forthcoming
-forthwith
-fortunate
-fortunes
-forum
-forward
-forwards
-foster
-fostering
-fought
-foul
-foully
-foulness
-fouls
-found
-foundation
-foundations
-founded
-fountain
-four
-fourth
-fourthly
-fowl
-fowls
-fragment
-fragments
-fragrance
-fragrant
-frailness
-frame
-framed
-framers
-frantic
-fraud
-fraught
-freaks
-free
-freed
-freedom
-freely
-freeman
-frenzied
-frenzies
-frenzy
-frequent
-frequently
-fresh
-freshness
-fretted
-friend
-friends
-friendship
-frightful
-fro
-from
-front
-frozen
-fruit
-fruitful
-fruitfully
-fruitfulness
-fruitless
-fruitlessly
-fruits
-ftp
-fuel
-fugitives
-fulfil
-fulfilled
-fulfils
-full
-fuller
-fully
-fulness
-fumed
-fumes
-functions
-fund
-funding
-funeral
-furious
-furnace
-furnish
-furnished
-furnishing
-further
-furtherance
-furthermore
-fury
-future
-gain
-gained
-gainful
-gaining
-gains
-gainsay
-gainsayer
-gainsayers
-gainst
-galatians
-gales
-gall
-gallantry
-game
-games
-garb
-garden
-gardens
-garland
-garlands
-garment
-garner
-gasped
-gate
-gates
-gather
-gathered
-gatheredst
-gatherest
-gathering
-gathers
-gave
-gavest
-gay
-gaze
-gazers
-gazing
-general
-generally
-generate
-generation
-generations
-genesis
-genius
-gentiles
-gentle
-gentleness
-gently
-genuinely
-geometry
-gervasius
-gestures
-get
-getting
-ghastly
-ghost
-ghosts
-giant
-gift
-gifted
-gifts
-gilded
-girded
-girl
-girls
-give
-given
-giver
-givers
-gives
-givest
-giveth
-giving
-glad
-gladdened
-gladdens
-gladiators
-gladly
-gladness
-gladsome
-glance
-glances
-glass
-gleam
-gleameth
-gleams
-glide
-glided
-gliding
-glittering
-gloried
-glories
-glorieth
-glorified
-glorifies
-glorify
-glorious
-glory
-glorying
-glow
-glowed
-gloweth
-glowing
-glows
-glue
-gnashed
-gnawed
-gnawing
-go
-goad
-goaded
-goading
-goads
-goal
-god
-godhead
-godless
-godly
-gods
-goes
-goest
-goeth
-going
-gold
-golden
-gone
-good
-goodliness
-goodly
-goodness
-goods
-gorgeous
-gospel
-got
-gotten
-govemed
-government
-governor
-governors
-gowned
-grace
-graceful
-gracefulness
-gracious
-gradation
-gradually
-grammar
-grammarian
-grammarians
-grandchildren
-grant
-granted
-grantest
-grasp
-grasps
-grass
-grassy
-gratefully
-gratias
-gratification
-gratings
-gratuitous
-gratuitously
-grave
-gravity
-great
-greater
-greatest
-greatly
-greatness
-greaves
-grecian
-greedily
-greediness
-greedy
-greek
-greeks
-green
-greet
-greeted
-grew
-grief
-griefs
-grieve
-grieved
-grieves
-grievest
-grieving
-grievous
-grievously
-groan
-groaned
-groaneth
-groaning
-groanings
-groans
-groat
-gross
-grossness
-ground
-grounded
-grounds
-groves
-grow
-growing
-grown
-growth
-guarded
-guardian
-guardianship
-guess
-guessed
-guidance
-guidances
-guide
-guidest
-guilt
-guiltless
-guilty
-gulf
-gushed
-gutenberg
-gutindex
-habit
-habitation
-habits
-had
-hadst
-hail
-hair
-hairs
-hale
-haled
-half
-hallow
-hallowed
-hallowing
-halved
-hand
-handkerchief
-handle
-handled
-handling
-handmaid
-hands
-handwriting
-hang
-hanging
-hap
-haphazard
-hapless
-haply
-happen
-happened
-happeneth
-happens
-happier
-happily
-happiness
-happy
-harass
-harbour
-harbouring
-hard
-harder
-hardheartedness
-hardship
-hare
-hark
-harlotries
-harm
-harmed
-harmless
-harmonious
-harmoniously
-harmonise
-harmoniseth
-harmonising
-harmonized
-harmonizing
-harmony
-harsh
-hart
-harts
-harvest
-has
-hast
-haste
-hasten
-hastened
-hastening
-hasting
-hatchet
-hate
-hated
-hateful
-hath
-hatred
-haughtiness
-haunt
-have
-having
-hay
-he
-head
-header
-headlong
-heads
-heal
-healed
-healedst
-healeth
-healing
-health
-healthful
-healthfully
-healthy
-heaped
-heaps
-hear
-heard
-heardest
-hearer
-hearers
-hearest
-heareth
-hearing
-hearken
-hears
-hearsay
-heart
-hearted
-heartedness
-hearts
-heat
-heated
-heathen
-heaven
-heavenly
-heavens
-heavier
-heavily
-heavy
-hebrew
-hedged
-heed
-heeded
-height
-heightening
-heights
-heinous
-held
-heldest
-hell
-hellish
-helmet
-help
-helped
-helper
-helpful
-helpidius
-helping
-hence
-henceforth
-her
-herb
-herbs
-here
-hereafter
-hereat
-hereby
-hereditary
-herein
-hereof
-hereon
-heresies
-heresy
-heretics
-heretofore
-hereunto
-hereupon
-hers
-herself
-hesitate
-hesitated
-hesitating
-hesitation
-hid
-hidden
-hiddest
-hide
-hideous
-hidest
-hierius
-high
-higher
-highest
-highly
-highness
-hills
-him
-himself
-hinder
-hindered
-hindereth
-hindrance
-hint
-hippocrates
-his
-history
-hither
-hitherto
-hoar
-hogs
-hogshed
-hold
-holden
-holdest
-holding
-holds
-holies
-holily
-holiness
-holy
-home
-homer
-honest
-honestly
-honesty
-honey
-honied
-honor
-honour
-honourable
-honoured
-honouring
-honours
-hook
-hooks
-hope
-hoped
-hopeful
-hopes
-hoping
-horns
-horrible
-horror
-horse
-horses
-hortensius
-host
-hosts
-hot
-hotly
-hour
-hours
-house
-household
-houseless
-houses
-hovered
-how
-however
-howsoever
-html
-http
-huge
-hugging
-human
-humane
-humanity
-humans
-humble
-humbled
-humbledst
-humility
-hundred
-hundreds
-hung
-hunger
-hungered
-hungering
-hungry
-hunting
-hurried
-hurriedly
-hurrying
-hurt
-hurtful
-hurting
-husband
-husbands
-hushed
-husks
-hymn
-hymns
-hypertext
-i
-ibiblio
-ice
-idaho
-ideas
-identification
-identify
-idle
-idleness
-idly
-idol
-idols
-if
-ignoble
-ignorance
-ignorant
-ii
-iii
-ill
-ills
-illuminate
-illuminating
-illumined
-illusion
-image
-images
-imaginary
-imagination
-imaginations
-imagine
-imagined
-imagining
-imbibe
-imbibed
-imbue
-imitate
-imitated
-imitating
-imitation
-immediately
-immense
-immersed
-immoderate
-immortal
-immortality
-immortally
-immovably
-immutable
-impair
-impaired
-impart
-imparted
-imparts
-impatience
-impatient
-impatiently
-imperfect
-imperfection
-imperfections
-imperishable
-imperturbable
-impiety
-impious
-implanted
-implanting
-implied
-imply
-important
-importunity
-imposed
-impostors
-impostumes
-impotent
-impregnable
-impress
-impressed
-impressing
-impression
-impressions
-imprinted
-improperly
-impudently
-impulses
-impunity
-impure
-impurity
-impute
-in
-inaccessible
-inaccurate
-inactive
-inanimate
-inappropriately
-inasmuch
-incarnation
-incense
-incensed
-inchoate
-incidental
-inclination
-incline
-inclined
-included
-including
-incommutable
-incomparably
-incomplete
-incomprehensible
-incongruously
-incorporeal
-incorrect
-incorruptible
-incorruptibly
-incorruption
-increase
-increased
-increasing
-incredible
-incredibly
-incumbrances
-incurable
-incurred
-indebted
-indeed
-indefinitely
-indemnify
-indemnity
-indentures
-indexes
-indiana
-indicate
-indicated
-indicating
-indications
-indigent
-indigested
-indignant
-indirect
-indirectly
-indite
-indited
-indued
-indulgent
-inebriate
-inebriated
-inebriation
-inevitable
-inevitably
-inexperienced
-inexpressible
-infancy
-infant
-infantine
-infants
-infected
-infection
-infer
-inferior
-infidelity
-infidels
-infinite
-infinitely
-infinitude
-infirmities
-infirmity
-inflame
-inflamed
-inflammation
-inflection
-inflicted
-influence
-influenced
-influences
-information
-informed
-informing
-infringement
-infuse
-infused
-ingrated
-inhabitant
-inhabitants
-inhabited
-inharmonious
-inheritance
-iniquities
-iniquity
-initiated
-initiating
-initiation
-initiatory
-injurable
-injure
-injured
-injures
-injurious
-injury
-injustice
-inmost
-innate
-inner
-innocence
-innocency
-innocent
-innumerable
-innumerably
-inordinate
-insatiable
-insatiate
-insensibly
-inseparable
-inserted
-insight
-insolently
-insomuch
-inspect
-inspecting
-inspiration
-inspire
-inspired
-inspirest
-inspiring
-instability
-instance
-instances
-instant
-instantly
-instead
-instillest
-instinct
-instinctive
-instituted
-institution
-instruct
-instructed
-instructest
-instruction
-instructor
-insult
-insultingly
-intellectual
-intelligence
-intelligences
-intelligent
-intelligible
-intemperance
-intend
-intended
-intense
-intensely
-intenseness
-intensest
-intent
-intention
-intently
-intercede
-intercedeth
-intercepting
-intercession
-intercourse
-interest
-interested
-interior
-intermission
-intermit
-intermitted
-intermitting
-internal
-international
-interpose
-interposed
-interposing
-interpret
-interpretation
-interpreted
-interpreter
-interpreting
-interrupt
-interrupted
-interruption
-interval
-intervals
-intimacy
-intimate
-intimated
-intimately
-into
-intolerable
-intoxicated
-intricate
-introduced
-intrude
-inured
-inveigler
-invest
-invests
-invisible
-invite
-invited
-inviting
-involved
-inward
-inwardly
-iowa
-iron
-irons
-irrational
-irresoluteness
-irrevocable
-irritate
-is
-isaac
-isaiah
-israel
-issue
-issued
-it
-italian
-italy
-itch
-itching
-items
-its
-itself
-jacob
-jarring
-jealous
-jealousy
-jeer
-jeering
-jerusalem
-jest
-jests
-jesus
-jew
-jews
-join
-joined
-joineth
-joining
-joint
-jointly
-joking
-jordan
-joseph
-journey
-journeyed
-jove
-joy
-joyed
-joyful
-joyfulness
-joying
-joyous
-joyously
-joyousness
-joys
-judge
-judged
-judgements
-judges
-judgest
-judgeth
-judging
-judgment
-judgments
-julian
-juncture
-june
-juno
-jupiter
-just
-justice
-justification
-justifieth
-justify
-justina
-justly
-keen
-keep
-keeper
-keepest
-keeping
-keeps
-ken
-kentucky
-kept
-kicking
-kill
-killed
-killest
-killeth
-kind
-kindle
-kindled
-kindly
-kindness
-kindred
-kinds
-king
-kingdom
-kingdoms
-kings
-knee
-knees
-knew
-knewest
-knit
-knitting
-knock
-knocked
-knocketh
-knocking
-knocks
-knots
-knottiness
-knotty
-know
-knowest
-knoweth
-knowing
-knowingly
-knowledge
-known
-knows
-labour
-laboured
-labourers
-labours
-lack
-lacketh
-lacking
-laden
-laid
-lament
-lamentable
-lamented
-lancet
-land
-lands
-language
-languages
-languishing
-lanthorn
-lap
-large
-largely
-largeness
-larger
-lashed
-lashes
-lashest
-last
-lastly
-late
-later
-lathe
-latin
-latins
-latinum
-latter
-lattice
-laugh
-laughed
-laughter
-launched
-law
-lawful
-lawfully
-lawless
-laws
-lawyer
-lawyers
-laxly
-lay
-layeth
-laying
-lays
-lead
-leaden
-leadeth
-leading
-leads
-leaning
-leaps
-learn
-learned
-learner
-learning
-learnt
-leasing
-least
-leave
-leaven
-leaves
-leaveth
-leaving
-lecture
-lectured
-led
-left
-legal
-legally
-leisure
-lends
-length
-lengthened
-lentiles
-less
-lessen
-lesser
-lesson
-lessons
-lest
-let
-lethargy
-letter
-letters
-lettest
-lewd
-liability
-liar
-libanus
-liberal
-liberality
-liberty
-licence
-license
-licensed
-licenses
-lick
-lie
-lied
-lies
-lieth
-life
-lift
-lifted
-liftedst
-lifter
-liftest
-lifts
-light
-lighted
-lighten
-lightened
-lighteth
-lightly
-lights
-lightsome
-like
-liked
-likedst
-likely
-likeness
-likenesses
-liker
-likes
-likest
-likewise
-lilies
-limbs
-limed
-limitation
-limited
-limits
-line
-lineage
-lineaments
-lined
-lines
-linger
-lingered
-lingering
-links
-lion
-lip
-lips
-list
-listened
-listening
-listing
-lists
-literally
-literary
-literature
-litigation
-little
-littles
-live
-lived
-livelihood
-lively
-lives
-livest
-liveth
-living
-lizard
-lo
-load
-loads
-loathed
-loathing
-loathsome
-locking
-locusts
-lodging
-lofty
-logic
-login
-long
-longed
-longer
-longing
-longings
-longs
-look
-looked
-looker
-looketh
-looking
-looks
-loose
-loosed
-loosen
-loosest
-loquacity
-lord
-lords
-lose
-loses
-loseth
-losing
-loss
-lost
-lot
-loth
-lottery
-loud
-loudly
-louisiana
-love
-loved
-loveliness
-lovely
-lover
-lovers
-loves
-lovest
-loveth
-loving
-lovingly
-low
-lower
-lowering
-lowest
-lowlily
-lowliness
-lowly
-lucid
-lucre
-ludicrous
-lulled
-luminaries
-lump
-lungs
-lure
-lures
-lust
-lusted
-lusteth
-lustful
-lustfulness
-lusting
-lusts
-luxuriousness
-luxury
-lying
-macedonia
-machine
-mad
-madaura
-made
-madest
-madly
-madness
-magical
-magistrates
-magnified
-magnify
-magnitudes
-maid
-maiden
-maidens
-mail
-maimed
-main
-mainly
-maintain
-maintained
-maintainers
-maintaining
-majesty
-make
-maker
-makers
-makes
-makest
-maketh
-making
-male
-malice
-malicious
-maliciously
-malignant
-mammon
-man
-manage
-manfully
-mangled
-manhood
-manichaean
-manichaeus
-manichee
-manichees
-manifest
-manifestation
-manifested
-manifestly
-manifold
-manifoldly
-manifoldness
-mankind
-manna
-manner
-manners
-manors
-mansion
-mantles
-manufactures
-many
-mariners
-mark
-marked
-market
-marketplace
-marking
-marks
-marriage
-marriageable
-married
-marrow
-marry
-marrying
-mars
-marts
-martyr
-martyrs
-marvel
-marvelled
-mary
-masculine
-mass
-massachusetts
-masses
-master
-mastered
-masters
-mastery
-material
-materials
-mathematicians
-matrons
-matter
-matters
-maturing
-may
-mayest
-mazes
-me
-mean
-meanest
-meaning
-meanings
-meanly
-means
-meant
-meantime
-meanwhile
-measurable
-measure
-measured
-measures
-measuring
-meat
-meats
-meddle
-meddling
-medea
-mediator
-medicine
-medicines
-medicining
-meditate
-meditated
-meditating
-meditations
-medium
-meek
-meekness
-meet
-meeting
-meets
-melodies
-melodious
-melody
-melt
-melted
-member
-members
-memory
-men
-mentally
-mention
-mentioned
-mentioning
-merchantability
-mercies
-merciful
-mercifully
-mercy
-mere
-merely
-merged
-merits
-merrily
-merry
-message
-messages
-messengers
-met
-method
-metre
-metres
-mget
-michael
-mid
-middle
-midnight
-might
-mightest
-mightier
-mightily
-mightiness
-mighty
-milan
-milanese
-milder
-mildly
-milk
-milky
-millennium
-million
-mimic
-mind
-minded
-mindful
-minds
-mine
-minerva
-mingle
-mingled
-mingling
-minister
-ministers
-ministry
-minute
-minutest
-miracles
-mire
-mirth
-mirthful
-mischief
-misdeeds
-miserable
-miserably
-miseries
-misery
-mislike
-misliked
-miss
-missed
-missing
-mist
-mistaken
-mistress
-mistresses
-mists
-mixture
-moan
-mock
-mocked
-mockeries
-mockers
-mockery
-mocking
-mode
-models
-moderate
-moderation
-modes
-modestly
-modesty
-modification
-modify
-modulation
-moist
-molest
-molten
-moment
-momentary
-momentous
-moments
-monad
-monasteries
-monastery
-money
-monk
-monnica
-monster
-monstrous
-monstrousness
-montana
-month
-months
-monument
-moon
-moral
-more
-moreover
-morning
-morrow
-morsel
-mortal
-mortality
-mortals
-mortified
-moses
-most
-mostly
-mother
-motherly
-mothers
-motion
-motions
-motive
-mould
-moulded
-mount
-mountain
-mountains
-mounting
-mourn
-mourned
-mourners
-mournful
-mourning
-mouth
-mouthed
-mouths
-move
-moved
-moveth
-moving
-much
-muddy
-mule
-multiple
-multiplicity
-multiplied
-multipliedst
-multiply
-multiplying
-multitude
-multitudes
-munday
-murder
-murdered
-murdering
-murmur
-murmured
-museth
-music
-musical
-musing
-must
-mutability
-mutable
-mute
-muttering
-mutual
-mutually
-my
-myself
-mysteries
-mysterious
-mysteriously
-mystery
-mystic
-mystically
-nails
-naked
-name
-named
-namely
-names
-narrow
-narrower
-narrowly
-narrowness
-nation
-nations
-native
-nativity
-natural
-naturally
-nature
-natures
-nay
-near
-nearer
-neatly
-neatness
-nebridius
-necessaries
-necessarily
-necessary
-necessities
-necessity
-neck
-need
-needed
-needeth
-needful
-needing
-needs
-needy
-neglect
-neglected
-neglecteth
-neglecting
-negligence
-negligent
-neighbour
-neighbouring
-neighbours
-neither
-neptune
-nest
-nests
-net
-nets
-nevada
-never
-nevertheless
-new
-newsletter
-newsletters
-next
-nigh
-night
-nights
-nill
-nilled
-nimble
-nine
-nineteenth
-ninety
-ninth
-no
-noah
-nobility
-noble
-nod
-noise
-nominally
-none
-noon
-nor
-north
-nostrils
-not
-note
-noted
-notes
-nothing
-notice
-notices
-notion
-notions
-notorious
-notwithstanding
-nought
-nourish
-nourished
-nourishing
-nourishment
-nourishments
-novelty
-novice
-now
-nowhere
-null
-number
-numbered
-numberest
-numbering
-numberless
-numbers
-numerous
-nurse
-nursery
-nurses
-nuts
-obedience
-obedient
-obediently
-obey
-obeyed
-obeying
-obeys
-object
-objected
-objections
-objects
-oblation
-obscure
-obscurely
-observance
-observation
-observe
-observed
-observes
-observeth
-observing
-obstinacy
-obtain
-obtained
-obtaining
-obtains
-obviously
-occasion
-occasioned
-occupy
-occupying
-occur
-occurred
-occurs
-ocean
-odour
-odours
-of
-off
-offence
-offences
-offend
-offended
-offensive
-offer
-offered
-offerings
-office
-officer
-officers
-offices
-official
-offspring
-oft
-often
-oftentimes
-ofthe
-ofttimes
-oh
-oil
-ointments
-oklahoma
-old
-omened
-omit
-omitted
-omnipotency
-omnipotent
-omnium
-on
-once
-one
-ones
-onesiphorus
-only
-open
-opened
-openest
-openeth
-opening
-openly
-opens
-operations
-opinion
-opinionative
-opinions
-opportunity
-oppose
-opposed
-opposing
-oppressed
-oppresseth
-oppression
-or
-oracle
-oracles
-orally
-orations
-orator
-oratory
-orbs
-ordained
-ordainer
-order
-ordered
-orderer
-orderest
-ordering
-ordinance
-ordinarily
-ordinary
-orestes
-org
-organization
-organs
-origin
-original
-ornamentedst
-ornamenting
-ostentation
-ostia
-other
-others
-otherwhere
-otherwhiles
-otherwise
-ought
-oughtest
-our
-ours
-ourself
-ourselves
-out
-outer
-outrages
-outset
-outward
-outwardly
-over
-overboldness
-overcame
-overcast
-overcharged
-overclouded
-overcome
-overcoming
-overflow
-overflowed
-overflowing
-overhastily
-overjoyed
-overpass
-overpast
-overspread
-overspreading
-overtake
-overthrew
-overthrow
-overturned
-overwhelmed
-owe
-owed
-owes
-owing
-own
-owns
-oxford
-page
-pages
-paid
-pain
-painful
-pains
-pair
-pairs
-palace
-palaces
-palate
-pale
-palm
-pamperedness
-pander
-panegyric
-pangs
-pant
-panted
-panting
-paper
-par
-paraclete
-paradise
-parched
-pardoned
-pared
-parent
-parental
-parents
-parity
-parley
-part
-partake
-partaker
-partaketh
-parted
-participation
-particle
-particles
-particular
-parties
-parting
-partly
-partners
-parts
-party
-pass
-passage
-passages
-passed
-passengers
-passes
-passeth
-passible
-passing
-passion
-passionately
-passions
-password
-past
-pastime
-pastimes
-patched
-path
-paths
-patience
-patiently
-patricius
-pattern
-patterns
-paul
-paulus
-pause
-pauses
-pay
-payable
-payest
-paying
-payments
-peace
-peaceful
-peacefully
-peacemaker
-pear
-pearl
-pears
-peculiar
-peculiarly
-pen
-penal
-penally
-penalties
-penalty
-pence
-penetrating
-penitent
-people
-per
-peradventure
-perceivable
-perceive
-perceived
-perceivedst
-perceives
-perceiveth
-perceiving
-perchance
-perdition
-perfect
-perfected
-perfecting
-perfection
-perfectly
-performed
-performing
-perhaps
-peril
-perilous
-perils
-period
-periodic
-periods
-perish
-perishable
-perished
-perisheth
-permission
-permit
-permitted
-pernicious
-perpetual
-perplexed
-perplexities
-persecuted
-persecutes
-persecuting
-persevering
-person
-personages
-personally
-personated
-persons
-perspicuous
-persuade
-persuaded
-persuasions
-persuasive
-pertain
-pertained
-pertaining
-perturbations
-perused
-perverse
-perverseness
-perversion
-perversity
-pervert
-perverted
-pervertedly
-perverting
-pervious
-pestilent
-petitions
-petty
-petulantly
-pg
-phantasm
-phantasms
-phantom
-phantoms
-philippians
-philosophers
-philosophy
-photinus
-phrase
-phrases
-physic
-physical
-physician
-physicians
-picture
-pictures
-piece
-piecemeal
-pieces
-pierce
-pierced
-piercing
-piety
-pile
-piled
-pilgrim
-pilgrimage
-pilgrims
-pinching
-pines
-pious
-piously
-pit
-pitch
-pitiable
-pitied
-pitiest
-pitiful
-pity
-pitying
-place
-placed
-placedst
-places
-placest
-placing
-plague
-plain
-plainer
-plainly
-plainness
-plains
-plan
-planets
-plans
-plant
-plants
-platonists
-plausibility
-play
-playing
-plays
-plea
-plead
-pleasant
-pleasanter
-pleasantly
-pleasantness
-please
-pleased
-pleasest
-pleasing
-pleasurable
-pleasure
-pleasureableness
-pleasures
-plenary
-plenteous
-plenteousness
-plentiful
-plentifully
-plenty
-pliant
-plot
-plots
-plotting
-pluck
-plucked
-pluckest
-plucking
-plunged
-plunging
-plural
-pmb
-poems
-poesy
-poet
-poetic
-poets
-point
-pointed
-points
-poise
-poison
-pole
-polished
-polluted
-pollution
-pontitianus
-poor
-popular
-popularity
-population
-portion
-portions
-position
-possess
-possessed
-possesses
-possessest
-possesseth
-possession
-possessor
-possibility
-possible
-posted
-potent
-potter
-pour
-poured
-pourest
-poverty
-power
-powerful
-powers
-practice
-practise
-practised
-praetorian
-prairienet
-praise
-praised
-praises
-praiseth
-prated
-praters
-prating
-pray
-prayed
-prayer
-prayers
-praying
-preach
-preached
-preacher
-preachers
-preaching
-preachings
-precede
-preceded
-precedes
-precedest
-precedeth
-precepts
-precious
-precipice
-precipitated
-precisely
-predestinated
-predestination
-predicament
-predicaments
-predicated
-predict
-predicted
-preeminence
-preeminent
-prefect
-prefer
-preferable
-preference
-preferred
-preferring
-prejudice
-prelate
-preliminary
-prepare
-prepared
-preparedst
-prepares
-preparest
-preparing
-prerogative
-presbyters
-prescribed
-prescribes
-prescripts
-presence
-present
-presented
-presently
-presents
-preserve
-preserved
-preserving
-presidentship
-presides
-presidest
-presideth
-presiding
-press
-pressed
-pressedst
-presseth
-pressure
-presume
-presumed
-presuming
-presumption
-pretend
-prevail
-prevailed
-prevailing
-prevails
-prevented
-preventedst
-preventing
-previous
-prey
-price
-prices
-pricked
-pricks
-pride
-priest
-primary
-primitive
-prince
-princes
-principalities
-principally
-principles
-print
-prior
-prison
-prisoner
-privacy
-private
-privately
-privation
-privily
-prize
-prizes
-probable
-problem
-proceed
-proceeded
-proceedeth
-proceeding
-processing
-processors
-proclaim
-proclaiming
-proconsul
-proconsular
-procure
-procured
-procuredst
-prodigality
-produce
-produced
-production
-products
-prof
-profane
-profess
-professed
-professing
-profession
-professor
-professorship
-proffer
-proffering
-proficiency
-profit
-profitable
-profited
-profits
-profligate
-profound
-profounder
-profoundly
-program
-progress
-prohibition
-project
-projected
-prolix
-prolonged
-promise
-promised
-promises
-promiseth
-promising
-promo
-pronounce
-pronounced
-pronounces
-pronouncing
-pronunciation
-proof
-proofread
-prop
-proper
-properly
-property
-prophecy
-prophet
-prophets
-proportion
-proportions
-proposed
-propound
-propoundest
-proprietary
-prose
-prosper
-prosperities
-prosperity
-protasius
-protect
-protection
-protest
-protesting
-protracted
-protraction
-proud
-prouder
-proudly
-prove
-proved
-provest
-proveth
-provide
-provided
-providedst
-providence
-province
-provincial
-provision
-provisions
-provoke
-prudent
-prunes
-pryers
-psalm
-psalmody
-psalms
-psalter
-psaltery
-pub
-public
-publication
-publicly
-puffed
-pulse
-punctuation
-punish
-punishable
-punished
-punishment
-punishments
-punitive
-pupils
-puppies
-purchase
-purchased
-purchasing
-pure
-purely
-purer
-purest
-purged
-purified
-purity
-purpose
-purposed
-purposes
-purposing
-pursue
-pursued
-pursues
-pursuing
-pursuits
-pusey
-put
-putrefied
-putting
-pylades
-qualified
-qualities
-quarrel
-quarrels
-quarter
-queen
-quench
-quest
-question
-questioned
-questioning
-questionings
-questions
-quick
-quicken
-quickened
-quickenest
-quicker
-quickly
-quickness
-quiet
-quieter
-quit
-quite
-quitting
-quoth
-race
-races
-racked
-racks
-rage
-raged
-raging
-rais
-raise
-raised
-raisedst
-raises
-raisest
-raising
-ran
-random
-range
-ranged
-rank
-ranked
-ransom
-rapture
-rare
-rash
-rashly
-rashness
-rates
-rather
-rational
-raven
-ravish
-reach
-reached
-reacheth
-reaching
-read
-readable
-reader
-readers
-readest
-readier
-readily
-readiness
-reading
-reads
-ready
-real
-realised
-realisest
-realities
-reality
-really
-reap
-reason
-reasonable
-reasoning
-reasonings
-reasons
-reawakened
-rebel
-rebelled
-rebellious
-rebuke
-rebuked
-recall
-recalled
-recallest
-recalling
-recalls
-receive
-received
-receives
-receivest
-receiveth
-receiving
-recent
-recently
-receptacle
-recess
-recesses
-recite
-recited
-reckon
-reckoned
-reckoning
-reckons
-reclaim
-reclaiming
-recognise
-recognised
-recognises
-recognising
-recollect
-recollected
-recollecting
-recollection
-recommend
-recommended
-recommending
-reconcile
-reconciled
-reconcilement
-reconciliation
-recondite
-record
-recorded
-recount
-recounts
-recourse
-recover
-recovered
-recoveredst
-recovering
-recovery
-recruiting
-rectify
-recur
-recurring
-redeem
-redeemed
-redeemer
-redemption
-redistributing
-redoubling
-refer
-reference
-references
-referred
-reflect
-reform
-reformed
-refrain
-refrained
-refraining
-refresh
-refreshed
-refreshing
-refreshment
-refuge
-refund
-refuse
-refused
-refusing
-refute
-regard
-regarded
-regardest
-regarding
-regardless
-regenerated
-regeneratedst
-regeneration
-region
-regions
-regular
-regulate
-rehearse
-reigning
-reigns
-rein
-reins
-reinvolved
-reject
-rejected
-rejection
-rejects
-rejoice
-rejoiced
-rejoices
-rejoicest
-rejoiceth
-rejoicing
-relapse
-relapseth
-relate
-related
-relater
-relating
-relation
-relations
-relationship
-relative
-relators
-relaxation
-relaxedly
-relaxing
-release
-released
-relics
-relied
-relief
-relieve
-religion
-religious
-religiously
-remain
-remainder
-remained
-remainest
-remaineth
-remaining
-remains
-remarkable
-remedies
-remember
-remembered
-remembereth
-remembering
-remembers
-remembrance
-remembrances
-reminded
-remindeth
-remission
-remitted
-remittest
-remnants
-remorse
-removal
-remove
-removed
-rend
-render
-renderest
-renew
-renewed
-reneweth
-renewing
-renounce
-renowned
-rent
-repair
-repay
-repeat
-repeated
-repeating
-repel
-repelled
-repent
-repentance
-repentest
-replace
-replacement
-replacing
-replenish
-replenished
-replenishing
-replied
-replies
-reply
-report
-reported
-reporters
-reports
-repose
-reposed
-reposes
-reposeth
-reposing
-represent
-repress
-reproach
-reproachful
-reproof
-reproved
-reproves
-reptiles
-reputation
-repute
-reputed
-request
-require
-required
-requirements
-requires
-requiring
-requital
-requited
-requitest
-rescue
-rescued
-rescuing
-resemble
-resembling
-resend
-resent
-reserved
-reside
-residest
-resigned
-resist
-resistance
-resisted
-resistedst
-resistest
-resisteth
-resisting
-resolute
-resolutely
-resolution
-resolved
-respect
-respected
-respective
-respects
-respite
-rest
-rested
-restest
-resting
-restless
-restlessly
-restlessness
-restoration
-restore
-restored
-restoring
-restrain
-restrained
-restrainest
-restraining
-restrains
-restraint
-restricted
-result
-resulting
-results
-resumed
-resumes
-resurrection
-retain
-retained
-retaineth
-retard
-retire
-retired
-retiring
-retreat
-return
-returned
-returning
-returns
-reveal
-revealed
-revealedst
-revealing
-revelation
-revelations
-revenge
-revenged
-revenges
-revenue
-reverence
-reverential
-reverently
-review
-reviewing
-reviled
-revised
-revive
-revolt
-revolting
-revolved
-revolving
-reward
-rewards
-rhetoric
-rich
-richer
-riches
-riddle
-ridiculous
-right
-righteous
-righteousness
-rightful
-rightly
-rights
-rigidly
-rigorous
-rioting
-riotous
-ripened
-riper
-rise
-risen
-riseth
-rising
-risk
-rites
-rivers
-riveted
-roared
-roarest
-rob
-robber
-robbery
-robert
-robing
-rocks
-rods
-roll
-rolled
-rolling
-roman
-romanianus
-rome
-rood
-room
-root
-rose
-rottenness
-rough
-round
-rounds
-rouse
-roused
-rove
-roving
-rovings
-royalties
-royalty
-rude
-rudely
-rudiments
-rugged
-ruggedness
-ruinous
-rule
-ruled
-ruler
-rules
-rulest
-ruleth
-ruminate
-ruminating
-run
-running
-runs
-rush
-rushing
-s
-sabbath
-sacrament
-sacraments
-sacrifice
-sacrificed
-sacrifices
-sacrificing
-sacrilegious
-sad
-saddeneth
-sadness
-safe
-safer
-safety
-said
-saidst
-sail
-sailors
-sails
-saint
-saints
-saith
-sake
-sakes
-salary
-sale
-salt
-salted
-salvation
-same
-sanctification
-sanctified
-sanctity
-sanctuary
-sand
-sang
-sangest
-sank
-sat
-sate
-sated
-satiate
-satiated
-satiety
-satisfaction
-satisfactorily
-satisfied
-satisfy
-satisfying
-saturn
-saul
-savage
-savageness
-save
-saved
-saving
-saviour
-savour
-savoured
-savoury
-saw
-sawest
-say
-sayest
-saying
-sayings
-says
-scanning
-scantling
-scarce
-scarcely
-scatter
-scattered
-scatteredst
-scenical
-sceptre
-schedule
-scholar
-scholars
-school
-schools
-science
-sciences
-scoffed
-scoffing
-scorn
-scorned
-scornful
-scornfully
-scourge
-scourged
-scourgedst
-scourges
-scraped
-scratch
-scratching
-scripture
-scriptures
-scroll
-scruple
-sea
-seal
-sealed
-search
-searched
-searcher
-searches
-searching
-seas
-season
-seasonably
-seasoned
-seasoneth
-seasons
-seat
-seated
-seats
-second
-secondary
-secrecies
-secret
-secretly
-secrets
-sect
-section
-secular
-secure
-securely
-seduce
-seduced
-seducers
-seducing
-seduction
-seductions
-seductive
-see
-seed
-seeing
-seek
-seekest
-seeketh
-seeking
-seeks
-seem
-seemed
-seemeth
-seemly
-seems
-seen
-sees
-seest
-seeth
-seize
-seized
-seizes
-seldomness
-selected
-self
-sell
-sellers
-selling
-selves
-semblance
-senator
-senators
-send
-sending
-seneca
-sensation
-sensations
-sense
-senseless
-senses
-sensible
-sensibly
-sensitive
-sent
-sentence
-sentences
-sentest
-sentiment
-separate
-separated
-separateth
-separating
-seraphim
-serene
-serenity
-sermons
-serpent
-serpents
-servant
-servants
-serve
-served
-serves
-service
-serviceable
-services
-serving
-servitude
-session
-set
-sets
-settest
-setting
-settle
-settled
-settling
-seven
-seventh
-sever
-several
-severally
-severe
-severed
-severely
-severer
-severing
-severity
-sex
-shade
-shadow
-shadowed
-shadows
-shadowy
-shady
-shaggy
-shake
-shaken
-shakes
-shall
-shalt
-shame
-shameful
-shamefulness
-shameless
-shamelessness
-shape
-shapen
-shapes
-share
-shared
-sharers
-shares
-sharp
-sharpen
-sharper
-sharply
-sharpness
-sharpsighted
-shatter
-shattered
-she
-shed
-sheep
-shelter
-shepherd
-shield
-shifted
-shifting
-shine
-shines
-shinest
-shineth
-shining
-ship
-ships
-shipwreck
-shod
-shoe
-shoes
-shone
-shonest
-shook
-shoot
-shop
-shops
-shore
-short
-shortened
-shorter
-shortly
-should
-shoulder
-shoulders
-shouldest
-shouted
-shoutedst
-show
-showed
-showedst
-shower
-showeth
-showing
-shown
-shows
-shrink
-shrinking
-shrunk
-shudder
-shunning
-shuns
-shut
-sick
-sickly
-sickness
-sicknesses
-side
-sides
-siege
-sigh
-sighed
-sigheth
-sighing
-sighs
-sight
-sights
-sign
-significations
-signified
-signifies
-signify
-signs
-silence
-silenced
-silent
-silently
-silly
-silver
-silversmiths
-similitude
-simple
-simplicianus
-simplicity
-simply
-sin
-since
-sincerely
-sinful
-sing
-singeth
-singing
-single
-singly
-sings
-singsong
-singular
-singularly
-sink
-sinking
-sinks
-sinned
-sinner
-sinners
-sins
-sipped
-sips
-sit
-sites
-sits
-sittest
-sitteth
-sitting
-six
-sixteenth
-sixth
-size
-skies
-skilful
-skill
-skilled
-skin
-skins
-skirmishes
-skirts
-sky
-slackened
-slackness
-slain
-slave
-slavery
-slaves
-slavish
-slay
-slaying
-sleep
-sleeper
-sleepest
-sleeping
-slept
-slew
-slight
-slighting
-slightly
-slipped
-slippery
-sloth
-slothful
-slow
-slower
-slowly
-sluggish
-slumber
-slumbers
-small
-smaller
-smallest
-smarting
-smell
-smelleth
-smelling
-smells
-smile
-smiled
-smiling
-smiting
-smoke
-smooth
-smoothed
-smoothing
-snare
-snares
-snow
-so
-soaring
-sober
-soberly
-sobriety
-socalled
-society
-sodom
-soever
-soft
-softened
-softening
-softly
-software
-soil
-solaces
-sold
-soldier
-sole
-solecism
-solemn
-solemnise
-solemnities
-solemnity
-solicited
-solicits
-solid
-solidity
-solitude
-solomon
-solstices
-solve
-solving
-some
-someone
-something
-sometime
-sometimes
-somewhat
-somewhere
-son
-song
-songs
-sons
-soon
-sooner
-soothed
-soothes
-sore
-sorely
-sores
-sorrow
-sorrowed
-sorrowful
-sorrowfulness
-sorrows
-sorry
-sort
-sorts
-sought
-soughtest
-soul
-souls
-sound
-sounded
-soundedst
-sounder
-soundeth
-sounding
-soundly
-soundness
-sounds
-sour
-source
-sources
-south
-sovereign
-sovereignly
-sowing
-space
-spaces
-spacious
-spake
-spare
-sparedst
-sparks
-sparrow
-sparrows
-speak
-speakers
-speakest
-speaketh
-speaking
-speaks
-special
-species
-specimens
-spectacle
-spectacles
-spectator
-spectators
-speech
-speeches
-speechless
-speed
-speedily
-spend
-spent
-spices
-spider
-spirit
-spirits
-spiritual
-spiritually
-spoil
-spoke
-spoken
-spokest
-sponge
-sport
-sportively
-sports
-spot
-spots
-spouts
-sprang
-spread
-spreadest
-spreading
-spreads
-spring
-springeth
-springs
-sprung
-spurn
-stable
-stablished
-staff
-stage
-stages
-staggered
-stand
-standest
-standeth
-standing
-stands
-stank
-stanza
-stanzas
-star
-starry
-stars
-start
-starting
-startled
-startles
-state
-stated
-stateliness
-statement
-states
-station
-statue
-stature
-status
-stay
-stayed
-stays
-stead
-steadfast
-steal
-stealing
-steals
-stealth
-steep
-steeping
-steer
-steered
-step
-steps
-stick
-sticking
-stiff
-stiffly
-stiffneckedness
-stiffness
-still
-stilled
-stimulus
-stipend
-stir
-stirred
-stirrest
-stirring
-stole
-stolen
-stolidity
-stomach
-stomachs
-stone
-stones
-stood
-stoop
-stooping
-stop
-stopped
-store
-stored
-stores
-stories
-storing
-storm
-stormed
-stormy
-story
-stowed
-straightening
-strained
-strait
-straitly
-straitness
-strange
-strangely
-stranger
-strangers
-strayed
-straying
-stream
-streaming
-streams
-streets
-strength
-strengthen
-strengthened
-strengthenedst
-strengthenest
-strengtheneth
-strengthless
-stretch
-stretched
-stretching
-stricken
-strict
-strictness
-strife
-strifes
-strike
-strikes
-striking
-strings
-stripes
-stripped
-strive
-strives
-striving
-stroke
-strong
-strongholds
-strongly
-struck
-structure
-struggle
-struggled
-struggles
-struggling
-stuck
-student
-students
-studied
-studies
-studious
-studiously
-study
-studying
-stuff
-stumble
-stumbled
-stumbling
-stung
-stupidity
-style
-styled
-subdu
-subdued
-subduedst
-subduing
-subject
-subjected
-subjection
-subjects
-subjoined
-subjoinedst
-subjoins
-sublime
-sublimely
-sublimer
-sublimities
-sublimity
-submit
-submitted
-submitting
-subordinate
-subsequently
-subsist
-subsists
-substance
-substances
-substantial
-subtile
-subtilty
-subtle
-subversion
-subverted
-subverters
-subvertings
-succeed
-succeeded
-succeeding
-succession
-successive
-successively
-succour
-succouredst
-such
-suck
-sucking
-sucklings
-sudden
-suddenly
-sue
-suffer
-suffered
-sufferedst
-sufferest
-suffering
-suffers
-suffice
-sufficed
-sufficest
-sufficeth
-sufficient
-sufficiently
-suffocated
-suffrages
-suggest
-suggested
-suggestion
-suggestions
-suggests
-suitable
-suitably
-summer
-summing
-summit
-sumptuously
-sun
-sunder
-sung
-sunk
-supercelestial
-supereminence
-supereminent
-superfluously
-superior
-superstition
-superstitious
-suppliant
-supplied
-supplies
-support
-supported
-supporting
-suppose
-supposed
-supposing
-suppress
-suppressed
-supreme
-supremely
-sure
-surely
-surf
-surface
-surfeiting
-surmount
-surmounted
-surpassed
-surpasses
-surpassest
-surpassingly
-surprises
-surrounded
-surveyed
-suspect
-suspected
-suspense
-suspicions
-suspicious
-sustenance
-swallowed
-swaying
-sweat
-sweet
-sweeten
-sweetened
-sweeter
-sweetly
-sweetlyvain
-sweetness
-sweetnesses
-swelled
-swelling
-swept
-swerving
-swift
-swiftness
-swine
-swollen
-swoon
-sword
-syllable
-syllables
-symmachus
-sympathy
-syrian
-tabernacle
-table
-take
-taken
-takes
-taketh
-taking
-tale
-talent
-talented
-talents
-tales
-talk
-talked
-talkers
-talketh
-talking
-tame
-tamed
-tamedst
-tamer
-taming
-tardy
-task
-taste
-tasted
-tastes
-tasteth
-tasting
-tattlings
-taught
-taughtest
-taunt
-taunted
-tax
-taxes
-tcosa10
-tcosa10a
-tcosa11
-teach
-teacher
-teachers
-teaches
-teachest
-teacheth
-teaching
-teachings
-tear
-tearful
-tears
-tediousness
-teeming
-teeth
-tell
-tellest
-telleth
-telling
-tells
-temper
-temperament
-temperance
-tempered
-tempers
-tempestuously
-temple
-temples
-temporal
-temporary
-temporately
-tempt
-temptation
-temptations
-tempted
-tempting
-tempts
-ten
-tend
-tender
-tenderly
-tenderness
-tendernesses
-tending
-tends
-tenet
-tenets
-tenor
-terence
-termed
-terms
-terrestrial
-terrible
-terribly
-terrors
-testament
-testified
-testimonies
-testimony
-texas
-text
-texts
-thagaste
-than
-thank
-thankful
-thanks
-thanksgiving
-thanksgivings
-that
-the
-theatre
-theatres
-theatrical
-thee
-theft
-thefts
-their
-theirs
-them
-themselves
-then
-thence
-thenceforth
-there
-thereby
-therefore
-therefrom
-therein
-thereof
-thereon
-thereto
-thereupon
-therewith
-these
-thessalonica
-they
-thick
-thickeneth
-thickets
-thief
-thieve
-thin
-thine
-thing
-things
-think
-thinkest
-thinketh
-thinking
-thinks
-third
-thirdly
-thirst
-thirsted
-thirsteth
-thirsts
-thirtieth
-this
-thither
-thorns
-thoroughly
-those
-thou
-though
-thought
-thoughts
-thousand
-thraldom
-thread
-threatenest
-threatens
-threats
-three
-threefold
-thrice
-thriven
-throat
-throne
-thrones
-throng
-throngs
-through
-throughout
-thrown
-thrust
-thrustedst
-thunder
-thundered
-thunderer
-thunderest
-thundering
-thus
-thwart
-thy
-thyself
-tibi
-tickled
-tide
-tides
-tie
-tilde
-till
-time
-times
-tip
-tire
-tired
-title
-titles
-tm
-to
-tobias
-together
-toil
-toiled
-toiling
-toilsome
-token
-told
-tolerated
-tolerating
-toment
-tomenting
-tomorrow
-tone
-tones
-tongue
-tongues
-too
-took
-tookest
-top
-tore
-torment
-tormented
-torments
-torn
-torpor
-torrent
-torture
-toss
-tossed
-tosses
-total
-touch
-touched
-touchedst
-touching
-toward
-towardliness
-towards
-tower
-town
-townsman
-toys
-trace
-traced
-tracedst
-traces
-track
-trade
-trademark
-tradition
-tragical
-trailed
-trample
-trampled
-tranquil
-tranquillity
-transcribe
-transcription
-transferred
-transferring
-transformed
-transforming
-transgressing
-transgression
-transgressions
-transgressors
-transition
-transitory
-translated
-transmitted
-transparent
-transported
-travail
-travailed
-travailing
-travails
-traveller
-treacherous
-treachery
-tread
-treasure
-treasured
-treasures
-treasury
-treat
-treble
-tree
-trees
-tremble
-trembled
-trembling
-trial
-trials
-tribulation
-tribute
-tried
-triers
-trifles
-trifling
-trillion
-trine
-trinity
-triple
-triumph
-triumphed
-triumpheth
-trod
-trojan
-troop
-troops
-trouble
-troubled
-troubles
-troublesome
-troy
-true
-truer
-truly
-trust
-trustees
-trusting
-truth
-truths
-try
-trying
-tully
-tumbling
-tumult
-tumults
-tumultuous
-tumultuously
-tumultuousness
-tune
-turbulence
-turbulent
-turmoiling
-turmoils
-turn
-turned
-turnest
-turning
-turns
-tutor
-tutors
-twelve
-twentieth
-twenty
-twice
-twinkling
-twins
-twisted
-two
-txt
-ulcerous
-uman
-unabiding
-unable
-unacquainted
-unadorned
-unaided
-unallowed
-unalterable
-unanxious
-unarranged
-unassuming
-unawares
-unbecoming
-unbelievers
-unbelieving
-unbending
-unbeseemingly
-unbounded
-unbroken
-uncase
-unceasing
-uncertain
-uncertainties
-uncertainty
-unchain
-unchangeable
-unchangeableness
-unchangeably
-unchanged
-unclean
-uncleanness
-unconscious
-unconsciously
-uncorrupted
-uncorruptible
-uncorruptness
-uncultivated
-undefilable
-under
-undergo
-underline
-understand
-understandeth
-understanding
-understands
-understood
-undertake
-undertook
-underwent
-undid
-undistracted
-undisturbed
-undo
-unemployed
-unexpected
-unexpectedly
-unexplained
-unfailing
-unfailingly
-unfair
-unfeigned
-unfledged
-unforgotten
-unformed
-unfriendly
-ungodlily
-ungodliness
-ungodly
-ungoverned
-unhappily
-unhappiness
-unhappy
-unharmonising
-unhealthiness
-unhesitatingly
-unholy
-uninjurable
-uninjuriousness
-unintelligible
-unintermitting
-union
-united
-unity
-universal
-universally
-universe
-university
-unjust
-unjustly
-unkindled
-unkindness
-unknowing
-unknowingly
-unknown
-unlawful
-unlearned
-unless
-unlicensed
-unlike
-unlikeliness
-unlikeness
-unliker
-unlimited
-unlocked
-unlooked
-unmarried
-unmeasurable
-unmeasured
-unnatural
-unpassable
-unperceived
-unpermitted
-unpleasantly
-unpraised
-unpunished
-unquiet
-unravelied
-unravelled
-unreal
-unreasoning
-unresolved
-unrighteous
-unrulily
-unruly
-unsating
-unsearchable
-unseemly
-unseen
-unsettled
-unshaken
-unshakenly
-unskilful
-unskilfulness
-unsought
-unsound
-unspeakable
-unstable
-unstayed
-unsuitably
-unsure
-untainted
-unteach
-unteachable
-unthankful
-unthought
-until
-unto
-untruly
-untruth
-unused
-unusual
-unutterable
-unutterably
-unveiled
-unwarmed
-unwearied
-unwholesome
-unwilling
-unwonted
-unworthy
-unyielding
-up
-upborne
-upbraid
-upbraided
-upheld
-upheldest
-uphold
-upliftest
-upon
-upper
-upright
-uprightness
-uproar
-upward
-upwards
-urge
-urged
-urgedst
-urgently
-us
-usa
-usage
-use
-used
-useful
-usefully
-users
-uses
-useth
-ushered
-using
-usual
-usually
-usury
-utensils
-utmost
-utter
-utterance
-uttered
-uttereth
-utterly
-vacation
-vagrant
-vail
-vain
-vainglorious
-vainly
-valentinian
-valiant
-valley
-valuable
-value
-valued
-vanilla
-vanished
-vanities
-vanity
-vanquished
-vapours
-variable
-variableness
-variance
-variation
-variations
-varied
-varies
-varieties
-variety
-various
-variously
-vary
-varying
-vast
-vaster
-vaunt
-vehemence
-vehement
-vehemently
-veil
-veiled
-vein
-venerable
-vengeance
-vent
-venture
-ventures
-venturing
-venus
-ver
-verecundus
-verily
-verity
-vermont
-verse
-verses
-version
-versions
-very
-vessel
-vessels
-vestige
-vex
-vexed
-vi
-vice
-vices
-viciousness
-vicissitude
-vicissitudes
-victim
-victor
-victorinus
-victorious
-victory
-view
-viewing
-vigorous
-vigour
-vii
-viii
-vile
-vileness
-villa
-villainies
-vindicating
-vindicianus
-vineyard
-vintage
-violated
-violence
-violent
-violets
-viper
-virgil
-virgin
-virginity
-virgins
-virtue
-virtuous
-virus
-visible
-vision
-visions
-vital
-vivid
-vocal
-vocally
-voice
-voices
-void
-volume
-volumes
-voluntarily
-volunteers
-voluptuous
-voluptuousness
-vomited
-vouchsafe
-vouchsafed
-vouchsafedst
-vouchsafest
-vow
-vowed
-vowing
-vows
-voyage
-vulgar
-waft
-waged
-wages
-wail
-wait
-waited
-waiting
-waking
-walk
-walked
-walking
-walks
-wallow
-wallowed
-walls
-wander
-wandered
-wanderer
-wandering
-wanderings
-want
-wanted
-wanting
-wanton
-wantonly
-wantonness
-wants
-war
-warfare
-warmth
-warned
-warning
-warped
-warranted
-warranties
-warranty
-warreth
-warring
-wars
-was
-wash
-washing
-wast
-waste
-wasted
-wasting
-watch
-watched
-watchfully
-watchings
-water
-watered
-waterest
-waters
-watery
-waver
-wavered
-wavering
-waves
-wavy
-wax
-way
-wayfaring
-ways
-wayward
-we
-weak
-weaken
-weakened
-weaker
-weakest
-weakly
-weakness
-weaknesses
-weal
-wealth
-wealthy
-weapon
-wear
-wearied
-weariness
-wearing
-wearisome
-weary
-weaving
-wedlock
-weep
-weeping
-weeps
-weigh
-weighed
-weigheth
-weighing
-weight
-weights
-weighty
-welcome
-well
-weltering
-went
-wept
-were
-wert
-whales
-what
-whatever
-whatsoever
-wheat
-wheel
-when
-whence
-whencesoever
-whenever
-where
-whereas
-whereat
-whereby
-wherefore
-wherefrom
-wherein
-whereof
-whereon
-wheresoever
-whereto
-whereupon
-wherever
-wherewith
-whether
-which
-whichsoever
-while
-whilst
-whirling
-whirlings
-whirlpool
-whirlpools
-whispered
-whisperings
-whispers
-whit
-white
-whither
-whithersoever
-whitherto
-whitherward
-who
-whoever
-whole
-wholesome
-wholesomely
-wholesomeness
-wholly
-whom
-whomever
-whoring
-whose
-whoso
-whosoever
-why
-wicked
-wickedly
-wickedness
-wide
-widow
-widows
-wife
-wild
-wilderness
-wildness
-wilfully
-wilfulness
-will
-willed
-willedst
-willest
-willeth
-willing
-willingly
-wills
-wilt
-win
-wind
-winding
-windings
-window
-winds
-windus
-windy
-wine
-wings
-winked
-winning
-wins
-wipe
-wisdom
-wise
-wisely
-wiser
-wish
-wished
-wishes
-wishing
-wit
-with
-withal
-withdraw
-withdrawing
-withdrawn
-withdrew
-wither
-withered
-withering
-within
-without
-withstood
-witness
-witnesses
-witting
-wittingly
-wives
-wizard
-woe
-woes
-woke
-woman
-womanish
-womb
-women
-won
-wonder
-wondered
-wonderful
-wonderfully
-wonderfulness
-wondering
-wonders
-wondrous
-wondrously
-wont
-wonted
-wood
-wooden
-wooed
-word
-wordly
-words
-wordy
-work
-workest
-worketh
-workhouse
-working
-workings
-workmanship
-workmaster
-works
-world
-worldly
-worlds
-worm
-worn
-worse
-worship
-worshipped
-worshipper
-worshippers
-worshipping
-worsted
-worthless
-worthy
-would
-wouldest
-wound
-wounded
-woundest
-wounds
-wove
-wrap
-wrath
-wrench
-wrested
-wretch
-wretched
-wretchedness
-wring
-wrinkle
-writ
-write
-writer
-writing
-writings
-written
-wrong
-wronged
-wronging
-wrote
-wroth
-wrought
-wyoming
-ye
-yea
-year
-years
-yes
-yesterday
-yet
-yield
-yielded
-yieldeth
-yielding
-yields
-yoke
-you
-young
-younger
-your
-yourselves
-youth
-youthful
-youthfulness
-youths
-zeal
-zealous
-zealously
-zip
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/Gr.HH.HTML b/public/Wb/Home/Src/Adam/Gr/Gr.HH.HTML deleted file mode 100755 index ff8d3f2..0000000 --- a/public/Wb/Home/Src/Adam/Gr/Gr.HH.HTML +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - -
-#help_index "Sprites/Binary"
-
-class CMeshTri
-{
-  I32 color;    //Give one of 0-7 colors.
-//Colors 8-15 are 0-7 with intensity bit set.
-  I32 nums[3];  //Vertex number
-};
-
-class CQueMeshTri
-{
-  CQueMeshTri *next,*last;
-  U0 start;
-  I32 color;
-  I32 nums[3];
-};
-
-public class CSpriteBase
-{
-  U8 type;
-};
-
-public class CSpriteColor : CSpriteBase
-{
-  U8 color;
-};
-
-public class CSpriteDitherColor : CSpriteBase
-{
-  U16 dither_color;
-};
-
-public class CSpriteT : CSpriteBase
-{
-  I32 thick;
-};
-
-public class CSpritePt : CSpriteBase
-{
-  I32 x1;
-  I32 y1;
-};
-
-public class CSpritePtRad : CSpritePt
-{
-  I32 radius;
-};
-
-public class CSpritePtPt : CSpritePt
-{
-  I32 x2;
-  I32 y2;
-};
-
-public class CSpritePtPtAng : CSpritePtPt
-{
-  F64 angle;
-};
-
-public class CSpritePtWH : CSpritePt
-{
-  I32 width;
-  I32 height;
-};
-
-public class CSpritePtWHU8s : CSpritePtWH
-{
-  U8 u[0];
-};
-
-public class CSpritePtWHAng : CSpritePtWH
-{
-  F64 angle;
-};
-
-public class CSpritePtWHAngSides : CSpritePtWHAng
-{
-  I32 sides;
-};
-
-public class CSpriteNumU8s : CSpriteBase
-{
-  I32 num;
-  U8  u[0];
-};
-
-public class CSpriteNumPtU8s : CSpriteBase
-{
-  I32 num;
-  I32 x;
-  I32 y;
-  U8  u[0];
-};
-
-public class CSpritePtStr : CSpritePt
-{
-  U8  st[0];
-};
-
-public class CSpriteMeshU8s : CSpriteBase
-{
-  I32 vertex_cnt;
-  I32 tri_cnt;
-  U8  u[0];
-};
-
-public class CSpritePtMeshU8s : CSpriteBase
-{
-  I32 x;
-  I32 y;
-  I32 z;
-  I32 vertex_cnt;
-  I32 tri_cnt;
-  U8  u[0];
-};
-
-#define SPF_SEL                 128
-#define SPf_SEL                 7
-
-#define SPT_END                 0       //CSpriteBase
-#define SPT_COLOR               1       //CSpriteColor
-#define SPT_DITHER_COLOR        2       //CSpriteDitherColor
-#define SPT_THICK               3       //CSpriteT
-#define SPT_PLANAR_SYMMETRY     4       //CSpritePtPt
-#define SPT_TRANSFORM_ON        5       //CSpriteBase
-#define SPT_TRANSFORM_OFF       6       //CSpriteBase
-#define SPT_SHIFT               7       //CSpritePt
-#define SPT_PT                  8       //CSpritePt
-#define SPT_POLYPT              9       //CSpriteNumPtU8s
-#define SPT_LINE                10      //CSpritePtPt
-#define SPT_POLYLINE            11      //CSpriteNumU8s
-#define SPT_RECT                12      //CSpritePtPt
-#define SPT_ROTATED_RECT        13      //CSpritePtPtAng
-#define SPT_CIRCLE              14      //CSpritePtRad
-#define SPT_ELLIPSE             15      //CSpritePtWHAng
-#define SPT_POLYGON             16      //CSpritePtWHAngSides
-#define SPT_BSPLINE2            17      //CSpriteNumU8s
-#define SPT_BSPLINE2_CLOSED     18      //CSpriteNumU8s
-#define SPT_BSPLINE3            19      //CSpriteNumU8s
-#define SPT_BSPLINE3_CLOSED     20      //CSpriteNumU8s
-#define SPT_FLOOD_FILL          21      //CSpritePt
-#define SPT_FLOOD_FILL_NOT      22      //CSpritePt
-#define SPT_BITMAP              23      //CSpritePtWHU8s
-#define SPT_MESH                24      //CSpriteMeshU8s See ::/Apps/GrModels.
-#define SPT_SHIFTABLE_MESH      25      //CSpritePtMeshU8s See ::/Apps/GrModels.
-#define SPT_ARROW               26      //CSpritePtPt
-#define SPT_TEXT                27      //CSpritePtStr
-#define SPT_TEXT_BOX            28      //CSpritePtStr
-#define SPT_TEXT_DIAMOND        29      //CSpritePtStr
-#define SPT_TYPES_NUM           30
-#define SPG_TYPE_MASK           0x7F
-
-#help_index "Graphics/Sprite;Sprites;Sprites/Binary"
-
-//See Sprites.  See ::/Adam/Gr/GrSpritePlot.HC and
-//::/Demo/Graphics/SpriteRaw.HC for how CSprite are stored.
-public class CSprite
-{
-  CSprite *next,*last;
-  U0 start;
-  union {
-    U8 type;
-    CSpriteBase         b;
-    CSpriteColor        c;
-    CSpriteDitherColor  d;
-    CSpriteT            t;
-    CSpritePt           p;
-    CSpritePtPt         pp;
-    CSpritePtPtAng      ppa;
-    CSpritePtRad        pr;
-    CSpritePtWHU8s      pwhu;
-    CSpritePtWHAng      pwha;
-    CSpritePtWHAngSides pwhas;
-    CSpriteNumU8s       nu;
-    CSpriteNumPtU8s     npu;
-    CSpriteMeshU8s      mu;
-    CSpritePtMeshU8s    pmu;
-    CSpritePtStr        ps;
-  }
-};
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrAsm.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrAsm.HC.HTML deleted file mode 100755 index 64840f8..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrAsm.HC.HTML +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Misc"
-asm {
-//************************************
-_GR_UPDATE_LINE64::
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-
-        MOV     RAX,U64 SF_ARG2[RBP]
-        MOV     RSI,U64 [RAX]           //rsi=src
-        MOV     RBX,U64 [&rev_bits_table]
-        MOV     RCX,U64 SF_ARG3[RBP]    //rcx=d
-        MOV     RAX,U64 SF_ARG4[RBP]
-        MOV     RDI,U64 [RAX]           //rdi=image
-
-        MOV     RAX,U64 SF_ARG1[RBP]
-        MOV     R8,U64 [RAX]            //rbp=vga dst
-
-@@05:   LODSQ
-        CMP     U64 [RDI],RAX
-        JE      @@10
-        MOV     U64 [RDI],RAX
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        MOV     U64 [R8],RAX
-@@10:   ADD     RDI,8
-        ADD     R8,8
-        DEC     RCX
-        JNZ     @@05
-
-        MOV     RAX,U64 SF_ARG1[RBP]
-        MOV     U64 [RAX],R8
-        MOV     RAX,U64 SF_ARG4[RBP]
-        MOV     U64 [RAX],RDI
-        MOV     RAX,U64 SF_ARG2[RBP]
-        MOV     U64 [RAX],RSI
-        POP     RDI
-        POP     RSI
-        POP     RBP
-        RET1    32
-//************************************
-_GR_UPDATE_LINE64_FLUSH_CACHE::
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-
-        MOV     RAX,U64 SF_ARG2[RBP]
-        MOV     RSI,U64 [RAX]           //rsi=src
-        MOV     RBX,U64 [&rev_bits_table]
-        MOV     RCX,U64 SF_ARG3[RBP]    //rcx=d
-        MOV     RAX,U64 SF_ARG4[RBP]
-        MOV     RDI,U64 [RAX]           //rdi=image
-
-        MOV     RAX,U64 SF_ARG1[RBP]
-        MOV     R8,U64 [RAX]            //rbp=vga dst
-
-@@05:   LODSQ
-        MOV     U64 [RDI],RAX
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        XLATB
-        ROR     RAX,8
-        MOV     U64 [R8],RAX
-        ADD     RDI,8
-        ADD     R8,8
-        DEC     RCX
-        JNZ     @@05
-
-        MOV     RAX,U64 SF_ARG1[RBP]
-        MOV     U64 [RAX],R8
-        MOV     RAX,U64 SF_ARG4[RBP]
-        MOV     U64 [RAX],RDI
-        MOV     RAX,U64 SF_ARG2[RBP]
-        MOV     U64 [RAX],RSI
-        POP     RDI
-        POP     RSI
-        POP     RBP
-        RET1    32
-//************************************
-_DC_BLOT_COLOR4::
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-        PUSH    R10
-
-        MOV     RDI,U64 SF_ARG1[RBP]
-        MOV     RSI,U64 SF_ARG2[RBP]
-        MOV     RBX,U64 SF_ARG3[RBP]
-        MOV     RCX,U64 SF_ARG4[RBP]
-
-        MOV     R8,RDI
-        ADD     R8,RCX
-        MOV     R9,R8
-        ADD     R9,RCX
-        MOV     R10,R9
-        ADD     R10,RCX
-
-@@5:    LODSQ
-        MOV     RDX,U64 [RBX]
-        CMP     RAX,RDX
-        JE      I32 @@10
-        MOV     U64 [RBX],RAX
-
-        XOR     RDX,RDX
-        BT      RAX,7*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,6*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,5*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,4*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,3*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,2*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,1*8+0
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,0*8+0
-        ADC     RDX,0
-        MOV     U8 [RDI],DL
-
-        XOR     RDX,RDX
-        BT      RAX,7*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,6*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,5*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,4*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,3*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,2*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,1*8+1
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,0*8+1
-        ADC     RDX,0
-        MOV     U8 [R8],DL
-
-        XOR     RDX,RDX
-        BT      RAX,7*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,6*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,5*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,4*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,3*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,2*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,1*8+2
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,0*8+2
-        ADC     RDX,0
-        MOV     U8 [R9],DL
-
-        XOR     RDX,RDX
-        BT      RAX,7*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,6*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,5*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,4*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,3*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,2*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,1*8+3
-        ADC     RDX,0
-        SHL1    RDX
-        BT      RAX,0*8+3
-        ADC     RDX,0
-        MOV     U8 [R10],DL
-
-@@10:   ADD     RBX,8
-
-        INC     RDI
-        INC     R8
-        INC     R9
-        INC     R10
-
-        DEC     RCX
-        JNZ     I32 @@5
-
-        POP     R10
-        POP     RDI
-        POP     RSI
-        POP     RBP
-        RET1    32
-//************************************
-_IS_PIX_COVERED0::
-        PUSH    RBP
-        MOV     RBP,RSP
-#assert FONT_WIDTH==FONT_HEIGHT==8
-        MOV     RCX,U64 SF_ARG3[RBP]
-        SAR     RCX,3
-        MOV     RAX,U64 SF_ARG2[RBP]
-        SAR     RAX,3
-        MOV     RDX,U64 SF_ARG1[RBP]
-        IMUL2   RCX,TEXT_COLS
-        MOV     RBX,U64 [&gr.win_z_buf]
-        MOV     DX,U16 CTask.win_z_num[RDX]
-        ADD     RCX,RAX
-        XOR     RAX,RAX
-        CMP     DX,U16 [RBX+RCX*2]
-        JAE     @@05    //Jump not covered
-        INC     RAX
-@@05:   POP     RBP
-        RET1    24
-//************************************
-_GR_ROP_EQU_U8_NO_CLIPPING::
-//Puts foreground char shape onto gr.dc2.
-//ch.u8[1] is color as a whole byte
-//ch ATTRf_UNDERLINE attr flag is used.
-        PUSH    RBP
-        MOV     RBP,RSP
-        MOVZX   RAX,U8 SF_ARG1[RBP]
-        MOV     RDX,U64 [&text.font]
-        MOV     RAX,U64 [RDX+RAX*8]     //RAX is 8x8 char font data, 64-bits
-        BT      U64 SF_ARG1[RBP],ATTRf_UNDERLINE
-        JNC     @@05
-        MOV     RBX,0xFF00000000000000
-        OR      RAX,RBX
-@@05:   TEST    RAX,RAX
-        JZ      I32 @@10
-
-        PUSH    RSI
-        PUSH    RDI
-        MOVZX   RBX,U8 SF_ARG1+1[RBP]   //Warning color is 8-bit
-        MOV     RDX,U64 [&gr.to_8_colors]
-        MOV     R8,U64 [RDX+RBX*8]      //R8 is color repeated 8 times.
-        MOV     R9,U64 SF_ARG3[RBP]     //R9 is width_internal
-        MOV     RDI,U64 SF_ARG2[RBP]
-        MOV     RSI,U64 [&gr.to_8_bits] //RSI is gr.to_8_bits
-
-//      m=my_1_to_8_bits[ch&255];ch>>=8;
-//      *dst=*dst&~m|c&m;
-//      dst(U8 *)+=w1;
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOVZX   RBX,AL
-        MOV     RDX,U64 [RSI+RBX*8]
-        SHR     RAX,8
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-        ADD     RDI,R9
-
-        MOV     RDX,U64 [RSI+RAX*8]
-        MOV     RBX,U64 [RDI]
-        MOV     RCX,RDX
-        NOT     RCX
-        AND     RDX,R8
-        AND     RCX,RBX
-        OR      RCX,RDX
-        MOV     U64 [RDI],RCX
-
-        POP     RDI
-        POP     RSI
-@@10:   POP     RBP
-        RET1    24
-}
-_extern _GR_ROP_EQU_U8_NO_CLIPPING U0 GrRopEquU8NoClipping(I64 ch,
-        U8 *dst,I64 width_internal);
-public _extern _IS_PIX_COVERED0 Bool IsPixCovered0(
-        CTask *task,I64 x,I64 y);//No clipping
-
-_extern _GR_UPDATE_LINE64 U0 GrUpdateLine64(
-  U64 **_vga,U64 **_src,I64 d,U8 **_dst);
-_extern _GR_UPDATE_LINE64_FLUSH_CACHE U0 GrUpdateLine64FlushCache(
-  U64 **_vga,U64 **_src,I64 d,U8 **_dst);
-_extern _DC_BLOT_COLOR4 U0 DCBlotColor4(
-  U8 *dst,I64 *img,I64 *img_cache,I64 cnt);
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrBitMap.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrBitMap.HC.HTML deleted file mode 100755 index 94abc58..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrBitMap.HC.HTML +++ /dev/null @@ -1,2085 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-
-Option(OPTf_WARN_HEADER_MISMATCH,OFF);
-public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
-{//2D. No clipping or transformation or thick.
-  U8 *dst;
-  I32 *db;
-  I64 d,dist;
-  CColorROPU32 c,color=dc->color,bkcolor=dc->bkcolor;
-
-  if (dc->flags & DCF_LOCATE_NEAREST) {
-    dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_RECORD_EXTENTS) {
-    if (x<dc->min_x) dc->min_x=x;
-    if (x>dc->max_x) dc->max_x=x;
-    if (y<dc->min_y) dc->min_y=y;
-    if (y>dc->max_y) dc->max_y=y;
-  }
-  if (dc->flags & DCF_DONT_DRAW)
-    return TRUE;
-  d=dc->width_internal*y+x;
-  if (db=dc->depth_buf) {
-    db+=d;
-    if (0<=dc->db_z<=*db)
-      *db=dc->db_z;
-    else
-      return TRUE;
-  }
-  if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
-    if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
-      if (RandU16<dc->dither_probability_u16) {
-        color.c1.rop=color.c0.rop;
-        color.c0=color.c1;
-      }
-    } else {
-      if ((x^y)&1) {
-        color.c1.rop=color.c0.rop;
-        color.c0=color.c1;
-      }
-    }
-  }
-  dst=dc->body+d;
-  switch [color.c0.rop] {
-    case ROPB_EQU:
-    case ROPB_MONO:
-      *dst=color.c0.color;
-      break;
-    case ROPB_COLLISION:
-      c=*dst;
-      if (c!=TRANSPARENT && c!=bkcolor.c0.color)
-        dc->collision_cnt++;
-      break;
-    case ROPB_XOR:
-      *dst^=color.c0.color;
-      break;
-  }
-  return TRUE;
-}
-Option(OPTf_WARN_HEADER_MISMATCH,ON);
-
-public I64 GrPeek0(CDC *dc=gr.dc,I64 x,I64 y)
-{//2D. No clipping or transformation.
-  return dc->body[dc->width_internal*y+x];
-}
-
-#help_index "Graphics;Graphics/Device Contexts"
-
-public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
-{//2D. Clipping but not transformation..
-  I64 i,j,k,k1,kk,kk1,w1,h1,w2,h2,dist,
-        leading_pixels,leading_pixel_mask,whole_I64s,
-        trailing_pixels,trailing_pixel_mask,
-        reg bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,
-        color_mask;
-  U8 reg *dst,*src;
-  I32 *db;
-  U16 reg *win_z_buf_ptr;
-  CColorROPU32 color,c,old_color;
-  CTask *win_task;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->scroll_x;
-    y+=win_task->scroll_y;
-  }
-  if (x<0)
-    w1=-x;
-  else
-    w1=0;
-  if (y<0)
-    h1=-y;
-  else
-    h1=0;
-  w2=img->width;
-  h2=img->height;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x+=win_task->pix_left;
-    y+=win_task->pix_top;
-  }
-  if (dc->flags & DCF_LOCATE_NEAREST) {
-    dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    if (x+w1<0) w1=-x;
-    if (x+w2>win_task->pix_right+1)
-      w2=win_task->pix_right+1-x;
-
-    if (y+h1<0) h1=-y;
-    if (y+h2>win_task->pix_bottom+1)
-      h2=win_task->pix_bottom+1-y;
-  }
-  if (x+w2>dc->width)
-    w2=dc->width-x;
-  if (y+h2>dc->height)
-    h2=dc->height-y;
-  if (w1<w2<=img->width && h1<h2<=img->height) {
-    if (dc->flags & DCF_RECORD_EXTENTS) {
-      if (x+w1<dc->min_x) dc->min_x=x+w1;
-      if (x+w2-1>dc->max_x) dc->max_x=x+w2-1;
-      if (y+h1<dc->min_y) dc->min_y=y+h1;
-      if (y+h2-1>dc->max_y) dc->max_y=y+h2-1;
-    }
-    if (dc->flags & DCF_DONT_DRAW)
-      return 1;
-    old_color=dc->color;
-    db=dc->depth_buf;
-    dc->depth_buf=NULL;
-    dc->color&=~ROPF_DITHER;
-    color=dc->color;
-    leading_pixels=-(w1+x)&7;
-    leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels];
-    bit_shift=-x&7;
-    whole_I64s=(w2-w1-leading_pixels)>>3;
-    if (whole_I64s<0) whole_I64s=0;
-    trailing_pixels=(x+w2)&7;
-    trailing_pixel_mask=gr.to_8_bits[0xFF<<trailing_pixels&0xFF];
-    if (leading_pixels+trailing_pixels>w2-w1) {
-      leading_pixel_mask|=trailing_pixel_mask;
-      trailing_pixels=0;
-    }
-    switch (color.c0.rop) {
-      case ROPB_COLLISION: //TODO: Might want to check win_z_buf
-        color =dc->bkcolor.c0.color;
-        k=h1*img->width_internal;
-        k1=(h1+y)*dc->width_internal+x;
-        for (j=h2-h1;j;j--) {
-          for (i=w1;i<w2;i++) {
-            c=dc->body[k1+i];
-            if (c!=TRANSPARENT&&c!=color&&img->body[k+i]!=TRANSPARENT)
-              dc->collision_cnt++;
-          }
-          k+=img->width_internal;
-          k1+=dc->width_internal;
-        }
-        break;
-      case ROPB_MONO:
-        color_mask=gr.to_8_colors[color.c0.color];
-        if (img->flags&DCF_NO_TRANSPARENTS) {
-          if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
-            win_z_buf_ptr=NULL;
-          else {
-            win_z_num=win_task->win_z_num;
-            win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+
-                  (w1+x)/FONT_WIDTH)*sizeof(U16);
-            win_z_buf_line_dec=whole_I64s;
-            if (leading_pixels)
-              win_z_buf_line_dec++;
-            if (trailing_pixels)
-              win_z_buf_line_dec++;
-            win_z_buf_line_dec*=sizeof(U16);
-            win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-          }
-          kk = h1   *img ->width_internal+w1;
-          kk1=(h1+y)*dc->width_internal+x+w1;
-          kk =(kk-bit_shift)&~7+bit_shift;
-          bit_shift*=8;
-          if (win_z_buf_ptr)
-            for (j=h1;j<h2;j++) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (win_z_num>=*win_z_buf_ptr++) {
-                  if (bit_shift)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          (*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift))&
-                          ~leading_pixel_mask&color_mask;
-                  else
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          *src(I64 *)++&~leading_pixel_mask&color_mask;
-                } else {
-                  src(I64 *)++;
-                  dst(I64 *)++;
-                }
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++=(*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift))&color_mask;
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              else
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++=*src(I64 *)++&color_mask;
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&
-                        ~trailing_pixel_mask&color_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *src(I64 *)++&~trailing_pixel_mask&color_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-              if ((j+y)&7==7)
-                win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-              else
-                win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-            }
-          else
-            for (j=h2-h1;j;j--) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&
-                        ~leading_pixel_mask&color_mask;
-                else
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        *src(I64 *)++&~leading_pixel_mask&color_mask;
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++=(*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&color_mask;
-              else
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++=*src(I64 *)++&color_mask;
-
-              if (trailing_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&
-                        ~trailing_pixel_mask&color_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *src(I64 *)++&~trailing_pixel_mask&color_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-            }
-        } else {
-          k=h1*img->width_internal;
-          if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
-            for (j=h1;j<h2;j++) {
-              for (i=w1;i<w2;i++)
-                if (img->body[k+i])
-                  GrPlot0(dc,x+i,y+j);
-              k+=img->width_internal;
-            }
-          } else {
-            win_z_num           =win_task->win_z_num;
-            win_z_buf_ptr       =gr.win_z_buf(U8 *)+
-                  ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16);
-            win_z_buf_line_dec=whole_I64s;
-            if (leading_pixels)
-              win_z_buf_line_dec++;
-            if (trailing_pixels)
-              win_z_buf_line_dec++;
-            win_z_buf_line_dec*=sizeof(U16);
-            win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-            for (j=h1;j<h2;j++) {
-              if (win_z_num>=*win_z_buf_ptr++)
-                color_mask=TRUE;
-              else
-                color_mask=FALSE;
-              for (i=w1;i<w2;) {
-                if (color_mask)
-                  if (img->body[k+i])
-                    GrPlot0(dc,x+i,y+j);
-                if (!((++i+x) &7) && i<w2) {
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    color_mask=TRUE;
-                  else
-                    color_mask=FALSE;
-                }
-              }
-              if ((j+y)&7==7)
-                win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-              else
-                win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-              k+=img->width_internal;
-            }
-          }
-        }
-        break;
-      case ROPB_EQU:
-        if (img->flags&DCF_NO_TRANSPARENTS) {
-          if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
-            win_z_buf_ptr=NULL;
-          else {
-            win_z_num=win_task->win_z_num;
-            win_z_buf_ptr=gr.win_z_buf(U8 *)+
-                  ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16);
-            win_z_buf_line_dec=whole_I64s;
-            if (leading_pixels)
-              win_z_buf_line_dec++;
-            if (trailing_pixels)
-              win_z_buf_line_dec++;
-            win_z_buf_line_dec*=sizeof(U16);
-            win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-          }
-          kk = h1   *img ->width_internal+w1;
-          kk1=(h1+y)*dc->width_internal+x+w1;
-          kk =(kk-bit_shift)&~7+bit_shift;
-          bit_shift*=8;
-          if (win_z_buf_ptr)
-            for (j=h1;j<h2;j++) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (win_z_num>=*win_z_buf_ptr++) {
-                  if (bit_shift)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          (*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask;
-                  else
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          *src(I64 *)++&~leading_pixel_mask;
-                } else {
-                  src(I64 *)++;
-                  dst(I64 *)++;
-                }
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++=*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift);
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              else
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++=*src(I64 *)++;
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *src(I64 *)++&~trailing_pixel_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-              if ((j+y)&7==7)
-                win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-              else
-                win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-            }
-          else
-            for (j=h2-h1;j;j--) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask;
-                else
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        *src(I64 *)++&~leading_pixel_mask;
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++=*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift);
-              else
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++=*src(I64 *)++;
-
-              if (trailing_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *src(I64 *)++&~trailing_pixel_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-            }
-        } else {
-here1a:
-          k=h1*img->width_internal;
-          if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
-            for (j=h1;j<h2;j++) {
-              for (i=w1;i<w2;i++) {
-                c=img->body[k+i];
-                if (c!=TRANSPARENT) {
-                  dc->color.c0.color=c;
-                  GrPlot0(dc,x+i,y+j);
-                }
-              }
-              k+=img->width_internal;
-            }
-          } else {
-            win_z_num           =win_task->win_z_num;
-            win_z_buf_ptr       =gr.win_z_buf(U8 *)+
-                  ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16);
-            win_z_buf_line_dec=whole_I64s;
-            if (leading_pixels)
-              win_z_buf_line_dec++;
-            if (trailing_pixels)
-              win_z_buf_line_dec++;
-            win_z_buf_line_dec*=sizeof(U16);
-            win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-            for (j=h1;j<h2;j++) {
-              if (win_z_num>=*win_z_buf_ptr++)
-                color_mask=TRUE;
-              else
-                color_mask=FALSE;
-              for (i=w1;i<w2;) {
-                if (color_mask) {
-                  c=img->body[k+i];
-                  if (c!=TRANSPARENT) {
-                    dc->color.c0.color=c;
-                    GrPlot0(dc,x+i,y+j);
-                  }
-                }
-                if (!((++i+x) &7) && i<w2) {
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    color_mask=TRUE;
-                  else
-                    color_mask=FALSE;
-                }
-              }
-              if ((j+y)&7==7)
-                win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-              else
-                win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-              k+=img->width_internal;
-            }
-          }
-          dc->color=color;
-        }
-        break;
-      case ROPB_XOR:
-        if (img->flags&DCF_NO_TRANSPARENTS) {
-          if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
-            win_z_buf_ptr=NULL;
-          else {
-            win_z_num=win_task->win_z_num;
-            win_z_buf_ptr=gr.win_z_buf(U8 *)+
-                  ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16);
-            win_z_buf_line_dec=whole_I64s;
-            if (leading_pixels)
-              win_z_buf_line_dec++;
-            if (trailing_pixels)
-              win_z_buf_line_dec++;
-            win_z_buf_line_dec*=sizeof(U16);
-            win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-          }
-          kk = h1   *img ->width_internal  +w1;
-          kk1=(h1+y)*dc->width_internal+x+w1;
-          kk =(kk-bit_shift)&~7+bit_shift;
-          bit_shift*=8;
-          if (win_z_buf_ptr)
-            for (j=h1;j<h2;j++) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (win_z_num>=*win_z_buf_ptr++) {
-                  if (bit_shift)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          (*dst(I64 *)^(*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask;
-                  else
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask;
-                } else {
-                  src(I64 *)++;
-                  dst(I64 *)++;
-                }
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++^=*src(U64 *)++>>bit_shift|
-                          *src(I64 *)<<(64-bit_shift);
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              else
-                for (i=0;i<whole_I64s;i++)
-                  if (win_z_num>=*win_z_buf_ptr++)
-                    *dst(I64 *)++^=*src(I64 *)++;
-                  else {
-                    src(I64 *)++;
-                    dst(I64 *)++;
-                  }
-              if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*dst(I64 *)^(*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-              if ((j+y)&7==7)
-                win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-              else
-                win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-            }
-          else
-            for (j=h2-h1;j;j--) {
-              src=img->body+kk&~7;
-              dst=dc->body+kk1&~7;
-              if (leading_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        (*dst(I64 *)^(*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask;
-                else
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask;
-              }
-              if (bit_shift)
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++^=*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift);
-              else
-                for (i=0;i<whole_I64s;i++)
-                  *dst(I64 *)++^=*src(I64 *)++;
-              if (trailing_pixels) {
-                if (bit_shift)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*dst(I64 *)^(*src(U64 *)++>>bit_shift|
-                        *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask;
-                else
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask;
-              }
-              kk +=img->width_internal;
-              kk1+=dc->width_internal;
-            }
-        } else
-          goto here1a;
-        break;
-    }
-    dc->depth_buf=db;
-    dc->color=old_color;
-    return 1;
-  } else
-    return 0;
-}
-
-#help_index "Graphics/Device Contexts"
-
-U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor)
-{
-  I64 c,k,i=src_size*2,i1=i>>3;
-  for (k=0;k<i;k++) {
-    c=0;
-    if (Bt(src     ,k)) c|=1;
-    if (Bt(src+i1  ,k)) c|=2;
-    if (Bt(src+i1*2,k)) c|=4;
-    if (Bt(src+i1*3,k)) c|=8;
-    if (c==bkcolor) c=TRANSPARENT;
-    *dst++=c;
-  }
-  return dst;
-}
-
-U8 *GrBitMap1ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor)
-{
-  I64 c,k,i=src_size*8;
-  for (k=0;k<i;k++) {
-    c=0;
-    if (Bt(src,k))  c=COLOR_MONO;
-    if (c==bkcolor) c=TRANSPARENT;
-    *dst++=c;
-  }
-  return dst;
-}
-
-public CDC *DCExt(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
-        CTask *task=NULL)
-{//Extract new device context rect from device context.
-  CDC *res;
-  CTask *win_task;
-  if (x1>x2) SwapI64(&x1,&x2);
-  if (y1>y2) SwapI64(&y1,&y2);
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x1+=win_task->pix_left+win_task->scroll_x;
-    y1+=win_task->pix_top +win_task->scroll_y;
-    x2+=win_task->pix_left+win_task->scroll_x;
-    y2+=win_task->pix_top +win_task->scroll_y;
-  }
-  res=DCNew(x2-x1+1,y2-y1+1,task);
-  DCFill(res);
-  GrBlot(res,-x1,-y1,dc);
-  return res;
-}
-
-public CDC *DCDiff(CDC *base,CDC *update)
-{//Trim to win of what has chged.
-  I64 i,x1=0,y1=0,x2=update->width-1,y2=update->height-1; //inclusive
-  U32 *ptr_base,*ptr_update;
-  CDC *res;
-  ptr_base  =base->body;
-  ptr_update=update->body;
-  while (y1<=y2) {
-    i=update->width>>2;
-    while (i--)
-      if (*ptr_base++!=*ptr_update++)
-        goto df_y2;
-    i=update->width&3;
-    while (i--)
-      if (*ptr_base(U8 *)++!=*ptr_update(U8 *)++)
-        goto df_y2;
-    y1++;
-  }
-  return NULL;
-df_y2:
-  ptr_base  =base->body  +base->width_internal  *base->height;
-  ptr_update=update->body+update->width_internal*update->height;
-  while (y1<y2) {
-    i=update->width>>2;
-    while (i--)
-      if (*--ptr_base!=*--ptr_update)
-        goto df_x1;
-    i=update->width&3;
-    while (i--)
-      if (*--ptr_base(U8 *)!=*--ptr_update(U8 *))
-        goto df_x1;
-    y2--;
-  }
-df_x1:
-  while (x1<x2) {
-    for (i=y1;i<=y2;i++)
-      if (GrPeek0(base,x1,i)!=GrPeek0(update,x1,i))
-         goto df_x2;
-    x1++;
-  }
-df_x2:
-  while (x1<x2) {
-    for (i=y1;i<=y2;i++)
-      if (GrPeek0(base,x2,i)!=GrPeek0(update,x2,i))
-         goto df_done;
-    x2--;
-  }
-df_done:
-  res=DCExt(update,x1,y1,x2,y2);
-  res->x0=x1;
-  res->y0=y1;
-  return res;
-}
-
-#help_index "Graphics/Char;Char/Graphics"
-
-public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
-{//2D. Clipping but not transformation.
-  U8 reg *src,reg *dst,*font_ptr;
-  I64 i,m,leading_pixels,trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
-        j,k1,kk1,w1,h1,w2,h2,reg bit_shift,reg color_mask,dist;
-  CColorROPU32 color,c;
-  CTask *win_task;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->scroll_x;
-    y+=win_task->scroll_y;
-  }
-
-  if (x<0)
-    w1=-x;
-  else
-    w1=0;
-  if (y<0)
-    h1=-y;
-  else
-    h1=0;
-  w2=FONT_WIDTH;
-  h2=FONT_HEIGHT;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x+=win_task->pix_left;
-    y+=win_task->pix_top;
-  }
-  if (dc->flags & DCF_LOCATE_NEAREST) {
-    dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    if (x+w1<0) w1=-x;
-    if (x+w2>win_task->pix_right+1)
-      w2=win_task->pix_right+1-x;
-
-    if (y+h1<0) h1=-y;
-    if (y+h2>win_task->pix_bottom+1)
-      h2=win_task->pix_bottom+1-y;
-  }
-  if (x+w2>dc->width)
-    w2=dc->width-x;
-  if (y+h2>dc->height)
-    h2=dc->height-y;
-  if (w1<w2<=FONT_WIDTH && h1<h2<=FONT_HEIGHT) {
-    if (dc->flags & DCF_RECORD_EXTENTS) {
-      if (x+w1  <dc->min_x) dc->min_x=x+w1;
-      if (x+w2-1>dc->max_x) dc->max_x=x+w2-1;
-      if (y+h1  <dc->min_y) dc->min_y=y+h1;
-      if (y+h2-1>dc->max_y) dc->max_y=y+h2-1;
-    }
-    if (dc->flags & DCF_DONT_DRAW)
-      return 1;
-    color=dc->color;
-    leading_pixels=-(w1+x)&7;
-    if (!leading_pixels) leading_pixels=8;
-    leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels];
-    bit_shift=-x&7;
-    trailing_pixels=(x+w2)&7;
-    trailing_pixel_mask=gr.to_8_bits[0xFF<<trailing_pixels&0xFF];
-    if (leading_pixels+trailing_pixels>w2-w1) {
-      leading_pixel_mask|=trailing_pixel_mask;
-      trailing_pixels=0;
-    }
-    font_ptr=&text.font(U8 *)[FONT_HEIGHT*ch+h1];
-    if (color.c0.rop==ROPB_COLLISION) {
-      m=w1&(FONT_WIDTH-1);
-#assert FONT_WIDTH==8
-      color =dc->bkcolor.c0.color;
-      for (i=w1;i<w2;i++,m++) {
-        k1=(h1+y)*dc->width_internal+x;
-        src=font_ptr;
-        for (j=h2-h1;j;j--) {
-          c=dc->body[k1+i];
-          if (c!=TRANSPARENT && c!=color && Bt(src,m))
-            dc->collision_cnt++;
-          k1+=dc->width_internal;
-          src++;
-        }
-      }
-    } else {
-      color_mask=gr.to_8_colors[color.c0.color];
-      k1=x+w1;
-      kk1=(h1+y)*dc->width_internal+k1;
-      if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
-        if (leading_pixels) {
-          dst=dc->body+kk1&~7;
-          src=font_ptr;
-          if (bit_shift)
-            src--;
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              for (j=h2-h1;j;j--) {
-                m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF];
-                *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                      (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask;
-                src++;
-                dst+=dc->width_internal;
-              }
-              break;
-            case ROPB_XOR:
-              if (color_mask) {
-                for (j=h2-h1;j;j--) {
-                  *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                        (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])&
-                        ~leading_pixel_mask;
-                  src++;
-                  dst+=dc->width_internal;
-                }
-              }
-              break;
-          }
-          kk1+=8;
-        }
-        if (trailing_pixels) {
-          dst=dc->body+kk1&~7;
-          src=font_ptr+1;
-          if (bit_shift)
-            src--;
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              for (j=h2-h1;j;j--) {
-                m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF];
-                *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                      (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask;
-                src++;
-                dst+=dc->width_internal;
-              }
-              break;
-            case ROPB_XOR:
-              if (color_mask)
-                for (j=h2-h1;j;j--) {
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])&
-                        ~trailing_pixel_mask;
-                  src++;
-                  dst+=dc->width_internal;
-                }
-              break;
-          }
-        }
-      } else {
-        if (leading_pixels) {
-          dst=dc->body+kk1&~7;
-          src=font_ptr;
-          if (bit_shift)
-            src--;
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              for (j=h1;j<h2;j++) {
-                if (!IsPixCovered0(win_task,k1,y+j)) {
-                  m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF];
-                  *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                        (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask;
-                }
-                src++;
-                dst+=dc->width_internal;
-              }
-              break;
-            case ROPB_XOR:
-              if (color_mask)
-                for (j=h1;j<h2;j++) {
-                  if (!IsPixCovered0(win_task,k1,y+j))
-                    *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                          (*dst(I64 *)^gr.to_8_bits
-                          [*src(U16 *)>>bit_shift&0xFF])&
-                          ~leading_pixel_mask;
-                  src++;
-                  dst+=dc->width_internal;
-                }
-              break;
-          }
-          k1+=8;
-          kk1+=8;
-        }
-        if (trailing_pixels) {
-          dst=dc->body+kk1&~7;
-          src=font_ptr+1;
-          if (bit_shift)
-            src--;
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              for (j=h1;j<h2;j++) {
-                if (!IsPixCovered0(win_task,k1,y+j)) {
-                  m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF];
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask;
-                }
-                src++;
-                dst+=dc->width_internal;
-              }
-              break;
-            case ROPB_XOR:
-              if (color_mask)
-                for (j=h1;j<h2;j++) {
-                  if (!IsPixCovered0(win_task,k1,y+j))
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          (*dst(I64 *)^gr.to_8_bits
-                          [*src(U16 *)>>bit_shift&0xFF])&
-                          ~trailing_pixel_mask;
-                  src++;
-                  dst+=dc->width_internal;
-                }
-              break;
-          }
-        }
-      }
-    }
-    return 1;
-  } else
-    return 0;
-}
-
-I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
-{//Use GrPrint()
-  I64 x0,sx=0,sy=0,res;
-  if (!_s) return 0;
-  x0=x;
-  res=0;
-  while (*_s) {
-    if (*_s=='\n') {
-      x=x0;
-      y+=FONT_HEIGHT;
-      _s++;
-    } else if (*_s=='\t') {
-      x=x0+CeilU64(x-x0+FONT_WIDTH,8*FONT_WIDTH);
-      _s++;
-    } else if (*_s(U32 *)=='$SY,') {
-      if (_s[4]=='-') {
-        _s++;
-        sy='0'-_s[4];
-      } else
-        sy=_s[4]-'0';
-      _s+=6;
-    } else if (*_s(U32 *)=='$SX,') {
-      if (_s[4]=='-') {
-        _s++;
-        sx='0'-_s[4];
-      } else
-        sx=_s[4]-'0';
-      _s+=6;
-    } else {
-      res+=GrPutChar(dc,x+sx,y+sy,*_s);
-      x+=FONT_WIDTH;
-      _s++;
-    }
-  }
-  return res;
-}
-
-I64 GrVPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
-{//Vertical Text.  Use GrVPrint()
-  I64 y0,sx=0,sy=0,res;
-  U8 buf[2];
-  if (!_s) return 0;
-  y0=y;
-  res=0;
-  buf[1]=0;
-  while (*_s) {
-    if (*_s=='\n') {
-      y=y0;
-      x+=FONT_WIDTH;
-      _s++;
-    } else if (*_s=='\t') {
-      y=y0+CeilU64(y-y0+FONT_HEIGHT,8*FONT_HEIGHT);
-      _s++;
-    } else if (*_s(U32 *)=='$SY,') {
-      if (_s[4]=='-') {
-        _s++;
-        sx='0'-_s[4];
-      } else
-        sx=_s[4]-'0';
-      _s+=6;
-    } else if (*_s(U32 *)=='$SX,') {
-      if (_s[4]=='-') {
-        _s++;
-        sy='0'-_s[4];
-      } else
-        sy=_s[4]-'0';
-      _s+=6;
-    } else {
-      *buf=*_s++;
-      res+=GrPutS(dc,x,y,buf);
-      y+=FONT_HEIGHT;
-    }
-  }
-  return res;
-}
-
-public I64 GrPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...)
-{//2D. Clipping but not transformation.
-  I64 res;
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  res=GrPutS(dc,x,y,buf);
-  Free(buf);
-  return res;
-}
-
-public I64 GrVPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...)
-{//2D. Vertical text. Clipping but not transformation.
-  I64 res;
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  res=GrVPutS(dc,x,y,buf);
-  Free(buf);
-  return res;
-}
-
-#help_index "Graphics"
-public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
-{//2D. Width Height. Clipping but not transformation.
-//Returns cnt of pixs changed.
-  I64 i,res=0,j,k1,kk1,w1,h1,w2,h2,dist,
-        leading_pixels,original_leading_pixels,whole_I64s,
-        trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
-        win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,color_mask;
-  U8 reg *dst;
-  U16 reg *win_z_buf_ptr;
-  CColorROPU32 color,c,dither_colors;
-  Bool dither,probability_dither;
-  CTask *win_task;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->scroll_x;
-    y+=win_task->scroll_y;
-  }
-
-  if (x<0)
-    w1=-x;
-  else
-    w1=0;
-  if (y<0)
-    h1=-y;
-  else
-    h1=0;
-  w2=w;
-  h2=h;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x+=win_task->pix_left;
-    y+=win_task->pix_top;
-  }
-  if (dc->flags & DCF_LOCATE_NEAREST) {//TODO:Untested
-    if (x<=dc->cur_x<=x+w && y<=dc->cur_y<=y+h)
-      dist=0;
-    else
-      dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    if (x+w1<0) w1=-x;
-    if (x+w2>win_task->pix_right+1)
-      w2=win_task->pix_right+1-x;
-
-    if (y+h1<0) h1=-y;
-    if (y+h2>win_task->pix_bottom+1)
-      h2=win_task->pix_bottom+1-y;
-  }
-  if (x+w2>dc->width)
-    w2=dc->width-x;
-  if (y+h2>dc->height)
-    h2=dc->height-y;
-  if (w1<w2<=w && h1<h2<=h) {
-    if (dc->flags & DCF_RECORD_EXTENTS) {
-      if (x+w1  <dc->min_x) dc->min_x=x+w1;
-      if (x+w2-1>dc->max_x) dc->max_x=x+w2-1;
-      if (y+h1  <dc->min_y) dc->min_y=y+h1;
-      if (y+h2-1>dc->max_y) dc->max_y=y+h2-1;
-    }
-    if (dc->flags & DCF_DONT_DRAW)
-      return TRUE;
-    color=dc->color;
-    if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
-      dither=TRUE;
-      if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
-        probability_dither=TRUE;
-        color.c1.rop=color.c0.rop;
-        dither_colors=color;
-      } else {
-        probability_dither=FALSE;
-        color.c1.rop=color.c0.rop;
-      }
-    } else
-      dither=FALSE;
-    original_leading_pixels=leading_pixels=-(w1+x)&7;
-    leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels];
-    whole_I64s=(w2-w1-leading_pixels)>>3;
-    if (whole_I64s<0) whole_I64s=0;
-    trailing_pixels=(x+w2)&7;
-    trailing_pixel_mask=gr.to_8_bits[0xFF<<trailing_pixels&0xFF];
-    if (leading_pixels+trailing_pixels>w2-w1) {
-      leading_pixel_mask|=trailing_pixel_mask;
-      leading_pixels=w2-w1; //Correct so it's right for res.
-      trailing_pixels=0;
-    }
-    if (color.c0.rop==ROPB_COLLISION) {//TODO: Might want to check win_z_buf
-      color =dc->bkcolor.c0.color;
-      k1=(h1+y)*dc->width_internal+x;
-      res=-dc->collision_cnt;
-      for (j=h2-h1;j;j--) {
-        for (i=w1;i<w2;i++) {
-          c=dc->body[k1+i];
-          if (c!=TRANSPARENT && c!=color)
-            dc->collision_cnt++;
-        }
-        k1+=dc->width_internal;
-      }
-      res+=dc->collision_cnt;
-    } else {
-      if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
-        win_z_buf_ptr=NULL;
-      else {
-        win_z_num=win_task->win_z_num;
-        win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+
-              (w1+x)/FONT_WIDTH)*sizeof(U16);
-        win_z_buf_line_dec=whole_I64s;
-        if (leading_pixels)
-          win_z_buf_line_dec++;
-        if (trailing_pixels)
-          win_z_buf_line_dec++;
-        win_z_buf_line_dec*=sizeof(U16);
-        win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec;
-      }
-      kk1=(h1+y)*dc->width_internal+x+w1;
-      if (dither) {
-        if (probability_dither) {
-          if (RandU16<dc->dither_probability_u16)
-            color.c0=dither_colors.c1;
-          else
-            color.c0=dither_colors.c0;
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              if (win_z_buf_ptr) {
-                res=0;
-                for (j=h1;j<h2;j++) {
-                  color_mask=gr.to_8_colors[color.c0.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels) {
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                            color_mask&~leading_pixel_mask;
-                      res+=leading_pixels;
-                    }
-                    dst(I64 *)++;
-                  }
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=color_mask;
-                      res+=8;
-                    }
-                  if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          color_mask&~trailing_pixel_mask;
-                    res+=trailing_pixels;
-                  }
-                  if ((j+y)&7==7)
-                    win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                  else
-                    win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                  kk1+=dc->width_internal;
-                  if (RandU16<dc->dither_probability_u16)
-                    color.c0=dither_colors.c1;
-                  else
-                    color.c0=dither_colors.c0;
-                }
-              } else {
-                for (j=h2-h1;j;j--) {
-                  color_mask=gr.to_8_colors[color.c0.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          color_mask&~leading_pixel_mask;
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    *dst(I64 *)=color_mask;
-                  if (trailing_pixels)
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          color_mask&~trailing_pixel_mask;
-                  kk1+=dc->width_internal;
-                  if (RandU16<dc->dither_probability_u16)
-                    color.c0=dither_colors.c1;
-                  else
-                    color.c0=dither_colors.c0;
-                }
-                res=(h2-h1)*(w2-w1);
-              }
-              break;
-            case ROPB_XOR:
-              if (win_z_buf_ptr) {
-                res=0;
-                for (j=h1;j<h2;j++) {
-                  color_mask=gr.to_8_colors[color.c0.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels) {
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                            *dst(I64 *)^color_mask&~leading_pixel_mask;
-                      res+=leading_pixels;
-                    }
-                    dst(I64 *)++;
-                  }
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)^=color_mask;
-                      res+=8;
-                    }
-                  if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                    res+=trailing_pixels;
-                  }
-                  if ((j+y)&7==7)
-                    win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                  else
-                    win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                  kk1+=dc->width_internal;
-                  if (RandU16<dc->dither_probability_u16)
-                    color.c0=dither_colors.c1;
-                  else
-                    color.c0=dither_colors.c0;
-                }
-              } else {
-                for (j=h2-h1;j;j--) {
-                  color_mask=gr.to_8_colors[color.c0.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          *dst(I64 *)^color_mask&~leading_pixel_mask;
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    *dst(I64 *)^=color_mask;
-                  if (trailing_pixels)
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                  kk1+=dc->width_internal;
-                  if (RandU16<dc->dither_probability_u16)
-                    color.c0=dither_colors.c1;
-                  else
-                    color.c0=dither_colors.c0;
-                }
-                res=(h2-h1)*(w2-w1);
-              }
-              break;
-          }
-        } else {
-          if (((x+w1-original_leading_pixels)^(y+h1))&1)
-            SwapU16(&color.c0,&color.c1);
-          switch [color.c0.rop] {
-            case ROPB_EQU:
-            case ROPB_MONO:
-              if (win_z_buf_ptr) {
-                res=0;
-                for (j=h1;j<h2;j++) {
-                  color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]|
-                        gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels) {
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                            color_mask&~leading_pixel_mask;
-                      res+=leading_pixels;
-                    }
-                    dst(I64 *)++;
-                  }
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=color_mask;
-                      res+=8;
-                    }
-                  if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          color_mask&~trailing_pixel_mask;
-                    res+=trailing_pixels;
-                  }
-                  if ((j+y)&7==7)
-                    win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                  else
-                    win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                  kk1+=dc->width_internal;
-                  SwapU16(&color.c0,&color.c1);
-                }
-              } else {
-                for (j=h2-h1;j;j--) {
-                  color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]|
-                        gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          color_mask&~leading_pixel_mask;
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    *dst(I64 *)=color_mask;
-                  if (trailing_pixels)
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          color_mask&~trailing_pixel_mask;
-                  kk1+=dc->width_internal;
-                  SwapU16(&color.c0,&color.c1);
-                }
-                res=(h2-h1)*(w2-w1);
-              }
-              break;
-            case ROPB_XOR:
-              if (win_z_buf_ptr) {
-                res=0;
-                for (j=h1;j<h2;j++) {
-                  color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]|
-                        gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels) {
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                            *dst(I64 *)^color_mask&~leading_pixel_mask;
-                      res+=leading_pixels;
-                    }
-                    dst(I64 *)++;
-                  }
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    if (win_z_num>=*win_z_buf_ptr++) {
-                      *dst(I64 *)^=color_mask;
-                      res+=8;
-                    }
-                  if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                    res+=trailing_pixels;
-                  }
-                  if ((j+y)&7==7)
-                    win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                  else
-                    win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                  kk1+=dc->width_internal;
-                  SwapU16(&color.c0,&color.c1);
-                }
-              } else {
-                for (j=h2-h1;j;j--) {
-                  color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]|
-                        gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color];
-                  dst=dc->body+kk1&~7;
-                  if (leading_pixels)
-                    *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                          *dst(I64 *)^color_mask&~leading_pixel_mask;
-                  for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                    *dst(I64 *)^=color_mask;
-                  if (trailing_pixels)
-                    *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                          *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                  kk1+=dc->width_internal;
-                  SwapU16(&color.c0,&color.c1);
-                }
-                res=(h2-h1)*(w2-w1);
-              }
-              break;
-          }
-        }
-      } else {
-        color_mask=gr.to_8_colors[color.c0.color];
-        switch [color.c0.rop] {
-          case ROPB_EQU:
-          case ROPB_MONO:
-            if (win_z_buf_ptr) {
-              res=0;
-              for (j=h1;j<h2;j++) {
-                dst=dc->body+kk1&~7;
-                if (leading_pixels) {
-                  if (win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                          color_mask&~leading_pixel_mask;
-                    res+=leading_pixels;
-                  }
-                  dst(I64 *)++;
-                }
-                for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                  if (win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=color_mask;
-                    res+=8;
-                  }
-                if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        color_mask&~trailing_pixel_mask;
-                  res+=trailing_pixels;
-                }
-                if ((j+y)&7==7)
-                  win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                else
-                  win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                kk1+=dc->width_internal;
-              }
-            } else {
-              for (j=h2-h1;j;j--) {
-                dst(I64 *)=dc->body+kk1&~7;
-                if (leading_pixels)
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        color_mask&~leading_pixel_mask;
-                for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                  *dst(I64 *)=color_mask;
-                if (trailing_pixels)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        color_mask&~trailing_pixel_mask;
-                kk1+=dc->width_internal;
-              }
-              res=(h2-h1)*(w2-w1);
-            }
-            break;
-          case ROPB_XOR:
-            if (win_z_buf_ptr) {
-              res=0;
-              for (j=h1;j<h2;j++) {
-                dst=dc->body+kk1&~7;
-                if (leading_pixels) {
-                  if (win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)=*dst(I64 *)&leading_pixel_mask|
-                          *dst(I64 *)^color_mask&~leading_pixel_mask;
-                    res+=leading_pixels;
-                  }
-                  dst(I64 *)++;
-                }
-                for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                  if (win_z_num>=*win_z_buf_ptr++) {
-                    *dst(I64 *)^=color_mask;
-                    res+=8;
-                  }
-                if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) {
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                  res+=trailing_pixels;
-                }
-                if ((j+y)&7==7)
-                  win_z_buf_ptr(U8 *)+=win_z_buf_line_inc;
-                else
-                  win_z_buf_ptr(U8 *)-=win_z_buf_line_dec;
-                kk1+=dc->width_internal;
-              }
-            } else {
-              for (j=h2-h1;j;j--) {
-                dst=dc->body+kk1&~7;
-                if (leading_pixels)
-                  *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask|
-                        *dst(I64 *)^color_mask&~leading_pixel_mask;
-                for (i=0;i<whole_I64s;i++,dst(I64 *)++)
-                  *dst(I64 *)^=color_mask;
-                if (trailing_pixels)
-                  *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask|
-                        *dst(I64 *)^color_mask&~trailing_pixel_mask;
-                kk1+=dc->width_internal;
-              }
-              res=(h2-h1)*(w2-w1);
-            }
-            break;
-        }
-      }
-    }
-  }
-  return res;
-}
-
-I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
-{
-//Returns cnt of pixs changed
-  I64 res=0,c,x3,y3,d;
-  U8 *dst,*dst2;
-  Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
-  CTask *win_task;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->scroll_x;
-    y+=win_task->scroll_y;
-  }
-  x3=x;
-  y3=y;
-  if (x3<0 || y3<0)
-    goto gr_done;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x3+=win_task->pix_left;
-    y3+=win_task->pix_top;
-    if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
-          !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3))
-      goto gr_done;
-  }
-  if (x3>=dc->width || y3>=dc->height)
-    goto gr_done;
-
-  d=y3*dc->width_internal;
-  dst2=dc->body+d;
-  while (TRUE) {
-    x3=x;
-    if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
-      if (dc->flags & DCF_SCRN_BITMAP) {
-        if (x3<0) break;
-        x3+=win_task->pix_left;
-        if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
-              !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3))
-          break;
-      } else
-        if (!(0<=x3<dc->width))
-          break;
-    } else if (dc->flags & DCF_SCRN_BITMAP)
-      x3+=win_task->pix_left;
-    dst=dst2+x3;
-    c=*dst;
-    if (not_color) {
-      if (c!=dc->color2) {
-        res++;
-        x--;
-      } else
-        break;
-    } else {
-      if (c==dc->color2) {
-        res++;
-        x--;
-      } else
-        break;
-    }
-  }
-  return res;
-gr_done:
-  return 0;
-}
-
-I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
-{
-//Returns cnt of pixs changed
-  I64 res=0,d,x=*x1,x2,x3,y3,dist;
-  Bool plot,dither,probability_dither,
-        not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
-  U8 *dst,*dst2;
-  CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor;
-  I32 *db2;
-  CTask *win_task;
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->scroll_x;
-    y+=win_task->scroll_y;
-    z+=win_task->scroll_z;
-  }
-  x2=x;
-  x3=x;
-  y3=y;
-  if (x3<0 || y3<0)
-    goto gr_done;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x3+=win_task->pix_left;
-    y3+=win_task->pix_top;
-    if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
-          !(dc->flags&DCF_ON_TOP) &&  IsPixCovered0(win_task,x3,y3))
-      goto gr_done;
-  }
-  if (x3>=dc->width || y3>=dc->height)
-    goto gr_done;
-
-  d=dc->width_internal*y3;
-  if (db) db+=d;
-
-  color=dc->color;
-  if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
-    dither=TRUE;
-    if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
-      probability_dither=TRUE;
-      color.c1.rop=color.c0.rop;
-    } else {
-      probability_dither=FALSE;
-      color.c1.rop=color.c0.rop;
-    }
-  } else
-    dither=FALSE;
-  dst2=dc->body+d;
-  while (TRUE) {
-    x3=x;
-    if (!(x3&(FONT_WIDTH-1))) {
-      if (dc->flags & DCF_SCRN_BITMAP) {
-        if (x3<0) break;
-        x3+=win_task->pix_left;
-        if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
-              !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3))
-          break;
-      } else {
-        if (!(0<=x3<dc->width))
-          break;
-      }
-    } else if (dc->flags & DCF_SCRN_BITMAP)
-      x3+=win_task->pix_left;
-
-    dst=dst2+x3;
-
-    c=*dst;
-    if (db) {
-      db2=db+x3;
-      if (0<=z<=*db2) {
-        *db2=z;
-        plot=TRUE;
-      } else
-        plot=FALSE;
-    } else
-      plot=TRUE;
-
-    if ((not_color && c!=dc->color2 ||
-          !not_color && c==dc->color2) && plot) {
-      if (dc->flags & DCF_LOCATE_NEAREST) {
-        dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
-        if (dist<=dc->nearest_dist)
-          dc->nearest_dist=dist;
-      }
-      if (dc->flags & DCF_RECORD_EXTENTS) {
-        if (x3<dc->min_x) dc->min_x=x3;
-        if (x3>dc->max_x) dc->max_x=x3;
-        if (y3<dc->min_y) dc->min_y=y3;
-        if (y3>dc->max_y) dc->max_y=y3;
-      }
-      dst=dst2+x3;
-
-      c=color.c0.color;
-      if (dither) {
-        if (probability_dither) {
-          if (RandU16<dc->dither_probability_u16)
-            c=color.c1.color;
-        } else
-          if ((x3^y3)&1)
-            c=color.c1.color;
-      }
-      switch [color.c0.rop] {
-        case ROPB_EQU:
-        case ROPB_MONO:
-          *dst=c;
-          break;
-        case ROPB_COLLISION:
-          c2=*dst;
-          if (c2!=TRANSPARENT && c2!=bkcolor.c0.color)
-            dc->collision_cnt++;
-          break;
-        case ROPB_XOR:
-          *dst^=c;
-          break;
-      }
-      res++;
-      x++;
-    } else
-      break;
-  }
-  if (dc->flags & DCF_SCRN_BITMAP)
-    *x1=x-1-win_task->scroll_x;
-  else
-    *x1=x-1;
-  x=x2-1;
-  while (TRUE) {
-    x3=x;
-    if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
-      if (dc->flags & DCF_SCRN_BITMAP) {
-        if (x3<0) break;
-        x3+=win_task->pix_left;
-        if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
-              !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3))
-          break;
-      } else
-        if (!(0<=x3<dc->width))
-          break;
-    } else if (dc->flags & DCF_SCRN_BITMAP)
-      x3+=win_task->pix_left;
-
-    dst=dst2+x3;
-    c=*dst;
-    if (db) {
-      db2=db+x3;
-      if (0<=z<=*db2) {
-        *db2=z;
-        plot=TRUE;
-      } else
-        plot=FALSE;
-    } else
-      plot=TRUE;
-
-    if ((not_color && c!=dc->color2 ||
-          !not_color && c==dc->color2) && plot) {
-      if (dc->flags & DCF_LOCATE_NEAREST) {
-        dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
-        if (dist<=dc->nearest_dist)
-          dc->nearest_dist=dist;
-      }
-      if (dc->flags & DCF_RECORD_EXTENTS) {
-        if (x3<dc->min_x) dc->min_x=x3;
-        if (x3>dc->max_x) dc->max_x=x3;
-        if (y3<dc->min_y) dc->min_y=y3;
-        if (y3>dc->max_y) dc->max_y=y3;
-      }
-      dst=dst2+x3;
-
-      c=color.c0.color;
-      if (dither) {
-        if (probability_dither) {
-          if (RandU16<dc->dither_probability_u16)
-            c=color.c1.color;
-        } else
-          if ((x3^y3)&1)
-            c=color.c1.color;
-      }
-      switch [color.c0.rop] {
-        case ROPB_EQU:
-        case ROPB_MONO:
-          *dst=c;
-          break;
-        case ROPB_COLLISION:
-          c2=*dst;
-          if (c2!=TRANSPARENT && c2!=bkcolor.c0.color)
-            dc->collision_cnt++;
-          break;
-        case ROPB_XOR:
-          *dst^=c;
-          break;
-      }
-      res++;
-      x--;
-    } else
-      break;
-  }
-  return res;
-gr_done:
-  return 0;
-}
-
-public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
-{//3D. No transformation or thick.
-//Returns cnt of pixs changed
-  //Uses fixed-point.
-  I64 dist,dx,dz,z,res=0,i,j,d;
-  U8 *dst;
-  CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor,dither_colors;
-  I32 *db;
-  Bool plot=TRUE,char_clear,dither,probability_dither;
-  CTask *win_task;
-
-  if (!dc->depth_buf) {
-    if (x2<x1) SwapI64(&x1,&x2);
-    return GrRect(dc,x1,y,x2-x1+1,1);
-  }
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x1+=win_task->scroll_x;
-    x2+=win_task->scroll_x;
-    y +=win_task->scroll_y;
-    z1+=win_task->scroll_z;
-    z2+=win_task->scroll_z;
-  }
-  if (dc->flags & DCF_RECORD_EXTENTS) {
-    if (x1<dc->min_x) dc->min_x=x1;
-    if (x1>dc->max_x) dc->max_x=x1;
-    if (x2<dc->min_x) dc->min_x=x2;
-    if (x2>dc->max_x) dc->max_x=x2;
-    if (y<dc->min_y) dc->min_y=y;
-    if (y>dc->max_y) dc->max_y=y;
-  }
-  if (y<0) goto gr_done;
-  if (x2<x1) {
-    SwapI64(&x1,&x2);
-    SwapI64(&z1,&z2);
-  }
-  if (x2<0)
-    goto gr_done;
-  if (x1<0) {
-    i=-x1;
-    x1=0;
-  } else
-    i=0;
-  j=0;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    x1+=win_task->pix_left;
-    x2+=win_task->pix_left;
-    if (x1>win_task->pix_right)
-      goto gr_done;
-    if (x2>win_task->pix_right) {
-      j=x2-win_task->pix_right;
-      x2=win_task->pix_right;
-    }
-    y+=win_task->pix_top;
-    if (!(0<=y<=win_task->pix_bottom) || x2<0)
-      goto gr_done;
-  }
-  if (x1>=dc->width || y>=dc->height)
-    goto gr_done;
-  dx=x2+j-(x1-i);
-  d=dc->width_internal*y+x1;
-  if (db=dc->depth_buf) {
-    db+=d;
-    if (dx)
-      dz=(z2-z1)<<32/dx;
-    else
-      dz=0;
-    z=z1<<32;
-  }
-  if (i)
-    z+=i*dz;
-  if (x2>=dc->width)
-    x2=dc->width-1;
-
-  if (dc->flags & DCF_LOCATE_NEAREST) {
-    if (x1<=dc->cur_x<=x2)
-      dist=0;
-    else if (dc->cur_x<x1)
-      dist=SqrI64(x1-dc->cur_x);
-    else
-      dist=SqrI64(dc->cur_x-x2);
-    dist+=SqrI64(y-dc->cur_y);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_DONT_DRAW)
-    goto gr_done;
-
-  if (!(dc->flags & DCF_SCRN_BITMAP) ||
-        win_task->next_task==sys_winmgr_task ||
-        dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
-    char_clear=TRUE;
-  else
-    char_clear=FALSE;
-  if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
-    dither=TRUE;
-    if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
-      probability_dither=TRUE;
-      color.c1.rop=color.c0.rop;
-      dither_colors=color;
-      if (RandU16<dc->dither_probability_u16)
-        color.c0=dither_colors.c1;
-      else
-        color.c0=dither_colors.c0;
-    } else {
-      probability_dither=FALSE;
-      color.c1.rop=color.c0.rop;
-      if ((x1^y)&1)
-        SwapU16(&color.c0,&color.c1);
-    }
-  } else
-    dither=FALSE;
-  while (x1<=x2) {
-    if (char_clear) {
-      if (db) {
-        if (0<=z.i32[1]<=*db) {
-          *db=z.i32[1];
-          plot=TRUE;
-        } else
-          plot=FALSE;
-      }
-      if (plot) {
-        dst=dc->body+d;
-        c=color.c0.color;
-        switch [color.c0.rop] {
-          case ROPB_EQU:
-          case ROPB_MONO:
-            *dst=c;
-            break;
-          case ROPB_COLLISION:
-            c2=*dst;
-            if (c2!=TRANSPARENT && c2!=bkcolor.c0.color)
-              dc->collision_cnt++;
-            break;
-          case ROPB_XOR:
-            *dst^=c;
-            break;
-        }
-        res++;
-      }
-    }
-    if (dither) {
-      if (probability_dither) {
-        if (RandU16<dc->dither_probability_u16)
-          color.c0=dither_colors.c1;
-        else
-          color.c0=dither_colors.c0;
-      } else
-        SwapU16(&color.c0,&color.c1);
-    }
-    d++;
-    x1++;
-    if (db)
-      db++;
-    z+=dz;
-    if (!(x1&(FONT_WIDTH-1)) && x1<=x2) {
-      if (!(dc->flags & DCF_SCRN_BITMAP)||
-            win_task->next_task==sys_winmgr_task ||
-            dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
-        char_clear=TRUE;
-      else
-        char_clear=FALSE;
-    }
-  }
-gr_done:
-  return res;
-}
-
-public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
-{//3D. No transformation or thick.
-//Returns cnt of pixs changed
-  //Uses fixed-point.
-  I64 dist,dy,dz,z,res=0,i,j,d;
-  U8 *dst;
-  CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor,dither_colors;
-  I32 *db;
-  Bool plot=TRUE,char_clear,dither,probability_dither;
-  CTask *win_task;
-
-  if (!dc->depth_buf) {
-    if (y2<y1) SwapI64(&y1,&y2);
-    return GrRect(dc,x,y1,1,y2-y1+1);
-  }
-
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x +=win_task->scroll_x;
-    y1+=win_task->scroll_y;
-    y2+=win_task->scroll_y;
-    z1+=win_task->scroll_z;
-    z2+=win_task->scroll_z;
-  }
-  if (dc->flags & DCF_RECORD_EXTENTS) {
-    if (x<dc->min_x) dc->min_x=x;
-    if (x>dc->max_x) dc->max_x=x;
-    if (y1<dc->min_y) dc->min_y=y1;
-    if (y1>dc->max_y) dc->max_y=y1;
-    if (y2<dc->min_y) dc->min_y=y2;
-    if (y2>dc->max_y) dc->max_y=y2;
-  }
-  if (x<0) goto gr_done;
-  if (y2<y1) {
-    SwapI64(&y1,&y2);
-    SwapI64(&z1,&z2);
-  }
-  if (y2<0)
-    goto gr_done;
-  if (y1<0) {
-    i=-y1;
-    y1=0;
-  } else
-    i=0;
-  j=0;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    y1+=win_task->pix_top;
-    y2+=win_task->pix_top;
-    if (y1>win_task->pix_bottom)
-      goto gr_done;
-    if (y2>win_task->pix_bottom) {
-      j=y2-win_task->pix_bottom;
-      y2=win_task->pix_bottom;
-    }
-    x+=win_task->pix_left;
-    if (!(0<=x<=win_task->pix_right) || y2<0)
-      goto gr_done;
-  }
-  if (y1>=dc->height || x>=dc->width)
-    goto gr_done;
-  dy=y2+j-(y1-i);
-  d=dc->width_internal*y1+x;
-  if (db=dc->depth_buf) {
-    db+=d;
-    if (dy)
-      dz=(z2-z1)<<32/dy;
-    else
-      dz=0;
-    z=z1<<32;
-  }
-  if (i)
-    z+=i*dz;
-  if (y2>=dc->height)
-    y2=dc->height-1;
-
-  if (dc->flags & DCF_LOCATE_NEAREST) {
-    if (y1<=dc->cur_y<=y2)
-      dist=0;
-    else if (dc->cur_y<y1)
-      dist=SqrI64(y1-dc->cur_y);
-    else
-      dist=SqrI64(dc->cur_y-y2);
-    dist+=SqrI64(x-dc->cur_x);
-    if (dist<=dc->nearest_dist)
-      dc->nearest_dist=dist;
-  }
-  if (dc->flags & DCF_DONT_DRAW)
-    goto gr_done;
-
-  if (!(dc->flags & DCF_SCRN_BITMAP) ||
-        win_task->next_task==sys_winmgr_task ||
-        dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
-    char_clear=TRUE;
-  else
-    char_clear=FALSE;
-  if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
-    dither=TRUE;
-    if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
-      probability_dither=TRUE;
-      color.c1.rop=color.c0.rop;
-      dither_colors=color;
-      if (RandU16<dc->dither_probability_u16)
-        color.c0=dither_colors.c1;
-      else
-        color.c0=dither_colors.c0;
-    } else {
-      probability_dither=FALSE;
-      color.c1.rop=color.c0.rop;
-      if ((x^y1)&1)
-        SwapU16(&color.c0,&color.c1);
-    }
-  } else
-    dither=FALSE;
-  while (y1<=y2) {
-    if (char_clear) {
-      if (db) {
-        if (0<=z.i32[1]<=*db) {
-          *db=z.i32[1];
-          plot=TRUE;
-        } else
-          plot=FALSE;
-      }
-      if (plot) {
-        dst=dc->body+d;
-        c=color.c0.color;
-        switch [color.c0.rop] {
-          case ROPB_EQU:
-          case ROPB_MONO:
-            *dst=c;
-            break;
-          case ROPB_COLLISION:
-            c2=*dst;
-            if (c2!=TRANSPARENT && c2!=bkcolor.c0.color)
-              dc->collision_cnt++;
-            break;
-          case ROPB_XOR:
-            *dst^=c;
-            break;
-        }
-        res++;
-      }
-    }
-    if (dither) {
-      if (probability_dither) {
-        if (RandU16<dc->dither_probability_u16)
-          color.c0=dither_colors.c1;
-        else
-          color.c0=dither_colors.c0;
-      } else
-        SwapU16(&color.c0,&color.c1);
-    }
-    d+=dc->width_internal;
-    y1++;
-    if (db)
-      db+=dc->width_internal;
-    z+=dz;
-    if (!(y1&(FONT_HEIGHT-1)) && y1<=y2) {
-      if (!(dc->flags & DCF_SCRN_BITMAP)||
-            win_task->next_task==sys_winmgr_task ||
-            dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
-        char_clear=TRUE;
-      else
-        char_clear=FALSE;
-    }
-  }
-gr_done:
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrComposites.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrComposites.HC.HTML deleted file mode 100755 index 1e53d5b..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrComposites.HC.HTML +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-public I64 GrFillPoly3(CDC *dc=gr.dc,I64 n,CD3I32 *poly)
-{//3D. Must be convex.
-//Returns cnt of pixs changed
-  CD3I32 tri[3];
-  I64 i,j,x,y,z,res=0;
-  if (n<3) return 0;
-  if (dc->flags & DCF_SYMMETRY) {
-    for (i=1;i<n-1;i++) {
-      j=i-1;
-      if (i==1) {
-        x=poly[j].x; y=poly[j].y; z=poly[j].z;
-        if (dc->flags&DCF_TRANSFORMATION)
-          (*dc->transform)(dc,&x,&y,&z);
-        DCReflect(dc,&x,&y,&z);
-        tri[0].x=x; tri[0].y=y; tri[0].z=z;
-      }
-
-      j++;
-      if (i==1) {
-        x=poly[j].x; y=poly[j].y; z=poly[j].z;
-        if (dc->flags&DCF_TRANSFORMATION)
-          (*dc->transform)(dc,&x,&y,&z);
-        DCReflect(dc,&x,&y,&z);
-      }
-      tri[1].x=x; tri[1].y=y; tri[1].z=z;
-
-      j++;
-      x=poly[j].x; y=poly[j].y; z=poly[j].z;
-      if (dc->flags&DCF_TRANSFORMATION)
-        (*dc->transform)(dc,&x,&y,&z);
-      DCReflect(dc,&x,&y,&z);
-      tri[2].x=x; tri[2].y=y; tri[2].z=z;
-
-      res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]);
-    }
-  }
-  if (dc->flags&DCF_JUST_MIRROR)
-    return res;
-  for (i=1;i<n-1;i++) {
-    j=i-1;
-    if (i==1) {
-      x=poly[j].x; y=poly[j].y; z=poly[j].z;
-      if (dc->flags&DCF_TRANSFORMATION)
-        (*dc->transform)(dc,&x,&y,&z);
-      tri[0].x=x; tri[0].y=y; tri[0].z=z;
-    }
-
-    j++;
-    if (i==1) {
-      x=poly[j].x; y=poly[j].y; z=poly[j].z;
-      if (dc->flags&DCF_TRANSFORMATION)
-        (*dc->transform)(dc,&x,&y,&z);
-    }
-    tri[1].x=x; tri[1].y=y; tri[1].z=z;
-
-    j++;
-    x=poly[j].x; y=poly[j].y; z=poly[j].z;
-    if (dc->flags&DCF_TRANSFORMATION)
-      (*dc->transform)(dc,&x,&y,&z);
-    tri[2].x=x; tri[2].y=y; tri[2].z=z;
-
-    res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]);
-  }
-  return res;
-}
-
-public I64 GrRectB(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2)
-{//2D. Two point. Clipping but not transformation.
-  if (x2<x1) SwapI64(&x1,&x2);
-  if (y2<y1) SwapI64(&y1,&y2);
-  return GrRect(dc,x1,y1,x2-x1+1,y2-y1+1);
-}
-
-public I64 GrRect3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,I64 w,I64 h)
-{//3D. Width Height. Clipping and transformation.
-  CD3I32 poly[4];
-  poly[0].x=x;
-  poly[0].y=y;
-  poly[0].z=z;
-  poly[1].x=x+w;
-  poly[1].y=y;
-  poly[1].z=z;
-  poly[2].x=x+w;
-  poly[2].y=y+h;
-  poly[2].z=z;
-  poly[3].x=x;
-  poly[3].y=y+h;
-  poly[3].z=z;
-  return GrFillPoly3(dc,4,poly);
-}
-
-public U0 GrBorder(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
-        I64 step=1,I64 start=0)
-{//2D. Transformation with thick.
-//Can be used with ROPF_DITHER+WHITE<<16+BLACK for dotted rect.
-  GrLine3(dc,x1,y1,0,x2,y1,0,step,start);
-  GrLine3(dc,x2,y1,0,x2,y2,0,step,start);
-  GrLine3(dc,x2,y2,0,x1,y2,0,step,start);
-  GrLine3(dc,x1,y2,0,x1,y1,0,step,start);
-}
-
-public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
-        I64 x2,I64 y2,I64 z2,F64 w=2.75,I64 step=1,I64 start=0)
-{//3D. Transformation with thick.
-  I64 _x1,_y1,_z1,_x2,_y2,_z2,dx,dy;
-  F64 d;
-  Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    (*dc->transform)(dc,&x1,&y1,&z1);
-    (*dc->transform)(dc,&x2,&y2,&z2);
-    dc->flags&=~DCF_TRANSFORMATION;
-    was_transform=TRUE;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    _x1=x1; _y1=y1; _z1=z1;
-    DCReflect(dc,&_x1,&_y1,&_z1);
-    _x2=x2; _y2=y2; _z2=z2;
-    DCReflect(dc,&_x2,&_y2,&_z2);
-    dc->flags&=~DCF_SYMMETRY;
-    res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
-    dx=_x2-_x1; dy=_y2-_y1;
-    if (d=Sqrt(dx*dx+dy*dy)) {
-      d=w*dc->thick/d;
-      res|=Line(dc,_x2-dx*d+dy*d+0.5,_y2-dy*d-dx*d+0.5,_z2,
-            _x2,_y2,_z2,&GrPlot3,step);
-      res|=Line(dc,_x2-dx*d-dy*d+0.5,_y2-dy*d+dx*d+0.5,_z2,
-            _x2,_y2,_z2,&GrPlot3,step);
-    }
-    was_symmetry=TRUE;
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-  res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
-  dx=x2-x1; dy=y2-y1;
-  if (d=Sqrt(dx*dx+dy*dy)) {
-    d=w*dc->thick/d;
-    res|=Line(dc,x2-dx*d+dy*d+0.5,y2-dy*d-dx*d+0.5,z2,
-          x2,y2,z2,&GrPlot3,step);
-    res|=Line(dc,x2-dx*d-dy*d+0.5,y2-dy*d+dx*d+0.5,z2,
-          x2,y2,z2,&GrPlot3,step);
-  }
-gr_done:
-  if (was_transform)
-    dc->flags|=DCF_TRANSFORMATION;
-  if (was_symmetry)
-    dc->flags|=DCF_SYMMETRY;
-  return res;
-}
-
-#help_index "Graphics/Char;Char/Graphics"
-public Bool GrTextBox3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,U8 *s,I64 border=2)
-{//3D. Transformation. DCF_SYMMETRY is silly.
-  U8 *ptr;
-  I64 ch,res,w,w_max,h;
-  if (!s) return FALSE;
-  ptr=s;
-  w=0;  w_max=0; h=FONT_HEIGHT;
-
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x1,&y1,&z1);
-  while (ch=*ptr++) {
-    if (ch=='\t')
-      w=CeilU64(w+FONT_WIDTH,FONT_WIDTH*8);
-    else if (ch=='\n') {
-      if (w>w_max) w_max=w;
-      w=0;
-      h+=FONT_HEIGHT;
-    } else
-      w+=FONT_WIDTH;
-  }
-  if (w>w_max) w_max=w;
-  res=GrPrint(dc,x1,y1,"%s",s);
-  res|=GrLine(dc,x1-border         ,y1-border  ,x1+w_max+border,y1-border);
-  res|=GrLine(dc,x1-border         ,y1+h+border,x1+w_max+border,y1+h+border);
-  res|=GrLine(dc,x1-border         ,y1-border  ,x1-border,y1+h+border);
-  res|=GrLine(dc,x1+w_max+border,y1-border  ,x1+w_max+border,y1+h+border);
-  return ToBool(res);
-}
-
-#define DIAMOND_SLOPE_MAX       2.75
-
-public Bool GrTextDiamond3(CDC *dc=gr.dc,
-        I64 x1,I64 y1,I64 z1,U8 *_s,I64 border=2)
-{//3D. Transformation. DCF_SYMMETRY is silly.
-  Bool first=TRUE;
-  U8 ch,*ptr,*ptr_end,*st,*s;
-  I64 res=0,y,dx,dy,dx_old,dy_old,w,h=FONT_HEIGHT;
-  F64 m;
-  if (!_s) return FALSE;
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x1,&y1,&z1);
-
-  ptr=s=StrNew(_s);
-  while (ch=*ptr) {
-    if (ch=='\r'||ch=='\t')
-      *ptr=CH_SPACE;
-    if (ch=='\n') {
-      *ptr=0;
-      h+=FONT_HEIGHT;
-    }
-    ptr++;
-  }
-  ptr_end=ptr+1;
-
-  y=y1-h>>1;
-  dx=FONT_WIDTH +border;      //Minimum
-  dy=FONT_HEIGHT+border+h>>1; //Minimum
-  ptr=s;
-  while (ptr!=ptr_end) {
-    st=ptr;
-    while (*ptr++);
-    StrUtil(st,SUF_REM_LEADING|SUF_REM_TRAILING);
-
-    w=(StrLen(st)*FONT_WIDTH)>>1;
-    if (first) {
-      res|=GrPrint(dc,x1-w,y,"%s",st);
-      first=FALSE;
-    } else
-      res|=GrPrint(dc,x1-w,y,"%s",st);
-    if (w) {
-      w+=border;
-      do {
-        dx_old=dx; dy_old=dy;
-        m=ToF64(dx)/dy;
-        if (m<1/DIAMOND_SLOPE_MAX) {
-          dy=MaxI64(dy,Ceil(DIAMOND_SLOPE_MAX*dx));
-          m=1/DIAMOND_SLOPE_MAX;
-        } else if (m>DIAMOND_SLOPE_MAX) {
-          dy=MaxI64(dy,Ceil(dx/DIAMOND_SLOPE_MAX));
-          m=DIAMOND_SLOPE_MAX;
-        }
-        dx=MaxI64(dx,w+Ceil(m*AbsI64(y-y1)));
-        dx=MaxI64(dx,w+Ceil(m*AbsI64(y+FONT_HEIGHT-y1)));
-      } while (dx!=dx_old || dy!=dy_old);
-    }
-    y+=FONT_HEIGHT;
-  }
-  Free(s);
-
-  res|=GrLine(dc,x1,y1-dy,x1+dx,y1);
-  res|=GrLine(dc,x1+dx,y1,x1,y1+dy);
-  res|=GrLine(dc,x1,y1+dy,x1-dx,y1);
-  res|=GrLine(dc,x1-dx,y1,x1,y1-dy);
-  return ToBool(res);
-}
-
-#help_index "Graphics/Mesh"
-public I64 Gr3Mesh(CDC *dc=gr.dc,I64 vertex_cnt,CD3I32 *p,
-        I64 tri_cnt,CMeshTri *tri)
-{//Returns cnt of pixs changed.
-  CColorROPU32 old_color=dc->color;
-  I64 i,x,y,z,res=0;
-  CD3I32 *pt,*pt_sym,*p_sym,*dst;
-  CMeshTri *tri_sym=tri;
-  if (dc->flags&DCF_TRANSFORMATION) {
-    dst=pt=MAlloc(sizeof(CD3I32)*vertex_cnt);
-    for (i=0;i<vertex_cnt;i++,p++,dst++) {
-      x=p->x; y=p->y; z=p->z;
-      (*dc->transform)(dc,&x,&y,&z);
-      dst->x=x; dst->y=y; dst->z=z;
-    }
-    p=pt;
-  } else
-    pt=NULL;
-
-  if (dc->flags & DCF_SYMMETRY) {
-    dst=pt_sym=MAlloc(sizeof(CD3I32)*vertex_cnt);
-    p_sym=p;
-    for (i=0;i<vertex_cnt;i++,p_sym++,dst++) {
-      x=p_sym->x; y=p_sym->y; z=p_sym->z;
-      DCReflect(dc,&x,&y,&z);
-      dst->x=x; dst->y=y; dst->z=z;
-    }
-    p_sym=pt_sym;
-    for (i=0;i<tri_cnt;i++,tri_sym++) {
-      (*dc->lighting)(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]],
-            &p_sym[tri_sym->nums[1]],tri_sym->color);
-      res+=GrFillTri0(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]],
-            &p_sym[tri_sym->nums[1]]);
-    }
-    Free(pt_sym);
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto mesh_done;
-  }
-  for (i=0;i<tri_cnt;i++,tri++) {
-    (*dc->lighting)(dc,&p[tri->nums[0]],&p[tri->nums[1]],
-          &p[tri->nums[2]],tri->color);
-    res+=GrFillTri0(dc,&p[tri->nums[0]],&p[tri->nums[1]],&p[tri->nums[2]]);
-  }
-mesh_done:
-  dc->color=old_color;
-  Free(pt);
-  return res;
-}
-
-#help_index "Graphics/Misc;Mouse/Ptr"
-public U0 DrawStdMs(CDC *dc,I64 x,I64 y)
-{//This is a callback. See ::/Demo/Graphics/Grid.HC.
-//Called by DrawMs() which is
-  //called by WinFinalUpdate().
-  dc->thick=1;
-  dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
-  GrArrow3(dc,x+8,y+8,0,x,y,0);
-}
-
-gr.fp_draw_ms=&DrawStdMs;
-
-public U0 DrawWaitMs(CDC *dc,I64 x,I64 y)
-{//This is a callback. See ::/Demo/Graphics/Grid.HC.
-  I64 old_pen_width=dc->thick;
-  CColorROPU32 old_color=dc->color;
-  dc->thick=3;
-  dc->color=LTRED;
-  GrCircle3(dc,x,y,0,7);
-  GrLine3(dc,x-6,y+6,0,x+6,y-6,0);
-  dc->color=RED;
-  GrCircle(dc,x,y,7);
-  GrLine(dc,x-6,y+6,x+6,y-6);
-  dc->thick=old_pen_width;
-  dc->color=old_color;
-}
-
-#help_index "Graphics/GR Files;Graphics/Scrn"
-public Bool GRScrnCaptureRead(U8 *filename,CDC *dc=gr.dc,I64 x=0,I64 y=0)
-{//GrBlot TempleOS GR File to dc,x,y.
-  CDC *dc2;
-  if (dc2=GRRead(filename)) {
-    dc->color=ROP_EQU;
-    GrBlot(dc,x,y,dc2);
-    DCDel(dc2);
-    return TRUE;
-  }
-  return FALSE;
-}
-
-public I64 GRScrnCaptureWrite(U8 *filename,Bool include_zoom=TRUE)
-{//Capture scrn to a TempleOS GR File.
-  I64 size;
-  CDC *dc=DCScrnCapture(include_zoom);
-  size=GRWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET);
-  DCDel(dc);
-  return size;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrDC.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrDC.HC.HTML deleted file mode 100755 index 12edb5e..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrDC.HC.HTML +++ /dev/null @@ -1,465 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Math/3D Transformation"
-#help_file "::/Doc/Transform"
-
-#define GR_SCALE        (1<<32)
-
-public U0 Mat4x4MulXYZ(I64 *r,I64 *_x,I64 *_y,I64 *_z)
-{//Rotate 3D point using 4x4 matrix. Uses fixed-point.
-  I64 x1,y1,z1,xx=*_x,yy=*_y,zz=*_z;
-  x1=(r[0*4+0]*xx+r[0*4+1]*yy+r[0*4+2]*zz+r[0*4+3])>>32;
-  y1=(r[1*4+0]*xx+r[1*4+1]*yy+r[1*4+2]*zz+r[1*4+3])>>32;
-  z1=(r[2*4+0]*xx+r[2*4+1]*yy+r[2*4+2]*zz+r[2*4+3])>>32;
-  *_x=x1;*_y=y1;*_z=z1;
-}
-
-public U0 DCTransform(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
-{//This is the dft dc->transform() callback.
-//Uses fixed-point.
-  Mat4x4MulXYZ(dc->r,_x,_y,_z);
-  *_x+=dc->x;
-  *_y+=dc->y;
-  *_z+=dc->z;
-}
-
-public I64 *Mat4x4IdentEqu(I64 *r)
-{//Set matrix to identity. Uses fixed-point.
-  MemSet(r,0,sizeof(I64)*16);
-  r[0*4+0].i32[1]=1;
-  r[1*4+1].i32[1]=1;
-  r[2*4+2].i32[1]=1;
-  r[3*4+3].i32[1]=1;
-  return r;
-}
-
-public I64 *Mat4x4IdentNew(CTask *mem_task=NULL)
-{//MAlloc an identity matrix. Uses fixed-point.
-  return Mat4x4IdentEqu(MAlloc(sizeof(I64)*16,mem_task));
-}
-
-public I64 Mat4x4NormSqr65536(I64 *r)
-{//Norm Squared of r.
-//(1.0/Sqrt(3))*65536=37837.22
-  return SqrI64((r[0*4+0]*37838+r[0*4+1]*37838+r[0*4+2]*37838)>>32)+
-        SqrI64((r[1*4+0]*37837+r[1*4+1]*37837+r[1*4+2]*37837)>>32)+
-        SqrI64((r[2*4+0]*37837+r[2*4+1]*37837+r[2*4+2]*37837)>>32);
-}
-
-public U0 DCMat4x4Set(CDC *dc=NULL,I64 *r)
-{//Set device context's rot matrix. Will be Freed() in DCDel().Uses fixed-point.
-//The main purpose is to set matrix norm for thick scaling.
-  //NULL as dc means gr.dc
-  if (!dc)   dc=gr.dc;
-  dc->r=r;
-  dc->r_norm=Sqrt(Mat4x4NormSqr65536(r))*65536; //scaled 32 bits
-}
-
-#help_index "Graphics/Mesh"
-public U0 DCLighting(CDC *dc,
-        CD3I32 *p1,CD3I32 *p2,CD3I32 *p3,CColorROPU32 color)
-{//This is the dft dc->lighting() callback.
-  CD3I32 v1,v2;
-  I64 i,vn_x,vn_y,vn_z;
-  F64 d;
-
-  v1.x=p1->x-p2->x;
-  v1.y=p1->y-p2->y;
-  v1.z=p1->z-p2->z;
-
-  v2.x=p3->x-p2->x;
-  v2.y=p3->y-p2->y;
-  v2.z=p3->z-p2->z;
-
-  //V1 and V2 are vects along two sides
-  //of the tri joined at p2.
-
-  vn_x=v1.y*v2.z-v1.z*v2.y;
-  vn_y=v1.z*v2.x-v1.x*v2.z;
-  vn_z=v1.x*v2.y-v1.y*v2.x;
-  if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z)))
-    d=1<<16/d;
-  vn_x*=d;
-  vn_y*=d;
-  vn_z*=d;
-//Vn is the cross product of V1 and V3
-  //which means it is perpendicular.  It
-  //is the normal vect to the surface.
-  //It has been scaled to length 65536.
-
-  //Light source has been scaled to length 65536.
-  i=(vn_x*dc->ls.x+vn_y*dc->ls.y+vn_z*dc->ls.z)>>16;
-//The dot product of the light source
-  //vect and the surface normal
-  //gives an illumination number.
-  //65536*65536>>16=65536
-
-  //TempleOS will generate a random U16
-  //and compare to dither_probability_u16 and
-  //will pick from two colors.
-  //Probability dithering does not work with thick>1 at this time.
-  if (color.c0.rop&ROPBF_TWO_SIDED) {
-    color.c0.rop&=~ROPBF_TWO_SIDED;
-    i=AbsI64(i)<<1;
-  } else
-    i+=65536;
-  if (color.c0.rop&ROPBF_HALF_RANGE_COLOR) {
-    color.c0.rop&=~ROPBF_HALF_RANGE_COLOR;
-    i>>=1;
-    if (color>=8) {
-      color-=8;
-      i+=65536;
-    }
-  }
-  if (i<65536) {
-    dc->color=ROPF_PROBABILITY_DITHER+color<<16+BLACK;
-    dc->dither_probability_u16=i;
-  } else {
-    dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color;
-    dc->dither_probability_u16=i-65536;
-  }
-}
-
-#help_index "Graphics/Device Contexts"
-public U0 DCFill(CDC *dc=NULL,CColorROPU32 val=TRANSPARENT)
-{//Fill entire device context with color.
-  if (!dc) dc=gr.dc;
-  MemSet(dc->body,val,dc->width_internal*dc->height);
-}
-
-public U0 DCClear(CDC *dc=NULL)
-{//Set entire device context image body to 0 (BLACK).
-  if (!dc) dc=gr.dc;
-  DCFill(dc,0);
-}
-
-public U0 DCRst(CDC *dc)
-{//Reset CDC structure members but not image body, itself.
-  dc->color=BLACK;
-  dc->color2=BLACK;
-  dc->bkcolor=BLACK;
-  dc->collision_cnt=0;
-  dc->thick=1;
-  dc->ls.x=37837; //1<<16/Sqrt(3)
-  dc->ls.y=37837;
-  dc->ls.z=37837;
-  dc->x=0;
-  dc->y=0;
-  dc->z=0;
-  dc->transform=&DCTransform;
-  dc->lighting =&DCLighting;
-  Mat4x4IdentEqu(dc->r);
-  dc->r_norm=GR_SCALE;
-  dc->flags&=~(DCF_SYMMETRY|DCF_TRANSFORMATION|DCF_JUST_MIRROR);
-  MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*COLORS_NUM);
-}
-
-public U0 DCExtentsInit(CDC *dc=NULL)
-{//Init markers for extent of next newly drawn graphics.
-//NULL means gr.dc
-  //See ::/Demo/Graphics/Extents.HC
-  //You should clear the record flag yourself
-  if (!dc)   dc=gr.dc;
-  dc->flags|=DCF_RECORD_EXTENTS;
-  dc->min_x=I64_MAX;
-  dc->max_x=I64_MIN;
-  dc->min_y=I64_MAX;
-  dc->max_y=I64_MIN;
-}
-
-public CDC *DCAlias(CDC *dc=NULL,CTask *task=NULL)
-{//Create alias of dc, so can change pen, color, etc.
-//NULL means gr.dc
-  CDC *res;
-  if (!dc)   dc=gr.dc;
-  if (!task) task=Fs;
-  if (dc->dc_signature!=DCS_SIGNATURE_VAL)
-    throw('Graphics');
-  res=MAlloc(sizeof(CDC),task);
-  MemCpy(res,dc,sizeof(CDC));
-  res->win_task=res->mem_task=task;
-  res->r=MAlloc(16*sizeof(I64),task);
-  DCRst(res);
-  res->flags|=DCF_ALIAS;
-  res->alias=dc;
-  return res;
-}
-
-public CDC *DCNew(I64 width,I64 height,CTask *task=NULL,Bool null_bitmap=FALSE)
-{//Create new width x height device context.
-//Internally only allows widths which are divisible by 8.
-  //Don't forget these sizeof(CDC).
-  CDC *res;
-  if (!task) task=Fs;
-  res=CAlloc(sizeof(CDC),task);
-  res->win_task=task;
-  res->mem_task=task;
-  res->width=width;
-  res->width_internal=(width+7)&~7;
-  res->height=height;
-  if (null_bitmap)
-    res->flags|=DCF_DONT_DRAW;
-  else
-    res->body=CAlloc(res->width_internal*res->height,task);
-  res->r=MAlloc(16*sizeof(I64),task);
-  DCRst(res);
-  res->dc_signature=DCS_SIGNATURE_VAL;
-  return res;
-}
-
-public U0 DCDel(CDC *dc)
-{//Free dc, image body, rot mat and depth buf.
-  if (!dc) return;
-  if (dc->dc_signature!=DCS_SIGNATURE_VAL)
-    throw('Graphics');
-  dc->dc_signature=0;
-  Free(dc->r);
-  if (!(dc->flags & DCF_ALIAS))
-    Free(dc->body);
-  Free(dc->depth_buf);
-  Free(dc);
-}
-
-public I64 DCSize(CDC *dc)
-{//Mem size of header, image body and depth buffer.
-  if (dc)
-    return MSize2(dc)+MSize2(dc->body)+MSize2(dc->depth_buf);
-  else
-    return 0;
-}
-
-public I32 *DCDepthBufRst(CDC *dc)
-{//Reset device context depth buf to far away.
-  if (dc->depth_buf)
-    MemSetU32(dc->depth_buf,I32_MAX,dc->width_internal*dc->height);
-  return dc->depth_buf;
-}
-
-public I32 *DCDepthBufAlloc(CDC *dc)
-{//Alloc a 32-bit depth buffer for device context.
-  Free(dc->depth_buf);
-  dc->depth_buf=MAlloc(dc->width_internal*dc->height*sizeof(I32),dc->mem_task);
-  return DCDepthBufRst(dc);
-}
-
-public CDC *DCCopy(CDC *dc,CTask *task=NULL)
-{//Alloc copy of dc, including image body, rot mat and depth buf.
-  CDC *res;
-  if (!dc) return NULL;
-  if (dc->dc_signature!=DCS_SIGNATURE_VAL)
-    throw('Graphics');
-  res=MAllocIdent(dc,task);
-  DCMat4x4Set(res,Mat4x4New(dc->r,task));
-  res->mem_task=task;
-  res->body=MAllocIdent(dc->body,task);
-  res->depth_buf=MAllocIdent(dc->depth_buf,task);
-  return res;
-}
-
-public U0 DCMono(CDC *dc,
-  I64 quest=TRANSPARENT,I64 true_color=0,I64 false_color=COLOR_MONO)
-{//Set entire device context to one of two colors.
-  I64 i;
-  U8 *dst;
-  dst=dc->body;
-  i=dc->width_internal*dc->height;
-  while (i--)
-    if (*dst==quest)
-      *dst++=true_color;
-    else
-      *dst++=false_color;
-}
-
-public I64 DCColorChg(CDC *dc,I64 src_color,I64 dst_color=TRANSPARENT)
-{//Find and replace src color with dst in device context.
-  I64 i,res=0;
-  U8 *dst;
-  dst=dc->body;
-  i=dc->width_internal*dc->height;
-  while (i--)
-    if (*dst==src_color) {
-      *dst++=dst_color;
-      res++;
-    } else
-      dst++;
-  return res;
-}
-
-public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
-{//Stores device context to mem, perhaps, with compression.
-  U8 *res,*ptr,*body;
-  CArcCompress *arc;
-  I64 body_size=dc->width_internal*dc->height,total_size,flags;
-  CBGR48 palette[COLORS_NUM];
-
-  if (dcsf_flags&DCSF_COMPRESSED) {
-    arc=CompressBuf(dc->body,body_size);
-    body_size=arc->compressed_size;
-    body=arc;
-  } else {
-    arc=NULL;
-    body=dc->body;
-  }
-
-  total_size=offset(CDC.end)-offset(CDC.start)+body_size;
-  if (dcsf_flags&DCSF_COMPRESSED)
-    flags=DCF_COMPRESSED;
-  else
-    flags=0;
-
-  if (dcsf_flags&DCSF_PALETTE_GET)
-    GrPaletteGet(palette);
-  else
-    MemCpy(palette,&dc->palette,COLORS_NUM*sizeof(CBGR48));
-  if (MemCmp(palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48))) {
-    flags|=DCF_PALETTE;
-    total_size+=COLORS_NUM*sizeof(CBGR48);
-  }
-
-  ptr=res=MAlloc(total_size);
-
-#assert !offset(CDC.start)
-  MemCpy(ptr,&dc->start,offset(CDC.end)-offset(CDC.start));
-  ptr(CDC *)->flags=flags;
-  ptr+=offset(CDC.end)-offset(CDC.start);
-
-#assert offset(CDC.end)==offset(CDC.palette)
-  if (flags&DCF_PALETTE) {
-    MemCpy(ptr,palette,COLORS_NUM*sizeof(CBGR48));
-    ptr+=COLORS_NUM*sizeof(CBGR48);
-  }
-
-  MemCpy(ptr,body,body_size);
-  ptr+=body_size;
-
-  Free(arc);
-  if (_size) *_size=total_size;
-  return res;
-}
-
-public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
-{//Loads device context from mem.
-  CDC *res;
-  U8 *ptr=src;
-  CArcCompress *arc;
-  I64 body_size;
-  if (!task) task=Fs;
-  res=CAlloc(sizeof(CDC),task);
-  res->win_task=task;
-  res->mem_task=task;
-  MemCpy(&res->start,ptr,offset(CDC.end)-offset(CDC.start));
-  ptr+=offset(CDC.end)-offset(CDC.start);
-
-  if (res->flags&DCF_PALETTE) {
-    MemCpy(&res->palette,ptr,COLORS_NUM*sizeof(CBGR48));
-    ptr+=COLORS_NUM*sizeof(CBGR48);
-  } else
-    MemCpy(&res->palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48));
-
-  body_size=res->width_internal*res->height;
-  if (res->flags&DCF_COMPRESSED) {
-    res->flags&=~DCF_COMPRESSED;
-    arc=ptr;
-    res->body=ExpandBuf(arc,task);
-    ptr+=arc->compressed_size;
-  } else {
-    res->body=MAlloc(body_size,task);
-    MemCpy(res->body,ptr,body_size);
-    ptr+=body_size;
-  }
-  res->thick=1;
-  res->r=Mat4x4IdentNew(task);
-  res->r_norm.u32[1]=1;
-  res->dc_signature=DCS_SIGNATURE_VAL;
-  if (_size) *_size=ptr-src;
-  return res;
-}
-
-#help_index "Graphics/GR Files"
-#help_file "::/Doc/GRFiles"
-#help_index "Graphics/Device Contexts;Graphics/GR Files"
-
-#define GR_FILE_MAX     (offset(CDC.end)-offset(CDC.start)+\
-        COLORS_NUM*sizeof(CBGR48)+sizeof(CArcCtrl)+GR_WIDTH*GR_HEIGHT)
-
-public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
-{//TempleOS GR File.
-  I64   size;
-  U8    *st=ExtDft(filename,"GR.Z"),
-        *src=DCSave(dc,&size,dcsf_flags);
-  FileWrite(st,src,size);
-  Free(st);
-  Free(src);
-  return size;
-}
-
-public CDC *GRRead(U8 *filename,CTask *task=NULL)
-{//TempleOS GR File.
-  CDC   *dc=NULL;
-  U8    *st=ExtDft(filename,"GR.Z"),
-        *src=FileRead(st);
-  if (src)
-    dc=DCLoad(src,,task);
-  Free(src);
-  Free(st);
-  return dc;
-}
-
-#help_index "Graphics/Sprite;Graphics/GR Files;DolDoc/Output;StdOut/DolDoc"
-public U0 DocGR(CDoc *doc=NULL,U8 *filename)
-{//Put a GR file into a document as asprite.
-  CDC *dc=GRRead(filename);
-  CSprite *elems=DC2Sprite(dc);
-  DocSprite(doc,elems);
-  Free(elems);
-  DCDel(dc);
-}
-
-#help_index "Graphics/Device Contexts;Graphics/Scrn"
-public CDC *DCScrnCapture(Bool include_zoom=TRUE,CTask *task=NULL)
-{//Capture scrn to a device context.
-  CDC *dc;
-  U8 *dst;
-  Refresh(0,FALSE);
-  if (include_zoom)
-    dc=DCCopy(gr.scrn_image,task);
-  else
-    dc=DCCopy(gr.dc1,task);
-  dc->flags&=~DCF_SCRN_BITMAP;
-  dst=MAlloc(dc->width_internal*dc->height,task);
-//Pick background color that never occurs. COLOR_INVALID
-  GrBitMap4ToBitMap8(dst,dc->body,
-        (dc->width_internal*dc->height)>>1,COLOR_INVALID);
-  Free(dc->body);
-  dc->body=dst;
-  return dc;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrEnd.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrEnd.HC.HTML deleted file mode 100755 index 351ed8b..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrEnd.HC.HTML +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Scrn"
-
-U0 CtrlAltZ(I64 sc)
-{
-  if (sc&SCF_SHIFT)
-    GrScaleZoom(0.5);
-  else
-    GrScaleZoom(2.0);
-}
-CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
-        "Cmd /Zoom Out");
-
-U0 Scrn2Clip(I64)
-{
-  CDC *dc=DCScrnCapture;
-  U8 *elems=DC2Sprite(dc);
-  Bool unlock_doc=DocLock(sys_clip_doc);
-  ClipDel;
-  DocSprite(sys_clip_doc,elems);
-  if (unlock_doc)
-    DocUnlock(sys_clip_doc);
-  Free(elems);
-  DCDel(dc);
-}
-U0 CtrlAltS(I64)
-{
-  Spawn(&Scrn2Clip);
-}
-CtrlAltCBSet('S',&CtrlAltS,"Cmd /Scrn Shot to Clip");
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrExt.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrExt.HC.HTML deleted file mode 100755 index f6873f3..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrExt.HC.HTML +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-extern U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor);
-extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
-extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
-extern U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL);
-extern CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
-        I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
-        I64 *_xx=NULL,I64 *_yy=NULL);
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrGlbls.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrGlbls.HC.HTML deleted file mode 100755 index 1128344..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrGlbls.HC.HTML +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-
-public class CGrGlbls
-{
-  I64   *to_8_bits,*to_8_colors;
-  CDC   *scrn_image,    //Read only.
-        *dc,            //Persistent
-        *dc1,
-        *dc2,           //Updated every refresh
-        *dc_cache,
-        *zoomed_dc;
-  U32   *text_base;     //See TextBase Layer. (Similar to 0xB8000 but 32 bits)
-  U16   *win_z_buf;
-
-  #define SPHT_ELEM_CODE        1
-  CHashTable *sprite_hash;
-
-  U16   *win_uncovered_bitmap;
-  I64   highest_uncovered;
-  U16   *vga_text_cache;
-  I64   pan_text_x,pan_text_y;  //[-7,7]
-  U0    (*fp_final_scrn_update)(CDC *dc);//Mouse cursor is handled here.
-  U0    (*fp_wall_paper)(CTask *task);
-  U0    (*fp_draw_ms)(CDC *dc,I64 x,I64 y);
-  U0    (*fp_draw_grab_ms)(CDC *dc,I64 x,I64 y,Bool closed);
-  U8    *empty_sprite; //Gets assigned gr.empty_sprite
-
-  #define GR_PEN_BRUSHES_NUM 64
-  CDC   *pen_brushes[GR_PEN_BRUSHES_NUM],
-        *collision_pen_brushes[GR_PEN_BRUSHES_NUM],
-        *even_pen_brushes[GR_PEN_BRUSHES_NUM],
-        *odd_pen_brushes[GR_PEN_BRUSHES_NUM];
-  I8    circle_lo[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM],
-        circle_hi[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM];
-
-  #define GR_SCRN_ZOOM_MAX      8
-  U8    *scrn_zoom_tables[GR_SCRN_ZOOM_MAX+1];
-  I64   scrn_zoom,sx,sy;
-
-  //When zoomed, this keeps the mouse centered.
-  Bool  continuous_scroll,
-        hide_row,hide_col;
-} gr;
-
-//See RLf_VGA
-//See SysGrInit()
-//Allows consts to be used instead of vars.
-HashPublic("GR_WIDTH",HTT_DEFINE_STR);;
-HashPublic("GR_HEIGHT",HTT_DEFINE_STR);;
-
-#help_index "Char;TextBase Layer/Char"
-DefinePrint("TEXT_ROWS","%d",text.rows);;;
-HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;;
-DefinePrint("TEXT_COLS","%d",text.cols);;;
-HashPublic("TEXT_COLS",HTT_DEFINE_STR);;;
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrInitA.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrInitA.HC.HTML deleted file mode 100755 index 88c5c38..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrInitA.HC.HTML +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-
-U0 GrInit1()
-{
-  DefineLstLoad("ST_SPRITE_ELEM_TYPES",
-        "End\0Color\0Dither Color\0"
-        "Thick\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
-        "Point\0PolyPoint\0Line\0PolyLine\0Rect\0Rotated Rect\0"
-        "Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2 Closed\0"
-        "BSpline3\0BSpline3 Closed\0"
-        "Flood Fill\0Flood Fill Not Color\0BitMap\0Mesh\0Shiftable Mesh\0"
-        "Arrow\0Text\0Text Box\0Text Diamond\0");
-  DefineLstLoad("ST_SPRITE_ELEM_CODES",
-        "End\0Color\0Color\0"
-        "Thick\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
-        "Pt\0PolyPt\0Line\0PolyLine\0Rect\0Rect\0"
-        "Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2\0BSpline3\0BSpline3\0"
-        "FloodFill\0FloodFill\0BitMap\0Mesh\0Mesh\0"
-        "Arrow\0Text\0TextBox\0TextDiamond\0");
-}
-GrInit1;
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrInitB.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrInitB.HC.HTML deleted file mode 100755 index 0bb9e8f..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrInitB.HC.HTML +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Scrn"
-
-U0 GrSetUpTables()
-{
-  CDC *dc;
-  I64 i,j,k,l,m,x,y,rr;
-  U8 *dst;
-
-  k=0;
-  for (i=0;i<256;i++)
-    for (j=0;j<8;j++)
-      if (Bt(&i,j))
-        gr.to_8_bits(U8 *)[k++]=0xFF;
-      else
-        gr.to_8_bits(U8 *)[k++]=0x00;
-  k=0;
-  for (i=0;i<256;i++)
-    for (j=0;j<8;j++)
-      gr.to_8_colors(U8 *)[k++]=i;
-
-  for (i=0;i<GR_PEN_BRUSHES_NUM;i++) {
-    k=i+1;
-
-    rr=k*k;
-    for (y=1;y<k;y++)
-      for (x=1;x<k;x++)
-        if (SqrI64(y*2-k)+SqrI64(x*2-k)<rr) {
-          if (x-1-i>>1<gr.circle_lo[i][i-y])
-            gr.circle_lo[i][i-y]=x-1-i>>1;
-          if (x-1-i>>1>gr.circle_hi[i][i-y])
-            gr.circle_hi[i][i-y]=x-1-i>>1;
-        }
-
-    dc=DCNew(i,i);
-    gr.pen_brushes[i]=dc;
-    dc->color=COLOR_MONO;
-    rr=k*k;
-    for (y=1;y<k;y++)
-      for (x=1;x<k;x++)
-        if (SqrI64(y*2-k)+SqrI64(x*2-k)<rr)
-          GrPlot0(dc,x-1,y-1);
-
-    dc=DCNew(i,i);
-    gr.collision_pen_brushes[i]=dc;
-    dc->color=COLOR_INVALID;//Want color that never occurs.
-    rr=k*k;
-    for (y=1;y<k;y++)
-      for (x=1;x<k;x++)
-        if (SqrI64(y*2-k)+SqrI64(x*2-k)<rr)
-          GrPlot0(dc,x-1,y-1);
-
-    dc=DCNew(i,i);
-    gr.even_pen_brushes[i]=dc;
-    dc->color=COLOR_MONO;
-    rr=k*k;
-    for (y=1;y<k;y++)
-      for (x=1;x<k;x++)
-        if (!(((x-1)^(y-1))&1) && SqrI64(y*2-k)+SqrI64(x*2-k)<rr)
-          GrPlot0(dc,x-1,y-1);
-
-    dc=DCNew(i,i);
-    gr.odd_pen_brushes[i]=dc;
-    dc->color=COLOR_MONO;
-    rr=k*k;
-    for (y=1;y<k;y++)
-      for (x=1;x<k;x++)
-        if (((x-1)^(y-1))&1 && SqrI64(y*2-k)+SqrI64(x*2-k)<rr)
-          GrPlot0(dc,x-1,y-1);
-  }
-  if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode
-    MemSet(text.vga_text_alias,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
-    MemSet(gr.vga_text_cache,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
-  } else {
-    OutU8(VGAP_IDX,VGAR_MAP_MASK);
-    OutU8(VGAP_DATA,0x0F);
-//Virtual Box crashes on the following for some reason.
-    //    MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
-    MemSet(gr.scrn_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
-  }
-  for (i=1;i<=GR_SCRN_ZOOM_MAX;i++) {
-    dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
-    for (j=0;j<256;j++) {
-      m=0;
-      for (k=0;k<8;k++) {
-        if (Bt(&j,k)) {
-          for (l=0;l<i;l++)
-            Bts(&m,l+k*i);
-        }
-      }
-      for (l=0;l<i;l++)
-        dst[j+l*256]=m.u8[l];
-    }
-  }
-}
-
-#help_index "Graphics/Scrn;Windows"
-
-U0 WinZBufFill(CTask *task)
-{//Not public
-  I64 y,t,b,l,r,w;
-  if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) {
-    if (task->win_top-1>0)
-      t=task->win_top-1;
-    else
-      t=0;
-    if (task->win_bottom+1<TEXT_ROWS)
-      b=task->win_bottom+1;
-    else
-      b=TEXT_ROWS-1;
-    if (task->win_left-1>0)
-      l=task->win_left-1;
-    else
-      l=0;
-    if (task->win_right+1<TEXT_COLS)
-      r=task->win_right+1;
-    else
-      r=TEXT_COLS-1;
-  } else {
-    if (task->win_top>0)
-      t=task->win_top;
-    else
-      t=0;
-    if (task->win_bottom<TEXT_ROWS)
-      b=task->win_bottom;
-    else
-      b=TEXT_ROWS-1;
-    if (task->win_left>0)
-      l=task->win_left;
-    else
-      l=0;
-    if (task->win_right<TEXT_COLS)
-      r=task->win_right;
-    else
-      r=TEXT_COLS-1;
-  }
-  t=ClampI64(t,0,TEXT_ROWS-1);
-  b=ClampI64(b,t,TEXT_ROWS-1);
-  l=ClampI64(l,0,TEXT_COLS-1);
-  r=ClampI64(r,l,TEXT_COLS-1);
-  if (w=r-l+1)
-    for (y=t;y<=b;y++)
-      MemSetU16(gr.win_z_buf(U8 *)+(y*TEXT_COLS+l)*sizeof(U16),
-            task->win_z_num,w);
-}
-
-public U0 WinZBufUpdate()
-{//Might have to call if doing graphics outside winmgr callback routines.
-//Call it if, for example, when a pop-up window closes and you need to refresh
-  //before graphics.
-  I64 i,z=1;
-  U16 *ptr;
-  CTask *task,*task1;
-  if (gr.win_z_buf) {
-    LBtr(&sys_semas[SEMA_UPDATE_WIN_Z_BUF],0);
-    task1=task=sys_winmgr_task;
-    do {
-      if (!TaskValidate(task)) break;
-      if (Bt(&task->display_flags,DISPLAYf_SHOW)) {
-        task->win_z_num=z++;
-        WinZBufFill(task);
-      }
-      task=task->next_task;
-    } while (task!=task1 && z<0x10000);
-
-    MemSet(gr.win_uncovered_bitmap,0,(gr.highest_uncovered+7)>>3+1);
-    gr.highest_uncovered=z-1;
-    for (ptr=gr.win_z_buf,i=TEXT_ROWS*TEXT_COLS;i;i--)
-      Bts(gr.win_uncovered_bitmap,*ptr++);
-  }
-}
-
-#help_index "Graphics"
-U0 GrInit2()
-{
-  MemSet(&gr,0,sizeof(CGrGlbls));
-  gr.sprite_hash=HashTableNew(512);
-  HashDefineLstAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
-  gr.scrn_zoom=1;
-
-  PaletteSetStd;
-  fp_set_std_palette=&PaletteSetStd;
-  GrPaletteIndicesSet;
-
-  gr.to_8_bits  =MAlloc(256*sizeof(I64));
-  gr.to_8_colors=MAlloc(256*sizeof(I64));
-
-  gr.text_base=CAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U32));
-  gr.vga_text_cache=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
-  gr.win_uncovered_bitmap=CAlloc(65536/8);
-  gr.highest_uncovered=0;
-  gr.win_z_buf=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
-
-  gr.dc2=DCNew(GR_WIDTH,GR_HEIGHT);
-  gr.dc2->flags|=DCF_SCRN_BITMAP;
-  gr.dc_cache=DCNew(GR_WIDTH,GR_HEIGHT);
-
-  gr.dc=DCNew(GR_WIDTH,GR_HEIGHT);
-  gr.dc->flags|=DCF_SCRN_BITMAP|DCF_ON_TOP;
-  DCFill;
-
-  gr.dc1=DCNew(GR_WIDTH,GR_HEIGHT);
-  gr.dc1->flags|=DCF_SCRN_BITMAP;
-
-  gr.scrn_image=DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
-  gr.zoomed_dc   =DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
-  gr.zoomed_dc->flags|=DCF_SCRN_BITMAP;
-}
-
-GrInit2;
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrMath.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrMath.HC.HTML deleted file mode 100755 index b1df487..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrMath.HC.HTML +++ /dev/null @@ -1,836 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Math"
-
-public I64 gr_x_offsets[8]={-1, 0, 1,-1,1,-1,0,1},
-           gr_y_offsets[8]={-1,-1,-1, 0,0, 1,1,1},
-          gr_x_offsets2[4]={ 0,-1, 1, 0},
-          gr_y_offsets2[4]={-1, 0, 0, 1};
-
-public Bool Line(U8 *aux_data,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),I64 step=1,I64 start=0)
-{//Step through line segment calling callback.
-//Uses fixed-point.
-  I64 i,j,d,dx=x2-x1,dy=y2-y1,dz=z2-z1,_x,_y,_z,
-        adx=AbsI64(dx),ady=AbsI64(dy),adz=AbsI64(dz);
-  Bool first=TRUE;
-  if (adx>=ady) {
-    if (adx>=adz) {
-      if (d=adx) {
-        if (dx>=0)
-          dx=0x100000000;
-        else
-          dx=-0x100000000;
-        dy=dy<<32/d;
-        dz=dz<<32/d;
-      }
-    } else {
-      if (d=adz) {
-        dx=dx<<32/d;
-        dy=dy<<32/d;
-        if (dz>=0)
-          dz=0x100000000;
-        else
-          dz=-0x100000000;
-      }
-    }
-  } else {
-    if (ady>=adz) {
-      if (d=ady) {
-        dx=dx<<32/d;
-        if (dy>=0)
-          dy=0x100000000;
-        else
-          dy=-0x100000000;
-        dz=dz<<32/d;
-      }
-    } else {
-      if (d=adz) {
-        dx=dx<<32/d;
-        dy=dy<<32/d;
-        if (dz>=0)
-          dz=0x100000000;
-        else
-          dz=-0x100000000;
-      }
-    }
-  }
-  x1<<=32; y1<<=32; z1<<=32;
-  for (j=0;j<start;j++) {
-    x1+=dx; y1+=dy; z1+=dz;
-  }
-  if (step!=1 && step!=0) {
-    dx*=step;
-    dy*=step;
-    dz*=step;
-    d/=step;
-  }
-  for (i=start;i<=d;i++) {
-    if ((_x!=x1.i32[1] || _y!=y1.i32[1] || _z!=z1.i32[1] || first) &&
-          !(*fp_plot)(aux_data,x1.i32[1],y1.i32[1],z1.i32[1]))
-      return FALSE;
-    first=FALSE;
-    _x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
-    x1+=dx; y1+=dy; z1+=dz;
-  }
-  if (step==1 && (_x!=x2||_y!=y2||_z!=z2) && !(*fp_plot)(aux_data,x2,y2,z2))
-    return FALSE;
-  return TRUE;
-}
-
-#help_index "Graphics/Math/3D Transformation"
-public I64 *Mat4x4MulMat4x4Equ(I64 *dst,I64 *m1,I64 *m2)
-{//Multiply 4x4 matrices and store in dst. Uses fixed-point.
-//Conceptually, the transform m1 is applied after m2
-  I64 i,j,k;
-  F64 sum;
-  for (i=0;i<4;i++) {
-    for (j=0;j<4;j++) {
-      sum=0;
-      for (k=0;k<4;k++)
-        sum+=ToF64(m1[k+4*j])*ToF64(m2[i+4*k]);
-      dst[i+4*j]=sum/GR_SCALE;
-    }
-  }
-  return dst;
-}
-
-public I64 *Mat4x4MulMat4x4New(I64 *m1,I64 *m2,CTask *mem_task=NULL)
-{//Multiply 4x4 matrices. Return MAlloced matrix. Uses fixed-point.
-//Conceptually, the transform m1 is applied after m2
-  return Mat4x4MulMat4x4Equ(MAlloc(sizeof(I64)*16,mem_task),m1,m2);
-}
-
-public I64 *Mat4x4Equ(I64 *dst,I64 *src)
-{//Copy 4x4 Rot matrix.
-  MemCpy(dst,src,sizeof(I64)*16);
-  return dst;
-}
-
-public I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL)
-{//Return MAlloced copy of 4x4 Rot matrix.
-  return Mat4x4Equ(MAlloc(sizeof(I64)*16,mem_task),src);
-}
-
-public I64 *Mat4x4RotX(I64 *m,F64 phi)
-{//Rot matrix about X axis. Uses fixed-point.
-  F64 my_cos=Cos(phi)*GR_SCALE,my_sin=Sin(phi)*GR_SCALE;
-  I64 r[16],r2[16];
-  MemSet(r,0,sizeof(r));
-  r[5]=my_cos;
-  r[10]=my_cos;
-  r[9]=my_sin;
-  r[6]=-my_sin;
-  r[0]=GR_SCALE;
-  r[15]=GR_SCALE;
-  return Mat4x4Equ(m,Mat4x4MulMat4x4Equ(r2,r,m));
-}
-
-public I64 *Mat4x4RotY(I64 *m,F64 omega)
-{//Rot matrix about Y axis. Uses fixed-point.
-  F64 my_cos=Cos(omega)*GR_SCALE,my_sin=Sin(omega)*GR_SCALE;
-  I64 r[16],r2[16];
-  MemSet(r,0,sizeof(r));
-  r[0]=my_cos;
-  r[10]=my_cos;
-  r[8]=-my_sin;
-  r[2]=my_sin;
-  r[5]=GR_SCALE;
-  r[15]=GR_SCALE;
-  return Mat4x4Equ(m,Mat4x4MulMat4x4Equ(r2,r,m));
-}
-
-public I64 *Mat4x4RotZ(I64 *m,F64 theta)
-{//Rot matrix about Z axis. Uses fixed-point.
-  F64 my_cos=Cos(theta)*GR_SCALE,my_sin=Sin(theta)*GR_SCALE;
-  I64 r[16],r2[16];
-  MemSet(r,0,sizeof(r));
-  r[0]=my_cos;
-  r[5]=my_cos;
-  r[4]=my_sin;
-  r[1]=-my_sin;
-  r[10]=GR_SCALE;
-  r[15]=GR_SCALE;
-  return Mat4x4Equ(m,Mat4x4MulMat4x4Equ(r2,r,m));
-}
-
-public I64 *Mat4x4Scale(I64 *m,F64 s)
-{//Scale 4x4 matrix by value.
-  I64 i;
-  for (i=0;i<16;i++)
-    m[i]*=s;
-  return m;
-}
-
-public U0 DCThickScale(CDC *dc=gr.dc)
-{//Scale device context's thick by norm of transformation.
-  I64 d;
-  if (dc->flags&DCF_TRANSFORMATION) {
-    if (dc->thick) {
-      d=dc->thick*dc->r_norm+0x80000000; //Round
-      dc->thick=d.i32[1];
-      if (dc->thick<1)
-        dc->thick=1;
-    }
-  }
-}
-
-public I64 *Mat4x4TranslationEqu(I64 *r,I64 x,I64 y,I64 z)
-{//Set translation values in 4x4 matrix. Uses fixed-point.
-  r[0*4+3]=x<<32;
-  r[1*4+3]=y<<32;
-  r[2*4+3]=z<<32;
-  r[3*4+3]=GR_SCALE;
-  return r;
-}
-
-public I64 *Mat4x4TranslationAdd(I64 *r,I64 x,I64 y,I64 z)
-{//Add translation to 4x4 matrix. Uses fixed-point.
-  r[0*4+3]+=x<<32;
-  r[1*4+3]+=y<<32;
-  r[2*4+3]+=z<<32;
-  r[3*4+3]=GR_SCALE;
-  return r;
-}
-
-public Bool DCSymmetrySet(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2)
-{//2D. Set device context's symmetry.
-  F64 d;
-  if (y1==y2 && x1==x2)
-    return FALSE;
-  dc->sym.snx=y2-y1;
-  dc->sym.sny=x1-x2;
-  dc->sym.snz=0;
-  if (d=Sqrt(SqrI64(dc->sym.snx)+
-        SqrI64(dc->sym.sny)+
-        SqrI64(dc->sym.snz))) {
-    d=GR_SCALE/d;
-    dc->sym.snx *= d;
-    dc->sym.sny *= d;
-    dc->sym.snz *= d;
-  }
-  dc->sym.sx=x1;
-  dc->sym.sy=y1;
-  dc->sym.sz=0;
-  return TRUE;
-}
-
-public Bool DCSymmetry3Set(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
-        I64 x2,I64 y2,I64 z2,I64 x3,I64 y3,I64 z3)
-{//3D. Set device context's symmetry.
-  F64 d,x,y,z,xx,yy,zz;
-  I64 xx1,yy1,zz1,xx2,yy2,zz2,*r;
-  xx1=x1-x2; yy1=y1-y2; zz1=z1-z2;
-  xx2=x3-x2; yy2=y3-y2; zz2=z3-z2;
-  if (!xx1 && !yy1 && !zz1 ||
-        !xx2 && !yy2 && !zz2 ||
-        xx1==xx2 && yy1==yy2 && zz1==zz2)
-    return FALSE;
-
-  x=yy1*zz2-zz1*yy2;
-  y=-xx1*zz2+zz1*xx2;
-  z=xx1*yy2-yy1*xx2;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    r=dc->r;
-    xx=x*r[0]+y*r[1]+z*r[2];
-    yy=x*r[4]+y*r[5]+z*r[6];
-    zz=x*r[8]+y*r[9]+z*r[10];
-    x=xx; y=yy; z=zz;
-  }
-  if (d=Sqrt(Sqr(x)+Sqr(y)+Sqr(z))) {
-    d=GR_SCALE/d;
-    dc->sym.snx = d*x;
-    dc->sym.sny = d*y;
-    dc->sym.snz = d*z;
-  }
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x1,&y1,&z1);
-  dc->sym.sx=x1;
-  dc->sym.sy=y1;
-  dc->sym.sz=z1;
-  return TRUE;
-}
-
-public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
-{//Reflect 3D point about device context's symmetry. Uses fixed-point.
-  I64 x=*_x<<32,y=*_y<<32,z=*_z<<32,
-        xx=*_x-dc->sym.sx,yy=*_y-dc->sym.sy,zz=*_z-dc->sym.sz,
-        d=(xx*dc->sym.snx+yy*dc->sym.sny+zz*dc->sym.snz)>>16,
-        xn,yn,zn,xx2,yy2,zz2;
-  xn=d*dc->sym.snx>>15;
-  yn=d*dc->sym.sny>>15;
-  zn=d*dc->sym.snz>>15;
-  xx=x-xn;
-  yy=y-yn;
-  zz=z-zn;
-  xx2=x+xn;
-  yy2=y+yn;
-  zz2=z+zn;
-  if (SqrI64(xx>>16 -dc->sym.sx<<16)+
-        SqrI64(yy>>16 -dc->sym.sy<<16)+
-        SqrI64(zz>>16 -dc->sym.sz<<16)<
-        SqrI64(xx2>>16-dc->sym.sx<<16)+
-        SqrI64(yy2>>16-dc->sym.sy<<16)+
-        SqrI64(zz2>>16-dc->sym.sz<<16)) {
-    *_x=xx.i32[1]; *_y=yy.i32[1]; *_z=zz.i32[1];
-  } else {
-    *_x=xx2.i32[1]; *_y=yy2.i32[1]; *_z=zz2.i32[1];
-  }
-}
-
-#help_index "Graphics/Math"
-#define GR_SCALE1_BITS  24
-#define GR_SCALE2_BITS  8
-public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
-        I64 step=1,F64 start_radians=0,F64 len_radians=2*pi)
-{//Step through circle arc calling callback.
-  I64 i,j,len=Ceil(len_radians*radius),
-        x,y,x1,y1,s1,s2,c;
-  F64 t;
-  if (radius<=0||!step) return TRUE;
-  t=1.0/radius;
-  c=1<<GR_SCALE1_BITS*Cos(t);
-  if (step<0) {
-    step=-step;
-    s2=1<<GR_SCALE1_BITS*Sin(t);
-    s1=-s2;
-  } else {
-    s1=1<<GR_SCALE1_BITS*Sin(t);
-    s2=-s1;
-  }
-  if (start_radians) {
-    x=radius*Cos(start_radians);
-    y=-radius*Sin(start_radians);
-  } else {
-    x=radius;
-    y=0;
-  }
-  x<<=GR_SCALE2_BITS;
-  y<<=GR_SCALE2_BITS;
-  for (i=0;i<=len;i+=step) {
-    if (!(*fp_plot)(aux_data,cx+x>>GR_SCALE2_BITS,cy+y>>GR_SCALE2_BITS,cz))
-      return FALSE;
-    for (j=0;j<step;j++) {
-      x1=(c*x+s1*y)>>GR_SCALE1_BITS;
-      y1=(s2*x+c*y)>>GR_SCALE1_BITS;
-      x=x1; y=y1;
-    }
-  }
-  return TRUE;
-}
-
-public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz,
-        I64 x_radius,I64 y_radius,Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
-        F64 rot_angle=0,I64 step=1,F64 start_radians=0,F64 len_radians=2*pi)
-{//Step through ellipse arc calling callback.
-  I64 i,j,len,
-        x,y,_x,_y,x1,y1,x2,y2, s1,s2,c, s12,s22,c2;
-  F64 t;
-  Bool first=TRUE;
-  if (x_radius<=0 || y_radius<=0 || !step)
-    return TRUE;
-  if (x_radius>=y_radius) {
-    t=1.0/x_radius;
-    len=Ceil(len_radians*x_radius);
-  } else {
-    t=1.0/y_radius;
-    len=Ceil(len_radians*y_radius);
-  }
-
-  c=1<<GR_SCALE1_BITS*Cos(t);
-  if (step<0) {
-    step=-step;
-    s2=1<<GR_SCALE1_BITS*Sin(t);
-    s1=-s2;
-  } else {
-    s1=1<<GR_SCALE1_BITS*Sin(t);
-    s2=-s1;
-  }
-
-  c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
-  s12=1<<GR_SCALE1_BITS*Sin(rot_angle);
-  s22=-s12;
-
-  if (start_radians) {
-    x=x_radius*Cos(start_radians);
-    y=-x_radius*Sin(start_radians);
-  } else {
-    x=x_radius;
-    y=0;
-  }
-  x<<=GR_SCALE2_BITS;
-  y<<=GR_SCALE2_BITS;
-  x2=x;
-  y2=y;
-
-  y1=y2*y_radius/x_radius;
-  x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
-  y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
-
-  for (i=0;i<=len;i+=step) {
-    if ((x>>GR_SCALE2_BITS!=_x || y>>GR_SCALE2_BITS!=_y || first) &&
-          !(*fp_plot)(aux_data,cx+x>>GR_SCALE2_BITS,cy+y>>GR_SCALE2_BITS,cz))
-      return FALSE;
-
-    _x=x>>GR_SCALE2_BITS; _y=y>>GR_SCALE2_BITS; first=FALSE;
-    for (j=0;j<step;j++) {
-      x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
-      y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
-      x2=x1;
-      y2=y1;
-      y1=y1*y_radius/x_radius;
-      x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
-      y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
-    }
-  }
-  return TRUE;
-}
-
-public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz,
-        I64 x_radius,I64 y_radius,I64 sides,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
-        F64 rot_angle=0,I64 step=1,F64 start_radians=0,F64 len_radians=2*pi)
-{//Step through regular polygon calling callback.
-  I64 i,n,x,y,x1,y1,x2,y2,
-        xx1,yy1,xx2,yy2,
-        s1,s2,c, s12,s22,c2;
-  F64 angle_step;
-
-  if (sides<=0 || x_radius<=0 || y_radius<=0)
-    return TRUE;
-
-  angle_step=2*pi/sides;
-  n=len_radians*sides/(2*pi);
-
-  s1=1<<GR_SCALE1_BITS*Sin(angle_step);
-  s2=-s1;
-  c=1<<GR_SCALE1_BITS*Cos(angle_step);
-
-  s12=1<<GR_SCALE1_BITS*Sin(rot_angle);
-  s22=-s12;
-  c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
-
-  if (start_radians) {
-    x=x_radius*Cos(start_radians);
-    y=-x_radius*Sin(start_radians);
-  } else {
-    x=x_radius;
-    y=0;
-  }
-  x<<=GR_SCALE2_BITS;
-  y<<=GR_SCALE2_BITS;
-  x2=x;
-  y2=y;
-
-  y1=y2*y_radius/x_radius;
-  x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
-  y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
-
-  xx1=cx+x>>GR_SCALE2_BITS;
-  yy1=cy+y>>GR_SCALE2_BITS;
-  for (i=0;i<n;i++) {
-    x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
-    y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
-    x2=x1;
-    y2=y1;
-    y1=y1*y_radius/x_radius;
-    x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
-    y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
-    xx2=cx+x>>GR_SCALE2_BITS;
-    yy2=cy+y>>GR_SCALE2_BITS;
-    if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step))
-      return FALSE;
-    xx1=xx2; yy1=yy2;
-  }
-  return TRUE;
-}
-
-#help_index "Graphics/Data Types/D3I32;Math/Data Types/D3I32;Data Types/D3I32"
-public F64 D3I32Dist(CD3I32 *p1,CD3I32 *p2)
-{//Distance
-  return Sqrt(SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z));
-}
-
-public I64 D3I32DistSqr(CD3I32 *p1,CD3I32 *p2)
-{//Distance Squared
-  return SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z);
-}
-
-public F64 D3I32Norm(CD3I32 *p)
-{//Norm
-  return Sqrt(SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z));
-}
-
-public I64 D3I32NormSqr(CD3I32 *p)
-{//Norm Squared
-  return SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z);
-}
-
-#help_index "Graphics/Math"
-public Bool Bezier2(U8 *aux_data,CD3I32 *ctrl,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE)
-{//Go in 2nd order bezier calling callback.
-  I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max;
-  F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z,
-        x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0,
-        x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0,
-        t,d=D3I32Dist(&ctrl[0],&ctrl[1])+
-        D3I32Dist(&ctrl[1],&ctrl[2])+
-        D3I32Dist(&ctrl[2],&ctrl[0]),
-        s=0.5/d,t1,t2;
-  xx=x0; yy=y0; zz=z0;
-  if (first && !(*fp_plot)(aux_data,xx,yy,zz))
-    return FALSE;
-  for (t=0.0;t<=1.0;t+=s) {
-    t1=t*(1.0-t);
-    t2=t*t;
-    x=x0+x1*t1+x2*t2;
-    y=y0+y1*t1+y2*t2;
-    z=z0+z1*t1+z2*t2;
-    dx=AbsI64(x-xx);
-    dy=AbsI64(y-yy);
-    dz=AbsI64(z-zz);
-    if (dx>dy)
-      d_max=dx;
-    else
-      d_max=dy;
-    if (dz>d_max)
-      d_max=dz;
-    if (!d_max)
-      s*=1.1;
-    else {
-      s*=0.9;
-      if (!(*fp_plot)(aux_data,x,y,z))
-        return FALSE;
-      xx=x;yy=y;zz=z;
-    }
-  }
-  x=ctrl[2].x; y=ctrl[2].y; z=ctrl[2].z;
-  if ((xx!=x || yy!=y || zz!=z) &&
-        !(*fp_plot)(aux_data,x,y,z))
-    return FALSE;
-  return TRUE;
-}
-
-public Bool Bezier3(U8 *aux_data,CD3I32 *ctrl,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE)
-{//Go in 3rd order bezier calling callback.
-  I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max;
-  F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z,
-        x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0,
-        x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0,
-        x3=ctrl[3].x-x0,y3=ctrl[3].y-y0,z3=ctrl[3].z-z0,
-        t,d=D3I32Dist(&ctrl[0],&ctrl[1])+
-        D3I32Dist(&ctrl[1],&ctrl[2])+
-        D3I32Dist(&ctrl[2],&ctrl[3])+
-        D3I32Dist(&ctrl[3],&ctrl[0]),
-        s=0.5/d,nt,t1,t2,t3;
-  xx=x0; yy=y0; zz=z0;
-  if (first && !(*fp_plot)(aux_data,xx,yy,zz))
-    return FALSE;
-  for (t=0.0;t<=1.0;t+=s) {
-    nt=1.0-t;
-    t1=t*nt*nt;
-    t2=t*t*nt;
-    t3=t*t*t;
-    x=x0+x1*t1+x2*t2+x3*t3;
-    y=y0+y1*t1+y2*t2+y3*t3;
-    z=z0+z1*t1+z2*t2+z3*t3;
-    dx=AbsI64(x-xx);
-    dy=AbsI64(y-yy);
-    dz=AbsI64(z-zz);
-    if (dx>dy)
-      d_max=dx;
-    else
-      d_max=dy;
-    if (dz>d_max)
-      d_max=dz;
-    if (!d_max)
-      s*=1.1;
-    else {
-      s*=0.9;
-      if (!(*fp_plot)(aux_data,x,y,z))
-        return FALSE;
-      xx=x;yy=y;zz=z;
-    }
-  }
-  x=ctrl[3].x; y=ctrl[3].y; z=ctrl[3].z;
-  if ((xx!=x || yy!=y || zz!=z) &&
-        !(*fp_plot)(aux_data,x,y,z))
-    return FALSE;
-  return TRUE;
-}
-
-public Bool BSpline2(U8 *aux_data,CD3I32 *ctrl,I64 cnt,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool closed=FALSE)
-{//Go in 2nd order spline calling callback.
-  I64 i,j;
-  CD3I32 *c;
-  Bool first;
-  if (cnt<3) return FALSE;
-  first=TRUE;
-  if (closed) {
-    cnt++;
-    c=MAlloc(sizeof(CD3I32)*(cnt*2-1));
-    j=1;
-    for (i=0;i<cnt-2;i++) {
-      c[j].x=(ctrl[i].x+ctrl[i+1].x)/2.0;
-      c[j].y=(ctrl[i].y+ctrl[i+1].y)/2.0;
-      c[j].z=(ctrl[i].z+ctrl[i+1].z)/2.0;
-      j+=2;
-    }
-    c[j].x=(ctrl[0].x+ctrl[cnt-2].x)/2.0;
-    c[j].y=(ctrl[0].y+ctrl[cnt-2].y)/2.0;
-    c[j].z=(ctrl[0].z+ctrl[cnt-2].z)/2.0;
-
-    c[0].x=(c[1].x+c[j].x)/2.0;
-    c[0].y=(c[1].y+c[j].y)/2.0;
-    c[0].z=(c[1].z+c[j].z)/2.0;
-    j=2;
-    for (i=0;i<cnt-2;i++) {
-      c[j].x=(c[j-1].x+c[j+1].x)/2.0;
-      c[j].y=(c[j-1].y+c[j+1].y)/2.0;
-      c[j].z=(c[j-1].z+c[j+1].z)/2.0;
-      j+=2;
-    }
-    c[j].x=c[0].x;
-    c[j].y=c[0].y;
-    c[j].z=c[0].z;
-  } else {
-    c=MAlloc(sizeof(CD3I32)*(cnt*2-1));
-    c[0].x=ctrl[0].x;
-    c[0].y=ctrl[0].y;
-    c[0].z=ctrl[0].z;
-    c[cnt*2-2].x=ctrl[cnt-1].x;
-    c[cnt*2-2].y=ctrl[cnt-1].y;
-    c[cnt*2-2].z=ctrl[cnt-1].z;
-    j=1;
-    for (i=0;i<cnt-1;i++) {
-      c[j].x=(ctrl[i].x+ctrl[i+1].x)/2.0;
-      c[j].y=(ctrl[i].y+ctrl[i+1].y)/2.0;
-      c[j].z=(ctrl[i].z+ctrl[i+1].z)/2.0;
-      j+=2;
-    }
-    j=2;
-    for (i=0;i<cnt-2;i++) {
-      c[j].x=(c[j-1].x+c[j+1].x)/2.0;
-      c[j].y=(c[j-1].y+c[j+1].y)/2.0;
-      c[j].z=(c[j-1].z+c[j+1].z)/2.0;
-      j+=2;
-    }
-  }
-  for (i=0;i<cnt*2-2;i+=2) {
-    if (!Bezier2(aux_data,&c[i],fp_plot,first))
-      return FALSE;
-    first=FALSE;
-  }
-  Free(c);
-  return TRUE;
-}
-
-public Bool BSpline3(U8 *aux_data,CD3I32 *ctrl,I64 cnt,
-        Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool closed=FALSE)
-{//Go in 3rd order spline calling callback.
-  I64 i,j;
-  F64 x,y,z;
-  CD3I32 *c;
-  Bool first;
-  if (cnt<3) return FALSE;
-  first=TRUE;
-  if (closed) {
-    cnt++;
-    c=MAlloc(sizeof(CD3I32)*(cnt*3-2));
-    j=1;
-    for (i=0;i<cnt-2;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      c[j].x=(ctrl[i+1].x-x)/3.0+x;
-      c[j].y=(ctrl[i+1].y-y)/3.0+y;
-      c[j].z=(ctrl[i+1].z-z)/3.0+z;
-      j++;
-      c[j].x=2.0*(ctrl[i+1].x-x)/3.0+x;
-      c[j].y=2.0*(ctrl[i+1].y-y)/3.0+y;
-      c[j].z=2.0*(ctrl[i+1].z-z)/3.0+z;
-      j+=2;
-    }
-    x=ctrl[cnt-2].x;
-    y=ctrl[cnt-2].y;
-    z=ctrl[cnt-2].z;
-    c[j].x=(ctrl[0].x-x)/3.0+x;
-    c[j].y=(ctrl[0].y-y)/3.0+y;
-    c[j].z=(ctrl[0].z-z)/3.0+z;
-    j++;
-    c[j].x=2.0*(ctrl[0].x-x)/3.0+x;
-    c[j].y=2.0*(ctrl[0].y-y)/3.0+y;
-    c[j].z=2.0*(ctrl[0].z-z)/3.0+z;
-
-    c[0].x=(c[1].x+c[j].x)/2.0;
-    c[0].y=(c[1].y+c[j].y)/2.0;
-    c[0].z=(c[1].z+c[j].z)/2.0;
-
-    j=3;
-    for (i=0;i<cnt-2;i++) {
-      c[j].x=(c[j-1].x+c[j+1].x)/2.0;
-      c[j].y=(c[j-1].y+c[j+1].y)/2.0;
-      c[j].z=(c[j-1].z+c[j+1].z)/2.0;
-      j+=3;
-    }
-    c[j].x=c[0].x;
-    c[j].y=c[0].y;
-    c[j].z=c[0].z;
-  } else {
-    c=MAlloc(sizeof(CD3I32)*(cnt*3-2));
-    c[0].x=ctrl[0].x;
-    c[0].y=ctrl[0].y;
-    c[0].z=ctrl[0].z;
-    c[cnt*3-3].x=ctrl[cnt-1].x;
-    c[cnt*3-3].y=ctrl[cnt-1].y;
-    c[cnt*3-3].z=ctrl[cnt-1].z;
-    j=1;
-    for (i=0;i<cnt-1;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      c[j].x=(ctrl[i+1].x-x)/3.0+x;
-      c[j].y=(ctrl[i+1].y-y)/3.0+y;
-      c[j].z=(ctrl[i+1].z-z)/3.0+z;
-      j++;
-      c[j].x=2.0*(ctrl[i+1].x-x)/3.0+x;
-      c[j].y=2.0*(ctrl[i+1].y-y)/3.0+y;
-      c[j].z=2.0*(ctrl[i+1].z-z)/3.0+z;
-      j+=2;
-    }
-    j=3;
-    for (i=0;i<cnt-2;i++) {
-      c[j].x=(c[j-1].x+c[j+1].x)/2.0;
-      c[j].y=(c[j-1].y+c[j+1].y)/2.0;
-      c[j].z=(c[j-1].z+c[j+1].z)/2.0;
-      j+=3;
-    }
-  }
-  for (i=0;i<cnt*3-3;i+=3) {
-    if (!Bezier3(aux_data,&c[i],fp_plot,first))
-      return FALSE;
-    first=FALSE;
-  }
-  Free(c);
-  return TRUE;
-}
-
-#define CC_LEFT         1
-#define CC_RIGHT        2
-#define CC_TOP          4
-#define CC_BOTTOM       8
-
-public Bool ClipLine(I64 *_x1,I64 *_y1,I64 *_x2,I64 *_y2,
-        I64 left,I64 top,I64 right,I64 bottom)
-{//Clip x1,y1 x2,y2 with left,top,right,bottom.
-  I64 x,y,x1=*_x1,y1=*_y1,x2=*_x2,y2=*_y2,
-        cc,cc1,cc2;
-  if (y1>bottom)
-    cc1=CC_BOTTOM;
-  else if (y1<top)
-    cc1=CC_TOP;
-  else
-    cc1=0;
-  if (x1>right)
-    cc1|=CC_RIGHT;
-  else if (x1<left)
-    cc1|=CC_LEFT;
-
-  if (y2>bottom)
-    cc2=CC_BOTTOM;
-  else if (y2<top)
-    cc2=CC_TOP;
-  else
-    cc2=0;
-  if (x2>right)
-    cc2|=CC_RIGHT;
-  else if (x2<left)
-    cc2|=CC_LEFT;
-
-  while (TRUE) {
-    if (!(cc1|cc2))
-      return TRUE;
-    if (cc1&cc2)
-      return FALSE;
-
-    if (cc1)
-      cc=cc1;
-    else
-      cc=cc2;
-
-    if (cc&CC_BOTTOM) {
-      x=x1+(x2-x1)*(bottom-y1)/(y2-y1);
-      y=bottom;
-    } else if (cc&CC_TOP) {
-      x=x1+(x2-x1)*(top-y1)/(y2-y1);
-      y=top;
-    } else if (cc&CC_RIGHT) {
-      y=y1+(y2-y1)*(right-x1)/(x2-x1);
-      x=right;
-    } else {
-      y=y1+(y2-y1)*(left-x1)/(x2-x1);
-      x=left;
-    }
-
-    if (cc==cc1) {
-      *_x1=x1=x;
-      *_y1=y1=y;
-      if (y1>bottom)
-        cc1=CC_BOTTOM;
-      else if (y1<top)
-        cc1=CC_TOP;
-      else
-        cc1=0;
-      if (x1>right)
-        cc1|=CC_RIGHT;
-      else if (x1<left)
-        cc1|=CC_LEFT;
-    } else {
-      *_x2=x2=x;
-      *_y2=y2=y;
-      if (y2>bottom)
-        cc2=CC_BOTTOM;
-      else if (y2<top)
-        cc2=CC_TOP;
-      else
-        cc2=0;
-      if (x2>right)
-        cc2|=CC_RIGHT;
-      else if (x2<left)
-        cc2|=CC_LEFT;
-    }
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrPalette.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrPalette.HC.HTML deleted file mode 100755 index 67331c3..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrPalette.HC.HTML +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Color"
-public U8 gr_rainbow_10[10]={
-  BLACK,BROWN,RED,LTRED,YELLOW,GREEN,BLUE,PURPLE,LTGRAY,WHITE};
-
-DefineLstLoad("ST_RAINBOW_10",
-  "BLACK\0BROWN\0RED\0LTRED\0YELLOW\0GREEN\0BLUE\0PURPLE\0LTGRAY\0WHITE\0");
-
-U0 GrPaletteIndicesSet()
-{//There is a level of indirection that we identity map.
-// Set 16-colors to use first 16 DAC BGR entries, so we
-// never need to worry about indexes, just DAC palette settings.
-  I64 i;
-  if (!Bt(&sys_run_level,RLf_VGA)) return;
-  PUSHFD
-  CLI
-  while (LBts(&sys_semas[SEMA_VGA],0))
-    Yield;
-  InU8(VGAP_INPUT_STAT); //Rsts attr index/data
-  for (i=0;i<COLORS_NUM;i++) {
-    OutU8(VGAP_ATTR_INDEX,i);
-    OutU8(VGAP_ATTR_DATA_WRITE,i);
-  }
-  OutU8(VGAP_ATTR_INDEX,0x20);
-  OutU8(VGAP_ATTR_DATA_WRITE,0); //Dummy write
-  InU8(VGAP_INPUT_STAT); //Rsts attr index/data
-  LBtr(&sys_semas[SEMA_VGA],0);
-  POPFD
-}
-
-public U0 GrPaletteColorSet(I64 color_num,CBGR48 bgr48)
-{//VGA has 6-bits for blue, for green, and for red.
-  if (!Bt(&sys_run_level,RLf_VGA)) return;
-  PUSHFD
-  CLI
-  while (LBts(&sys_semas[SEMA_VGA],0))
-    Yield;
-  OutU8(VGAP_PALETTE_MASK,0xFF);
-  OutU8(VGAP_REG_WRITE,color_num);
-  OutU8(VGAP_PALETTE_DATA,bgr48.r>>10);
-  OutU8(VGAP_PALETTE_DATA,bgr48.g>>10);
-  OutU8(VGAP_PALETTE_DATA,bgr48.b>>10);
-  LBtr(&sys_semas[SEMA_VGA],0);
-  POPFD
-}
-
-public CBGR48 GrPaletteColorGet(I64 color_num)
-{//VGA has 6-bits for blue, for green, and for red.
-  CBGR48 res=0;
-  if (!Bt(&sys_run_level,RLf_VGA)) return 0;
-  PUSHFD
-  CLI
-  while (LBts(&sys_semas[SEMA_VGA],0))
-    Yield;
-  OutU8(VGAP_PALETTE_MASK,0xFF);
-  OutU8(VGAP_REG_READ,color_num);
-  res.r=0xFFFF<<10*InU8(VGAP_PALETTE_DATA)/0xFC00;
-  res.g=0xFFFF<<10*InU8(VGAP_PALETTE_DATA)/0xFC00;
-  res.b=0xFFFF<<10*InU8(VGAP_PALETTE_DATA)/0xFC00;
-  LBtr(&sys_semas[SEMA_VGA],0);
-  POPFD
-  return res;
-}
-
-public CBGR48 gr_palette_std[COLORS_NUM]={
-0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
-0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
-0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
-0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
-
-public CBGR48 gr_palette_gray[COLORS_NUM]={
-0x000000000000,0x111111111111,0x222222222222,0x333333333333,
-0x444444444444,0x555555555555,0x666666666666,0x777777777777,
-0x888888888888,0x999999999999,0xAAAAAAAAAAAA,0xBBBBBBBBBBBB,
-0xCCCCCCCCCCCC,0xDDDDDDDDDDDD,0xEEEEEEEEEEEE,0xFFFFFFFFFFFF};
-
-public U0 GrPaletteGet(CBGR48 *bgr48)
-{//16 colors
-  I64 i;
-  for (i=0;i<COLORS_NUM;i++)
-    bgr48[i]=GrPaletteColorGet(i);
-}
-
-public U0 GrPaletteSet(CBGR48 *bgr48)
-{//16 colors
-  I64 i;
-  for (i=0;i<COLORS_NUM;i++)
-    GrPaletteColorSet(i,bgr48[i]);
-}
-
-public U0 PaletteSetStd()
-{//Activate std palette.
-  GrPaletteSet(gr_palette_std);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrPrimatives.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrPrimatives.HC.HTML deleted file mode 100755 index f652252..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrPrimatives.HC.HTML +++ /dev/null @@ -1,1853 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics"
-
-public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom,
-        I64 width=0,I64 height=0)
-{//Returns scrn, not window coordinates.
-  CTask *win_task;
-  *left=0;
-  *top=0;
-  *right=dc->width-1;
-  *bottom=dc->height-1;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    if (GR_WIDTH-1<*right)
-      *right=GR_WIDTH-1;
-    if (GR_HEIGHT-1<*bottom)
-      *bottom=GR_HEIGHT-1;
-    if (win_task->pix_left>*left)
-      *left=win_task->pix_left;
-    if (win_task->pix_top>*top)
-      *top=win_task->pix_top;
-    if (win_task->pix_right<*right)
-      *right=win_task->pix_right;
-    if (win_task->pix_bottom<*bottom)
-      *bottom=win_task->pix_bottom;
-  }
-  *left-=width;
-  *right+=width;
-  *top-=height;
-  *bottom+=height;
-  return *left<=*right && *top<=*bottom;
-}
-
-Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
-        I64 width=0,I64 height=0)
-{//Also converts window to scrn coordinates
-  I64 left,top,right,bottom;
-  CTask *win_task;
-  if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) {
-    if (dc->flags & DCF_SCRN_BITMAP) {
-      win_task=dc->win_task;
-      *x1+=win_task->pix_left+win_task->scroll_x;
-      *y1+=win_task->pix_top+win_task->scroll_y;
-      *x2+=win_task->pix_left+win_task->scroll_x;
-      *y2+=win_task->pix_top+win_task->scroll_y;
-    }
-    return ClipLine(x1,y1,x2,y2,left,top,right,bottom);
-  } else
-    return FALSE;
-}
-
-public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
-{//2D. Clipping but No transformation or thick.
-  I32 *db=dc->depth_buf;
-  CTask *win_task;
-  CColorROPU32 old_color;
-  dc->depth_buf=NULL;
-  if (dc->brush) {
-    old_color=dc->color;
-    if (dc->color.c0.rop!=ROPB_COLLISION)
-      dc->color.c0.rop=ROPB_MONO;
-    GrBlot(dc,x,y,dc->brush);
-    dc->color=old_color;
-  } else if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->pix_left+win_task->scroll_x;
-    y+=win_task->pix_top+win_task->scroll_y;
-    if (win_task->pix_left<=x<=win_task->pix_right &&
-          win_task->pix_top<=y<=win_task->pix_bottom &&
-          0<=x<dc->width && 0<=y<dc->height &&
-          (win_task->next_task==sys_winmgr_task ||
-          dc->flags&DCF_ON_TOP ||
-          !IsPixCovered0(win_task,x,y)))
-      GrPlot0(dc,x,y);
-  } else
-    if (0<=x<dc->width && 0<=y<dc->height)
-      GrPlot0(dc,x,y);
-  dc->depth_buf=db;
-  return TRUE;
-}
-
-Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
-{//Clipping but No transformation or thick, called with db_z set
-  CTask *win_task;
-  CColorROPU32 old_color;
-  if (dc->brush) {
-    old_color=dc->color;
-    if (dc->color.c0.rop!=ROPB_COLLISION)
-      dc->color.c0.rop=ROPB_MONO;
-    if (dc->depth_buf)
-      GrBlot3(dc,x,y,dc->db_z,dc->brush);
-    else
-      GrBlot(dc,x,y,dc->brush);
-    dc->color=old_color;
-  } else if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->pix_left+win_task->scroll_x;
-    y+=win_task->pix_top+win_task->scroll_y;
-    if (win_task->pix_left<=x<=win_task->pix_right &&
-          win_task->pix_top <=y<=win_task->pix_bottom &&
-          0<=x<dc->width && 0<=y<dc->height &&
-          (win_task->next_task==sys_winmgr_task ||
-          dc->flags&DCF_ON_TOP ||
-          !IsPixCovered0(win_task,x,y)))
-      GrPlot0(dc,x,y);
-  } else
-    if (0<=x<dc->width && 0<=y<dc->height)
-      GrPlot0(dc,x,y);
-  return TRUE;
-}
-
-public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y)
-{//2D. Clipping but no transformation.
-//Returns pix color or -1 if off-scrn or covered.
-  CTask *win_task;
-  if (dc->flags & DCF_SCRN_BITMAP) {
-    win_task=dc->win_task;
-    x+=win_task->pix_left+win_task->scroll_x;
-    y+=win_task->pix_top+win_task->scroll_y;
-    if (!(win_task->pix_left<=x<=win_task->pix_right)  ||
-          !(win_task->pix_top <=y<=win_task->pix_bottom) ||
-          !(0<=x<dc->width) || !(0<=y<dc->height) ||
-          win_task->next_task!=sys_winmgr_task &&
-          !(dc->flags&DCF_ON_TOP) &&
-          IsPixCovered0(win_task,x,y))
-      return -1;
-  } else
-    if (!(0<=x<dc->width) || !(0<=y<dc->height))
-      return -1;
-  return GrPeek0(dc,x,y);
-}
-
-/*
-
-This is an easier to understand
-version of the nonrecursive routine below.
-I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db)
-{
-  I64 res,j,x1,ray_len,ray_len2;
-
-  if (UnusedStk<0x80)
-    Panic("Stk Overflow",Fs);
-
-  res=ray_len=GrRayLen(dc,&x,y,z,db);
-  y--;
-  j=ray_len;
-  x1=x;
-  while (j>0) {
-    if (ray_len2=GrRayLenMinus(dc,x1,y))
-      res+=GrFloodFillRay(dc,x1,y,z,db);
-    j-=ray_len2+1;
-    x1-=ray_len2+1;
-  }
-  y+=2;
-  j=ray_len;
-  x1=x;
-  while (j>0) {
-    if (ray_len2=GrRayLenMinus(dc,x1,y))
-      res+=GrFloodFillRay(dc,x1,y,z,db);
-    j-=ray_len2+1;
-    x1-=ray_len2+1;
-  }
-  return res;
-}
-*/
-
-class CFFRay
-{
-  I64 state,x,y,j,x1,ray_len,ray_len2;
-};
-
-I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db)
-{//See the above commented-out routine for an easier to understand version.
-//Returns cnt of pixs changed
-  I64 res=0;
-//We don't dynamically calculate the size to avoid
-  //fragmentation of memory.
-  CFFRay *f_dc=MAlloc(sizeof(CFFRay)*0x80000),*f=f_dc;
-  f->x=x;
-  f->y=y;
-  f->state=0;
-  do {
-    switch [f->state] {
-      case 0:
-        f->state++;
-        res+=f->ray_len=GrRayLen(dc,&f->x,f->y,z,db);
-        f->y--;
-        f->j=f->ray_len;
-        f->x1=f->x;
-        break;
-      case 1:
-        if (f->j>0) {
-          f->state++;
-          if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) {
-            f[1].x=f->x1;
-            f[1].y=f->y;
-            f[1].state=0;
-            f++;
-          }
-        } else
-          f->state+=2;
-        break;
-      case 2:
-        f->state--;
-        f->j-=f->ray_len2+1;
-        f->x1-=f->ray_len2+1;
-        break;
-      case 3:
-        f->state++;
-        f->y+=2;
-        f->j=f->ray_len;
-        f->x1=f->x;
-        break;
-      case 4:
-        if (f->j>0) {
-          f->state++;
-          if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) {
-            f[1].x=f->x1;
-            f[1].y=f->y;
-            f[1].state=0;
-            f++;
-          }
-        } else
-          f->state+=2;
-        break;
-      case 5:
-        f->state--;
-        f->j-=f->ray_len2+1;
-        f->x1-=f->ray_len2+1;
-        break;
-      case 6:
-        f--;
-        break;
-    }
-  } while (f>=f_dc);
-  Free(f_dc);
-  return res;
-}
-
-public I64 GrFloodFill(CDC *dc=gr.dc,I64 x,I64 y,
-        Bool not_color=FALSE,I64 z=0,I32 *db=NULL)
-{//2D. Ignore z and db.
-//not_color=TRUE means fill up to everything which is not the current color.
-  //not_color=FALSE means fill all parts equ to the color under the point.
-  //Returns cnt of pixs changed
-  I64 res=0,j,old_flags=dc->flags;
-  CColorROPU32 old_color2=dc->color2;
-  CDC *old_brush;
-  if (dc->flags & DCF_DONT_DRAW) //TODO
-    return 0;
-  old_brush=dc->brush;
-  dc->brush=NULL;
-  if ((j=GrPeek(dc,x,y))>=0) {
-    if (not_color) {
-      dc->color2=dc->color.c0.color;
-      dc->flags|=DCF_FILL_NOT_COLOR;
-    } else {
-      dc->color2=j;
-      if (dc->color.c1.rop&ROPBF_DITHER) {
-        if (dc->color2.c0.color==dc->color.c0.color &&
-              dc->color.c0.color==dc->color.c1.color)
-          goto ff_done;
-      } else if (dc->color2.c0.color==dc->color.c0.color)
-        goto ff_done;
-      dc->flags&=~DCF_FILL_NOT_COLOR;
-    }
-    if (not_color && j!=dc->color2 ||
-          !not_color)
-      res=GrFloodFillRay(dc,x,y,z,db);
-  }
-ff_done:
-  dc->brush=old_brush;
-  dc->flags=old_flags;
-  dc->color2=old_color2;
-  return res;
-}
-
-I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
-{//2D. Clipping but not transformation.
-  I64 res=0,i,k,r=diameter>>1,rr;
-  if (diameter>=1)
-    switch (n) {
-      case 0:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=0;i<r;i++)
-            res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
-                  gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=0;i<r;i++)
-            res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
-                  Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
-        }
-        break;
-      case 1:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=r+1;i<diameter;i++)
-            res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
-                  gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=r+1;i<k;i++)
-            res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
-                  Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
-        }
-        break;
-      case 2:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=0;i<r;i++)
-            res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
-                  gr.circle_hi[diameter][i]+cy,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=0;i<r;i++)
-            res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(r-i))+cy,
-                  Sqrt(rr-SqrI64(r-i))+cy,z,z);
-        }
-        break;
-      case 3:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=r+1;i<diameter;i++)
-            res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
-                  gr.circle_hi[diameter][i]+cy,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=r+1;i<k;i++)
-            res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(i-r))+cy,
-                  Sqrt(rr-SqrI64(i-r))+cy,z,z);
-        }
-        break;
-      case 4:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=0;i<r;i++)
-            res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
-                  gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=0;i<r;i++)
-            res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
-                  Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
-        }
-        break;
-      case 5:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=r+1;i<diameter;i++)
-            res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
-                  gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=r+1;i<k;i++)
-            res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
-                  Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
-        }
-        break;
-      case 6:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=0;i<r;i++)
-            res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
-                  gr.circle_hi[diameter][i]+cy,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=0;i<r;i++)
-            res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(r-i))+cy,
-                  Sqrt(rr-SqrI64(r-i))+cy,z,z);
-        }
-        break;
-      case 7:
-        if (diameter<GR_PEN_BRUSHES_NUM)
-          for (i=r+1;i<diameter;i++)
-            res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
-                  gr.circle_hi[diameter][i]+cy,z,z);
-        else {
-          k=diameter+1;
-          rr=SqrI64((k+1)>>1);
-          for (i=r+1;i<k;i++)
-            res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(i-r))+cy,
-                  Sqrt(rr-SqrI64(i-r))+cy,z,z);
-        }
-        break;
-    }
-  return res;
-}
-
-public I64 GrFillCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter)
-{//2D. Clipping but not transformation.
-  I64 res=0,i,k,r=diameter>>1,rr;
-  if (diameter>=1) {
-    if (diameter<GR_PEN_BRUSHES_NUM)
-      for (i=0;i<diameter;i++)
-        res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
-              gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
-    else {
-      k=diameter+1;
-      rr=SqrI64((k+1)>>1);
-      for (i=0;i<=r;i++)
-        res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
-              Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
-      for (;i<k;i++)
-        res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
-              Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
-    }
-  }
-  return res;
-}
-
-public Bool GrPlot3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
-{//3D. Clipping and transformation but no thick.
-  I64 _x,_y,_z;
-  Bool was_transform=FALSE,was_symmetry=FALSE;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    (*dc->transform)(dc,&x,&y,&z);
-    dc->flags&=~DCF_TRANSFORMATION;
-    was_transform=TRUE;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    _x=x; _y=y; _z=z;
-    DCReflect(dc,&_x,&_y,&_z);
-    dc->flags&=~DCF_SYMMETRY;
-    dc->db_z=_z;
-    GrPlot1(dc,_x,_y);
-    was_symmetry=TRUE;
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-  dc->db_z=z;
-  GrPlot1(dc,x,y);
-gr_done:
-  if (was_transform)
-    dc->flags|=DCF_TRANSFORMATION;
-  if (was_symmetry)
-    dc->flags|=DCF_SYMMETRY;
-  return TRUE;
-}
-
-public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
-{//3D. Clipping and transformation and thick.
-  I64 _x,_y,_z,w,dist;
-  CColorROPU32 old_color=dc->color;
-  Bool record,was_transform=FALSE,was_symmetry=FALSE;
-  CTask *win_task;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    (*dc->transform)(dc,&x,&y,&z);
-    dc->flags&=~DCF_TRANSFORMATION;
-    was_transform=TRUE;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    _x=x; _y=y; _z=z;
-    DCReflect(dc,&_x,&_y,&_z);
-    dc->flags&=~DCF_SYMMETRY;
-    GrPlot3(dc,_x,_y,_z);
-    was_symmetry=TRUE;
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-  w=dc->thick>>1;
-  dc->db_z=z;
-  if (dc->brush || w<=0)
-    GrPlot1(dc,x,y);
-  else if (dc->thick<GR_PEN_BRUSHES_NUM) {
-    if (dc->color.c0.rop!=ROPB_COLLISION)
-      dc->color.c0.rop=ROPB_MONO;
-    if (dc->depth_buf) {
-      if (dc->color.c1.rop&ROPBF_DITHER) {
-        dc->color.c1.rop=dc->color.c0.rop;
-        if (((x-w)^(y-w))&1) {
-          record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
-          dc->color.c0=dc->color.c1;
-          record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
-        } else {
-          record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
-          dc->color.c0=dc->color.c1;
-          record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
-        }
-      } else {
-        if (dc->color.c0.rop==ROPB_COLLISION) {
-          if (dc->color.c0.color!=dc->bkcolor.c0.color &&
-                dc->color.c0.color!=TRANSPARENT)
-            record=GrBlot3(dc,x-w,y-w,z,
-                  gr.collision_pen_brushes[dc->thick]);
-          else
-            record=FALSE;
-        } else
-          record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->thick]);
-      }
-    } else {
-      if (dc->color.c1.rop&ROPBF_DITHER) {
-        dc->color.c1.rop=dc->color.c0.rop;
-        if (((x-w)^(y-w))&1) {
-          record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
-          dc->color.c0=dc->color.c1;
-          record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
-        } else {
-          record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
-          dc->color.c0=dc->color.c1;
-          record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
-        }
-      } else {
-        if (dc->color.c0.rop==ROPB_COLLISION) {
-          if (dc->color.c0.color!=dc->bkcolor.c0.color &&
-                dc->color.c0.color!=TRANSPARENT)
-            record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->thick]);
-          else
-            record=FALSE;
-        } else
-          record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->thick]);
-      }
-    }
-    if (record) {
-      if (dc->flags & DCF_SCRN_BITMAP) {
-        win_task=dc->win_task;
-        x+=win_task->pix_left+win_task->scroll_x;
-        y+=win_task->pix_top+win_task->scroll_y;
-      }
-      if (dc->flags & DCF_LOCATE_NEAREST) {
-        dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
-        if (dist<=dc->nearest_dist)
-          dc->nearest_dist=dist;
-      }
-      if (dc->flags & DCF_RECORD_EXTENTS) {
-        if (x-w<dc->min_x) dc->min_x=x-w;
-        if (y-w<dc->min_y) dc->min_y=y-w;
-        if (dc->thick & 1) {
-          if (x+w>dc->max_x) dc->max_x=x+w;
-          if (y+w>dc->max_y) dc->max_y=y+w;
-        } else {
-          if (x+w-1>dc->max_x) dc->max_x=x+w-1;
-          if (y+w-1>dc->max_y) dc->max_y=y+w-1;
-        }
-      }
-    }
-  } else
-    GrFillCircle(dc,x,y,dc->db_z,dc->thick);
-gr_done:
-  dc->color=old_color;
-  if (was_transform)
-    dc->flags|=DCF_TRANSFORMATION;
-  if (was_symmetry)
-    dc->flags|=DCF_SYMMETRY;
-  return TRUE;
-}
-
-Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z)
-{//This is a callback.
-  CTask *win_task=dc->win_task;
-  if (!(dc->flags & DCF_SCRN_BITMAP) ||
-        win_task->next_task==sys_winmgr_task ||
-        dc->flags&DCF_ON_TOP ||
-        !IsPixCovered0(win_task,x,y)) {
-    dc->db_z=z;
-    GrPlot0(dc,x,y);
-  }
-  return TRUE;
-}
-
-Bool GrLinePlot(CDC *dc,I64 x,I64 y,I64 z)
-{//This is a callback.
-  dc->db_z=z;
-  GrPlot1(dc,x,y);
-  return TRUE;
-}
-
-public Bool GrLine(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
-        I64 step=1,I64 start=0)
-{//2D. Clipping but not transformation.
-  Bool res=FALSE;
-  I32 *db=dc->depth_buf;
-  dc->depth_buf=NULL;
-  if (step==1 && !start && !dc->brush && !dc->depth_buf) {
-    if (DCClipLine(dc,&x1,&y1,&x2,&y2))
-      res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
-  } else
-    res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot,step,start);
-  dc->depth_buf=db;
-  return res;
-}
-
-public Bool GrCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 radius,
-  I64 step=1,F64 start_radians=0,F64 len_radians=2*pi)
-{//2D. Clipping but not transformation.
-  Bool res;
-  I32 *db=dc->depth_buf;
-  dc->depth_buf=NULL;
-  res=Circle(dc,cx,cy,0,radius,&GrLinePlot,step,start_radians,len_radians);
-  dc->depth_buf=db;
-  return res;
-}
-
-public Bool GrEllipse(CDC *dc=gr.dc,
-                I64 cx,I64 cy,
-                I64 x_radius,I64 y_radius,
-                F64 rot_angle=0,
-                I64 step=1,
-                F64 start_radians=0,
-                F64 len_radians=2*pi)
-{//2D. Clipping but not transformation.
-  Bool res;
-  I32 *db=dc->depth_buf;
-  dc->depth_buf=NULL;
-  res=Ellipse(dc,cx,cy,0,x_radius,y_radius,&GrLinePlot,
-        rot_angle,step,start_radians,len_radians);
-  dc->depth_buf=db;
-  return res;
-}
-
-public Bool GrRegPoly(CDC *dc=gr.dc,
-                I64 cx,I64 cy,
-                I64 x_radius,I64 y_radius,I64 sides,
-                F64 rot_angle=0,
-                I64 step=1,
-                F64 start_radians=0,
-                F64 len_radians=2*pi)
-{//2D. Clipping but no transform or thick.
-  Bool res;
-  I32 *db=dc->depth_buf;
-  dc->depth_buf=NULL;
-  res=RegPoly(dc,cx,cy,0,x_radius,y_radius,sides,
-        &GrLinePlot,rot_angle,step,start_radians,len_radians);
-  dc->depth_buf=db;
-  return res;
-}
-
-public Bool Gr2Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
-{//2nd order. Clipping but no transform or thick.
-  return Bezier2(dc,ctrl,&GrLinePlot);
-}
-
-public Bool Gr3Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
-{//3rd order. Clipping but no transform or thick.
-  return Bezier3(dc,ctrl,&GrLinePlot);
-}
-
-public Bool Gr2BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
-{//2nd order. Clipping but no transform or thick.
-  return BSpline2(dc,ctrl,cnt,&GrLinePlot,closed);
-}
-
-public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
-{//3rd order. Clipping but no transform or thick.
-  return BSpline3(dc,ctrl,cnt,&GrLinePlot,closed);
-}
-
-I64 GrLineFat3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
-        I64 width,I64 start=0)
-{//Step through line segment calling callback.
-//Uses fixed-point.
-  I64 res=0,i,j,d,dx=x2-x1,dy=y2-y1,dz=z2-z1,_x,_y,_z,d_lo,d_hi,
-        adx=AbsI64(dx),ady=AbsI64(dy),adz=AbsI64(dz);
-  if (width>0) {
-    if (adx>=ady) {
-      if (adx>=adz) {
-        if (d=adx) {
-          if (dx>=0)
-            dx=0x100000000;
-          else
-            dx=-0x100000000;
-          dy=dy<<32/d;
-          dz=dz<<32/d;
-        }
-      } else {
-        if (d=adz) {
-          dx=dx<<32/d;
-          dy=dy<<32/d;
-          if (dz>=0)
-            dz=0x100000000;
-          else
-            dz=-0x100000000;
-        }
-      }
-      x1<<=32; y1<<=32; z1<<=32;
-      for (j=0;j<start;j++) {
-        x1+=dx; y1+=dy; z1+=dz;
-      }
-      if (start>=d)
-        res+=GrFillCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width);
-      else {
-        if (width==1)
-          for (i=start;i<=d;i++) {
-            dc->db_z=z1.i32[1];
-            res+=GrPlot1(dc,x1.i32[1],y1.i32[1]);
-            _x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
-            x1+=dx; y1+=dy; z1+=dz;
-          }
-        else {
-          i=width*Sqrt(SqrI64(adx)+SqrI64(ady))/adx;
-          d_lo=i>>1; d_hi=(i-1)>>1;
-
-          if (dx>=0)
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,2);
-          else
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,7);
-          for (i=start;i<=d;i++) {
-            res+=GrVLine(dc,x1.i32[1],y1.i32[1]-d_lo,y1.i32[1]+d_hi,
-                  z1.i32[1],z1.i32[1]);
-            _x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
-            x1+=dx; y1+=dy; z1+=dz;
-          }
-          x1-=dx; y1-=dy; z1-=dz;
-          if (dx>=0)
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,3);
-          else
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,6);
-        }
-      }
-    } else {
-      if (ady>=adz) {
-        if (d=ady) {
-          dx=dx<<32/d;
-          if (dy>=0)
-            dy=0x100000000;
-          else
-            dy=-0x100000000;
-          dz=dz<<32/d;
-        }
-      } else {
-        if (d=adz) {
-          dx=dx<<32/d;
-          dy=dy<<32/d;
-          if (dz>=0)
-            dz=0x100000000;
-          else
-            dz=-0x100000000;
-        }
-      }
-      x1<<=32; y1<<=32; z1<<=32;
-      for (j=0;j<start;j++) {
-        x1+=dx; y1+=dy; z1+=dz;
-      }
-      if (start>=d)
-        res+=GrFillCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width);
-      else {
-        if (width==1)
-          for (i=start;i<=d;i++) {
-            dc->db_z=z1.i32[1];
-            res+=GrPlot1(dc,x1.i32[1],y1.i32[1]);
-            _x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
-            x1+=dx; y1+=dy; z1+=dz;
-          }
-        else {
-          i=width*Sqrt(SqrI64(ady)+SqrI64(adx))/ady;
-          d_lo=i>>1; d_hi=(i-1)>>1;
-
-          if (dy>=0)
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,0);
-          else
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,5);
-          for (i=start;i<=d;i++) {
-            res+=GrHLine(dc,x1.i32[1]-d_lo,x1.i32[1]+d_hi,y1.i32[1],
-                  z1.i32[1],z1.i32[1]);
-            _x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
-            x1+=dx; y1+=dy; z1+=dz;
-          }
-          x1-=dx; y1-=dy; z1-=dz;
-          if (dy>=0)
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,1);
-          else
-            res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,4);
-        }
-      }
-    }
-  }
-  return res;
-}
-
-public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
-        I64 step=1,I64 start=0)
-{//3D. Transformation with thick.
-  I64 _x1,_y1,_z1,_x2,_y2,_z2;
-  Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    (*dc->transform)(dc,&x1,&y1,&z1);
-    (*dc->transform)(dc,&x2,&y2,&z2);
-    dc->flags&=~DCF_TRANSFORMATION;
-    was_transform=TRUE;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    _x1=x1; _y1=y1; _z1=z1;
-    DCReflect(dc,&_x1,&_y1,&_z1);
-    _x2=x2; _y2=y2; _z2=z2;
-    DCReflect(dc,&_x2,&_y2,&_z2);
-    dc->flags&=~DCF_SYMMETRY;
-    if (step==1 && !dc->brush) {
-      if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
-        if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2))
-          res=Line(dc,_x1,_y1,0,_x2,_y2,0,&GrLinePlot0,step,start);
-      } else {
-        if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->thick,start))
-          res=TRUE;
-      }
-    } else
-      res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
-    was_symmetry=TRUE;
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-  if (step==1 && !dc->brush) {
-    if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
-      if (DCClipLine(dc,&x1,&y1,&x2,&y2))
-        res|=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
-    } else {
-      if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->thick,start))
-        res=TRUE;
-    }
-  } else
-    res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
-gr_done:
-  if (was_transform)
-    dc->flags|=DCF_TRANSFORMATION;
-  if (was_symmetry)
-    dc->flags|=DCF_SYMMETRY;
-  return res;
-}
-
-#help_index "Graphics/Char;Char/Graphics"
-
-public Bool GrPutChar3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 ch)
-{//3D. Transformation. DCF_SYMMETRY is silly.
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x,&y,&z);
-  return GrPutChar(dc,x,y,ch);
-}
-
-public I64 GrPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...)
-{//3D. Transformation. DCF_SYMMETRY is silly.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  I64 res;
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x,&y,&z);
-  res=GrPrint(dc,x,y,"%s",buf);
-  Free(buf);
-  return res;
-}
-
-public I64 GrVPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...)
-{//3D. Vertical text. Transformation. DCF_SYMMETRY is silly.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  I64 res;
-  if (dc->flags & DCF_TRANSFORMATION)
-    (*dc->transform)(dc,&x,&y,&z);
-  res=GrVPrint(dc,x,y,"%s",buf);
-  Free(buf);
-  return res;
-}
-
-#help_index "Graphics"
-
-public Bool GrEllipse3(CDC *dc=gr.dc,
-                I64 cx,I64 cy,I64 cz,
-                I64 x_radius,I64 y_radius,
-                F64 rot_angle=0,
-                I64 step=1,
-                F64 start_radians=0,
-                F64 len_radians=2*pi)
-{//3D. Transformation with thick.
-  Bool res;
-  I64 x,y,z,xx,yy,zz;
-  F64 m1,arg1,m2,arg2,s,c;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    dc->flags&=~DCF_TRANSFORMATION;
-    (*dc->transform)(dc,&cx,&cy,&cz);
-
-    c=Cos(rot_angle);
-    s=Sin(rot_angle);
-
-    x_radius<<=16;
-    y_radius<<=16;
-
-    xx=0;
-    yy=0;
-    zz=0;
-    (*dc->transform)(dc,&xx,&yy,&zz);
-
-    x=x_radius*c;
-    y=x_radius*s;
-    z=0;
-    (*dc->transform)(dc,&x,&y,&z);
-    x-=xx;
-    y-=yy;
-    z-=zz;
-    R2P(&m1,&arg1,x,y);
-
-    x=-y_radius*s;
-    y=y_radius*c;
-    z=0;
-    (*dc->transform)(dc,&x,&y,&z);
-    x-=xx;
-    y-=yy;
-    z-=zz;
-    R2P(&m2,&arg2,x,y);
-    m2*=Abs(Sin(arg2-arg1));
-
-    res=Ellipse(dc,cx,cy,cz,
-          m1/0x10000,m2/0x10000,&GrPlot3,-arg1,step,start_radians,len_radians);
-    dc->flags|=DCF_TRANSFORMATION;
-  } else
-    res=Ellipse(dc,cx,cy,cz,x_radius,y_radius,&GrPlot3,
-          rot_angle,step,start_radians,len_radians);
-  return res;
-}
-
-public Bool GrCircle3(CDC *dc=gr.dc,I64 cx,I64 cy,I64 cz,I64 radius,
-  I64 step=1,F64 start_radians=0,F64 len_radians=2*pi)
-{//3D. Transformation with thick.
-  if (dc->flags & DCF_TRANSFORMATION)
-    return GrEllipse3(dc,cx,cy,cz,radius,radius,0,step,
-          start_radians,len_radians);
-  else
-    return Circle(dc,cx,cy,cz,radius,&GrPlot3,step,
-          start_radians,len_radians);
-}
-
-public Bool GrRegPoly3(CDC *dc=gr.dc,
-                I64 cx,I64 cy,I64 cz,
-                I64 x_radius,I64 y_radius,I64 sides,
-                F64 rot_angle=0,
-                I64 step=1,
-                F64 start_radians=0,
-                F64 len_radians=2*pi)
-{//3D. Clipping and transform and thick.
-  Bool res;
-  I64 x,y,z,xx,yy,zz;
-  F64 m1,arg1,m2,arg2,s,c;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    dc->flags&=~DCF_TRANSFORMATION;
-    (*dc->transform)(dc,&cx,&cy,&cz);
-
-    c=Cos(rot_angle);
-    s=Sin(rot_angle);
-
-    x_radius<<=16;
-    y_radius<<=16;
-
-    xx=0;
-    yy=0;
-    zz=0;
-    (*dc->transform)(dc,&xx,&yy,&zz);
-
-    x=x_radius*c;
-    y=x_radius*s;
-    z=0;
-    (*dc->transform)(dc,&x,&y,&z);
-    x-=xx;
-    y-=yy;
-    z-=zz;
-    R2P(&m1,&arg1,x,y);
-
-    x=-y_radius*s;
-    y=y_radius*c;
-    z=0;
-    (*dc->transform)(dc,&x,&y,&z);
-    x-=xx;
-    y-=yy;
-    z-=zz;
-    R2P(&m2,&arg2,x,y);
-    m2*=Abs(Sin(arg2-arg1));
-
-    res=RegPoly(dc,cx,cy,cz,
-          m1/0x10000,m2/0x10000,sides,&GrPlot3,-arg1,
-          step,start_radians,len_radians);
-    dc->flags|=DCF_TRANSFORMATION;
-  } else
-    res=RegPoly(dc,cx,cy,cz,x_radius,y_radius,sides,&GrPlot3,
-          rot_angle,step,start_radians,len_radians);
-  return res;
-}
-
-public I64 GrFloodFill3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,Bool not_color=FALSE)
-{//3D. Transformation.
-//not_color=TRUE means fill up to everything which is not the current color.
-  //not_color=FALSE means fill all parts equ to the color under the point.
-  //Returns cnt of pixs changed
-  I64 res,old_flags=dc->flags,
-        _x,_y,_z;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    (*dc->transform)(dc,&x1,&y1,&z1);
-    dc->flags&=~DCF_TRANSFORMATION;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    _x=x1; _y=y1; _z=z1;
-    DCReflect(dc,&_x,&_y,&_z);
-    dc->flags&=~DCF_SYMMETRY;
-    res=GrFloodFill(dc,_x,_y,not_color,_z,dc->depth_buf);
-    if (dc->flags&DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-  res=GrFloodFill(dc,x1,y1,not_color,z1,dc->depth_buf);
-gr_done:
-  dc->flags=old_flags;
-  return res;
-}
-
-#help_index "Graphics;Graphics/Device Contexts"
-
-Option(OPTf_WARN_HEADER_MISMATCH,OFF);
-public I64 GrBlot3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,CDC *img)
-{//3D. Clipping and transformation.
-  CColorROPU32 old_color=dc->color;
-  I64  color,reg i,j,w=img->width,h=img->height,
-        d1,dx1,dy1,dz1,
-        reg d2,dx2,dy2,dz2,
-        adx1,ady1,adz1,
-        adx2,ady2,adz2,
-        x2,y2,z2,x3,y3,z3,
-        dw,reg dh,x,y,_x1,_y1,_z1,_x2,_y2,_z2,_x3,_y3,_z3,
-        last_x,last_y,res=0;
-  Bool first;
-  CDC *old_brush=dc->brush;
-
-  if (dc->depth_buf || dc->flags & (DCF_TRANSFORMATION | DCF_SYMMETRY)) {
-    x2=x1+w; y2=y1; z2=z1;
-    x3=x1; y3=y1+h; z3=z1;
-    if (dc->flags & DCF_TRANSFORMATION) {
-      (*dc->transform)(dc,&x1,&y1,&z1);
-      (*dc->transform)(dc,&x2,&y2,&z2);
-      (*dc->transform)(dc,&x3,&y3,&z3);
-    }
-    if (dc->flags & DCF_SYMMETRY) {
-      _x1=x1; _y1=y1; _z1=z1;
-      DCReflect(dc,&_x1,&_y1,&_z1);
-      _x2=x2; _y2=y2; _z2=z2;
-      DCReflect(dc,&_x2,&_y2,&_z2);
-      _x3=x3; _y3=y3; _z3=z3;
-      DCReflect(dc,&_x3,&_y3,&_z3);
-      dx1=_x2-_x1; dy1=_y2-_y1; dz1=_z2-_z1;
-      dx2=_x3-_x1; dy2=_y3-_y1; dz2=_z3-_z1;
-      adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1);
-      adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2);
-
-      if (adx1>=ady1) {
-        if (adx1>=adz1)
-          d1=adx1;
-        else
-          d1=adz1;
-      } else {
-        if (ady1>=adz1)
-          d1=ady1;
-        else
-          d1=adz1;
-      }
-      if (adx2>=ady2) {
-        if (adx2>=adz2)
-          d2=adx2;
-        else
-          d2=adz2;
-      } else {
-        if (ady2>=adz2)
-          d2=ady2;
-        else
-          d2=adz2;
-      }
-
-      if (AbsI64(d1)!=w ||AbsI64(d2)!=h) {
-        d1<<=1;
-        d2<<=1;
-      }
-      if (d1) {
-        dx1=dx1<<32/d1;
-        dy1=dy1<<32/d1;
-        dz1=dz1<<32/d1;
-      } else
-        goto normal_image;
-      if (d2) {
-        dx2=dx2<<32/d2;
-        dy2=dy2<<32/d2;
-        dz2=dz2<<32/d2;
-      } else
-        goto normal_image;
-      dc->brush=NULL;
-      x=0;y=0;
-      dw=w<<32/d1;
-      dh=h<<32/d2;
-
-      first=TRUE;
-      _x1<<=32; _y1<<=32; _z1<<=32;
-      for (j=0;j<=d1;j++) {
-        _x2=_x1; _y2=_y1; _z2=_z1;
-        y=0;
-        for (i=0;i<=d2;i++) {
-          if (_x2.i32[1]!=last_x || _y2.i32[1]!=last_y ||first) {
-            if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) {
-              if (dc->color.c0.rop==ROPB_MONO) {
-                if (color) {
-                  dc->color=old_color&~ROPF_DITHER;
-                  if (dc->depth_buf) {
-                    dc->db_z=_z2.i32[1];
-                    GrPlot1(dc,_x2.i32[1],_y2.i32[1]);
-                  } else
-                    GrPlot(dc,_x2.i32[1],_y2.i32[1]);
-                }
-              } else {
-                if (color!=TRANSPARENT) {
-                  dc->color=old_color&~COLORROP_NO_ROP0_MASK|color;
-                  if (dc->depth_buf) {
-                    dc->db_z=_z2.i32[1];
-                    GrPlot1(dc,_x2.i32[1],_y2.i32[1]);
-                  } else
-                    GrPlot(dc,_x2.i32[1],_y2.i32[1]);
-                }
-              }
-            }
-          }
-          first=FALSE;
-          last_x=_x2.i32[1]; last_y=_y2.i32[1];
-          _x2+=dx2; _y2+=dy2; _z2+=dz2;
-          y+=dh;
-        }
-        _x1+=dx1; _y1+=dy1; _z1+=dz1;
-        x+=dw;
-      }
-      res=1;
-normal_image:
-      if (dc->flags&DCF_JUST_MIRROR)
-        goto gr_done;
-    }
-    dx1=x2-x1; dy1=y2-y1; dz1=z2-z1;
-    dx2=x3-x1; dy2=y3-y1; dz2=z3-z1;
-    adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1);
-    adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2);
-
-    if (adx1>=ady1) {
-      if (adx1>=adz1)
-        d1=adx1;
-      else
-        d1=adz1;
-    } else {
-      if (ady1>=adz1)
-        d1=ady1;
-      else
-        d1=adz1;
-    }
-    if (adx2>=ady2) {
-      if (adx2>=adz2)
-        d2=adx2;
-      else
-        d2=adz2;
-    } else {
-      if (ady2>=adz2)
-        d2=ady2;
-      else
-        d2=adz2;
-    }
-    if (AbsI64(d1)!=w ||AbsI64(d2)!=h) {
-      d1<<=1;
-      d2<<=1;
-    }
-    if (d1) {
-      dx1=dx1<<32/d1;
-      dy1=dy1<<32/d1;
-      dz1=dz1<<32/d1;
-    } else
-      goto gr_done;
-    if (d2) {
-      dx2=dx2<<32/d2;
-      dy2=dy2<<32/d2;
-      dz2=dz2<<32/d2;
-    } else
-      goto gr_done;
-    dc->brush=NULL;
-    x=0;y=0;
-    dw=w<<32/d1;
-    dh=h<<32/d2;
-
-    first=TRUE;
-    x1<<=32; y1<<=32; z1<<=32;
-    for (j=0;j<=d1;j++) {
-      x2=x1; y2=y1; z2=z1;
-      y=0;
-      for (i=0;i<=d2;i++) {
-        if (x2.i32[1]!=last_x || y2.i32[1]!=last_y || first) {
-          if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) {
-            if (dc->color.c0.rop==ROPB_MONO) {
-              if (color) {
-                dc->color=old_color&~ROPF_DITHER;
-                if (dc->depth_buf) {
-                  dc->db_z=z2.i32[1];
-                  GrPlot1(dc,x2.i32[1],y2.i32[1]);
-                } else
-                  GrPlot(dc,x2.i32[1],y2.i32[1]);
-              }
-            } else {
-              if (color!=TRANSPARENT) {
-                dc->color=old_color&~COLORROP_NO_ROP0_MASK|color;//COLOR
-                if (dc->depth_buf) {
-                  dc->db_z=z2.i32[1];
-                  GrPlot1(dc,x2.i32[1],y2.i32[1]);
-                } else
-                  GrPlot(dc,x2.i32[1],y2.i32[1]);
-              }
-            }
-          }
-        }
-        first=FALSE;
-        last_x=x2.i32[1]; last_y=y2.i32[1];
-        x2+=dx2; y2+=dy2; z2+=dz2;
-        y+=dh;
-      }
-      x1+=dx1; y1+=dy1; z1+=dz1;
-      x+=dw;
-    }
-    res=1;  //TODO: check off scrn
-  } else
-    res=GrBlot(dc,x1,y1,img);
-gr_done:
-  dc->color=old_color;
-  dc->brush=old_brush;
-  return res;
-}
-Option(OPTf_WARN_HEADER_MISMATCH,ON);
-
-#help_index "Graphics"
-
-public Bool Gr2Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
-{//2nd order. Clipping and transform and thick.
-  Bool res=FALSE;
-  I64 i,x,y,z,
-        old_flags=dc->flags;
-  CD3I32 *ctrl2=NULL,*ctrl3=NULL;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    ctrl2=MAlloc(sizeof(CD3I32)*3);
-    for (i=0;i<3;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      (*dc->transform)(dc,&x,&y,&z);
-      ctrl2[i].x=x;
-      ctrl2[i].y=y;
-      ctrl2[i].z=z;
-    }
-    dc->flags&=~DCF_TRANSFORMATION;
-    ctrl=ctrl2;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    ctrl3=MAlloc(sizeof(CD3I32)*3);
-    for (i=0;i<3;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      DCReflect(dc,&x,&y,&z);
-      ctrl3[i].x=x;
-      ctrl3[i].y=y;
-      ctrl3[i].z=z;
-    }
-    dc->flags&=~DCF_SYMMETRY;
-    res=Bezier2(dc,ctrl3,&GrPlot3);
-    if (dc->flags & DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-
-  res|=Bezier2(dc,ctrl,&GrPlot3);
-gr_done:
-  Free(ctrl2);
-  Free(ctrl3);
-  dc->flags=old_flags;
-  return res;
-}
-
-public Bool Gr3Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
-{//3rd order. Clipping and transform and thick.
-  Bool res=FALSE;
-  I64 i,x,y,z,
-        old_flags=dc->flags;
-  CD3I32 *ctrl2=NULL,*ctrl3=NULL;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    ctrl2=MAlloc(sizeof(CD3I32)*4);
-    for (i=0;i<4;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      (*dc->transform)(dc,&x,&y,&z);
-      ctrl2[i].x=x;
-      ctrl2[i].y=y;
-      ctrl2[i].z=z;
-    }
-    dc->flags&=~DCF_TRANSFORMATION;
-    ctrl=ctrl2;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    ctrl3=MAlloc(sizeof(CD3I32)*4);
-    for (i=0;i<4;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      DCReflect(dc,&x,&y,&z);
-      ctrl3[i].x=x;
-      ctrl3[i].y=y;
-      ctrl3[i].z=z;
-    }
-    dc->flags&=~DCF_SYMMETRY;
-    res=Bezier3(dc,ctrl3,&GrPlot3);
-    if (dc->flags & DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-
-  res|=Bezier3(dc,ctrl,&GrPlot3);
-gr_done:
-  Free(ctrl2);
-  Free(ctrl3);
-  dc->flags=old_flags;
-  return res;
-}
-
-public I64 Gr2BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
-{//2nd order. Clipping and transform and thick.
-  Bool res=FALSE;
-  I64 i,x,y,z,
-        old_flags=dc->flags;
-  CD3I32 *ctrl2=NULL,*ctrl3=NULL;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    ctrl2=MAlloc(sizeof(CD3I32)*cnt);
-    for (i=0;i<cnt;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      (*dc->transform)(dc,&x,&y,&z);
-      ctrl2[i].x=x;
-      ctrl2[i].y=y;
-      ctrl2[i].z=z;
-    }
-    dc->flags&=~DCF_TRANSFORMATION;
-    ctrl=ctrl2;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    ctrl3=MAlloc(sizeof(CD3I32)*cnt);
-    for (i=0;i<cnt;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      DCReflect(dc,&x,&y,&z);
-      ctrl3[i].x=x;
-      ctrl3[i].y=y;
-      ctrl3[i].z=z;
-    }
-    dc->flags&=~DCF_SYMMETRY;
-    res=BSpline2(dc,ctrl3,cnt,&GrPlot3,closed);
-    if (dc->flags & DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-
-  res|=BSpline2(dc,ctrl,cnt,&GrPlot3,closed);
-gr_done:
-  Free(ctrl2);
-  Free(ctrl3);
-  dc->flags=old_flags;
-  return res;
-}
-
-public Bool Gr3BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
-{//3rd order. Clipping and transform and thick.
-  Bool res=FALSE;
-  I64 i,x,y,z,
-        old_flags=dc->flags;
-  CD3I32 *ctrl2=NULL,*ctrl3=NULL;
-  if (dc->flags & DCF_TRANSFORMATION) {
-    ctrl2=MAlloc(sizeof(CD3I32)*cnt);
-    for (i=0;i<cnt;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      (*dc->transform)(dc,&x,&y,&z);
-      ctrl2[i].x=x;
-      ctrl2[i].y=y;
-      ctrl2[i].z=z;
-    }
-    dc->flags&=~DCF_TRANSFORMATION;
-    ctrl=ctrl2;
-  }
-  if (dc->flags & DCF_SYMMETRY) {
-    ctrl3=MAlloc(sizeof(CD3I32)*cnt);
-    for (i=0;i<cnt;i++) {
-      x=ctrl[i].x;
-      y=ctrl[i].y;
-      z=ctrl[i].z;
-      DCReflect(dc,&x,&y,&z);
-      ctrl3[i].x=x;
-      ctrl3[i].y=y;
-      ctrl3[i].z=z;
-    }
-    dc->flags&=~DCF_SYMMETRY;
-    res=BSpline3(dc,ctrl3,cnt,&GrPlot3,closed);
-    if (dc->flags & DCF_JUST_MIRROR)
-      goto gr_done;
-  }
-
-  res|=BSpline3(dc,ctrl,cnt,&GrPlot3,closed);
-gr_done:
-  Free(ctrl2);
-  Free(ctrl3);
-  dc->flags=old_flags;
-  return res;
-}
-
-public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
-{//3D. Returns cnt of pixs changed
-  I64 x1,x2,y1,y2,z1,z2,dx1,dy1,dz1,dx2,dy2,dz2,res=0,i,min,max;
-  CTask *win_task;
-
-  if (AbsI64(p1->y-p2->y)+AbsI64(p1->y-p4->y)<=
-        AbsI64(p1->x-p2->x)+AbsI64(p1->x-p4->x)) {
-//p1 is min x
-    if (p4->x<p2->x)
-      SwapI64(&p4,&p2);
-    if (p2->x<p1->x)
-      SwapI64(&p2,&p1);
-
-      //p2y<=p4y
-    if (p4->y<p2->y)
-      SwapI64(&p4,&p2);
-
-    min=0;
-    max=dc->height;
-    if (dc->flags & DCF_SCRN_BITMAP) {
-      win_task=dc->win_task;
-      min-=win_task->scroll_y+win_task->pix_top;
-      max-=win_task->scroll_y+win_task->pix_top;
-      if (max>win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top))
-        max=win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top);
-    }
-
-    if ((dy2=p4->y-p1->y)<0) {
-      dy1=p2->y-p1->y;
-      dx1=(p1->x-p2->x)<<32/dy1;
-      dz1=(p1->z-p2->z)<<32/dy1;
-
-      dx2=(p1->x-p4->x)<<32/dy2;
-      dz2=(p1->z-p4->z)<<32/dy2;
-      x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32;
-      if (y1+dy2<min) {
-        i=min-(y1+dy2);
-        if (i>-dy2) goto ft_done;
-        dy2+=i;
-      }
-      if (y1>=max) {
-        i=y1-max+1;
-        if (i>-dy2)
-          i=-dy2;
-        dy2+=i;
-        y1-=i;
-        x1+=dx1*i;
-        x2+=dx2*i;
-        z1+=dz1*i;
-        z2+=dz2*i;
-      }
-      while (dy2++) {
-        res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-        y1--;
-        x1+=dx1;
-        x2+=dx2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-      if (dy2=p2->y-p4->y) {
-        dx2=(p4->x-p2->x)<<32/dy2;
-        dz2=(p4->z-p2->z)<<32/dy2;
-        if (y1+dy2<min) {
-          i=min-(y1+dy2);
-          if (i>-dy2) goto ft_done;
-          dy2+=i;
-        }
-        if (y1>=max) {
-          i=y1-max+1;
-          if (i>-dy2) goto ft_done;
-          dy2+=i;
-          y1-=i;
-          x1+=dx1*i;
-          x2+=dx2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-      }
-      while (dy2++<=0) {
-        res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-        y1--;
-        x1+=dx1;
-        x2+=dx2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-    } else if ((dy2=p2->y-p1->y)>0) {
-      dy1=p4->y-p1->y;
-      dx1=(p4->x-p1->x)<<32/dy1;
-      dz1=(p4->z-p1->z)<<32/dy1;
-
-      dx2=(p2->x-p1->x)<<32/dy2;
-      dz2=(p2->z-p1->z)<<32/dy2;
-      x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32;
-      if (y1+dy2>=max) {
-        i=y1+dy2-max+1;
-        if (i>dy2) goto ft_done;
-        dy2-=i;
-      }
-      if (y1<min) {
-        i=min-y1;
-        if (i>dy2)
-          i=dy2;
-        dy2-=i;
-        y1+=i;
-        x1+=dx1*i;
-        x2+=dx2*i;
-        z1+=dz1*i;
-        z2+=dz2*i;
-      }
-      while (dy2--) {
-        res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-        y1++;
-        x1+=dx1;
-        x2+=dx2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-      if (dy2=p4->y-p2->y) {
-        dx2=(p4->x-p2->x)<<32/dy2;
-        dz2=(p4->z-p2->z)<<32/dy2;
-        if (y1+dy2>=max) {
-          i=y1+dy2-max+1;
-          if (i>dy2) goto ft_done;
-          dy2-=i;
-        }
-        if (y1<min) {
-          i=min-y1;
-          if (i>dy2) goto ft_done;
-          dy2-=i;
-          y1+=i;
-          x1+=dx1*i;
-          x2+=dx2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-      }
-      while (dy2-->=0) {
-        res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-        y1++;
-        x1+=dx1;
-        x2+=dx2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-    } else {
-      if (dy1=p2->y-p1->y) {
-        dx1=(p2->x-p1->x)<<32/dy1;
-        dz1=(p2->z-p1->z)<<32/dy1;
-        if (dy2=p2->y-p4->y) {
-          dx2=(p2->x-p4->x)<<32/dy2;
-          dz2=(p2->z-p4->z)<<32/dy2;
-        } else {
-          dx2=0;
-          dz2=0;
-        }
-        x1=x2=p2->x<<32; y1=p2->y; z1=z2=p2->z<<32;
-        if (y1<min) {
-          i=min-y1;
-          if (i>-dy1)
-            i=-dy1;
-          dy1+=i;
-          y1+=i;
-          x1+=dx1*i;
-          x2+=dx2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-        while (dy1++<=0) {
-          if (y1<max)
-            res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-          y1++;
-          x1+=dx1;
-          x2+=dx2;
-          z1+=dz1;
-          z2+=dz2;
-        }
-      }
-      if (dy1=p4->y-p1->y) {
-        dx1=(p1->x-p4->x)<<32/dy1;
-        dz1=(p1->z-p4->z)<<32/dy1;
-        if (dy2=p4->y-p2->y) {
-          dx2=(p2->x-p4->x)<<32/dy2;
-          dz2=(p2->z-p4->z)<<32/dy2;
-        } else {
-          dx2=0;
-          dz2=0;
-        }
-        x1=x2=p4->x<<32; y1=p4->y; z1=z2=p4->z<<32;
-        if (y1-dy1<min) {
-          i=min-(y1-dy1);
-          if (i>dy1) goto ft_done;
-          dy1-=i;
-        }
-        if (y1>=max) {
-          i=y1-max+1;
-          if (i>dy1) goto ft_done;
-          dy1-=i;
-          y1-=i;
-          x1+=dx1*i;
-          x2+=dx2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-        while (dy1-->=0) {
-          res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]);
-          y1--;
-          x1+=dx1;
-          x2+=dx2;
-          z1+=dz1;
-          z2+=dz2;
-        }
-      }
-    }
-  } else {
-//p1 is min y
-    if (p4->y<p2->y)
-      SwapI64(&p4,&p2);
-    if (p2->y<p1->y)
-      SwapI64(&p2,&p1);
-
-      //p2x<=p4x
-    if (p4->x<p2->x)
-      SwapI64(&p4,&p2);
-
-    min=0;
-    max=dc->width;
-    if (dc->flags & DCF_SCRN_BITMAP) {
-      win_task=dc->win_task;
-      min-=win_task->scroll_x+win_task->pix_left;
-      max-=win_task->scroll_x+win_task->pix_left;
-      if (max>win_task->pix_right-(win_task->scroll_x+win_task->pix_left))
-        max=win_task->pix_right-(win_task->scroll_x+win_task->pix_left);
-    }
-
-    if ((dx2=p4->x-p1->x)<0) {
-      dx1=p2->x-p1->x;
-      dy1=(p1->y-p2->y)<<32/dx1;
-      dz1=(p1->z-p2->z)<<32/dx1;
-
-      dy2=(p1->y-p4->y)<<32/dx2;
-      dz2=(p1->z-p4->z)<<32/dx2;
-      y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32;
-      if (x1+dx2<min) {
-        i=min-(x1+dx2);
-        if (i>-dx2) goto ft_done;
-        dx2+=i;
-      }
-      if (x1>=max) {
-        i=x1-max+1;
-        if (i>-dx2)
-          i=-dx2;
-        dx2+=i;
-        x1-=i;
-        y1+=dy1*i;
-        y2+=dy2*i;
-        z1+=dz1*i;
-        z2+=dz2*i;
-      }
-      while (dx2++) {
-        res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-        x1--;
-        y1+=dy1;
-        y2+=dy2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-      if (dx2=p2->x-p4->x) {
-        dy2=(p4->y-p2->y)<<32/dx2;
-        dz2=(p4->z-p2->z)<<32/dx2;
-        if (x1+dx2<min) {
-          i=min-(x1+dx2);
-          if (i>-dx2) goto ft_done;
-          dx2+=i;
-        }
-        if (x1>=max) {
-          i=x1-max+1;
-          if (i>-dx2) goto ft_done;
-          dx2+=i;
-          x1-=i;
-          y1+=dy1*i;
-          y2+=dy2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-      }
-      while (dx2++<=0) {
-        res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-        x1--;
-        y1+=dy1;
-        y2+=dy2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-    } else if ((dx2=p2->x-p1->x)>0) {
-      dx1=p4->x-p1->x;
-      dy1=(p4->y-p1->y)<<32/dx1;
-      dz1=(p4->z-p1->z)<<32/dx1;
-
-      dy2=(p2->y-p1->y)<<32/dx2;
-      dz2=(p2->z-p1->z)<<32/dx2;
-      y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32;
-      if (x1+dx2>=max) {
-        i=x1+dx2-max+1;
-        if (i>dx2) goto ft_done;
-        dx2-=i;
-      }
-      if (x1<min) {
-        i=min-x1;
-        if (i>dx2)
-          i=dx2;
-        dx2-=i;
-        x1+=i;
-        y1+=dy1*i;
-        y2+=dy2*i;
-        z1+=dz1*i;
-        z2+=dz2*i;
-      }
-      while (dx2--) {
-        res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-        x1++;
-        y1+=dy1;
-        y2+=dy2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-      if (dx2=p4->x-p2->x) {
-        dy2=(p4->y-p2->y)<<32/dx2;
-        dz2=(p4->z-p2->z)<<32/dx2;
-        if (x1+dx2>=max) {
-          i=x1+dx2-max+1;
-          if (i>dx2) goto ft_done;
-          dx2-=i;
-        }
-        if (x1<min) {
-          i=min-x1;
-          if (i>dx2) goto ft_done;
-          dx2-=i;
-          x1+=i;
-          y1+=dy1*i;
-          y2+=dy2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-      }
-      while (dx2-->=0) {
-        res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-        x1++;
-        y1+=dy1;
-        y2+=dy2;
-        z1+=dz1;
-        z2+=dz2;
-      }
-    } else {
-      if (dx1=p2->x-p1->x) {
-        dy1=(p2->y-p1->y)<<32/dx1;
-        dz1=(p2->z-p1->z)<<32/dx1;
-        if (dx2=p2->x-p4->x) {
-          dy2=(p2->y-p4->y)<<32/dx2;
-          dz2=(p2->z-p4->z)<<32/dx2;
-        } else {
-          dy2=0;
-          dz2=0;
-        }
-        y1=y2=p2->y<<32; x1=p2->x; z1=z2=p2->z<<32;
-        if (x1<min) {
-          i=min-x1;
-          if (i>-dx1)
-            i=-dx1;
-          dx1+=i;
-          x1+=i;
-          y1+=dy1*i;
-          y2+=dy2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-        while (dx1++<=0) {
-          if (x1<max)
-            res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-          x1++;
-          y1+=dy1;
-          y2+=dy2;
-          z1+=dz1;
-          z2+=dz2;
-        }
-      }
-      if (dx1=p4->x-p1->x) {
-        dy1=(p1->y-p4->y)<<32/dx1;
-        dz1=(p1->z-p4->z)<<32/dx1;
-        if (dx2=p4->x-p2->x) {
-          dy2=(p2->y-p4->y)<<32/dx2;
-          dz2=(p2->z-p4->z)<<32/dx2;
-        } else {
-          dy2=0;
-          dz2=0;
-        }
-        y1=y2=p4->y<<32; x1=p4->x; z1=z2=p4->z<<32;
-        if (x1-dx1<min) {
-          i=min-(x1-dx1);
-          if (i>dx1) goto ft_done;
-          dx1-=i;
-        }
-        if (x1>=max) {
-          i=x1-max+1;
-          if (i>dx1) goto ft_done;
-          dx1-=i;
-          x1-=i;
-          y1+=dy1*i;
-          y2+=dy2*i;
-          z1+=dz1*i;
-          z2+=dz2*i;
-        }
-        while (dx1-->=0) {
-          res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]);
-          x1--;
-          y1+=dy1;
-          y2+=dy2;
-          z1+=dz1;
-          z2+=dz2;
-        }
-      }
-    }
-  }
-ft_done:
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrScrn.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrScrn.HC.HTML deleted file mode 100755 index 2eba4fb..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrScrn.HC.HTML +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Scrn"
-
-U0 GrUpdateTaskODEs(CTask *task)
-{
-  sys_task_being_scrn_updated=task;
-  try
-    ODEsUpdate(task);
-  catch {
-    LBts(&task->win_inhibit,WIf_SELF_ODE);
-    "Exception in WinMgr: Update Task ODEs\n";
-    PutExcept;
-    Sleep(3000);
-    VGAFlush;
-  }
-  sys_task_being_scrn_updated=NULL;
-}
-
-U0 GrUpdateTaskWin(CTask *task)
-{ //Draw a win.  Only Core0 tasks have a win.
-  CDC *dc;
-  CD3I64 saved_scroll;
-  sys_task_being_scrn_updated=task;
-  try {
-    if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER))
-      TextBorder(Fs,task->win_left,task->win_right,task->win_top,
-            task->win_bottom,task->border_attr,task==sys_focus_task);
-    TextRect(task->win_left,task->win_right,
-          task->win_top,task->win_bottom,task->text_attr<<8);
-    if (task==sys_winmgr_task) {
-      if (gr.fp_wall_paper)
-        (*gr.fp_wall_paper)(task);
-    } else if (!(task->win_inhibit&WIF_SELF_DOC))
-      DocUpdateTaskDocs(task);
-    if (TaskValidate(task)) {
-      if (task->draw_it) {
-        dc=DCAlias(gr.dc2,task);
-        (*task->draw_it)(task,dc);
-        DCDel(dc);
-      }
-      if (TaskValidate(task)) {
-        WinScrollNull(task,&saved_scroll);
-        DrawCtrls(task);
-        WinScrollRestore(task,&saved_scroll);
-      }
-    }
-  } catch {
-    if (task!=Fs && TaskValidate(task)) {
-      LBtr(&task->display_flags,DISPLAYf_SHOW);
-      "Exception in WinMgr: Update Task Win\n";
-      PutExcept;
-      Sleep(3000);
-      VGAFlush;
-    }
-  }
-  sys_task_being_scrn_updated=NULL;
-}
-
-U0 GrUpdateTasks()
-{//Only called by WinMgr
-  I64 i;
-  CTask *task,*task1;
-  try {
-    winmgr.ode_time=0;
-    if (Bt(&sys_semas[SEMA_UPDATE_WIN_Z_BUF],0))
-      WinZBufUpdate;
-    task1=task=sys_winmgr_task;
-    do { //Loop through Core0 tasks.
-      if (!TaskValidate(task)) break;
-      if (Bt(&task->display_flags,DISPLAYf_SHOW) &&
-            Bt(gr.win_uncovered_bitmap,task->win_z_num))
-        GrUpdateTaskWin(task);
-      if (!TaskValidate(task)) break;
-      task=task->next_task;
-    } while (task!=task1);
-
-    for (i=0;i<mp_cnt;i++) { //Loop through all cores.
-      task1=task=cpu_structs[i].seth_task;
-      do {
-        if (!TaskValidate(task)) break;
-        GrUpdateTaskODEs(task);
-        if (!TaskValidate(task)) break;
-        task=task->next_task;
-      } while (task!=task1);
-    }
-  } catch {
-    PutExcept(FALSE);
-    Dbg("Exception in WinMgr");
-  }
-  winmgr.last_ode_time=winmgr.ode_time;
-  ode_alloced_factor=LowPass1(0.1,ode_alloced_factor,
-        Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps);
-  sys_task_being_scrn_updated=NULL;
-}
-
-U0 GrFixZoomScale()
-{
-  gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_SCRN_ZOOM_MAX);
-  if (gr.scrn_zoom==1) {
-    gr.sx=0;
-    gr.sy=0;
-  } else {
-    gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.scrn_zoom)&~7;
-    gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.scrn_zoom);
-  }
-}
-
-public U0 GrScaleZoom(F64 scale)
-{//Multiply zoom factor larger or smaller.
-  F64 s=gr.scrn_zoom;
-  gr.scrn_zoom=gr.scrn_zoom*scale;
-  GrFixZoomScale;
-  s/=gr.scrn_zoom;
-  ms.scale.x*=s;
-  ms.scale.y*=s;
-  ms.scale.z*=s;
-  ms.offset.x=ms.pos.x-(ms.pos.x-ms.offset.x)*s;
-  ms.offset.y=ms.pos.y-(ms.pos.y-ms.offset.y)*s;
-  ms.offset.z=ms.pos.z-(ms.pos.z-ms.offset.z)*s;
-  gr.sx=ms.pos.x-gr.zoomed_dc->width >>1/gr.scrn_zoom;
-  gr.sy=ms.pos.y-gr.zoomed_dc->height>>1/gr.scrn_zoom;
-  GrFixZoomScale;
-}
-
-U0 GrZoomInScrn()
-{
-  GrFixZoomScale;
-  I64 plane,row,col,k,l,
-        d2=gr.zoomed_dc->width>>3/gr.scrn_zoom,
-        d4=gr.zoomed_dc->width_internal>>3,
-        d5=d4-d2*gr.scrn_zoom,
-        d3=gr.zoomed_dc->height/gr.scrn_zoom,
-        d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3,
-        d7=gr.zoomed_dc->height%gr.scrn_zoom*d4;
-  U8 *src,*src2,*dst,*src3,*map=gr.scrn_zoom_tables[gr.scrn_zoom];
-
-  src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3;
-  dst=gr.zoomed_dc->body;
-  for (plane=1;plane<0x10;plane<<=1) {
-    row=d3;
-    while (row--) {
-      k=gr.scrn_zoom;
-      while (k--) {
-        src2=src;
-        col=d2;
-        while (col--) {
-          src3=&map[*src2++];
-          l=gr.scrn_zoom;
-          while (l--) {
-            *dst++=*src3;
-            src3+=256;
-          }
-        }
-        l=d5;
-        while (l--)
-          *dst++=0;
-      }
-      src+=d4;
-    }
-    l=d7;
-    while (l--)
-      *dst++=0;
-    src+=d6;
-  }
-}
-
-U0 GrUpdateTextBG()
-{
-  I64 reg RSI *dst=gr.dc2->body,reg R13 c,row,col,
-        num_rows=TEXT_ROWS,num_cols=TEXT_COLS,i,j,cur_ch,
-        reg R12 w1=gr.dc2->width_internal,w2=-7*w1+8,w3=7*w1,w4=0;
-  U32 *src=gr.text_base;
-  Bool blink_flag=Blink;
-  U8 *dst2=dst;
-
-  if (gr.pan_text_x||gr.hide_col) {
-    gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7);
-    j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1;
-    num_cols-=j;
-    if (gr.pan_text_x<0) {
-      src+=j;
-      i=FONT_WIDTH*j+gr.pan_text_x;
-    } else
-      i=gr.pan_text_x;
-    dst2=dst(U8 *)+i;
-    w4=j;
-    w3+=j*FONT_WIDTH;
-
-    j*=FONT_WIDTH;
-    dst(U8 *)=gr.dc2->body;
-    for (row=num_rows*FONT_HEIGHT;row--;) {
-      for (col=i;col--;)
-        *dst(U8 *)++=0;
-      dst(U8 *)+=w1-i-j;
-      for (col=j;col--;)
-        *dst(U8 *)++=0;
-    }
-  }
-  dst=dst2;
-
-  if (gr.pan_text_y||gr.hide_row) {
-    gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7);
-    j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1;
-    num_rows-=j;
-    if (gr.pan_text_y<0) {
-      src+=w1/FONT_WIDTH*j;
-      i=w1*(FONT_HEIGHT*j+gr.pan_text_y);
-    } else
-      i=w1*gr.pan_text_y;
-    dst2=dst(U8 *)+i;
-
-    j*=w1*FONT_HEIGHT;
-    dst(U8 *)=gr.dc2->body;
-    for (row=i;row--;)
-      *dst(U8 *)++=0;
-    dst(U8 *)=gr.dc2->body+TEXT_ROWS*TEXT_COLS*FONT_HEIGHT*FONT_WIDTH-j;
-    for (row=j;row--;)
-      *dst(U8 *)++=0;
-  }
-  dst=dst2;
-
-  for (row=num_rows;row--;) {
-    for (col=num_cols;col--;) {
-      cur_ch=*src++;
-      if (cur_ch & (ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) {
-        if (cur_ch & ATTRF_SEL)
-          cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
-        if (cur_ch & ATTRF_INVERT)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-        if (cur_ch & ATTRF_BLINK && blink_flag)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      }
-      c=gr.to_8_colors[cur_ch.u8[1]>>4];
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      ADD       RSI,R12
-      MOV       U64 [RSI],R13
-      dst(U8 *)+=w2;
-    }
-    src+=w4;
-    dst(U8 *)+=w3;
-  }
-}
-
-U0 GrUpdateTextFG()
-{//See TextBase Layer.
-  U32 *src=gr.text_base;
-  I64 i,j,cur_ch,*dst=gr.dc2->body,
-        w1=gr.dc2->width_internal,w2=7*w1,w4=0,
-        num_rows=TEXT_ROWS,num_cols=TEXT_COLS,row,col;
-  U8 *dst_start=gr.dc2->body,*dst_end=dst_start+w1*gr.dc2->height-7*w1-8;
-  Bool blink_flag=Blink;
-
-  if (gr.pan_text_x||gr.hide_col) {
-    gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7);
-    j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1;
-    num_cols-=j;
-    if (gr.pan_text_x<0) {
-      src+=j;
-      dst(U8 *)+=FONT_WIDTH*j;
-    }
-    w4=j;
-    w2+=j*FONT_WIDTH;
-  }
-
-  if (gr.pan_text_y||gr.hide_row) {
-    gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7);
-    j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1;
-    num_rows-=j;
-    if (gr.pan_text_y<0) {
-      src+=w1/FONT_WIDTH*j;
-      dst(U8 *)+=w1*FONT_HEIGHT*j;
-    }
-  }
-
-  for (row=num_rows;row--;) {
-    for (col=num_cols;col--;) {
-      cur_ch=*src++;
-      if (cur_ch & (ATTRF_UNDERLINE|ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) {
-        if (cur_ch & ATTRF_SEL)
-          cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
-        if (cur_ch & ATTRF_INVERT)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-        if (cur_ch & ATTRF_BLINK && blink_flag)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      }
-      if (i=cur_ch.u16[1]&0x3FF+gr.pan_text_x+gr.pan_text_y<<5) {
-        j=i&0x1F;
-        if (j&0x10) j|=~0x1F;
-        i>>=5;
-        if (i&0x10) i|=~0x1F;
-        i=w1*i+j;
-        if (dst_start<=dst(U8 *)+i<dst_end)
-          GrRopEquU8NoClipping(cur_ch&(ATTRF_UNDERLINE+0xFFF),dst(U8 *)+i,w1);
-      } else
-        GrRopEquU8NoClipping(cur_ch&(ATTRF_UNDERLINE+0xFFF),dst,w1);
-      dst(U8 *)+=8;
-    }
-    src+=w4;
-    dst(U8 *)+=w2;
-  }
-}
-
-U0 DCBlotColor8(CDC *dc,CDC *img)
-{
-  U8  *src=img->body,*b0=dc->body;
-  I64 j,k,d0=img->width_internal*img->height;
-  for (k=0;k<d0;k++) {
-    j=*src++;
-    if (j!=TRANSPARENT)
-      *b0++=j;
-    else
-      b0++;
-  }
-}
-
-U0 GrUpdateTextModeText()
-{
-  U32 *src=gr.text_base;
-  I64 cur_ch,i=TEXT_COLS*TEXT_ROWS;
-  U16 *dst=text.vga_text_alias,*dst2=gr.vga_text_cache;
-  Bool blink_flag=Blink;
-  if (LBtr(&sys_semas[SEMA_FLUSH_VGA_IMAGE],0)) {
-    while (i--) {
-      cur_ch=*src++;
-      if (cur_ch & ATTRF_SEL)
-        cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
-      if (cur_ch & ATTRF_INVERT)
-        cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      if (cur_ch & ATTRF_BLINK)
-        if (blink_flag)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      *dst++=*dst2++=cur_ch&0x7FFF;
-    }
-  } else {
-    while (i--) {
-      cur_ch=*src++;
-      if (cur_ch & ATTRF_SEL)
-        cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
-      if (cur_ch & ATTRF_INVERT)
-        cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      if (cur_ch & ATTRF_BLINK)
-        if (blink_flag)
-          cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
-      cur_ch&=0x7FFF;
-      if (*dst2!=cur_ch)
-        *dst++=*dst2++=cur_ch;
-      else {
-        dst++;
-        dst2++;
-      }
-    }
-  }
-}
-
-U0 GrUpdateVGAGraphics()
-{//Update Graphic Card
-  I64 row,plane,d=gr.zoomed_dc->width_internal>>6;
-  U32 *src,*vga,*dst;
-  if (gr.scrn_zoom==1)
-    src=gr.dc1->body;
-  else {
-    GrZoomInScrn;
-    src=gr.zoomed_dc->body;
-  }
-  dst=gr.scrn_image->body;
-  if (LBtr(&sys_semas[SEMA_FLUSH_VGA_IMAGE],0)) {
-    for (plane=1;plane<0x10;plane<<=1) {
-      OutU8(VGAP_IDX,VGAR_MAP_MASK);
-      OutU8(VGAP_DATA,plane);
-      vga=text.vga_alias;
-      row=gr.zoomed_dc->height;
-      while (row--)
-        GrUpdateLine64FlushCache(&vga,&src,d,&dst);
-    }
-  } else {
-    for (plane=1;plane<0x10;plane<<=1) {
-      OutU8(VGAP_IDX,VGAR_MAP_MASK);
-      OutU8(VGAP_DATA,plane);
-      vga=text.vga_alias;
-      row=gr.zoomed_dc->height;
-      while (row--)
-        GrUpdateLine64(&vga,&src,d,&dst);
-    }
-  }
-}
-
-U0 GrUpdateScrn()
-{//Called by the Window Manager HERE, 30 times a second.
-  CDC *dc;
-  if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
-    GrUpdateTasks;
-  else {
-    GrUpdateTextBG;
-    GrUpdateTextFG;
-    GrUpdateTasks;
-    DCBlotColor8(gr.dc2,gr.dc);
-  }
-
-  dc=DCAlias(gr.dc2,Fs);
-  dc->flags|=DCF_ON_TOP;
-  if (gr.fp_final_scrn_update)
-    (*gr.fp_final_scrn_update)(dc);
-  DCDel(dc);
-
-  if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
-    GrUpdateTextModeText;
-  else {
-    DCBlotColor4(gr.dc1->body,gr.dc2->body,gr.dc_cache->body,
-          gr.dc2->height*gr.dc2->width_internal>>3);
-    GrUpdateVGAGraphics;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrSpritePlot.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrSpritePlot.HC.HTML deleted file mode 100755 index 376a839..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrSpritePlot.HC.HTML +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-/*
-CSprites are stored as a sequence of var
-length operations with a 1-byte type leading
-each operation.  They are stored, one after another,
-in a chunk of memory terminated by a zero.
-Sprite3() shows how the CSprite unions are used.
-
-SpriteElemSize() will return the size of a single
-element, while SpriteSize() will return the size
-of an entire list.  Look at sprite_elem_base_sizes.
-
-See ::/Apps/GrModels for an example of
-making CSprite by hand.  It uses SPT_MESH,
-one of the most complicated.
-*/
-
-public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
-        Bool just_one_elem=FALSE)
-{//Plot a sprite into a CDC.
-  CSprite *tmpg=elems-offset(CSprite.start);
-  I64 i,j,k,x1,y1,z1,x2,y2,
-        *old_r,*r2,old_flags=dc->flags,old_pen_width=dc->thick;
-  I32 *ptr;
-  CColorROPU32 old_color=dc->color;
-  CDC *img;
-  CD3I32 *p,*p2;
-  CGrSym old_sym;
-  MemCpy(&old_sym,&dc->sym,sizeof(CGrSym));
-  if (dc->flags & DCF_LOCATE_NEAREST)
-    dc->nearest_dist=I64_MAX;
-  while (tmpg->type&SPG_TYPE_MASK) {
-    switch (tmpg->type&SPG_TYPE_MASK) {
-      case SPT_COLOR:
-        dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tmpg->c.color;
-        break;
-      case SPT_DITHER_COLOR:
-        dc->color=dc->color&~COLORROP_COLORS_MASK|
-              tmpg->d.dither_color.u8[0]|
-              tmpg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
-        break;
-      case SPT_THICK:
-        dc->thick=tmpg->t.thick;
-        DCThickScale(dc);
-        break;
-      case SPT_TRANSFORM_ON:
-        if (!(dc->flags&DCF_TRANSFORMATION)) {
-          x-=dc->x;
-          y-=dc->y;
-          z-=dc->z;
-        }
-        dc->flags|=DCF_TRANSFORMATION;
-        break;
-      case SPT_TRANSFORM_OFF:
-        if (dc->flags&DCF_TRANSFORMATION) {
-          x+=dc->x;
-          y+=dc->y;
-          z+=dc->z;
-        }
-        dc->flags&=~DCF_TRANSFORMATION;
-        break;
-      case SPT_PT:
-        GrPlot3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z);
-        break;
-      case SPT_TEXT:
-        GrPrint3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,"%s",tmpg->ps.st);
-        break;
-      case SPT_TEXT_BOX:
-        GrTextBox3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,tmpg->ps.st);
-        break;
-      case SPT_TEXT_DIAMOND:
-        GrTextDiamond3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,tmpg->ps.st);
-        break;
-      case SPT_FLOOD_FILL:
-        GrFloodFill3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z,FALSE);
-        break;
-      case SPT_FLOOD_FILL_NOT:
-        i=dc->color;
-        dc->color=dc->color.c0;
-        GrFloodFill3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z,TRUE);
-        dc->color=i;
-        break;
-      case SPT_SHIFT:
-        x+=tmpg->p.x1;
-        y+=tmpg->p.y1;
-        break;
-      case SPT_LINE:
-        GrLine3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
-              tmpg->pp.x2+x,tmpg->pp.y2+y,z);
-        break;
-      case SPT_ARROW:
-        GrArrow3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
-              tmpg->pp.x2+x,tmpg->pp.y2+y,z);
-        break;
-      case SPT_PLANAR_SYMMETRY:
-        if (DCSymmetry3Set(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
-              tmpg->pp.x2+x,tmpg->pp.y2+y,z,
-              tmpg->pp.x2+x,tmpg->pp.y2+y,z+1))
-          dc->flags|=DCF_SYMMETRY;
-        else
-          dc->flags&=~DCF_SYMMETRY;
-        break;
-      case SPT_BITMAP:
-        img=CAlloc(sizeof(CDC));
-        img->width=tmpg->pwhu.width;
-        img->width_internal=(tmpg->pwhu.width+7)&~7;
-        img->height=tmpg->pwhu.height;
-        img->body=&tmpg->pwhu.u;
-        img->dc_signature=DCS_SIGNATURE_VAL;
-        GrBlot3(dc,tmpg->pwhu.x1+x,tmpg->pwhu.y1+y,z,img);
-        Free(img);
-        break;
-      case SPT_RECT:
-        GrRect3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
-              tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
-        break;
-      case SPT_ROTATED_RECT:
-        x1=tmpg->ppa.x1+x;
-        y1=tmpg->ppa.y1+y;
-        z1=z;
-        Mat4x4MulXYZ(dc->r,&x1,&y1,&z1);
-        old_r=dc->r;
-        dc->flags|=DCF_TRANSFORMATION;
-        r2=Mat4x4IdentNew;
-        Mat4x4RotZ(r2,-tmpg->ppa.angle);
-        Mat4x4TranslationEqu(r2,x1,y1,z1);
-        DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2));
-        GrRect3(dc,0,0,0,
-              tmpg->ppa.x2-tmpg->ppa.x1,tmpg->ppa.y2-tmpg->ppa.y1);
-        Free(dc->r);
-        Free(r2);
-        DCMat4x4Set(dc,old_r);
-        dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
-        break;
-      case SPT_CIRCLE:
-        GrCircle3(dc,tmpg->pr.x1+x,tmpg->pr.y1+y,z,tmpg->pr.radius);
-        break;
-      case SPT_ELLIPSE:
-        GrEllipse3(dc,tmpg->pwha.x1+x,tmpg->pwha.y1+y,z,tmpg->pwha.width,
-              tmpg->pwha.height,tmpg->pwha.angle);
-        break;
-      case SPT_POLYGON:
-        GrRegPoly3(dc,tmpg->pwhas.x1+x,tmpg->pwhas.y1+y,z,tmpg->pwhas.width,
-              tmpg->pwhas.height,tmpg->pwhas.sides,tmpg->pwhas.angle);
-        break;
-      case SPT_POLYLINE:
-        ptr=&tmpg->nu.u;
-        x1=ptr[0];
-        y1=ptr[1];
-        for (i=1;i<tmpg->nu.num;i++) {
-          x2=ptr[i<<1];
-          y2=ptr[i<<1+1];
-          GrLine3(dc,x1+x,y1+y,z,x2+x,y2+y,z);
-          x1=x2;y1=y2;
-        }
-        break;
-      case SPT_POLYPT:
-        x1=tmpg->npu.x;
-        y1=tmpg->npu.y;
-        ptr=&tmpg->npu.u;
-        k=tmpg->npu.num*3;
-        GrPlot3(dc,x1+x,y1+y,z);
-        for (i=0;i<k;i+=3) {
-          j=BFieldExtU32(ptr,i,3);
-          x1+=gr_x_offsets[j];
-          y1+=gr_y_offsets[j];
-          GrPlot3(dc,x1+x,y1+y,z);
-        }
-        break;
-      start:
-        p2=p=MAlloc(tmpg->nu.num*sizeof(CD3I32));
-        MemCpy(p,&tmpg->nu.u,tmpg->nu.num*sizeof(CD3I32));
-        for (i=0;i<tmpg->nu.num;i++,p2++) {
-          p2->x+=x;
-          p2->y+=y;
-          p2->z+=z;
-        }
-        case SPT_BSPLINE2:
-          Gr2BSpline3(dc,p,tmpg->nu.num,FALSE);
-          break;
-        case SPT_BSPLINE3:
-          Gr3BSpline3(dc,p,tmpg->nu.num,FALSE);
-          break;
-        case SPT_BSPLINE2_CLOSED:
-          Gr2BSpline3(dc,p,tmpg->nu.num,TRUE);
-          break;
-        case SPT_BSPLINE3_CLOSED:
-          Gr3BSpline3(dc,p,tmpg->nu.num,TRUE);
-          break;
-      end:
-        Free(p);
-        break;
-      case SPT_MESH:
-        p2=p=MAlloc(tmpg->mu.vertex_cnt*sizeof(CD3I32));
-        MemCpy(p,&tmpg->mu.u,tmpg->mu.vertex_cnt*sizeof(CD3I32));
-        for (i=0;i<tmpg->mu.vertex_cnt;i++,p2++) {
-          p2->x+=x;
-          p2->y+=y;
-          p2->z+=z;
-        }
-        Gr3Mesh(dc,tmpg->mu.vertex_cnt,p,tmpg->mu.tri_cnt,
-              (&tmpg->mu.u)(U8 *)+sizeof(CD3I32)*tmpg->mu.vertex_cnt);
-        Free(p);
-        break;
-      case SPT_SHIFTABLE_MESH:
-        if (dc->flags&DCF_TRANSFORMATION) {
-          dc->x+=tmpg->pmu.x;
-          dc->y+=tmpg->pmu.y;
-          dc->z+=tmpg->pmu.z;
-          x1=x;
-          y1=y;
-          z1=z;
-        } else {
-          x1=tmpg->pmu.x+x;
-          y1=tmpg->pmu.y+y;
-          z1=tmpg->pmu.z+z;
-        }
-        p2=p=MAlloc(tmpg->pmu.vertex_cnt*sizeof(CD3I32));
-        MemCpy(p,&tmpg->pmu.u,tmpg->pmu.vertex_cnt*sizeof(CD3I32));
-        for (i=0;i<tmpg->pmu.vertex_cnt;i++,p2++) {
-          p2->x+=x1;
-          p2->y+=y1;
-          p2->z+=z1;
-        }
-        Gr3Mesh(dc,tmpg->pmu.vertex_cnt,p,tmpg->pmu.tri_cnt,
-              (&tmpg->pmu.u)(U8 *)+sizeof(CD3I32)*tmpg->pmu.vertex_cnt);
-        Free(p);
-        if (dc->flags&DCF_TRANSFORMATION) {
-          dc->x-=tmpg->pmu.x;
-          dc->y-=tmpg->pmu.y;
-          dc->z-=tmpg->pmu.z;
-        }
-        break;
-    }
-    if (just_one_elem) break;
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-  }
-  MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
-  dc->color=old_color;
-  dc->thick=old_pen_width;
-  dc->flags=dc->flags&~(DCF_SYMMETRY|DCF_TRANSFORMATION) |
-        old_flags&(DCF_SYMMETRY|DCF_TRANSFORMATION);
-}
-
-public U0 Sprite3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems)
-{//Plot a sprite into a CDC, post transform xyz translation.
-  I64 old_x=dc->x,old_y=dc->y,old_z=dc->z,
-        old_flags=dc->flags&DCF_TRANSFORMATION;
-  dc->x=x; dc->y=y; dc->z=z;
-  dc->flags|=DCF_TRANSFORMATION;
-  Sprite3(dc,0,0,0,elems);
-  dc->x=old_x; dc->y=old_y; dc->z=old_z;
-  dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
-}
-
-public U0 Sprite3Mat4x4B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,I64 *m)
-{//Plot rotated by matrix.
-  I64 r[16],*old_r=dc->r,new_m[16],
-        old_flags=dc->flags&DCF_TRANSFORMATION;
-  MemCpy(new_m,m,16*sizeof(I64));
-  dc->flags|=DCF_TRANSFORMATION;
-  Mat4x4TranslationAdd(new_m,x,y,z);
-  dc->r=Mat4x4MulMat4x4Equ(r,old_r,new_m);
-  Sprite3(dc,0,0,0,elems);
-  dc->r=old_r;
-  dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
-}
-
-public U0 Sprite3XB(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 phi=0)
-{//Plot rotated around X axis.
-  I64 r[16];
-  Mat4x4IdentEqu(r);
-  Mat4x4RotX(r,phi);
-  Sprite3Mat4x4B(dc,x,y,z,elems,r);
-}
-
-public U0 Sprite3YB(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 omega=0)
-{//Plot rotated around Y axis.
-  I64 r[16];
-  Mat4x4IdentEqu(r);
-  Mat4x4RotY(r,omega);
-  Sprite3Mat4x4B(dc,x,y,z,elems,r);
-}
-
-public U0 Sprite3ZB(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 theta=0)
-{//Plot rotated around Z axis.
-  I64 r[16];
-  Mat4x4IdentEqu(r);
-  Mat4x4RotZ(r,theta);
-  Sprite3Mat4x4B(dc,x,y,z,elems,r);
-}
-
-public U0 SpriteExtents(U8 *elems,I64 *min_x=NULL,I64 *max_x=NULL,
-                                   I64 *min_y=NULL,I64 *max_y=NULL)
-{//Ignores flood fills.
-  CDC *dc=DCNew(I32_MAX,I32_MAX,Fs,TRUE);
-  DCExtentsInit(dc);
-  Sprite3(dc,I32_MAX/2,I32_MAX/2,I32_MAX/2,elems);
-  if (dc->min_x<=dc->max_x) {
-    dc->min_x-=I32_MAX/2;
-    dc->max_x-=I32_MAX/2;
-  }
-  if (dc->min_y<=dc->max_y) {
-    dc->min_y-=I32_MAX/2;
-    dc->max_y-=I32_MAX/2;
-  }
-  if (min_x) *min_x=dc->min_x;
-  if (max_x) *max_x=dc->max_x;
-  if (min_y) *min_y=dc->min_y;
-  if (max_y) *max_y=dc->max_y;
-  DCDel(dc);
-}
-
-public CDC *Sprite2DC(U8 *elems)
-{//Convert sprite to device context.
-  CDC *res;
-  I64 min_x,max_x,min_y,max_y;
-  SpriteExtents(elems,&min_x,&max_x,&min_y,&max_y);
-  res=DCNew(max_x-min_x+1,max_y-min_y+1);
-  Sprite3(res,-min_x,-min_y,0,elems);
-  return res;
-}
-
-public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
-{//The two CSprite should be ident except for points shifted around.
-//t ranges from 0.0 to 1.0.
-  I64 i,t1=GR_SCALE*t,t0=GR_SCALE-t1;
-  I32 *ptr0,*ptr1,*ptrr;
-  CD3I32 *p0,*p1,*pr;
-  U8 *res;
-  CSprite *tmpg0=elems0-offset(CSprite.start),
-        *tmpg1=elems1-offset(CSprite.start),*tmpgr;
-  if (t<0.5) {
-    i=SpriteSize(elems0),
-          res=MAlloc(i);
-    MemCpy(res,elems0,i);
-  } else {
-    i=SpriteSize(elems1),
-          res=MAlloc(i);
-    MemCpy(res,elems1,i);
-  }
-  tmpgr=res-offset(CSprite.start);
-  while (tmpg0->type&SPG_TYPE_MASK) {
-    if (tmpg0->type&SPG_TYPE_MASK!=tmpg1->type&SPG_TYPE_MASK)
-      throw('Graphics');
-    switch (tmpg0->type&SPG_TYPE_MASK) {
-      case SPT_ROTATED_RECT:
-        tmpgr->ppa.angle=(tmpg0->ppa.angle*t0+tmpg1->ppa.angle*t1)/GR_SCALE;
-      case SPT_RECT:
-      case SPT_LINE:
-      case SPT_ARROW:
-      case SPT_PLANAR_SYMMETRY:
-        tmpgr->pp.x2=(tmpg0->pp.x2*t0+tmpg1->pp.x2*t1)>>32;
-        tmpgr->pp.y2=(tmpg0->pp.y2*t0+tmpg1->pp.y2*t1)>>32;
-      case SPT_TEXT:
-      case SPT_TEXT_BOX:
-      case SPT_TEXT_DIAMOND:
-      case SPT_PT:
-      case SPT_FLOOD_FILL:
-      case SPT_FLOOD_FILL_NOT:
-      case SPT_SHIFT:
-        tmpgr->p.x1=(tmpg0->p.x1*t0+tmpg1->p.x1*t1)>>32;
-        tmpgr->p.y1=(tmpg0->p.y1*t0+tmpg1->p.y1*t1)>>32;
-        break;
-      case SPT_CIRCLE:
-        tmpgr->pr.radius=(tmpg0->pr.radius*t0+tmpg1->pr.radius*t1)>>32;
-        tmpgr->pr.x1=(tmpg0->pr.x1*t0+tmpg1->pr.x1*t1)>>32;
-        tmpgr->pr.y1=(tmpg0->pr.y1*t0+tmpg1->pr.y1*t1)>>32;
-        break;
-      case SPT_ELLIPSE:
-      case SPT_POLYGON:
-        tmpgr->pwha.x1=(tmpg0->pwha.x1*t0+tmpg1->pwha.x1*t1)>>32;
-        tmpgr->pwha.y1=(tmpg0->pwha.y1*t0+tmpg1->pwha.y1*t1)>>32;
-        tmpgr->pwha.width =(tmpg0->pwha.width *t0+tmpg1->pwha.width*t1)>>32;
-        tmpgr->pwha.height=(tmpg0->pwha.height*t0+tmpg1->pwha.height*t1)>>32;
-        break;
-      case SPT_BITMAP:
-        tmpgr->pwhu.x1=(tmpg0->pwhu.x1*t0+tmpg1->pwhu.x1*t1)>>32;
-        tmpgr->pwhu.y1=(tmpg0->pwhu.y1*t0+tmpg1->pwhu.y1*t1)>>32;
-        break;
-      case SPT_POLYLINE:
-        ptr0=&tmpg0->nu.u;
-        ptr1=&tmpg1->nu.u;
-        ptrr=&tmpgr->nu.u;
-        for (i=0;i<tmpg0->nu.num;i++) {
-          ptrr[i<<1]=(ptr0[i<<1]*t0+ptr1[i<<1]*t1)>>32;
-          ptrr[i<<1+1]=(ptr0[i<<1+1]*t0+ptr1[i<<1+1]*t1)>>32;
-        }
-        break;
-      case SPT_POLYPT:
-        tmpgr->npu.x=(tmpg0->npu.x*t0+tmpg1->npu.x*t1)>>32;
-        tmpgr->npu.y=(tmpg0->npu.y*t0+tmpg1->npu.y*t1)>>32;
-        break;
-      case SPT_BSPLINE2:
-      case SPT_BSPLINE3:
-      case SPT_BSPLINE2_CLOSED:
-      case SPT_BSPLINE3_CLOSED:
-        p0=&tmpg0->nu.u;
-        p1=&tmpg1->nu.u;
-        pr=&tmpgr->nu.u;
-        for (i=0;i<tmpg0->nu.num;i++) {
-          pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
-          pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
-          pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
-        }
-        break;
-      case SPT_MESH:
-        p0=&tmpg0->mu.u;
-        p1=&tmpg1->mu.u;
-        pr=&tmpgr->mu.u;
-        for (i=0;i<tmpg0->mu.vertex_cnt;i++) {
-          pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
-          pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
-          pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
-        }
-        break;
-      case SPT_SHIFTABLE_MESH:
-        p0=&tmpg0->pmu.u;
-        p1=&tmpg1->pmu.u;
-        pr=&tmpgr->pmu.u;
-        for (i=0;i<tmpg0->pmu.vertex_cnt;i++) {
-          pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
-          pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
-          pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
-        }
-        break;
-    }
-    tmpg0(U8 *)+=SpriteElemSize(tmpg0);
-    tmpg1(U8 *)+=SpriteElemSize(tmpg1);
-    tmpgr(U8 *)+=SpriteElemSize(tmpgr);
-  }
-  return res;
-}
-
-#help_index "Graphics/Sprite;DolDoc/Output;StdOut/DolDoc"
-public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL)
-{//Put a sprite into a document.  You can, optionally, supply a fmt string
-//for DolDoc cmd with a %d for the bin_num.
-  I64 size;
-  U8 *st;
-  Bool unlock;
-  CDocEntry *doc_e;
-  CDocBin *tmpb;
-  if (!doc && !(doc=DocPut)) return NULL;
-  unlock=DocLock(doc);
-  size=SpriteSize(elems);
-  tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
-  tmpb->size=size;
-  tmpb->data=MAlloc(size,doc->mem_task);
-  MemCpy(tmpb->data,elems,size);
-  tmpb->num=doc->cur_bin_num;
-  tmpb->use_cnt=1;
-  QueIns(tmpb,doc->bin_head.last);
-  if (fmt)
-    st=MStrPrint(fmt,doc->cur_bin_num++);
-  else
-    st=MStrPrint("$SP,\"\",BI=%d$",doc->cur_bin_num++);
-  doc_e=DocPrint(doc,"%s",st);
-  Free(st);
-  doc_e->bin_data=tmpb;
-  if (doc_e && doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
-    tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
-  if (unlock)
-    DocUnlock(doc);
-  return doc_e;
-}
-
-public CDocEntry *Sprite(U8 *elems,U8 *fmt=NULL)
-{//Put sprite to the command-line, DocPut.
-//If you set fmt, then include dollars ("$SP ...$") and leave %d for num.
-  CDoc *doc;
-  if (doc=DocPut)
-    return DocSprite(doc,elems,fmt);
-  return NULL;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/GrTextBase.HC.HTML b/public/Wb/Home/Src/Adam/Gr/GrTextBase.HC.HTML deleted file mode 100755 index 862ffad..0000000 --- a/public/Wb/Home/Src/Adam/Gr/GrTextBase.HC.HTML +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - - - - -
-#help_index "TextBase Layer;Char/TextBase Layer"
-#help_file "::/Doc/TextBase"
-
-asm {
-//************************************
-_TEXT_CHAR::
-//Bool TextChar(CTask *task,Bool allow_border=FALSE,I64 x,I64 y,I64 d);
-//Must be called 30fps in Fs->draw_it() callback.
-        PUSH    RBP
-        MOV     RBP,RSP
-        MOV     RCX,U64 SF_ARG1[RBP]
-        MOV     RBX,U64 CTask.scroll_x[RCX]
-        SAR     RBX,3
-        ADD     RBX,U64 SF_ARG3[RBP]
-        MOV     RAX,U64 CTask.scroll_y[RCX]
-        SAR     RAX,3
-        ADD     RAX,U64 SF_ARG4[RBP]
-
-        TEST    U8 SF_ARG2[RBP],0xFF
-        JNZ     @@10
-
-//Border not allowed
-        TEST    RBX,RBX         //Check X
-        JS      @@05
-        ADD     RBX,U64 CTask.win_left[RCX]
-        CMP     RBX,U64 CTask.win_right[RCX]
-        JG      @@05
-        TEST    RBX,RBX
-        JS      @@05
-        CMP     RBX,TEXT_COLS
-        JGE     @@05
-        TEST    RAX,RAX         //Check Y
-        JS      @@05
-        ADD     RAX,U64 CTask.win_top[RCX]
-        CMP     RAX,U64 CTask.win_bottom[RCX]
-        JG      @@05
-        TEST    RAX,RAX
-        JS      @@05
-        CMP     RAX,TEXT_ROWS
-        JGE     @@05
-        JMP     @@15
-
-@@05:   XOR     RAX,RAX         //return FALSE
-        POP     RBP
-        RET1    40
-
-//Border allowed
-@@10:   MOV     RDX,-1          //Check X
-        CMP     RBX,RDX
-        JL      @@05
-        ADD     RBX,U64 CTask.win_left[RCX]
-        MOV     RDX,U64 CTask.win_right[RCX]
-        INC     RDX
-        CMP     RBX,RDX
-        JG      @@05
-        TEST    RBX,RBX
-        JS      @@05
-        CMP     RBX,TEXT_COLS
-        JGE     @@05
-        MOV     RDX,-1          //Check Y
-        CMP     RAX,RDX
-        JL      @@05
-        ADD     RAX,U64 CTask.win_top[RCX]
-        MOV     RDX,U64 CTask.win_bottom[RCX]
-        INC     RDX
-        CMP     RAX,RDX
-        JG      @@05
-        TEST    RAX,RAX
-        JS      @@05
-        CMP     RAX,TEXT_ROWS
-        JGE     @@05
-
-@@15:   IMUL2   RAX,TEXT_COLS
-        ADD     RBX,RAX
-        SHL     RBX,2
-        ADD     RBX,U64 [&gr.text_base]
-        MOV     RAX,U64 SF_ARG5[RBP]
-        MOV     U32 [RBX],EAX
-
-        MOV     RAX,TRUE
-        POP     RBP
-        RET1    40
-//************************************
-_TEXT_LEN_STR::
-//Bool TextLenStr(CTask *task,I64 x,I64 y,I64 len,I64 attr,U8 *s)
-//Must be called 30fps in Fs->draw_it() callback.
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-        MOV     RBX,U64 SF_ARG1[RBP]
-        MOV     RSI,U64 SF_ARG6[RBP]
-        MOV     RDI,U64 CTask.scroll_x[RBX]
-        SAR     RDI,3
-        ADD     RDI,U64 SF_ARG2[RBP]
-        MOV     RCX,U64 SF_ARG4[RBP]
-
-        TEST    RDI,RDI
-        JNS     @@05
-        ADD     RCX,RDI
-        SUB     RSI,RDI
-        XOR     RDI,RDI
-@@05:   ADD     RDI,U64 CTask.win_left[RBX]
-        MOV     RDX,RCX
-        ADD     RDX,RDI
-        DEC     RDX
-        CMP     RDX,U64 CTask.win_right[RBX]
-        JLE     @@10
-        MOV     RAX,RDX
-        SUB     RAX,U64 CTask.win_right[RBX]
-        SUB     RDX,RAX
-        SUB     RCX,RAX
-@@10:   TEST    RDI,RDI
-        JNS     @@15
-        ADD     RCX,RDI
-        SUB     RSI,RDI
-        XOR     RDI,RDI
-@@15:   INC     RDX
-        SUB     RDX,TEXT_COLS
-        JLE     @@20
-        SUB     RCX,RDX
-@@20:   CMP     RCX,1
-        JL      @@30
-
-        MOV     RAX,U64 CTask.scroll_y[RBX]
-        SAR     RAX,3
-        ADD     RAX,U64 SF_ARG3[RBP]
-        TEST    RAX,RAX
-        JS      @@30
-        ADD     RAX,U64 CTask.win_top[RBX]
-        CMP     RAX,U64 CTask.win_bottom[RBX]
-        JG      @@30
-        TEST    RAX,RAX
-        JS      @@30
-        CMP     RAX,TEXT_ROWS
-        JGE     @@30
-
-        IMUL2   RAX,TEXT_COLS
-        ADD     RDI,RAX
-        SHL     RDI,2
-        ADD     RDI,U64 [&gr.text_base]
-        MOV     RAX,U64 SF_ARG5[RBP]
-@@25:   LODSB
-        STOSD
-        DEC     RCX
-        JNZ     @@25
-
-        POP     RDI
-        POP     RSI
-        MOV     RAX,TRUE
-        POP     RBP
-        RET1    48
-
-@@30:   POP     RDI
-        POP     RSI
-        XOR     RAX,RAX
-        POP     RBP
-        RET1    48
-//************************************
-_TEXT_LEN_ATTR_STR::
-//Bool TextLenAttrStr(CTask *task,I64 x,I64 y,I64 len,U32 *_attr)
-//Must be called 30fps in Fs->draw_it() callback.
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-        MOV     RBX,U64 SF_ARG1[RBP]
-        MOV     RSI,U64 SF_ARG5[RBP]
-        MOV     RDI,U64 CTask.scroll_x[RBX]
-        SAR     RDI,3
-        ADD     RDI,U64 SF_ARG2[RBP]
-        MOV     RCX,U64 SF_ARG4[RBP]
-
-        TEST    RDI,RDI
-        JNS     @@05
-        ADD     RCX,RDI
-        SHL     RDI,2
-        SUB     RSI,RDI
-        XOR     RDI,RDI
-@@05:   ADD     RDI,U64 CTask.win_left[RBX]
-        MOV     RDX,RCX
-        ADD     RDX,RDI
-        DEC     RDX
-        CMP     RDX,U64 CTask.win_right[RBX]
-        JLE     @@10
-        MOV     RAX,RDX
-        SUB     RAX,U64 CTask.win_right[RBX]
-        SUB     RDX,RAX
-        SUB     RCX,RAX
-@@10:   TEST    RDI,RDI
-        JNS     @@15
-        ADD     RCX,RDI
-        SHL     RDI,2
-        SUB     RSI,RDI
-        XOR     RDI,RDI
-@@15:   INC     RDX
-        SUB     RDX,TEXT_COLS
-        JLE     @@20
-        SUB     RCX,RDX
-@@20:   CMP     RCX,1
-        JL      @@30
-
-        MOV     RAX,U64 CTask.scroll_y[RBX]
-        SAR     RAX,3
-        ADD     RAX,U64 SF_ARG3[RBP]
-        TEST    RAX,RAX
-        JS      @@30
-        ADD     RAX,U64 CTask.win_top[RBX]
-        CMP     RAX,U64 CTask.win_bottom[RBX]
-        JG      @@30
-        TEST    RAX,RAX
-        JS      @@30
-        CMP     RAX,TEXT_ROWS
-        JGE     @@30
-
-        IMUL2   RAX,TEXT_COLS
-        ADD     RDI,RAX
-        SHL     RDI,2
-        ADD     RDI,U64 [&gr.text_base]
-@@25:   MOVSD
-        DEC     RCX
-        JNZ     @@25
-
-        POP     RDI
-        POP     RSI
-        MOV     RAX,TRUE
-        POP     RBP
-        RET1    40
-
-@@30:   POP     RDI
-        POP     RSI
-        XOR     RAX,RAX
-        POP     RBP
-        RET1    40
-//************************************
-_TEXT_LEN_ATTR:://Bool TextLenAttr(CTask *task,I64 x,I64 y,I64 len,I64 attr)
-//Must be called 30fps in Fs->draw_it() callback.
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-        MOV     RBX,U64 SF_ARG1[RBP]
-        MOV     RDI,U64 CTask.scroll_x[RBX]
-        SAR     RDI,3
-        ADD     RDI,U64 SF_ARG2[RBP]
-        MOV     RCX,U64 SF_ARG4[RBP]
-
-        TEST    RDI,RDI
-        JNS     @@05
-        ADD     RCX,RDI
-        XOR     RDI,RDI
-@@05:   ADD     RDI,U64 CTask.win_left[RBX]
-        MOV     RDX,RCX
-        ADD     RDX,RDI
-        DEC     RDX
-        CMP     RDX,U64 CTask.win_right[RBX]
-        JLE     @@10
-        MOV     RAX,RDX
-        SUB     RAX,U64 CTask.win_right[RBX]
-        SUB     RDX,RAX
-        SUB     RCX,RAX
-@@10:   TEST    RDI,RDI
-        JNS     @@15
-        ADD     RCX,RDI
-        XOR     RDI,RDI
-@@15:   INC     RDX
-        SUB     RDX,TEXT_COLS
-        JLE     @@20
-        SUB     RCX,RDX
-@@20:   CMP     RCX,1
-        JL      @@35
-
-        MOV     RAX,U64 CTask.scroll_y[RBX]
-        SAR     RAX,3
-        ADD     RAX,U64 SF_ARG3[RBP]
-        TEST    RAX,RAX
-        JS      @@35
-        ADD     RAX,U64 CTask.win_top[RBX]
-        CMP     RAX,U64 CTask.win_bottom[RBX]
-        JG      @@35
-        TEST    RAX,RAX
-        JS      @@35
-        CMP     RAX,TEXT_ROWS
-        JGE     @@35
-
-        IMUL2   RAX,TEXT_COLS
-        ADD     RDI,RAX
-        SHL     RDI,2
-        ADD     RDI,U64 [&gr.text_base]
-        MOV     RBX,U64 SF_ARG5[RBP]
-        MOV     RSI,RDI
-@@25:   LODSD
-        TEST    AL,AL
-        JNZ     @@30
-        MOV     RAX,RBX
-        STOSD
-        DEC     RCX
-        JNZ     @@25
-
-@@30:   POP     RDI
-        POP     RSI
-        MOV     RAX,TRUE
-        POP     RBP
-        RET1    40
-
-@@35:   POP     RDI
-        POP     RSI
-        XOR     RAX,RAX
-        POP     RBP
-        RET1    40
-}
-public _extern _TEXT_CHAR Bool TextChar(CTask *task,Bool allow_border=FALSE,
-I64 x,I64 y,I64 d); //Plot char. 30fps in Fs->draw_it() callback.
-public _extern _TEXT_LEN_STR Bool TextLenStr(CTask *task,I64 x,I64 y,I64 len,
-I64 attr,U8 *s); //Plot str with len.  30fps in Fs->draw_it() callback.
-public _extern _TEXT_LEN_ATTR_STR Bool TextLenAttrStr(CTask *task,I64 x,I64 y,
-I64 len,U32 *_attr); //Plot attr str with len.  30fps in Fs->draw_it() callback.
-public _extern _TEXT_LEN_ATTR Bool TextLenAttr(CTask *task,I64 x,I64 y,I64 len,
-I64 attr); //Plot attrs with len.  30fps in Fs->draw_it() callback.
-
-public U0 TextPrint(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...)
-{//Plot chars. 30fps in Fs->draw_it() callback.
-//You probably want GrPrint() or just Print().
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
-  TextLenStr(task,x,y,StrLen(buf),attr<<8,buf);
-  Free(buf);
-}
-
-public U0 TextBorder(CTask *task=NULL,
-        I64 l,I64 r,I64 t,I64 b,I64 attr,Bool solid)
-{//Plot border square. 30fps in Fs->draw_it() callback.
-//Draws window borders or DolDoc text bttn borders.
-  //Set task=sys_winmgr_task for no clipping.
-  I64 i;
-  if (!task) task=Fs;
-  attr<<=8;
-  TextChar(task,,l-1,t-1,text.border_chars[6+solid]+attr);
-  TextChar(task,,r+1,t-1,text.border_chars[8+solid]+attr);
-  TextChar(task,,l-1,b+1,text.border_chars[10+solid]+attr);
-  TextChar(task,,r+1,b+1,text.border_chars[12+solid]+attr);
-  for (i=l;i<=r;i++) {
-    TextChar(task,,i,t-1,text.border_chars[2+solid]+attr);
-    TextChar(task,,i,b+1,text.border_chars[2+solid]+attr);
-  }
-  for (i=t;i<=b;i++) {
-    TextChar(task,,l-1,i,text.border_chars[4+solid]+attr);
-    TextChar(task,,r+1,i,text.border_chars[4+solid]+attr);
-  }
-}
-
-public U0 TextRect(I64 l,I64 r,I64 t,I64 b,I64 d)
-{//Fill text rect. 30fps in Fs->draw_it() callback.
-  I64 y,w;
-  if (l>r || t>b) return;
-  if (t<0) t=0;
-  if (b>=TEXT_ROWS) b=TEXT_ROWS-1;
-  if (l<0) l=0;
-  if (r>=TEXT_COLS) r=TEXT_COLS-1;
-  if (w=r-l+1)
-    for (y=t;y<=b;y++)
-      MemSetU32(gr.text_base(U8 *)+(y*TEXT_COLS+l)*sizeof(U32),d,w);
-}
-
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/MakeGr.HC.HTML b/public/Wb/Home/Src/Adam/Gr/MakeGr.HC.HTML deleted file mode 100755 index 7914c17..0000000 --- a/public/Wb/Home/Src/Adam/Gr/MakeGr.HC.HTML +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-
-#include "GrInitA"
-#include "Gr.HH"
-#include "GrExt"
-#include "GrGlbls"
-#include "GrTextBase"
-#include "GrAsm"
-#include "GrPalette"
-#include "GrDC"
-#include "GrInitB"
-#include "GrMath"
-#include "GrScrn"
-#include "GrBitMap"
-#include "GrPrimatives"
-#include "GrComposites"
-#include "ScrnCast"
-
-#define SPE_ABORT       (-1)
-#define SPE_EXIT        0
-#define SPE_CONT        1
-#include "SpriteNew"
-#include "GrSpritePlot"
-#include "SpriteMesh"
-#include "SpriteBitMap"
-#include "SpriteCode"
-#include "SpriteSideBar"
-#include "SpriteEd"
-#include "SpriteMain"
-
-#include "GrEnd"
-
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/ScrnCast.HC.HTML b/public/Wb/Home/Src/Adam/Gr/ScrnCast.HC.HTML deleted file mode 100755 index 83affc4..0000000 --- a/public/Wb/Home/Src/Adam/Gr/ScrnCast.HC.HTML +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - -
-#help_index "ScrnCast;Graphics/Device Contexts;Graphics/GR Files"
-
-#define MV_FILE_MAX     0x007FF000
-
-public I64 GR2MV(U8 *print_fmt="VID%03d.MV",
-        U8 *files_find_mask,U8 *fu_flags=NULL)
-{/*Merge GR lst to MV file.
-"+d" will delete GR list files.
-*/
-  I64 fuf_flags=0,file_num=0,size;
-  CDirEntry *tmpde,*tmpde1;
-  U8 *base,*dst,*src,*st;
-  CDC *dc,*dc_base=DCNew(GR_WIDTH,GR_HEIGHT);
-  CDate cdt;
-  Bool old_silent;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
-  if (progress1_max=LinkedLstCnt(tmpde1)) {
-    dst=base=MAlloc(MV_FILE_MAX);
-    while (tmpde) {
-      dc=GRRead(tmpde->full_name);
-      GrBlot(dc_base,dc->x0,dc->y0,dc);
-      if (dst+GR_FILE_MAX>base+MV_FILE_MAX) {
-        st=MStrPrint(print_fmt,file_num++);
-        FileWrite(st,base,dst-base);
-        Free(st);
-        dst=base;
-
-        cdt=dc->cdt;
-        dc=DCCopy(dc_base);
-        dc->cdt=cdt;
-      }
-      src=DCSave(dc,&size);
-      DCDel(dc);
-      MemCpy(dst,src,size);
-      dst+=size;
-      Free(src);
-      if (fuf_flags&FUF_DEL) {
-        old_silent=Silent;
-        Del(tmpde->full_name);
-        Silent(old_silent);
-      }
-      progress1++;
-      tmpde=tmpde->next;
-    }
-    if (dst>base) {
-      st=MStrPrint(print_fmt,file_num++);
-      FileWrite(st,base,dst-base);
-      Free(st);
-    }
-    Free(base);
-  }
-  progress1=progress1_max=0;
-  DirTreeDel(tmpde1);
-  DCDel(dc_base);
-  return file_num;
-}
-
-#help_index "ScrnCast;Snd/AU Files"
-public U0 SndShift(CSndData *head,F64 dt=0)
-{//Shift CSndData in time.
-  CSndData *tmpsd,*tmpsd1;
-  if (dt) {
-    tmpsd=head->next;
-    while (tmpsd!=head) {
-      tmpsd1=tmpsd->next;
-      tmpsd->tS-=dt;
-      if (tmpsd->tS<tmpsd->last->tS) {
-        QueRem(tmpsd);
-        Free(tmpsd);
-      }
-      tmpsd=tmpsd1;
-    }
-  }
-}
-
-public I64 AUWrite(U8 *filename,CSndData *head,CDate *t0_now,F64 t0_tS)
-{//Write AU file.
-  CSndData *tmpsd;
-  CAUData *base,*dst;
-  I64 size=(1+QueCnt(head))*sizeof(CAUData);
-  U8 *st=ExtDft(filename,"AU");
-  base=dst=MAlloc(size);
-  tmpsd=head;
-  do {
-    dst->cdt=t0_now(I64)+ToI64(CDATE_FREQ*(tmpsd->tS-t0_tS));
-    dst->ona=tmpsd->ona;
-    dst++;
-    tmpsd=tmpsd->next;
-  } while (tmpsd!=head);
-  FileWrite(st,base,dst(U8 *)-base(U8 *));
-  Free(base);
-  Free(st);
-  return size;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteBitMap.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteBitMap.HC.HTML deleted file mode 100755 index 46cb9ac..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteBitMap.HC.HTML +++ /dev/null @@ -1,701 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-
-#define SPBM_EXIT               0
-#define SPBM_MAIN_MENU          1
-#define SPBM_COLOR              2
-#define SPBM_DITHER_COLOR       3
-#define SPBM_WIDTH              4
-#define SPBM_PT                 5
-#define SPBM_LINE               6
-#define SPBM_ARROW              7
-#define SPBM_RECT               8
-#define SPBM_CIRCLE             9
-#define SPBM_TEXT               10
-#define SPBM_TEXT_BOX           11
-#define SPBM_TEXT_DIAMOND       12
-#define SPBM_FLOOD_FILL         13
-#define SPBM_FLOOD_FILL_NOT     14
-#define SPBM_POLYLINE           15
-#define SPBM_POLYPT             16
-#define SPBM_COPY               17
-#define SPBM_DELETE             18
-#define SPBM_PASTE              19
-#define SPBM_PASTE_TRANSPARENT  20
-#define SPBM_FIND_AND_REPLACE   21
-#define SPBM_TRIM_TO_EXTENTS    22
-#define SPBM_ADD_OUTLINE        23
-#define SPBM_ETCH               24
-#define SPBM_UNDO               25
-#define SPBM_SAVE_GR            26
-
-U0 GrInit4()
-{
-  DefineLstLoad("ST_SPRITE_BITMAP_MENU",
-        "Exit\0Main Menu\0Color\0Dither Color\0Width\0Point\0Line\0Arrow\0"
-        "Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
-        "Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
-        "Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0"
-        "Etch\0Undo\0Save GR\0");
-}
-GrInit4;
-
-I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
-{
-  I64 res;
-  U8 *st1,*st2,buf[STR_LEN];
-  CDoc *doc=DocNew;
-
-  Color2Str(buf,color);
-  if (color&ROPF_DITHER) {
-    st1="";
-    st2=buf;
-  } else {
-    st1=buf;
-    st2="";
-  }
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Sprite BitMap Menu\"$\n"
-        "$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.DD.Z\"$\n"
-        "\n$LTBLUE$$MU-UL,\"Color        %s\",LE=SPBM_COLOR$\n"
-        "$MU-UL,\"Dither Color %s\",LE=SPBM_DITHER_COLOR$\n"
-        "$MU-UL,\"Width        %d\",LE=SPBM_WIDTH$\n"
-        "$MU-UL,\"Find & Replace Color\",LE=SPBM_FIND_AND_REPLACE$\n"
-        "$MU-UL,\"Trim to Extents\",LE=SPBM_TRIM_TO_EXTENTS$\n"
-        "$MU-UL,\"Add Outline\",LE=SPBM_ADD_OUTLINE$\n"
-        "$MU-UL,\"Etch\",LE=SPBM_ETCH$\n"
-        "\n$MU-UL,\"Point\",LE=SPBM_PT$\n"
-        "$MU-UL,\"Line\",LE=SPBM_LINE$\n"
-        "$MU-UL,\"Arrow\",LE=SPBM_ARROW$\n"
-        "$MU-UL,\"Rect\",LE=SPBM_RECT$\n"
-        "$MU-UL,\"Circle\",LE=SPBM_CIRCLE$\n"
-        "$MU-UL,\"Text\",LE=SPBM_TEXT$\n"
-        "$MU-UL,\"Text Box\",LE=SPBM_TEXT_BOX$\n"
-        "$MU-UL,\"Text Diamond\",LE=SPBM_TEXT_DIAMOND$\n"
-        "$MU-UL,\"Flood Fill\",LE=SPBM_FLOOD_FILL$\n"
-        "$MU-UL,\"Flood Fill Not Color\",LE=SPBM_FLOOD_FILL_NOT$\n"
-        "$MU-UL,\"PolyLine\",LE=SPBM_POLYLINE$\n"
-        "$MU-UL,\"PolyPoint\",LE=SPBM_POLYPT$\n"
-        "\n$MU-UL,\"Copy to Clip\",LE=SPBM_COPY$\n"
-        "$MU-UL,\"Delete to Clip\",LE=SPBM_DELETE$\n"
-        "$MU-UL,\"Paste Clip\",LE=SPBM_PASTE$\n"
-        "$MU-UL,\"Paste Transparent Clip\",LE=SPBM_PASTE_TRANSPARENT$\n"
-        "\n$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GR$\n"
-        "\n$MU-UL,\"Undo\",LE=SPBM_UNDO$\n"
-        "\n$PURPLE$$MU-UL,\"+] Sprite Main Menu\",LE=SPBM_MAIN_MENU$$LTBLUE$\n"
-        "$MU-UL,\"Exit  Sprite\",LE=SPBM_EXIT$\n"
-        "$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$\n"
-        "\nRight-Click to get back to this menu.",st1,st2,width);
-  res=PopUpMenu(doc);
-  DocDel(doc);
-  return res;
-}
-
-U0 GrBitMapEdPrepPersistentDC(CDC *dc,I64 xx1,I64 yy1,CDC *img)
-{
-  DCFill(dc);
-  GrBlot(dc,xx1,yy1,img);
-}
-
-U0 GrBitMapEdTrimToExtents(CDC **_img,I64 *_xx1,I64 *_yy1,
-        I64 *_xx2,I64 *_yy2,CColorROPU32 bkcolor)
-{
-  CDC *img=*_img;
-  I64 i,c,
-        x1=0,y1=0,x2=img->width-1,y2=img->height-1; //inclusive
-  while (y1<y2) {
-    for (i=x1;i<=x2;i++) {
-      c=GrPeek(img,i,y1);
-      if (c!=bkcolor&&c!=TRANSPARENT) goto tr_y2;
-    }
-    y1++;
-  }
-
-  tr_y2:
-  while (y1<y2) {
-    for (i=x1;i<=x2;i++) {
-      c=GrPeek(img,i,y2);
-      if (c!=bkcolor&&c!=TRANSPARENT) goto tr_x1;
-    }
-    y2--;
-  }
-
-  tr_x1:
-  while (x1<x2) {
-    for (i=y1;i<=y2;i++) {
-      c=GrPeek(img,x1,i);
-      if (c!=bkcolor&&c!=TRANSPARENT) goto tr_x2;
-    }
-    x1++;
-  }
-
-  tr_x2:
-  while (x1<x2) {
-    for (i=y1;i<=y2;i++) {
-      c=GrPeek(img,x2,i);
-      if (c!=bkcolor&&c!=TRANSPARENT) goto tr_done;
-    }
-    x2--;
-  }
-
-  tr_done:
-  *_img=DCExt(img,x1,y1,x2,y2);
-  *_xx1+=x1;                *_yy1+=y1;
-  *_xx2+=x2-(img->width-1); *_yy2+=y2-(img->height-1); //not inclusive
-  DCDel(img);
-}
-
-U0 GrBitMapEdAddOutline(CDC *img,I64 width,
-        CColorROPU32 color,CColorROPU32 bkcolor)
-{
-  I64 i,j,k,c;
-  CColorROPU32 old_color;
-  CDC *src;
-  if (img->width && img->height) {
-    old_color=img->color;
-    img->color=color;
-    while (width-->0) {
-      src=DCExt(img,0,0,img->width-1,img->height-1);
-      for (i=0;i<img->height;i++)
-        for (j=0;j<img->width;j++)
-          if (GrPeek(src,j,i)==bkcolor)
-            for (k=0;k<8;k++) {
-              c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]);
-              if (c>=0 && c!=bkcolor) {
-                GrPlot(img,j,i);
-                break;
-              }
-            }
-      DCDel(src);
-    }
-    img->color=old_color;
-  }
-}
-
-U0 GrBitMapEdEtch(CDC *img,I64 width,CColorROPU32 bkcolor)
-{
-  I64 i,j,k,c;
-  CColorROPU32 old_color;
-  CDC *src;
-  if (img->width && img->height) {
-    old_color=img->color;
-    img->color=bkcolor;
-    while (width-->0) {
-      src=DCExt(img,0,0,img->width-1,img->height-1);
-      for (i=0;i<img->height;i++)
-        for (j=0;j<img->width;j++)
-          if (GrPeek(src,j,i)!=bkcolor)
-            for (k=0;k<8;k++) {
-              c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]);
-              if (c<0 || c==bkcolor) {
-                GrPlot(img,j,i);
-                break;
-              }
-            }
-      DCDel(src);
-    }
-    img->color=old_color;
-  }
-}
-
-I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
-        I64 *_xx2,I64 *_yy2,CDC **_img,CColorROPU32 bkcolor)
-{
-  I64 i,j,mode=SPBM_LINE,color=BLACK,width=1,msg_code,arg1,arg2,x1,y1,x11,y11,
-        x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2,
-        old_de_flags=doc_e->de_flags;
-  Bool down=FALSE;
-  U8 *st=NULL;
-  CEdFileName filename;
-  CDC *img=*_img,
-        *clip=NULL,*undo=NULL,*dc2;
-  SettingsPush; //See SettingsPush
-
-  doc_e->de_flags|=DOCEF_DONT_DRAW;
-  goto bm_menu;
-
-  while (TRUE) {
-    if (kbd.scan_code&SCF_CTRL)//grab scroll update?
-      GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-
-    dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-    dc->thick=1;
-    GrBorder(dc,xx1-1,yy1-1,xx2,yy2);//This is done little bit too often.
-
-    while (msg_code=ScanMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
-          1<<MSG_MS_R_DOWN|1<<MSG_MS_MOVE|1<<MSG_KEY_DOWN)) {
-      switch (msg_code) {
-        case MSG_KEY_DOWN:
-          switch (arg1) {
-            case CH_SHIFT_ESC:
-              res=SPE_ABORT;
-              goto bm_key_up_done;
-            case CH_ESC:
-              res=SPE_CONT;
-              goto bm_key_up_done;
-            case 'c': //eye-dropper
-              dc2=DCScrnCapture(FALSE);
-              color=GrPeek(dc2,ms.pos.x,ms.pos.y)^15;//Mouse cursor is XORed.
-              DCDel(dc2);
-              break;
-            case 't': //Set to transparent color
-              color=TRANSPARENT;
-              break;
-          }
-          break;
-
-        case MSG_MS_R_DOWN:
-bm_menu:
-          DCFill(dc);
-          StrCpy(Fs->task_title,"Sprite BitMap Menu");
-          i=PopUpSpriteBitMap(color,width);
-          if (i>=0)
-            StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU"));
-          switch (i) {
-            case DOCM_CANCEL:
-              res=SPE_ABORT;
-              goto bm_done;
-            case SPBM_EXIT:
-              res=SPE_EXIT;
-              goto bm_done;
-            case SPBM_MAIN_MENU:
-              res=SPE_CONT;
-              goto bm_done;
-            case SPBM_COLOR:
-              i=PopUpColor(,,FALSE);
-              if (i>=0) color=i;
-              goto bm_menu;
-            case SPBM_FIND_AND_REPLACE:
-              i=PopUpColor("Find Color\n",,FALSE);
-              if (i>=0) {
-                j=PopUpColor("Replace Color\n",,FALSE);
-                if (j>=0) {
-                  DCColorChg(img,i,j);
-                  GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                }
-              }
-              goto bm_menu;
-            case SPBM_TRIM_TO_EXTENTS:
-              GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              goto bm_menu;
-            case SPBM_ADD_OUTLINE:
-              i=PopUpRangeI64(1,16,1,"Outline Width\n");
-              if (i>=0) {
-                GrBitMapEdAddOutline(img,i,color,bkcolor);
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              }
-              goto bm_menu;
-            case SPBM_ETCH:
-              i=PopUpRangeI64(1,16,1,"Etch Width\n");
-              if (i>=0) {
-                GrBitMapEdEtch(img,i,bkcolor);
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              }
-              goto bm_menu;
-            case SPBM_SAVE_GR:
-              *filename.name=0;
-              if (DocForm(&filename) && *filename.name)
-                GRWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);
-              goto bm_menu;
-            case SPBM_DITHER_COLOR:
-              i=PopUpColorDither;
-              if (i>=0) color=i;
-              goto bm_menu;
-            case SPBM_WIDTH:
-              i=PopUpRangeI64(1,16,1,"Thick\n");
-              if (i>=0) width=i;
-              goto bm_menu;
-            case SPBM_UNDO:
-              if (undo) {
-                DCFill(img,bkcolor);
-                img->color=ROP_EQU;
-                GrBlot(img,0,0,undo);
-                DCDel(undo);
-                undo=NULL;
-              }
-              goto bm_menu;
-            case SPBM_PT:
-            case SPBM_LINE:
-            case SPBM_ARROW:
-            case SPBM_RECT:
-            case SPBM_CIRCLE:
-            case SPBM_FLOOD_FILL:
-            case SPBM_FLOOD_FILL_NOT:
-            case SPBM_POLYPT:
-            case SPBM_POLYLINE:
-            case SPBM_COPY:
-            case SPBM_DELETE:
-            case SPBM_PASTE:
-            case SPBM_PASTE_TRANSPARENT:
-              mode=i;
-              break;
-            case SPBM_TEXT:
-            case SPBM_TEXT_BOX:
-            case SPBM_TEXT_DIAMOND:
-              Free(st);
-              st=PopUpGetStr("Enter text and press <ESC>.\n");
-              if (st && *st)
-                mode=i;
-              else
-                goto bm_menu;
-              break;
-          }
-          DCDel(undo);
-          undo=DCExt(img,0,0,img->width-1,img->height-1);
-          undo->bkcolor=bkcolor;
-          Refresh(2,TRUE);      //Let popup close
-          GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-          down=FALSE;
-          break;
-        case MSG_MS_L_DOWN:
-          switch (mode) {
-            case SPBM_PT:
-              img->color=color;
-              img->thick=width;
-              GrPlot3(img,arg1-xx1,arg2-yy1,0);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-            start:
-              if (down)
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              x1=arg1; y1=arg2;
-              down=TRUE;
-              dc->color=color;
-              dc->thick=width;
-              case SPBM_LINE:
-                GrLine3(dc,x1,y1,0,arg1,arg2,0);
-                break;
-              case SPBM_ARROW:
-                GrArrow3(dc,x1,y1,0,arg1,arg2,0);
-                break;
-              case SPBM_RECT:
-                GrRect(dc,x1,y1,1,1);
-                break;
-              case SPBM_CIRCLE:
-                GrCircle3(dc,x1,y1,0,1);
-                break;
-              case SPBM_COPY:
-              case SPBM_DELETE:
-                dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-                dc->thick=1;
-                GrBorder(dc,x1,y1,x1,y1);
-                break;
-            end:
-              break;
-            case SPBM_PASTE:
-            case SPBM_PASTE_TRANSPARENT:
-              if (clip) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                if (mode==SPBM_PASTE) {
-                  clip->flags|=DCF_NO_TRANSPARENTS;
-                  GrBlot(dc,arg1,arg2,clip);
-                  clip->flags&=~DCF_NO_TRANSPARENTS;
-                } else {
-                  dc2=DCCopy(clip);
-                  DCColorChg(dc2,bkcolor);
-                  GrBlot(dc,arg1,arg2,dc2);
-                  DCDel(dc2);
-                }
-              }
-              break;
-            case SPBM_TEXT:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrPrint(dc,arg1,arg2,"%s",st);
-              break;
-            case SPBM_TEXT_BOX:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrTextBox3(dc,arg1,arg2,0,st);
-              break;
-            case SPBM_TEXT_DIAMOND:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrTextDiamond3(dc,arg1,arg2,0,st);
-              break;
-            case SPBM_FLOOD_FILL:
-              img->color=color;
-              GrFloodFill(img,arg1-xx1,arg2-yy1);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-            case SPBM_FLOOD_FILL_NOT:
-              img->color=color;
-              GrFloodFill(img,arg1-xx1,arg2-yy1,TRUE);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-            case SPBM_POLYLINE:
-              if (!down) {
-                x1=arg1; y1=arg2;
-                down=TRUE;
-                dc->color=color;
-                dc->thick=width;
-                GrLine3(dc,x1,y1,0,arg1,arg2,0);
-              }
-              break;
-            case SPBM_POLYPT:
-              x1=arg1; y1=arg2;
-              down=TRUE;
-              img->color=color;
-              img->thick=width;
-              GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-          }
-          break;
-        case MSG_MS_MOVE:
-          switch (mode) {
-            case SPBM_LINE:
-            case SPBM_ARROW:
-            case SPBM_POLYLINE:
-              if (down) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                dc->color=color;
-                dc->thick=width;
-                if (mode==SPBM_ARROW)
-                  GrArrow3(dc,x1,y1,0,arg1,arg2,0);
-                else
-                  GrLine3(dc,x1,y1,0,arg1,arg2,0);
-              }
-              break;
-            case SPBM_RECT:
-              if (down) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                if (x1<arg1) {
-                  x11=x1;
-                  x22=arg1;
-                } else {
-                  x11=arg1;
-                  x22=x1;
-                }
-                if (y1<arg2) {
-                  y11=y1;
-                  y22=arg2;
-                } else {
-                  y11=arg2;
-                  y22=y1;
-                }
-                dc->color=color;
-                GrRect(dc,x11,y11,x22-x11+1,y22-y11+1);
-              }
-              break;
-            case SPBM_COPY:
-            case SPBM_DELETE:
-              if (down) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                if (x1<arg1) {
-                  x11=x1;
-                  x22=arg1;
-                } else {
-                  x11=arg1;
-                  x22=x1;
-                }
-                if (y1<arg2) {
-                  y11=y1;
-                  y22=arg2;
-                } else {
-                  y11=arg2;
-                  y22=y1;
-                }
-                dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-                dc->thick=1;
-                GrBorder(dc,x11,y11,x22,y22);
-              }
-              break;
-            case SPBM_CIRCLE:
-              if (down) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                dc->color=color;
-                dc->thick=width;
-                GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
-              }
-              break;
-            case SPBM_PASTE:
-            case SPBM_PASTE_TRANSPARENT:
-              if (clip) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                if (mode==SPBM_PASTE) {
-                  clip->flags|=DCF_NO_TRANSPARENTS;
-                  GrBlot(dc,arg1,arg2,clip);
-                  clip->flags&=~DCF_NO_TRANSPARENTS;
-                } else {
-                  dc2=DCCopy(clip);
-                  DCColorChg(dc2,bkcolor);
-                  GrBlot(dc,arg1,arg2,dc2);
-                  DCDel(dc2);
-                }
-              }
-              break;
-            case SPBM_TEXT:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrPrint(dc,arg1,arg2,"%s",st);
-              break;
-            case SPBM_TEXT_BOX:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrTextBox3(dc,arg1,arg2,0,st);
-              break;
-            case SPBM_TEXT_DIAMOND:
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              dc->color=color;
-              GrTextDiamond3(dc,arg1,arg2,0,st);
-              break;
-            case SPBM_POLYPT:
-              if (down) {
-                img->color=color;
-                img->thick=width;
-                GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                x1=arg1; y1=arg2;
-              }
-              break;
-          }
-          break;
-        case MSG_MS_L_UP:
-          switch (mode) {
-            case SPBM_LINE:
-            case SPBM_ARROW:
-            case SPBM_POLYPT:
-            case SPBM_POLYLINE:
-              img->color=color;
-              img->thick=width;
-              if (mode==SPBM_ARROW)
-                GrArrow3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
-              else
-                GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              if (mode==SPBM_POLYLINE) {
-                x1=arg1; y1=arg2;
-              } else
-                down=FALSE;
-              break;
-            case SPBM_RECT:
-              img->color=color;
-              if (x1<arg1) {
-                x11=x1;
-                x22=arg1;
-              } else {
-                x11=arg1;
-                x22=x1;
-              }
-              if (y1<arg2) {
-                y11=y1;
-                y22=arg2;
-              } else {
-                y11=arg2;
-                y22=y1;
-              }
-              GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
-              down=FALSE;
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-            case SPBM_COPY:
-            case SPBM_DELETE:
-              if (x1<arg1) {
-                x11=x1;
-                x22=arg1;
-              } else {
-                x11=arg1;
-                x22=x1;
-              }
-              if (y1<arg2) {
-                y11=y1;
-                y22=arg2;
-              } else {
-                y11=arg2;
-                y22=y1;
-              }
-              DCDel(clip);
-              clip=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
-              clip->bkcolor=bkcolor;
-              if (mode==SPBM_DELETE) {
-                img->color=bkcolor;
-                GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
-              }
-              goto bm_menu;
-            case SPBM_CIRCLE:
-              img->color=color;
-              img->thick=width;
-              GrCircle3(img,x1-xx1,y1-yy1,0,
-                    Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
-              down=FALSE;
-              GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              break;
-            case SPBM_PASTE:
-            case SPBM_PASTE_TRANSPARENT:
-              if (clip) {
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-                if (mode==SPBM_PASTE) {
-                  clip->flags|=DCF_NO_TRANSPARENTS;
-                  GrBlot(img,arg1-xx1,arg2-yy1,clip);
-                  clip->flags&=~DCF_NO_TRANSPARENTS;
-                } else {
-                  dc2=DCCopy(clip);
-                  DCColorChg(dc2,bkcolor);
-                  GrBlot(img,arg1-xx1,arg2-yy1,dc2);
-                  DCDel(dc2);
-                }
-                GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
-              }
-              break;
-            case SPBM_TEXT:
-              img->color=color;
-              GrPrint(img,arg1-xx1,arg2-yy1,"%s",st);
-              goto bm_menu;
-            case SPBM_TEXT_BOX:
-              img->color=color;
-              GrTextBox3(img,arg1-xx1,arg2-yy1,0,st);
-              goto bm_menu;
-            case SPBM_TEXT_DIAMOND:
-              img->color=color;
-              GrTextDiamond3(img,arg1-xx1,arg2-yy1,0,st);
-              goto bm_menu;
-          }
-          break;
-      }
-    }
-    Refresh;
-  }
-bm_key_up_done:
-  GetMsg(,,1<<MSG_KEY_UP);
-bm_done:
-  DCDel(clip);
-  DCDel(undo);
-  Free(st);
-  DCFill(dc);
-  SettingsPop;
-  doc_e->de_flags=old_de_flags;
-  *_img=img;
-  *_xx1=xx1,*_yy1=yy1,*_xx2=xx2,*_yy2=yy2;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteCode.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteCode.HC.HTML deleted file mode 100755 index e43a4cf..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteCode.HC.HTML +++ /dev/null @@ -1,634 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-
-U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
-{
-  U8 buf1[STR_LEN],buf2[STR_LEN];
-  I32 *ptr;
-  I64 i,j,k,col,width_internal;
-  CD3I32 *p;
-  CMeshTri *tri;
-  if (!doc) doc=DocPut;
-  DocPrint(doc,"%Z",tmpg->type&SPG_TYPE_MASK,"ST_SPRITE_ELEM_CODES");
-  switch (tmpg->type&SPG_TYPE_MASK) {
-    case SPT_COLOR:
-      DocPrint(doc,"{%s}",
-            Color2Str(buf1,tmpg->c.color));
-      break;
-    case SPT_DITHER_COLOR:
-      DocPrint(doc,"{%s}",
-            Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
-            tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
-      break;
-    case SPT_TRANSFORM_ON:
-      DocPrint(doc,"{ON}");
-      break;
-    case SPT_TRANSFORM_OFF:
-      DocPrint(doc,"{OFF}");
-      break;
-    case SPT_LINE:
-    case SPT_ARROW:
-    case SPT_PLANAR_SYMMETRY:
-      DocPrint(doc,"{(%d,%d),(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
-            tmpg->pp.x2,tmpg->pp.y2);
-      break;
-    case SPT_RECT:
-      DocPrint(doc,"{(%d,%d):(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
-            tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
-      break;
-    case SPT_ROTATED_RECT:
-      DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->ppa.x1,tmpg->ppa.y1,
-            tmpg->ppa.x2-tmpg->ppa.x1,tmpg->ppa.y2-tmpg->ppa.y1,
-            180/pi*Wrap(tmpg->ppa.angle));
-      break;
-    case SPT_PT:
-    case SPT_FLOOD_FILL:
-    case SPT_SHIFT:
-      DocPrint(doc,"{(%d,%d)}",tmpg->p.x1,tmpg->p.y1);
-      break;
-    case SPT_FLOOD_FILL_NOT:
-      DocPrint(doc,"{(%d,%d),TRUE}",tmpg->p.x1,tmpg->p.y1);
-      break;
-    case SPT_CIRCLE:
-      DocPrint(doc,"{(%d,%d):%d}",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
-      break;
-    case SPT_THICK:
-      DocPrint(doc,"{%d}",tmpg->t.thick);
-      break;
-    case SPT_ELLIPSE:
-      DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->pwha.x1,tmpg->pwha.y1,
-            tmpg->pwha.width,tmpg->pwha.height,180/pi*Wrap(tmpg->pwha.angle));
-      break;
-    case SPT_POLYGON:
-      DocPrint(doc,"{%d,(%d,%d):(%d,%d),%0.4f}",tmpg->pwhas.sides,
-            tmpg->pwhas.x1,tmpg->pwhas.y1,
-            tmpg->pwhas.width,tmpg->pwhas.height,
-            180/pi*Wrap(tmpg->pwhas.angle));
-      break;
-    case SPT_TEXT:
-    case SPT_TEXT_BOX:
-    case SPT_TEXT_DIAMOND:
-      DocPrint(doc,"{(%d,%d),\"%Q\"}",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
-      break;
-    case SPT_POLYLINE:
-      ptr=&tmpg->nu.u;
-      DocPrint(doc,"{");
-      for (i=0;i<tmpg->nu.num;i++,ptr+=2) {
-        DocPrint(doc,"(%d,%d)",ptr[0],ptr[1]);
-        if (i+1<tmpg->nu.num) DocPrint(doc,",");
-        if (i&3==3 && i+1<tmpg->nu.num)
-          DocPrint(doc,"\n");
-      }
-      DocPrint(doc,"}");
-      break;
-    case SPT_BSPLINE2:
-    case SPT_BSPLINE3:
-    case SPT_BSPLINE2_CLOSED:
-    case SPT_BSPLINE3_CLOSED:
-      ptr=&tmpg->nu.u;
-      DocPrint(doc,"{");
-      for (i=0;i<tmpg->nu.num;i++,ptr+=3) {
-        DocPrint(doc,"(%d,%d,%d)",ptr[0],ptr[1],ptr[2]);
-        if (i+1<tmpg->nu.num) DocPrint(doc,",");
-        if (i&3==3 && i+1<tmpg->nu.num)
-          DocPrint(doc,"\n");
-      }
-      if (tmpg->type&SPG_TYPE_MASK==SPT_BSPLINE2||
-            tmpg->type&SPG_TYPE_MASK==SPT_BSPLINE3)
-        DocPrint(doc,",FALSE}");
-      else
-        DocPrint(doc,",TRUE}");
-      break;
-    case SPT_POLYPT:
-      DocPrint(doc,"{(%d,%d),",tmpg->npu.x,tmpg->npu.y);
-      ptr=&tmpg->npu.u;
-      col=16;
-      for (i=0;i<tmpg->npu.num;i++) {
-        DocPrint(doc,"%d",BFieldExtU32(ptr,i*3,3));
-        if (++col>=64 && i+1<tmpg->npu.num) {
-          DocPrint(doc,"\n");
-          col=0;
-        }
-      }
-      DocPrint(doc,"}");
-      break;
-    case SPT_BITMAP:
-      DocPrint(doc,"{(%d,%d):(%d,%d),\n",tmpg->pwhu.x1,tmpg->pwhu.y1,
-            tmpg->pwhu.width,tmpg->pwhu.height);
-      width_internal=(tmpg->pwhu.width+7)&~7;
-      if (width_internal<80)
-        k=width_internal;
-      else
-        k=64;
-      ptr=&tmpg->pwhu.u;
-      col=0;
-      for (j=0;j<tmpg->pwhu.height;j++)
-        for (i=0;i<width_internal;i++,ptr(U8 *)++) {
-          if (i>=tmpg->pwhu.width)
-            DocPrint(doc,"_");
-          else if (*ptr(U8 *)<16)
-            DocPrint(doc,"%X",*ptr(U8 *));
-          else
-            DocPrint(doc,"%c",CH_SHIFT_SPACE);
-          if (++col>=k && (i+1<width_internal||j+1<tmpg->pwhu.height)) {
-            DocPrint(doc,"\n");
-            col=0;
-          }
-        }
-      DocPrint(doc,"}");
-      break;
-    case SPT_MESH:
-      DocPrint(doc,"{FALSE,");
-      p=&tmpg->mu.u;
-      col=0;
-      for (i=0;i<tmpg->mu.vertex_cnt;i++,p++) {
-        DocPrint(doc,"(%d,%d,%d)",p->x,p->y,p->z);
-        if (i+1<tmpg->mu.vertex_cnt) DocPrint(doc,",");
-        if (++col==4) {
-          DocPrint(doc,"\t//%d\n",i);
-          col=0;
-        }
-      }
-      DocPrint(doc,":");
-      tri=p;
-      for (i=0;i<tmpg->mu.tri_cnt;i++,tri++) {
-        DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
-              tri->nums[0],tri->nums[1],tri->nums[2]);
-        if (i+1<tmpg->mu.tri_cnt) DocPrint(doc,",");
-        if (++col>=3 && i+1<tmpg->mu.tri_cnt) {
-          DocPrint(doc,"\n");
-          col=0;
-        }
-      }
-      DocPrint(doc,"}");
-      break;
-    case SPT_SHIFTABLE_MESH:
-      DocPrint(doc,"{TRUE,(%d,%d,%d):",tmpg->pmu.x,tmpg->pmu.y,tmpg->pmu.z);
-      p=&tmpg->pmu.u;
-      col=1;
-      for (i=0;i<tmpg->pmu.vertex_cnt;i++,p++) {
-        DocPrint(doc,"(%d,%d,%d)",p->x,p->y,p->z);
-        if (i+1<tmpg->pmu.vertex_cnt) DocPrint(doc,",");
-        if (++col==4) {
-          DocPrint(doc,"\t//%d\n",i);
-          col=0;
-        }
-      }
-      DocPrint(doc,":");
-      tri=p;
-      for (i=0;i<tmpg->pmu.tri_cnt;i++,tri++) {
-        DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
-              tri->nums[0],tri->nums[1],tri->nums[2]);
-        if (i+1<tmpg->pmu.tri_cnt) DocPrint(doc,",");
-        if (++col>=3 && i+1<tmpg->pmu.tri_cnt) {
-          DocPrint(doc,"\n");
-          col=0;
-        }
-      }
-      DocPrint(doc,"}");
-      break;
-  }
-    DocPrint(doc,";\n");
-}
-
-public U0 Sprite2Code(CDoc *doc=NULL,U8 *elems)
-{//Sprite to text.
-  CSprite *tmpg=elems-offset(CSprite.start);
-  while (tmpg->type&SPG_TYPE_MASK) {
-    SpriteElem2Code(doc,tmpg);
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-  }
-}
-
-CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
-{
-  I64 i,num1,num2,size;
-  CSprite *res,g;
-  CColorROPU32 color;
-  U8 *st,*ptr;
-  CQueD3I32 headp,*tmpp,*tmpa1;
-  CQueMeshTri headt,*tmpt,*tmpt1;
-  CQueVectU8 *tmpv;
-  MemSet(&g,0,sizeof(CSprite));
-  switch (type) {
-    start:
-      case SPT_COLOR:
-      case SPT_DITHER_COLOR:
-        st=LexFirstRem(cc,"}");
-        color=Str2ColorU32(st);
-        Free(st);
-        Lex(cc); //Skip color
-        g.c.color=color.c0.color;
-        if (color&ROPF_DITHER) {
-          g.d.dither_color.u8[1]=color.c1.color;
-          g.type=SPT_DITHER_COLOR;
-        } else
-          g.type=SPT_COLOR;
-        break;
-      case SPT_TRANSFORM_ON:
-      case SPT_TRANSFORM_OFF:
-        Lex(cc); //Skip {
-        if (LexExpressionI64(cc))
-          g.type=SPT_TRANSFORM_ON;
-        else
-          g.type=SPT_TRANSFORM_OFF;
-        break;
-      case SPT_LINE:
-      case SPT_ARROW:
-      case SPT_PLANAR_SYMMETRY:
-        Lex(cc); //Skip {
-        g.type=type;
-        LexD2I32(cc,&g.pp.x1);
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        LexD2I32(cc,&g.pp.x2);
-        break;
-      case SPT_RECT:
-      case SPT_ROTATED_RECT:
-        Lex(cc); //Skip {
-        LexD2I32(cc,&g.pp.x1);
-        if (cc->token!=':')
-          LexExcept(cc,"Expecting ':' at ");
-        Lex(cc); //Skip :
-        LexD2I32(cc,&g.pp.x2);
-        g.ppa.x2+=g.pp.x1;
-        g.ppa.y2+=g.pp.y1;
-        if (cc->token==',') {
-          Lex(cc); //Skip ,
-          g.ppa.angle=pi/180*LexExpressionF64(cc);
-          g.type=SPT_ROTATED_RECT;
-        } else
-          g.type=SPT_RECT;
-        break;
-      case SPT_PT:
-      case SPT_SHIFT:
-        Lex(cc); //Skip {
-        g.type=type;
-        LexD2I32(cc,&g.p.x1);
-        break;
-      case SPT_FLOOD_FILL:
-      case SPT_FLOOD_FILL_NOT:
-        Lex(cc); //Skip {
-        LexD2I32(cc,&g.p.x1);
-        if (cc->token==',') {
-          Lex(cc); //Skip ,
-          i=LexExpressionI64(cc);
-        } else
-          i=0;
-        if (i)
-          g.type=SPT_FLOOD_FILL_NOT;
-        else
-          g.type=SPT_FLOOD_FILL;
-        break;
-      case SPT_THICK:
-        Lex(cc); //Skip {
-        g.t.thick=LexExpressionI64(cc);
-        g.type=SPT_THICK;
-        break;
-      case SPT_CIRCLE:
-        Lex(cc); //Skip {
-        g.type=SPT_CIRCLE;
-        LexD2I32(cc,&g.pr.x1);
-        if (cc->token!=':')
-          LexExcept(cc,"Expecting ':' at ");
-        Lex(cc); //Skip :
-        g.pr.radius=LexExpressionI64(cc);
-        break;
-      case SPT_POLYGON:
-        Lex(cc); //Skip {
-        g.pwhas.sides=LexExpressionI64(cc);
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-      case SPT_ELLIPSE:
-        Lex(cc); //Skip {
-        g.type=type;
-        LexD2I32(cc,&g.pwha.x1);
-        if (cc->token!=':')
-          LexExcept(cc,"Expecting ':' at ");
-        Lex(cc); //Skip :
-        LexD2I32(cc,&g.pwha.width);
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        g.pwha.angle=pi/180*LexExpressionF64(cc);
-        break;
-    end:
-      size=SpriteElemSize(&g)+offset(CSprite.start);
-      res=MAlloc(size);
-      MemCpy(res,&g,size);
-      break;
-    case SPT_TEXT:
-    case SPT_TEXT_BOX:
-    case SPT_TEXT_DIAMOND:
-      Lex(cc); //Skip {
-      g.type=type;
-      LexD2I32(cc,&g.ps.x1);
-      if (cc->token!=',')
-        LexExcept(cc,"Expecting ',' at ");
-      if (Lex(cc)==TK_STR)  //Skip ,
-        st=LexExtStr(cc);
-      else
-        LexExcept(cc,"Expecting string at ");
-      size=SpriteElemQuedBaseSize(type);
-      i=StrLen(st)+1;
-      res=MAlloc(size+i);
-      MemCpy(res,&g,size);
-      MemCpy(res(U8 *)+size,st,i);
-      Free(st);
-      break;
-    case SPT_POLYLINE:
-      Lex(cc); //Skip {
-      g.type=SPT_POLYLINE;
-      QueInit(&headp);
-      while (cc->token=='(') {
-        tmpp=CAlloc(sizeof(CQueD3I32));
-        LexD2I32(cc,&tmpp->p);
-        QueIns(tmpp,headp.last);
-        g.nu.num++;
-        if (cc->token==',')
-          Lex(cc); //Skip ,
-      }
-      if (g.nu.num<2)
-        LexExcept(cc,"Expecting point at ");
-      size=SpriteElemQuedBaseSize(SPT_POLYLINE);
-      res=MAlloc(size+g.nu.num*sizeof(CD2I32));
-      MemCpy(res,&g,size);
-      ptr=&res->nu.u;
-      tmpp=headp.next;
-      while (tmpp!=&headp) {
-        tmpa1=tmpp->next;
-        MemCpy(ptr,&tmpp->p,sizeof(CD2I32));
-        ptr+=sizeof(CD2I32);
-        Free(tmpp);
-        tmpp=tmpa1;
-      }
-      break;
-    case SPT_BSPLINE2:
-    case SPT_BSPLINE3:
-    case SPT_BSPLINE2_CLOSED:
-    case SPT_BSPLINE3_CLOSED:
-      Lex(cc); //Skip {
-      QueInit(&headp);
-      while (cc->token=='(') {
-        tmpp=CAlloc(sizeof(CQueD3I32));
-        LexD3I32(cc,&tmpp->p);
-        QueIns(tmpp,headp.last);
-        g.nu.num++;
-        if (cc->token==',')
-          Lex(cc); //Skip ,
-      }
-      if (g.nu.num<2)
-        LexExcept(cc,"Expecting point at ");
-      size=SpriteElemQuedBaseSize(type);
-      res=MAlloc(size+g.nu.num*sizeof(CD3I32));
-      if (LexExpressionI64(cc)) {
-        if (type==SPT_BSPLINE2||type==SPT_BSPLINE2_CLOSED)
-          g.type=SPT_BSPLINE2_CLOSED;
-        else
-          g.type=SPT_BSPLINE3_CLOSED;
-      } else {
-        if (type==SPT_BSPLINE2||type==SPT_BSPLINE2_CLOSED)
-          g.type=SPT_BSPLINE2;
-        else
-          g.type=SPT_BSPLINE3;
-      }
-      MemCpy(res,&g,size);
-      ptr=&res->nu.u;
-      tmpp=headp.next;
-      while (tmpp!=&headp) {
-        tmpa1=tmpp->next;
-        MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
-        ptr+=sizeof(CD3I32);
-        Free(tmpp);
-        tmpp=tmpa1;
-      }
-      break;
-    case SPT_POLYPT:
-      Lex(cc); //Skip {
-      LexD2I32(cc,&g.npu.x);
-      if (cc->token!=',')
-        LexExcept(cc,"Expecting ',' at ");
-      tmpv=QueVectU8New;
-      while (TRUE) {
-        if (!(i=LexGetChar(cc)))
-          LexExcept(cc,"Expecting '}' at ");
-        if (i=='}')
-          break;
-        if ('0'<=i<='7')
-          QueVectU8Put(tmpv,g.npu.num++,i-'0');
-      }
-      Bts(&cc->flags,CCf_USE_LAST_U16);
-      Lex(cc); //Load '}'
-      g.type=SPT_POLYPT;
-      size=SpriteElemQuedBaseSize(SPT_POLYPT);
-      res=CAlloc(size+(g.npu.num*3+7)>>3);
-      MemCpy(res,&g,size);
-      ptr=&res->npu.u;
-      for (i=0;i<g.npu.num;i++)
-        BFieldOrU32(ptr,i*3,QueVectU8Get(tmpv,i));
-      QueVectU8Del(tmpv);
-      break;
-    case SPT_BITMAP:
-      Lex(cc); //Skip {
-      LexD2I32(cc,&g.pwhu.x1);
-      if (cc->token!=':')
-        LexExcept(cc,"Expecting ':' at ");
-      Lex(cc); //Skip :
-      LexD2I32(cc,&g.pwhu.width);
-      if (cc->token!=',')
-        LexExcept(cc,"Expecting ',' at ");
-      tmpv=QueVectU8New;
-      num1=0;
-      while (TRUE) {
-        if (!(i=ToUpper(LexGetChar(cc))))
-          LexExcept(cc,"Expecting '}' at ");
-        if (i=='}')
-          break;
-        if ('0'<=i<='9')
-          QueVectU8Put(tmpv,num1++,i-'0');
-        else if ('A'<=i<='F')
-          QueVectU8Put(tmpv,num1++,i-'A'+10);
-        else if (i==CH_SPACE||i==CH_SHIFT_SPACE)
-          QueVectU8Put(tmpv,num1++,TRANSPARENT);
-        else if (i=='_')
-          QueVectU8Put(tmpv,num1++,0);
-      }
-      Bts(&cc->flags,CCf_USE_LAST_U16);
-      Lex(cc); //Load '}'
-      g.type=SPT_BITMAP;
-      size=SpriteElemQuedBaseSize(SPT_BITMAP);
-      res=CAlloc(size+num1);
-      MemCpy(res,&g,size);
-      ptr=&res->pwhu.u;
-      for (i=0;i<num1;i++)
-        *ptr++=QueVectU8Get(tmpv,i);
-      QueVectU8Del(tmpv);
-      break;
-    case SPT_MESH:
-    case SPT_SHIFTABLE_MESH:
-      Lex(cc); //Skip {
-      if (LexExpressionI64(cc)) {
-        g.type=SPT_SHIFTABLE_MESH;
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        LexD3I32(cc,&g.pmu.x);
-        if (cc->token!=':')
-          LexExcept(cc,"Expecting ':' at ");
-        Lex(cc); //Skip :
-      } else {
-        g.type=SPT_MESH;
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-      }
-      num1=0;
-      QueInit(&headp);
-      while (cc->token=='(') {
-        tmpp=CAlloc(sizeof(CQueD3I32));
-        LexD3I32(cc,&tmpp->p);
-        QueIns(tmpp,headp.last);
-        num1++;
-        if (cc->token==',')
-          Lex(cc); //Skip ,
-      }
-      if (cc->token!=':')
-        LexExcept(cc,"Expecting ':' at ");
-      Lex(cc); //Skip :
-      num2=0;
-      QueInit(&headt);
-      while (cc->token=='(') {
-        tmpt=CAlloc(sizeof(CQueMeshTri));
-        st=LexFirstRem(cc,",");
-        tmpt->color=Str2ColorU32(st);
-        Free(st);
-        Lex(cc); //Skip color
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        tmpt->nums[0]=LexExpressionI64(cc);
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        tmpt->nums[1]=LexExpressionI64(cc);
-        if (cc->token!=',')
-          LexExcept(cc,"Expecting ',' at ");
-        Lex(cc); //Skip ,
-        tmpt->nums[2]=LexExpressionI64(cc);
-        if (cc->token!=')')
-          LexExcept(cc,"Expecting ')' at ");
-        Lex(cc); //Skip )
-        QueIns(tmpt,headt.last);
-        num2++;
-        if (cc->token==',')
-          Lex(cc); //Skip ,
-      }
-      if (g.type==SPT_MESH) {
-        g.mu.vertex_cnt=num1;
-        g.mu.tri_cnt=num2;
-        size=SpriteElemQuedBaseSize(SPT_MESH);
-      } else {
-        g.pmu.vertex_cnt=num1;
-        g.pmu.tri_cnt=num2;
-      }
-      size=SpriteElemQuedBaseSize(g.type);
-      res=MAlloc(size+num1*sizeof(CD3I32)+num2*sizeof(CMeshTri));
-      MemCpy(res,&g,size);
-      ptr=res(U8 *)+size;
-      tmpp=headp.next;
-      while (tmpp!=&headp) {
-        tmpa1=tmpp->next;
-        MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
-        ptr+=sizeof(CD3I32);
-        Free(tmpp);
-        tmpp=tmpa1;
-      }
-      tmpt=headt.next;
-      while (tmpt!=&headt) {
-        tmpt1=tmpt->next;
-        MemCpy(ptr,&tmpt->start,sizeof(CMeshTri));
-        ptr+=sizeof(CMeshTri);
-        Free(tmpt);
-        tmpt=tmpt1;
-      }
-      break;
-  }
-  if (cc->token!='}')
-    LexExcept(cc,"Expecting '}' at ");
-  if (Lex(cc)!=';')
-    LexExcept(cc,"Expecting ';' at ");
-  return res;
-}
-
-public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
-{//Text to sprite.
-  CSprite head;
-  U8 *res;
-  Bool okay=TRUE,unlock_doc=DocLock(doc);
-  CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
-  CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
-  CHashGeneric *tmph;
-  I64 i,size=0;
-  QueInit(&head);
-  LexAttachDoc(cc,,doc);
-  try {
-    do {
-      cc->htc.hash_table_lst=NULL;
-      if (Lex(cc)==TK_IDENT && //Skip ;
-            (tmph=HashFind(cc->cur_str,gr.sprite_hash,SPHT_ELEM_CODE))) {
-        i=tmph->user_data0;
-        cc->htc.hash_table_lst=old_hash_table_lst;
-        if (Lex(cc)=='{') //Skip ident
-          QueIns(Code2SpriteElem(cc,i),head.last);
-      } else if (cc->token)
-        LexExcept(cc,"Expecting sprite element type name at ");
-    } while (cc->token);
-    okay=TRUE;
-  } catch {
-    Fs->catch_except=TRUE;
-    okay=FALSE;
-  }
-  if (unlock_doc)
-    DocUnlock(doc);
-  if (okay) {
-    CmpCtrlDel(cc); //TODO: can crash
-    res=SpriteQue2Sprite(&head,&size);
-  } else {
-    res=NULL;
-    size=0;
-  }
-  if (_size) *_size=size;
-  QueDel(&head);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteEd.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteEd.HC.HTML deleted file mode 100755 index 8117f52..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteEd.HC.HTML +++ /dev/null @@ -1,1209 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-
-CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
-        I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
-        I64 *_xx=NULL,I64 *_yy=NULL)
-{
-  CSprite *res=head->next;
-  I64 thick=1,xx=0,yy=0;
-  CColorROPU32 color=BLACK;
-  if (dc) DCRst(dc);
-  while (elem_num-->0 && res!=head) {
-    switch (res->type&SPG_TYPE_MASK) {
-      case SPT_COLOR:
-        color=res->c.color;
-        if (dc) dc->color=color;
-        break;
-      case SPT_DITHER_COLOR:
-        color=res->d.dither_color.u8[0]|
-              res->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
-        if (dc) dc->color=color;
-        break;
-      case SPT_THICK:
-        thick=res->t.thick;
-        if (dc) dc->thick=thick;
-        break;
-      case SPT_SHIFT:
-        xx+=res->p.x1;
-        yy+=res->p.y1;
-        x+=res->p.x1;
-        y+=res->p.y1;
-        break;
-      case SPT_PLANAR_SYMMETRY:
-        if (dc) {
-          if (DCSymmetry3Set(dc,res->pp.x1+x,res->pp.y1+y,0,
-                res->pp.x2+x,res->pp.y2+y,0,
-                res->pp.x2+x,res->pp.y2+y,1))
-            dc->flags|=DCF_SYMMETRY;
-          else
-            dc->flags&=~DCF_SYMMETRY;
-        }
-        break;
-    }
-    res=res->next;
-  }
-  if (_color) *_color=color;
-  if (_thick) *_thick=thick;
-  if (_xx) *_xx=xx;
-  if (_yy) *_yy=yy;
-  return res;
-}
-
-Bool SpritePolyPtPlot(CSprite *head,I64 x,I64 y,I64)
-{
-  CSprite *tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_PT));
-  tmpg->type=SPT_PT;
-  tmpg->p.x1=x;
-  tmpg->p.y1=y;
-  QueIns(tmpg,head->last);
-  return TRUE;
-}
-
-CSprite *Sprite2SpriteQue(U8 *elems)
-{
-  I64 s;
-  CSprite *res=CAlloc(sizeof(CSprite)),
-        *tmpg=elems-offset(CSprite.start),*tmpg1;
-  QueInit(res);
-  while (tmpg->type&SPG_TYPE_MASK) {
-    tmpg1=MAlloc(SpriteElemSize(tmpg)+offset(CSprite.start));
-    s=SpriteElemSize(tmpg);
-    MemCpy(&tmpg1->start,&tmpg->start,s);
-    QueIns(tmpg1,res->last);
-    tmpg(U8 *)+=s;
-  }
-  return res;
-}
-
-U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL)
-{
-  I64 i,size=sprite_elem_base_sizes[SPT_END];
-  CSprite *tmpg=head->next;
-  U8 *res,*dst;
-  while (tmpg!=head) {
-    size+=SpriteElemSize(tmpg);
-    tmpg=tmpg->next;
-  }
-  if (_size) *_size=size;
-  res=dst=MAlloc(size);
-  tmpg=head->next;
-  while (tmpg!=head) {
-    i=SpriteElemSize(tmpg);
-    MemCpy(dst,&tmpg->start,i);
-    dst+=i;
-    tmpg=tmpg->next;
-  }
-  *dst=SPT_END;
-  return res;
-}
-
-U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *head)
-{
-  CDocBin *tmpb=doc_ce->bin_data;
-  I64 size;
-  Bool unlock=DocLock(doc);
-  Free(tmpb->data);
-  tmpb->data=SpriteQue2Sprite(head,&size);
-  tmpb->size=size;
-  if (unlock)
-    DocUnlock(doc);
-}
-
-U0 SpriteSetOrigin(CSprite *head,I64 dx,I64 dy,I64 dz)
-{
-  I64 i;
-  I32 *ptr;
-  CD3I32 *p;
-  CSprite *tmpg=head->next;
-  while (tmpg!=head) {
-    if (Bt(&tmpg->type,SPf_SEL))
-      switch (tmpg->type&SPG_TYPE_MASK) {
-        case SPT_ARROW:
-        case SPT_LINE:
-        case SPT_PLANAR_SYMMETRY:
-        case SPT_RECT:
-        case SPT_ROTATED_RECT:
-          tmpg->pp.x2+=dx;
-          tmpg->pp.y2+=dy;
-        case SPT_PT:
-        case SPT_FLOOD_FILL:
-        case SPT_FLOOD_FILL_NOT:
-        case SPT_TEXT:
-        case SPT_TEXT_BOX:
-        case SPT_TEXT_DIAMOND:
-        case SPT_CIRCLE:
-        case SPT_BITMAP:
-        case SPT_ELLIPSE:
-        case SPT_POLYGON:
-          tmpg->p.x1+=dx;
-          tmpg->p.y1+=dy;
-          break;
-        case SPT_POLYLINE:
-          ptr=&tmpg->nu.u;
-          for (i=0;i<tmpg->nu.num;i++) {
-            ptr[i<<1]+=dx;
-            ptr[i<<1+1]+=dy;
-          }
-          break;
-        case SPT_POLYPT:
-          tmpg->npu.x+=dx;
-          tmpg->npu.y+=dy;
-          break;
-        case SPT_BSPLINE2:
-        case SPT_BSPLINE3:
-        case SPT_BSPLINE2_CLOSED:
-        case SPT_BSPLINE3_CLOSED:
-          p=&tmpg->nu.u;
-          for (i=0;i<tmpg->nu.num;i++,p++) {
-            p->x+=dx;
-            p->y+=dy;
-            p->z+=dz;
-          }
-          break;
-        case SPT_MESH:
-          p=&tmpg->mu.u;
-          for (i=0;i<tmpg->mu.vertex_cnt;i++,p++) {
-            p->x+=dx;
-            p->y+=dy;
-            p->z+=dz;
-          }
-          break;
-        case SPT_SHIFTABLE_MESH:
-          tmpg->pmu.x+=dx;
-          tmpg->pmu.y+=dy;
-          tmpg->pmu.z+=dz;
-          break;
-      }
-    tmpg=tmpg->next;
-  }
-}
-
-CSprite *SpriteTransformCircle(I64 *r,CSprite *tmpg)
-{
-  I64 x,y,z;
-  F64 m1,arg1,m2,radius=tmpg->pr.radius<<16;
-  CSprite *tmpg1=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE));
-  tmpg1->type=SPT_ELLIPSE;
-
-  x=tmpg->pr.x1; y=tmpg->pr.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  tmpg1->pwha.x1=x;
-  tmpg1->pwha.y1=y;
-
-  x=radius; y=0; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  R2P(&m1,&arg1,x,y);
-
-  x=0; y=radius; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  m2=Sqrt(x*x+y*y);
-
-  tmpg1->pwha.width =ToI64(m1)/0x10000;
-  tmpg1->pwha.height=ToI64(m2)/0x10000;
-  tmpg1->pwha.angle=-arg1;
-
-  tmpg1->type|=tmpg->type&SPF_SEL;
-  return tmpg1;
-}
-
-CSprite *SpriteTransformEllipse(I64 *r,CSprite *tmpg)
-{
-  I64 x,y,z;
-  F64 m1,arg1,m2,arg2,s,c,x_radius=tmpg->pwha.width<<16,
-        y_radius=tmpg->pwha.height<<16;
-  CSprite *tmpg1=CAlloc(SpriteElemQuedBaseSize(tmpg->type&SPG_TYPE_MASK));
-  tmpg1->type=tmpg->type;
-  if (tmpg->type&SPG_TYPE_MASK==SPT_POLYGON)
-    tmpg1->pwhas.sides=tmpg->pwhas.sides;
-
-  x=tmpg->pwha.x1; y=tmpg->pwha.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  tmpg1->pwha.x1=x;
-  tmpg1->pwha.y1=y;
-
-  c=Cos(-tmpg->pwha.angle);
-  s=Sin(-tmpg->pwha.angle);
-
-  x=x_radius*c;
-  y=x_radius*s;
-  z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  R2P(&m1,&arg1,x,y);
-
-  x=-y_radius*s;
-  y=y_radius*c;
-  z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  R2P(&m2,&arg2,x,y);
-  m2*=Abs(Sin(arg2-arg1));
-
-  tmpg1->pwha.width=ToI64(m1)/0x10000;
-  if (tmpg1->pwha.width<1) tmpg1->pwha.width=1;
-  tmpg1->pwha.height=ToI64(m2)/0x10000;
-  if (tmpg1->pwha.height<1) tmpg1->pwha.height=1;
-  tmpg1->pwha.angle=-arg1;
-
-  tmpg1->type|=tmpg->type&SPF_SEL;
-  return tmpg1;
-}
-
-CSprite *SpriteTransformRect(I64 *r,CSprite *tmpg,F64 theta)
-{
-  I64 x,y,z,w,h;
-  F64 m1,arg1,m2,arg2,s,c,
-        x_radius=(tmpg->pp.x2-tmpg->pp.x1)<<16,
-        y_radius=(tmpg->pp.y2-tmpg->pp.y1)<<16;
-  CSprite *tmpg1=CAlloc(SpriteElemQuedBaseSize(SPT_ROTATED_RECT));
-  tmpg1->type=SPT_ROTATED_RECT;
-
-  x=tmpg->pp.x1; y=tmpg->pp.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  tmpg1->ppa.x1=x;
-  tmpg1->ppa.y1=y;
-
-  c=Cos(-theta);
-  s=Sin(-theta);
-
-  x=x_radius*c;
-  y=x_radius*s;
-  z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  R2P(&m1,&arg1,x,y);
-
-  x=-y_radius*s;
-  y=y_radius*c;
-  z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  R2P(&m2,&arg2,x,y);
-  m2*=Abs(Sin(arg2-arg1));
-
-  w=ToI64(m1)/0x10000;
-  if (w<1) w=1;
-  h=ToI64(m2)/0x10000;
-  if (h<1) h=1;
-  tmpg1->ppa.x2=tmpg1->ppa.x1+w;
-  tmpg1->ppa.y2=tmpg1->ppa.y1+h;
-  tmpg1->ppa.angle=-arg1;
-
-  tmpg1->type|=tmpg->type&SPF_SEL;
-  return tmpg1;
-}
-
-CSprite *SpriteTransformBitMap(I64 *r,CSprite *tmpg)
-{
-  CDC *img,*dc3;
-  U8 *elems;
-  I64 x,y,z,minx,maxx,miny,maxy,minz,maxz;
-  CSprite *tmpg1;
-
-  x=tmpg->pwhu.x1; y=tmpg->pwhu.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  minx=maxx=x;
-  miny=maxy=y;
-  minz=maxz=z;
-
-  x=tmpg->pwhu.x1; y=tmpg->pwhu.y1+tmpg->pwhu.height; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  if (x<minx) minx=x;
-  if (x>maxx) maxx=x;
-  if (y<miny) miny=y;
-  if (y>maxy) maxy=y;
-  if (z<minz) minz=z;
-  if (z>maxz) maxz=z;
-
-  x=tmpg->pwhu.x1+tmpg->pwhu.width; y=tmpg->pwhu.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  if (x<minx) minx=x;
-  if (x>maxx) maxx=x;
-  if (y<miny) miny=y;
-  if (y>maxy) maxy=y;
-  if (z<minz) minz=z;
-  if (z>maxz) maxz=z;
-
-  x=tmpg->pwhu.x1+tmpg->pwhu.width; y=tmpg->pwhu.y1+tmpg->pwhu.height; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  if (x<minx) minx=x;
-  if (x>maxx) maxx=x;
-  if (y<miny) miny=y;
-  if (y>maxy) maxy=y;
-  if (z<minz) minz=z;
-  if (z>maxz) maxz=z;
-
-  dc3=DCNew(maxx-minx+1,maxy-miny+1);
-
-  img=CAlloc(sizeof(CDC));
-  img->width=tmpg->pwhu.width;
-  img->width_internal=(tmpg->pwhu.width+7)&~7;
-  img->height=tmpg->pwhu.height;
-  img->body=&tmpg->pwhu.u;
-  img->dc_signature=DCS_SIGNATURE_VAL;
-
-  dc3->color=TRANSPARENT;
-  GrRect(dc3,0,0,maxx-minx+1,maxy-miny+1);
-
-  Free(dc3->r);
-  DCMat4x4Set(dc3,r);
-  dc3->flags|=DCF_TRANSFORMATION;
-
-  dc3->x=tmpg->pwhu.x1-minx;
-  dc3->y=tmpg->pwhu.y1-miny;
-  dc3->z=-minz;
-  GrBlot3(dc3,0,0,0,img);
-  Free(img);
-
-  elems=DC2Sprite(dc3);
-  dc3->r=NULL;
-  DCDel(dc3);
-  tmpg1=CAlloc(offset(CSprite.start)+MSize(elems));
-  MemCpy(tmpg1(U8 *)+offset(CSprite.start),elems,MSize(elems));
-  tmpg1->type=tmpg->type;
-
-  x=tmpg->pwhu.x1; y=tmpg->pwhu.y1; z=0;
-  Mat4x4MulXYZ(r,&x,&y,&z);
-  tmpg1->pwhu.x1=x;
-  tmpg1->pwhu.y1=y;
-
-  return tmpg1;
-}
-
-U0 SpriteTransformQue(CSprite *head,I64 *r)
-{
-  I64 i,j,k,num,x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3;
-  I32 *ptr;
-  CD3I32 *p;
-  CSprite *tmpg=head->next,head2,*tmpg1,*tmpg2,*tmpg3;
-  while (tmpg!=head) {
-    if (Bt(&tmpg->type,SPf_SEL))
-      switch (tmpg->type&SPG_TYPE_MASK) {
-        case SPT_THICK:
-          tmpg->t.thick*=Sqrt(Mat4x4NormSqr65536(r))/65536;
-          if (tmpg->t.thick<0) tmpg->t.thick=0;
-          break;
-        case SPT_PLANAR_SYMMETRY:
-        case SPT_ARROW:
-        case SPT_LINE:
-          x=tmpg->pp.x2; y=tmpg->pp.y2; z=0;
-          Mat4x4MulXYZ(r,&x,&y,&z);
-          tmpg->pp.x2=x;
-          tmpg->pp.y2=y;
-        case SPT_PT:
-        case SPT_FLOOD_FILL:
-        case SPT_FLOOD_FILL_NOT:
-        case SPT_TEXT:
-        case SPT_TEXT_BOX:
-        case SPT_TEXT_DIAMOND:
-          x=tmpg->p.x1; y=tmpg->p.y1; z=0;
-          Mat4x4MulXYZ(r,&x,&y,&z);
-          tmpg->p.x1=x;
-          tmpg->p.y1=y;
-          break;
-        case SPT_BITMAP:
-          tmpg1=SpriteTransformBitMap(r,tmpg);
-          QueIns(tmpg1,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg1;
-          break;
-        case SPT_ROTATED_RECT:
-          tmpg1=SpriteTransformRect(r,tmpg,tmpg->ppa.angle);
-          QueIns(tmpg1,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg1;
-          break;
-        case SPT_RECT:
-          tmpg1=SpriteTransformRect(r,tmpg,0);
-          QueIns(tmpg1,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg1;
-          break;
-        case SPT_CIRCLE:
-          tmpg1=SpriteTransformCircle(r,tmpg);
-          QueIns(tmpg1,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg1;
-          break;
-        case SPT_ELLIPSE:
-        case SPT_POLYGON:
-          tmpg1=SpriteTransformEllipse(r,tmpg);
-          QueIns(tmpg1,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg1;
-          break;
-        case SPT_POLYLINE:
-          ptr=&tmpg->nu.u;
-          for (i=0;i<tmpg->nu.num;i++) {
-            x=ptr[i<<1]; y=ptr[i<<1+1]; z=0;
-            Mat4x4MulXYZ(r,&x,&y,&z);
-            ptr[i<<1]=x;
-            ptr[i<<1+1]=y;
-          }
-          break;
-        case SPT_POLYPT:
-          QueInit(&head2);
-          x=tmpg->npu.x; y=tmpg->npu.y; z=0;
-          x1=x; y1=y; z1=z;  //unrotated cur coordinates
-          Mat4x4MulXYZ(r,&x,&y,&z);
-          ptr=&tmpg->npu.u;
-          k=tmpg->npu.num*3;
-          x2=x; y2=y; z2=z;  //rotated start coordinates
-          x3=x; y3=y; z3=z;  //lag 1 rotated coordinates
-          for (i=0;i<k;i+=3) {
-            j=BFieldExtU32(ptr,i,3);
-            x1+=gr_x_offsets[j];
-            y1+=gr_y_offsets[j];
-            x=x1; y=y1; z=z1;
-            Mat4x4MulXYZ(r,&x,&y,&z);
-            Line(&head2,x3-x2,y3-y2,0,x-x2,y-y2,0,&SpritePolyPtPlot);
-            x3=x; y3=y; z3=z;
-          }
-
-          num=0;
-          tmpg1=head2.next;
-          x3=0; y3=0; z3=0;
-          while (tmpg1!=&head2) {
-            tmpg2=tmpg1->next;
-            if (tmpg1->p.x1==x3 && tmpg1->p.y1==y3) {
-              QueRem(tmpg1);
-              Free(tmpg1);
-            } else {
-              num++;
-              x3=tmpg1->p.x1;
-              y3=tmpg1->p.y1;
-            }
-            tmpg1=tmpg2;
-          }
-
-          tmpg3=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3);
-          tmpg3->npu.x=x2;
-          tmpg3->npu.y=y2;
-          ptr=&tmpg3->npu.u;
-          x3=0;y3=0; z3=0;
-          i=0;
-          tmpg1=head2.next;
-          while (tmpg1!=&head2) {
-            tmpg2=tmpg1->next;
-            BFieldOrU32(ptr,i,
-                  polypt_map[SignI64(tmpg1->p.x1-x3)+1+
-                  3*(SignI64(tmpg1->p.y1-y3)+1)]);
-            i+=3;
-            x3=tmpg1->p.x1;y3=tmpg1->p.y1;
-            QueRem(tmpg1);
-            Free(tmpg1);
-            tmpg1=tmpg2;
-          }
-          tmpg3->type=SPT_POLYPT|tmpg->type&SPF_SEL;
-          tmpg3->npu.num=num;
-          QueIns(tmpg3,tmpg);
-          QueRem(tmpg);
-          Free(tmpg);
-          tmpg=tmpg3;
-          break;
-        case SPT_BSPLINE2:
-        case SPT_BSPLINE3:
-        case SPT_BSPLINE2_CLOSED:
-        case SPT_BSPLINE3_CLOSED:
-          p=&tmpg->nu.u;
-          for (i=0;i<tmpg->nu.num;i++,p++) {
-            x=p->x; y=p->y; z=p->z;
-            Mat4x4MulXYZ(r,&x,&y,&z);
-            p->x=x;
-            p->y=y;
-            p->z=z;
-          }
-          break;
-        case SPT_SHIFTABLE_MESH:
-          x=tmpg->pmu.x; y=tmpg->pmu.y; z=tmpg->pmu.z;
-          Mat4x4MulXYZ(r,&x,&y,&z);
-          tmpg->pmu.x=x;
-          tmpg->pmu.y=y;
-          tmpg->pmu.z=z;
-          p=&tmpg->pmu.u;
-          for (i=0;i<tmpg->pmu.vertex_cnt;i++,p++) {
-            x=p->x; y=p->y; z=p->z;
-            Mat4x4MulXYZ(r,&x,&y,&z);
-            p->x=x;
-            p->y=y;
-            p->z=z;
-          }
-          break;
-        case SPT_MESH:
-          p=&tmpg->mu.u;
-          for (i=0;i<tmpg->mu.vertex_cnt;i++,p++) {
-            x=p->x; y=p->y; z=p->z;
-            Mat4x4MulXYZ(r,&x,&y,&z);
-            p->x=x;
-            p->y=y;
-            p->z=z;
-          }
-          break;
-      }
-    tmpg=tmpg->next;
-  }
-}
-
-I64 SpriteQueSelCnt(CSprite *head,Bool val=TRUE)
-{
-  I64 res=0;
-  CSprite *tmpg=head->next;
-  val=ToBool(val);
-  while (tmpg!=head) {
-    if (Bt(&tmpg->type,SPf_SEL)==val)
-      res++;
-    tmpg=tmpg->next;
-  }
-  return res;
-}
-
-I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE)
-{
-  I64 res=0;
-  CSprite *tmpg=head->next;
-  while (tmpg!=head) {
-    BEqu(&tmpg->type,SPf_SEL,val);
-    res++;
-    tmpg=tmpg->next;
-  }
-  return res;
-}
-
-Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num)
-{
-  Bool res;
-  CSprite *head=*_head;
-  U8 *elems=SpriteQue2Sprite(head);
-  CDoc *doc=DocNew,*doc2,*old_put=DocPut;
-  StrPrint(doc->filename.name,"AI:0x%X",doc);
-  DocPrint(doc,"//$PURPLE$$TX+CX,\"Sprite Edit as Text\"$$FG$\n"
-        "//$LK+PU+CX,\"Click for Help\","
-        "A=\"FI:::/Doc/SpriteEdText.DD.Z\"$\n\n");
-  Sprite2Code(doc,elems);
-  Free(elems);
-  while (TRUE) {
-    if (res=PopUpPrint("DocEd(0x%X,0x%X);",doc,0)) {
-      Fs->put_doc=doc2=DocNew;
-      "$WW,1$";
-      if (elems=Code2Sprite(doc)) {
-        DocDel(doc2);
-        Fs->put_doc=old_put;
-        QueDel(head);
-        Free(head);
-        head=Sprite2SpriteQue(elems);
-        Free(elems);
-        *_cur_elem_num=QueCnt(head); //TODO: Might want to improve this.
-        break;
-      } else {
-        PopUpPrint("DocEd(0x%X,0x%X);",doc2,0);
-        DocDel(doc2);
-        Fs->put_doc=old_put;
-      }
-    } else
-      break;
-  }
-  DocDel(doc);
-  if (_head) *_head=head;
-  return res;
-}
-
-#define SPED_SEL_UNSEL_ALL      0
-#define SPED_SEL                2
-#define SPED_SEL_RECTS          3
-#define SPED_UNSEL              4
-#define SPED_UNSEL_RECTS        5
-#define SPED_SHIFT_PTS          6
-#define SPED_SHIFT_RECTS        7
-#define SPED_SHIFT_SEL          8
-#define SPED_TRANSFORM_SEL      9
-#define SPED_SET_ORIGIN         10
-#define SPED_SHIFT_SUB_ORIGIN   11
-#define SPED_TEXT_ED            12
-#define SPED_INS_CLIP           13
-#define SPED_MAIN_MENU          14
-#define SPED_EXIT               15
-
-U0 GrInit3()
-{
-  DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0 \0Select\0"
-        "Select Rects\0Unselect\0Unselect Rects\0Shift Points\0Shift Rects\0"
-        "Shift Selected\0Transform Selected\0Set Origin\0"
-        "Insert Shift SubOrigin\0Edit as Text\0Insert Clip\0Main Menu\0");
-}
-GrInit3;
-
-I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num)
-{
-  U8 *st;
-  CTask *pu_task;
-  I64 res;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Sprite Edit Menu\"$\n"
-        "$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.DD.Z\"$\n\n"
-        "$LTBLUE$$MU-UL,\"Select/Unselect All\",LE=SPED_SEL_UNSEL_ALL$\n"
-        "$MU-UL,\"Select Elems\",LE=SPED_SEL$\n"
-        "$MU-UL,\"Select Elems with Rects\",LE=SPED_SEL_RECTS$\n"
-        "$MU-UL,\"Unsel Elems\",LE=SPED_UNSEL$\n"
-        "$MU-UL,\"Unsel Elems with Rects\",LE=SPED_UNSEL_RECTS$\n\n"
-        "$MU-UL,\"Shift Points\",LE=SPED_SHIFT_PTS$\n"
-        "$MU-UL,\"Shift Points with Rects\",LE=SPED_SHIFT_RECTS$\n"
-        "$MU-UL,\"Shift Selected Elems\",LE=SPED_SHIFT_SEL$\n"
-        "$MU-UL,\"Transform Selected Elems\",LE=SPED_TRANSFORM_SEL$\n\n"
-        "$MU-UL,\"Set Origin\",LE=SPED_SET_ORIGIN$\n"
-        "$MU-UL,\"Insert Shift SubOrigin\",LE=SPED_SHIFT_SUB_ORIGIN$\n\n"
-        "$MU-UL,\"Edit as Text\",LE=SPED_TEXT_ED$\n"
-        "$MU-UL,\"Insert Clip Sprite's\",LE=SPED_INS_CLIP$\n\n"
-        "$PURPLE$$MU-UL,\"+] Sprite Main Menu\",LE=SPED_MAIN_MENU$$LTBLUE$\n"
-        "$MU-UL,\"Exit  Sprite\",LE=SPED_EXIT$\n"
-        "$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$");
-  st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num);
-  PopUp(st,NULL,&pu_task);
-  Free(st);
-  res=PopUpMenu(doc);
-  if (TaskValidate(pu_task)) {
-    *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num);
-    Kill(pu_task);
-  }
-  DocDel(doc);
-  return res;
-}
-
-#define SPEDT_SIMPLE_PT         0
-#define SPEDT_WIDTH_HEIGHT      1
-
-#define SPEDF_SEL               1
-
-class CEdSprite
-{
-  CEdSprite *next,*last;
-  CSprite *g;
-  I32 type,num,flags,xx,yy,zz;
-  I32 *x,*y,*z,*w,*h;
-};
-
-CEdSprite *EdSpriteNew(I64 type,CSprite *tmpg)
-{
-  CEdSprite *res=CAlloc(sizeof(CEdSprite));
-  res->g=tmpg;
-  if (tmpg->type&SPF_SEL)
-    res->flags|=SPEDF_SEL;
-  res->type=type;
-  return res;
-}
-
-U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
-{
-  I64 i,num=0;
-  I32 *ptr;
-  CD3I32 *p;
-  CEdSprite *tmpes;
-  CSprite *tmpg=elems-offset(CSprite.start);
-  QueInit(head);
-  while (tmpg->type&SPG_TYPE_MASK) {
-    switch (tmpg->type&SPG_TYPE_MASK) {
-      case SPT_ELLIPSE:
-      case SPT_POLYGON:
-        tmpes=EdSpriteNew(SPEDT_WIDTH_HEIGHT,tmpg);
-        tmpes->xx=x;
-        tmpes->yy=y;
-        tmpes->x=&tmpg->pwha.x1;
-        tmpes->y=&tmpg->pwha.y1;
-        tmpes->w=&tmpg->pwha.width;
-        tmpes->h=&tmpg->pwha.height;
-        tmpes->num=num;
-        QueIns(tmpes,head->last);
-        goto pq_x1_y1;
-      case SPT_RECT:
-      case SPT_ROTATED_RECT:
-      case SPT_LINE:
-      case SPT_ARROW:
-      case SPT_PLANAR_SYMMETRY:
-        tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-        tmpes->xx=x;
-        tmpes->yy=y;
-        tmpes->x=&tmpg->pp.x2;
-        tmpes->y=&tmpg->pp.y2;
-        tmpes->num=num;
-        QueIns(tmpes,head->last);
-      case SPT_TEXT:
-      case SPT_TEXT_BOX:
-      case SPT_TEXT_DIAMOND:
-      case SPT_PT:
-      case SPT_BITMAP:
-      case SPT_FLOOD_FILL:
-      case SPT_FLOOD_FILL_NOT:
-      case SPT_CIRCLE:
-pq_x1_y1:
-        tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-        tmpes->xx=x;
-        tmpes->yy=y;
-        tmpes->x=&tmpg->p.x1;
-        tmpes->y=&tmpg->p.y1;
-        tmpes->num=num;
-        QueIns(tmpes,head->last);
-        break;
-      case SPT_SHIFT:
-        x+=tmpg->p.x1;
-        y+=tmpg->p.y1;
-        break;
-      case SPT_POLYLINE:
-        ptr=&tmpg->nu.u;
-        for (i=0;i<tmpg->nu.num;i++) {
-          tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-          tmpes->xx=x;
-          tmpes->yy=y;
-          tmpes->x=&ptr[i<<1];
-          tmpes->y=&ptr[i<<1+1];
-          tmpes->num=num;
-          QueIns(tmpes,head->last);
-        }
-        break;
-      case SPT_POLYPT:
-        tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-        tmpes->xx=x;
-        tmpes->yy=y;
-        tmpes->x=&tmpg->npu.x;
-        tmpes->y=&tmpg->npu.y;
-        tmpes->num=num;
-        QueIns(tmpes,head->last);
-        break;
-      case SPT_BSPLINE2:
-      case SPT_BSPLINE3:
-      case SPT_BSPLINE2_CLOSED:
-      case SPT_BSPLINE3_CLOSED:
-        p=&tmpg->nu.u;
-        for (i=0;i<tmpg->nu.num;i++) {
-          tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-          tmpes->xx=x;
-          tmpes->yy=y;
-          tmpes->x=&p[i].x;
-          tmpes->y=&p[i].y;
-          tmpes->z=&p[i].z;
-          tmpes->num=num;
-          QueIns(tmpes,head->last);
-        }
-        break;
-      case SPT_MESH:
-        break;
-      case SPT_SHIFTABLE_MESH:
-        tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
-        tmpes->xx=x;
-        tmpes->yy=y;
-        tmpes->x=&tmpg->pmu.x;
-        tmpes->y=&tmpg->pmu.y;
-        tmpes->z=&tmpg->pmu.z;
-        tmpes->num=num;
-        QueIns(tmpes,head->last);
-        break;
-    }
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-    num++;
-  }
-}
-
-U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *head)
-{
-  I64 x,y;
-  CEdSprite *tmpes;
-  Refresh;
-  DCFill(dc);
-  if (Blink(20)) {
-    tmpes=head->next;
-    while (tmpes!=head) {
-      switch (tmpes->type) {
-        case SPEDT_SIMPLE_PT:
-          x=*tmpes->x+tmpes->xx;
-          y=*tmpes->y+tmpes->yy;
-          break;
-        case SPEDT_WIDTH_HEIGHT:
-          x=*tmpes->w+*tmpes->x+tmpes->xx;
-          y=*tmpes->h+*tmpes->y+tmpes->yy;
-          break;
-      }
-      if (tmpes->flags&SPEDF_SEL)
-        dc->color=RED;
-      else
-        dc->color=BLACK;
-      GrRect(dc,x-2,y-2,4,4);
-      dc->color=WHITE;
-      GrRect(dc,x-1,y-1,2,2);
-      tmpes=tmpes->next;
-    }
-  }
-}
-
-U0 SpriteCtrlPtsMove(CEdSprite *head,I64 dx,I64 dy)
-{
-  CEdSprite *tmpes;
-  tmpes=head->next;
-  while (tmpes!=head) {
-    if (tmpes->flags&SPEDF_SEL)
-      switch (tmpes->type) {
-        case SPEDT_SIMPLE_PT:
-          if (tmpes->x) *tmpes->x+=dx;
-          if (tmpes->y) *tmpes->y+=dy;
-          break;
-        case SPEDT_WIDTH_HEIGHT:
-          if (tmpes->w) *tmpes->w+=dx;
-          if (tmpes->h) *tmpes->h+=dy;
-          break;
-      }
-    tmpes=tmpes->next;
-  }
-}
-
-Bool SpriteSelUnselShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
-{
-  I64 msg_code,arg1,arg2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num;
-  Bool res=TRUE;
-  CDC *dc=DCAlias;
-  CEdSprite head,*tmpes,*best_es;
-
-  SpritePtQueNew(elems,x,y,&head);
-  cur_elem_num=0;
-  if (head.next!=&head) {
-    while (TRUE) {
-      SpriteCtrlPtsDraw(dc,&head); //has Refresh
-      switch (msg_code=ScanMsg(&arg1,&arg2,
-            1<<MSG_MS_R_UP|1<<MSG_MS_L_DOWN|1<<MSG_KEY_DOWN)) {
-        case MSG_MS_L_DOWN:
-          switch (mode) {
-            case SPED_SEL:
-            case SPED_UNSEL:
-            case SPED_SHIFT_PTS:
-              xx=arg1; yy=arg2;
-              best_dd=I64_MAX;
-              tmpes=head.next;
-              while (tmpes!=&head) {
-                switch (tmpes->type) {
-                  case SPEDT_SIMPLE_PT:
-                    dd=SqrI64(*tmpes->x+tmpes->xx-xx)+
-                          SqrI64(*tmpes->y+tmpes->yy-yy);
-                    break;
-                  case SPEDT_WIDTH_HEIGHT:
-                    dd=SqrI64(*tmpes->x+*tmpes->w+tmpes->xx-xx)+
-                          SqrI64(*tmpes->y+*tmpes->h+tmpes->yy-yy);
-                    break;
-                }
-                if (dd<best_dd) {
-                  best_dd=dd;
-                  best_es=tmpes;
-                }
-                tmpes=tmpes->next;
-              }
-              cur_elem_num=best_es->num;
-              if (mode!=SPED_UNSEL) {
-                best_es->flags|=SPEDF_SEL;
-                best_es->g->type|=SPF_SEL;
-              } else {
-                best_es->flags&=~SPEDF_SEL;
-                best_es->g->type&=~SPF_SEL;
-              }
-              break;
-            start:
-              xx2=xx=arg1; yy2=yy=arg2;
-              while (TRUE) {
-                SpriteCtrlPtsDraw(dc,&head);
-                dc->color=ROPF_DITHER+WHITE<<16+RED;
-                GrBorder(dc,xx,yy,xx2,yy2);
-                if (msg_code=ScanMsg(&arg1,&arg2,
-                      1<<MSG_MS_MOVE|1<<MSG_MS_L_UP)) {
-                  if (msg_code==MSG_MS_MOVE) {
-                    xx2=arg1; yy2=arg2;
-                  } else
-                    break;
-                }
-              }
-              if (xx2<xx) SwapI64(&xx,&xx2);
-              if (yy2<yy) SwapI64(&yy,&yy2);
-              tmpes=head.next;
-              while (tmpes!=&head) {
-                switch (tmpes->type) {
-                  case SPEDT_SIMPLE_PT:
-                    if (xx<=*tmpes->x+tmpes->xx<=xx2 &&
-                          yy<=*tmpes->y+tmpes->yy<=yy2) {
-                      if (mode!=SPED_UNSEL_RECTS) {
-                        tmpes->flags|=SPEDF_SEL;
-                        tmpes->g->type|=SPF_SEL;
-                      } else {
-                        tmpes->flags&=~SPEDF_SEL;
-                        tmpes->g->type&=~SPF_SEL;
-                      }
-                    }
-                    break;
-                  case SPEDT_WIDTH_HEIGHT:
-                    if (xx<=*tmpes->x+*tmpes->w+tmpes->xx<=xx2 &&
-                          yy<=*tmpes->y+*tmpes->h+tmpes->yy<=yy2) {
-                      if (mode!=SPED_UNSEL_RECTS) {
-                        tmpes->flags|=SPEDF_SEL;
-                        tmpes->g->type|=SPF_SEL;
-                      } else {
-                        tmpes->flags&=~SPEDF_SEL;
-                        tmpes->g->type&=~SPF_SEL;
-                      }
-                    }
-                    break;
-                }
-                tmpes=tmpes->next;
-              }
-              case SPED_SEL_RECTS:
-              case SPED_UNSEL_RECTS:
-                break;
-              case SPED_SHIFT_RECTS:
-                do {
-                  SpriteCtrlPtsDraw(dc,&head);
-                  msg_code=ScanMsg(&arg1,&arg2,
-                        1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN);
-                  if (msg_code==MSG_KEY_DOWN) goto gs_key;
-                } while (msg_code!=MSG_MS_L_DOWN);
-                xx=arg1;yy=arg2;
-                break;
-            end:
-          }
-          switch (mode) {
-            case SPED_SHIFT_PTS:
-            case SPED_SHIFT_RECTS:
-              do {
-                SpriteCtrlPtsDraw(dc,&head);
-                if (msg_code=ScanMsg(&arg1,&arg2,
-                      1<<MSG_MS_MOVE|1<<MSG_MS_L_UP)) {
-                  SpriteCtrlPtsMove(&head,arg1-xx,arg2-yy);
-                  xx=arg1;yy=arg2;
-                }
-              } while (msg_code!=MSG_MS_L_UP);
-              tmpes=head.next;
-              while (tmpes!=&head) {
-                tmpes->flags&=~SPEDF_SEL;
-                tmpes->g->type&=~SPF_SEL;
-                tmpes=tmpes->next;
-              }
-              break;
-          }
-          break;
-        case MSG_KEY_DOWN:
-gs_key:
-          switch (arg1.u8[0]) {
-            case CH_SHIFT_ESC:
-              res=FALSE;
-            case CH_ESC:
-              GetMsg(&arg1,&arg2,1<<MSG_KEY_UP);
-              goto gs_done;
-            case 'p':
-            case 'P':
-              mode&=~1;
-              break;
-            case 'r':
-            case 'R':
-              mode|=1;
-              break;
-          }
-          break;
-        case MSG_MS_R_UP:
-          goto gs_done;
-      }
-    }
-gs_done:
-    QueDel(&head,TRUE);
-  }
-  DCFill(dc);
-  DCDel(dc);
-  if (_cur_elem_num && res)
-    *_cur_elem_num=cur_elem_num;
-  return res;
-}
-
-I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
-        CSprite **_head,I64 *_cur_elem_num)
-{
-  CDocEntry *doc_e2;
-  CDocBin *tmpb;
-  Bool unlock;
-  I64 i,r[16],msg_code,arg1,arg2,xx,yy,
-        old_de_flags;
-  CSprite *head2,*next,*last,*tmpg,*insert_pt;
-
-  old_de_flags=doc_ce->de_flags;
-  tmpb=doc_ce->bin_data;
-  DocUnlock(doc);
-  SpriteQueSelAll(*_head,FALSE);
-  do {
-    if (winmgr.fps<10)
-      doc_ce->de_flags|=DOCEF_DONT_DRAW;
-    StrCpy(Fs->task_title,"Sprite Edit Menu");
-    i=PopUpSpriteEd(_head,_cur_elem_num);
-    SpriteEdUpdate(doc,doc_ce,*_head);
-    if (0<=i<SPED_EXIT) {
-      StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_ED_MENU"));
-      switch (i) {
-        case SPED_SEL_UNSEL_ALL:
-          if (!SpriteQueSelCnt(*_head))
-            SpriteQueSelAll(*_head);
-          else
-            SpriteQueSelAll(*_head,FALSE);
-          break;
-        case SPED_SET_ORIGIN:
-          SpriteQueSelAll(*_head);
-          doc_ce->de_flags=old_de_flags;
-          GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP);
-          SpriteSetOrigin(*_head,x-arg1,y-arg2,0);
-          SpriteEdUpdate(doc,doc_ce,*_head);
-          SpriteQueSelAll(*_head,FALSE);
-          break;
-        case SPED_SHIFT_SEL:
-          if (!SpriteQueSelCnt(*_head))
-            SpriteQueSelAll(*_head);
-          doc_ce->de_flags=old_de_flags;
-          GetMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN);
-          xx=arg1; yy=arg2;
-          do {
-            msg_code=GetMsg(&arg1,&arg2,
-                  1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-            SpriteSetOrigin(*_head,arg1-xx,arg2-yy,0);
-            xx=arg1; yy=arg2;
-            SpriteEdUpdate(doc,doc_ce,*_head);
-          } while (msg_code!=MSG_MS_L_UP);
-          if (!SpriteQueSelCnt(*_head,FALSE))
-            SpriteQueSelAll(*_head,FALSE);
-          break;
-        case SPED_SEL:
-        case SPED_SEL_RECTS:
-        case SPED_UNSEL:
-        case SPED_UNSEL_RECTS:
-        case SPED_SHIFT_PTS:
-        case SPED_SHIFT_RECTS:
-          RegOneTimePopUp(ARf_CSPRITE_PTS_RECTANGLES,
-                "You can switch between points\n"
-                "and rectangles with '$GREEN$p$FG$' and '$GREEN$r$FG$'.\n"
-                "Press '$GREEN$r$FG$' after one rectangle\n"
-                "to OR another rectangle.\n");
-          doc_ce->de_flags=old_de_flags;
-          if (SpriteSelUnselShiftPts(tmpb->data,x,y,_cur_elem_num,i)) {
-            QueDel(*_head);
-            Free(*_head);
-            *_head=Sprite2SpriteQue(tmpb->data);
-          } else
-            SpriteEdUpdate(doc,doc_ce,*_head);
-          break;
-        case SPED_TRANSFORM_SEL:
-          if (!SpriteQueSelCnt(*_head))
-            SpriteQueSelAll(*_head);
-          if (PopUpTransform(r)) {
-            SpriteTransformQue(*_head,r);
-            SpriteEdUpdate(doc,doc_ce,*_head);
-          }
-          if (!SpriteQueSelCnt(*_head,FALSE))
-            SpriteQueSelAll(*_head,FALSE);
-          break;
-        case SPED_SHIFT_SUB_ORIGIN:
-          doc_ce->de_flags=old_de_flags;
-          insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num);
-          tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFT));
-          tmpg->type=SPT_SHIFT;
-          tmpg->p.x1=0;
-          tmpg->p.y1=0;
-          QueIns(tmpg,insert_pt->last);
-          GetMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN);
-          xx=arg1; yy=arg2;
-          do {
-            msg_code=GetMsg(&arg1,&arg2,
-                  1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-            tmpg->p.x1=arg1-xx;
-            tmpg->p.y1=arg2-yy;
-            SpriteEdUpdate(doc,doc_ce,*_head);
-          } while (msg_code!=MSG_MS_L_UP);
-          *_cur_elem_num+=1;
-          break;
-        case SPED_INS_CLIP:
-          RegOneTimePopUp(ARf_CSPRITE_INS_CLIP,
-                "You will probably want to shift around\n"
-                "the location of element groups.  Use\n"
-                "'Insert shift sub-origin' after picking the\n"
-                "element to insert before.  Or,\n"
-                "use 'shift points'.\n");
-          insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num);
-          unlock=DocLock(sys_clip_doc);
-          doc_e2=sys_clip_doc->head.next;
-          while (doc_e2!=sys_clip_doc) {
-            if (doc_e2->type_u8==DOCT_SPRITE) {
-              head2=Sprite2SpriteQue(doc_e2->bin_data->data);
-              if (head2->next!=head2) {
-                tmpg=head2->next;
-                while (tmpg!=head2) {
-                  *_cur_elem_num+=1;
-                  tmpg=tmpg->next;
-                }
-                next=head2->next;
-                last=head2->last;
-                insert_pt->last->next=next;
-                next->last=insert_pt->last;
-                insert_pt->last=last;
-                last->next=insert_pt;
-              }
-              Free(head2);
-            }
-            doc_e2=doc_e2->next;
-          }
-          if (unlock)
-            DocUnlock(sys_clip_doc);
-          SpriteEdUpdate(doc,doc_ce,*_head);
-          break;
-        case SPED_TEXT_ED:
-          if (SpriteEdText(_head,_cur_elem_num))
-            SpriteEdUpdate(doc,doc_ce,*_head);
-          break;
-      }
-    }
-  } while (i!=DOCM_CANCEL && i!=SPED_EXIT && i!=SPED_MAIN_MENU);
-  doc_ce->de_flags=old_de_flags;
-
-  switch (i) {
-    case DOCM_CANCEL:   return SPE_ABORT;
-    case SPED_EXIT:     return SPE_EXIT;
-    case SPED_MAIN_MENU:        return SPE_CONT;
-  }
-}
-
-#help_index "Graphics/Sprite;Sprites;Graphics/Math/3D Transformation"
-public U8 *SpriteTransform(U8 *elems,I64 *r)
-{//Rotate Sprite using 4x4 matrix. Uses fixed-point.
-  U8 *res;
-  CSprite *head=Sprite2SpriteQue(elems);
-  SpriteQueSelAll(head);
-  SpriteTransformQue(head,r);
-  res=SpriteQue2Sprite(head);
-  QueDel(head);
-  Free(head);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteMain.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteMain.HC.HTML deleted file mode 100755 index 808abdd..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteMain.HC.HTML +++ /dev/null @@ -1,1269 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-
-#define SPT_MENU        -2
-#define SPT_INS_SCRN_BITMAP             -3
-#define SPT_INS_TRANSPARENT_SCRN_BITMAP -4
-#define SPT_ED_MENU     -5
-#define SPT_EXIT        -6
-
-I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num,
-        CDoc *_doc,CDocEntry *_doc_e)
-{
-  CTask *pu_task;
-  I64   res;
-  CDoc *doc=DocNew;
-  CDocEntry *doc_de;
-  U8    *st;
-
-  doc_de=DocPrint(doc,"$PURPLE$$TX+CX,\"Sprite Main Menu\"$\n"
-        "$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteMain.DD.Z\"$\n"
-        "\n$LTBLUE$$DA+M,A=\"Tag Text:%%s\"$\n\n");
-  doc_de->data=StrNew(_doc_e->tag,doc->mem_task);
-  DocDataFmt(doc,doc_de);
-
-  DocPrint(doc,"$MU-UL,\"Color (4-bit)\",LE=SPT_COLOR$\n"
-        "$MU-UL,\"Dither Color (4-bit)\",LE=SPT_DITHER_COLOR$\n"
-        "$MU-UL,\"Thick\",LE=SPT_THICK$\n"
-        "$MU-UL,\"Planar Symmetry\",LE=SPT_PLANAR_SYMMETRY$\n"
-        "\n$MU-UL,\"Point\",LE=SPT_PT$\n"
-        "$MU-UL,\"Line\",LE=SPT_LINE$\n"
-        "$MU-UL,\"Arrow\",LE=SPT_ARROW$\n"
-        "$MU-UL,\"Rect\",LE=SPT_RECT$\n"
-        "$MU-UL,\"Circle\",LE=SPT_CIRCLE$\n"
-        "$MU-UL,\"Ellipse\",LE=SPT_ELLIPSE$\n"
-        "$MU-UL,\"Polygon\",LE=SPT_POLYGON$\n"
-        "$MU-UL,\"Text\",LE=SPT_TEXT$\n"
-        "$MU-UL,\"Text Box\",LE=SPT_TEXT_BOX$\n"
-        "$MU-UL,\"Text Diamond\",LE=SPT_TEXT_DIAMOND$\n"
-        "$MU-UL,\"Flood Fill\",LE=SPT_FLOOD_FILL$\n"
-        "$MU-UL,\"Flood Fill Not Color\",LE=SPT_FLOOD_FILL_NOT$\n"
-        "$MU-UL,\"PolyLine\",LE=SPT_POLYLINE$\n"
-        "$MU-UL,\"PolyPoint\",LE=SPT_POLYPT$\n"
-        "$MU-UL,\"BSpline2\",LE=SPT_BSPLINE2$\n"
-        "$MU-UL,\"BSpline3\",LE=SPT_BSPLINE3$\n"
-        "$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$\n"
-        "$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_CLOSED$\n"
-        "$MU-UL,\"Insert Scrn-Captured BitMap\",LE=SPT_INS_SCRN_BITMAP$\n"
-        "$MU-UL,\"Insert Transparent Scrn-Captured BitMap\","
-        "LE=SPT_INS_TRANSPARENT_SCRN_BITMAP$\n"
-        "$PURPLE$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$\n"
-        "$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\","
-        "LE=SPT_SHIFTABLE_MESH$\n"
-        "$MU-UL,\"+] Convert to BitMap or Edit BitMap\","
-        "LE=SPT_BITMAP$$LTBLUE$\n"
-        "\n$MU-UL,\"Transform On  (for use with 3D icons)\","
-        "LE=SPT_TRANSFORM_ON$\n"
-        "$MU-UL,\"Transform Off (for use with 3D icons)\","
-        "LE=SPT_TRANSFORM_OFF$\n"
-        "\n"
-        "$PURPLE$$MU-UL,\"+] Sprite Edit Menu\",LE=SPT_ED_MENU$$LTBLUE$\n"
-        "$MU-UL,\"Exit  Sprite\",LE=SPT_EXIT$\n"
-        "$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$\n"
-        "\nRight-Click to get back to this menu.");
-  st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num);
-  PopUp(st,NULL,&pu_task);
-  Free(st);
-  res=PopUpMenu(doc);
-  if (TaskValidate(pu_task)) {
-    *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num);
-    Kill(pu_task);
-  }
-  Free(_doc_e->tag);
-  _doc_e->tag=StrNew(doc_de->data,_doc->mem_task);
-  _doc->cur_col=0;
-  DocDel(doc);
-  return res;
-}
-
-Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2)
-{
-  I64 res;
-  CDoc *doc=DocNew;
-  CDocEntry *doc_e;
-  doc_e=DocPrint(doc,"  $DA,A=\"x1:%%d\"$\n");
-  doc_e->data=_x1;
-  DocDataFmt(doc,doc_e);
-  doc_e=DocPrint(doc,"  $DA,A=\"x2:%%d\"$\n");
-  doc_e->data=_x2;
-  DocDataFmt(doc,doc_e);
-  doc_e=DocPrint(doc,"  $DA,A=\"y1:%%d\"$\n");
-  doc_e->data=_y1;
-  DocDataFmt(doc,doc_e);
-  doc_e=DocPrint(doc,"  $DA,A=\"y2:%%d\"$\n\n");
-  doc_e->data=_y2;
-  DocDataFmt(doc,doc_e);
-
-  DocPrint(doc," $BT,\"Use These Extents\",LE=TRUE$");
-  DocPrint(doc,"$CM,3,0$$BT,\"Drag-Out New Extents\",LE=FALSE$\n\n");
-  do res=PopUpMenu(doc);
-  while (res!=FALSE && res!=TRUE);
-  DocDel(doc);
-  return res;
-}
-
-U0 SpriteScrnInit(CDC *dc,I64,I64)
-{
-//Uses fixed-point.
-  I64 xx,yy,old_pen_width=dc->thick;
-  CColorROPU32 old_color=dc->color;
-  Refresh;
-  DCFill(dc);
-  if (dc->flags&DCF_SYMMETRY) {
-    dc->flags&=~DCF_SYMMETRY;
-    dc->thick=1;
-    xx=dc->sym.sny*8192;
-    yy=-dc->sym.snx*8192;
-    dc->color=RED;
-    GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0,
-          dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,0);
-    dc->color=WHITE;
-    GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0,
-          dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,1);
-    dc->color=BLACK;
-    GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0,
-          dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,2);
-    dc->flags|=DCF_SYMMETRY;
-  }
-  dc->color=old_color;
-  dc->thick=old_pen_width;
-}
-
-CSprite *SMLine(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrLine3(dc,x1,y1,0,x2,y2,0);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrLine3(dc,x1,y1,0,x2,y2,0);
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_LINE));
-  res->type=SPT_LINE;
-  res->pp.x1=x1-x;
-  res->pp.y1=y1-y;
-  res->pp.x2=x2-x;
-  res->pp.y2=y2-y;
-  return res;
-}
-
-CSprite *SMArrow(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrArrow3(dc,x1,y1,0,x2,y2,0);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrArrow3(dc,x1,y1,0,x2,y2,0);
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_ARROW));
-  res->type=SPT_ARROW;
-  res->pp.x1=x1-x;
-  res->pp.y1=y1-y;
-  res->pp.x2=x2-x;
-  res->pp.y2=y2-y;
-  return res;
-}
-
-CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,old_width,old_flags;
-  CSprite *res;
-  old_width=dc->thick;
-  old_flags=dc->flags;
-  dc->flags&=~DCF_SYMMETRY;
-  dc->thick=1;
-  do {
-    dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-    GrLine3(dc,x1,y1,0,x2,y2,0);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  dc->flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY;
-  dc->thick=old_width;
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
-  res->type=SPT_PLANAR_SYMMETRY;
-  res->pp.x1=x1-x;
-  res->pp.y1=y1-y;
-  res->pp.x2=x2-x;
-  res->pp.y2=y2-y;
-  return res;
-}
-
-CSprite *SMRect(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,
-        xx1=arg1,yy1=arg2,xx2=arg1,yy2=arg2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-    if (x2<x1) {
-      xx1=x2; xx2=x1;
-    } else {
-      xx1=x1; xx2=x2;
-    }
-    if (y2<y1) {
-      yy1=y2; yy2=y1;
-    } else {
-      yy1=y1; yy2=y2;
-    }
-  } while (msg_code!=MSG_MS_L_UP);
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_RECT));
-  res->type=SPT_RECT;
-  res->pp.x1=xx1-x;
-  res->pp.y1=yy1-y;
-  res->pp.x2=xx2-x;
-  res->pp.y2=yy2-y;
-  return res;
-}
-
-CSprite *SMScrnBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,
-        I64 arg1,I64 arg2,CColorROPU32 bm_bkcolor)
-{
-  I64 i,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,
-        xx1=arg1,yy1=arg2,xx2=arg1,yy2=arg2,old_width;
-  CDC *dc3,*img;
-  CSprite *res;
-  old_width=dc2->thick;
-  dc2->thick=1;
-  do {
-    dc2->color=ROPF_DITHER+WHITE<<16+BLACK;
-    GrBorder(dc2,xx1+Fs->pix_left+Fs->scroll_x,yy1+Fs->pix_top+Fs->scroll_y,
-          xx2+Fs->pix_left+Fs->scroll_x,yy2+Fs->pix_top+Fs->scroll_y);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-    if (x2<x1) {
-      xx1=x2; xx2=x1;
-    } else {
-      xx1=x1; xx2=x2;
-    }
-    if (y2<y1) {
-      yy1=y2; yy2=y1;
-    } else {
-      yy1=y1; yy2=y2;
-    }
-  } while (msg_code!=MSG_MS_L_UP);
-  xx2++; yy2++;
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+((xx2-xx1+7)&~7)*(yy2-yy1));
-  res->type=SPT_BITMAP;
-  res->pwhu.width=xx2-xx1;
-  res->pwhu.height=yy2-yy1;
-  res->pwhu.x1=0;
-  res->pwhu.y1=0;
-  SpriteScrnInit(dc,x,y);
-  i=gr.scrn_zoom;
-  GrScaleZoom(1.0/i);
-  Refresh(2,TRUE);
-
-  dc3=DCScrnCapture;
-  img=DCExt(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1,
-        Fs->pix_left+Fs->scroll_x+xx2-1,Fs->pix_top+Fs->scroll_y+yy2-1);
-  if (eletype==SPT_INS_TRANSPARENT_SCRN_BITMAP)
-    DCColorChg(img,bm_bkcolor);
-  GrScaleZoom(i);
-  MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
-  DCDel(img);
-  DCDel(dc3);
-  dc2->thick=old_width;
-  Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
-        -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL;
-  return res;
-}
-
-CSprite *SMCircle(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)));
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)));
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_CIRCLE));
-  res->type=SPT_CIRCLE;
-  res->pr.x1=x1-x;
-  res->pr.y1=y1-y;
-  res->pr.radius=Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2));
-  return res;
-}
-
-CSprite *SMEllipse(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  F64 angle1,angle2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrEllipse3(dc,(x1+x2)>>1,(y1+y2)>>1,0,AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE));
-  res->type=SPT_ELLIPSE;
-  res->pwha.x1=(x1+x2)>>1-x;
-  res->pwha.y1=(y1+y2)>>1-y;
-  res->pwha.width =AbsI64(x1-x2)>>1;
-  res->pwha.height=AbsI64(y1-y2)>>1;
-  angle2=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y));
-  if (res->pwha.width<res->pwha.height)
-    angle2-=pi/2.0;
-  do {
-    angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y));
-    if (res->pwha.width>=res->pwha.height)
-      res->pwha.angle=-(angle1-angle2);
-    else
-      res->pwha.angle=-(angle1-angle2)+pi/2.0;
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0,
-          res->pwha.width,res->pwha.height,res->pwha.angle);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y));
-  if (res->pwha.width>=res->pwha.height)
-    res->pwha.angle=-(angle1-angle2);
-  else
-    res->pwha.angle=-(angle1-angle2)+pi/2.0;
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0,
-        res->pwha.width,res->pwha.height,res->pwha.angle);
-  return res;
-}
-
-CSprite *SMPolygon(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,I64 sides,
-        CColorROPU32 color)
-{
-  I64 msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  F64 angle1,angle2;
-  CSprite *res;
-  do {
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrRegPoly3(dc,(x1+x2)>>1,(y1+y2)>>1,0,
-          AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYGON));
-  res->type=SPT_POLYGON;
-  res->pwhas.x1=(x1+x2)>>1-x;
-  res->pwhas.y1=(y1+y2)>>1-y;
-  res->pwhas.width =AbsI64(x1-x2)>>1;
-  res->pwhas.height=AbsI64(y1-y2)>>1;
-  res->pwhas.sides=sides;
-  angle2=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y));
-  if (res->pwhas.width<res->pwhas.height)
-    angle2-=pi/2.0;
-  do {
-    angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y));
-    if (res->pwhas.width>=res->pwhas.height)
-      res->pwhas.angle=-(angle1-angle2);
-    else
-      res->pwhas.angle=-(angle1-angle2)+pi/2.0;
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0,
-          res->pwhas.width,res->pwhas.height,
-          res->pwhas.sides,res->pwhas.angle);
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    SpriteScrnInit(dc,x,y);
-    x2=arg1; y2=arg2;
-  } while (msg_code!=MSG_MS_L_UP);
-  angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y));
-  if (res->pwhas.width>=res->pwhas.height)
-    res->pwhas.angle=-(angle1-angle2);
-  else
-    res->pwhas.angle=-(angle1-angle2)+pi/2.0;
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0,
-        res->pwhas.width,res->pwhas.height,res->pwhas.sides,
-        res->pwhas.angle);
-  return res;
-}
-
-CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,
-        CColorROPU32 color)
-{
-  I64 i,num=0,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
-  I32 *ptr;
-  CD3I32 *p;
-  CSprite *res,*tmpg,*tmpg1,head2;
-
-  QueInit(&head2);
-  do {
-    do {
-      dc->color=color&COLORROP_NO_ROP0_MASK;
-      if (num)
-        GrLine3(dc,x1,y1,0,x2,y2,0);
-      msg_code=GetMsg(&arg1,&arg2,
-            1<<MSG_MS_L_UP+1<<MSG_MS_MOVE+1<<MSG_MS_R_UP);
-      dc->color=TRANSPARENT;
-      if (num)
-        GrLine3(dc,x1,y1,0,x2,y2,0);
-      x2=arg1; y2=arg2;
-    } while (msg_code!=MSG_MS_L_UP && msg_code!=MSG_MS_R_UP);
-    dc->color=color&COLORROP_NO_ROP0_MASK;
-    if (msg_code==MSG_MS_L_UP) {
-      if (num)
-        GrLine3(dc,x1,y1,0,x2,y2,0);
-      res=CAlloc(SpriteElemQuedBaseSize(SPT_PT));
-      res->type=SPT_PT;
-      res->p.x1=x2-x;
-      res->p.y1=y2-y;
-      QueIns(res,head2.last);
-      x1=x2;y1=y2;
-      num++;
-    }
-  } while (msg_code!=MSG_MS_R_UP);
-
-  switch (eletype) {
-    case SPT_POLYLINE:
-      if (num>1) {
-        res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32));
-        ptr=&res->nu.u;
-        tmpg1=head2.next;
-        for (i=0;i<num;i++) {
-          tmpg=tmpg1->next;
-          ptr[i<<1]=tmpg1->p.x1;
-          ptr[i<<1+1]=tmpg1->p.y1;
-          Free(tmpg1);
-          tmpg1=tmpg;
-        }
-        res->type=SPT_POLYLINE;
-        res->nu.num=num;
-      } else {
-        tmpg1=head2.next;
-        for (i=0;i<num;i++) {
-          tmpg=tmpg1->next;
-          Free(tmpg1);
-          tmpg1=tmpg;
-        }
-        res=NULL;
-      }
-      break;
-    case SPT_BSPLINE2:
-    case SPT_BSPLINE3:
-    case SPT_BSPLINE2_CLOSED:
-    case SPT_BSPLINE3_CLOSED:
-      if (num>2) {
-        res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32));
-        p=&res->nu.u;
-        tmpg1=head2.next;
-        for (i=0;i<num;i++) {
-          tmpg=tmpg1->next;
-          p[i].x=tmpg1->p.x1;
-          p[i].y=tmpg1->p.y1;
-          Free(tmpg1);
-          tmpg1=tmpg;
-        }
-        res->type=eletype;
-        res->nu.num=num;
-      } else {
-        tmpg1=head2.next;
-        for (i=0;i<num;i++) {
-          tmpg=tmpg1->next;
-          Free(tmpg1);
-          tmpg1=tmpg;
-        }
-        res=NULL;
-      }
-      break;
-  }
-  return res;
-}
-
-CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color)
-{
-  I64 i,num=0,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,x3,y3;
-  I32 *ptr;
-  CSprite *res,*tmpg,*tmpg1,head2;
-
-  QueInit(&head2);
-  x3=arg1-x; y3=arg2-y;
-  dc->color=color&COLORROP_NO_ROP0_MASK;
-  do {
-    msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-    x2=arg1; y2=arg2;
-    GrLine3(dc,x1,y1,0,x2,y2,0);
-    Line(&head2,x1-x,y1-y,0,x2-x,y2-y,0,&SpritePolyPtPlot);
-    x1=x2;y1=y2;
-  } while (msg_code!=MSG_MS_L_UP);
-
-  num=0;
-  res=head2.next;
-  x1=x3; y1=y3;
-  while (res!=&head2) {
-    tmpg=res->next;
-    if (res->p.x1==x1 && res->p.y1==y1) {
-      QueRem(res);
-      Free(res);
-    } else {
-      num++;
-      x1=res->p.x1;
-      y1=res->p.y1;
-    }
-    res=tmpg;
-  }
-
-  res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3);
-  res->npu.x=x3;
-  res->npu.y=y3;
-  ptr=&res->npu.u;
-  x1=x3; y1=y3;
-  i=0;
-  tmpg1=head2.next;
-  while (tmpg1!=&head2) {
-    tmpg=tmpg1->next;
-    BFieldOrU32(ptr,i,polypt_map[SignI64(tmpg1->p.x1-x1)+1+
-          3*(SignI64(tmpg1->p.y1-y1)+1)]);
-    i+=3;
-    x1=tmpg1->p.x1;y1=tmpg1->p.y1;
-    QueRem(tmpg1);
-    Free(tmpg1);
-    tmpg1=tmpg;
-  }
-  res->type=SPT_POLYPT;
-  res->npu.num=num;
-  return res;
-}
-
-U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,CDC *dc,
-        I64 x,I64 y,I64 arg1,I64 arg2,CColorROPU32 color,I64 *_cur_elem_num,
-        I64 old_de_flags)
-{
-  CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num);
-  I64 msg_code,x1,y1;
-  U8 *st;
-  doc_ce->de_flags|=DOCEF_DONT_DRAW;
-  st=PopUpGetStr("Enter text and press <ESC>.\n");
-  doc_ce->de_flags=old_de_flags;
-  if (st && *st) {
-    x1=0; y1=0;
-    do {
-      dc->color=color&COLORROP_NO_ROP0_MASK;
-      switch (eletype) {
-        case SPT_TEXT:          GrPrint3(dc,x1,y1,0,"%s",st);   break;
-        case SPT_TEXT_BOX:      GrTextBox3(dc,x1,y1,0,st);      break;
-        case SPT_TEXT_DIAMOND:  GrTextDiamond3(dc,x1,y1,0,st);  break;
-      }
-      msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-      SpriteScrnInit(dc,x,y);
-      x1=arg1; y1=arg2;
-    } while (msg_code!=MSG_MS_L_UP);
-    tmpg=CAlloc(SpriteElemQuedBaseSize(eletype)+StrLen(st)+1);
-    tmpg->type=eletype;
-    tmpg->ps.x1=x1-x;
-    tmpg->ps.y1=y1-y;
-    StrCpy(tmpg->ps.st,st);
-    QueIns(tmpg,insert_pt->last);
-    SpriteEdUpdate(doc,doc_ce,head);
-    *_cur_elem_num+=1;
-  }
-  Free(st);
-}
-
-I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
-        CDC *dc,I64 xx,I64 yy,I64 arg1,I64 arg2,CColorROPU32 bm_bkcolor,
-        Bool sel,I64 xx1=0,I64 yy1=0,I64 xx2=0,I64 yy2=0,I64 *_cur_elem_num)
-{
-  I64 i,msg_code,x=xx,y=yy,x1=arg1,y1=arg2,x2=arg1,y2=arg2,old_width;
-  CSprite *tmpg,*tmpg1,*insert_pt;
-  CDC *img;
-
-  insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y);
-  x+=xx; y+=yy;
-
-  if (sel) {
-    xx1=arg1; yy1=arg2;
-    xx2=arg1; yy2=arg2;
-    old_width=dc->thick;
-    dc->thick=1;
-    do {
-      dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-      GrBorder(dc,xx1,yy1,xx2,yy2);
-      msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
-      SpriteScrnInit(dc,x,y);
-      x2=arg1; y2=arg2;
-      if (x2<x1) {
-        xx1=x2; xx2=x1;
-      } else {
-        xx1=x1; xx2=x2;
-      }
-      if (y2<y1) {
-        yy1=y2; yy2=y1;
-      } else {
-        yy1=y1; yy2=y2;
-      }
-    } while (msg_code!=MSG_MS_L_UP);
-    dc->thick=old_width;
-  }
-
-  xx2++; yy2++;
-  tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
-        ((xx2-xx1+7)&~7)*(yy2-yy1));
-  tmpg->type=SPT_BITMAP;
-  tmpg->pwhu.width=xx2-xx1;
-  tmpg->pwhu.height=yy2-yy1;
-  tmpg->pwhu.x1=xx1-x;
-  tmpg->pwhu.y1=yy1-y;
-  img=DCNew(tmpg->pwhu.width,tmpg->pwhu.height,Fs);
-  img->color=bm_bkcolor;
-  GrRect(img,0,0,tmpg->pwhu.width,tmpg->pwhu.height);
-  tmpg1=insert_pt;
-  if (tmpg1==head || tmpg1->type&SPG_TYPE_MASK!=SPT_BITMAP) {
-    SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y));
-    x=xx; y=yy;
-    Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data);
-    QueDel(head);
-    insert_pt=head->next=head->last=head;
-    *_cur_elem_num=1;
-  } else {
-    SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y));
-    Sprite3(img,-(xx1-x),-(yy1-y),0,&tmpg1->start,TRUE);
-    insert_pt=tmpg1->next;
-    QueRem(tmpg1);
-    Free(tmpg1);
-  }
-  MemCpy(&tmpg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
-
-  switch (i=SpriteBitMapEd(doc,doc_ce,dc,&xx1,&yy1,
-        &xx2,&yy2,&img,bm_bkcolor)) {
-    case SPE_EXIT:
-    case SPE_CONT:
-      Free(tmpg);
-      tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
-            ((xx2-xx1+7)&~7)*(yy2-yy1));
-      tmpg->type=eletype;
-      tmpg->pwhu.width=xx2-xx1;
-      tmpg->pwhu.height=yy2-yy1;
-      tmpg->pwhu.x1=xx1-x;
-      tmpg->pwhu.y1=yy1-y;
-      MemCpy(&tmpg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
-      break;
-  }
-  QueIns(tmpg,insert_pt->last);
-  DCDel(img);
-  SpriteEdUpdate(doc,doc_ce,head);
-  return i;
-}
-
-U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
-{
-  CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
-        *tmpg1=insert_pt;
-  CD3I32 *p;
-  I64 i,size,x1,y1,z1;
-  I32 *mesh,*old_mesh;
-  if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_MESH)
-    old_mesh=&tmpg1->mu.vertex_cnt;
-  else if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
-    x1=tmpg1->pmu.x;
-    y1=tmpg1->pmu.y;
-    z1=tmpg1->pmu.z;
-    p=&tmpg1->pmu.u;
-    for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
-      p->x+=x1;
-      p->y+=y1;
-      p->z+=z1;
-    }
-    old_mesh=&tmpg1->pmu.vertex_cnt;
-  } else
-    old_mesh=NULL;
-  if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
-    tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size);
-    tmpg->type=SPT_MESH;
-    MemCpy(&tmpg->mu.vertex_cnt,mesh,size);
-    Free(mesh);
-    QueIns(tmpg,insert_pt->last);
-    SpriteEdUpdate(doc,doc_ce,head);
-    if (old_mesh) {
-      insert_pt=tmpg;
-      QueRem(tmpg1);
-      Free(tmpg1);
-      SpriteEdUpdate(doc,doc_ce,head);
-    } else
-      *_cur_elem_num+=1;
-  } else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
-    x1=tmpg1->pmu.x;
-    y1=tmpg1->pmu.y;
-    z1=tmpg1->pmu.z;
-    p=&tmpg1->pmu.u;
-    for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
-      p->x-=x1;
-      p->y-=y1;
-      p->z-=z1;
-    }
-  }
-}
-
-U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
-        I64 x,I64 y,I64 arg1,I64 arg2,I64 *_cur_elem_num)
-{
-  CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
-        *tmpg1=insert_pt;
-  CD3I32 *p;
-  I64 i,size,z,x1,y1,z1;
-  I32 *mesh,*old_mesh;
-  if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_MESH) {
-    z=0;
-    x1=-(arg1-x);
-    y1=-(arg2-y);
-    z1=z;
-    p=&tmpg1->mu.u;
-    for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
-      p->x+=x1;
-      p->y+=y1;
-      p->z+=z1;
-    }
-    old_mesh=&tmpg1->mu.vertex_cnt;
-  } else if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
-    z=-tmpg1->pmu.z;
-    x1=tmpg1->pmu.x-(arg1-x);
-    y1=tmpg1->pmu.y-(arg2-y);
-    z1=tmpg1->pmu.z+z;
-    p=&tmpg1->pmu.u;
-    for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
-      p->x+=x1;
-      p->y+=y1;
-      p->z+=z1;
-    }
-    old_mesh=&tmpg1->pmu.vertex_cnt;
-  } else {
-    z=0;
-    old_mesh=NULL;
-  }
-  if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
-    tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size);
-    tmpg->type=SPT_SHIFTABLE_MESH;
-    MemCpy(&tmpg->pmu.vertex_cnt,mesh,size);
-    Free(mesh);
-    tmpg->pmu.x=arg1-x;
-    tmpg->pmu.y=arg2-y;
-    tmpg->pmu.z=-z;
-    QueIns(tmpg,insert_pt->last);
-    SpriteEdUpdate(doc,doc_ce,head);
-    if (old_mesh) {
-      insert_pt=tmpg;
-      QueRem(tmpg1);
-      Free(tmpg1);
-      SpriteEdUpdate(doc,doc_ce,head);
-    } else
-      *_cur_elem_num+=1;
-  } else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
-    x1=tmpg1->pmu.x-(arg1-x);
-    y1=tmpg1->pmu.y-(arg2-y);
-    z1=tmpg1->pmu.z+z;
-    p=&tmpg1->pmu.u;
-    for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
-      p->x-=x1;
-      p->y-=y1;
-      p->z-=z1;
-    }
-  } else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_MESH) {
-    x1=-(arg1-x);
-    y1=-(arg2-y);
-    z1= z;
-    p=&tmpg1->mu.u;
-    for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
-      p->x-=x1;
-      p->y-=y1;
-      p->z-=z1;
-    }
-  }
-}
-
-U0 SMTaskTitleSet(I64 eletype)
-{
-  Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST
-  switch (eletype) {
-    case SPT_INS_SCRN_BITMAP:
-      StrCpy(Fs->task_title,"Insert Scrn BitMap");
-      break;
-    case SPT_INS_TRANSPARENT_SCRN_BITMAP:
-      StrCpy(Fs->task_title,"Insert Transparent Scrn BitMap");
-      break;
-    default:
-      if (eletype>=0)
-        StrCpy(Fs->task_title,DefineSub(eletype,"ST_SPRITE_ELEM_TYPES"));
-  }
-  Fs->border_src=BDS_CONST;
-}
-
-I64 SpriteMainEd(CDoc *doc)
-{
-  CDocEntry *doc_ce=doc->cur_entry;
-  I64 res,i,x,y,arg1,arg2,xx,yy,xx1,yy1,xx2,yy2,thick,eletype=SPT_MENU,
-        cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src,
-        old_de_flags=doc_ce->de_flags;
-  CColorROPU32 bm_bkcolor,color;
-  CSprite *head,*tmpg,*insert_pt;
-  CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3;
-  U8 *old_task_title=StrNew(Fs->task_title);
-
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  Refresh(2,TRUE);
-  dc2->flags|=DCF_ON_TOP;
-  head=Sprite2SpriteQue(doc_ce->bin_data->data);
-  cur_elem_num=QueCnt(head);
-  xx=(doc_ce->x+doc_ce->max_col-doc->line_start_col)*FONT_WIDTH;
-  yy=(doc_ce->y-doc->top_line_num)*FONT_HEIGHT;
-
-  while (TRUE) {
-    insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
-          &color,&thick,&x,&y);
-    x+=xx; y+=yy;
-    DCFill;
-    if (eletype==SPT_MENU) {
-      Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
-            -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL;
-      if (winmgr.fps<10)
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-      StrCpy(Fs->task_title,old_task_title);
-      Fs->border_src=old_border_src;
-      Fs->title_src =old_title_src;
-
-      xx-=StrLen(doc_ce->tag)*FONT_WIDTH;
-      eletype=PopUpSpriteMain(&head,&cur_elem_num,doc,doc_ce);
-      xx+=StrLen(doc_ce->tag)*FONT_WIDTH;
-      insert_pt=SpriteSetSettings(dc,head,cur_elem_num,x,y,
-            &color,&thick,&x,&y);
-      x+=xx; y+=yy;
-
-      SpriteEdUpdate(doc,doc_ce,head);
-      switch (eletype) {
-        case SPT_FLOOD_FILL:
-        case SPT_FLOOD_FILL_NOT:
-          RegOneTimePopUp(ARf_FLOODFILL,
-                ST_WARN_ST "This is affected by what's underneath\n"
-                "when it is drawn.  You will probably want to\n"
-                "convert it to a bitmap.\n\n"
-                "A tip on artistry you might consider\n"
-                "is using lines to fill regions because\n"
-                "brush strokes look cool.\n");
-          break;
-        case SPT_PLANAR_SYMMETRY:
-          RegOneTimePopUp(ARf_PLANAR_SYMMETRY,
-                "Right-click to turn-off symmetry.\n");
-          break;
-      }
-      doc_ce->de_flags=old_de_flags;
-    }
-    SMTaskTitleSet(eletype);
-    switch (eletype) {
-      case SPT_COLOR:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpColor(,,FALSE);
-        if (i>=0) {
-          color=i;
-          tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
-          tmpg->type=SPT_COLOR;
-          tmpg->c.color=color;
-          QueIns(tmpg,insert_pt->last);
-          SpriteEdUpdate(doc,doc_ce,head);
-          cur_elem_num++;
-        }
-        doc_ce->de_flags=old_de_flags;
-        eletype=SPT_MENU;
-        break;
-      case SPT_DITHER_COLOR:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpColorDither;
-        if (i>=0) {
-          color=i;
-          tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR));
-          tmpg->type=SPT_DITHER_COLOR;
-          tmpg->d.dither_color=color.c0.color|color.c1.color<<8;
-          QueIns(tmpg,insert_pt->last);
-          SpriteEdUpdate(doc,doc_ce,head);
-          cur_elem_num++;
-        }
-        doc_ce->de_flags=old_de_flags;
-        eletype=SPT_MENU;
-        break;
-      case SPT_ED_MENU:
-        switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) {
-          case SPE_ABORT:       eletype=DOCM_CANCEL;    break;
-          case SPE_EXIT:        eletype=SPT_EXIT;       break;
-          case SPE_CONT:        eletype=SPT_MENU;       break;
-        }
-        break;
-      case SPT_MESH:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        SMMesh(doc,doc_ce,head,&cur_elem_num);
-        doc_ce->de_flags=old_de_flags;
-        eletype=SPT_MENU;
-        break;
-      case SPT_SHIFTABLE_MESH:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        if (PopUpNoYes("Study the $LK,\"X-Caliber\","
-              "A=\"FF:::/PersonalMenu.DD.Z,X-Caliber\"$ icon.\n\n"
-              "It has black rectangle background with stars.  The\n"
-              "mesh is in front and rotates.  To keep the background\n"
-              "rectangle from rotating, "
-              "$GREEN$TRANSFORM OFF$FG$ has been used.\n\n"
-              "The X-Caliber mesh has a different origin for rotation.\n"
-              "To avoid clipping, it also has also been moved in the\n"
-              "negative Z direction by editing the sprite as text\n"
-              "and changing the first vector.\n\n"
-              "For the mesh you are creating, use same origin as\n"
-              "the rest of the sprite?  If $GREEN$YES$FG$, you can always\n"
-              "shift the mesh origin point in the sprite edit menu.\n")) {
-          doc_ce->de_flags=old_de_flags;
-          arg1=x; arg2=y;
-          SMShiftableMesh(doc,doc_ce,head,x,y,arg1,arg2,&cur_elem_num);
-          eletype=SPT_MENU;
-        } else
-          PopUpOk("Select Origin.\n");
-        doc_ce->de_flags=old_de_flags;
-        break;
-      case SPT_INS_SCRN_BITMAP:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
-        doc_ce->de_flags=old_de_flags;
-        Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_MS_L|WIF_FOCUS_TASK_MS_R|
-              WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL;
-        break;
-      case SPT_BITMAP:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpColor("Background Color\n\n",,FALSE);
-        if (i<0)
-          eletype=SPT_MENU;
-        else {
-          bm_bkcolor=i;
-          SpriteEdUpdate(doc,doc_ce,head);
-          SpriteExtents(doc_ce->bin_data->data,&xx1,&xx2,&yy1,&yy2);
-          if (!(xx1<=xx2 && yy1<=yy2))
-            xx1=xx2=yy1=yy2=0;
-          if (PopUpExtents(&xx1,&xx2,&yy1,&yy2)) {
-            doc_ce->de_flags=old_de_flags;
-            xx1+=xx; yy1+=yy;
-            xx2+=xx; yy2+=yy;
-            if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,arg1,arg2,bm_bkcolor,
-                  FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==SPE_EXIT) {
-              res=SPE_EXIT;
-              goto ei_done;
-            }
-            eletype=SPT_MENU;
-          }
-        }
-        doc_ce->de_flags=old_de_flags;
-        break;
-      case SPT_INS_TRANSPARENT_SCRN_BITMAP:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpColor("Color to Become Transparent\n\n",,FALSE);
-        if (i<0)
-          eletype=SPT_MENU;
-        else {
-          bm_bkcolor=i;
-          PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
-        }
-        doc_ce->de_flags=old_de_flags;
-        Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_MS_L|WIF_FOCUS_TASK_MS_R|
-              WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL;
-        break;
-      case SPT_THICK:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpRangeI64(1,16,1,"Thick\n");
-        if (i>=1) {
-          thick=i;
-          tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_THICK));
-          tmpg->type=SPT_THICK;
-          tmpg->t.thick=thick;
-          QueIns(tmpg,insert_pt->last);
-          SpriteEdUpdate(doc,doc_ce,head);
-          cur_elem_num++;
-        }
-        doc_ce->de_flags=old_de_flags;
-        eletype=SPT_MENU;
-        break;
-      case SPT_TRANSFORM_ON:
-      case SPT_TRANSFORM_OFF:
-        tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON));
-        if (eletype==SPT_TRANSFORM_ON)
-          tmpg->type=SPT_TRANSFORM_ON;
-        else
-          tmpg->type=SPT_TRANSFORM_OFF;
-        QueIns(tmpg,insert_pt->last);
-        SpriteEdUpdate(doc,doc_ce,head);
-        cur_elem_num++;
-        eletype=SPT_MENU;
-        break;
-      case SPT_POLYGON:
-        doc_ce->de_flags|=DOCEF_DONT_DRAW;
-        i=PopUpRangeI64(3,16,1,"Num of Sides\n");
-        doc_ce->de_flags=old_de_flags;
-        if (i<3)
-          eletype=SPT_MENU;
-        break;
-      case SPT_TEXT:
-      case SPT_TEXT_BOX:
-      case SPT_TEXT_DIAMOND:
-        SMTextFamily(eletype,doc,doc_ce,head,dc,xx,yy,arg1,arg2,
-              color,&cur_elem_num,old_de_flags);
-        eletype=SPT_MENU;
-        break;
-    }
-
-    if (eletype!=SPT_MENU) {
-      insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
-            &color,&thick,&x,&y);
-      x+=xx; y+=yy;
-      SpriteScrnInit(dc,x,y);
-      if (eletype==SPT_EXIT) {
-        res=SPE_EXIT;
-        goto ei_done;
-      } else if (eletype==DOCM_CANCEL) {
-        res=SPE_ABORT;
-        goto ei_done;
-      }
-      switch (GetMsg(&arg1,&arg2,
-            1<<MSG_KEY_DOWN|1<<MSG_MS_R_UP|1<<MSG_MS_L_DOWN)) {
-        case MSG_KEY_DOWN:
-          switch (arg1) {
-            case CH_ESC:
-              res=SPE_EXIT;
-              goto ei_done;
-            case CH_SHIFT_ESC:
-              res=SPE_ABORT;
-              goto ei_done;
-            case 'c': //eye-dropper
-              dc3=DCScrnCapture(FALSE);
-              color=GrPeek(dc3,ms.pos.x,ms.pos.y)^15;//Mouse cursor is XORed.
-              DCDel(dc3);
-              tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
-              tmpg->type=SPT_COLOR;
-              tmpg->c.color=color;
-              QueIns(tmpg,insert_pt->last);
-              SpriteEdUpdate(doc,doc_ce,head);
-              cur_elem_num++;
-              break;
-            case 't': //Set to transparent color
-              tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
-              tmpg->type=SPT_COLOR;
-              tmpg->c.color=TRANSPARENT;
-              QueIns(tmpg,insert_pt->last);
-              SpriteEdUpdate(doc,doc_ce,head);
-              cur_elem_num++;
-              break;
-          }
-          break;
-        case MSG_MS_R_UP:
-          if (eletype==SPT_PLANAR_SYMMETRY) {
-            tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
-            tmpg->type=SPT_PLANAR_SYMMETRY;
-            QueIns(tmpg,insert_pt->last);
-            SpriteEdUpdate(doc,doc_ce,head);
-            cur_elem_num++;
-            eletype=SPT_MENU;
-          } else
-            eletype=SPT_MENU;
-          break;
-        case MSG_MS_L_DOWN:
-          switch (eletype) {
-            start:
-              case SPT_LINE:
-                tmpg=SMLine(dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_ARROW:
-                tmpg=SMArrow(dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_PLANAR_SYMMETRY:
-                tmpg=SMPlanarSymmetry(dc,x,y,arg1,arg2);
-                eletype=SPT_MENU;
-                break;
-              case SPT_RECT:
-                tmpg=SMRect(dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_INS_SCRN_BITMAP:
-              case SPT_INS_TRANSPARENT_SCRN_BITMAP:
-                tmpg=SMScrnBitMap(eletype,dc,dc2,x,y,arg1,arg2,bm_bkcolor);
-                eletype=SPT_MENU;
-                break;
-              case SPT_CIRCLE:
-                tmpg=SMCircle(dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_ELLIPSE:
-                tmpg=SMEllipse(dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_POLYGON:
-                tmpg=SMPolygon(dc,x,y,arg1,arg2,i,color);
-                eletype=SPT_MENU;
-                break;
-              case SPT_PT:
-              case SPT_FLOOD_FILL:
-              case SPT_FLOOD_FILL_NOT:
-                tmpg=CAlloc(SpriteElemQuedBaseSize(eletype));
-                tmpg->type=eletype;
-                tmpg->p.x1=arg1-x;
-                tmpg->p.y1=arg2-y;
-                break;
-              case SPT_POLYLINE:
-              case SPT_BSPLINE2:
-              case SPT_BSPLINE3:
-              case SPT_BSPLINE2_CLOSED:
-              case SPT_BSPLINE3_CLOSED:
-                tmpg=SMPolyLineFamily(eletype,dc,x,y,arg1,arg2,color);
-                break;
-              case SPT_POLYPT:
-                tmpg=SMPolyPoint(dc,x,y,arg1,arg2,color);
-                break;
-            end:
-              if (tmpg) {
-                QueIns(tmpg,insert_pt->last);
-                SpriteEdUpdate(doc,doc_ce,head);
-                cur_elem_num++;
-              }
-              break;
-            case SPT_BITMAP:
-              if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,
-                    arg1,arg2,bm_bkcolor,TRUE,,,,,&cur_elem_num)==SPE_EXIT) {
-                res=SPE_EXIT;
-                goto ei_done;
-              }
-              doc_ce->de_flags=old_de_flags;
-              eletype=SPT_MENU;
-              break;
-            case SPT_SHIFTABLE_MESH:
-              GetMsg(NULL,NULL,1<<MSG_MS_L_UP);
-              doc_ce->de_flags|=DOCEF_DONT_DRAW;
-              SMShiftableMesh(doc,doc_ce,head,x,y,arg1,arg2,&cur_elem_num);
-              doc_ce->de_flags=old_de_flags;
-              eletype=SPT_MENU;
-              break;
-          }
-          break;
-      }
-    }
-  }
-ei_done:
-  DCFill;
-  SettingsPop;
-  doc_ce->de_flags=old_de_flags;
-  DCDel(dc);
-  DCDel(dc2);
-  StrCpy(Fs->task_title,old_task_title);
-  Free(old_task_title);
-  Fs->border_src=old_border_src;
-  Fs->title_src =old_title_src;
-  QueDel(head);
-  Free(head);
-  return res;
-}
-
-U0 EdSpriteIns(CDoc *doc)
-{
-  Bool unlock;
-  U8 *st;
-  CDocEntry *doc_e;
-  CDocBin *tmpb;
-  if (Fs!=doc->mem_task)
-    throw('Graphics');
-  if (st=EdSprite(doc->cur_bin_num)) {
-    unlock=DocLock(doc);
-    tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
-    tmpb->size=sprite_elem_base_sizes[SPT_END];
-    tmpb->data=CAlloc(tmpb->size,doc->mem_task);
-    tmpb->num=doc->cur_bin_num++;
-    tmpb->use_cnt=1;
-    QueIns(tmpb,doc->bin_head.last);
-    doc_e=DocPrint(doc,"%s",st);
-    doc_e->bin_data=tmpb;
-    Free(st);
-    if (doc_e) {
-      if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
-        tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
-      doc->cur_entry=doc_e;
-      doc->cur_col=0;
-      DocUnlock(doc);
-      DocRecalc(doc);
-      if (SpriteMainEd(doc)==SPE_ABORT) {
-        DocLock(doc);
-        DocEntryDel(doc,doc_e);
-      } else
-        SpriteSelAll(tmpb->data,FALSE);
-    } else
-      DocBinDel(doc,tmpb);
-    if (unlock)
-      DocUnlock(doc);
-  }
-  if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
-    DocBinsValidate(doc);
-}
-
-U0 EdSpriteEd(CDoc *doc)
-{
-  CDocEntry *doc_ce;
-  CDocBin *tmpb;
-  CSprite *old_csprite;
-  I64   old_size;
-  Bool unlock=DocLock(doc);
-  doc_ce=doc->cur_entry;
-  tmpb=doc_ce->bin_data;
-  old_size=tmpb->size;
-  old_csprite=tmpb->data;
-  tmpb->data=MAllocIdent(old_csprite,doc->mem_task);
-  DocUnlock(doc);
-  if (SpriteMainEd(doc)==SPE_ABORT) {
-    DocLock(doc);
-    Free(tmpb->data);
-    tmpb->data=old_csprite;
-    tmpb->size=old_size;
-  } else {
-    SpriteSelAll(tmpb->data,FALSE);
-    Free(old_csprite);
-  }
-  if (unlock)
-    DocUnlock(doc);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteMesh.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteMesh.HC.HTML deleted file mode 100755 index 5d52a61..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteMesh.HC.HTML +++ /dev/null @@ -1,1539 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Mesh"
-#define MESH_WORKSPACE_SIZE     4000
-
-#define VF_SEL          1
-#define VF_COPIED       2
-#define VF_IGNORE       4
-
-class CMeshEdVertex
-{
-  CMeshEdVertex *next,*last,*copy;
-
-  U0 start;
-  CD3I32 p; //World coordinates of the point.
-  U0 end;
-  CD3I32 p0,
-        pt; //Transformed coordinates.  (Scrn)
-  I32 num,flags;
-};
-
-#define TF_SEL  1
-#define TF_COPIED       2
-
-class CMeshEdTri
-{
-  CMeshEdTri *next,*last;
-
-  U0 start;
-  CMeshTri mt;
-  U0 end;
-
-  I32 cpu_num,flags; //Draw different tris with different cores.
-  CMeshEdVertex *t[3];
-};
-
-class CMeshFrame
-{
-  I64 ms_z,thickness; //Mouse Z-coordinate
-  I64 ed_mode,cx,cy;
-  CColorROPU32 cur_color;
-  Bool grid_on,flip_y,sel_rect,vertex_on,closed,pad[3];
-  I64 mp_not_done_flags; //Used for multiprocessing signaling.
-  F64 view_scale;
-  CDC *dc;
-  I32 *depth_buf;
-  I64 *w2s,*s2w; //Scrn-to-world and world-to-scrn transform matrices.
-  I64 vertex_cnt,tri_cnt; //Set by MeshSize
-  CMeshEdVertex vertex_head,*cur_vertex,*chain_pred;
-  CMeshEdTri    tri_head,*cur_tri;
-  I64 x1,y1,x2,y2,cur_snap;
-};
-
-CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z)
-{
-  CMeshEdVertex *tmpv=CAlloc(sizeof(CMeshEdVertex));
-  tmpv->p.x=x;
-  tmpv->p.y=y;
-  tmpv->p.z=z;
-  QueIns(tmpv,e->vertex_head.last);
-  return tmpv;
-}
-
-CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
-        CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3)
-{
-  static I64 cpu_num=0;
-  CMeshEdTri *tmpt=CAlloc(sizeof(CMeshEdTri));
-  tmpt->cpu_num=cpu_num++%mp_cnt;
-  tmpt->mt.color=color;
-  tmpt->t[0]=v1;
-  tmpt->t[1]=v2;
-  tmpt->t[2]=v3;
-  QueIns(tmpt,e->tri_head.last);
-  return tmpt;
-}
-
-CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
-{//Scrn coordinates
-  CMeshEdVertex *res=NULL,*tmpv=e->vertex_head.next;
-  I64 dd,dz,best_dd=I64_MAX,best_dz=I64_MAX;
-  while (tmpv!=&e->vertex_head) {
-    if (!(tmpv->flags&VF_IGNORE)) {
-      dd=SqrI64(x-tmpv->pt.x)+SqrI64(y-tmpv->pt.y);
-      dz=AbsI64(e->ms_z-tmpv->p.z);
-      if (dd<best_dd || dd==best_dd && dz<best_dz) {
-        res=tmpv;
-        best_dd=dd;
-        best_dz=dz;
-      }
-    }
-    tmpv=tmpv->next;
-  }
-  return res;
-}
-
-CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num)
-{
-  CMeshEdVertex *tmpv=haystack_e->vertex_head.next;
-  while (tmpv!=&haystack_e->vertex_head) {
-    if (tmpv->num==needle_num)
-      return tmpv;
-    tmpv=tmpv->next;
-  }
-  return NULL;
-}
-
-U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tmpt)
-{
-  if (tmpt) {
-    if (tmpt==e->cur_tri)
-      e->cur_tri=NULL;
-    QueRem(tmpt);
-    Free(tmpt);
-  }
-}
-
-U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tmpv)
-{
-  I64 i;
-  CMeshEdTri *tmpt,*tmpt1;
-  if (tmpv) {
-    tmpt=e->tri_head.next;
-    while (tmpt!=&e->tri_head) {
-      tmpt1=tmpt->next;
-      for (i=0;i<3;i++)
-        if (tmpt->t[i]==tmpv)
-          break;
-      if (i<3)
-        MeshTriDel(e,tmpt);
-      tmpt=tmpt1;
-    }
-    if (tmpv==e->cur_vertex)
-      e->cur_vertex=NULL;
-    if (tmpv==e->chain_pred)
-      e->chain_pred=NULL;
-    QueRem(tmpv);
-    Free(tmpv);
-  }
-}
-
-U0 MeshFence(CMeshFrame *e)
-{
-  CMeshEdVertex *tmpv,*tmpv1,*tmpv_last=NULL,*tmpv1_last=NULL,
-        *start=e->chain_pred->next,*end=e->vertex_head.last;
-  tmpv=start;
-  while (TRUE) {
-    tmpv1=MeshVertexNew(e,tmpv->p.x,tmpv->p.y,tmpv->p.z+e->thickness);
-    if (tmpv_last) {
-      MeshTriNew(e,e->cur_color,tmpv_last,tmpv,tmpv1);
-      MeshTriNew(e,e->cur_color,tmpv1,tmpv1_last,tmpv_last);
-    }
-    tmpv_last=tmpv;
-    tmpv1_last=tmpv1;
-    if (tmpv==end)
-      break;
-    tmpv=tmpv->next;
-  }
-  if (e->closed && tmpv_last) {
-    MeshTriNew(e,e->cur_color,tmpv_last,start,end->next);
-    MeshTriNew(e,e->cur_color,end->next,tmpv1_last,tmpv_last);
-  }
-}
-
-U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev)
-{
-  CMeshEdVertex *tmpv,*tmpv1;
-  if (start!=end) {
-    tmpv=start;
-    tmpv1=tmpv->next;
-    while (tmpv1!=end) {
-      if (rev)
-        MeshTriNew(e,e->cur_color,tmpv1,tmpv,end);
-      else
-        MeshTriNew(e,e->cur_color,tmpv,tmpv1,end);
-      tmpv=tmpv->next;
-      tmpv1=tmpv1->next;
-    }
-  }
-}
-
-U0 MeshPrism(CMeshFrame *e)
-{
-  CMeshEdVertex *start=e->chain_pred->next,*end=e->vertex_head.last;
-  MeshFence(e);
-  MeshPolygon(e,start,end,FALSE);
-  MeshPolygon(e,end->next,e->vertex_head.last,TRUE);
-}
-
-U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    if (val)
-      tmpv->flags|=VF_SEL;
-    else
-      tmpv->flags&=~VF_SEL;
-    tmpv=tmpv->next;
-  }
-}
-
-U0 MeshTriSelAll(CMeshFrame *e,Bool val)
-{
-  CMeshEdTri *tmpt=e->tri_head.next;
-  while (tmpt!=&e->tri_head) {
-    if (val)
-      tmpt->flags|=TF_SEL;
-    else
-      tmpt->flags&=~TF_SEL;
-    tmpt=tmpt->next;
-  }
-}
-
-U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    tmpv->flags&=~VF_IGNORE;
-    if (tmpv->flags&VF_SEL && val)
-      tmpv->flags|=VF_IGNORE;
-    tmpv=tmpv->next;
-  }
-}
-
-U0 MeshP0Capture(CMeshFrame *e)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    MemCpy(&tmpv->p0,&tmpv->p,sizeof(CD3I32));
-    tmpv=tmpv->next;
-  }
-}
-
-U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    if (tmpv->flags&VF_SEL) {
-      tmpv->p.x=tmpv->p0.x+dx;
-      tmpv->p.y=tmpv->p0.y+dy;
-      tmpv->p.z=tmpv->p0.z+dz;
-    }
-    tmpv=tmpv->next;
-  }
-}
-
-#define SEL_MESH_EQU    0
-#define SEL_MESH_OR     1
-#define SEL_MESH_AND    2
-
-U0 MeshVertexSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  if (x1>x2) SwapI64(&x1,&x2);
-  if (y1>y2) SwapI64(&y1,&y2);
-  while (tmpv!=&e->vertex_head) {
-    if (x1<=tmpv->pt.x<=x2 &&
-          y1<=tmpv->pt.y<=y2) {
-      if (sel_mode==SEL_MESH_AND)
-        tmpv->flags&=~VF_SEL;
-      else
-        tmpv->flags|=VF_SEL;
-    } else if (sel_mode==SEL_MESH_EQU)
-      tmpv->flags&=~VF_SEL;
-    tmpv=tmpv->next;
-  }
-}
-
-U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
-{
-  CMeshEdTri *tmpt=e->tri_head.next;
-  if (x1>x2) SwapI64(&x1,&x2);
-  if (y1>y2) SwapI64(&y1,&y2);
-  while (tmpt!=&e->tri_head) {
-    if (x1<=tmpt->t[0]->pt.x<=x2 &&
-          y1<=tmpt->t[0]->pt.y<=y2 &&
-          x1<=tmpt->t[1]->pt.x<=x2 &&
-          y1<=tmpt->t[1]->pt.y<=y2 &&
-          x1<=tmpt->t[2]->pt.x<=x2 &&
-          y1<=tmpt->t[2]->pt.y<=y2) {
-      if (sel_mode==SEL_MESH_AND)
-        tmpt->flags&=~TF_SEL;
-      else
-        tmpt->flags|=TF_SEL;
-    } else {
-      if (sel_mode==SEL_MESH_EQU)
-        tmpt->flags&=~TF_SEL;
-      else if (sel_mode==SEL_MESH_AND) {
-        if (x1<=tmpt->t[0]->pt.x<=x2 &&
-              y1<=tmpt->t[0]->pt.y<=y2 ||
-              x1<=tmpt->t[1]->pt.x<=x2 &&
-              y1<=tmpt->t[1]->pt.y<=y2 ||
-              x1<=tmpt->t[2]->pt.x<=x2 &&
-              y1<=tmpt->t[2]->pt.y<=y2)
-          tmpt->flags&=~TF_SEL;
-      }
-    }
-    tmpt=tmpt->next;
-  }
-}
-
-I64 MeshSelCnt(CMeshFrame *e)
-{
-  I64 res=0;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  CMeshEdTri *tmpt=e->tri_head.next;
-  while (tmpv!=&e->vertex_head) {
-    if (tmpv->flags&VF_SEL)
-      res++;
-    tmpv=tmpv->next;
-  }
-  while (tmpt!=&e->tri_head) {
-    if (tmpt->flags&TF_SEL)
-      res++;
-    tmpt=tmpt->next;
-  }
-  return res;
-}
-
-U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
-{
-  Bool unsel;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  if (!MeshSelCnt(e)) {
-    MeshVertexSelAll(e,TRUE);
-    unsel=TRUE;
-  } else
-    unsel=FALSE;
-  while (tmpv!=&e->vertex_head) {
-    if (tmpv->flags&VF_SEL)
-      SwapU32((&tmpv->p)(U8 *)+o1,(&tmpv->p)(U8 *)+o2);
-    tmpv=tmpv->next;
-  }
-  if (unsel)
-    MeshVertexSelAll(e,FALSE);
-}
-
-U0 MeshInvertAxis(CMeshFrame *e,I64 o)
-{
-  Bool unsel;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  if (!MeshSelCnt(e)) {
-    MeshVertexSelAll(e,TRUE);
-    unsel=TRUE;
-  } else
-    unsel=FALSE;
-  while (tmpv!=&e->vertex_head) {
-    if (tmpv->flags&VF_SEL)
-      *((&tmpv->p)(U8 *)+o)(I32 *)=-*((&tmpv->p)(U8 *)+o)(I32 *);
-    tmpv=tmpv->next;
-  }
-  if (unsel)
-    MeshVertexSelAll(e,FALSE);
-}
-
-U0 MeshTransformSel(CMeshFrame *e)
-{
-  Bool unsel;
-  I64 r[16],x,y,z;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  if (PopUpTransform(r)) {
-    if (!MeshSelCnt(e)) {
-      MeshVertexSelAll(e,TRUE);
-      unsel=TRUE;
-    } else
-      unsel=FALSE;
-    while (tmpv!=&e->vertex_head) {
-      if (tmpv->flags&VF_SEL) {
-        x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
-        Mat4x4MulXYZ(r,&x,&y,&z);
-        tmpv->p.x=x; tmpv->p.y=y; tmpv->p.z=z;
-      }
-      tmpv=tmpv->next;
-    }
-    if (unsel)
-      MeshVertexSelAll(e,FALSE);
-  }
-}
-
-U0 MeshColorTris(CMeshFrame *e)
-{
-  Bool unsel;
-  CMeshEdTri *tmpt=e->tri_head.next;
-  if (!MeshSelCnt(e)) {
-    MeshTriSelAll(e,TRUE);
-    unsel=TRUE;
-  } else
-    unsel=FALSE;
-  while (tmpt!=&e->tri_head) {
-    if (tmpt->flags & TF_SEL)
-      tmpt->mt.color=e->cur_color;
-    tmpt=tmpt->next;
-  }
-  if (unsel)
-    MeshTriSelAll(e,FALSE);
-}
-
-U0 MeshRevTris(CMeshFrame *e)
-{
-  Bool unsel;
-  CMeshEdTri *tmpt=e->tri_head.next;
-  if (!MeshSelCnt(e)) {
-    MeshTriSelAll(e,TRUE);
-    unsel=TRUE;
-  } else
-    unsel=FALSE;
-  while (tmpt!=&e->tri_head) {
-    if (tmpt->flags & TF_SEL)
-      SwapI64(&tmpt->t[1],&tmpt->t[2]);
-    tmpt=tmpt->next;
-  }
-  if (unsel)
-    MeshTriSelAll(e,FALSE);
-}
-
-U0 MeshRecalcCxCy(CTask *task,CMeshFrame *e)
-{
-  e->cx=RoundI64(task->pix_width/2 -task->horz_scroll.pos,e->cur_snap);
-  e->cy=RoundI64(task->pix_height/2-task->vert_scroll.pos,e->cur_snap);
-}
-
-U0 MeshCurSnap(CMeshFrame *e)
-{
-  I64 x1,y1,z1,x2,y2,z2;
-  if (e->w2s) {
-    x1=e->cur_snap<<16; y1=0; z1=0;
-    Mat4x4MulXYZ(e->w2s,&x1,&y1,&z1);
-    x2=0; y2=e->cur_snap<<16; z2=0;
-    Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2);
-    ms_grid.x=Max(1,MaxI64(x1,x2)>>16);
-    ms_grid.y=Max(1,MaxI64(y1,y2)>>16);
-    ms_grid.z=Min(ms_grid.x,ms_grid.y);
-  }
-}
-
-U0 MeshScaleZoom(CMeshFrame *e,F64 scale)
-{
-  CTask *task=Fs;
-  I64   x=ms.pos.x-task->pix_left-task->scroll_x-task->pix_width/2,
-        y=ms.pos.y-task->pix_top-task->scroll_y-task->pix_height/2;
-  task->horz_scroll.pos*=scale;
-  task->vert_scroll.pos*=scale;
-  task->horz_scroll.pos+=scale*x-x;
-  task->vert_scroll.pos+=scale*y-y;
-  e->view_scale*=scale;
-  MeshRecalcCxCy(task,e);
-  MeshCurSnap(e);
-}
-
-U0 MPDrawIt(CMeshFrame *e)
-{//Multiprocessing draw it, called by each core.
-
-  //Makes a copy of e->dc so we can change dc->color member and stuff.
-  CDC *dc=DCAlias(e->dc,e->dc->win_task);
-
-  CMeshEdTri *tmpt=e->tri_head.next;
-  I64 i,*old_r=dc->r;
-
-  //DCAlias() allocs a new identity rotation matrix.
-  //We want e->dc's rotation matrix.
-  dc->r=e->dc->r;
-  dc->depth_buf=e->depth_buf;
-  MemCpy(&dc->ls,&e->dc->ls,sizeof(CD3I32));
-
-  //... and translation (shift) vals.
-  dc->x=e->dc->x;
-  dc->y=e->dc->y;
-  dc->z=e->dc->z;
-  dc->flags|=DCF_TRANSFORMATION;
-
-  if (e->grid_on)
-//Draw grid with different cores.
-    for (i=-500+25*Gs->num;i<=500;i+=25*mp_cnt) {
-      if (i) {
-        dc->color=DKGRAY;
-        GrLine3(dc,i,-500,0,i,500,0);
-        dc->color=LTGRAY;
-        GrLine3(dc,-500,i,0,500,i,0);
-      }
-    }
-  if (!Gs->num) {
-    dc->color=RED;      //Y-Axis red
-    GrLine3(dc,0,0,0,0,500,0);
-    dc->color=ROPF_DITHER+RED;   //Y-Axis red
-    GrLine3(dc,0,-500,0,0,0,0);
-
-    dc->color=YELLOW;   //X-Axis yellow
-    GrLine3(dc,0,0,0,500,0,0);
-    dc->color=ROPF_DITHER+YELLOW;        //X-Axis yellow
-    GrLine3(dc,-500,0,0,0,0,0);
-
-    dc->color=GREEN;    //Z-Axis green
-    GrLine3(dc,0,0,0,0,0,500);
-    dc->color=ROPF_DITHER+GREEN;         //Z-Axis green
-    GrLine3(dc,0,0,-500,0,0,0);
-  }
-
-  while (tmpt!=&e->tri_head) {
-    if (tmpt->cpu_num==Gs->num) {
-      if (tmpt->flags & TF_SEL) {
-        if (Blink)
-          dc->color=ROPF_DITHER+WHITE<<16+RED;
-        else
-          dc->color=ROPF_DITHER+RED<<16+WHITE;
-        GrFillTri0(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
-      } else {
-        (*dc->lighting)(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,
-              &tmpt->t[2]->pt,tmpt->mt.color);
-        GrFillTri0(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
-      }
-    }
-    tmpt=tmpt->next;
-  }
-  dc->r=old_r;
-
-  //e->dc's depth buf was copied but we don't want it freed during DCDel().
-  dc->depth_buf=NULL;
-
-  DCDel(dc);
-  LBtr(&e->mp_not_done_flags,Gs->num);
-}
-
-I64 *MeshW2S(CMeshFrame *e,CTask *task)
-{//World to scrn coordinate transform matrix.
-  CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
-  CViewAngles *s=c->state;
-  I64 *r=Mat4x4IdentNew(task);
-  Mat4x4Scale(r,e->view_scale);
-  Mat4x4RotZ(r,s->az);
-  Mat4x4RotY(r,s->ay);
-  if (e->flip_y)
-    Mat4x4RotX(r,s->ax);
-  else
-    Mat4x4RotX(r,s->ax+pi);
-  return r;
-}
-
-I64 *MeshS2W(CMeshFrame *e,CTask *task)
-{//Scrn to world coordinate transform matrix.
-  CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
-  CViewAngles *s=c->state;
-  I64 *r=Mat4x4IdentNew(task);
-  if (e->flip_y)
-    Mat4x4RotX(r,-s->ax);
-  else
-    Mat4x4RotX(r,-(s->ax+pi));
-  Mat4x4RotY(r,-s->ay);
-  Mat4x4RotZ(r,-s->az);
-  Mat4x4Scale(r,1/e->view_scale);
-  return r;
-}
-
-I64 *MeshSetW2S(CMeshFrame *e,CTask *task)
-{
-  Free(e->w2s);
-  e->w2s=MeshW2S(e,task);
-  Free(e->s2w);
-  e->s2w=MeshS2W(e,task);
-//returned matrix is assigned to dc->r and will be freed by DCDel().
-  return Mat4x4New(e->w2s,task);
-}
-
-U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z)
-{
-  I64   x_shadow,y_shadow,z_shadow,
-        xc=ms.pos.x-task->pix_left-task->scroll_x-e->cx,
-        yc=ms.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0,
-        x=0,y=0,z=e->ms_z,
-        i,x2,y2,z2;
-  Mat4x4MulXYZ(e->w2s,&x,&y,&z); //scrn of Z vect
-
-  //Converges onto a solution for zc, an unknown.
-  for (i=0;i<128;i++) {
-    x_shadow=xc-x; //Shadow of mouse cursor on xy plane
-    y_shadow=yc-y;
-    z_shadow=zc-z;
-    Mat4x4MulXYZ(e->s2w,&x_shadow,&y_shadow,&z_shadow);
-    x2=0; y2=0; z2=-z_shadow;
-    Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2);
-    zc+=Round(Sqrt(x2*x2+y2*y2+z2*z2))*SignI64(z2);
-  }
-
-  x=xc-x;
-  y=yc-y;
-  z=zc-z;
-  Mat4x4MulXYZ(e->s2w,&x,&y,&z);
-  x=RoundI64(x,e->cur_snap);
-  y=RoundI64(y,e->cur_snap);
-  z=RoundI64(e->ms_z,e->cur_snap);
-  *_x=x; *_y=y; *_z=z;
-}
-
-CMeshEdVertex   sys_clip_vertex_head;
-CMeshEdTri      sys_clip_tri_head;
-
-U0 MeshClipInit()
-{
-  QueInit(&sys_clip_vertex_head);
-  QueInit(&sys_clip_tri_head);
-}
-
-U0 MeshClipRst()
-{
-  QueDel(&sys_clip_vertex_head,TRUE);
-  QueDel(&sys_clip_tri_head,TRUE);
-  MeshClipInit;
-}
-
-U0 MeshClipCopy(CMeshFrame *e)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv2;
-  CMeshEdTri    *tmpt=e->tri_head.next,*tmpt2;
-
-  MeshClipRst;
-  while (tmpv!=&e->vertex_head) {
-    if (tmpv->flags&VF_SEL) {
-      tmpv->copy=tmpv2=ACAlloc(sizeof(CMeshEdVertex));
-      MemCpy(&tmpv2->p,&tmpv->p,sizeof(CD3I32));
-      QueIns(tmpv2,sys_clip_vertex_head.last);
-      tmpv->flags|=VF_COPIED;
-      tmpv->flags&=~VF_SEL;
-    } else {
-      tmpv->copy=NULL;
-      tmpv->flags&=~(VF_COPIED|VF_SEL);
-    }
-    tmpv=tmpv->next;
-  }
-  while (tmpt!=&e->tri_head) {
-    if (tmpt->flags&TF_SEL &&
-          tmpt->t[0]->copy && tmpt->t[1]->copy && tmpt->t[2]->copy) {
-      tmpt2=ACAlloc(sizeof(CMeshEdTri));
-      tmpt2->t[0]=tmpt->t[0]->copy;
-      tmpt2->t[1]=tmpt->t[1]->copy;
-      tmpt2->t[2]=tmpt->t[2]->copy;
-      tmpt2->mt.color=tmpt->mt.color;
-      QueIns(tmpt2,sys_clip_tri_head.last);
-      tmpt->flags|=TF_COPIED;
-      tmpt->flags&=~TF_SEL;
-    } else
-      tmpt->flags&=~(TF_COPIED|TF_SEL);
-    tmpt=tmpt->next;
-  }
-}
-
-U0 MeshClipCut(CMeshFrame *e)
-{
-  CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
-  CMeshEdTri    *tmpt=e->tri_head.next,*tmpt1;
-  MeshClipCopy(e);
-  while (tmpt!=&e->tri_head) {
-    tmpt1=tmpt->next;
-    if (tmpt->flags&TF_COPIED)
-      MeshTriDel(e,tmpt);
-    tmpt=tmpt1;
-  }
-  while (tmpv!=&e->vertex_head) {
-    tmpv1=tmpv->next;
-    if (tmpv->flags&VF_COPIED)
-      MeshVertexDel(e,tmpv);
-    tmpv=tmpv1;
-  }
-}
-
-U0 MeshClipDel(CMeshFrame *e)
-{//Technically not clip
-  CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
-  CMeshEdTri    *tmpt=e->tri_head.next,*tmpt1;
-  while (tmpt!=&e->tri_head) {
-    tmpt1=tmpt->next;
-    if (tmpt->flags&TF_SEL)
-      MeshTriDel(e,tmpt);
-    tmpt=tmpt1;
-  }
-  while (tmpv!=&e->vertex_head) {
-    tmpv1=tmpv->next;
-    if (tmpv->flags&VF_SEL)
-      MeshVertexDel(e,tmpv);
-    tmpv=tmpv1;
-  }
-}
-
-U0 MeshClipPaste(CMeshFrame *e)
-{
-  CMeshEdVertex *tmpv2=sys_clip_vertex_head.next,*tmpv;
-  CMeshEdTri    *tmpt2=sys_clip_tri_head.next,*tmpt;
-
-  MeshVertexSelAll(e,FALSE);
-  MeshTriSelAll(e,FALSE);
-  while (tmpv2!=&sys_clip_vertex_head) {
-    tmpv2->copy=tmpv=CAlloc(sizeof(CMeshEdVertex));
-    MemCpy(&tmpv->p,&tmpv2->p,sizeof(CD3I32));
-    QueIns(tmpv,e->vertex_head.last);
-    tmpv->flags|=VF_SEL;
-    tmpv2=tmpv2->next;
-  }
-
-  while (tmpt2!=&sys_clip_tri_head) {
-    tmpt=MeshTriNew(e,tmpt2->mt.color,tmpt2->t[0]->copy,
-          tmpt2->t[1]->copy,tmpt2->t[2]->copy);
-    tmpt->flags|=TF_SEL;
-    tmpt2=tmpt2->next;
-  }
-}
-
-MeshClipInit;
-
-U0 DrawIt(CTask *task,CDC *dc)
-{
-  CMeshFrame *e=FramePtr("CMeshFrame",task);
-  CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
-  F64 d;
-  I64 i,x,y,z;
-  CMeshEdVertex *tmpv;
-
-  task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2;
-  task->horz_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_width)/2;
-  task->vert_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_height)/2;
-  task->vert_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_height)/2;
-  TaskDerivedValsUpdate(task);
-  MeshRecalcCxCy(task,e);
-
-  dc->flags|=DCF_TRANSFORMATION;
-
-  Free(dc->r); //Set rotmat doesn't free old dc->r matrix.
-  DCMat4x4Set(dc,MeshSetW2S(e,task));
-
-  dc->x=e->cx;
-  dc->y=e->cy;
-//z-vals less than zero are in front of scrn and not drawn.
-  //we want to shift all Z-vals into a drawable range.
-  //GR_Z_ALL is set to half of the Z-range which is an I32.
-  dc->z=GR_Z_ALL;
-
-  //Light source set to mouse.
-  MeshCursorW(e,task,&x,&y,&z);
-  dc->ls.x=x;
-  dc->ls.y=y;
-  dc->ls.z=z;
-  d=1<<16/D3I32Norm(&dc->ls); //Light source normalized to 65536.
-  dc->ls.x*=d;
-  dc->ls.y*=d;
-  dc->ls.z*=d;
-
-  DCDepthBufAlloc(dc);
-
-  tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
-    (*dc->transform)(dc,&x,&y,&z);
-    tmpv->pt.x=x; tmpv->pt.y=y; tmpv->pt.z=z;
-    tmpv=tmpv->next;
-  }
-
-  e->mp_not_done_flags=1<<mp_cnt-1; //Issue jobs to all cores.
-  e->dc=dc;
-  e->depth_buf=dc->depth_buf;
-  for (i=0;i<mp_cnt;i++)
-    JobQue(&MPDrawIt,e,i);
-
-  tmpv=e->vertex_head.next;
-  while (tmpv!=&e->vertex_head) {
-    x=tmpv->pt.x; y=tmpv->pt.y; z=tmpv->pt.z;
-    if (e->vertex_on) {
-      if (Blink(10)) //This blinks at 10 Hz.
-        dc->color=ROPF_DITHER+BLACK<<16+WHITE;
-      else
-        dc->color=ROPF_DITHER+WHITE<<16+BLACK;
-      GrLine(dc,x-3,y-3,x+3,y+3);
-      GrLine(dc,x-3,y+3,x+3,y-3);
-    }
-    if (tmpv->flags&VF_SEL) {
-      if (e->ed_mode=='t') {
-        if (Blink(10)) //This blinks at 10 Hz.
-          dc->color=ROPF_DITHER+e->cur_color.c0.color<<16+
-                e->cur_color.c0.color^8;
-        else
-          dc->color=ROPF_DITHER+(e->cur_color.c0.color^8)<<16+
-                e->cur_color.c0.color;
-      } else {
-        if (Blink)
-          dc->color=ROPF_DITHER+RED<<16+WHITE;
-        else
-          dc->color=ROPF_DITHER+WHITE<<16+RED;
-      }
-      GrCircle(dc,x,y,3);
-    }
-    tmpv=tmpv->next;
-  }
-
-  if (CtrlInside(c,ms.presnap.x,ms.presnap.y)||winmgr.show_menu) {
-    GridInit;
-    task->win_inhibit=WIF_SELF_DOC;
-  } else {
-    MeshCurSnap(e);
-    task->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER
-          -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL;
-  }
-
-  MeshCursorW(e,task,&x,&y,&z);
-  if (z<0)
-    dc->color=ROP_XOR+RED^TRANSPARENT;
-  else
-    dc->color=ROP_XOR+TRANSPARENT;
-  GrPrint(dc,0,0,"%6.3f%% (%d,%d,%d)",e->view_scale*100,x,y,z);
-  dc->thick=1;
-  dc->color&=0xF;
-  if (Blink(10))
-    dc->color^=0xF;
-  GrLine3(dc,x,y,z,x,y,0);
-
-  if (e->sel_rect) {
-    dc->flags&=~DCF_TRANSFORMATION;
-    dc->thick=1;
-    if (Blink)
-      dc->color=ROPF_DITHER+RED<<16+WHITE;
-    else
-      dc->color=ROPF_DITHER+WHITE<<16+RED;
-    GrBorder(dc,e->x1,e->y1,e->x2,e->y2);
-  }
-//Wait for all cores to complete.
-  while (e->mp_not_done_flags)
-    Yield;
-}
-
-U0 MeshInit(CMeshFrame *e,Bool flip_y)
-{
-  MemSet(e,0,sizeof(CMeshFrame));
-  QueInit(&e->vertex_head);
-  QueInit(&e->tri_head);
-  e->ed_mode='v';
-  e->grid_on=TRUE;
-  e->vertex_on=TRUE;
-  e->ms_z=0;
-  e->thickness=25;
-  e->closed=TRUE;
-  e->view_scale=1.0;
-  e->w2s=NULL;
-  e->s2w=NULL;
-  e->cur_color=RED;
-  e->cur_snap=5;
-  e->flip_y=flip_y;
-  e->sel_rect=FALSE;
-  e->cur_tri=NULL;
-  e->cur_vertex=NULL;
-  e->chain_pred=NULL;
-}
-
-U0 MeshLoad(CMeshFrame *e,U8 *src)
-{
-  I64 i,j,x,y,z;
-  CColorROPU32 color;
-  CMeshEdVertex *tmpv,*va[3];
-
-  QueInit(&e->vertex_head);
-  QueInit(&e->tri_head);
-
-  e->vertex_cnt  =*src(I32 *)++;
-  e->tri_cnt=*src(I32 *)++;
-  for (i=0;i<e->vertex_cnt;i++) {
-    x=*src(I32 *)++;
-    y=*src(I32 *)++;
-    z=*src(I32 *)++;
-    tmpv=MeshVertexNew(e,x,y,z);
-    tmpv->num=i;
-  }
-  for (i=0;i<e->tri_cnt;i++) {
-    color=*src(I32 *)++;
-    for (j=0;j<3;j++)
-      va[j]=MeshVertexFindNum(e,*src(I32 *)++);
-    MeshTriNew(e,color,va[0],va[1],va[2]);
-  }
-}
-
-I64 MeshSize(CMeshFrame *e)
-{
-  I64 i;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  CMeshEdTri    *tmpt=e->tri_head.next;
-
-  e->vertex_cnt=0;
-  while (tmpv!=&e->vertex_head) {
-    tmpv->num=e->vertex_cnt++;
-    tmpv=tmpv->next;
-  }
-
-  e->tri_cnt=0;
-  while (tmpt!=&e->tri_head) {
-    e->tri_cnt++;
-    for (i=0;i<3;i++)
-      tmpt->mt.nums[i]=tmpt->t[i]->num;
-    tmpt=tmpt->next;
-  }
-  return sizeof(I32)*2+
-        (offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+
-        (offset(CMeshEdTri.end)-offset(CMeshEdTri.start))*e->tri_cnt;
-}
-
-I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
-{
-  I64 size=MeshSize(e);
-  U8 *res=MAlloc(size),*dst=res;
-  CMeshEdVertex *tmpv=e->vertex_head.next;
-  CMeshEdTri    *tmpt=e->tri_head.next;
-
-  *dst(I32 *)++=e->vertex_cnt;
-  *dst(I32 *)++=e->tri_cnt;
-
-  e->vertex_cnt=0;
-  while (tmpv!=&e->vertex_head) {
-    MemCpy(dst,&tmpv->start,offset(CMeshEdVertex.end)
-    -offset(CMeshEdVertex.start));
-    dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start);
-    tmpv=tmpv->next;
-  }
-
-  e->tri_cnt=0;
-  while (tmpt!=&e->tri_head) {
-    MemCpy(dst,&tmpt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
-    dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start);
-    tmpt=tmpt->next;
-  }
-  if (_size) *_size=size;
-  return res;
-}
-
-U0 MeshCleanUp(CMeshFrame *e)
-{
-  QueDel(&e->vertex_head,TRUE);
-  QueDel(&e->tri_head,TRUE);
-  Free(e->w2s);
-  Free(e->s2w);
-}
-
-U0 MeshUpdateMenu(CMeshFrame *e)
-{
-  CMenuEntry *tmpse;
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Grid"))
-    tmpse->checked=ToBool(e->grid_on);
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Vertex"))
-    tmpse->checked=ToBool(e->vertex_on);
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex"))
-    tmpse->checked=ToBool(e->ed_mode=='v');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex"))
-    tmpse->checked=ToBool(e->ed_mode=='m');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ"))
-    tmpse->checked=ToBool(e->ed_mode=='M');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle"))
-    tmpse->checked=ToBool(e->ed_mode=='t');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon"))
-    tmpse->checked=ToBool(e->ed_mode=='n');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Fence"))
-    tmpse->checked=ToBool(e->ed_mode=='f');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Prism"))
-    tmpse->checked=ToBool(e->ed_mode=='p');
-  if (tmpse=MenuEntryFind(Fs->cur_menu,"View/FlipY"))
-    tmpse->checked=ToBool(e->flip_y);
-}
-
-I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
-{/*Fmt for mesh:
-{
-I32 vertex_cnt;
-I32 tri_cnt;
-CD3I32 vertices[];
-CMeshTri tris[];
-}
-
-If head points to a mesh, it will load it.
-
-Returns a newly malloced mesh or NULL.
-
-See ::/Demo/Graphics/SpritePlot3D.HC.
-*/
-  CCtrl *c=CtrlFindUnique(Fs,CTRLT_VIEWING_ANGLES);
-  CViewAngles *s,*old_s;
-  I64 i,msg_code,sel_mode,arg1,arg2,make_tri_vertex_num=0,x,y,z;
-  CD3I32 p0a,p0b;
-  CMeshEdVertex *va[3],*tmpv;
-  Bool adjusting_z=FALSE,moving,save_and_exit;
-  CMeshFrame e;
-
-  if (c) {
-    old_s=MAlloc(sizeof(CViewAngles));
-    MemCpy(old_s,c->state,sizeof(CViewAngles));
-  } else {
-    c=ViewAnglesNew;
-    old_s=NULL;
-  }
-
-  s=c->state;
-  s->sx=0;
-  s->sy=0;
-  s->sz=0;
-  s->cx=YELLOW;
-  s->cy=RED;
-  s->cz=GREEN;
-
-  MenuPush(
-        "File {"
-        "  Abort(,CH_SHIFT_ESC);"
-        "  Exit(,CH_ESC);"
-        "}"
-        "Edit {"
-        "  Delete(,,SC_DELETE);"
-        "  DelLast(,CH_BACKSPACE);"
-        "  Cut(,CH_CTRLX);"
-        "  Copy(,CH_CTRLC);"
-        "  Paste(,CH_CTRLV);"
-        "  SelectAll(,'A');"
-        "  UnSelectAll(,'U');"
-        "  SelectRect(,'a');"
-        "  UnSelectRect(,'u');"
-        "  OrSelectRect(,'o');"
-        "  JumpToZ(,'j');"
-        "  ResetColor(,'C');"
-        "  ReverseTri(,'r');"
-        "}"
-        "Mode {"
-        "  PlaceVertex(,'v');"
-        "  MoveVertex(,'m');"
-        "  MoveVertexZ(,'M');"
-        "  Triangle(,'t');"
-        "  Polygon(,'n');"
-        "  Fence(,'f');"
-        "  Prism(,'p');"
-        "}"
-        "Settings {"
-        "  Color(,'c');"
-        "  Snap(,'s');"
-        "}"
-        "View {"
-        "  ZoomIn(,'z');"
-        "  ZoomOut(,'Z');"
-        "  NullAngles(,'N');"
-        "  FlipY(,'y');"
-        "  Grid(,'g');"
-        "  Vertex(,'V');"
-        "  ToggleBorder(,CH_CTRLB);"
-        "}"
-        "Transforms {"
-        "  Transform(,'T');"
-        "  SwapXY(,'1');"
-        "  SwapXZ(,'2');"
-        "  SwapYZ(,'3');"
-        "  InvertX(,'4');"
-        "  InvertY(,'5');"
-        "  InvertZ(,'6');"
-        "  ReverseTri(,'R');"
-        "}");
-
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  RegOneTimePopUp(ARf_MESH_ED,
-        "$GREEN$Right Mouse$FG$: Hold and move to shift cursor z\n"
-        "$GREEN$'j'$FG$: Jump cursor Z to nearest vertex's Z\n"
-        "$GREEN$'v'$FG$: Place Vertex Mode\n"
-        "$GREEN$'m'$FG$: Move Vertex Mode\n"
-        "$GREEN$'M'$FG$: Move Vertex Z\n"
-        "$GREEN$'t'$FG$: Form Triangle Mode\n"
-        "$GREEN$'n'$FG$: Polygon Mode\n"
-        "$GREEN$'f'$FG$: Fence Mode\n"
-        "$GREEN$'p'$FG$: Prism Mode\n"
-        "$GREEN$'c'$FG$: Set color\n"
-        "$GREEN$'s'$FG$: Set snap\n"
-        "\nSee menu at top of scrn for more.\n");
-
-  Fs->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER
-        -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL;
-  Fs->horz_scroll.pos=0;
-  Fs->vert_scroll.pos=0;
-  MeshInit(&e,flip_y);
-  if (head)
-    MeshLoad(&e,head);
-  FramePtrAdd("CMeshFrame",&e);
-  Fs->draw_it=&DrawIt;
-  MeshCurSnap(&e);
-  MeshRecalcCxCy(Fs,&e);
-
-  try {//In case of <CTRL-ALT-c>
-    while (TRUE) {
-      MeshUpdateMenu(&e);
-      msg_code=GetMsg(&arg1,&arg2,
-            1<<MSG_MS_MOVE|1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|
-            1<<MSG_MS_L_UP|1<<MSG_MS_R_DOWN|1<<MSG_MS_R_UP);
-me_restart:
-      switch (msg_code) {
-        case MSG_KEY_DOWN:
-          switch (arg1) {
-            case 0:
-              switch (arg2.u8[0]) {
-                case SC_DELETE:
-                  if (arg2&SCF_SHIFT)
-                    goto me_clip_cut;
-                  else {
-                    if (MeshSelCnt(&e))
-                      MeshClipDel(&e);
-                    else if (e.ed_mode!='t')
-                      MeshVertexDel(&e,MeshVertexFindScrPt(&e,
-                            ms.presnap.x-Fs->pix_left-Fs->scroll_x,
-                            ms.presnap.y-Fs->pix_top-Fs->scroll_y));
-                    MeshVertexSelAll(&e,FALSE);
-                    MeshTriSelAll(&e,FALSE);
-                    make_tri_vertex_num=0;
-                  }
-                  break;
-                case SC_INS:
-                  if (arg2&SCF_CTRL)
-                    goto me_clip_copy;
-                  else if (arg2&SCF_SHIFT)
-                    goto me_clip_paste;
-              }
-              break;
-            case CH_BACKSPACE:
-              switch (e.ed_mode) {
-                case 'n':
-                case 'f':
-                case 'p':
-                case 'v':
-                  MeshVertexDel(&e,e.cur_vertex);
-                  break;
-                case 't':
-                  if (make_tri_vertex_num) {
-                    MeshVertexSelAll(&e,FALSE);
-                    MeshTriSelAll(&e,FALSE);
-                    make_tri_vertex_num=0;
-                  } else
-                    MeshTriDel(&e,e.cur_tri);
-                  break;
-              }
-              break;
-            case 'f':
-            case 'p':
-              e.thickness=PopUpGetI64("Thickness (%d):",e.thickness);
-            case 'n':
-              if (arg1=='n' || arg1=='p')
-                e.closed=TRUE;
-              else
-                e.closed=PopUpNoYes("Closed?\n");
-me_chain:
-              e.chain_pred=e.vertex_head.last;
-            case 't':
-              MeshVertexSelAll(&e,FALSE);
-              MeshTriSelAll(&e,FALSE);
-            case 'v':
-            case 'm':
-            case 'M':
-              adjusting_z=FALSE;
-              moving=FALSE;
-              e.ed_mode=arg1;
-              make_tri_vertex_num=0;
-              Snd;
-              break;
-            case 'T':
-              MeshTransformSel(&e);
-              break;
-            case 'A':
-              MeshTriSelAll(&e,TRUE);
-              if (e.ed_mode!='t')
-                MeshVertexSelAll(&e,TRUE);
-              else
-                MeshVertexSelAll(&e,FALSE);
-              make_tri_vertex_num=0;
-              break;
-            case 'U':
-              MeshTriSelAll(&e,FALSE);
-              MeshVertexSelAll(&e,FALSE);
-              make_tri_vertex_num=0;
-              break;
-            case 'a':
-            case 'u':
-            case 'o':
-              if (arg1=='a')
-                sel_mode=SEL_MESH_EQU;
-              else if (arg1=='u')
-                sel_mode=SEL_MESH_AND;
-              else
-                sel_mode=SEL_MESH_OR;
-              if ((msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|
-                    1<<MSG_MS_L_UP|1<<MSG_MS_R_DOWN|1<<MSG_MS_R_UP))
-                    !=MSG_MS_L_DOWN) {
-                Beep; Beep;
-                goto me_restart;
-              }
-              e.x1=arg1; e.y1=arg2;
-              e.x2=arg1; e.y2=arg2;
-              e.sel_rect=TRUE;
-              while (TRUE) {
-                msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_MOVE|1<<MSG_KEY_DOWN|
-                      1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_DOWN|
-                      1<<MSG_MS_R_UP);
-                if (msg_code==MSG_MS_MOVE) {
-                  e.x2=arg1; e.y2=arg2;
-                } else if (msg_code==MSG_MS_L_UP) {
-                  e.x2=arg1; e.y2=arg2;
-                  break;
-                } else {
-                  e.sel_rect=FALSE;
-                  Beep; Beep;
-                  goto me_restart;
-                }
-              }
-              e.sel_rect=FALSE;
-              MeshTriSelRect(&e,sel_mode,e.x1,e.x2,e.y1,e.y2);
-              if (e.ed_mode!='t')
-                MeshVertexSelRect(&e,sel_mode,e.x1,e.x2,e.y1,e.y2);
-              else
-                MeshVertexSelAll(&e,FALSE);
-              make_tri_vertex_num=0;
-              break;
-            case CH_CTRLB:
-              WinBorder(Bt(&Fs->display_flags,DISPLAYf_NO_BORDER));
-              break;
-            case CH_CTRLC:
-me_clip_copy:
-              if (e.ed_mode=='t') {
-                Beep;Beep;
-              } else
-                MeshClipCopy(&e);
-              break;
-            case CH_CTRLV:
-me_clip_paste:
-              if (e.ed_mode=='t') {
-                Beep;Beep;
-              } else {
-                MeshClipPaste(&e);
-                e.ed_mode='m';
-              }
-              break;
-            case CH_CTRLX:
-me_clip_cut:
-              if (e.ed_mode=='t') {
-                Beep;Beep;
-              } else
-                MeshClipCut(&e);
-              break;
-            case CH_SHIFT_ESC:
-              save_and_exit=FALSE;
-              goto me_done;
-            case CH_ESC:
-              save_and_exit=TRUE;
-              goto me_done;
-            case 'z':
-              MeshScaleZoom(&e,1.5);
-              break;
-            case 'Z':
-              MeshScaleZoom(&e,1/1.5);
-              break;
-            case 'c':
-              e.cur_color=PopUpColorLighting;
-              break;
-            case 's':
-              i=PopUpRangeI64(1,25,1,"New Snap\n");
-              if (i>=1)
-                e.cur_snap=i;
-              MeshCurSnap(&e);
-              MeshRecalcCxCy(Fs,&e);
-              break;
-            case 'g':
-              e.grid_on=!e.grid_on;
-              break;
-            case 'V':
-              e.vertex_on=!e.vertex_on;
-              break;
-            case 'N':
-              s->sx=s->sy=s->sz=0;
-              break;
-            case 'y':
-              e.flip_y=!e.flip_y;
-              break;
-            case 'j':
-              if (moving)
-                MeshVertexIgnoreSet(&e,TRUE);
-              if (tmpv=MeshVertexFindScrPt(&e,
-                    ms.pos.x-Fs->pix_left-Fs->scroll_x,
-                    ms.pos.y-Fs->pix_top-Fs->scroll_y)) {
-                Noise(25,86,110);
-                e.ms_z=RoundI64(tmpv->p.z,e.cur_snap);
-              } else {
-                Beep; Beep;
-                e.ms_z=0;
-              }
-              MeshVertexIgnoreSet(&e,FALSE);
-              if (moving) {
-                MeshCursorW(&e,Fs,&x,&y,&z);
-                if (adjusting_z)
-                  MeshP0Offset(&e,0,0,z-p0a.z);
-                else
-                  MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z);
-                p0a.x=x;
-                p0a.y=y;
-                p0a.z=z;
-                MeshP0Capture(&e);
-              }
-              break;
-            case '1':
-              MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.y));
-              break;
-            case '2':
-              MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.z));
-              break;
-            case '3':
-              MeshSwapAxes(&e,offset(CD3I32.y),offset(CD3I32.z));
-              break;
-            case '4':
-              MeshInvertAxis(&e,offset(CD3I32.x));
-              break;
-            case '5':
-              MeshInvertAxis(&e,offset(CD3I32.y));
-              break;
-            case '6':
-              MeshInvertAxis(&e,offset(CD3I32.z));
-              break;
-            case 'r':
-              if (e.cur_tri)
-                SwapI64(&e.cur_tri->t[1],&e.cur_tri->t[2]);
-              break;
-            case 'C':
-              MeshColorTris(&e);
-              break;
-            case 'R':
-              MeshRevTris(&e);
-              break;
-          }
-          break;
-        case MSG_MS_L_DOWN:
-          switch (e.ed_mode) {
-            case 'm':
-              if (!moving) {
-                if (!MeshSelCnt(&e) &&
-                      (tmpv=MeshVertexFindScrPt(&e,arg1,arg2))) {
-                  tmpv->flags|=VF_SEL;
-                  e.ms_z=RoundI64(tmpv->p.z,e.cur_snap);
-                }
-                if (MeshSelCnt(&e)) {
-                  MeshCursorW(&e,Fs,&x,&y,&z);
-                  p0a.x=x;
-                  p0a.y=y;
-                  p0a.z=z;
-                  MeshP0Capture(&e);
-                  moving=TRUE;
-                }
-              }
-              break;
-            case 'M':
-              if (!adjusting_z && !moving) {
-                if (!MeshSelCnt(&e) &&
-                      (tmpv=MeshVertexFindScrPt(&e,arg1,arg2))) {
-                  tmpv->flags|=VF_SEL;
-                  e.ms_z=RoundI64(tmpv->p.z,e.cur_snap);
-                }
-                if (MeshSelCnt(&e)) {
-                  MeshCursorW(&e,Fs,&x,&y,&z);
-                  p0a.x=x;
-                  p0a.y=y;
-                  p0a.z=z;
-                  MeshP0Capture(&e);
-                  moving=TRUE;
-
-                  p0b.x=ms.presnap.x;
-                  p0b.y=ms.presnap.y;
-                  p0b.z=e.ms_z;
-                  adjusting_z=TRUE;
-                  Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
-                }
-              }
-              break;
-          }
-          break;
-        case MSG_MS_L_UP:
-          switch (e.ed_mode) {
-            case 'n':
-            case 'f':
-            case 'p':
-            case 'v':
-              Noise(25,86,110);
-              MeshCursorW(&e,Fs,&x,&y,&z);
-              e.cur_vertex=MeshVertexNew(&e,x,y,z);
-              break;
-            case 'm':
-            case 'M':
-              if (moving) {
-                if (adjusting_z) {
-                  e.ms_z=RoundI64(Sign(p0b.y-ms.presnap.y)
-                  *Sqrt(Sqr(p0b.x-ms.presnap.x)+Sqr(p0b.y-ms.presnap.y))
-                  +p0b.z,e.cur_snap);
-                  Snd;
-                  adjusting_z=FALSE;
-                  MeshCursorW(&e,Fs,&x,&y,&z);
-                  MeshP0Offset(&e,0,0,z-p0a.z);
-                } else {
-                  MeshCursorW(&e,Fs,&x,&y,&z);
-                  MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z);
-                }
-                MeshTriSelAll(&e,FALSE);
-                MeshVertexSelAll(&e,FALSE);
-                moving=FALSE;
-              }
-              break;
-            case 't':
-              if (tmpv=MeshVertexFindScrPt(&e,arg1,arg2)) {
-                for (i=0;i<make_tri_vertex_num;i++)
-                  if (va[i]==tmpv) {
-                    Beep; Beep;
-                    break;
-                  }
-                if (i==make_tri_vertex_num) {
-                  Noise(25,86,110);
-                  va[make_tri_vertex_num++]=tmpv;
-                  tmpv->flags|=VF_SEL;
-                  if (make_tri_vertex_num==3) {
-                    e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]);
-                    for (i=0;i<make_tri_vertex_num;i++)
-                      va[i]->flags&=~VF_SEL;
-                    make_tri_vertex_num=0;
-                  }
-                }
-              }
-              break;
-          }
-          break;
-        case MSG_MS_R_DOWN:
-          if (!adjusting_z && e.ed_mode!='M' &&
-                (e.chain_pred==e.vertex_head.last ||
-                e.ed_mode!='n' && e.ed_mode!='f' && e.ed_mode!='p')) {
-            if (moving) {
-              MeshCursorW(&e,Fs,&x,&y,&z);
-              MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z);
-              p0a.x=x;
-              p0a.y=y;
-              p0a.z=z;
-              MeshP0Capture(&e);
-            }
-            p0b.x=ms.presnap.x;
-            p0b.y=ms.presnap.y;
-            p0b.z=e.ms_z;
-            adjusting_z=TRUE;
-            Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
-          }
-          break;
-        case MSG_MS_R_UP:
-          if (adjusting_z) {
-            e.ms_z=RoundI64(Sign(p0b.y-ms.presnap.y)
-            *Sqrt(Sqr(p0b.x-ms.presnap.x)+Sqr(p0b.y-ms.presnap.y))
-            +p0b.z,e.cur_snap);
-            Snd;
-            adjusting_z=FALSE;
-            if (moving) {
-              MeshCursorW(&e,Fs,&x,&y,&z);
-              MeshP0Offset(&e,0,0,z-p0a.z);
-              p0a.x=x;
-              p0a.y=y;
-              p0a.z=z;
-              MeshP0Capture(&e);
-            }
-          } else  if (e.ed_mode=='n') {
-            if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
-              MeshPolygon(&e,e.chain_pred->next,e.vertex_head.last,FALSE);
-            arg1=e.ed_mode;
-            goto me_chain;
-          } else if (e.ed_mode=='f') {
-            if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
-              MeshFence(&e);
-            arg1=e.ed_mode;
-            goto me_chain;
-          } else if (e.ed_mode=='p') {
-            if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
-              MeshPrism(&e);
-            arg1=e.ed_mode;
-            goto me_chain;
-          }
-          break;
-        case MSG_MS_MOVE:
-          if (adjusting_z) {
-            e.ms_z=RoundI64(Sign(p0b.y-ms.presnap.y)
-            *Sqrt(Sqr(p0b.x-ms.presnap.x)+Sqr(p0b.y-ms.presnap.y))
-            +p0b.z,e.cur_snap);
-            Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
-          }
-          if (moving) {
-            MeshCursorW(&e,Fs,&x,&y,&z);
-            if (adjusting_z)
-              MeshP0Offset(&e,0,0,z-p0a.z);
-            else
-              MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z);
-            p0a.x=x;
-            p0a.y=y;
-            p0a.z=z;
-            MeshP0Capture(&e);
-          }
-          break;
-      }
-    }
-me_done:
-  } catch
-    Fs->catch_except=TRUE;
-  SettingsPop;
-  MenuPop;
-  if (save_and_exit)
-    head=MeshSave(&e,_size);
-  else
-    head=NULL;
-  MeshCleanUp(&e);
-  FramePtrDel("CMeshFrame");
-  if (old_s) {
-    MemCpy(c->state,old_s,sizeof(CViewAngles));
-    Free(old_s);
-  } else
-    ViewAnglesDel;
-  return head;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteNew.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteNew.HC.HTML deleted file mode 100755 index c75aad5..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteNew.HC.HTML +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-#help_file "::/Doc/Sprite"
-
-U8 polypt_map[9]={0,1,2,3,0,4,5,6,7};
-
-I64 sprite_elem_base_sizes[SPT_TYPES_NUM]={
-  sizeof(CSpriteBase),          //SPT_END
-  sizeof(CSpriteColor),         //SPT_COLOR
-  sizeof(CSpriteDitherColor),   //SPT_DITHER_COLOR
-  sizeof(CSpriteT),             //SPT_THICK
-  sizeof(CSpritePtPt),          //SPT_PLANAR_SYMMETRY
-  sizeof(CSpriteBase),          //SPT_TRANSFORM_ON
-  sizeof(CSpriteBase),          //SPT_TRANSFORM_OFF
-  sizeof(CSpritePt),            //SPT_SHIFT
-  sizeof(CSpritePt),            //SPT_PT
-  sizeof(CSpriteNumPtU8s),      //SPT_POLYPT
-  sizeof(CSpritePtPt),          //SPT_LINE
-  sizeof(CSpriteNumU8s),        //SPT_POLYLINE
-  sizeof(CSpritePtPt),          //SPT_RECT
-  sizeof(CSpritePtPtAng),       //SPT_ROTATED_RECT
-  sizeof(CSpritePtRad),         //SPT_CIRCLE
-  sizeof(CSpritePtWHAng),       //SPT_ELLIPSE
-  sizeof(CSpritePtWHAngSides),  //SPT_POLYGON
-  sizeof(CSpriteNumU8s),        //SPT_BSPLINE2
-  sizeof(CSpriteNumU8s),        //SPT_BSPLINE2_CLOSED
-  sizeof(CSpriteNumU8s),        //SPT_BSPLINE3
-  sizeof(CSpriteNumU8s),        //SPT_BSPLINE3_CLOSED
-  sizeof(CSpritePt),            //SPT_FLOOD_FILL
-  sizeof(CSpritePt),            //SPT_FLOOD_FILL_NOT
-  sizeof(CSpritePtWHU8s),       //SPT_BITMAP
-  sizeof(CSpriteMeshU8s),       //SPT_MESH
-  sizeof(CSpritePtMeshU8s),     //SPT_SHIFTABLE_MESH
-  sizeof(CSpritePtPt),          //SPT_ARROW
-  sizeof(CSpritePtStr),         //SPT_TEXT
-  sizeof(CSpritePtStr),         //SPT_TEXT_BOX
-  sizeof(CSpritePtStr),         //SPT_TEXT_DIAMOND
-};
-
-I64 SpriteElemQuedBaseSize(I64 type)
-{
-  return sprite_elem_base_sizes[type&SPG_TYPE_MASK]+offset(CSprite.start);
-}
-
-I64 SpriteElemSize(CSprite *tmpg)
-{
-  I64 i=sprite_elem_base_sizes[tmpg->type&SPG_TYPE_MASK];
-  switch (tmpg->type&SPG_TYPE_MASK) {
-    case SPT_POLYLINE:
-      i+=tmpg->nu.num*sizeof(CD2I32);
-      break;
-    case SPT_TEXT:
-    case SPT_TEXT_BOX:
-    case SPT_TEXT_DIAMOND:
-      i+=StrLen(tmpg->ps.st)+1;
-      break;
-    case SPT_BITMAP:
-      i+=((tmpg->pwhu.width+7)&~7)*tmpg->pwhu.height;
-      break;
-    case SPT_POLYPT:
-      i+=(tmpg->npu.num*3+7)>>3;
-      break;
-    case SPT_BSPLINE2:
-    case SPT_BSPLINE3:
-    case SPT_BSPLINE2_CLOSED:
-    case SPT_BSPLINE3_CLOSED:
-      i+=tmpg->nu.num*sizeof(CD3I32);
-      break;
-    case SPT_MESH:
-      i+=tmpg->mu.vertex_cnt*sizeof(CD3I32)+
-            tmpg->mu.tri_cnt*sizeof(CMeshTri);
-      break;
-    case SPT_SHIFTABLE_MESH:
-      i+=tmpg->pmu.vertex_cnt*sizeof(CD3I32)+
-            tmpg->pmu.tri_cnt*sizeof(CMeshTri);
-      break;
-  }
-  return i;
-}
-
-public I64 SpriteSize(U8 *elems)
-{//Walk sprite elements and return size of sprite as binary data.
-  CSprite *tmpg=elems-offset(CSprite.start),*tmpg1=tmpg;
-  while (tmpg->type&SPG_TYPE_MASK)
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-  return tmpg(U8 *)-tmpg1(U8 *)+sprite_elem_base_sizes[SPT_END];
-}
-
-I64 SpriteTypeMask(U8 *elems)
-{
-  I64 res=0;
-  CSprite *tmpg=elems-offset(CSprite.start);
-  while (tmpg->type&SPG_TYPE_MASK) {
-    if (tmpg->type&SPG_TYPE_MASK>=SPT_TYPES_NUM)
-      return 1<<SPT_TYPES_NUM;
-    Bts(&res,tmpg->type&SPG_TYPE_MASK);
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-  }
-  return res;
-}
-
-U0 SpriteSelAll(U8 *elems,Bool val)
-{
-  CSprite *tmpg=elems-offset(CSprite.start);
-  while (tmpg->type&SPG_TYPE_MASK) {
-    BEqu(&tmpg->type,SPf_SEL,val);
-    tmpg(U8 *)+=SpriteElemSize(tmpg);
-  }
-}
-
-public U8 *DC2Sprite(CDC *tmpb)
-{//Convert device context to sprite.
-  CSprite *tmpg;
-  tmpg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+
-        tmpb->width_internal*tmpb->height+
-        sprite_elem_base_sizes[SPT_END])
-  (U8 *)-offset(CSprite.start);
-  tmpg->type=SPT_BITMAP;
-  tmpg->pwhu.width=tmpb->width;
-  tmpg->pwhu.height=tmpb->height;
-  tmpg->pwhu.x1=0;
-  tmpg->pwhu.y1=0;
-  MemCpy(&tmpg->pwhu.u,tmpb->body,tmpb->width_internal*tmpb->height);
-  return tmpg(U8 *)+offset(CSprite.start);
-}
-
-public U8 *SpriteElem2Summary(CSprite *tmpg)
-{//Study ::/Demo/Graphics/SpriteText.HC.
-  U8 buf[STR_LEN],buf2[STR_LEN];
-  I32 *ptr;
-  StrPrint(buf,"%Z",tmpg->type&SPG_TYPE_MASK,"ST_SPRITE_ELEM_TYPES");
-  switch (tmpg->type&SPG_TYPE_MASK) {
-    case SPT_COLOR:
-      CatPrint(buf," %s",Color2Str(buf2,tmpg->c.color));
-      break;
-    case SPT_DITHER_COLOR:
-      CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
-            tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
-      break;
-    case SPT_PT:
-    case SPT_FLOOD_FILL:
-    case SPT_FLOOD_FILL_NOT:
-    case SPT_SHIFT:
-      CatPrint(buf," (%d,%d)",tmpg->p.x1,tmpg->p.y1);
-      break;
-    case SPT_LINE:
-    case SPT_ARROW:
-    case SPT_PLANAR_SYMMETRY:
-    case SPT_RECT:
-    case SPT_ROTATED_RECT:
-      CatPrint(buf," (%d,%d),(%d,%d)",tmpg->pp.x1,tmpg->pp.y1,
-            tmpg->pp.x2,tmpg->pp.y2);
-      break;
-    case SPT_CIRCLE:
-      CatPrint(buf," (%d,%d):%dR",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
-      break;
-    case SPT_THICK:
-      CatPrint(buf," %d",tmpg->t.thick);
-      break;
-    case SPT_TEXT:
-    case SPT_TEXT_BOX:
-    case SPT_TEXT_DIAMOND:
-      CatPrint(buf," %d,%d:%-16t$Q",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
-      break;
-    case SPT_POLYLINE:
-    case SPT_POLYPT:
-      ptr=&tmpg->npu.x;
-      CatPrint(buf," %d (%d,%d)",tmpg->npu.num,ptr[0],ptr[1]);
-      break;
-    case SPT_ELLIPSE:
-    case SPT_POLYGON:
-    case SPT_BITMAP:
-      CatPrint(buf," (%d,%d):%dW,%dH",tmpg->pwhu.x1,tmpg->pwhu.y1,
-            tmpg->pwhu.width,tmpg->pwhu.height);
-      break;
-    case SPT_BSPLINE2:
-    case SPT_BSPLINE3:
-    case SPT_BSPLINE2_CLOSED:
-    case SPT_BSPLINE3_CLOSED:
-      CatPrint(buf," %d",tmpg->nu.num);
-      break;
-    case SPT_MESH:
-      CatPrint(buf," %dV,%dT",tmpg->mu.vertex_cnt,tmpg->mu.tri_cnt);
-      break;
-    case SPT_SHIFTABLE_MESH:
-      CatPrint(buf," %dV,%dT",tmpg->pmu.vertex_cnt,tmpg->pmu.tri_cnt);
-      break;
-  }
-  return StrNew(buf);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Gr/SpriteSideBar.HC.HTML b/public/Wb/Home/Src/Adam/Gr/SpriteSideBar.HC.HTML deleted file mode 100755 index e2b8da3..0000000 --- a/public/Wb/Home/Src/Adam/Gr/SpriteSideBar.HC.HTML +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - -
-#help_index "Graphics/Sprite;Sprites"
-
-CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
-{//For the side-bar
-  CSprite *res=CAlloc(sizeof(CSprite)),*tmpg;
-  CDocEntry *doc_e=doc->head.next;
-  Bool found=FALSE;
-  I64 num=0;
-  QueInit(res);
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
-      tmpg=SpriteSetSettings(,head,doc_e->left_exp);
-      if (tmpg!=head) {
-        tmpg=MAllocIdent(tmpg);
-        BEqu(&tmpg->type,SPf_SEL,Bt(&doc_e->type,DOCEt_SEL));
-        if (*_cur_elem_num==doc_e->left_exp) {
-          *_cur_elem_num=num;
-          found=TRUE;
-        }
-        QueIns(tmpg,res->last);
-        num++;
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  if (!found)
-    *_cur_elem_num=num;
-  QueDel(head);
-  Free(head);
-  return res;
-}
-
-U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num)
-{
-  CSprite *tmpg;
-  CDocEntry *doc_cur_e=NULL,*doc_e;
-  I64 cur_elem_num=0;
-  U8 *st;
-  DocPrint(doc,"$PURPLE$$TX+CX,\"Sprite SideBar\"$\n"
-        "$LK+PU+CX,\"Click for Help\","
-        "A=\"FI:::/Doc/SpriteSideBar.DD.Z\"$\n\n");
-  tmpg=head->next;
-  while (tmpg!=head) {
-    st=SpriteElem2Summary(tmpg);
-    if (cur_elem_num==old_num)
-      doc_cur_e=doc_e=
-            DocPrint(doc,"$LTRED$$MU-UL,\"%$Q\",LE=%d$\n",st,cur_elem_num++);
-    else
-      doc_e=DocPrint(doc,"$LTBLUE$$MU-UL,\"%$Q\",LE=%d$\n",st,cur_elem_num++);
-    BEqu(&doc_e->de_flags,DOCEf_SEL,Bt(&tmpg->type,&SPf_SEL));
-    BEqu(&doc_e->type,DOCEt_SEL,Bt(&tmpg->type,SPf_SEL));
-    Free(st);
-    tmpg=tmpg->next;
-  }
-  if (cur_elem_num==old_num)
-    doc_cur_e=DocPrint(doc,"$LTRED$$MU-UL,\"END\",LE=%d$\n",cur_elem_num);
-  else
-    DocPrint(doc,"$LTBLUE$$MU-UL,\"END\",LE=%d$\n",cur_elem_num);
-  if (doc_cur_e)
-    doc->cur_entry=doc_cur_e;
-}
-
-U0 SpriteSideBarTask2(CTask *grand_parent)
-{
-  I64 w,h;
-  CTask *parent=Fs->parent_task,*pu_task;
-  while (TRUE) {
-    pu_task=grand_parent->popup_task;
-    if (TaskValidate(pu_task)) {
-      w=parent->win_right-parent->win_left;
-      WinHorz(pu_task->win_right+2,pu_task->win_right+2+w,parent);
-      h=parent->win_bottom-parent->win_top;
-      WinVert(pu_task->win_top,pu_task->win_top+h,parent);
-    }
-    Refresh;
-  }
-}
-
-U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
-{
-  CDocEntry *doc_e;
-  CDoc *doc=DocPut;
-  Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
-  doc->flags|=DOCF_SIZE_MIN|DOCF_FORM;
-  while (TRUE) {
-    SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
-    DocHighlightCursor(,doc);
-    View;
-    doc_e=doc->cur_entry;
-    if (doc_e->type_u8==DOCT_MENU_VAL)
-      *_cur_elem_num=doc_e->left_exp;
-    *_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num);
-    DocClear(doc);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Host.HC.HTML b/public/Wb/Home/Src/Adam/Host.HC.HTML deleted file mode 100755 index f3a7e15..0000000 --- a/public/Wb/Home/Src/Adam/Host.HC.HTML +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - -
-#help_index "Misc/Host"
-
-public Bool HostChgDsk(U8 *iso_filename)
-{//Help user change CD/DVD or ISO_file.
-  Bool res=FALSE;
-  SettingsPush; //See SettingsPush
-  try {
-    AutoComplete;
-    WinBorder;
-    WinMax;
-    DocClear;
-    "$PURPLE$$TX+CX,\"Set to %s\"$$FG$\n\n\n\n",iso_filename;
-    switch (ins_reg.host_vm) {
-      case VM_VMWARE:
-        if (IsDotC(iso_filename))
-"
-Click CDROM Icon in bottom-right border of VMware window.
-
-Click \"Settings\".
-
-Set ISO image to \"%s\".
-When browsing, change the file mask from \"*.iso\" to \"All Files\".
-
-",iso_filename;
-          else
-"
-Click CDROM Icon in bottom-right border of VMware window.
-
-Click \"Settings\".
-
-Set ISO image to \"%s\".
-
-",iso_filename;
-        break;
-      case VM_QEMU:
-"
-Change to QEMU monitor using <CTRL-ALT-2>
-
-Get the CDROM designation.
-
-        >info block
-
-Use the designation.
-
-        >eject ide1-cd0
-
-Use the designation.
-
-        >change ide1-cd0 %s
-
-Change back to QEMU using <CTRL-ALT-1>
-
-",iso_filename;
-        break;
-      default:
-"
-Place the CDDVD %s in the drive.
-
-",iso_filename;
-    }
-    if (PressAKey!=CH_SHIFT_ESC) {
-      ">DskChg('T');\n\n";
-      DskChg('T');
-      res=TRUE;
-    }
-  } catch
-    PutExcept;
-  SettingsPop;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/InFile.HC.HTML b/public/Wb/Home/Src/Adam/InFile.HC.HTML deleted file mode 100755 index c27c559..0000000 --- a/public/Wb/Home/Src/Adam/InFile.HC.HTML +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - -
-#help_index "InFile;Help System/Training"
-#help_file "::/Doc/InFile"
-
-public U0 InGetStr(U8 *st)
-{//Wait for user to type certain str.
-  I64 ch,sc;
-  U8 buf[256],*st2;
-  while (*st) {
-    ch=GetKey(&sc,FALSE);
-    if (sc.u8[0]!=SC_SHIFT &&
-          sc.u8[0]!=SC_ALT &&
-          sc.u8[0]!=SC_CTRL) {
-      if (ch==*st) {
-        '' ch;
-        st++;
-      } else {
-        st2=Char2KeyName(*st);
-        StrPrint(buf,"Press the $GREEN$<%s>$FG$ key.",st2);
-        Free(st2);
-        PopUpOk(buf);
-      }
-    }
-  }
-}
-
-public U0 InPrint(I64 mS=100,U8 *fmt,...)
-{//Print message with delay after each char.
-  U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf;
-  I64 ch;
-  while (ch=*st++) {
-    '' ch;
-    Sleep(mS);
-  }
-  Free(buf);
-}
-
-public U0 InGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
-{//Wait for user to press certain key.
-  I64 sc,ch;
-  U8 buf[STR_LEN],*st;
-  do {
-    ch=GetKey(&sc);
-    if (sc.u8[0]!=SC_PRTSCRN1 &&
-          !(sc.u8[0]==SC_SHIFT && scan_code&SCF_SHIFT) &&
-          !(sc.u8[0]==SC_CTRL && scan_code&SCF_CTRL) &&
-          !(sc.u8[0]==SC_ALT && scan_code&SCF_ALT) ) {
-      if (sc&sc_mask!=scan_code&sc_mask) {
-        st=ScanCode2KeyName(scan_code);
-        StrPrint(buf,"Press the $GREEN$<%s>$FG$ key",st);
-        Free(st);
-        PopUpOk(buf);
-      }
-    }
-  } while (sc&sc_mask!=scan_code&sc_mask);
-  Msg(MSG_KEY_DOWN,ch,sc);
-}
-
-public I64 InGetChar(...)
-{//Wait for user to press one of set of chars.
-  I64 i,sc,ch;
-  U8 buf[512],*st;
-  while (TRUE) {
-    ch=GetKey(&sc);
-    if (sc.u8[0]!=SC_SHIFT && sc.u8[0]!=SC_ALT && sc.u8[0]!=SC_CTRL) {
-      for (i=0;i<argc;i++)
-        if (ch==argv[i]) {
-          Msg(MSG_KEY_DOWN,ch,sc);
-          return ch;
-        }
-      StrPrint(buf,"Press ");
-      for (i=0;i<argc;i++) {
-        st=Char2KeyName(argv[i]);
-        CatPrint(buf,"$GREEN$<%s>$FG$",st);
-        Free(st);
-        if (argc==i+1)
-          CatPrint(buf,".");
-        else if (argc==i+2)
-          CatPrint(buf," or ");
-        else
-          CatPrint(buf,", ");
-      }
-      PopUpOk(buf);
-    }
-  }
-}
-
-public U0 InUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
-{//Let user type until he presses certain key.
-  I64 sc,ch;
-  do {
-    ch=GetKey(&sc);
-    Msg(MSG_KEY_DOWN,ch,sc);
-  } while (sc&sc_mask!=scan_code&sc_mask);
-}
-
-public I64 InUntilChar(...)
-{//Let user type until he presses one of set of chars.
-  I64 i,sc,ch;
-  while (TRUE) {
-    ch=GetKey(&sc);
-    Msg(MSG_KEY_DOWN,ch,sc);
-    for (i=0;i<argc;i++)
-      if (ch==argv[i])
-        return ch;
-  }
-}
-
-public Bool InView()
-{//Let user type until <ESC> or <SHIFT-ESC>.
-  Bool res=View;
-  DocBottom;
-  return res;
-}
-
-#help_index "InFile;Help System/Training;Mouse"
-I64 in_plot_l,in_plot_r;
-
-Bool InSetMsPlot(I64 mS,I64 x,I64 y,I64 z)
-{
-  MsSet(x,y,z,in_plot_l,in_plot_r);
-  Sleep(mS);
-  return TRUE;
-}
-
-public U0 InSetMs(I64 mS=7,I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,
-                I64 l=I64_MAX,I64 r=I64_MAX)
-{//Move mouse to spot at certain speed.
-  if (!(0<=x<GR_WIDTH))
-    x=ms.pos.x;
-  if (!(0<=y<GR_HEIGHT))
-    y=ms.pos.y;
-  if (z==I64_MAX)
-    z=ms.pos.z;
-  if (!(FALSE<=l<=TRUE))
-    l=ms.lb;
-  if (!(FALSE<=r<=TRUE))
-    r=ms.rb;
-  in_plot_l=l; in_plot_r=r;
-  Line(mS,ms.pos.x,ms.pos.y,ms.pos.z,x,y,z,&InSetMsPlot);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/InsReg.HC.HTML b/public/Wb/Home/Src/Adam/InsReg.HC.HTML deleted file mode 100755 index 68c6212..0000000 --- a/public/Wb/Home/Src/Adam/InsReg.HC.HTML +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - -
-#help_index "Registry/Install Registration"
-
-public CInsReg ins_reg;
-MemSet(&ins_reg,0,sizeof(CInsReg));
-
-DefineLstLoad("ST_HOST_OSES","Other\0Native\0Linux\0Windows\0");
-DefineLstLoad("ST_HOST_VMS","Other\0Native\0VMware\0QEMU\0VirtualBox\0");
-
-#define RR_UNREGISTER   -1
-#define RR_REGISTER     0
-#define RR_REREGISTER   1
-
-public Bool InsReg(U8 drv_let=0,I64 action=RR_REGISTER)
-{//Register this install in local Registry.HC file.
-  CInsReg r;
-  I64 old_drv_let;
-  Bool res=FALSE;
-
-  if (action==RR_UNREGISTER) {
-    MemSet(&r,0,sizeof(CInsReg));
-    res=TRUE;
-  } else if (action==RR_REREGISTER || !ins_reg.registered) {
-    MemCpy(&r,&ins_reg,sizeof(CInsReg));
-    r.registered=TRUE;
-    if (PopUpForm(&r))
-      res=TRUE;
-  }
-
-  if (res) {
-    old_drv_let=*sys_registry_doc->filename.name;
-    if (drv_let)
-      *sys_registry_doc->filename.name=drv_let;
-    RegWrite("Adam/InsReg",
-        "#help_index \"Registry/Install Registration\"\n"
-        "MemSet(&ins_reg,0,sizeof(CInsReg));\n"
-        "ins_reg.registered=%d;\n"
-        "ins_reg.host_os=%d;\n"
-        "ins_reg.host_vm=%d;\n"
-        "\n#define INS_REG_PERSONAL_INITIALS \"%s\"\n"
-        "StrCpy(ins_reg.initials,\"%s\");\n"
-        "HashPublic(\"INS_REG_PERSONAL_INITIALS\",HTT_DEFINE_STR);\n"
-        "\n#define INS_REG_MACHINE_NUM %d\n"
-        "ins_reg.machine_num=%d;\n"
-        "HashPublic(\"INS_REG_MACHINE_NUM\",HTT_DEFINE_STR);\n"
-        "\n\"InsReg:%%s:%%d\\n\","
-        "INS_REG_PERSONAL_INITIALS,INS_REG_MACHINE_NUM;\n"
-        "\n#help_index \"\"\n"
-        ,r.registered,r.host_os,r.host_vm,
-        r.initials,r.initials,r.machine_num,r.machine_num);
-    *sys_registry_doc->filename.name=old_drv_let;
-    RegExe("Adam/InsReg");
-  }
-  return res;
-}
-
-public Bool InsRereg(U8 drv_let=0)
-{//Reregister this install in local Registry.HC file.
-  return InsReg(drv_let,RR_REREGISTER);
-}
-
-public Bool InsUnreg(U8 drv_let=0)
-{//Unregister this install in local Registry.HC file.
-  return InsReg(drv_let,RR_UNREGISTER);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/MakeAdam.HC.HTML b/public/Wb/Home/Src/Adam/MakeAdam.HC.HTML deleted file mode 100755 index 4f723a5..0000000 --- a/public/Wb/Home/Src/Adam/MakeAdam.HC.HTML +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-#include "AExts"
-#include "AMath"
-#include "Training"
-#include "AMem"
-#include "TaskRep"
-#include "AMathODE"
-#include "Gr/MakeGr"
-#include "ASnd"
-#include "ABlkDev/MakeABlkDev"
-#include "Menu"
-#include "Win"
-#include "WinMgr"
-#include "ADbg"
-#include "::/Adam/God/GodExt"
-#include "DolDoc/MakeDoc"
-LBts(&sys_run_level,RLf_DOC);
-#include "Ctrls/MakeCtrls"
-#include "InFile"
-#include "ARegistry"
-#include "InsReg"
-#include "AutoComplete/MakeAC"
-#include "God/MakeGod"
-#include "AHash"
-#include "TaskSettings"
-#include "CPURep"
-#include "DevInfo"
-#include "ADefine"
-#include "WallPaper"
-#include "AMouse"
-#include "Host"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/Menu.HC.HTML b/public/Wb/Home/Src/Adam/Menu.HC.HTML deleted file mode 100755 index 678b30b..0000000 --- a/public/Wb/Home/Src/Adam/Menu.HC.HTML +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - - - - -
-#help_index "Menus"
-#help_file "::/Doc/Menus"
-
-CTask *MenuTask()
-{
-  CTask *res=sys_focus_task;
-  while (res && !res->cur_menu)
-    res=res->parent_task;
-  return res;
-}
-
-CMenuEntry *sys_cur_submenu_entry=NULL;
-
-public CMenuEntry *MenuSubEntryFind(
-        CMenuEntry *haystack_first,U8 *needle_entry_name)
-{//You probably don't need this. Use dir / and MenuEntryFind().
-  while (haystack_first) {
-    if (!StrCmp(haystack_first->name,needle_entry_name))
-      return haystack_first;
-    haystack_first=haystack_first->next;
-  }
-  return NULL;
-}
-
-public CMenuEntry *MenuEntryFind(CMenu *haystack_menu,U8 *needle_full_name)
-{//Find pulldown entry. Fs->cur_menu is probably the menu you want.
-//Just 2 levels -- across top and down are valid, currently.
-  U8 *st,*st2;
-  CMenuEntry *tmpse;
-  if (!haystack_menu || !needle_full_name)
-    return NULL;
-  st=StrNew(needle_full_name);
-  st2=StrNew(needle_full_name);
-  tmpse=(&haystack_menu->sub)(U8 *)-offset(CMenuEntry.sub);
-  while (*st && tmpse) {
-    StrFirstRem(st,"/",st2);
-    tmpse=MenuSubEntryFind(tmpse->sub,st2);
-  }
-  Free(st);
-  Free(st2);
-  return tmpse;
-}
-
-CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
-{
-  CMenuEntry *tmpme=NULL,*tmpse;
-  if (cc->token==TK_IDENT) {
-    tmpme=CAlloc(sizeof(CMenuEntry),task);
-    if (StrLen(cc->cur_str)>31)
-      cc->cur_str[31]=0;
-    StrCpy(tmpme->name,cc->cur_str);
-    if (Lex(cc)=='(') {
-      tmpme->msg_code=MSG_KEY_DOWN_UP;
-      if (Lex(cc)!=',' && cc->token!=')')
-        tmpme->msg_code=LexExpressionI64(cc);
-      if (cc->token==',')
-        Lex(cc);
-      if (cc->token!=',' && cc->token!=')')
-        tmpme->arg1=LexExpressionI64(cc);
-      if (cc->token==',')
-        Lex(cc);
-      if (cc->token!=',' && cc->token!=')')
-        tmpme->arg2=LexExpressionI64(cc);
-      if (cc->token!=')')
-        LexExcept(cc,"Missing ')' at ");
-      if (Lex(cc)!=';')
-        LexExcept(cc,"Missing ';' at");
-      Lex(cc); //Skip ;
-    } else if (cc->token=='{') {
-      Lex(cc); //Skip {
-      tmpme->dir=TRUE;
-      tmpse=&tmpme->sub;
-      while (tmpse && cc->token!='}')
-        tmpse=tmpse->next=MenuNewSub(cc,task);
-      if (cc->token!='}')
-        LexExcept(cc,"Missing '}' at ");
-      else
-        Lex(cc); //Skip }
-    } else
-      LexExcept(cc,"Expecting '{' at ");
-  }
-  return tmpme;
-}
-
-public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
-{//Parse a menu. You probably don't need this.
-  CMenu *m;
-  CMenuEntry *tmpse;
-  CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
-  if (!task) task=Fs;
-  Lex(cc);
-  m=CAlloc(sizeof(CMenu),task);
-  m->task=task;
-  m->flags=flags;
-  m->attr =BLUE<<4+YELLOW;
-  tmpse=&m->sub;
-  while (tmpse)
-    tmpse=tmpse->next=MenuNewSub(cc,task);
-  CmpCtrlDel(cc);
-  return m;
-}
-
-public CMenu *MenuFile(U8 *filename,I64 flags=0,CTask *task=NULL)
-{//Parse a pulldown menu file. You probably don't need this.
-  CMenu *m;
-  U8 *st=MStrPrint("#include \"%s\"",filename);
-  m=MenuNew(st,flags,task);
-  Free(st);
-  return m;
-}
-
-U0 MenuDelSub(CMenuEntry *tmpme)
-{
-  CMenuEntry *tmpse,*tmpse1;
-  if (tmpme) {
-    tmpse=tmpme->sub;
-    while (tmpse) {
-      tmpse1=tmpse->next;
-      MenuDelSub(tmpse);
-      tmpse=tmpse1;
-    }
-    Free(tmpme);
-  }
-}
-
-public U0 MenuDel(CMenu *m)
-{//Delete a manu. You probably don't need this.
-  CMenuEntry *tmpme,*tmpme1;
-  if (!m) return;
-  tmpme=m->sub;
-  while (tmpme) {
-    tmpme1=tmpme->next;
-    MenuDelSub(tmpme);
-    tmpme=tmpme1;
-  }
-  Free(m);
-}
-
-I64 MenuEntryWidth(CMenuEntry *tmpme)
-{
-  I64 res=StrLen(tmpme->name);
-  CMenuEntry *tmpse=tmpme->sub;
-  while (tmpse) {
-    res=MaxI64(res,StrLen(tmpse->name));
-    tmpse=tmpse->next;
-  }
-  return res+1;
-}
-
-public CMenu *MenuPush(U8 *st)
-{//Save old pulldown menu and replace with new from str.
-  CMenu *m=MenuNew(st);
-  m->next=Fs->cur_menu;
-  Fs->cur_menu=m;
-  return m;
-}
-
-public CMenu *MenuFilePush(U8 *filename)
-{//Save old pulldown menu and replace with new from file.
-  CMenu *m=MenuFile(filename);
-  m->next=Fs->cur_menu;
-  Fs->cur_menu=m;
-  return m;
-}
-
-public U0 MenuPop()
-{//Restore old pulldown menu. Delete just-deactivated menu.
-  CMenu *m=Fs->cur_menu;
-  if (!m) return;
-  Fs->cur_menu=m->next;
-  MenuDel(m);
-}
-
-U0 DrawMenu(CDC *dc)
-{
-  CMenu *m;
-  CMenuEntry *tmpme,*tmpse,*cur_submenu=NULL;
-  U8 *st=NULL;
-  CTask *task=MenuTask;
-  I64 i,w,x0,y0,x1=ms.pos.x,y1=ms.pos.y;
-  if (!TaskValidate(task) || !(m=task->cur_menu)) {
-    sys_cur_submenu_entry=NULL;
-    return;
-  }
-  dc->color=m->attr>>4;
-  GrRect(dc,0,0,GR_WIDTH,FONT_HEIGHT);
-  x0=0;
-  tmpme=m->sub;
-  while (tmpme) {
-    w=MenuEntryWidth(tmpme)*FONT_WIDTH;
-    if (x0<=x1<x0+w) {
-      if (0<=y1<FONT_HEIGHT) {
-        dc->color=m->attr&15;
-        GrRect(dc,x0,0,w,FONT_HEIGHT);
-        dc->color=m->attr>>4;
-      } else
-        dc->color=m->attr&15;
-      GrPrint(dc,x0,0,"%s",tmpme->name);
-      y0=FONT_HEIGHT;
-      tmpse=tmpme->sub;
-      while (tmpse) {
-        if (tmpse->checked)
-          i=m->attr^0xFF;
-        else
-          i=m->attr;
-        if (y0<=y1<y0+FONT_HEIGHT) {
-          if (tmpse->msg_code==MSG_KEY_DOWN||
-                tmpse->msg_code==MSG_KEY_DOWN_UP) {
-            if (!tmpse->arg2)
-              tmpse->arg2=Char2ScanCode(tmpse->arg1);
-            st=ScanCode2KeyName(tmpse->arg2);
-          }
-          sys_cur_submenu_entry=cur_submenu=tmpse;
-          dc->color=i&15;
-          GrRect(dc,x0,y0,w,FONT_HEIGHT);
-          dc->color=i>>4;
-          GrPrint(dc,x0,y0,"%s",tmpse->name);
-          if (st) {
-            dc->color=i>>4;
-            GrRect(dc,x0+w,y0-FONT_HEIGHT,
-                  (StrLen(st)+1)*FONT_WIDTH,FONT_HEIGHT*3);
-            dc->color=i&15;
-            GrPrint(dc,x0+w,y0,"%s",st);
-            Free(st);
-          }
-        } else {
-          dc->color=i>>4;
-          GrRect(dc,x0,y0,w,FONT_HEIGHT);
-          dc->color=i&15;
-          GrPrint(dc,x0,y0,"%s",tmpse->name);
-        }
-        y0+=FONT_HEIGHT;
-        tmpse=tmpse->next;
-      }
-    } else {
-      dc->color=m->attr&15;
-      GrPrint(dc,x0,0,"%s",tmpme->name);
-    }
-    x0+=w;
-    tmpme=tmpme->next;
-  }
-  sys_cur_submenu_entry=cur_submenu;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootDVD.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootDVD.HC.HTML deleted file mode 100755 index f002b4e..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootDVD.HC.HTML +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - -
-#define BOOT_HIGH_LOC_DVD       ((BOOT_RAM_LIMIT-\
-                                (BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE))>>4)
-
-DefinePrint(
-  "DD_BOOT_HIGH_LOC_DVD","%08X",BOOT_HIGH_LOC_DVD<<4);
-DefinePrint(
-  "DD_BOOT_HIGH_LOC_DVD_END","%08X",BOOT_RAM_LIMIT-1);
-
-asm {
-USE16
-BDVD_START::
-//DL is supposed to have the BIOS drive number
-        CLD
-        MOV     AX,BOOT_HIGH_LOC_DVD
-        MOV     ES,AX
-
-        CLI
-        MOV     SS,AX
-        MOV     SP,BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE
-        STI
-
-        CALL    BDVD_GET_RIP
-BDVD_GET_RIP:
-        POP     BX
-        SUB     BX,BDVD_GET_RIP-BDVD_START
-        SHR     BX,4
-//This copies this bootloader's code to 0x00096600
-        MOV     AX,CS
-        ADD     AX,BX
-        MOV     DS,AX
-        MOV     CX,DVD_BOOT_LOADER_SIZE
-        XOR     SI,SI
-        XOR     DI,DI
-        REP_MOVSB
-
-        MOV     AX,BOOT_HIGH_LOC_DVD
-        MOV     DS,AX
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_HIGH_LOC_DVD:BDVD_MAIN
-        DU16    BDVD_MAIN-BDVD_START,BOOT_HIGH_LOC_DVD;
-
-BDVD_BIOS_DRV_NUM:      DU8     0;
-BDVD_PAGE:              DU8     0;
-
-BDVD_DAP:               DU8     16,0,1,0; //One blk at a time
-BDVD_DAP_BUF:           DU16    0,0;
-BDVD_DAP_BLK:           DU64    0;
-        
-BDVD_TEMPLEOS_MSG:
-        DU8     "Loading TempleOS",0;
-
-BDVD_NOT64_MSG:
-        DU8     "TempleOS requires a 64-bit capable processor.\n\r",0;
-
-//These get patched.
-BDVD_BLK_LO::           DU16    0;
-BDVD_BLK_HI::           DU16    0;
-BDVD_BLK_CNT::          DU16    0;
-BDVD_SHIFT_BLKS::       DU16    0;
-BDVD_PROGRESS_STEP::    DU32    0;
-BDVD_PROGRESS_VAL::     DU32    0;
-
-BDVD_PUT_CHAR::
-        MOV     AH,0xE
-        MOV     BL,7 //Might be foreground color on some BIOS's
-        MOV     BH,U8 [BDVD_PAGE-BDVD_START]
-        INT     0x10
-BDVD_RET::
-        RET
-BDVD_PUTS::
-@@1:    LODSB
-        TEST    AL,AL
-        JZ      BDVD_RET
-        CALL    BDVD_PUT_CHAR
-        JMP     @@1
-
-BDVD_MAIN::
-        MOV     U8 [BDVD_BIOS_DRV_NUM-BDVD_START],DL //Passed in by BIOS
-
-        MOV     AH,0xF
-        INT     0x10
-        MOV     U8 [BDVD_PAGE-BDVD_START],BH //Video page
-
-        MOV     EAX,0x80000000
-        CPUID
-        CMP     EAX,0x80000001
-        JB      @@05
-
-        MOV     EAX,0x80000001
-        CPUID
-        BT      EDX,29
-        JC      @@15
-@@05:   MOV     SI,BDVD_NOT64_MSG-BDVD_START
-        CALL    BDVD_PUTS
-@@10:   JMP     @@10
-
-@@15:   MOV     SI,BDVD_TEMPLEOS_MSG-BDVD_START
-        CALL    BDVD_PUTS
-
-        MOV     AX,BOOT_RAM_BASE/16
-        MOV     ES,AX
-        XOR     ECX,ECX
-        MOV     CX,U16 [BDVD_BLK_CNT-BDVD_START]
-
-        MOV     EAX,(80-7-9)*65536      //80 columns
-        XOR     EDX,EDX
-        DIV     ECX
-        MOV     U32 [BDVD_PROGRESS_STEP-BDVD_START],EAX
-        MOV     U32 [BDVD_PROGRESS_VAL-BDVD_START],0
-
-        MOV     AX,U16 [BDVD_BLK_LO-BDVD_START]
-        MOV     DX,U16 [BDVD_BLK_HI-BDVD_START]
-
-@@20:   PUSH    CX      //Blk cnt
-
-//READ BLK
-        PUSH    AX      //Blk lo
-        PUSH    DX      //Blk hi
-        PUSH    ES      //Buf seg
-        MOV     U16 [BDVD_DAP_BLK-BDVD_START],AX
-        MOV     U16 [BDVD_DAP_BLK+2-BDVD_START],DX
-        MOV     AX,ES
-        MOV     U16 [BDVD_DAP_BUF+2-BDVD_START],AX //ES:0000
-        MOV     SI,BDVD_DAP-BDVD_START //DS:SI=DAP
-        MOV     AH,0x42
-        MOV     DL,U8 [BDVD_BIOS_DRV_NUM-BDVD_START]
-        INT     0x13
-
-        POP     AX      //ES
-        ADD     AX,DVD_BLK_SIZE/16
-        MOV     ES,AX
-        POP     DX
-        POP     AX
-        INC     AX
-        JNZ     @@25
-        INC     DX
-
-@@25:   PUSH    AX
-        MOV     BX,U16 [BDVD_PROGRESS_VAL+2-BDVD_START]
-        MOV     EAX,U32 [BDVD_PROGRESS_STEP-BDVD_START]
-        ADD     U32 [BDVD_PROGRESS_VAL-BDVD_START],EAX
-        CMP     U16 [BDVD_PROGRESS_VAL+2-BDVD_START],BX
-        JE      @@30
-        MOV     AL,'.'
-        CALL    BDVD_PUT_CHAR
-@@30:   POP     AX
-
-        POP     CX
-        LOOP    @@20
-
-//Shift backward to align
-        PUSH    DS
-        MOV     BX,U16 [BDVD_SHIFT_BLKS-BDVD_START]
-        SHL     BX,BLK_SIZE_BITS-4
-        MOV     CX,U16 [BDVD_BLK_CNT-BDVD_START]
-        MOV     AX,BOOT_RAM_BASE/16
-        MOV     ES,AX
-        ADD     AX,BX
-        MOV     DS,AX
-@@35:   PUSH    CX
-        XOR     SI,SI
-        XOR     DI,DI
-        MOV     CX,DVD_BLK_SIZE/4
-        REP_MOVSD
-        MOV     AX,DS
-        ADD     AX,DVD_BLK_SIZE/16
-        MOV     DS,AX
-        MOV     AX,ES
-        ADD     AX,DVD_BLK_SIZE/16
-        MOV     ES,AX
-        POP     CX
-        LOOP    @@35
-        POP     DS
-
-//See BootDVDProbe().
-        MOV     EBX,U32 [BDVD_BLK_LO-BDVD_START]
-        MOV     AX,U16 [BDVD_SHIFT_BLKS-BDVD_START]
-        SHL     EAX,16
-        MOV     AX,BOOT_SRC_DVD  //See sys_boot_src
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_RAM_BASE:0000
-        DU16    0,BOOT_RAM_BASE/16;
-//Continues here ::/Kernel/KStart16.HC
-BDVD_END::
-#assert BDVD_END-BDVD_START<DVD_BOOT_LOADER_SIZE
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootDVDIns.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootDVDIns.HC.HTML deleted file mode 100755 index 6d3592b..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootDVDIns.HC.HTML +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - -
-//See Install Documentation.
-//Study my account examples: Cfg Strs, Update Funs
-
-#include "BootDVD"
-#include "DskISORedSea"
-
-#help_index "Install"
-
-#define KERNEL_BIN_C    "Kernel.BIN.C"
-#define BOOT_DIR        "/0000Boot"
-#define BOOT_DIR_KERNEL_BIN_C   BOOT_DIR "/0000" KERNEL_BIN_C
-
-U0 MakeAll()
-{
-  if (Cmp("/Compiler/Compiler","Compiler",,':'))
-    throw;
-  if (Cmp("/Kernel/Kernel","Kernel",,':'))
-    throw;
-}
-
-public U0 BootDVDIns(U8 drv_let=0)
-{//See ::/Misc/DoDistro.HC.
-  try {
-    if (!Drv(drv_let))
-      throw;
-    MakeAll;
-    Move("/Kernel/Kernel.BIN.Z",BOOT_DIR_KERNEL_BIN_C);
-  } catch {
-    PutExcept;
-    Beep;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootHD.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootHD.HC.HTML deleted file mode 100755 index 58706ba..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootHD.HC.HTML +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - -
-#define MODULE_SIZE             1*BLK_SIZE
-#define BOOT_HIGH_LOC_HD        ((BOOT_RAM_LIMIT-\
-                                (BOOT_STK_SIZE+MODULE_SIZE))>>4)
-
-DefinePrint(
-  "DD_BOOT_HIGH_LOC_HD","%08X",BOOT_HIGH_LOC_HD<<4);
-
-asm {
-USE16
-BHD_CODE::
-
-#define BHD_START (BHD_CODE-offset(CFAT32Boot.code))
-
-        CLD
-
-        MOV     AX,BOOT_HIGH_LOC_HD
-        MOV     ES,AX
-
-        CLI
-        MOV     SS,AX
-        MOV     SP,BOOT_STK_SIZE+MODULE_SIZE
-        STI
-
-        CALL    BHD_GET_RIP
-BHD_GET_RIP:
-        POP     BX
-        SUB     BX,BHD_GET_RIP-BHD_START
-        SHR     BX,4
-//This copies this bootloader's code to 0x00096C00
-        MOV     AX,CS
-        ADD     AX,BX
-        MOV     DS,AX
-        MOV     CX,MODULE_SIZE
-        XOR     SI,SI
-        XOR     DI,DI
-        REP_MOVSB
-
-        MOV     AX,BOOT_HIGH_LOC_HD
-        MOV     DS,AX
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_HIGH_LOC_HD:BHD_HISTART
-        DU16    BHD_HISTART-BHD_START,BOOT_HIGH_LOC_HD;
-
-BHD_BIOS_DRV_NUM: DU8   0;
-
-//Gets patched by BootHDIns().
-BHD_BLK_CNT::   DU16    0;
-
-BHD_DAP:        DU8     16,0,1,0; //One blk at a time
-BHD_DAP_BUF:    DU16    0,0;
-//Gets patched by BootHDIns().
-BHD_DAP_BLK::   //64-bit
-BHD_DAP_BLK_LO: DU32    0;
-BHD_DAP_BLK_HI: DU32    0;
-
-BHD_HISTART:
-        MOV     U8 [BHD_BIOS_DRV_NUM-BHD_START],DL //Passed in by BIOS
-        MOV     AX,BOOT_RAM_BASE/16
-        MOV     ES,AX
-        XOR     ECX,ECX
-        MOV     CX,U16 [BHD_BLK_CNT-BHD_START]
-
-@@05:   PUSH    CX      //Blk cnt
-
-//READ BLK
-        PUSH    ES      //Buf seg
-        MOV     AX,ES
-        MOV     U16 [BHD_DAP_BUF+2-BHD_START],AX //ES:0000
-        MOV     SI,BHD_DAP-BHD_START //DS:SI=DAP
-        MOV     AH,0x42
-        MOV     DL,U8 [BHD_BIOS_DRV_NUM-BHD_START]
-        INT     0x13
-
-        POP     AX      //ES
-        ADD     AX,BLK_SIZE/16
-        MOV     ES,AX
-        INC     U32 [BHD_DAP_BLK_LO-BHD_START]
-        JNZ     @@10
-        INC     U32 [BHD_DAP_BLK_HI-BHD_START]
-
-@@10:   POP     CX
-        LOOP    @@05
-
-        XOR     EBX,EBX
-        MOV     EAX,BOOT_SRC_HARDDRV //See sys_boot_src
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_RAM_BASE:0000
-        DU16    0,BOOT_RAM_BASE/16;
-//Continues here ::/Kernel/KStart16.HC
-BHD_END::
-#assert BHD_END-BHD_START<MODULE_SIZE-2
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootHDIns.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootHDIns.HC.HTML deleted file mode 100755 index d1ad294..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootHDIns.HC.HTML +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - -
-//See Install Documentation.
-//Study my account examples: Cfg Strs, Update Funs
-
-#include "BootHD"
-
-#help_index "Install"
-
-#define KERNEL_BIN_C    "Kernel.BIN.C"
-
-U0 MakeAll()
-{
-  if (Cmp("/Compiler/Compiler","Compiler",,':'))
-    throw;
-  if (Cmp("/Kernel/Kernel","Kernel",,':'))
-    throw;
-}
-
-public U0 BootHDIns(U8 drv_let=0)
-{//MakeAll and install new boot-loader.
-  CDrv *dv;
-  CFAT32Boot br;
-  CDirEntry de;
-  I64 i;
-  try {
-    if (!Drv(drv_let))
-      throw;
-    dv=Fs->cur_dv;
-    MakeAll;
-    switch (Let2BlkDevType(dv->drv_let)) {
-      case BDT_RAM:
-      case BDT_ATA:
-        Move("/Kernel/Kernel.BIN.Z","/" KERNEL_BIN_C);
-        if (!FileFind("/" KERNEL_BIN_C,&de,FUF_JUST_FILES))
-          "No Kernel.BIN.C\n";
-        else {
-          Free(de.full_name);
-          "Modifying partition boot record.\n";
-          BlkRead(dv,&br,dv->drv_offset,1);
-          br.jump_and_nop[0]=OC_JMP_REL8;
-          br.jump_and_nop[1]=offset(CFAT32Boot.code)-2;
-#assert offset(CFAT32Boot.code)>=offset(CRedSeaBoot.code)
-          br.jump_and_nop[2]=OC_NOP;
-          *BHD_BLK_CNT(U16 *)=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS;
-          *BHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
-          for (i=0;i<BHD_END-BHD_CODE;i++)
-            br.code[i]=BHD_CODE(U8 *)[i];
-#assert sizeof(CFAT32Boot.code)>=BHD_END-BHD_CODE
-          for (;i<sizeof(CFAT32Boot.code);i++)
-            br.code[i]=0;
-          BlkWrite(dv,&br,dv->drv_offset,1);
-        }
-        break;
-      default:
-        throw;
-    }
-  } catch {
-    PutExcept;
-    Beep;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD.HC.HTML deleted file mode 100755 index edbad66..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD.HC.HTML +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - -
-#define MODULE_SIZE             1*BLK_SIZE
-#define BOOT_HIGH_LOC_MHD       ((BOOT_RAM_LIMIT-\
-                                (BOOT_STK_SIZE+MODULE_SIZE))>>4)
-
-DefinePrint(
-  "DD_BOOT_HIGH_LOC_MHD","%08X",BOOT_HIGH_LOC_MHD<<4);
-
-asm {
-USE16
-BMHD_START::
-BMHD_CODE::
-        CLD
-
-        MOV     AX,BOOT_HIGH_LOC_MHD
-
-        CLI
-        MOV     SS,AX
-        MOV     SP,BOOT_STK_SIZE+MODULE_SIZE
-        STI
-
-        PUSHFW
-        PUSH    DS
-        PUSH    ES
-        PUSH    FS
-        PUSH    GS
-        PUSH    ECX
-        PUSH    EBX
-        PUSH    EDX
-        PUSH    EBP
-
-        MOV     ES,AX
-
-        CALL    BMHD_GET_RIP
-BMHD_GET_RIP:
-        POP     BX
-        SUB     BX,BMHD_GET_RIP-BMHD_START
-        MOV     CX,BX
-        SHR     BX,4
-//This copies this bootloader's code to 0x00096C00
-        MOV     AX,CS
-        PUSH    AX
-        ADD     AX,BX
-        MOV     DS,AX
-        MOV     U16 [BMHD_OLD_CS_RIP-BMHD_START],CX
-        POP     U16 [BMHD_OLD_CS_RIP+2-BMHD_START]
-
-        MOV     CX,MODULE_SIZE
-        XOR     SI,SI
-        XOR     DI,DI
-        REP_MOVSB
-
-        MOV     AX,BOOT_HIGH_LOC_MHD
-        MOV     DS,AX
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_HIGH_LOC_MHD:BMHD_HISTART
-        DU16    BMHD_HISTART-BMHD_START,BOOT_HIGH_LOC_MHD;
-
-BMHD_BIOS_DRV_NUM:      DU8     0;
-BMHD_OLD_CS_RIP:                DU16    0,0;
-//Gets patched by BootHDIns().
-BMHD_BLK_CNT::          DU16    0;
-
-BMHD_DAP:               DU8     16,0,1,0; //One blk at a time
-BMHD_DAP_BUF:           DU16    0,0;
-//Gets patched by BootHDIns().
-BMHD_DAP_BLK::  //64-bit
-BMHD_DAP_BLK_LO:        DU32    0;
-BMHD_DAP_BLK_HI:        DU32    0;
-
-BMHD_HISTART:
-        MOV     U8 [BMHD_BIOS_DRV_NUM-BMHD_START],DL //Passed in by BIOS
-        MOV     AX,BOOT_RAM_BASE/16
-        MOV     ES,AX
-        XOR     ECX,ECX
-        MOV     CX,U16 [BMHD_BLK_CNT-BMHD_START]
-
-@@05:   PUSH    CX      //Blk cnt
-
-//READ BLK
-        PUSH    ES      //Buf seg
-        MOV     AX,ES
-        MOV     U16 [BMHD_DAP_BUF+2-BMHD_START],AX //ES:0000
-        MOV     SI,BMHD_DAP-BMHD_START //DS:SI=DAP
-        MOV     AH,0x42
-        MOV     DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START]
-        INT     0x13
-
-        POP     AX      //ES
-        ADD     AX,BLK_SIZE/16
-        MOV     ES,AX
-        INC     U32 [BMHD_DAP_BLK_LO-BMHD_START]
-        JNZ     @@10
-        INC     U32 [BMHD_DAP_BLK_HI-BMHD_START]
-
-@@10:   POP     CX
-        LOOP    @@05
-
-        MOV     DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START]
-        MOV     EBX,U32 [BMHD_OLD_CS_RIP-BMHD_START]
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_RAM_BASE:0000
-        DU16    0,BOOT_RAM_BASE/16;
-//Continues here BMHD2_START
-BMHD_END::
-#assert BMHD_END-BMHD_START<=440
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD2.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD2.HC.HTML deleted file mode 100755 index fde5e41..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHD2.HC.HTML +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - -
-#define MODULE_SIZE             2*BLK_SIZE
-#define BOOT_HIGH_LOC_MHD2      ((BOOT_RAM_LIMIT-\
-                                (BOOT_STK_SIZE+MODULE_SIZE))>>4)
-
-DefinePrint(
-  "DD_BOOT_HIGH_LOC_MHD2","%08X",BOOT_HIGH_LOC_MHD2<<4);
-
-asm {
-USE16
-BMHD2_START::
-        MOV     U32 FS:[0],'B'+0x2000+('2'+0x2000)<<16
-
-        MOV     AX,BOOT_HIGH_LOC_MHD2
-        MOV     ES,AX
-//This copies this bootloader's code to 0x00096A00
-        MOV     AX,CS
-        MOV     DS,AX
-        MOV     U32 [BMHD2_OLD_CS_RIP-BMHD2_START],EBX
-        MOV     U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START],DL
-
-        MOV     CX,MODULE_SIZE
-        XOR     SI,SI
-        XOR     DI,DI
-        REP_MOVSB
-
-        MOV     AX,BOOT_HIGH_LOC_MHD2
-        MOV     DS,AX
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP BOOT_HIGH_LOC_MHD2:BMHD2_HISTART
-        DU16    BMHD2_HISTART-BMHD2_START,BOOT_HIGH_LOC_MHD2;
-
-BMHD2_BOOT_MSG::
-        DU8     256 DUP(0);
-
-BMHD2_BIOS_DRV_NUM:     DU8     0;
-BMHD2_PAGE:             DU8     0;
-BMHD2_BLK_ARRAY::       DU64 8 DUP(0);
-
-BMHD2_DAP:              DU8     16,0,1,0; //One blk at a time
-BMHD2_DAP_BUF:          DU16    0,0;
-BMHD2_DAP_BLK:: //64-bit
-BMHD2_DAP_BLK_LO:       DU32    0;
-BMHD2_DAP_BLK_HI:       DU32    0;
-
-BMHD2_PUT_CHAR::
-        MOV     AH,0xE
-        MOV     BL,7 //Might be foreground color on some BIOS's
-        MOV     BH,U8 [BMHD2_PAGE-BMHD2_START]
-        INT     0x10
-BMHD2_RET::
-        RET
-BMHD2_PUTS::
-@@1:    LODSB
-        TEST    AL,AL
-        JZ      BMHD2_RET
-        CALL    BMHD2_PUT_CHAR
-        JMP     @@1
-
-BMHD2_GETCHAR:
-        XOR     AH,AH
-        INT     0x16
-        PUSH    AX
-        MOV     AH,0x0E
-        MOV     BX,0x07
-        INT     0x10
-        POP     AX
-        RET
-
-BMHD2_HISTART:
-        MOV     AH,0xF
-        INT     0x10
-        MOV     U8 [BMHD2_PAGE-BMHD2_START],BH //Video page
-
-        MOV     U32 FS:[0],0
-@@5:    MOV     SI,BMHD2_BOOT_MSG-BMHD2_START
-        CALL    BMHD2_PUTS
-        CALL    BMHD2_GETCHAR
-        CMP     AL,'0'
-        JB      @@5
-        CMP     AL,'8'
-        JAE     @@5
-        AND     EAX,7
-
-        MOV     EBX,U32 BMHD2_BLK_ARRAY-BMHD2_START[EAX*8]
-        MOV     EAX,U32 BMHD2_BLK_ARRAY+4-BMHD2_START[EAX*8]
-
-        TEST    EBX,EBX
-        JNZ     @@10
-        TEST    EAX,EAX
-        JZ      @@5
-
-@@10:   MOV     U32 [BMHD2_DAP_BLK_LO-BMHD2_START],EBX
-        MOV     U32 [BMHD2_DAP_BLK_HI-BMHD2_START],EAX
-
-        MOV     AX,U16 [BMHD2_OLD_CS_RIP-BMHD2_START]
-        SHR     AX,4
-        ADD     AX,U16 [BMHD2_OLD_CS_RIP+2-BMHD2_START]
-        MOV     U16 [BMHD2_DAP_BUF+2-BMHD2_START],AX //ES:0000
-        MOV     SI,BMHD2_DAP-BMHD2_START //DS:SI=DAP
-        MOV     DL,U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START]
-        MOV     AH,0x42
-        INT     0x13
-
-        POP     EBP
-        POP     EDX
-        POP     EBX
-        POP     ECX
-        XOR     EAX,EAX
-        POP     GS
-        POP     FS
-        POP     ES
-        POP     DS
-        POPFW
-
-//My assembler doesn't support 16-bit very well.
-        DU8     0xEA;   //JMP xxxx:yyyy
-BMHD2_OLD_CS_RIP:
-        DU16    0,0;
-BMHD2_END::
-//Continues here ::/Adam/Opt/Boot/BootHD.HC
-#assert BMHD2_END-BMHD2_START<MODULE_SIZE
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHDIns.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootMHDIns.HC.HTML deleted file mode 100755 index 9f2bd46..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootMHDIns.HC.HTML +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - -
-//See Install Documentation.
-//Study my account examples: Cfg Strs, Update Funs
-
-#include "BootMHD"
-#include "BootMHD2"
-
-#help_index "Install"
-
-#define BOOT_DIR        "/0000Boot"
-//Stage 2 of master boot loader
-#define BOOT_DIR_BOOTMHD2_BIN_C BOOT_DIR "/BootMHD2.BIN.C"
-//Old master boot record
-#define BOOT_DIR_OLDMBR_BIN_C   BOOT_DIR "/OldMBR.BIN.C"
-
-public U0 BootMHDOldRead(U8 src_drv,U8 dst_drv)
-{//Reads MBR from disk drive containing src partition.
-//Writes a single blk file to dst BOOT_DIR.
-  CBlkDev *bd=Let2BlkDev(src_drv);
-  CDrv *dv;
-  CMasterBoot mbr;
-  Drv(dst_drv);
-  dv=Fs->cur_dv;
-  if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32)
-    PrintErr("File System Not Supported\n");
-  else {
-//Bypass partition bounds-checking
-    BlkDevLock(bd);
-    ATAReadBlks(bd,&mbr,0,1);
-    BlkDevUnlock(bd);
-
-    Drv(dst_drv);
-    DirMk(BOOT_DIR);
-    FileWrite(BOOT_DIR_OLDMBR_BIN_C,&mbr,BLK_SIZE);
-  }
-}
-
-public U0 BootMHDOldWrite(U8 src_drv,U8 dst_drv)
-{//Reads OldMBR from src drive BOOT_DIR.
-//writes it to the MBR of the drive with dst partition.
-  CBlkDev *bd=Let2BlkDev(dst_drv);
-  CMasterBoot *mbr;
-  Drv(src_drv);
-  if (mbr=FileRead(BOOT_DIR_OLDMBR_BIN_C)) {
-//Bypass partition bounds-checking
-    BlkDevLock(bd);
-    ATAWriteBlks(bd,mbr,0,1);
-    BlkDevUnlock(bd);
-  }
-  Free(mbr);
-}
-
-public U0 BootMHDZero(U8 dst_drv)
-{//Set MBR of disk with dst partition to zero.
-
-  //This is dangerous!!
-  //The TempleOS partitioner doesn't play well
-  //with other operating systems at this time and you need
-  //to do this on a drive partitioned by TempleOS
-  //if you wish to partition with another operating system.
-  CBlkDev *bd=Let2BlkDev(dst_drv);
-  CMasterBoot mbr;
-  MemSet(&mbr,0,BLK_SIZE);
-//Bypass partition bounds-checking
-  BlkDevLock(bd);
-  ATAWriteBlks(bd,&mbr,0,1);
-  BlkDevUnlock(bd);
-}
-
-public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL)
-{//Create new MBR on the disk that has drv_let as a partition.
-//Puts stage 2 in BOOT_DIR of drv_let.
-  CBlkDev *bd,*bd1;
-  CDrv *dv,*p1;
-  CMasterBoot mbr;
-  CDirEntry de;
-  I64 i,j,size,*_q;
-  U8 *menu_ptr,*ptr,ch,buf[STR_LEN];
-  Bool res=FALSE;
-
-  try {
-    if (drv_lst) {
-      StrCpy(buf,drv_lst);
-      StrUtil(buf,SUF_TO_UPPER);
-    } else {
-      j=0;
-      for (i='A';i<='Z';i++)
-        buf[j++]=i;
-      buf[j++]=0;
-    }
-    Drv(drv_let);
-    dv=Fs->cur_dv;
-    if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32)
-      PrintErr("File System Not Supported\n");
-    else {
-      bd=dv->bd;
-      if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,,FUF_JUST_FILES))
-        BootMHDOldRead(drv_let,drv_let);
-
-      _q=BMHD2_BLK_ARRAY;
-      MemSet(_q,0,sizeof(I64)*8);
-      menu_ptr=BMHD2_BOOT_MSG;
-      StrPrint(menu_ptr,"\n\r\n\rTempleOS Boot Loader\n\r\n\r");
-      j=0;
-      if (FileFind(BOOT_DIR_OLDMBR_BIN_C,&de,FUF_JUST_FILES)) {
-        Free(de.full_name);
-        *_q++=Clus2Blk(dv,de.clus);
-        CatPrint(menu_ptr,"0. Old Boot Record\n\r");
-        j++;
-      }
-
-      ptr=buf;
-      while (ch=*ptr++) {
-        if ((p1=Let2Drv(ch,FALSE)) && (bd1=p1->bd) && bd1==bd) {
-          *_q=p1->drv_offset;
-          "Drive %C:%16X\n",Drv2Let(p1),*_q;
-          CatPrint(menu_ptr,"%d. Drive %C\n\r",j++,Drv2Let(p1));
-          _q++;
-        }
-      }
-      CatPrint(menu_ptr,"\n\rSelection:");
-
-      size=BMHD2_END-BMHD2_START;
-      FileWrite(BOOT_DIR_BOOTMHD2_BIN_C,BMHD2_START,size);
-
-      if (!FileFind(BOOT_DIR_BOOTMHD2_BIN_C,&de,FUF_JUST_FILES))
-        "No Boot Loader Image\n";
-      else {
-        Free(de.full_name);
-        *BMHD_BLK_CNT(U16 *)=(size+BLK_SIZE-1)>>BLK_SIZE_BITS;
-        *BMHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
-//Bypass partition bounds-checking
-        BlkDevLock(bd);
-        ATAReadBlks(bd,&mbr,0,1);
-        for (i=0;i<BMHD_END-BMHD_CODE;i++)
-          mbr.code[i]=BMHD_CODE(U8 *)[i];
-#assert sizeof(CMasterBoot.code)>=BMHD_END-BMHD_CODE
-        for (;i<sizeof(CMasterBoot.code);i++)
-          mbr.code[i]=0;
-        if (!mbr.media_id)
-          mbr.media_id=RandU32;
-        mbr.zero=0;
-        mbr.signature=0xAA55;
-
-        ATAWriteBlks(bd,&mbr,0,1);
-        BlkDevUnlock(bd);
-        res=TRUE;
-      }
-    }
-  } catch
-    PutExcept;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/BootRAM.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/BootRAM.HC.HTML deleted file mode 100755 index 9a05223..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/BootRAM.HC.HTML +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - -
-#help_index "Call"
-asm {
-_HI_CALL::
-        PUSH    RBP
-        MOV     RBP,RSP
-        MOV     RAX,U64 16[RBP]
-        TEST    RAX,RAX
-        JZ      @@05
-        CALL    RAX
-@@05:   POP     RBP
-        RET1    8
-//************************************
-_HI_MEMCPY::
-        PUSH    RBP
-        MOV     RBP,RSP
-        PUSH    RSI
-        PUSH    RDI
-        CLD
-        MOV     RDI,U64 SF_ARG1[RBP]
-        MOV     RSI,U64 SF_ARG2[RBP]
-        MOV     RCX,U64 SF_ARG3[RBP]
-        REP_MOVSB
-        MOV     RAX,RDI
-        POP     RDI
-        POP     RSI
-        POP     RBP
-        RET1    24
-}
-_extern _HI_CALL I64 HiCall(U8 *machine_code);
-_extern _HI_MEMCPY U8 *HiMemCpy(U8 *dst,U8 *src,I64 cnt);
-
-#help_index "Boot"
-public U0 BootRAM(U8 *filename=NULL)
-{//Softboot Kernel.BIN file. No hardware reset.
-  I64 size;
-  CKernel *hi_image,*lo_image=mem_boot_base-sizeof(CBinFile),
-        reg *sys_ram_reboot;
-  if (!filename)
-    filename="::/" KERNEL_BIN_C;
-  do if (!(hi_image=FileRead(filename,&size))) return;
-  while (hi_image<0x100000); //If alloc from low 640K, just get another copy.
-
-  do sys_ram_reboot=MAlloc(SYS_RAM_REBOOT_END-SYS_RAM_REBOOT,Fs->code_heap);
-  while (sys_ram_reboot<0x100000);
-
-  hi_image->boot_src=BOOT_SRC_RAM;
-  hi_image->boot_blk=0;
-  hi_image->boot_patch_table_base=lo_image(U8 *)+hi_image->h.patch_table_offset;
-  hi_image->sys_run_level =lo_image->sys_run_level&(RLF_VGA|RLF_16BIT);
-  MemCpy(&hi_image->start,&lo_image->start,
-        sizeof(CKernel)-offset(CKernel.start));
-
-  CLI
-  if (mp_cnt>1)
-    MPHalt;
-
-  HiMemCpy(sys_ram_reboot,SYS_RAM_REBOOT,SYS_RAM_REBOOT_END-SYS_RAM_REBOOT);
-  HiMemCpy(lo_image,hi_image,size);
-  HiCall(sys_ram_reboot);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/DskISORedSea.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/DskISORedSea.HC.HTML deleted file mode 100755 index 1f7490e..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/DskISORedSea.HC.HTML +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - -
-#help_index "File/CD DVD"
-
-U0 FillU16Palindrome(CPalindromeU16 *dst,U16 w)
-{
-  dst->big=EndianU16(w);
-  dst->little=w;
-}
-
-U0 FillU32Palindrome(CPalindromeU32 *dst,I64 d)
-{
-  dst->big=EndianU32(d);
-  dst->little=d;
-}
-
-class CElTorito
-{
-  U16 w[16];
-  U8 bootable; //88=bootable 00=not bootable
-  U8 media_type; //0=no emulation 4=hard disk
-  U16 load_seg; //0000->07C0
-  U8 sys_type;
-  U8 zero;
-  U16 sect_cnt;
-  U32 load_rba; //start addr of virtual disk
-  U8 zero2[20];
-};
-
-U0 RedSeaISO9660Stage1(U8 *iso_filename,U8 *stage2_filename)
-{
-  CDirEntry de;
-  CFile *out_file=NULL;
-  U8    *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE);
-  if (FileFind(stage2_filename,&de) && (out_file=FOpen(iso_filename,"wc+"))) {
-    MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
-    *(BDVD_BLK_LO       -BDVD_START+stage1_buf)(U32 *)=de.clus>>2;
-    *(BDVD_BLK_CNT      -BDVD_START+stage1_buf)(U16 *)=
-          (de.size+DVD_BLK_SIZE-1)>>(BLK_SIZE_BITS+2);
-    *(BDVD_SHIFT_BLKS   -BDVD_START+stage1_buf)(U16 *)=de.clus&3;
-    if (de.clus&3)
-      *(BDVD_BLK_CNT    -BDVD_START+stage1_buf)(U16 *)+=1;
-    FBlkWrite(out_file,stage1_buf,
-          20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
-    FClose(out_file);
-  }
-  Free(stage1_buf);
-}
-
-U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
-{
-  CDrv  *dv=Let2Drv(drv_let);
-  CISOPriDesc *iso_pri=CAlloc(DVD_BLK_SIZE),
-        *iso_boot=CAlloc(DVD_BLK_SIZE),
-        *iso_sup=CAlloc(DVD_BLK_SIZE),
-        *iso_term=CAlloc(DVD_BLK_SIZE);
-  I64 iso_size=0,i,j;
-  U32 *d;
-  CElTorito *et=CAlloc(DVD_BLK_SIZE);
-  U8    *zero_buf=CAlloc(DVD_BLK_SIZE);
-  CFile *out_file=NULL;
-
-  if (out_file=FOpen(iso_filename,"wc+")) {
-    iso_size=FSize(out_file)/DVD_BLK_SIZE;
-    for (i=0;i<dv->bd->drv_offset;i+=4)
-      FBlkWrite(out_file,zero_buf,i,4);
-
-    iso_pri->type=ISOT_PRI_VOL_DESC;
-    StrCpy(iso_pri->id,"CD001");
-    iso_pri->version=1;
-    FillU16Palindrome(&iso_pri->vol_set_size,1);
-    FillU16Palindrome(&iso_pri->vol_seq_num,1);
-    FillU16Palindrome(&iso_pri->log_block_size,DVD_BLK_SIZE);
-    FillU32Palindrome(&iso_pri->vol_space_size,iso_size);
-    FillU32Palindrome(&iso_pri->root_dir_record,dv->root_clus);
-    iso_pri->file_structure_version=1;
-    StrCpy(iso_pri->publisher_id,"TempleOS RedSea");
-
-    MemCpy(iso_sup,iso_pri,DVD_BLK_SIZE);
-    iso_sup->type=ISOT_SUPPLEMENTARY_DESC;
-
-    iso_boot->type=ISOT_BOOT_RECORD;
-    StrCpy(iso_boot->id,"CD001");
-    iso_boot->version=1;
-    StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
-
-    FBlkWrite(out_file,iso_pri,16<<2,4);
-    iso_term->type=ISOT_TERMINATOR;
-    StrCpy(iso_term->id,"CD001");
-    iso_term->version=1;
-
-    d=iso_boot(U8 *)+0x47;
-    *d=20<<2>>2;
-    FBlkWrite(out_file,iso_boot,17<<2,4);
-
-    FBlkWrite(out_file,iso_sup,18<<2,4);
-    FBlkWrite(out_file,iso_term,19<<2,4);
-
-    et->w[0]=1;
-    StrCpy(&et->w[2],"TempleOS");
-    et->w[15]=0xAA55;
-    j=0;
-    for (i=0;i<16;i++) //Checksum
-      j+=et->w[i];
-    et->w[14]=-j;
-    et->bootable=0x88;
-    et->media_type=0;//0=no emu 2=1.44meg 4=hard drive
-    et->sect_cnt=4;  //5 seems like the limit, 4 is safer
-    et->load_rba=20<<2>>2+1;
-    FBlkWrite(out_file,et,20<<2,4);
-    FClose(out_file);
-  }
-  Free(zero_buf);
-  Free(et);
-  Free(iso_pri);
-  Free(iso_boot);
-  Free(iso_sup);
-  Free(iso_term);
-}
-
-I64 RedSeaISOPass1(CDirEntry *tmpde)
-{
-  I64 dir_entry_cnt=3+LinkedLstCnt(tmpde),res=0;
-  while (tmpde) {
-    if (tmpde->attr & RS_ATTR_DIR) {
-      if (tmpde->sub)
-        res+=RedSeaISOPass1(tmpde->sub);
-      else
-        res+=BLK_SIZE; //Empty dir
-    } else
-      res+=CeilU64(tmpde->size,BLK_SIZE);
-    tmpde=tmpde->next;
-  }
-  res+=CeilU64(dir_entry_cnt<<6,BLK_SIZE); //Size in bytes
-#assert CDIR_SIZE==64
-  return res;
-}
-public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
-        U8 *_stage2_filename=NULL)
-{//See ::/Misc/DoDistro.HC. Must be ISO.C
-  I64 i,res,root_cnt,root_dir_blks,bitmap_blks,bitmap_blks1;
-  CDirEntry *tmpde;
-  U8 buf[STR_LEN],*iso_filename,*src_dir,*stage2_filename;
-  CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First BDT_ISO_FILE_WRITE
-  CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE);
-
-  if (!IsDir(_src_dir))
-    PrintErr("'%s' is not a dir.\n",_src_dir);
-  else {
-    if (!_iso_filename)
-      _iso_filename=blkdev.dft_iso_c_filename;
-    iso_filename=ExtChg(_iso_filename,"ISO.C");
-    src_dir=DirNameAbs(_src_dir);
-    if (_stage2_filename) {
-      stage2_filename=FileNameAbs(_stage2_filename);
-      *stage2_filename=dv->drv_let;
-      i=StrLen(src_dir);
-      if (i!=3) //If not root
-        i++;    //Skip slash
-      StrCpy(stage2_filename+3,stage2_filename+i);
-    } else
-      stage2_filename=NULL;
-    tmpde=FilesFind(src_dir,FUF_RECURSE);
-    root_cnt=LinkedLstCnt(tmpde)+3;
-    root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
-    if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
-      bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
-      bitmap_blks=1;
-      do {
-        bitmap_blks1=bitmap_blks;
-        bitmap_blks=(res+bitmap_blks+BLK_SIZE<<3-1)/BLK_SIZE<<3;
-      } while (bitmap_blks!=bitmap_blks1);
-
-      bd->max_blk=CeilI64(bd->drv_offset+1+bitmap_blks+res,4);
-      bd->max_blk--; //Inclusive.
-      bd->file_dsk_name=AStrNew(iso_filename);
-      bd->init_root_dir_blks=root_dir_blks;
-      BlkDevAdd(bd,,TRUE,TRUE);
-      StrPrint(buf,"%C:/",dv->drv_let);
-      CopyTree(src_dir,buf,TRUE);
-      RedSeaISO9660Stage1(iso_filename,stage2_filename);
-      DrvDel(dv);
-      BlkDevDel(bd);
-    }
-    Free(stage2_filename);
-    Free(src_dir);
-    Free(iso_filename);
-  }
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Boot/MakeBoot.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Boot/MakeBoot.HC.HTML deleted file mode 100755 index 181a93f..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Boot/MakeBoot.HC.HTML +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-#include "BootDVDIns"
-#include "BootHDIns"
-#include "BootMHDIns"
-#include "BootRAM"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/Diff.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/Diff.HC.HTML deleted file mode 100755 index 5a18dbd..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/Diff.HC.HTML +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically)"
-
-#define DS_USE_FILE1    0
-#define DS_USE_FILE2    1
-#define DS_REMAINDER_1  2
-#define DS_REMAINDER_2  3
-#define DS_ABORT_FILE   4
-
-I64 PopUpDiffMenu()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$CM+LX,2,4$$FG$$BT,\"USE FILE1\",LE=DS_USE_FILE1$"
-        "$CM+LX,24,0$$CYAN$$BT,\"USE FILE2\",LE=DS_USE_FILE2$"
-        "$CM+LX,2,4$$FG$$BT,\"REMAINDER ALL FILE1\",LE=DS_REMAINDER_1$"
-        "$CM+LX,24,0$$CYAN$$BT,\"REMAINDER ALL FILE2\",LE=DS_REMAINDER_2$"
-        "$CM+LX,2,4$$FG$$BT,\"ABORT FILE\",LE=DS_ABORT_FILE$"
-        "$CM+LX,24,0$$FG$$BT,\"ABORT ALL FILES\",LE=DOCM_CANCEL$\n");
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 DiffEntriesCompare(CDocEntry *doc_e1,CDocEntry *doc_e2)
-{
-  return StrCmp(doc_e1->tag,doc_e2->tag);
-}
-
-#define DF_MODIFIED                     0x01
-#define DF_DONT_MODIFIED                0x02
-#define DF_REMAINDER_ALL_FILE1          0x04
-#define DF_REMAINDER_ALL_FILE2          0x08
-#define DF_ABORT_FILE                   0x10
-#define DF_ABORT_ALL_FILES              0x20
-#define DF_NO_MORE_PMTS_THIS_FILE       0x40
-
-U0 DiffSel(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,
-        I64 j2_lo,I64 j2_hi,I64 cnt1,I64 cnt2,
-        CDocEntry **doc_unsorted1,CDocEntry **doc_unsorted2)
-{
-  CDocEntry *doc_e,*doc_e1,*doc_e2;
-  Bool use_file1;
-  I64 i,old_flags;
-  CDoc *cur_l;
-  if (!(*_df_flags & (DF_ABORT_FILE|DF_ABORT_ALL_FILES))) {
-    "$RED$";
-    if (0<=j1_lo<cnt1)
-      "%d,",doc_unsorted1[j1_lo]->y+1;
-    else if (0<=j1_hi-1<cnt1)
-      "%d,",doc_unsorted1[j1_hi-1]->y+1;
-    else
-      "***,";
-    if (0<=j2_lo<cnt2)
-      "%d",doc_unsorted2[j2_lo]->y+1;
-    else if (0<=j2_hi-1<cnt2)
-      "%d",doc_unsorted2[j2_hi-1]->y+1;
-    else
-      "***";
-    "---------------------$FG$\n";
-    if (j1_lo<=0)
-      i=0;
-    else
-      i=j1_lo-1;
-    while (i<j1_hi) {
-      if (cur_l=DocPut) {
-        old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
-        cur_l->flags|=DOCF_PLAIN_TEXT;
-      }
-      "%s",doc_unsorted1[i++]->tag;
-      if (cur_l)
-        cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
-      '\n';
-    }
-    "$CYAN$";
-    if (j2_lo<=0)
-      i=0;
-    else
-      i=j2_lo-1;
-    while (i<j2_hi) {
-      if (cur_l=DocPut) {
-        old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
-        cur_l->flags|=DOCF_PLAIN_TEXT;
-      }
-      "%s",doc_unsorted2[i++]->tag;
-      if (cur_l)
-        cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
-      '\n';
-    }
-    "$FG$";
-
-    use_file1=TRUE;
-    if (!(*_df_flags & DF_NO_MORE_PMTS_THIS_FILE)) {
-      switch (PopUpDiffMenu) {
-        case DS_USE_FILE1:
-          break;
-        case DS_USE_FILE2:
-          use_file1=FALSE;
-          break;
-        case DS_REMAINDER_1:
-          *_df_flags=*_df_flags&~DF_REMAINDER_ALL_FILE2|
-                DF_REMAINDER_ALL_FILE1|DF_NO_MORE_PMTS_THIS_FILE;
-          break;
-        case DS_REMAINDER_2:
-          *_df_flags=*_df_flags&~DF_REMAINDER_ALL_FILE1|
-                DF_REMAINDER_ALL_FILE2|DF_NO_MORE_PMTS_THIS_FILE;
-          break;
-        case DS_ABORT_FILE:
-          *_df_flags|=DF_DONT_MODIFIED|DF_ABORT_FILE|
-                DF_NO_MORE_PMTS_THIS_FILE;
-          break;
-        default:
-          *_df_flags|=DF_DONT_MODIFIED|DF_ABORT_ALL_FILES|
-                DF_NO_MORE_PMTS_THIS_FILE;
-      }
-    }
-    if (*_df_flags & DF_REMAINDER_ALL_FILE2 &&
-          !(*_df_flags & (DF_DONT_MODIFIED|DF_REMAINDER_ALL_FILE1)))
-      use_file1=FALSE;
-    if (!use_file1) {
-      *_df_flags|=DF_MODIFIED;
-      doc_e1=doc_unsorted1[j1_lo]->last;
-      if (j1_lo<j1_hi) {
-        doc_e=doc_unsorted1[j1_lo];
-        while (doc_e!=doc_unsorted1[j1_hi]) {
-          doc_e2=doc_e->next;
-          DocEntryDel(doc,doc_e);
-          doc_e=doc_e2;
-        }
-      }
-      if (j2_lo<j2_hi) {
-        doc_e=doc_unsorted2[j2_lo];
-        while (doc_e!=doc_unsorted2[j2_hi]) {
-          doc_e2=DocEntryCopy(doc,doc_e);
-          QueIns(doc_e2,doc_e1);
-          doc_e1=doc_e2;
-          doc_e=doc_e->next;
-        }
-      }
-    }
-  }
-}
-
-Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
-        I64 cnt1,I64 cnt2,CDocEntry **doc_sorted1,CDocEntry **doc_sorted2,
-        CDocEntry **doc_unsorted1,CDocEntry **doc_unsorted2)
-{
-  I64 i,i1=0,i2=0,i2b,j1,j2,n,
-        best_j1,best_j2,best_score=0,score;
-  Bool res=FALSE;
-
-  if (j1_lo>=j1_hi || j2_lo>=j2_hi) {
-    if (j1_lo<j1_hi || j2_lo<j2_hi) {
-      DiffSel(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
-            doc_unsorted1,doc_unsorted2);
-      return TRUE;
-    } else
-      return FALSE;
-  }
-
-  //Locate longest matching str in intervals
-  while (i1<cnt1 && i2<cnt2) {
-    if (!(j1_lo<=doc_sorted1[i1]->user_data<j1_hi)) //user_data is the new y
-      i1++;
-    else if (!(j2_lo<=doc_sorted2[i2]->user_data<j2_hi)) //user_data is new y
-      i2++;
-    else {
-      i=StrCmp(doc_sorted1[i1]->tag,doc_sorted2[i2]->tag);
-      if (i>0)
-        i2++;
-      else if (i<0)
-        i1++;
-      else {
-        i2b=i2;
-        while (!StrCmp(doc_sorted1[i1]->tag,doc_sorted2[i2]->tag)) {
-          if (j2_lo<=doc_sorted2[i2]->user_data<j2_hi) {//user_data is the new y
-            score=0;
-            j1=doc_sorted1[i1]->user_data; //user_data is the new y
-            j2=doc_sorted2[i2]->user_data; //user_data is the new y
-            n=j1_hi-j1;
-            if (j2_hi-j2<n)
-              n=j2_hi-j2;
-            while (score<n) {
-              if (!StrCmp(doc_unsorted1[j1+score]->tag,
-                    doc_unsorted2[j2+score]->tag))
-                score++;
-              else
-                break;
-            }
-            if (score>best_score) {
-              best_score=score;
-              best_j1=j1;
-              best_j2=j2;
-            }
-          }
-          i2++;
-          if (i2>=cnt2)
-            break;
-        }
-        i2=i2b;
-        i1++;
-      }
-    }
-  }
-  if (!best_score) {
-    DiffSel(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
-          doc_unsorted1,doc_unsorted2);
-    return TRUE;
-  } else {
-    if (DiffSub(doc,_df_flags,j1_lo,best_j1,j2_lo,best_j2,cnt1,cnt2,
-          doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2))
-      res=TRUE;
-    if (DiffSub(doc,_df_flags,best_j1+best_score,j1_hi,best_j2+best_score,
-          j2_hi,cnt1,cnt2,
-          doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2))
-      res=TRUE;
-    return res;
-  }
-}
-
-Bool DiffBins(CDoc *doc1,CDoc *doc2)
-{
-  CDocBin *tmpb1=doc1->bin_head.next,
-        *tmpb2=doc2->bin_head.next;
-
-  if (tmpb1->last->last->num!=tmpb2->last->last->num)
-    return TRUE;
-  while (tmpb1!=&doc1->bin_head) {
-    if (tmpb1->size!=tmpb2->size ||
-          MemCmp(tmpb1->data,tmpb2->data,tmpb1->size))
-      return TRUE;
-    tmpb1=tmpb1->next;
-    tmpb2=tmpb2->next;
-  }
-  return FALSE;
-}
-
-public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
-{//Report differences between two files and merge differences
-//from src_file to dst_file.  Don't use _df_flags arg. (Used by Merge().)
-  CDoc *doc1=DocRead(dst_file,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR),
-        *doc2=DocRead(src_file,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  CDocEntry *doc_e,**doc_sorted1,**doc_sorted2,**doc_unsorted1,**doc_unsorted2;
-  I64 i,cnt1=0,cnt2=0,df_flags;
-  Bool res=FALSE;
-
-  if (_df_flags)
-    df_flags=*_df_flags;
-  else
-    df_flags=0;
-  df_flags&=DF_ABORT_ALL_FILES;
-
-  doc_e=doc1->head.next;
-  while (doc_e!=doc1) {
-    if (doc_e->type_u8==DOCT_TEXT)
-      doc_e->user_data=cnt1++; //user_data is the new y
-    doc_e=doc_e->next;
-  }
-
-  doc_e=doc2->head.next;
-  while (doc_e!=doc2) {
-    if (doc_e->type_u8==DOCT_TEXT)
-      doc_e->user_data=cnt2++; //user_data is the new y
-    doc_e=doc_e->next;
-  }
-
-  doc_sorted1=MAlloc(cnt1*sizeof(CDocEntry *));
-  doc_unsorted1=MAlloc((cnt1+1)*sizeof(CDocEntry *));
-  i=0;
-  doc_e=doc1->head.next;
-  while (doc_e!=doc1) {
-    if (doc_e->type_u8==DOCT_TEXT) {
-      doc_sorted1[i]=doc_e;
-      doc_unsorted1[i++]=doc_e;
-    }
-    doc_e=doc_e->next;
-  }
-  doc_unsorted1[i]=doc1;
-  QSortI64(doc_sorted1,cnt1,&DiffEntriesCompare);
-
-  doc_sorted2=MAlloc(cnt2*sizeof(CDocEntry *));
-  doc_unsorted2=MAlloc((cnt2+1)*sizeof(CDocEntry *));
-  i=0;
-  doc_e=doc2->head.next;
-  while (doc_e!=doc2) {
-    if (doc_e->type_u8==DOCT_TEXT) {
-      doc_sorted2[i]=doc_e;
-      doc_unsorted2[i++]=doc_e;
-    }
-    doc_e=doc_e->next;
-  }
-  doc_unsorted2[i]=doc2;
-  QSortI64(doc_sorted2,cnt2,&DiffEntriesCompare);
-
-  res=DiffSub(doc1,&df_flags,0,cnt1,0,cnt2,cnt1,cnt2,
-        doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2);
-  if (df_flags&DF_MODIFIED && !(df_flags&DF_DONT_MODIFIED))
-    DocWrite(doc1);
-
-  if (DiffBins(doc1,doc2)) {
-    "$RED$Bin Data is Different$FG$\n";
-    res=TRUE;
-  }
-
-  DocDel(doc1);
-  DocDel(doc2);
-  Free(doc_sorted1);
-  Free(doc_sorted2);
-  Free(doc_unsorted1);
-  Free(doc_unsorted2);
-  if (_df_flags)
-    *_df_flags=df_flags;
-  return res;
-}
-
-#help_index "Cmd Line (Typically);Info"
-I64 ZRepCompare(CDirEntry *e1,CDirEntry *e2)
-{
-  return SignI64(e2->user_data(F64)-e1->user_data(F64));
-}
-public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
-  Bool just_text_not_graphics=TRUE)
-{//Report file compressibility.
-//Dft is just src files.  (Used to spot
-  //src files with redundancy in them.)
-  I64 i=0,cnt,size,fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1,**sort_buf;
-  U8 *buf;
-  CArcCompress *arc;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F+S");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  cnt=FileCnt(tmpde);
-  sort_buf=MAlloc(sizeof(CDirEntry *)*cnt);
-  while (tmpde) {
-    sort_buf[i++]=tmpde;
-    buf=FileRead(tmpde->full_name,&size);
-    if (just_text_not_graphics)
-      size=StrLen(buf);
-    arc=CompressBuf(buf,size);
-    Free(buf);
-    tmpde->user_data(F64)=100.0*arc->compressed_size/arc->expanded_size;
-    Free(arc);
-    tmpde=tmpde->next;
-  }
-  QSortI64(sort_buf,cnt,&ZRepCompare);
-  for (i=0;i<cnt;i++) {
-    "%4.1f%% %04X ",sort_buf[i]->user_data,sort_buf[i]->size;
-    PutFileLink(sort_buf[i]->full_name);
-    '\n';
-  }
-  Free(sort_buf);
-  DirTreeDel(tmpde1);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/DocUtils.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/DocUtils.HC.HTML deleted file mode 100755 index 1a9e676..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/DocUtils.HC.HTML +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Cmd Line (Typically)"
-
-U0 CursorRemFile(U8 *filename)
-{//Rem ASCII 5 cursor from one file.
-  CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
-  DocWrite(doc);
-  DocDel(doc);
-}
-public U0 CursorRem(U8 *files_find_mask="*")
-{//Rem ASCII 5 cursor.
-  I64 fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
-  CDirEntry *tmpde=FilesFind(files_find_mask,fuf_flags),*tmpde1=tmpde;
-  while (tmpde) {
-    CursorRemFile(tmpde->full_name);
-    Touch(tmpde->full_name,"",,tmpde->datetime);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
-U0 CollapseFile(U8 *filename,Bool collapse=TRUE)
-{//Collapse DolDoc trees in one file.
-  CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
-  DocCollapse(collapse,doc);
-  DocWrite(doc);
-  DocDel(doc);
-}
-public U0 Collapse(U8 *files_find_mask="*",
-        Bool collapse=TRUE,U8 *fu_flags=NULL)
-{//Collapse DolDoc trees.
-  I64 fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+$+O");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  CDirEntry *tmpde=FilesFind(files_find_mask,fuf_flags),*tmpde1=tmpde;
-  while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
-    CollapseFile(tmpde->full_name,collapse);
-    Touch(tmpde->full_name,"",,tmpde->datetime);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
-I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags)
-{
-  U8 *st,*st2,**_dst;
-  I64 i,res=0;
-
-  if (doc_e->de_flags&DOCEF_LINK && doc_e->de_flags&(DOCEF_AUX_STR|DOCEF_TAG)) {
-    if (doc_e->de_flags & DOCEF_AUX_STR && doc_e->de_flags & DOCEF_TAG &&
-          !MemCmp(doc_e->aux_str,"FI:",3) &&
-          !StrCmp(doc_e->aux_str+3,doc_e->tag)) {
-      Free(doc_e->aux_str);
-      doc_e->aux_str=NULL;
-      doc_e->de_flags&=~DOCEF_AUX_STR;
-      res++;
-    }
-    if (doc_e->de_flags & DOCEF_AUX_STR)
-      _dst=&doc_e->aux_str;
-    else
-      _dst=&doc_e->tag;
-    if (StrMatch(".Z",*_dst)) {
-      st=DocLinkFile(*_dst);
-      if (FileFind(st)) {
-        if (IsDotZ(st))
-          st[StrLen(st)-2]=0;
-        i=StrLen(st);
-        if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') {
-          StrCpy(st2+i,st2+i+2);
-          res++;
-        }
-      }
-      Free(st);
-    }
-    if (fuf_flags&FUF_RISKY) {
-      if (doc_e->de_flags & DOCEF_AUX_STR) {
-        if (st=StrMatch(".Z",doc_e->aux_str)) {
-          StrCpy(st,st+2);
-          res++;
-        }
-      }
-      if (doc_e->de_flags&DOCEF_TAG) {
-        if (st=StrMatch(".Z",doc_e->tag)) {
-          StrCpy(st,st+2);
-          res++;
-        }
-      }
-    }
-  }
-  return res;
-}
-I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
-{//Optimize Doc.
-  Bool unlock=DocLock(doc);
-  I64 res=0;
-  CDocEntry *doc_e,*doc_e1,*doc_e_last;
-  DocRecalc(doc);
-  doc_e_last=NULL;
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    doc_e1=doc_e->next;
-    if (res+=DocOptEntry(doc,doc_e,fuf_flags))
-      res+=DocOptEntry(doc,doc_e,fuf_flags);
-    if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 &&
-       doc_e_last->de_flags==doc_e->de_flags &&
-       Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) &&
-       doc_e_last->attr==doc_e->attr) {
-      DocEntryDel(doc,doc_e);
-      res++;
-    } else
-      doc_e_last=doc_e;
-    doc_e=doc_e1;
-  }
-  DocRecalc(doc);
-  if (unlock)
-    DocUnlock(doc);
-  return res;
-}
-I64 DocOptFile(U8 *filename,I64 fuf_flags)
-{//Optimize file.
-  I64 res;
-  CDoc *doc=DocRead(filename);
-  if (res=DocOptDoc(doc,fuf_flags)) {
-    "-%d:%s\n",res,doc->filename.name;
-    DocWrite(doc);
-  }
-  DocDel(doc);
-  return res;
-}
-I64 DocOptLst(CDirEntry *tmpde,I64 fuf_flags)
-{
-  I64 res=0;
-  CDirEntry *tmpde1;
-  while (tmpde) {
-    tmpde1=tmpde->next;
-    if (tmpde->attr & RS_ATTR_DIR) {
-      if (tmpde->sub) {
-        "Scanning Directory: %s\n",tmpde->full_name;
-        res+=DocOptLst(tmpde->sub,fuf_flags);
-      }
-    } else
-      res+=DocOptFile(tmpde->full_name,fuf_flags);
-    DirEntryDel(tmpde);
-    tmpde=tmpde1;
-  }
-  return res;
-}
-public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
-{//Optimize DolDoc files, eliminating aux_str's and .Z's.
-//+R flag for aggressively risky.
-  I64 fuf_flags=0;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
-        fuf_flags&~FUG_FILES_FIND);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/Find.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/Find.HC.HTML deleted file mode 100755 index 0f97350..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/Find.HC.HTML +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically)"
-
-#define FND_REPLACE     0
-#define FND_SKIP        1
-#define FND_ALL         2
-#define FND_ED          3
-#define FND_ABORT_FILE  4
-#define FND_SKIP_FILE   5
-
-I64 PopUpFindMenu()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"$CM+LX,2,4$$BT,\"REPLACE\",LE=FND_REPLACE$"
-        "$CM+LX,22,0$$BT,\"SKIP\",LE=FND_SKIP$"
-        "$CM+LX,2,4$$BT,\"ALL\",LE=FND_ALL$"
-        "$CM+LX,22,0$$BT,\"ABORT ALL\",LE=DOCM_CANCEL$"
-        "$CM+LX,2,4$$BT,\"EDIT\",LE=FND_ED$"
-        "$CM+LX,22,0$$BT,\"ABORT FILE\",LE=FND_ABORT_FILE$"
-        "$CM+LX,2,4$$BT,\"SKIP FILE\",LE=FND_SKIP_FILE$\n");
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  return i;
-}
-
-I64 FindFile(U8 *needle_str,U8 *haystack_filename,
-        I64 *_fuf_flags,U8 *replace_text)
-{//Have you confused with FileFind()?
-  Bool first_on_line,write_this_file=FALSE,cont=!Bt(_fuf_flags,FUf_CANCEL);
-  U8 *src,*dst,*dst2,*name_buf=NULL;
-  I64 i,j,plen,rlen,dlen,cnt=0,old_flags,ss_flags;
-  CDoc *cur_l,*doc=DocRead(haystack_filename,
-        DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  CDocEntry *doc_e;
-
-  if (Bt(_fuf_flags,FUf_IGNORE))
-    ss_flags=SFF_IGNORE_CASE;
-  else
-    ss_flags=0;
-  if (Bt(_fuf_flags,FUf_WHOLE_LABELS))
-    ss_flags|=SFG_WHOLE_LABELS;
-  if (Bt(_fuf_flags,FUf_WHOLE_LABELS_BEFORE))
-    ss_flags|=SFF_WHOLE_LABELS_BEFORE;
-  if (Bt(_fuf_flags,FUf_WHOLE_LABELS_AFTER))
-    ss_flags|=SFF_WHOLE_LABELS_AFTER;
-
-  plen=StrLen(needle_str);
-  if (replace_text)
-    rlen=StrLen(replace_text);
-  doc_e=doc->head.next;
-  while (doc_e!=doc && cont) {
-    if (doc_e->type_u8==DOCT_TEXT) {
-      src=doc_e->tag;
-      first_on_line=TRUE;
-      while (src && cont) {
-        if (src=StrFind(needle_str,src,ss_flags)) {
-          cnt++;
-          if (first_on_line || Bt(_fuf_flags,FUf_REPLACE)) {
-            first_on_line=FALSE;
-            PutFileLink(haystack_filename,,doc_e->y+1,TRUE);
-            name_buf=MStrPrint("%s,%d",haystack_filename,doc_e->y+1);
-            if (cur_l=DocPut) {
-              old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
-              cur_l->flags|=DOCF_PLAIN_TEXT;
-            }
-            " %s\n",doc_e->tag;
-            if (cur_l)
-              cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
-          }
-          if (Bt(_fuf_flags,FUf_REPLACE)) {
-            if (Bt(_fuf_flags,FUf_ALL))
-              i=FND_ALL;
-            else {
-              i=PopUpFindMenu;
-              if (i<0) {
-                LBts(_fuf_flags,FUf_CANCEL);
-                cont=FALSE;
-                write_this_file=FALSE;
-              } else if (i==FND_ALL)
-                LBts(_fuf_flags,FUf_ALL);
-              else if (i==FND_ABORT_FILE) {
-                cont=FALSE;
-                write_this_file=FALSE;
-              } else if (i==FND_SKIP_FILE)
-                cont=FALSE;
-            }
-            if (i==FND_REPLACE || i==FND_ALL) {
-              dlen=StrLen(doc_e->tag);
-              dst=MAlloc(dlen+1+rlen-plen);
-              dst2=dst;
-              j=src-doc_e->tag;
-              for (i=0;i<j;i++)
-                *dst++=doc_e->tag[i];
-              for (i=0;i<rlen;i++)
-                *dst++=replace_text[i];
-              src=dst;
-              for (i=j+plen;i<=dlen;i++)
-                *dst++=doc_e->tag[i];
-              Free(doc_e->tag);
-              doc_e->tag=dst2;
-              if (cur_l=DocPut) {
-                old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
-                cur_l->flags|=DOCF_PLAIN_TEXT;
-              }
-              "%12s,%04d*%s\n",haystack_filename,doc_e->y+1,dst2;
-              if (cur_l)
-                cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
-              write_this_file=TRUE;
-            } else {
-              src++;
-              if (i==FND_ED) {
-                Free(name_buf);
-                name_buf=StrNew(doc->filename.name);
-                doc->flags&=~DOCF_NO_CURSOR;
-                doc->cur_entry=doc_e;
-                doc->cur_col=doc_e->min_col;
-                DocWrite(doc);
-                DocDel(doc);
-                "Wrote:%s\n",name_buf;
-                Ed(name_buf);
-                doc=DocRead(name_buf, DOCF_PLAIN_TEXT_TABS);
-                doc_e=doc->cur_entry;
-                if (doc_e->last!=doc) doc_e=doc_e->last;
-                src=NULL;
-                write_this_file=FALSE;
-              }
-            }
-          } else
-            src++;
-          Free(name_buf);
-          name_buf=NULL;
-        }
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  if (write_this_file) {
-    DocWrite(doc);
-    "Wrote:%s\n",doc->filename.name;
-  }
-  DocDel(doc);
-  return cnt;
-}
-
-public I64 Find(U8 *needle_str,U8 *files_find_mask="*",
-        U8 *fu_flags=NULL,U8 *replace_text=NULL)
-{/*Find occurrences of a string in files.
-This does not do regular expressions.
-Anyway, it's good for searching and replacing.
-Let's say it stands for global replace ;-)
-
-"+r" =recurse
-"+i" =ignore case
-"+l" =whole labels only.
-This will check for a nonlabel character before
-and after.  If you have a var, "dd" and don't
-want to match words like "Add", you
-set this flag and it will see that the characters
-before or after "dd" are label characters.
-"+lb"=only checks for label chars before.
-"+la"=only checks for label chars after.
-*/
-  I64 cnt=0,fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+i+f+F+T");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_ALL|
-        FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER))
-    throw('FUF');
-  LBEqu(&fuf_flags,FUf_REPLACE,replace_text);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
-  fuf_flags&=FUF_ALL|FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|
-        FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER;
-  while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
-    cnt+=FindFile(needle_str,tmpde->full_name,&fuf_flags,replace_text);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return cnt;
-}
-
-public I64 FileOcc(U8 *needle_str,
-        U8 *files_find_mask="*",U8 *fu_flags="+r+i+l")
-{/*Silently return occurrences of a string in files.
-"+r"=recurse
-"+i"=ignore case
-"+l"=whole labels only.
-"+lb"=only checks for label chars before.
-"+la"=only checks for label chars after.
-*/
-  I64 cnt=0;
-  Bool old_silent=Silent(TRUE);
-  cnt=Find(needle_str,files_find_mask,fu_flags);
-  Silent(old_silent);
-  return cnt;
-}
-
-class CFind
-{
-  U8    find_text[STR_LEN] format "$DA-P,"
-        "A=\"FIND        :%s\"$\n";
-  U8    replace_text[STR_LEN] format "$DA-P,"
-        "A=\"REPLACE     :%s\"$\n";
-  Bool  replace         format "$CB,\"REPLACE\"$\n";
-  Bool  match_case      format "$CB,\"MATCH CASE\"$\n";
-  Bool  whole_labels    format "$CB,\"WHOLE LABELS\"$\n";
-  U8    filemask[STR_LEN] format "$DA-P,A=\"FILE MASK   :%s\"$\n";
-  Bool  recurse         format "$CB,\"RECURSE\"$\n";
-};
-
-I64 FindWiz()
-{
-  CDoc *doc;
-  U8 buf[32],*dir,*st;
-  CFind *g=CAlloc(sizeof(CFind));
-  I64 res=0;
-  g->recurse=TRUE;
-  StrCpy(g->filemask,FILEMASK_TXT);
-  if (doc=DocPut) {
-    StrCpy(g->find_text,doc->find_replace->find_text);
-    StrCpy(g->replace_text,doc->find_replace->replace_text);
-    g->replace=doc->find_replace->replace;
-    g->match_case=doc->find_replace->match_case;
-    g->whole_labels=doc->find_replace->whole_labels;
-  }
-  if (DocForm(g,,0,"$PURPLE$$TX+CX,\"Find\"$\n$FG$")) {
-    if (doc) {
-      StrCpy(doc->find_replace->find_text,g->find_text);
-      StrCpy(doc->find_replace->replace_text,g->replace_text);
-      doc->find_replace->replace=g->replace;
-      doc->find_replace->match_case=g->match_case;
-      doc->find_replace->whole_labels=g->whole_labels;
-    }
-    dir=PopUpPickDir;
-    if (*dir) {
-      *buf=0;
-      if (g->match_case)
-        CatPrint(buf,"-i");
-      if (!g->recurse)
-        CatPrint(buf,"-r");
-      if (g->whole_labels)
-        CatPrint(buf,"+l");
-      if (g->replace)
-        st=MStrPrint("\"$$WW+H,1$$\";Cd(\"%s\");"
-              "Find(\"%Q\",\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",
-              dir,g->find_text,g->filemask,buf,g->replace_text);
-      else
-        st=MStrPrint("\"$$WW+H,1$$\";Cd(\"%s\");"
-              "Find(\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",
-              dir,g->find_text,g->filemask,buf);
-      res=PopUp(st);
-    }
-    Free(dir);
-  }
-  Free(g);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/HeapLog.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/HeapLog.HC.HTML deleted file mode 100755 index 9f1e398..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/HeapLog.HC.HTML +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - -
-#help_index "Debugging/Heap;Memory/Debugging"
-#help_file "::/Doc/HeapDbg"
-
-#define HL_CALLER_DEPTH 5 //Feel free to change this.
-#define HL_HASH_SIZE    0x1000
-
-class CHeapLog
-{
-  CHeapLog *next,*last;
-  union {
-    U8 *addr;
-    I64 size;
-  }
-  I64 cnt;
-  U8 *caller[HL_CALLER_DEPTH];
-};
-
-class CHeapLogHash
-{
-  CHeapLog *next,*last;
-};
-
-CHeapCtrl *heaplog_hc_watched,*heaplog_hc=NULL;
-CHeapLogHash *heaplog_head=NULL;
-
-U0 HeapLogMAlloc(U8 *addr)
-{
-  CHeapLog *tmphl;
-  I64 i;
-  if (MHeapCtrl(addr)==heaplog_hc_watched) {
-    tmphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
-    tmphl->addr=addr;
-    for (i=0;i<HL_CALLER_DEPTH;i++)
-      tmphl->caller[i]=Caller(i+2);
-    i=addr>>3 &(HL_HASH_SIZE-1);
-    PUSHFD
-    CLI
-    while (LBts(&sys_semas[SEMA_HEAPLOG_LOCK],0))
-      PAUSE
-    QueIns(tmphl,heaplog_head[i].last);
-    LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-    POPFD
-  }
-}
-
-U0 HeapLogFree(U8 *addr)
-{
-  I64 i;
-  CHeapLog *tmphl;
-  if (!addr) return;
-  if (MHeapCtrl(addr)==heaplog_hc_watched) {
-    i=addr>>3 &(HL_HASH_SIZE-1);
-    PUSHFD
-    CLI
-    while (LBts(&sys_semas[SEMA_HEAPLOG_LOCK],0))
-      PAUSE
-    tmphl=heaplog_head[i].next;
-    while (tmphl!=&heaplog_head[i]) {
-      if (addr==tmphl->addr) {
-        QueRem(tmphl);
-        LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-        POPFD
-        Free(tmphl);
-        return;
-      }
-      tmphl=tmphl->next;
-    }
-    LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-    POPFD
-  }
-}
-
-public Bool HeapLog(Bool val=ON,CTask *task=NULL)
-{//Turn on.  Collect data.  Call HeapLogAddrRep() or  HeapLogSizeRep().
-  I64 i;
-  if (val) {
-    if (Bt(&sys_semas[SEMA_HEAPLOG_ACTIVE],0)) {
-      "HeapLog Already Active\n";
-      return TRUE;
-    } else {
-      if (!task) task=Fs;
-      if (TaskValidate(task))
-        heaplog_hc_watched=task->data_heap;
-      else
-        heaplog_hc_watched=task;//Actually, not a task, must be a HeapCtrl.
-      PUSHFD
-      CLI
-      while (LBts(&sys_semas[SEMA_HEAPLOG_LOCK],0))
-        PAUSE
-      heaplog_hc=HeapCtrlInit(,,sys_data_bp);
-      ext[EXT_HEAPLOG_MALLOC]=&HeapLogMAlloc;
-      ext[EXT_HEAPLOG_FREE]=&HeapLogFree;
-      heaplog_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
-      for (i=0;i<HL_HASH_SIZE;i++)
-        QueInit(&heaplog_head[i]);
-      LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-      POPFD
-      LBts(&sys_semas[SEMA_HEAPLOG_ACTIVE],0);
-      return FALSE;
-    }
-  } else {
-    if (!LBtr(&sys_semas[SEMA_HEAPLOG_ACTIVE],0)) {
-      "HeapLog Not Active\n";
-      return FALSE;
-    } else {
-      HeapCtrlDel(heaplog_hc);
-      heaplog_head=heaplog_hc=NULL;
-      ext[EXT_HEAPLOG_MALLOC]=NULL;
-      ext[EXT_HEAPLOG_FREE]=NULL;
-      return TRUE;
-    }
-  }
-}
-
-public U0 HeapLogAddrRep(Bool leave_it=OFF)
-{//Call HeapLog() first and collect data.
-  I64 i,j,total=0;
-  CHeapLog *tmphl,hl;
-  if (!LBtr(&sys_semas[SEMA_HEAPLOG_ACTIVE],0)) {
-    "HeapLog Not Active\n";
-    return;
-  }
-  "$WW,0$";
-  while (LBts(&sys_semas[SEMA_HEAPLOG_LOCK],0))
-    PAUSE
-  for (i=0;i<HL_HASH_SIZE;i++) {
-    tmphl=heaplog_head[i].next;
-    while (tmphl!=&heaplog_head[i]) {
-//Take snapshot in case modified. (while we work)
-      MemCpy(&hl,tmphl,sizeof(CHeapLog));
-      "$PURPLE$%08X$FG$ %08X",MSize(hl.addr),hl.addr;
-      for (j=0;j<HL_CALLER_DEPTH;j++)
-        " %P",hl.caller[j];
-      '\n';
-      total+=MSize(hl.addr);
-      tmphl=hl.next;
-    }
-  }
-  LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-  "\n$LTRED$Total:%08X$FG$\n",total;
-  LBts(&sys_semas[SEMA_HEAPLOG_ACTIVE],0);
-  if (!leave_it)
-    HeapLog(OFF);
-}
-
-public U0 HeapLogSizeRep(Bool leave_it=OFF)
-{//Call HeapLog() first and collect data.
-  I64 i,j,k,total=0;
-  CHeapLog *tmphla,hla,*tmphls,*tmphls1;
-  CHeapLogHash *size_head;
-  if (!LBtr(&sys_semas[SEMA_HEAPLOG_ACTIVE],0)) {
-    "HeapLog Not Active\n";
-    return;
-  }
-
-  size_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
-  for (i=0;i<HL_HASH_SIZE;i++)
-    QueInit(&size_head[i]);
-
-  "$WW,0$";
-  while (LBts(&sys_semas[SEMA_HEAPLOG_LOCK],0))
-    PAUSE
-  for (i=0;i<HL_HASH_SIZE;i++) {
-    tmphla=heaplog_head[i].next;
-    while (tmphla!=&heaplog_head[i]) {
-//Take snapshot in case modified. (while we work)
-      MemCpy(&hla,tmphla,sizeof(CHeapLog));
-      k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
-      tmphls=size_head[k].next;
-      while (tmphls!=&size_head[k]) {
-        if (MSize(hla.addr)==tmphls->size) {
-          for (j=0;j<HL_CALLER_DEPTH;j++)
-            if (hla.caller[j]!=tmphls->caller[j])
-              goto hl_next;
-          tmphls->cnt++;
-          goto hl_found;
-        }
-hl_next:
-        tmphls=tmphls->next;
-      }
-      tmphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
-      MemCpy(tmphls,&hla,sizeof(CHeapLog));
-      tmphls->cnt=1;
-      tmphls->size=MSize(hla.addr);
-      QueIns(tmphls,size_head[k].last);
-hl_found:
-      tmphla=hla.next;
-    }
-  }
-  LBtr(&sys_semas[SEMA_HEAPLOG_LOCK],0);
-
-  for (i=0;i<HL_HASH_SIZE;i++) {
-    tmphls=size_head[i].next;
-    while (tmphls!=&size_head[i]) {
-      tmphls1=tmphls->next;
-      "%08X*%08X=%08X",tmphls->size,tmphls->cnt,tmphls->size*tmphls->cnt;
-      for (j=0;j<HL_CALLER_DEPTH;j++)
-        " %P",tmphls->caller[j];
-      '\n';
-      total+=tmphls->size*tmphls->cnt;
-      Free(tmphls);
-      tmphls=tmphls1;
-    }
-  }
-  Free(size_head);
-
-  "\n$LTRED$Total:%08X$FG$\n",total;
-  LBts(&sys_semas[SEMA_HEAPLOG_ACTIVE],0);
-  if (!leave_it)
-    HeapLog(OFF);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/LineRep.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/LineRep.HC.HTML deleted file mode 100755 index ac646b8..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/LineRep.HC.HTML +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically)"
-
-I64 LineRep1(CDirEntry *tmpde)
-{
-  CDoc *doc;
-  I64 res=0,i;
-  while (tmpde) {
-    i=0;
-    if (tmpde->attr&RS_ATTR_DIR)
-      i=LineRep1(tmpde->sub);
-    else {
-      doc=DocRead(tmpde->full_name);
-      if (doc->head.next!=doc)
-        i=doc->head.last->y+2;
-      DocDel(doc);
-    }
-    tmpde->user_data=i;
-    res+=i;
-    tmpde=tmpde->next;
-  }
-  return res;
-}
-U0 LineRep2(CDoc *doc,CDirEntry *tmpde)
-{
-  while (tmpde) {
-    if (tmpde->attr&RS_ATTR_DIR) {
-      DocPrint(doc,"%8,d $TR+C,\"%s\"$\n$ID,2$",tmpde->user_data,tmpde->name);
-      LineRep2(doc,tmpde->sub);
-      DocPrint(doc,"$ID,-2$");
-    } else
-      DocPrint(doc,"%8,d $LK,\"%s\",A=\"FI:%s\"$\n",
-            tmpde->user_data,tmpde->name,tmpde->full_name);
-    tmpde=tmpde->next;
-  }
-}
-public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
-{//Source line-of-code count report.
-  I64 fuf_flags=0,res=0;
-  CDoc *doc=DocNew;
-  CDirEntry *tmpde1=NULL;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+S");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (tmpde1=FilesFind(files_find_mask,fuf_flags)) {
-    res=LineRep1(tmpde1);
-    DocPrint(doc,"%8,d $TR+C,\"%s\"$\n$ID,2$",res,files_find_mask);
-    LineRep2(doc,tmpde1);
-    DocPrint(doc,"$ID,-2$");
-    DirTreeDel(tmpde1);
-  }
-  DocInsDoc(DocPut,doc);
-  DocDel(doc);
-  return res;
-}
-
-I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
-{
-  I64 res=0,i;
-  U8 buf[BLK_SIZE];
-  CDrv *dv;
-  while (tmpde) {
-    if (tmpde->attr&RS_ATTR_DIR)
-      i=SizeRep1(tmpde->sub,_fuf_flags);
-    else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
-          FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
-      dv=Let2Drv(*tmpde->full_name);
-      BlkRead(dv,buf,Clus2Blk(dv,tmpde->clus),1);
-      i=(&buf)(CArcCompress *)->expanded_size;
-    }
-    tmpde->user_data=i;
-    res+=i;
-    tmpde=tmpde->next;
-  }
-  return res;
-}
-U0 SizeRep2(CDoc *doc,CDirEntry *tmpde)
-{
-  while (tmpde) {
-    if (tmpde->attr&RS_ATTR_DIR) {
-      DocPrint(doc,"%10,d $TR+C,\"%s\"$\n$ID,2$",
-            tmpde->user_data,tmpde->name);
-      SizeRep2(doc,tmpde->sub);
-      DocPrint(doc,"$ID,-2$");
-    } else {
-      DocPrint(doc,"%10,d ",tmpde->user_data);
-      DocPrint(doc,"$LK,\"%s\",A=\"FI:%s\"$\n",
-            tmpde->name,tmpde->full_name);
-    }
-    tmpde=tmpde->next;
-  }
-}
-public I64 SizeRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
-{//Report file sizes. "+x" for expanded size of compressed files.
-  I64 fuf_flags=0,res=0;
-  CDoc *doc=DocNew;
-  CDirEntry *tmpde1=NULL;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
-    fuf_flags&=FUF_EXPAND;
-    res=SizeRep1(tmpde1,&fuf_flags);
-    DocPrint(doc,"%10,d $TR+C,\"%s\"$\n$ID,2$",res,files_find_mask);
-    SizeRep2(doc,tmpde1);
-    DocPrint(doc,"$ID,-2$");
-    DirTreeDel(tmpde1);
-  }
-  DocInsDoc(DocPut,doc);
-  DocDel(doc);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/LinkChk.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/LinkChk.HC.HTML deleted file mode 100755 index e36417e..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/LinkChk.HC.HTML +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - -
-#help_index "Debugging;Cmd Line (Typically)"
-
-I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
-{
-  U8 *st;
-  Bool found,unlock=DocLock(doc);
-  CDoc *old_doc;
-  CDocEntry *doc_e=doc->head.next;
-  I64 res=0;
-  while (doc_e!=doc) {
-    if (ScanKey) {
-      LBts(_fuf_flags,FUf_CANCEL);
-      break;
-    }
-    if (st=DocEntryLink(doc,doc_e)) {
-      old_doc=DocPut;
-      DocLock(old_doc);
-      Fs->put_doc=doc;
-      found=DocLinkChk(doc,st);
-      Fs->put_doc=old_doc;
-      DocUnlock(old_doc);
-      if (!found) {
-        PutFileLink(doc->filename.name,,doc_e->y);
-        "$RED$ %04d:%s\n$FG$",doc_e->y,st;
-        res++;
-      }
-      Free(st);
-    } else if (doc_e->type_u8==DOCT_ERROR) {
-      PutFileLink(doc->filename.name,,doc_e->y);
-      "$RED$ Doc Error\n$FG$";
-      res++;
-    }
-    doc_e=doc_e->next;
-  }
-  if (unlock) DocUnlock(doc);
-  return res;
-}
-
-I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
-{
-  I64 res;
-  CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
-  res=LinkChkDoc(doc,_fuf_flags);
-  DocDel(doc);
-  return res;
-}
-public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
-{//Check documents for broken file links.
-  I64 fuf_flags=0,res=0;
-  CDirEntry *tmpde,*tmpde1;
-  U8 *st;
-  progress2_max=1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$+f+F+O");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
-
-    st=MStrPrint("Before %s Broke:%d",tmpde->full_name,res);
-    if (StrLen(st)>PROGRESS_DESC_LEN-1)
-      st[PROGRESS_DESC_LEN-1]=0;
-    StrCpy(progress2_desc,st);
-    Free(st);
-    Yield;
-
-    res+=LinkChkFile(tmpde->full_name,&fuf_flags);
-
-    st=MStrPrint("After %s Broke:%d",tmpde->full_name,res);
-    if (StrLen(st)>PROGRESS_DESC_LEN-1)
-      st[PROGRESS_DESC_LEN-1]=0;
-    StrCpy(progress2_desc,st);
-    Free(st);
-    Yield;
-
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  progress2_max=0;
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/MakeUtils.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/MakeUtils.HC.HTML deleted file mode 100755 index c570100..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/MakeUtils.HC.HTML +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - -
-Cd(__DIR__);;
-#include "Diff"
-#include "Find"
-#include "HeapLog"
-#include "LineRep"
-#include "LinkChk"
-#include "MemRep"
-#include "Merge"
-#include "Profiler"
-#include "StrUtils"
-#include "DocUtils"
-#include "ToDolDoc"
-#include "ToTXT"
-#include "TOS"
-Cd("..");;
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/MemRep.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/MemRep.HC.HTML deleted file mode 100755 index a48593e..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/MemRep.HC.HTML +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - -
-#help_index "Info;Memory/Info;Cmd Line (Typically)"
-
-I64 TSSSize(CTSS *tss)
-{
-  return MSize2(tss)+MSize2(tss->st0)+MSize2(tss->st1)+MSize2(tss->st2);
-}
-
-I64 PenBrushesSize()
-{
-  I64 res=0,i;
-  for (i=0;i<GR_PEN_BRUSHES_NUM;i++)
-    res+=DCSize(gr.pen_brushes[i])+DCSize(gr.collision_pen_brushes[i])+
-          DCSize(gr.even_pen_brushes[i])+DCSize(gr.odd_pen_brushes[i]);
-  return res;
-}
-
-I64 ScrnZoomTablesSize()
-{
-  I64 res=0,i;
-  for (i=1;i<=GR_SCRN_ZOOM_MAX;i++)
-    res+=MSize2(gr.scrn_zoom_tables[i]);
-  return res;
-}
-
-I64 TaskStkSize(CTask *task)
-{
-  CTaskStk *tmps=task->stk;
-  I64 res=0;
-  while (tmps) {
-    res+=MSize2(tmps);
-    tmps=tmps->next_stk;
-  }
-  return res;
-}
-
-I64 TaskQueSize(CTask *task)
-{
-  CJob *tmpc,*tmpc1;
-  I64 res=0;
-  PUSHFD
-  CLI
-  while (LBts(&task->srv_ctrl.flags,JOBCf_LOCKED))
-    PAUSE
-
-  tmpc1=&task->srv_ctrl.next_waiting;
-  tmpc=tmpc1->next;
-  while (tmpc!=tmpc1) {
-    res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
-    tmpc=tmpc->next;
-  }
-
-  tmpc1=&task->srv_ctrl.next_done;
-  tmpc=tmpc1->next;
-  while (tmpc!=tmpc1) {
-    res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
-    tmpc=tmpc->next;
-  }
-
-  LBtr(&task->srv_ctrl.flags,JOBCf_LOCKED);
-  POPFD
-  return res;
-}
-
-I64 BlkDevsSize()
-{
-  I64 i,j,res=MSize2(blkdev.blkdevs);
-  CBlkDev *bd;
-  for (i=0;i<BLKDEVS_NUM;i++) {
-    bd=&blkdev.blkdevs[i];
-    if (bd->bd_signature==BD_SIGNATURE_VAL) {
-      j=(bd->max_blk+1)<<BLK_SIZE_BITS;
-      if (bd->type==BDT_RAM)
-        "RAMDsk %C\t:%010X/%010X\n",
-              bd->first_drv_let,j-DrvUnused(bd->first_drv_let),j;
-      res+=MSize2(bd->dev_id_record);
-    }
-  }
-  return res;
-}
-
-I64 DrvsSize()
-{
-  I64 i,res=MSize2(blkdev.drvs);
-  for (i=0;i<DRVS_NUM;i++)
-    res+=MSize2(blkdev.drvs[i].cur_fat_blk)+MSize2(blkdev.drvs[i].fis);
-  return res;
-}
-
-Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
-{
-  I64 i,j,k,m,n;
-  CDoc *pdoc,*ddoc,*bdoc;
-  CCmpCtrl *cc;
-  CMathODE *o;
-  CCPU *c;
-  CTask *task1;
-
-  if (!override_validate && !TaskValidate(task))
-    return FALSE;
-  if (task==Fs)
-    task->rsp=GetRSP;
-  "$BLACK$%-27t$Q#%08X$FG$\n",task->task_title,task;
-  "$ID,2$Heap\t:%010X/%010X\n",TaskMemUsed(task,override_validate),
-        TaskMemAlloced(task,override_validate);
-
-  i=UnusedStk(task);
-  j=TaskStkSize(task);
-  if (0<=i<=task->stk->stk_size)
-    "Stk\t\t:%010X/%010X\n",j-i,j;
-  else
-    "Stk\t\t:$RED$$BK,1$Overflow$BK,0$$FG$/%010X\n",j;
-
-  "HashTable\t:%010X\n",HashTableSize2(task->hash_table);
-  "FPU\t\t:%010X\n",MSize2(task->fpu_mmx);
-  "DirCur\t:%010X\n",MSize2(task->cur_dir);
-
-  if (pdoc=DocPut(task))
-    "PutDoc\t:%010X\n",DocSize(pdoc);
-  if ((ddoc=DocDisplay(task)) && pdoc!=ddoc)
-    "DisplayDoc\t:%010X\n",DocSize(ddoc);
-  if (bdoc=DocBorder(task))
-    "BorderDoc\t:%010X\n",DocSize(bdoc);
-
-  cc=task->next_cc;
-  while (cc!=&task->next_cc) {
-    "CmpCtrl\t:%010X\n",CmpCtrlSize(cc);
-    cc=cc->next;
-  }
-
-  o=task->next_ode;
-  while (o!=&task->next_ode) {
-    "CMathODE\t:%010X\n",ODESize(o);
-    o=o->next;
-  }
-
-  if (task==sys_winmgr_task) {
-    "gr.pen_brushes\t:%010X\n",PenBrushesSize;
-    "gr.scrn_zoom_tbles\t:%010X\n",ScrnZoomTablesSize;
-    "scrncast.dc\t:%010X\n",DCSize(scrncast.dc);
-    "scrncast.dc2_alias\t:%010X\n",DCSize(scrncast.dc2_alias);
-  } else if (task==adam_task) {
-    j=0;k=0;m=0;n=0;
-    for (i=0;i<mp_cnt;i++) {
-      c=&cpu_structs[i];
-      k+=TSSSize(c->tss);
-      task1=c->seth_task;
-      do {
-        if (task1!=adam_task) {//adam task located in Kernel mem
-          j+=MSize2(task1);
-          m+=MSize2(task1->code_heap);
-          if (task1->data_heap!=task1->code_heap)
-            m+=MSize2(task1->code_heap);
-        }
-        n+=TaskQueSize(task1);
-        task1=task1->next_task;
-      } while (task1!=c->seth_task);
-      task1=c->idle_task;
-      j+=MSize2(task1);
-      m+=MSize2(task1->code_heap);
-      if (task1->data_heap!=task1->code_heap)
-        m+=MSize2(task1->code_heap);
-    }
-    "TaskStructs\t:%010X\n",j;
-    "TSSes\t:%010X\n",k;
-    "HeapCtrls\t:%010X\n",m;
-    if (n)
-      "TaskQues\t:%010X\n",n;
-    "BlkDevs\t:%010X\n",BlkDevsSize;
-    "Drvs\t:%010X\n",DrvsSize;
-    if (blkdev.cache_base)
-      "DskCache\t:%010X\n",
-            MSize2(blkdev.cache_base)+MSize2(blkdev.cache_hash_table)+
-            MSize2(blkdev.cache_ctrl);
-    "Clip\t:%010X\n",DocSize(sys_clip_doc);
-    "AutoComplete:%010X\n",CallExtStr("AutoCompleteSize");
-    "gr.to_8_bits\t:%010X\n",MSize2(gr.to_8_bits);
-    "gr.to_8_colors\t:%010X\n",MSize2(gr.to_8_colors);
-    "gr.text_base\t:%010X\n",MSize2(gr.text_base);
-    "gr.vga_text_cache\t:%010X\n",MSize2(gr.vga_text_cache);
-    "gr.win_z_buf\t:%010X\n",MSize2(gr.win_z_buf)+
-          MSize2(gr.win_uncovered_bitmap);
-    "gr.dc\t\t:%010X\n",DCSize(gr.dc);
-    "gr.dc1\t\t:%010X\n",DCSize(gr.dc1);
-    "gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
-    "gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
-    "gr.scrn_image\t:%010X\n",DCSize(gr.scrn_image);
-    "gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
-  }
-  "$ID,-2$";
-  return TRUE;
-}
-
-public U0 MemRep()
-{//Memory usage report.
-  I64 i;
-  CTask *task;
-  CCPU *c;
-  CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
-  bfh(I64)+=bfh->file_size-1;
-
-  "$BLACK$Low Memory\t:0000100000$FG$\n$ID,2$";
-  "Kernel\t:%010X-%010X\n",mem_boot_base-sizeof(CBinFile),bfh;
-
-  "VGA\t\t:00000A0000-00000BFFFF\n";
-  "$ID,-2$$BLACK$High Memory\t:0000100000-%010X$FG$\n",
-        mem_heap_limit;
-  "SYS_FIXED_AREA\t:%010X-%010X\n",
-        SYS_FIXED_AREA,SYS_FIXED_AREA+sizeof(CSysFixedArea)-1;
-
-  if (sys_data_bp) {
-    "$BLACK$Code Heap\t:%010X/%010X$FG$\n",
-          sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
-    "$BLACK$Data Heap\t:%010X/%010X$FG$\n",
-          sys_data_bp->used_u8s,sys_data_bp->alloced_u8s;
-  } else
-    "$BLACK$Code/Data Heap\t:%010X/%010X$FG$\n",
-          sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
-
-  for (i=0;i<mp_cnt;i++) {
-    c=&cpu_structs[i];
-    "$PURPLE$CPU%d$FG$\n$ID,2$",i;
-    task=c->seth_task;
-    do {
-      if (!MemRepTask(task))
-        break;
-      task=task->next_task;
-    } while (task!=c->seth_task);
-    MemRepTask(c->idle_task,TRUE);
-    "$ID,-2$";
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/Merge.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/Merge.HC.HTML deleted file mode 100755 index a4b2059..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/Merge.HC.HTML +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically)"
-
-CDirEntry MGFind(CDirEntry *needle_entry,CDirEntry *haystack_lst)
-{
-  while (haystack_lst) {
-    if (!StrCmp(needle_entry->name,haystack_lst->name))
-      return haystack_lst;
-    haystack_lst=haystack_lst->next;
-  }
-  return NULL;
-}
-
-U0 Merge2(CDirEntry *tmpde1,CDirEntry *tmpde2,I64 *_fuf_flags,I64 *_df_flags)
-{
-  CDirEntry *tmpde;
-  while (tmpde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
-    tmpde=MGFind(tmpde1,tmpde2);
-    if (!tmpde)
-      "$BROWN$Does Not Exist:%s$FG$\n",tmpde1->full_name;
-    else {
-      if (tmpde1->attr & RS_ATTR_DIR)
-        Merge2(tmpde1->sub,tmpde->sub,_fuf_flags,_df_flags);
-      else {
-        if (AbsI64(tmpde1->datetime-tmpde->datetime)>CDATE_FREQ*2) {//slop
-          "%s",tmpde1->full_name;
-          '\n';
-          if (Bt(_fuf_flags,FUf_DIFF)) {
-            if (FilesFindMatch(tmpde1->full_name,FILEMASK_TXT))
-              Diff(tmpde->full_name,tmpde1->full_name,_df_flags);
-          }
-        }
-      }
-    }
-    tmpde1=tmpde1->next;
-  }
-}
-public U0 Merge(U8 *dst_files_find_mask="/*",U8 *src_files_find_mask="/*",
-  U8 *fu_flags=NULL)
-{/*Merge text files from one list into another.
-Report files whos date/time is different.
-
-"+d" will do Diff() on files and prompt to
-merge changes from source files into
-destination files.
-*/
-  I64 df_flags=0,fuf_flags=0;
-  CDirEntry *tmpde1=NULL,*tmpde2=NULL;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  if (fuf_flags&~(FUG_FILES_FIND|FUF_DIFF))
-    throw('FUF');
-  PrintWarn("This is based strictly on file dates.\n");
-  tmpde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
-  tmpde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
-  fuf_flags&=FUF_DIFF;
-  Merge2(tmpde1,tmpde2,&fuf_flags,&df_flags);
-  DirTreeDel(tmpde1);
-  DirTreeDel(tmpde2);
-}
-
-#help_index "Utils;Cmd Line (Typically)"
-
-public U0 NewFiles(U8 *files_find_mask="/*",CDate cdt=0,U8 *fu_flags=NULL)
-{//Report files newer than a certain date.
-  I64 fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  if (!cdt) cdt=sys_compile_time;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    if (tmpde->datetime>cdt)
-      "%s\n",tmpde->full_name;
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/Profiler.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/Profiler.HC.HTML deleted file mode 100755 index 33a7b46..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/Profiler.HC.HTML +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - -
-#help_index "Debugging/Profiler;Profiler;Cmd Line (Typically)/Profiler"
-#help_file "::/Doc/Profiler"
-
-#define PF_ARRAY_CNT 0x100000
-I64 pf_jiffy_start,pf_jiffy_end;
-I64 *pf_array=NULL;
-I64 pf_cpu=0;
-I64 pf_buf_in_ptr=0,pf_depth;
-I64 pf_prof_active=0;
-
-U0 ProfTimerInt(CTask *task)
-{//See profiler_timer_irq.
-  I64 i,k;
-  if (Bt(&pf_prof_active,0))
-    for (k=0;k<=pf_depth;k++) {
-      if (task==Gs->idle_task)
-        i=SYS_IDLE_PT;
-      else
-        i=TaskCaller(task,k,TRUE);
-      if (pf_buf_in_ptr<PF_ARRAY_CNT) {
-        pf_array[pf_buf_in_ptr++]=i;
-        pf_jiffy_end=cnts.jiffies;
-      }
-    }
-}
-
-public U0 Prof(I64 depth=0,I64 cpu_num=0)
-{/*Start collecting profiler statistics.
-Profilers report where time is spent
-by sampling RIP during the 1000Hz
-timer interrupt.
-
-Do a ProfRep(), (profiler report)
-after you have collected data.
-*/
-  if (!(0<=cpu_num<mp_cnt))
-    ST_ERR_ST "Invalid CPU\n";
-  else {
-    cpu_structs[pf_cpu].profiler_timer_irq=NULL;
-    pf_cpu=cpu_num;
-
-    pf_depth=depth;
-    pf_buf_in_ptr=0;
-    if (!pf_array)
-      pf_array=AMAlloc(sizeof(I64)*PF_ARRAY_CNT);
-    pf_jiffy_end=pf_jiffy_start=cnts.jiffies;
-    LBts(&pf_prof_active,0);
-    cpu_structs[pf_cpu].profiler_timer_irq=&ProfTimerInt;
-  }
-}
-
-I64 ProfCompare(U8 *i1,U8 *i2)
-{
-  return i1-i2;
-}
-
-public U0 ProfRep(I64 filter_cnt=1,Bool leave_it=OFF)
-{//Profiler report. Call Prof() first and collect data.
-  I64 i,hits,rip,last_rip=0,routine_total=0;
-  F64 total_time;
-  U8 buf[256],buf2[256],last_buf[256];
-  if (!LBtr(&pf_prof_active,0))
-    "Profiler Not Active\n";
-  if (!pf_buf_in_ptr)
-    "No Profiler Statistic\n";
-  else {
-    if (!(total_time=pf_jiffy_end-pf_jiffy_start))
-      total_time=1;
-    QSortI64(pf_array,pf_buf_in_ptr,&ProfCompare);
-    *last_buf=0;
-    for (i=0;i<pf_buf_in_ptr;i+=hits) {
-      rip=pf_array[i];
-      hits=0;
-      do hits++;
-      while (i+hits<pf_buf_in_ptr && pf_array[i+hits]==rip);
-
-      StrPrint(buf,"%p",rip);
-      StrFirstRem(buf,"+",buf2);
-      if (StrCmp(buf2,last_buf)) {
-        if (*last_buf && routine_total>=filter_cnt)
-          "$GREEN$%6.2f %08X:%s\n$FG$",100*routine_total/total_time,
-                routine_total,last_buf;
-        StrCpy(last_buf,buf2);
-        routine_total=0;
-      }
-      routine_total+=hits;
-      if (hits>=filter_cnt) {
-        "%6.2f %08X:%P\n",100*hits/total_time,hits,rip;
-        last_rip=rip;
-      }
-    }
-    if (*last_buf && routine_total>=filter_cnt)
-      "$GREEN$%6.2f %08X:%s\n$FG$",100*routine_total/total_time,
-            routine_total,last_buf;
-    "Total Time:%0.6fs\n",total_time/JIFFY_FREQ;
-    if (leave_it) {
-      cpu_structs[pf_cpu].profiler_timer_irq=&ProfTimerInt;
-      LBts(&pf_prof_active,0);
-    } else
-      cpu_structs[pf_cpu].profiler_timer_irq=NULL;
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/StrUtils.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/StrUtils.HC.HTML deleted file mode 100755 index 07755d0..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/StrUtils.HC.HTML +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically)"
-
-I64 DEPtrCompare(CDocEntry **e1,CDocEntry **e2)
-{
-  return StrCmp((*e1)->tag,(*e2)->tag);
-}
-
-public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
-        I64 entry_lines=1,Bool unique=FALSE)
-{//Sort lines of a text file. Removes blank lines.
-  U8 *in_name,*out_name,*st;
-  CDoc *doc;
-  CDocEntry *doc_e,*doc_e1,**a;
-  I64 i,j,cnt=0,res;
-
-  if (!_in_name) return 0;
-  in_name=ExtDft(_in_name,"DD.Z");
-  if (_out_name)
-    out_name=ExtDft(_out_name,"DD.Z");
-  else
-    out_name=StrNew(in_name);
-
-  doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TEXT)
-      cnt++;
-    doc_e=doc_e->next;
-  }
-  a=MAlloc(cnt*sizeof(CDocEntry *));
-  doc_e=doc->head.next;
-  i=0;
-  while (doc_e!=doc) {
-    doc_e1=doc_e->next;
-    if (doc_e->type_u8==DOCT_TEXT) {
-      QueRem(doc_e);
-      a[i++]=doc_e;
-    } else
-      DocEntryDel(doc,doc_e);
-    doc_e=doc_e1;
-  }
-  QSort(a,cnt/entry_lines,entry_lines*sizeof(CDocEntry *),&DEPtrCompare);
-
-  res=0;
-  st=NULL;
-  for (i=0;i<cnt;) {
-    if (!unique || !st || StrCmp(a[i]->tag,st)) {
-      st=a[i]->tag;
-      for (j=0;j<entry_lines && i<cnt;j++,i++) {
-        QueIns(a[i],doc->head.last);
-        doc->cur_entry=&doc->head;
-        doc->cur_col=0;
-        DocPrint(doc,"\n");
-      }
-      res++;
-    } else
-      for (j=0;j<entry_lines && i<cnt;j++,i++) {
-        QueIns(a[i],doc->head.last);
-        DocEntryDel(doc,a[i]);
-      }
-  }
-  StrCpy(doc->filename.name,out_name);
-  DocWrite(doc);
-
-  Free(a);
-  DocDel(doc);
-  Free(in_name);
-  Free(out_name);
-  return res; //Num Entries
-}
-
-I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *char_bmp)
-{
-  U8 *ptr,*ptr2;
-  I64 res=0,ch;
-  CDoc *doc_in=DocRead(filename);
-  CDocEntry *doc_e=doc_in->head.next;
-  while (doc_e!=doc_in) {
-    if (doc_e->de_flags & DOCEF_TAG) {
-      ptr=doc_e->tag;
-      while (*ptr) {
-        while (*ptr && !Bt(char_bmp,*ptr))
-          ptr++;
-
-        ptr2=ptr;
-        while (*ptr && Bt(char_bmp,*ptr))
-          ptr++;
-
-        ch=*ptr;
-        *ptr=0;
-        if (*ptr2) {
-          DocPrint(doc_out,"%s\n",ptr2);
-          res++;
-        }
-        *ptr=ch;
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  DocDel(doc_in);
-  return res;
-}
-public I64 Words(U8 *files_find_mask="*",U32 *char_bmp=char_bmp_alpha,
-        U8 *fu_flags=NULL)
-{//Break file into list of not-unique words.
-  I64 fuf_flags=0,res=0;
-  CDoc *doc_out=DocNew;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    res+=DocWordsFile(doc_out,tmpde->full_name,char_bmp);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  DocInsDoc(NULL,doc_out);
-  DocDel(doc_out);
-  return res;
-}
-
-I64 LongLinesFile(U8 *filename,I64 cols)
-{
-  I64 res=0;
-  CDoc *doc=DocRead(filename);
-  CDocEntry *doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1)
-      res++;
-    doc_e=doc_e->next;
-  }
-  DocDel(doc);
-  if (res) {
-    "%04d ",res;
-    PutFileLink(filename);
-    '\n';
-  }
-  return res;
-}
-public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL)
-{//Report files with lines of too many cols.
-  I64 res=0,fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+S");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    if (LongLinesFile(tmpde->full_name,cols))
-      res++;
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-  return res;
-}
-
-U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor)
-{//String utility on a single file
-//See SU Flags
-  U8 *dst;
-  Bool chged=FALSE;
-  I64 reduced=0;
-  CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
-  CDocEntry *doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TEXT) {
-      dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor);
-      if (StrCmp(dst,doc_e->tag)) {
-        reduced+=StrLen(doc_e->tag)-StrLen(dst);
-        chged=TRUE;
-        Free(doc_e->tag);
-        doc_e->tag=dst;
-      } else
-        Free(dst);
-    }
-    doc_e=doc_e->next;
-  }
-  if (chged) {
-    "Reduced %s by %d chars\n",filename,reduced;
-    DocWrite(doc);
-  }
-  DocDel(doc);
-}
-public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL,
-        F64 indent_scale_factor=0)
-{//Apply StrUtil() on files.
-//You can convert spaces to tabs, for example,
-  //or removing trailing spaces on lines.
-  //See SUF Flags.
-  I64 fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F+T");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    SUFile(tmpde->full_name,suf_flags,indent_scale_factor);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
-public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL)
-{//Spaces to tabs.
-//Use "Hard Space" (SHIFT-SPACE) for spaces
-  //in string consts in your code.
-  SU(files_find_mask,SUF_S2T|SUF_REM_TRAILING,fu_flags);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/TOS.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/TOS.HC.HTML deleted file mode 100755 index 67cdb2d..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/TOS.HC.HTML +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - -
-#help_index "Misc/TOS"
-
-U0 TOSStaffIns()
-{//Completes TOS install from TOS_Staff.ISO
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  WinBorder;
-  WinMax;
-  DocClear;
-  "$PURPLE$$TX+CX,\"Complete TOS install from TOS_Staff.ISO\"$$FG$\n\n\n\n";
-  InsRereg;
-
-  "\nDownload TOS_Supplemental1.ISO.C\tfrom http://www.templeos.org\n"
-  "Download TOS_Supplemental2.ISO.C\tfrom http://www.templeos.org\n"
-  "Download TOS_Supplemental3.ISO.C\tfrom http://www.templeos.org\n";
-
-  if (PressAKey!=CH_SHIFT_ESC) {
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental1.ISO.C"))
-      CopyTree("T:/","~/Sup1");
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental2.ISO.C"))
-      CopyTree("T:/","~/Sup2");
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental3.ISO.C"))
-      CopyTree("T:/","~/Sup3");
-
-    Once("TOSBootHDIns;");
-    "\nDo you wish to run >TOSRegen; to generate\n the "
-          "distro ISO's ";
-    if (YorN) {
-      Once("TOSRegen;");
-      BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
-    } else {
-      "\nReboot ";
-      if (YorN)
-        Reboot;
-    }
-  }
-  SettingsPop;
-}
-
-public U0 TOSStdIns()
-{//Completes TOS install from TOS_Distro.ISO
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  WinBorder;
-  WinMax;
-  DocClear;
-  "$PURPLE$$TX+CX,\"Complete TOS install from TOS_Distro.ISO\"$$FG$\n\n\n\n";
-  InsRereg;
-
-  "\nDownload TOS_Supplemental1.ISO.C\tfrom http://www.templeos.org\n"
-  "Download TOS_Supplemental2.ISO.C\tfrom http://www.templeos.org\n"
-  "Download TOS_Supplemental3.ISO.C\tfrom http://www.templeos.org\n";
-
-  if (PressAKey!=CH_SHIFT_ESC) {
-    if (FileFind("/Demo/AcctExample"))
-      CopyTree("::/Demo/AcctExample","~");
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental1.ISO.C"))
-      CopyTree("T:/","~/Sup1");
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental2.ISO.C"))
-      CopyTree("T:/","~/Sup2");
-    if (HostChgDsk("/home/tad/Downloads/TOS_Supplemental3.ISO.C"))
-      CopyTree("T:/","~/Sup3");
-
-    Once("TOSBootHDIns;");
-    "\nDo you wish to run >TOSRegen; to generate\n the distro ISO's ";
-    if (YorN) {
-      Once("TOSRegen;");
-      BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
-    } else {
-      "\nReboot ";
-      if (YorN)
-        Reboot;
-    }
-  }
-  SettingsPop;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/ToDolDoc.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/ToDolDoc.HC.HTML deleted file mode 100755 index 83dafd9..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/ToDolDoc.HC.HTML +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - -
-#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)"
-
-public U0 ToDolDoc(U8 *files_find_mask,U8 *fu_flags=NULL)
-{//Convert text file to DolDoc by making double $'s.
-  CDoc *doc;
-  I64 fuf_flags=0;
-  CDirEntry *tmpde,*tmpde1;
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
-  ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
-  tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
-  while (tmpde) {
-    "%s\n",tmpde->full_name;
-    doc=DocRead(tmpde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
-    DocWrite(doc);
-    DocDel(doc);
-    tmpde=tmpde->next;
-  }
-  DirTreeDel(tmpde1);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Opt/Utils/ToTXT.HC.HTML b/public/Wb/Home/Src/Adam/Opt/Utils/ToTXT.HC.HTML deleted file mode 100755 index bf8c4fe..0000000 --- a/public/Wb/Home/Src/Adam/Opt/Utils/ToTXT.HC.HTML +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - -
-#help_index "DolDoc/Conversion"
-
-U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col)
-{
-  U8 *ch,*ptr;
-  while (ch=*st++) {
-    switch (ch) {
-      case '\t':
-        do {
-          DocPutKey(doc,CH_SPACE,0);
-          *_col=*_col+1;
-        } while (*_col&7);
-        break;
-
-      start:
-        case 'pi':      ptr="pi";       break;
-        case 'theta':   ptr="theta";    break;
-        case 'phi':     ptr="phi";      break;
-        case 'omega':   ptr="omega";    break;
-        case 'inf':     ptr="inf";      break;
-        case 'u':       ptr="u";        break;
-        case CH_SHIFT_SPACE: ptr=" ";   break;
-      end:
-        DocPrint(doc,ptr);
-        *_col=*_col+StrLen(ptr);
-        break;
-
-      default:
-        if (CH_SPACE<=ch<0x7F || ch=='\n')
-          DocPutKey(doc,ch,0);
-        else
-          DocPrint(doc,".");
-        *_col=*_col+1;
-    }
-  }
-}
-
-public CDoc *Doc2TXT(CDoc *doc_in)
-{//Cvt DolDoc doc to plain text.
-  CDocEntry *doc_e,*doc_e2;
-  I64 y,col;
-  CDoc *doc_out=DocNew;
-  Bool unlock_doc_in=DocLock(doc_in),no_bwd,line_has_html_code=FALSE;
-  DocRecalc(doc_in);
-
-  doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
-
-  doc_e=doc_in->head.next;
-  col=doc_e->x;
-  y=doc_e->y;
-  while (doc_e!=doc_in) {
-    if (!(doc_e->de_flags&DOCEF_SKIP)) {
-      while (y<doc_e->y) {
-        TXTPutS(doc_out,"\n",&col);
-        y++;
-        col=0;
-        line_has_html_code=FALSE;
-      }
-      if (doc_e->type_u8==DOCT_HTML_CODE)
-        line_has_html_code=TRUE;
-
-      no_bwd=TRUE;
-      doc_e2=doc_e->next;
-      while (doc_e2!=doc_in && doc_e2->y==doc_e->y) {
-        if (doc_e2->x<doc_e->x) {
-          no_bwd=FALSE;
-          break;
-        }
-        doc_e2=doc_e2->next;
-      }
-      if (no_bwd && !(doc_e->type_u8==DOCT_NEW_LINE && line_has_html_code))
-        while (col<doc_e->x)
-          TXTPutS(doc_out," ",&col);
-
-      switch (doc_e->type_u8) {
-        case DOCT_TEXT:
-          TXTPutS(doc_out,doc_e->tag,&col);
-          break;
-        case DOCT_TAB:
-          TXTPutS(doc_out,"\t",&col);
-          break;
-        case DOCT_HTML_CODE:
-          break;
-        case DOCT_SPRITE:
-          break;
-        default:
-          if (doc_e->de_flags&DOCEF_TAG)
-            TXTPutS(doc_out,doc_e->tag,&col);
-      }
-    }
-    doc_e=doc_e->next;
-  }
-  while (y<doc_e->y) {
-    TXTPutS(doc_out,"\n",&col);
-    y++;
-    col=0;
-  }
-  doc_out->cur_entry=&doc_out->head;
-  DocRecalc(doc_out);
-
-  if (unlock_doc_in)
-    DocUnlock(doc_in);
-  return doc_out;
-}
-
-#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)"
-public U0 ToTXT(U8 *_in_name,U8 *_out_name=NULL,I64 width=70)
-{//Convert DolDocfile to plain text.
-  U8 *in_name,*out_name;
-  CDoc *doc_in,*doc_out;
-
-  SettingsPush; //See SettingsPush
-  WinHorz(0,width-1); //Sets doc width for word wrap.
-
-  in_name=ExtDft(_in_name,"DD.Z");
-  if (_out_name)
-    out_name=ExtDft(_out_name,"TXT");
-  else
-    out_name=ExtChg(_in_name,"TXT");
-
-  doc_in=DocRead(in_name);
-  doc_out=Doc2TXT(doc_in);
-  StrCpy(&doc_out->filename.name,out_name);
-
-  SettingsPop;
-
-  DocWrite(doc_out);
-  DocDel(doc_in);
-  DocDel(doc_out);
-  Free(in_name);
-  Free(out_name);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/TaskRep.HC.HTML b/public/Wb/Home/Src/Adam/TaskRep.HC.HTML deleted file mode 100755 index d0e386e..0000000 --- a/public/Wb/Home/Src/Adam/TaskRep.HC.HTML +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - -
-#help_index "Info;Task"
-U0 TaskRepTask(CTask *task,I64 indent)
-{
-  CTask *task1;
-  "%h*c$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$ $BLACK$#%d$FG$ "
-        "$TX,\"%$Q...\",SCX=16$\n",indent,CH_SPACE,task,task,task->task_num,
-        task->task_title;
-  "%h*c%08X %04X:%04X:%08X\n",indent+2,CH_SPACE,TaskMemAlloced(task),
-        task->task_flags,task->display_flags,task->win_inhibit;
-  task1=task->next_child_task;
-  while (task1!=(&task->next_child_task)(U8 *)
-        -offset(CTask.next_sibling_task)) {
-    TaskRepTask(task1,indent+2);
-    task1=task1->next_sibling_task;
-  }
-}
-
-public U0 TaskRep()
-{//Report current tasks on all cores.
-  I64 i;
-  CCPU *c;
-  PUSHFD
-  CLI
-  for (i=0;i<mp_cnt;i++) {
-    c=&cpu_structs[i];
-    "$PURPLE$CPU%02X$FG$\n",i;
-    TaskRepTask(c->seth_task,2);
-  }
-  POPFD
-}
-
- diff --git a/public/Wb/Home/Src/Adam/TaskSettings.HC.HTML b/public/Wb/Home/Src/Adam/TaskSettings.HC.HTML deleted file mode 100755 index 8b58bcf..0000000 --- a/public/Wb/Home/Src/Adam/TaskSettings.HC.HTML +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - -
-#help_index "Task/Settings"
-
-public CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0)
-{//Typically, called at start of an application.
-//It saves many settings so they can be restored
-  //at the end of the application with SettingsPop().
-
-  CTaskSettings *tmpse;
-  CDoc *doc;
-  if (!task) task=Fs;
-  if (!TaskValidate(task)) return NULL;
-  tmpse=CAlloc(sizeof(CTaskSettings),task);
-  tmpse->cur_dir=DirCur(task,task);
-  tmpse->draw_it=task->draw_it;
-  GrPaletteGet(tmpse->palette);
-  tmpse->task_end_cb=task->task_end_cb;
-
-  if (!(flags&TSF_SAME_SONG)) {
-    if (tmpse->song_task=task->song_task) {
-      Suspend(task->song_task);
-      Snd;
-    }
-    task->song_task=NULL;
-  }
-
-  if (tmpse->animate_task=task->animate_task)
-    Suspend(task->animate_task);
-  task->animate_task=NULL;
-
-  if (doc=DocPut(task)) {
-    tmpse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
-    tmpse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
-    tmpse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
-  }
-
-  tmpse->left=task->win_left;
-  tmpse->right=task->win_right;
-  tmpse->top=task->win_top;
-  tmpse->bottom=task->win_bottom;
-
-  tmpse->scroll_x=task->scroll_x;
-  tmpse->scroll_y=task->scroll_y;
-  tmpse->scroll_z=task->scroll_z;
-
-  tmpse->win_inhibit=task->win_inhibit;
-  tmpse->text_attr=task->text_attr;
-  StrCpy(tmpse->task_title,task->task_title);
-  tmpse->title_src  =task->title_src;
-  tmpse->border_attr=task->border_attr;
-  tmpse->border_src =task->border_src;
-  tmpse->border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
-  if (TaskValidate(ac.task))
-    tmpse->autocomplete=TRUE;
-  else
-    tmpse->autocomplete=FALSE;
-
-  tmpse->next=task->next_settings;
-  task->next_settings=tmpse;
-  return tmpse;
-}
-
-U0 SettingsPop2(CTask *task,CTaskSettings *tmpse)
-{
-  CDoc *doc;
-
-  if (doc=DocPut(task)) {
-    LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tmpse->hide_cursor);
-    LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tmpse->highlight_cursor);
-    LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tmpse->scroll);
-  }
-
-  WinBorder(tmpse->border,task);
-  WinHorz(tmpse->left,tmpse->right,task);
-  WinVert(tmpse->top,tmpse->bottom,task);
-  task->scroll_x=tmpse->scroll_x;
-  task->scroll_y=tmpse->scroll_y;
-  task->scroll_z=tmpse->scroll_z;
-  task->win_inhibit=tmpse->win_inhibit;
-  task->text_attr=tmpse->text_attr;
-  task->border_attr=tmpse->border_attr;
-  task->border_src =tmpse->border_src;
-  task->title_src  =tmpse->title_src;
-  StrCpy(task->task_title,tmpse->task_title);
-  AutoComplete(tmpse->autocomplete);
-  GrPaletteSet(tmpse->palette);
-  Snd;
-}
-
-public U0 SettingsPop(CTask *task=NULL,I64 flags=0)
-{//Typically, called at end of an application.
-  CTaskSettings *tmpse;
-  if (!task) task=Fs;
-  if (!TaskValidate(task))
-    return;
-  if (tmpse=task->next_settings) {
-    task->next_settings=tmpse->next;
-    Cd(tmpse->cur_dir);
-    Free(tmpse->cur_dir);
-    task->draw_it=tmpse->draw_it;
-    task->task_end_cb=tmpse->task_end_cb;
-
-    if (task->animate_task)
-      Kill(task->animate_task);
-    if (task->animate_task=tmpse->animate_task)
-      Suspend(task->animate_task,FALSE);
-
-    if (!(flags&TSF_SAME_SONG)) {
-      if (task->song_task)
-        Kill(task->song_task);
-      if (task->song_task=tmpse->song_task)
-        Suspend(task->song_task,FALSE);
-    }
-
-    SettingsPop2(task,tmpse); //Do it to get ress fast
-    Refresh(,TRUE);
-    SettingsPop2(task,tmpse); //Redo in case was lost by old update
-
-    Free(tmpse);
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Training.HC.HTML b/public/Wb/Home/Src/Adam/Training.HC.HTML deleted file mode 100755 index d8db1f5..0000000 --- a/public/Wb/Home/Src/Adam/Training.HC.HTML +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - -
-#help_index "Help System"
-
-U8 *KeyMapKeyMStrPrint(I64 sc,U0 (*fp_hndlr)(I64 sc),
-        U8 *desc,CTask *task=NULL)
-{
-  I64 i=9,k,c;
-  U8 *st,*st2,*res,*ptr;
-  CHashTable *old_hash=Fs->hash_table;
-  st=ScanCode2KeyName(sc);
-  if (sc&SCF_CTRL)      i+=5;
-  if (sc&SCF_ALT)       i+=4;
-  if (sc&(SCF_SHIFT|SCF_NO_SHIFT)) i+=6;
-  if (TaskValidate(task))
-    Fs->hash_table=task->hash_table;
-  st2=SrcEdLink(fp_hndlr,256);
-  Fs->hash_table=old_hash;
-
-  k=*desc(U32 *);
-  if (k=='Edit')        c=BLUE;
-  else if (k=='Dol ')   c=GREEN;
-  else if (k=='Cmd ')   c=RED;
-  else                  c=BLACK;
-
-  res=MStrPrint("%-*s $FG,%d$$TX+UL+L+PU,\"%$Q\",A=\"%s\"$$FG$\n",
-        i,st,c,desc,st2);
-  Free(st);
-  Free(st2);
-
-  ptr=res;
-  while (*ptr) {
-    if (*ptr==CH_SPACE)
-      *ptr=CH_SHIFT_SPACE;
-    ptr++;
-  }
-
-  return res;
-}
-
-U0 KeyMapKeyPrint(I64 sc,U0 (*fp_hndlr)(I64 sc),U8 *desc,CTask *task=NULL)
-{
-  U8 *st=KeyMapKeyMStrPrint(sc,fp_hndlr,desc,task);
-  "%s",st;
-  Free(st);
-}
-
-U0 KeyMapCtrlAltFamily(Bool no_shift,Bool shift)
-{
-  I64 i,no_shift_f;
-  if (no_shift && shift)
-    no_shift_f=SCF_NO_SHIFT;
-  else
-    no_shift_f=0;
-  if (no_shift) KeyMapKeyPrint(SC_DELETE+SCF_CTRL+SCF_ALT+no_shift_f,
-          &Reboot,"Cmd /Reboot");
-  if (no_shift) KeyMapKeyPrint(SC_ESC+SCF_CTRL+SCF_ALT+no_shift_f,
-          &User,"Cmd /Terminal Window");
-  if (no_shift) KeyMapKeyPrint(SC_TAB+SCF_CTRL+SCF_ALT+no_shift_f,
-          &WinToTop,"Cmd /Next Focus Task");
-
-  for (i=0;i<26;i++)
-    if (keydev.fp_ctrl_alt_cbs[i]) {
-      if (no_shift && keydev.ctrl_alt_no_shift_descs[i])
-        KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+no_shift_f,
-              keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_no_shift_descs[i]);
-      if (shift && keydev.ctrl_alt_shift_descs[i])
-        KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+SCF_SHIFT,
-              keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_shift_descs[i]);
-    }
-}
-
-U0 KMComparePrepare(U8 *buf,I64 *src)
-{
-  I64 i,*dst=buf;
-  U8 *ptr;
-  if (src) {
-    *dst++=*src++;
-    *dst++=*src++;
-    *dst++=*src++;
-    *dst++=*src++;
-    *dst(U8 *)=0;
-    if (ptr=StrMatch("SHIFT",buf)) {
-      for (i=0;i<5;i++)
-        ptr[i]=CH_SHIFT_SPACE;
-      if (ptr=StrMatch("$",buf))
-        *ptr=255;
-    }
-  } else
-    *buf=0;
-}
-
-I64 KMCompare(U8 *e1,U8 *e2)
-{
-  U8 buf1[STR_LEN],buf2[STR_LEN];
-  KMComparePrepare(buf1,e1);
-  KMComparePrepare(buf2,e2);
-  return StrCmp(buf1,buf2);
-}
-
-U0 KeyMapFamily2(U8 **entries,CTask *task,I64 scf)
-{
-  I64 i,arg1,arg2;
-  for (i=0;i<256;i++) {
-    arg2=scf|i|SCF_KEY_DESC;
-    arg1=ScanCode2Char(arg2);
-    *keydev.desc=0;
-    keydev.hndlr=NULL;
-    if (TaskValidate(task) && !Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) {
-      if (task==Fs)
-        PutKey(arg1,arg2);
-      else
-        PostMsg(task,MSG_KEY_DOWN,arg1,arg2);
-      Refresh(0,TRUE);
-      Sleep(1); //Open loop because might be no response.  TODO: Drops msgs.
-    }
-    if (*keydev.desc && StrNCmp(keydev.desc,"Char  /",7))
-      entries[i]=KeyMapKeyMStrPrint(arg2,keydev.hndlr,keydev.desc,task);
-  }
-}
-
-U0 KeyMapFamily(CTask *task,I64 scf,Bool no_shift,Bool shift)
-{
-  I64 i,cnt=0;
-  U8 **entries=CAlloc(2*256*sizeof(U8 *)),**ptr=entries;
-  if (no_shift) {
-    if (shift)
-      KeyMapFamily2(ptr,task,scf+SCF_NO_SHIFT);
-    else
-      KeyMapFamily2(ptr,task,scf);
-    ptr+=256;
-    cnt+=256;
-  }
-  if (shift) {
-    KeyMapFamily2(ptr,task,scf+SCF_SHIFT);
-    ptr+=256;
-    cnt+=256;
-  }
-  QSortI64(entries,cnt,&KMCompare);
-  for (i=0;i<cnt;i++)
-    if (entries[i]) {
-      "%s",entries[i];
-      Free(entries[i]);
-    }
-  Free(entries);
-}
-
-public U0 KeyMap(CTask *task=NULL)
-{//Report desc of all keys.
-  Bool old_key_desc;
-  if (!task) task=Fs;
-  old_key_desc=LBtr(&task->win_inhibit,WIf_SELF_KEY_DESC);
-  DocMax;
-  KeyMapFamily(task,0,TRUE,TRUE);
-  KeyMapFamily(task,SCF_CTRL,TRUE,TRUE);
-  KeyMapFamily(task,SCF_ALT,TRUE,TRUE);
-  KeyMapCtrlAltFamily(TRUE,TRUE);
-  LBEqu(&task->win_inhibit,WIf_SELF_KEY_DESC,old_key_desc);
-  "\nKeyMap Completed.\n";
-}
-
-#help_index "Help System/Training"
-public U0 TipOfDay(U8 *tip_file="::/Doc/Tips.DD")
-{//Print random tip-of-day from ::/Doc/Tips.DD.
-  I64 i=RandU16;
-  CDoc *doc=DocRead(tip_file),*doc2=DocNew;
-  CDocEntry *doc_e=doc->head.next;
-  "$WW,1$\n";
-  while (TRUE) {
-    if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*')
-      if (!i--) break;
-    doc_e=doc_e->next;
-  }
-  if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') {
-    while (doc_e!=doc) {
-      if (doc_e->type_u8!=DOCT_ERROR)
-        DocInsEntry(doc2,DocEntryCopy(doc2,doc_e));
-      doc_e=doc_e->next;
-      if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*')
-        break;
-    }
-  }
-  DocInsDoc(DocPut,doc2);
-  DocDel(doc2);
-  DocDel(doc);
-}
-
- diff --git a/public/Wb/Home/Src/Adam/WallPaper.HC.HTML b/public/Wb/Home/Src/Adam/WallPaper.HC.HTML deleted file mode 100755 index 7a7e7d1..0000000 --- a/public/Wb/Home/Src/Adam/WallPaper.HC.HTML +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - -
-#help_index "Windows"
-
-class CWallPaperGlbls
-{
-  I64   last_calc_idle_cnt,last_swap_cnter[MP_PROCESSORS_NUM];
-  F64   last_calc_idle_delta_time;
-  U8    top_line[STR_LEN];
-} *wall=CAlloc(sizeof(CWallPaperGlbls));
-wall->last_calc_idle_delta_time=1.0;
-
-class CTaskWallPaperData
-{
-  I64   alloced_u8s,used_u8s;
-  U8    caller_stk[STR_LEN-$];
-};
-
-U0 WallPaper(CTask *_task)
-{
-  I64 i,j,l=TEXT_ROWS-1;
-  CTask *task;
-  CTaskWallPaperData *wpd;
-  CHashTable *old_hash=Fs->hash_table;
-  CCPU *c;
-  CDateStruct ds;
-  U8 *st;
-  _task->text_attr=BLUE<<4+WHITE;
-  if (sys_data_bp) {
-    TextPrint(Fs,0,l--,BLUE<<4+YELLOW,
-          "%010X/%010X %010X/%010X%12td%12td%12td",
-          sys_data_bp->used_u8s,sys_data_bp->alloced_u8s,
-          sys_code_bp->used_u8s,sys_code_bp->alloced_u8s,
-          cmp.compiled_lines,blkdev.read_cnt,blkdev.write_cnt);
-    TextPrint(Fs,0,l--,BLUE<<4+WHITE,
-          "______Data_Heap______ ______Code_Heap______ "
-          "___Lines___ ___Reads___ __Writes___");
-  } else {
-    TextPrint(Fs,0,l--,BLUE<<4+WHITE,
-          "%010X/%010X%12td%12td%12td",
-          sys_code_bp->used_u8s,sys_code_bp->alloced_u8s,
-          cmp.compiled_lines,blkdev.read_cnt,blkdev.write_cnt);
-    TextPrint(Fs,0,l--,BLUE<<4+WHITE,
-          "____CodeData_Heap____ "
-          "___Lines___ ___Reads___ ___Writes__");
-  }
-  TextPrint(Fs,0,l--,BLUE<<4+WHITE,"ProgressBars:%016X %016X %016X %016X",
-        progress1,progress2,progress3,progress4);
-  for (i=0;i<mp_cnt;i++) {
-    c=&cpu_structs[i];
-    if (winmgr.t->calc_idle_cnt!=wall->last_calc_idle_cnt) {
-      wall->last_calc_idle_delta_time=winmgr.t->calc_idle_delta_time;
-      wall->last_swap_cnter[i]=winmgr.t->last_swap_cnter[i];
-      winmgr.t->last_swap_cnter[i]=c->swap_cnter;
-    }
-
-    task=c->seth_task;
-    do {
-      wpd=&task->wallpaper_data;
-      if (!TaskValidate(task)) break;
-      if (!(winmgr.updates&31)) {
-        if (c==Gs)
-          Fs->hash_table=task->hash_table;
-        else //precaution
-          Fs->hash_table=old_hash;
-        StrPrint(wpd->caller_stk,"    %-18tp %-18tp %-18tp %-18tp",
-              TaskCaller(task,0),TaskCaller(task,1),
-              TaskCaller(task,2),TaskCaller(task,3));
-      }
-      TextPrint(Fs,0,l--,BLUE<<4+YELLOW,wpd->caller_stk);
-      j=UnusedStk(task);
-      if (j<0)
-        Panic("Stk Overflow",task);
-      if (!(winmgr.updates&31)) {
-        wpd->alloced_u8s=TaskMemAlloced(task);
-        wpd->used_u8s   =TaskMemUsed(task);
-      }
-      TextPrint(Fs,0,l--,BLUE<<4+BROWN,
-            "  %-18ts #%08X %010X %010X/%010X %04X:%02tX:%08X",
-            task->task_title,task,j,wpd->used_u8s,wpd->alloced_u8s,
-            task->task_flags,task->display_flags,task->win_inhibit);
-      if (!TaskValidate(task)) break;
-      task=task->next_task;
-    } while (task!=c->seth_task);
-    TextPrint(Fs,0,l--,BLUE<<4+WHITE,"CPU%02X %2tf%% ContextSwaps/s:%9,d",i,
-          100.0*(1.0-c->idle_factor),ToI64((winmgr.t->last_swap_cnter[i]
-          -wall->last_swap_cnter[i])/wall->last_calc_idle_delta_time));
-  }
-  TextPrint(Fs,0,l--,BLUE<<4+WHITE,
-        "  ___Description____ #__Task__ UnusedStk_ _UsedMem__/_AllocMem_ "
-        "______Flags_____");
-
-  if (!(winmgr.updates&31) || !*wall->top_line) {
-    Date2Struct(&ds,Now+local_time_offset);
-    i=sys_code_bp->alloced_u8s-sys_code_bp->used_u8s;
-    if (sys_data_bp)
-      i+=sys_data_bp->alloced_u8s-sys_data_bp->used_u8s;
-    StrPrint(wall->top_line,
-          "%3tZ %02d/%02d %02d:%02d:%02d FPS:%2tf Mem:%010X CPU",
-          ds.day_of_week,"ST_DAYS_OF_WEEK",ds.mon,ds.day_of_mon,
-          ds.hour,ds.min,ds.sec,winmgr.fps,i);
-  }
-  TextPrint(Fs,0,0,BLUE<<4+WHITE,wall->top_line);
-
-  if (scrncast.record)
-    TextPrint(Fs,44-4,0,BLUE<<4+RED,"*");
-  for (i=0;i<mp_cnt;i++) {
-    c=&cpu_structs[i];
-    if (i&1)
-      TextPrint(Fs,44+i*2,0,BLUE<<4+WHITE,"%2tf",100.0*(1.0-c->idle_factor));
-    else
-      TextPrint(Fs,44+i*2,0,BLUE<<4+YELLOW,"%2tf",100.0*(1.0-c->idle_factor));
-  }
-
-  st=ScanCode2KeyName(kbd.last_down_scan_code);
-  TextPrint(Fs,80-18,0,BLUE<<4+YELLOW,"%18ts",st);
-  Free(st);
-
-  Fs->hash_table=old_hash;
-  wall->last_calc_idle_cnt=winmgr.t->calc_idle_cnt;
-}
-
-<1>/* Graphics Not Rendered in HTML */
-
-
-
-U0 DrawTermBttn(CDC *dc,CCtrl *c)
-{
-  if (Blink)
-    Sprite3(dc,c->left,c->top,0,<1>);
-}
-
-U0 LeftClickTermBttn(CCtrl *,I64,I64,Bool down)
-{
-  if (down)
-    User;
-}
-
-CCtrl *TermBttnNew()
-{
-  I64 min_x,max_x,min_y,max_y;
-  CCtrl *c=ACAlloc(sizeof(CCtrl));
-
-  c->win_task=sys_winmgr_task;
-  c->flags=CTRLF_SHOW;
-  c->type=CTRLT_GENERIC;
-  c->draw_it=&DrawTermBttn;
-  c->left_click=&LeftClickTermBttn;
-
-  SpriteExtents(<1>,&min_x,&max_x,&min_y,&max_y);
-//min must be zero
-  c->left=sys_winmgr_task->pix_width-(max_x-min_x+1);
-  c->right=c->left+(max_x-min_x+1)-1;
-  c->top=sys_winmgr_task->pix_height-(max_y-min_y+1);
-  c->bottom=c->top+(max_y-min_y+1)-1;
-
-  QueIns(c,sys_winmgr_task->last_ctrl);
-  TaskDerivedValsUpdate(sys_winmgr_task);
-
-  return c;
-}
-
-U0 WallPaperInit()
-{
-  TermBttnNew;
-  gr.fp_wall_paper=&WallPaper;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/Win.HC.HTML b/public/Wb/Home/Src/Adam/Win.HC.HTML deleted file mode 100755 index 95548e8..0000000 --- a/public/Wb/Home/Src/Adam/Win.HC.HTML +++ /dev/null @@ -1,573 +0,0 @@ - - - - - - - - - - - -
-#help_index "Windows"
-#help_file "::/Doc/Windows"
-
-CMsStateGlbls old_ms={{-1000,-1000,0},{-1000,-1000,0},{-1000,-1000,0},
-  {0,0,0},{1.0,1.0,1.0},0.0,GetTSC,0.350,0,0,
-  FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE
-};
-
-public CWinMgrGlbls winmgr={0,0,0,WINMGR_FPS,tS,tS,NULL,FALSE,FALSE,FALSE};
-winmgr.t=CAlloc(sizeof(CWinMgrTimingGlbls));
-winmgr.t->last_calc_idle_time=tS;
-
-U0 ProgressBarsRegTf(U8 *path=NULL)
-{
-  F64 t,p1,p2,p3,p4;
-  if (path) {
-    t=tS;
-    if (progress1_t0) p1=t-progress1_t0; else p1=0;
-    if (progress2_t0) p2=t-progress2_t0; else p2=0;
-    if (progress3_t0) p3=t-progress3_t0; else p3=0;
-    if (progress4_t0) p4=t-progress4_t0; else p4=0;
-    RegWrite(path,"progress1_tf=%0.3f;progress2_tf=%0.3f;\n"
-          "progress3_tf=%0.3f;progress4_tf=%0.3f;\n",p1,p2,p3,p4);
-  }
-}
-
-#define PROGRESS_BAR_HEIGHT     20
-#define PROGRESS_BAR_WIDTH      (3*GR_WIDTH/4)
-U0 DrawProgressBars(CDC *dc)
-{
-  I64 i,j,k,n,m;
-  U8 *st,*st2;
-  for (i=0;i<PROGRESS_BARS_NUM;i++) {
-    if (m=sys_progresses[i].max) {
-      dc->color=BLACK;
-      GrRect(dc,
-            (GR_WIDTH-PROGRESS_BAR_WIDTH)/2,
-            (GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2,
-            PROGRESS_BAR_WIDTH,PROGRESS_BAR_HEIGHT);
-
-      dc->color=LTGREEN;
-      n=sys_progresses[i].val;
-      if (n>m)
-        n=m;
-      GrRect(dc,
-            (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+2,
-            (GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2+2,
-            n*(PROGRESS_BAR_WIDTH-4)/m,
-            PROGRESS_BAR_HEIGHT-4);
-
-      if (m>1) {
-        dc->color=BLACK;
-        k=m-1;
-        if (k>19) k=19;
-        for (j=0;j<=k;j++)
-          GrLine(dc,
-                (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j*
-                (PROGRESS_BAR_WIDTH-4)/ToF64(k+1),
-                (GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*
-                PROGRESS_BAR_HEIGHT)/2+4,
-                (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j*
-                (PROGRESS_BAR_WIDTH-4)/ToF64(k+1),
-                (GR_HEIGHT-(PROGRESS_BARS_NUM*2-3-i*4)*
-                PROGRESS_BAR_HEIGHT)/2-4);
-      }
-
-      dc->color=GREEN;
-      if (*sys_progresses[i].desc)
-        st=StrNew(sys_progresses[i].desc);
-      else
-        st=MStrPrint("%d/%d",n,m);
-      if (sys_progresses[i].t0) {
-        st2=MStrPrint("%s %fs",st,tS-sys_progresses[i].t0);
-        Free(st);
-      } else
-        st2=st;
-      if (sys_progresses[i].tf) {
-        st=MStrPrint("%s/%fs",st2,sys_progresses[i].tf);
-        Free(st2);
-      } else
-        st=st2;
-      GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2,(GR_HEIGHT-FONT_HEIGHT-
-            (PROGRESS_BARS_NUM*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st);
-      Free(st);
-    }
-  }
-}
-
-U0 DrawWinGrid(CDC *dc)
-{
-  F64 d;
-  dc->color=BLACK;
-  dc->thick=1;
-  for (d=ms_grid.x_offset;d<GR_WIDTH; d+=ms_grid.x)
-    GrLine(dc,d,0,d,GR_HEIGHT-1);
-  for (d=ms_grid.y_offset;d<GR_HEIGHT;d+=ms_grid.y)
-    GrLine(dc,0,d,GR_WIDTH-1,d);
-}
-
-U0 WinGrid(Bool val)
-{
-  CGridGlbls last_grid;
-  MemCpy(&last_grid,&ms_grid,sizeof(CGridGlbls));
-  if (!val || PopUpForm(&ms_grid)) {
-    if (!val)
-      GridInit;
-    ms_hard.prescale.x*=last_grid.x_speed/ms_grid.x_speed;
-    ms_hard.prescale.y*=last_grid.y_speed/ms_grid.y_speed;
-    ms_hard.prescale.z*=last_grid.z_speed/ms_grid.z_speed;
-  } else
-    MemCpy(&ms_grid,&last_grid,sizeof(CGridGlbls));
-}
-U0 CtrlAltG(I64 sc)
-{
-  if (sc&SCF_SHIFT)
-    PopUp("WinGrid(OFF);");
-  else
-    PopUp("WinGrid(ON);");
-}
-CtrlAltCBSet('G',&CtrlAltG,"Cmd /Grid On",
-        "Cmd /Grid Off");
-
-CTask *ext_ASCII_task;
-U0 ExtendedASCII()
-{
-  I64 i;
-  CDoc *doc=DocNew;
-  DocPrint(doc,"Sel Char and Press <ESC>\n$LTBLUE$");
-  for (i=0;i<256;i++) {
-    if (i>=CH_SHIFT_SPACE && i!=0x7F) {
-      if (i==CH_SHIFT_SPACE)
-        DocPrint(doc,"$MU-UL,\"\\x1F\",LE=%d$",i);
-      else if (i=='$')
-        DocPrint(doc,"$MU-UL,\"\\x24\",LE=%d$",i);
-      else if (i=='\"'||i=='\\')
-        DocPrint(doc,"$MU-UL,\"\\%c\",LE=%d$",i,i);
-      else
-        DocPrint(doc,"$MU-UL,\"%c\",LE=%d$",i,i);
-    } else
-      DocPrint(doc," ");
-    if (i&15==15)
-      DocPrint(doc,"\n");
-  }
-  i=PopUpMenu(doc);
-  DocDel(doc);
-  if (i>=0)
-    PostMsg(ext_ASCII_task,MSG_KEY_DOWN_UP,i,Char2ScanCode(i));
-}
-
-U0 CtrlAltA(I64)
-{
-  if (ext_ASCII_task=sys_focus_task)
-    Spawn(&ExtendedASCII);
-}
-CtrlAltCBSet('A',&CtrlAltA,"Cmd /Extended ASCII");
-
-public U0 WinScrollNull(CTask *task,CD3I64 *s)
-{//If panning a window has been done, restore to zero.
-  s->x=task->scroll_x;
-  s->y=task->scroll_y;
-  s->z=task->scroll_z;
-  task->scroll_x=0;
-  task->scroll_y=0;
-  task->scroll_z=0;
-}
-
-public U0 WinScrollRestore(CTask *task,CD3I64 *s)
-{//Set window pan value to stored value.
-  task->scroll_x=s->x;
-  task->scroll_y=s->y;
-  task->scroll_z=s->z;
-}
-
-U0 DrawMs(CDC *dc)
-{
-  I64 x,y;
-  PUSHFD
-  CLI
-  x=ms.pos.x;
-  y=ms.pos.y;
-  POPFD
-  if (ms.show && ms_hard.installed) {
-    if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
-      gr.text_base[ms.pos_text.x+ms.pos_text.y*TEXT_COLS]^=0x7F00;
-    else {
-      if (gr.fp_draw_ms) {
-        if (ms.lb)
-          dc->color=ROP_XOR+LTPURPLE^TRANSPARENT;
-        else if (ms.rb)
-          dc->color=ROP_XOR+LTCYAN^TRANSPARENT;
-        else
-          dc->color=ROP_XOR+BLACK^TRANSPARENT;
-        if (winmgr.grab_scroll && gr.fp_draw_grab_ms)
-          (*gr.fp_draw_grab_ms)(dc,x,y,winmgr.grab_scroll_closed);
-        else
-          (*gr.fp_draw_ms)(dc,x,y);
-      }
-    }
-  }
-}
-
-U0 WinFinalUpdate(CDC *dc)
-{
-  if (ms_grid.show)
-    DrawWinGrid(dc);
-  if (ms_grid.coord)
-    GrPrint(dc,GR_WIDTH-FONT_WIDTH*10,FONT_HEIGHT*3,
-          "(%03d,%03d)",ms.pos.x,ms.pos.y);
-  DrawProgressBars(dc);
-  if (winmgr.show_menu)
-    DrawMenu(dc);
-  else
-    sys_cur_submenu_entry=NULL;
-  DrawMs(dc);
-}
-
-gr.fp_final_scrn_update=&WinFinalUpdate;
-
-U0 WinMsUpdate()
-{
-  I64 dd;
-  Bool set=FALSE;
-  if (ms_hard.installed) {
-    ms.has_wheel=ms_hard.has_wheel;
-    if (ms_hard.evt) {
-      MsUpdate(ms_hard.pos.x,ms_hard.pos.y,ms_hard.pos.z,
-            ms_hard.bttns[0],ms_hard.bttns[1]);
-      ms_hard.evt=FALSE;
-      set=TRUE;
-    }
-  }
-
-  if (set) {
-    if (ms_hard.installed) {
-      ms.speed=ms_hard.speed;
-      ms.timestamp=ms_hard.timestamp;
-    }
-  } else
-    ms.speed*=0.95;
-  if (gr.scrn_zoom!=1) {
-    if (gr.continuous_scroll)
-      GrScaleZoom(1.0);
-    else {
-      dd=(ms.pos.x-gr.sx)*gr.scrn_zoom;
-      if (!(8<=dd<GR_WIDTH-8))
-        GrScaleZoom(1.0);
-      else {
-        dd=(ms.pos.y-gr.sy)*gr.scrn_zoom;
-        if (!(8<=dd<GR_HEIGHT-8))
-          GrScaleZoom(1.0);
-      }
-    }
-  }
-}
-
-public CTask *WinRefocus(CTask *task=NULL)
-{//Reset the focus task if NULL.
-  PUSHFD
-  CLI
-  if (!task) {
-    task=sys_winmgr_task->last_task;
-    while (TaskValidate(task) && task!=sys_winmgr_task) {
-      if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) {
-        sys_focus_task=task;
-        break;
-      }
-      task=task->last_task;
-    }
-  }
-  POPFD
-  return sys_focus_task;
-}
-
-I64 WinOnTopWindows()
-{
-  CTask *task,*task1,*first_moved_fwd=NULL;
-  I64 res=0;
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  task=sys_winmgr_task->next_task;
-  while (task!=sys_winmgr_task && task!=first_moved_fwd) {
-    task1=task->next_task;
-    if (!TaskValidate(task)) {
-      POPFD
-      return res;
-    }
-    if (Bt(&task->display_flags,DISPLAYf_WIN_ON_TOP) &&
-          task!=sys_winmgr_task->last_task) {
-      TaskQueRem(task);
-      TaskQueIns(task,sys_winmgr_task);
-      res++;
-      if (!first_moved_fwd)
-        first_moved_fwd=task;
-    }
-    task=task1;
-  }
-  POPFD
-  return res;
-}
-
-public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE)
-{//Put task's win on top of window stack.
-  CTask *task1;
-  I64 res=0;
-  if (!task) task=Fs;
-  if (!TaskValidate(task) || task->gs->num)
-    return 0;
-  TaskDerivedValsUpdate(task,FALSE);
-  if (!sys_winmgr_task || task==sys_winmgr_task)
-    return 0;
-  PUSHFD
-  CLI
-  if (!TaskValidate(task)) {
-    POPFD
-    return 0;
-  }
-  if (task!=sys_winmgr_task->last_task) {
-    TaskQueRem(task);
-    TaskQueIns(task,sys_winmgr_task);
-    res++;
-  }
-  if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
-    sys_focus_task=task;
-  if (res && !Bt(&task->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP)) {
-    task1=task->next_child_task;
-    while (task1!=&task->next_child_task) {
-      if (!TaskValidate(task1))
-        break;
-      res+=WinToTop(task1,FALSE);
-      task1=task1->next_sibling_task;
-    }
-    if (task->popup_task &&
-          task->popup_task->parent_task==task)
-      res+=WinToTop(task->popup_task,FALSE);
-  }
-  POPFD
-  res+=WinOnTopWindows;
-  if (res && update_z_buf)
-    WinZBufUpdate;
-  return res;
-}
-ext[EXT_WIN_TO_TOP]=&WinToTop;
-
-public CTask *WinFocus(CTask *task=NULL)
-{//Set task as focus task.
-  if (!task) task=Fs;
-  PUSHFD
-  CLI
-  if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_SELF_FOCUS))
-    task=WinRefocus(sys_focus_task);
-  WinToTop(sys_focus_task=task);
-  POPFD
-  return sys_focus_task;
-}
-ext[EXT_WIN_FOCUS]=&WinFocus;
-
-public Bool WinHorz(I64 left,I64 right,CTask *task=NULL)
-{//Set task's win left and right columns.
-  I64 d=right-left;
-  if (!task) task=Fs;
-  if (!TaskValidate(task)) return FALSE;
-  if (d<0) d=0;
-  if (left>=TEXT_COLS) {
-    left=TEXT_COLS-1;
-    right=left+d;
-  }
-  if (right<0) {
-    right=0;
-    left=right-d;
-  }
-  if (left>right) {
-    if (left>0)
-      right=left;
-    else
-      left=right;
-  }
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  if (task->win_left!=left || task->win_right!=right) {
-    task->win_left=left;
-    task->win_right=right;
-    TaskDerivedValsUpdate(task);
-    POPFD
-    return TRUE;
-  } else {
-    POPFD
-    return FALSE;
-  }
-}
-
-public Bool WinVert(I64 top,I64 bottom,CTask *task=NULL)
-{//Set task's win top and bottom rows.
-  I64 d=bottom-top;
-  if (!task) task=Fs;
-  if (!TaskValidate(task)) return FALSE;
-  if (d<0) d=0;
-  if (top>=TEXT_ROWS) {
-    top=TEXT_ROWS-1;
-    bottom=top+d;
-  }
-  if (bottom<=0) {
-    bottom=1;
-    top=bottom-d;
-  }
-  if (top>bottom) {
-    if (top>=0)
-      bottom=top;
-    else
-      top=bottom;
-  }
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  if (task->win_top!=top || task->win_bottom!=bottom) {
-    task->win_top=top;
-    task->win_bottom=bottom;
-    TaskDerivedValsUpdate(task);
-    POPFD
-    return TRUE;
-  } else {
-    POPFD
-    return FALSE;
-  }
-}
-
-public U0 WinTileHorz()
-{//Tile windows horizontally top-to-bottom.
-  CTask *task,*last_task=Fs;
-  I64 cnt,c,i,vert_size,no_border;
-
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  task=sys_winmgr_task;
-  cnt=0;
-  do {
-    if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
-      cnt++;
-    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=cnt- i&~3;
-      if (!c)
-        c=1;
-      else if (c>4)
-        c=4;
-      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);
-      last_task=task;
-      if (i&3==3)
-        WinVert(task->win_top,TEXT_ROWS-2,task);
-      i++;
-    }
-    task=task->last_task;
-  } while (task!=sys_winmgr_task);
-  WinVert(last_task->win_top,TEXT_ROWS-2,last_task);
-  POPFD
-}
-
-public U0 WinTileVert()
-{//Tile windows vertically side-by-side.
-  CTask *task,*last_task=Fs;
-  I64 cnt,c,i,horz_size,no_border;
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  task=sys_winmgr_task;
-  cnt=0;
-  do {
-    if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
-      cnt++;
-    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=cnt- i&~3;
-      if (!c)
-        c=1;
-      else if (c>4)
-        c=4;
-      horz_size=TEXT_COLS/c;
-      WinHorz((i&3)*horz_size+1-no_border,(i&3+1)*horz_size-1+no_border,task);
-      WinVert(2-no_border,TEXT_ROWS-2+no_border,task);
-      last_task=task;
-      if (i&3==3)
-        WinHorz(task->win_left,TEXT_COLS-2,task);
-      i++;
-    }
-    task=task->last_task;
-  } while (task!=sys_winmgr_task);
-  WinHorz(last_task->win_left,TEXT_COLS-2,last_task);
-  POPFD
-}
-
-public U0 WinMax(CTask *task=NULL)
-{//Maximize task's window
-  I64 no_border;
-  if (!task) task=Fs;
-  if (!TaskValidate(task)) return;
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER);
-  WinHorz(1-no_border,TEXT_COLS-2+no_border,task);
-  WinVert(2-no_border,TEXT_ROWS-2+no_border,task);
-  WinToTop(task);
-  POPFD
-}
-
-public Bool WinBorder(Bool val=OFF,CTask *task=NULL)
-{//Turn off (or on) window border.
-  Bool old_has_border;
-  if (!task) task=Fs;
-  if (!TaskValidate(task)) return FALSE;
-  PUSHFD
-  CLI //TODO Multiprocessor safe
-  old_has_border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
-  if (val) {
-    if (!old_has_border) {
-      LBtr(&task->display_flags,DISPLAYf_NO_BORDER);
-      task->win_left++; task->win_right--;
-      task->win_top++;  task->win_bottom--;
-      TaskDerivedValsUpdate(task,FALSE);
-    }
-  } else {
-    if (old_has_border) {
-      LBts(&task->display_flags,DISPLAYf_NO_BORDER);
-      task->win_left--; task->win_right++;
-      task->win_top--;  task->win_bottom++;
-      TaskDerivedValsUpdate(task,FALSE);
-    }
-  }
-  POPFD
-  return old_has_border;
-}
-
- diff --git a/public/Wb/Home/Src/Adam/WinMgr.HC.HTML b/public/Wb/Home/Src/Adam/WinMgr.HC.HTML deleted file mode 100755 index 6fb4f67..0000000 --- a/public/Wb/Home/Src/Adam/WinMgr.HC.HTML +++ /dev/null @@ -1,894 +0,0 @@ - - - - - - - - - - - -
-#help_index "Windows;Task/Delay"
-
-public U0 Refresh(I64 cnt=1,Bool force=FALSE)
-{//Wait for 30fps WinMgr to start & finish scrn refresh.
-  //0,FALSE Cnt Sync to WinMgr.
-  //0,TRUE  Pump Msgs.
-  //1 Cnt Wait and Pump Msgs.
-  //2 Cnt Make Sure to do a Full Refresh
-  //and Set Cur Pos.
-  Bool  old_full_refresh,
-        old_idle=LBts(&Fs->task_flags,TASKf_IDLE);
-  CDoc *old_doc=DocPut;
-  I64 update_cnt;
-  if (!cnt&&force)
-    LBts(&sys_semas[SEMA_JUST_PUMP_MSGS],0);
-  while (Bt(&sys_semas[SEMA_REFRESH_IN_PROGRESS],0)) {
-    if (force && sys_winmgr_task)
-      sys_winmgr_task->wake_jiffy=cnts.jiffies;
-    Yield;
-  }
-  if (cnt>1 && old_doc)
-    old_full_refresh=LBts(&old_doc->flags,DOCf_DO_FULL_REFRESH);
-  update_cnt=winmgr.updates+cnt;
-  while (winmgr.updates<update_cnt) {
-    if (force && sys_winmgr_task)
-      sys_winmgr_task->wake_jiffy=cnts.jiffies;
-    Sleep(1);
-  }
-  if (old_doc)
-    LBEqu(&old_doc->flags,DOCf_DO_FULL_REFRESH,old_full_refresh);
-  LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle);
-}
-
-#help_index "Windows"
-
-I64 WinQueIPMsgs(Bool que)
-{
-  static CD3I64 single_ms={0,0,0};
-  F64 time=tS;
-  I64 msg_code=0,arg1,arg2,single_arg1,single_arg2;
-  CTask *task_focus=sys_focus_task;
-
-  if (task_focus && !winmgr.grab_scroll) {
-    arg1=ms.pos.x-task_focus->pix_left-task_focus->scroll_x;
-    arg2=ms.pos.y-task_focus->pix_top-task_focus->scroll_y;
-    single_arg1=single_ms.x-task_focus->pix_left-task_focus->scroll_x;
-    single_arg2=single_ms.y-task_focus->pix_top-task_focus->scroll_y;
-    if (old_ms.presnap.x!=ms.presnap.x || old_ms.presnap.y!=ms.presnap.y) {
-      if (que)
-        TaskMsg(task_focus,0,
-              MSG_MS_MOVE,arg1,arg2,0);
-      msg_code=MSG_MS_MOVE;
-    }
-//TODO que msg for ms.pos.z?
-    if (ms.left_dbl_time) {
-      if (time>ms.left_dbl_time) {
-        if (ms.left_dbl) {
-          if (!ms.left_down_sent) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_L_D_DOWN,arg1,arg2,0);
-            ms.left_down_sent=TRUE;
-            msg_code=MSG_MS_L_D_DOWN;
-          }
-          if (!ms.lb) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_L_D_UP,arg1,arg2,0);
-            ms.left_dbl_time=0;
-            msg_code=MSG_MS_L_D_UP;
-          }
-        } else {
-          if (!ms.left_down_sent) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_L_DOWN,single_arg1,single_arg2,0);
-            ms.left_down_sent=TRUE;
-            msg_code=MSG_MS_L_DOWN;
-          }
-          if (!ms.lb) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_L_UP,arg1,arg2,0);
-            ms.left_dbl_time=0;
-            msg_code=MSG_MS_L_UP;
-          }
-        }
-      } else {
-        if (ms.lb && !ms_last.lb) {
-          ms.left_dbl_time=time;
-          ms.left_dbl=TRUE;
-        }
-      }
-    } else {
-      if (TaskValidate(task_focus) &&
-            Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_MS_L_D)) {
-        if (ms.lb  && !ms_last.lb) {
-          if (que)
-            TaskMsg(task_focus,0,
-                  MSG_MS_L_DOWN,arg1,arg2,0);
-          msg_code=MSG_MS_L_DOWN;
-        } else if (!ms.lb && ms_last.lb) {
-          if (que)
-            TaskMsg(task_focus,0,
-                  MSG_MS_L_UP,arg1,arg2,0);
-          msg_code=MSG_MS_L_UP;
-        }
-      } else {
-        if (ms.lb  && !ms_last.lb) {
-          ms.left_dbl=FALSE;
-          ms.left_down_sent=FALSE;
-          ms.left_dbl_time=time+ms.dbl_time;
-          single_ms.x=ms.pos.x;
-          single_ms.y=ms.pos.y;
-        }
-      }
-    }
-
-    if (ms.right_dbl_time) {
-      if (time>ms.right_dbl_time) {
-        if (ms.right_dbl) {
-          if (!ms.right_down_sent) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_R_D_DOWN,arg1,arg2,0);
-            ms.right_down_sent=TRUE;
-            msg_code=MSG_MS_R_D_DOWN;
-          }
-          if (!ms.rb) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_R_D_UP,arg1,arg2,0);
-            ms.right_dbl_time=0;
-            msg_code=MSG_MS_R_D_UP;
-          }
-        } else {
-          if (!ms.right_down_sent) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_R_DOWN,single_arg1,single_arg2,0);
-            ms.right_down_sent=TRUE;
-            msg_code=MSG_MS_R_DOWN;
-          }
-          if (!ms.rb) {
-            if (que)
-              TaskMsg(task_focus,0,
-                    MSG_MS_R_UP,arg1,arg2,0);
-            ms.right_dbl_time=0;
-            msg_code=MSG_MS_R_UP;
-          }
-        }
-      } else {
-        if (ms.rb && !ms_last.rb) {
-          ms.right_dbl_time=time;
-          ms.right_dbl=TRUE;
-        }
-      }
-    } else {
-      if (TaskValidate(task_focus) &&
-            Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_MS_R_D)) {
-        if (ms.rb  && !ms_last.rb) {
-          if (que)
-            TaskMsg(task_focus,0,
-                  MSG_MS_R_DOWN,arg1,arg2,0);
-          msg_code=MSG_MS_R_DOWN;
-        } else if (!ms.rb && ms_last.rb) {
-          if (que)
-            TaskMsg(task_focus,0,
-                  MSG_MS_R_UP,arg1,arg2,0);
-          msg_code=MSG_MS_R_UP;
-        }
-      } else {
-        if (ms.rb  && !ms_last.rb) {
-          ms.right_dbl=FALSE;
-          ms.right_down_sent=FALSE;
-          ms.right_dbl_time=time+ms.dbl_time;
-          single_ms.x=ms.pos.x;
-          single_ms.y=ms.pos.y;
-        }
-      }
-    }
-
-    MemCpy(&ms_last,&ms,sizeof(CMsStateGlbls));
-    MemCpy(&old_ms,&ms,sizeof(CMsStateGlbls));
-  }
-  return msg_code;
-}
-
-U0 WinCalcIdles()
-{
-  F64 calc_idle_time;
-  I64 i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[MP_PROCESSORS_NUM];
-  CCPU *c;
-  CWinMgrTimingGlbls *t=winmgr.t;
-
-  if ((t->calc_idle_delta_time=
-        (calc_idle_time=tS)-t->last_calc_idle_time)>.25) {
-    PUSHFD
-    CLI
-    total_jiffies=cpu_structs[0].total_jiffies;
-    for (i=0;i<mp_cnt;i++)
-      idle_pt_hits[i]=cpu_structs[i].idle_pt_hits;
-    POPFD
-
-    total_jiffies_delta=total_jiffies-t->last_total_jiffies;
-    for (i=0;i<mp_cnt;i++) {
-      c=&cpu_structs[i];
-      if (total_jiffies_delta && (k=idle_pt_hits[i]-t->last_idle_pt_hits[i])>=0)
-        c->idle_factor=Clamp(ToF64(k)/total_jiffies_delta,0.01,0.99);
-      else
-        c->idle_factor=0.01;
-      t->last_idle_pt_hits[i]=idle_pt_hits[i];
-    }
-    t->last_total_jiffies=total_jiffies;
-    t->last_calc_idle_time=calc_idle_time;
-    t->calc_idle_cnt++;
-  }
-}
-
-I64 WinMgrSleep(Bool flush_msgs=FALSE)
-{
-  I64 timeout_val,msg_code=0;
-  CCtrl *c;
-  Bool que;
-  F64 t,t_delta;
-  U8 *st;
-  CDC *diff;
-  CDate cdt;
-
-  TimeCal;
-  if ((t_delta=(t=tS)-winmgr.last_refresh_tS)>0.01)
-    winmgr.fps=Max(1.0/t_delta,1);
-  else
-    winmgr.fps=99;
-  winmgr.last_refresh_tS=t;
-  WinCalcIdles;
-
-  if (flush_msgs)
-    FifoI64Flush(kbd.scan_code_fifo);
-  else if (TaskValidate(sys_focus_task)) {
-    KbdMsgsQue;
-
-    que=TRUE;
-    if (TaskValidate(sys_focus_task) &&
-          !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS)) {
-      c=sys_focus_task->next_ctrl;
-      while (c!=&sys_focus_task->next_ctrl) {
-        if (CtrlInside(c,ms.pos.x,ms.pos.y)) {
-          que=FALSE;
-          break;
-        }
-        c=c->next;
-      }
-    }
-    msg_code=WinQueIPMsgs(que);
-  } else {
-    WinRefocus(sys_focus_task);
-    if (!TaskValidate(sys_focus_task))
-      FifoI64Flush(kbd.scan_code_fifo);
-  }
-  if (sys_focus_task)
-    LBtr(&sys_focus_task->task_flags,TASKf_HAS_SONG);
-  WinMsUpdate;
-
-  if (!LBtr(&sys_semas[SEMA_JUST_PUMP_MSGS],0)) {
-    t=tS+WINMGR_PERIOD/8;
-    while (winmgr.ideal_refresh_tS<t)
-      winmgr.ideal_refresh_tS+=WINMGR_PERIOD;
-    timeout_val=cnts.jiffies+(winmgr.ideal_refresh_tS-tS)*JIFFY_FREQ;
-    LBts(&sys_semas[SEMA_REFRESH_IN_PROGRESS],0);
-    GrUpdateScrn;
-    LBtr(&sys_semas[SEMA_REFRESH_IN_PROGRESS],0);
-    if (scrncast.record  && !scrncast.just_audio) {
-      cdt=scrncast.t0_now(I64)+ToI64(CDATE_FREQ*(tS-scrncast.t0_tS));
-      if (!scrncast.dc) {
-        scrncast.dc=DCCopy(scrncast.dc2_alias);
-        scrncast.dc->cdt=cdt;
-        st=MStrPrint(scrncast.print_fmt,cdt);
-        GRWrite(st,scrncast.dc);
-        Free(st);
-      } else if (MemCmp(scrncast.dc->body,
-            scrncast.dc2_alias->body,MSize(scrncast.dc2_alias->body))) {
-        diff=DCDiff(scrncast.dc,scrncast.dc2_alias);
-        diff->cdt=cdt;
-        st=MStrPrint(scrncast.print_fmt,cdt);
-        GRWrite(st,diff);
-        Free(st);
-        DCDel(diff);
-        Free(scrncast.dc->body);
-        scrncast.dc->body=MAllocIdent(scrncast.dc2_alias->body);
-      }
-    } else if (scrncast.dc) {
-      DCDel(scrncast.dc); //TODO: MemRep can crash.
-      scrncast.dc=NULL;
-    }
-    if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) {
-      Free(music.cur_song);
-      music.cur_song=NULL;
-    }
-    if (music.cur_song) {
-      if (!music.cur_song_task)
-        music.cur_song_task=Spawn(&CurSongTask,NULL,"Song");
-    } else if (music.cur_song_task) {
-      Kill(music.cur_song_task);
-      music.cur_song_task=NULL;
-    }
-    winmgr.updates++;
-    if (ms_hard.install_attempts) //Don't call before boot mouse install attempt
-      KbdMsHndlr(FALSE,TRUE);
-    SleepUntil(timeout_val);
-  }
-  return msg_code;
-}
-
-CDoc *WinCursorPosSet(CTask *task,I64 msx,I64 msy,Bool set_cursor=TRUE)
-{
-  CDoc *res=NULL;
-  Bool unlock;
-  I64 x0,y0;
-  if (!task) task=Fs;
-  if (WinInside(msx,msy,task)) {
-    if ((res=DocDisplay(task)) && res->flags&DOCF_DONT_SHOW)
-      res=NULL;
-    else if (set_cursor) {
-      unlock=DocLock(res);
-      if (res->doc_signature!=DOC_SIGNATURE_VAL)
-        res=NULL;
-      else {
-        x0=res->line_start_col;
-        y0=res->top_line_num;
-        DocRecalc(res,RECALCF_HAS_CURSOR);
-        res->x=(msx-task->pix_left-task->scroll_x)/FONT_WIDTH +x0;
-        res->y=(msy-task->pix_top -task->scroll_y)/FONT_HEIGHT+y0;
-        DocRecalc(res,RECALCt_FIND_CURSOR);
-        task->scroll_x=0;
-        task->scroll_y=0;
-        task->scroll_z=0;
-        if (unlock)
-          DocUnlock(res);
-      }
-    }
-    WinToTop(task);
-  }
-  return res;
-}
-
-Bool WinKeyNavMenu()
-{
-  I64 i,old_key_cnt;
-  CD3I64 old_pos,new_pos;
-  CMenu *m;
-  CMenuEntry *tmpme;
-  CTask *focus=MenuTask;
-  if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) {
-    winmgr.show_menu=TRUE;
-    sys_cur_submenu_entry=NULL;
-    old_pos.x=ms.pos.x; old_pos.y=ms.pos.y;
-    ms.pos.x=new_pos.x=ms.pos.y=new_pos.y=0;
-    while (Bt(kbd.down_bitmap,SC_GUI)) {
-      old_key_cnt=kbd.cnt;
-      if (Bt(kbd.down_bitmap,SC_CURSOR_LEFT)) {
-        while (Bt(kbd.down_bitmap,SC_CURSOR_LEFT) && kbd.cnt==old_key_cnt)
-          WinMgrSleep(TRUE);
-        if (new_pos.x) {
-          i=0;
-          tmpme=m->sub;
-          while (tmpme) {
-            if (i+MenuEntryWidth(tmpme)*FONT_WIDTH==new_pos.x) {
-              new_pos.x=i;
-              break;
-            }
-            i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
-            tmpme=tmpme->next;
-          }
-        }
-        new_pos.y=0;
-      } else if (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT)) {
-        while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt)
-          WinMgrSleep(TRUE);
-        i=0;
-        tmpme=m->sub;
-        while (tmpme) {
-          if (i==new_pos.x) {
-            if (tmpme->next)
-              new_pos.x=i+MenuEntryWidth(tmpme)*FONT_WIDTH;
-            break;
-          }
-          i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
-          tmpme=tmpme->next;
-        }
-        new_pos.y=0;
-      } else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) {
-        while (Bt(kbd.down_bitmap,SC_CURSOR_UP) && kbd.cnt==old_key_cnt)
-          WinMgrSleep(TRUE);
-        new_pos.y-=FONT_HEIGHT;
-      } else if (Bt(kbd.down_bitmap,SC_CURSOR_DOWN)) {
-        while (Bt(kbd.down_bitmap,SC_CURSOR_DOWN) && kbd.cnt==old_key_cnt)
-          WinMgrSleep(TRUE);
-        new_pos.y+=FONT_HEIGHT;
-      }
-      new_pos.x=ClampI64(new_pos.x,0,GR_WIDTH-1);
-      new_pos.y=ClampI64(new_pos.y,0,GR_HEIGHT-1);
-      ms.pos.x=new_pos.x; ms.pos.y=new_pos.y;
-      WinMgrSleep(TRUE);
-      if (!sys_cur_submenu_entry)
-        ms.pos.y=new_pos.y=0;
-    }
-    if (sys_cur_submenu_entry)
-      TaskMsg(sys_focus_task,0,sys_cur_submenu_entry->msg_code,
-            sys_cur_submenu_entry->arg1,sys_cur_submenu_entry->arg2,0);
-    winmgr.show_menu=FALSE;
-    ms.pos.x=old_pos.x; ms.pos.y=old_pos.y;
-    return TRUE;
-  }
-  return FALSE;
-}
-
-U0 WinMgrTask(I64)
-{
-  CTask *task=Fs;
-  CDoc *doc;
-  CDocEntry *doc_e;
-  I64 x,y,z,msg_code,
-        my_ms_z=0,left,top,
-        old_flags=GetRFlags;
-  Bool has_border;
-  CCtrl *c;
-  WinHorz(0,TEXT_COLS-1);
-  WinVert(0,TEXT_ROWS-1);
-  LBts(&Fs->display_flags,DISPLAYf_NO_BORDER);
-  LBts(&Fs->display_flags,DISPLAYf_SHOW);
-  gr.dc->win_task=Fs;
-  Fs->win_inhibit&=~WIF_SELF_CTRLS;
-  GrSetUpTables;
-  scrncast.dc2_alias=DCAlias(gr.dc2);
-  WinZBufUpdate;
-  LBts(&sys_run_level,RLf_WINMGR);
-  while (TRUE) {
-    try {
-wmt_start:
-      if (Bt(&sys_run_level,RLf_ADAM_SERVER))
-        TaskKillDying;
-      WinMgrSleep;
-
-      task=Fs->last_task;
-      while (TRUE) {
-        CLI
-        if (!TaskValidate(task)) {
-          SetRFlags(old_flags);
-          goto wmt_start;
-        }
-        TaskDerivedValsUpdate(task,FALSE);
-        task=task->last_task;
-        SetRFlags(old_flags);
-        if (task==Fs)
-          break;
-      }
-      TaskDerivedValsUpdate(Fs,FALSE);
-
-      task=Fs->last_task;
-      while (TRUE) {
-        CLI
-        if (!TaskValidate(task)) {
-          SetRFlags(old_flags);
-          goto wmt_start;
-        }
-        if (WinInside(ms.pos.x,ms.pos.y,task,FONT_WIDTH)) {
-          SetRFlags(old_flags);
-          break;
-        }
-        if (task==Fs) { //Shouldn't happen
-          SetRFlags(old_flags);
-          goto wmt_start;
-        }
-        task=task->last_task;
-        SetRFlags(old_flags);
-      }
-
-      if (Bt(&task->display_flags,DISPLAYf_NO_BORDER))
-        has_border=FALSE;
-      else
-        has_border=TRUE;
-
-      winmgr.show_menu=FALSE;
-      sys_cur_submenu_entry=NULL;
-      if (TaskValidate(sys_focus_task) &&
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MENU)) {
-        if (WinKeyNavMenu)
-          goto wmt_start;
-        if (task==Fs && 0<=ms.pos.y<FONT_HEIGHT && ms_hard.installed) {
-          winmgr.show_menu=TRUE;
-          if (ms.lb && !old_ms.lb) {
-            winmgr.show_menu=TRUE;
-            while (ms.lb)
-              WinMgrSleep(TRUE);
-            if (sys_cur_submenu_entry)
-              TaskMsg(sys_focus_task,0,
-                    sys_cur_submenu_entry->msg_code,
-                    sys_cur_submenu_entry->arg1,
-                    sys_cur_submenu_entry->arg2,0);
-            winmgr.show_menu=FALSE;
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-        }
-      }
-
-      //grab scroll
-      if (!Bt(&task->win_inhibit,WIf_SELF_GRAB_SCROLL) &&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_GRAB_SCROLL)) &&
-            kbd.scan_code&SCF_CTRL && TaskValidate(task)) {
-        winmgr.grab_scroll_closed=FALSE;
-        winmgr.grab_scroll=TRUE;
-        while (kbd.scan_code&SCF_CTRL && TaskValidate(task) && (!ac.task ||
-              !WinInside(ms.pos.x,ms.pos.y,ac.task,FONT_WIDTH))) {
-          if (ms.lb) {
-            winmgr.grab_scroll_closed=TRUE;
-            x=ms.pos.x-task->scroll_x;
-            y=ms.pos.y-task->scroll_y;
-            z=ms.pos.z-task->scroll_z;
-            while (ms.lb && kbd.scan_code&SCF_CTRL && TaskValidate(task)) {
-              task->scroll_x=(ms.pos.x-x)&~7;
-              task->scroll_y=(ms.pos.y-y)&~7;
-              task->scroll_z=ms.pos.z-z;
-              WinMgrSleep(TRUE);
-            }
-            winmgr.grab_scroll_closed=FALSE;
-          } else if (ms.rb)  {
-            task->scroll_x=0;
-            task->scroll_y=0;
-            task->scroll_z=0;
-            WinMgrSleep(TRUE);
-          } else
-            WinMgrSleep;
-        }
-        winmgr.grab_scroll=FALSE;
-        goto wmt_start;
-      } else
-        winmgr.grab_scroll=FALSE;
-
-      if (!Bt(&task->win_inhibit,WIf_SELF_CTRLS) &&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS))) {
-        if (ms.lb && !old_ms.lb) {
-          c=task->next_ctrl;
-          while (c!=&task->next_ctrl) {
-            if (CtrlInside(c,ms.pos.x,ms.pos.y)) {
-              left=task->pix_left;
-              top =task->pix_top;
-              if (c->flags&CTRLF_BORDER) {
-                left-=FONT_WIDTH;
-                top -=FONT_HEIGHT;
-              }
-              if (c->flags&CTRLF_CAPTURE_LEFT_MS) {
-                while (ms.lb && TaskValidate(task)) {
-                  if (c->left_click)
-                    (*c->left_click)(c,ms.pos.x-left,ms.pos.y-top,TRUE);
-                  WinMgrSleep;
-                }
-                if (c->left_click)
-                  (*c->left_click)(c,ms.pos.x-left,ms.pos.y-top,FALSE);
-                old_ms.lb=FALSE;
-                goto wmt_start;
-              } else {
-                if (c->left_click)
-                  (*c->left_click)(c,ms.pos.x-left,ms.pos.y-top,TRUE);
-                old_ms.lb=TRUE;
-                goto wmt_start;
-              }
-            }
-            c=c->next;
-          }
-        }
-        if (old_ms.lb && !ms.lb) {
-          c=task->next_ctrl;
-          while (c!=&task->next_ctrl) {
-            if (CtrlInside(c,ms.pos.x,ms.pos.y)) {
-              left=task->pix_left;
-              top =task->pix_top;
-              if (c->flags&CTRLF_BORDER) {
-                left-=FONT_WIDTH;
-                top -=FONT_HEIGHT;
-              }
-              if (c->left_click)
-                (*c->left_click)(c,ms.pos.x-left,ms.pos.y-top,FALSE);
-              old_ms.lb=FALSE;
-              goto wmt_start;
-            }
-            c=c->next;
-          }
-        }
-        if (ms.rb && !old_ms.rb) {
-          c=task->next_ctrl;
-          while (c!=&task->next_ctrl) {
-            if (CtrlInside(c,ms.pos.x,ms.pos.y)) {
-              left=task->pix_left;
-              top =task->pix_top;
-              if (c->flags&CTRLF_BORDER) {
-                left-=FONT_WIDTH;
-                top -=FONT_HEIGHT;
-              }
-              if (c->flags&CTRLF_CAPTURE_RIGHT_MS) {
-                while (ms.rb && TaskValidate(task)) {
-                  if (c->right_click)
-                    (*c->right_click)(c,ms.pos.x-left,ms.pos.y-top,TRUE);
-                  WinMgrSleep;
-                }
-                if (c->right_click)
-                  (*c->right_click)(c,ms.pos.x-left,ms.pos.y-top,FALSE);
-                old_ms.rb=FALSE;
-                goto wmt_start;
-              } else {
-                if (c->right_click)
-                  (*c->right_click)(c,ms.pos.x-left,ms.pos.y-top,TRUE);
-                old_ms.rb=TRUE;
-                goto wmt_start;
-              }
-            }
-            c=c->next;
-          }
-        }
-        if (old_ms.rb && !ms.rb) {
-          c=task->next_ctrl;
-          while (c!=&task->next_ctrl) {
-            if (CtrlInside(c,ms.pos.x,ms.pos.y)) {
-              left=task->pix_left;
-              top =task->pix_top;
-              if (c->flags&CTRLF_BORDER) {
-                left-=FONT_WIDTH;
-                top -=FONT_HEIGHT;
-              }
-              if (c->right_click)
-                (*c->right_click)(c,ms.pos.x-left,ms.pos.y-top,FALSE);
-              old_ms.rb=FALSE;
-              goto wmt_start;
-            }
-            c=c->next;
-          }
-        }
-        if (ms.has_wheel && my_ms_z!=ms.pos.z) {
-          if (task==sys_focus_task) {
-            c=task->next_ctrl;
-            while (c!=&task->next_ctrl) {
-              if (c->wheel_chg) {
-                (*c->wheel_chg)(c,ms.pos.z-my_ms_z);
-                my_ms_z=ms.pos.z;
-                goto wmt_start;
-              }
-              c=c->next;
-            }
-            my_ms_z=ms.pos.z;
-          } else if (!sys_focus_task)
-            my_ms_z=ms.pos.z;
-        }
-      }
-
-      if (task==Fs)
-        goto wmt_start;
-
-      if (!Bt(&task->win_inhibit,WIf_SELF_MS_L)&&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MS_L))) {
-        if (!old_ms.lb && ms.lb) {
-          if (doc=WinCursorPosSet(task,ms.pos.x,ms.pos.y)) {
-            DocLock(doc);
-            if (doc->doc_signature==DOC_SIGNATURE_VAL) {
-              doc_e=doc->cur_entry;
-              if (doc_e!=doc) {
-                if (doc_e->de_flags & DOCEF_HAS_BORDER)
-                  doc_e->de_flags|=DOCEF_SOLID_BORDER;
-              }
-            }
-            DocUnlock(doc);
-            old_ms.lb=TRUE;
-            goto wmt_start;
-          }
-        }
-      }
-      if (!Bt(&task->win_inhibit,WIf_SELF_MS_R)&&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MS_R))) {
-        if (!old_ms.rb && ms.rb) {
-          if (WinCursorPosSet(task,ms.pos.x,ms.pos.y)) {
-            old_ms.rb=TRUE;
-            goto wmt_start;
-          }
-        }
-      }
-      if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border &&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) {
-        if (old_ms.lb && !ms.lb) {
-          if (ms.pos_text.y==task->win_top-1) {
-            if (task->win_left<=ms.pos_text.x<task->win_left+4) {
-              TaskMsg(task,0,MSG_KEY_DOWN,CH_CTRLM,0x43200000432,0);
-              old_ms.lb=FALSE;
-              goto wmt_start;
-            } else if (task->win_right-2<=ms.pos_text.x<=task->win_right) {
-              if (DocPut(task))
-                TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0);
-              else
-                Kill(task,FALSE);
-              old_ms.lb=FALSE;
-              goto wmt_start;
-            }
-          }
-        }
-      }
-      if (!Bt(&task->win_inhibit,WIf_SELF_MS_L)&&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MS_L))) {
-        if (old_ms.lb && !ms.lb) {
-          if (doc=WinCursorPosSet(task,ms.pos.x,ms.pos.y,FALSE)) {
-            do msg_code=WinMgrSleep;
-            while (TaskValidate(task) && (ms.lb || ms.left_dbl_time));
-            if (TaskValidate(task)) {
-              if (msg_code==MSG_MS_L_UP) {
-                if (doc->doc_signature==DOC_SIGNATURE_VAL) {
-                  DocLock(doc);
-                  if (TaskValidate(task)) {
-                    if (doc->doc_signature==DOC_SIGNATURE_VAL) {
-                      doc_e=doc->cur_entry;
-                      if (doc_e!=doc) {
-                        if (doc_e->de_flags & DOCEF_HAS_BORDER)
-                          doc_e->de_flags&=~DOCEF_SOLID_BORDER;
-                        if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST|
-                              DOCEF_LINK|DOCEF_CHECK_COLLAPSABLE|
-                              DOCEF_LEFT_CB|DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP))
-                          TaskMsg(task,0,MSG_KEY_DOWN,CH_SPACE,0,0);
-                      }
-                    }
-                    DocUnlock(doc);
-                  }
-                }
-              } else if (msg_code==MSG_MS_L_D_UP)
-                TaskMsg(task,0,MSG_KEY_DOWN,CH_ESC,0,0);
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-        }
-      }
-
-      if (!Bt(&task->win_inhibit,WIf_SELF_MS_R)&&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MS_R))) {
-        if (old_ms.rb && !ms.rb) {
-          if (doc=WinCursorPosSet(task,ms.pos.x,ms.pos.y,FALSE)) {
-            do msg_code=WinMgrSleep;
-            while (TaskValidate(task) && (ms.rb || ms.right_dbl_time));
-            if (TaskValidate(task)) {
-              if (msg_code==MSG_MS_R_UP) {
-                if (doc->doc_signature==DOC_SIGNATURE_VAL) {
-                  DocLock(doc);
-                  if (TaskValidate(task)) {
-                    if (doc->doc_signature==DOC_SIGNATURE_VAL) {
-                      doc_e=doc->cur_entry;
-                      if (doc_e!=doc) {
-                        if (doc_e->de_flags&(DOCEF_LINK|
-                              DOCEF_RIGHT_CB|DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP))
-                          TaskMsg(task,0,MSG_KEY_DOWN,'\n',0,0);
-                      }
-                    }
-                    DocUnlock(doc);
-                  }
-                }
-              } else if (msg_code==MSG_MS_R_D_UP)
-                TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0);
-            }
-            old_ms.rb=FALSE;
-            goto wmt_start;
-          }
-        }
-      }
-
-      if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border &&
-            (!TaskValidate(sys_focus_task)||
-            !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) {
-        if (ms.lb && !old_ms.lb) {
-          if (task->win_top==ms.pos_text.y+1 &&
-                task->win_left-1<=ms.pos_text.x<=task->win_right+1) {
-            if (task->win_left<=ms.pos_text.x<task->win_left+4) {
-              old_ms.lb=TRUE;
-              goto wmt_start;
-            }
-            if (task->win_right-2<=ms.pos_text.x<=task->win_right) {
-              old_ms.lb=TRUE;
-              goto wmt_start;
-            }
-            x=ms.pos_text.x-task->win_left;
-            if (ms.lb) {
-              WinToTop(task);
-              while (ms.lb && TaskValidate(task)) {
-                WinHorz(ms.pos_text.x-x,task->win_width-1+ms.pos_text.x-x,task);
-                WinVert(ms.pos_text.y+1,task->win_height+ms.pos_text.y,task);
-                WinMgrSleep;
-              }
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-          if (task->win_left==ms.pos_text.x+1 &&
-                task->win_top-1<=ms.pos_text.y<=task->win_bottom+1) {
-            y=ms.pos_text.y-task->win_top;
-            if (ms.lb) {
-              WinToTop(task);
-              while (ms.lb && TaskValidate(task)) {
-                WinHorz(ms.pos_text.x+1,task->win_width+ms.pos_text.x,task);
-                WinVert(ms.pos_text.y-y,
-                      task->win_height-1+ms.pos_text.y-y,task);
-                WinMgrSleep;
-              }
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-          if (task->win_right+1==ms.pos_text.x &&
-                task->win_bottom+1==ms.pos_text.y) {
-            if (ms.lb) {
-              WinToTop(task);
-              while (ms.lb && TaskValidate(task)) {
-                WinHorz(task->win_left,ms.pos_text.x-1,task);
-                WinVert(task->win_top,ms.pos_text.y-1,task);
-                WinMgrSleep;
-              }
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-          if (task->win_bottom==ms.pos_text.y-1 &&
-                task->win_left<=ms.pos_text.x<=task->win_right) {
-            if (ms.lb) {
-              WinToTop(task);
-              while (ms.lb && TaskValidate(task)) {
-                WinVert(task->win_top,ms.pos_text.y-1,task);
-                WinMgrSleep;
-              }
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-          if (task->win_right==ms.pos_text.x-1 &&
-                task->win_top<=ms.pos_text.y<=task->win_bottom) {
-            if (ms.lb) {
-              WinToTop(task);
-              while (ms.lb && TaskValidate(task)) {
-                WinHorz(task->win_left,ms.pos_text.x-1,task);
-                WinMgrSleep;
-              }
-            }
-            old_ms.lb=FALSE;
-            goto wmt_start;
-          }
-        }
-      }
-    } catch {
-      Beep;
-      Fs->catch_except=TRUE;
-      task=Fs;
-    }
-  }
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/Accts.DD.HTML b/public/Wb/Home/Src/Apps/Budget/Accts.DD.HTML deleted file mode 100755 index 24298ee..0000000 --- a/public/Wb/Home/Src/Apps/Budget/Accts.DD.HTML +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - -
-JOB
-BANK
-CREDIT
-CASH
-RENT
-CAR
-UTILITIES
-MISC
-CLOTHS
-HEALTH
-CHARITY
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtAccts.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtAccts.HC.HTML deleted file mode 100755 index 55a5316..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtAccts.HC.HTML +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - -
-U0 BgtAcctsUpdate()
-{
-  CBgtEntry     *tmpb;
-  CBgtTemplate  *tmpt;
-  tmpb=b_head.next;
-  while (tmpb!=&b_head) {
-    if (tmpb->type!=BE_TEMPLATE_COPY) {
-      tmpb->credit_idx=StrFileAdd(tmpb->credit,
-            &accts_table_strs,accts_table);
-      tmpb->debit_idx =StrFileAdd(tmpb->debit,
-            &accts_table_strs,accts_table);
-    }
-    tmpb=tmpb->next;
-  }
-  tmpt=t_head.next;
-  while (tmpt!=&t_head) {
-    tmpt->b.credit_idx=StrFileAdd(tmpt->b.credit,
-          &accts_table_strs,accts_table);
-    tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,
-          &accts_table_strs,accts_table);
-    tmpt=tmpt->next;
-  }
-}
-
-U0 BgtAcctsWrite()
-{
-  BgtAcctsUpdate;
-  StrFileWrite(bgt_accts_file,accts_table,TRUE);
-}
-
-U0 BgtAcctsRead()
-{
-  I64   i,max_num;
-  U8    *colors,**s=StrFileRead(bgt_accts_file,&max_num,&colors,TRUE);
-  StrFileDel(accts_table);
-  accts_table=HashTableNew(512);
-  accts_table_strs=0;
-  for (i=0;i<=max_num;i++)
-    if (s[i])
-      StrFileAdd(s[i],&accts_table_strs,accts_table,colors[i]);
-  StrFileArrDel(s,max_num);
-  Free(colors);
-}
-
-I64 BgtAcctColor(U8 *st)
-{
-  CHashGeneric *tmph;
-  if (tmph=HashFind(st,accts_table,SFT_GENERIC))
-    return tmph->user_data1;
-  else
-    return BLACK;
-}
-
-U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
-{
-  I64 i;
-  U8 *res;
-  CDoc *doc=DocNew;
-  CDocEntry *doc_e,*doc_dft=NULL;
-  CHashGeneric *tmph;
-
-  if (header)
-    DocPrint(doc,"%s",header);
-
-  for (i=0;i<=accts_table->mask;i++) {
-    tmph=accts_table->body[i];
-    while (tmph) {
-      doc_e=DocPrint(doc,"$FG,%d$$MU-UL,\"%s\",LE=0x%X$\n",
-            tmph->user_data1,tmph->str,tmph->str);
-      if (dft && !StrCmp(dft,tmph->str))
-        doc_dft=doc_e;
-      tmph=tmph->next;
-    }
-  }
-
-  if (doc_dft) {
-    doc->cur_entry=doc_dft;
-    doc->cur_col=0;
-  }
-  res=PopUpMenu(doc,DOF_DONT_HOME);
-  DocDel(doc);
-  return res;
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtEntry.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtEntry.HC.HTML deleted file mode 100755 index 063c4cc..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtEntry.HC.HTML +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - -
-U0 BgtEntryDel2(CBgtEntry *tmpb)
-{
-  if (tmpb->type!=BE_TEMPLATE_COPY) {
-    Free(tmpb->credit);
-    Free(tmpb->debit);
-    Free(tmpb->desc);
-  }
-}
-
-CBgtEntry *BgtEntryCopy(CBgtEntry *tmpb,Bool periodic_copy)
-{
-  CBgtEntry *res=MAlloc(sizeof(CBgtEntry));
-  MemCpy(res,tmpb,sizeof(CBgtEntry));
-  if (periodic_copy) {
-    res->credit=StrNew(tmpb->credit);
-    res->debit =StrNew(tmpb->debit);
-    res->desc  =StrNew(tmpb->desc);
-  }
-  return res;
-}
-
-U0 BgtEntryDel(CBgtEntry *tmpb)
-{
-  BgtEntryDel2(tmpb);
-  Free(tmpb);
-}
-
-U0 BgtIns(CBgtEntry *tmpb)
-{
-  CBgtEntry     *tmpb1=b_head.next;
-  while (tmpb1!=&b_head && tmpb1->date<tmpb->date)
-    tmpb1=tmpb1->next;
-  QueIns(tmpb,tmpb1->last);
-}
-
-class CBgtEntryForm
-{
-  U8    date[512]       format "$DA-P,A=\"Date              :%s\"$\n";
-  F64   amount          format "Amount            $$$DA,A=\"%10.2f\"$\n";
-  U8    credit[512]     format "$DA-P,A=\"Credit (from) Acct:%s\"$\n";
-  U8    debit [512]     format "$DA-P,A=\"Debit  (to)   Acct:%s\"$\n";
-  U8    desc  [512]     format "$DA-P,A=\"Desc              :%s\"$\n";
-};
-
-CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
-{
-  CBgtEntryForm b;
-  CBgtEntry *tmpb;
-  U8 *st;
-  MemSet(&b,0,sizeof(CBgtEntryForm));
-  StrCpy(&b.date,"*");
-  if (dft) {
-    StrPrint(b.date,"%D",dft->date);
-    b.amount=dft->amount;
-    StrCpy(b.credit,dft->credit);
-    StrCpy(b.debit ,dft->debit);
-    StrCpy(b.desc  ,dft->desc);
-  }
-  while (TRUE)
-    if (PopUpForm(&b)) {
-      if (!*b.credit) {
-        st=BgtPopUpAcct("Credit Acct\n\n");
-        if (st!=DOCM_CANCEL)
-          StrCpy(b.credit,st);
-      } else if (!*b.debit) {
-        st=BgtPopUpAcct("Debit Acct\n\n");
-        if (st!=DOCM_CANCEL)
-          StrCpy(b.debit,st);
-      } else {
-        tmpb=CAlloc(sizeof(CBgtEntry));
-        tmpb->date  =Str2Date(b.date);
-        tmpb->amount=b.amount;
-        tmpb->credit=StrNew(b.credit);
-        tmpb->debit =StrNew(b.debit);
-        tmpb->desc  =StrNew(b.desc);
-        tmpb->type  =BE_NORMAL;
-        StrFileAdd(tmpb->credit,&accts_table_strs,accts_table);
-        StrFileAdd(tmpb->debit,&accts_table_strs,accts_table);
-        return tmpb;
-      }
-    } else
-      return NULL;
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtFile.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtFile.HC.HTML deleted file mode 100755 index 660e642..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtFile.HC.HTML +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - -
-U0 BgtDataRead()
-{
-  CBgtEntry     *tmpb;
-  CBgtTemplate  *tmpt;
-  I64           i,cnt,size;
-  U8            *b,*ptr;
-  I64           max_num;
-  U8            **s=StrFileRead(bgt_string_file,&max_num);
-
-  MemSet(&b_head,0,sizeof(CBgtEntry));
-  QueInit(&b_head);
-  b_head.date=Now;
-  MemSet(&t_head,0,sizeof(CBgtTemplate));
-  QueInit(&t_head);
-  t_head.b.date=Now;
-
-  if (ptr=b=FileRead(bgt_data_file,&size)) {
-    cnt=*ptr(I64 *)++;
-    for (i=0;i<cnt;i++) {
-      tmpb=CAlloc(sizeof(CBgtEntry));
-      MemCpy(&tmpb->start,ptr,BE_SIZE);
-      tmpb->credit=StrNew(s[tmpb->credit_idx]);
-      tmpb->debit =StrNew(s[tmpb->debit_idx]);
-      tmpb->desc  =StrNew(s[tmpb->desc_idx]);
-      QueIns(tmpb,b_head.last);
-      ptr+=BE_SIZE;
-    }
-
-    cnt=*ptr(I64 *)++;
-    for (i=0;i<cnt;i++) {
-      tmpt=CAlloc(sizeof(CBgtTemplate));
-      MemCpy(&tmpt->start,ptr,BT_SIZE);
-      ptr+=BT_SIZE;
-      MemCpy(&tmpt->b.start,ptr,BE_SIZE);
-      ptr+=BE_SIZE;
-      tmpt->b.credit=StrNew(s[tmpt->b.credit_idx]);
-      tmpt->b.debit =StrNew(s[tmpt->b.debit_idx]);
-      tmpt->b.desc  =StrNew(s[tmpt->b.desc_idx]);
-      QueIns(tmpt,t_head.last);
-    }
-  }
-
-  StrFileArrDel(s,max_num);
-  Free(b);
-
-  BgtAcctsUpdate;
-}
-
-U0 BgtDataWrite()
-{
-  I64 i,num=0,size,cnt1,cnt2;
-  CHashTable    *table=HashTableNew(1024);
-  CBgtEntry     *tmpb;
-  CBgtTemplate  *tmpt;
-  CHashGeneric *tmph;
-  U8 *buf,*ptr;
-
-  for (i=0;i<=accts_table->mask;i++) {
-    tmph=accts_table->body[i];
-    while (tmph) {
-      StrFileAdd(tmph->str,&num,table); //Cosmetics -- make accts appear first.
-      tmph=tmph->next;
-    }
-  }
-
-  tmpb=b_head.next;
-  cnt1=0;
-  while (tmpb!=&b_head) {
-    if (tmpb->type!=BE_TEMPLATE_COPY) {
-      tmpb->credit_idx  =StrFileAdd(tmpb->credit,&num,table);
-      tmpb->debit_idx   =StrFileAdd(tmpb->debit,&num,table);
-      tmpb->desc_idx            =StrFileAdd(tmpb->desc,&num,table);
-      cnt1++;
-    }
-    tmpb=tmpb->next;
-  }
-
-  tmpt=t_head.next;
-  cnt2=0;
-  while (tmpt!=&t_head) {
-    tmpt->b.credit_idx  =StrFileAdd(tmpt->b.credit,&num,table);
-    tmpt->b.debit_idx   =StrFileAdd(tmpt->b.debit,&num,table);
-    tmpt->b.desc_idx            =StrFileAdd(tmpt->b.desc,&num,table);
-    cnt2++;
-    tmpt=tmpt->next;
-  }
-  StrFileWrite(bgt_string_file,table);
-  StrFileDel(table);
-
-  size=sizeof(I64)*2+cnt1*BE_SIZE+cnt2*(BT_SIZE+BE_SIZE);
-  buf=ptr=MAlloc(size);
-
-  MemCpy(ptr,&cnt1,sizeof(I64));
-  ptr+=sizeof(I64);
-  tmpb=b_head.next;
-  while (tmpb!=&b_head) {
-    if (tmpb->type!=BE_TEMPLATE_COPY) {
-      MemCpy(ptr,&tmpb->start,BE_SIZE);
-      ptr+=BE_SIZE;
-    }
-    tmpb=tmpb->next;
-  }
-
-  MemCpy(ptr,&cnt2,sizeof(I64));
-  ptr+=sizeof(I64);
-  tmpt=t_head.next;
-  while (tmpt!=&t_head) {
-    MemCpy(ptr,&tmpt->start,BT_SIZE);
-    ptr+=BT_SIZE;
-    MemCpy(ptr,&tmpt->b.start,BE_SIZE);
-    ptr+=BE_SIZE;
-    tmpt=tmpt->next;
-  }
-
-  FileWrite(bgt_data_file,buf,size);
-  Free(buf);
-}
-
-U0 BgtDel()
-{
-  CBgtEntry     *tmpb,*tmpb1;
-  CBgtTemplate  *tmpt,*tmpt1;
-  tmpb=b_head.next;
-  while (tmpb!=&b_head) {
-    tmpb1=tmpb->next;
-    BgtEntryDel2(tmpb);
-    Free(tmpb);
-    tmpb=tmpb1;
-  }
-  tmpt=t_head.next;
-  while (tmpt!=&t_head) {
-    tmpt1=tmpt->next;
-    BgtEntryDel2(&tmpt->b);
-    Free(tmpt);
-    tmpt=tmpt1;
-  }
-  StrFileDel(accts_table);
-  accts_table=NULL;
-  accts_table_strs=0;
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtMain.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtMain.HC.HTML deleted file mode 100755 index ce86b2d..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtMain.HC.HTML +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - -
-extern U0 BgtRegen();
-
-Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
-{//ch=ASCII; sc=scan_code
-  no_warn sc;
-  CBgtEntry *tmpb,*tmpb1;
-  CBgtTemplate *tmpt,*tmpt1;
-  CDocEntry *doc_ce;
-  U8 *st;
-  switch (ch) {
-    case '\n':
-      if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
-            doc_ce->type_u8==DOCT_MENU_VAL) {
-        tmpb=doc_ce->user_data;
-        if (tmpt=tmpb->template) {
-          if (tmpt1=BgtTemplatePmt(tmpt)) {
-            QueRem(tmpt);
-            BgtTemplatePurge(tmpt);
-            BgtEntryDel2(&tmpt->b);
-            Free(tmpt);
-            QueIns(tmpt1,t_head.last);
-            BgtTemplateExpand(tmpt1);
-            BgtRegen;
-          }
-        } else {
-          if (tmpb1=BgtEntryPmt(tmpb)) {
-            QueRem(tmpb);
-            BgtEntryDel(tmpb);
-            BgtIns(tmpb1);
-            BgtRegen;
-          }
-        }
-      }
-      return TRUE;
-    case CH_CTRLY:
-      if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
-            doc_ce->type_u8==DOCT_MENU_VAL) {
-        tmpb=doc_ce->user_data;
-        if (tmpt=tmpb->template) {
-          QueRem(tmpt);
-          BgtTemplateDel(tmpt);
-        } else {
-          QueRem(tmpb);
-          BgtEntryDel(tmpb);
-        }
-        BgtRegen;
-      }
-      return TRUE;
-    case 'a':
-      PopUpOk(  "Set the name and color of your accounts.\n"
-            "To delete accounts, manually edit\n"
-            "$GREEN$~/Budget/Accts.DD.Z$FG$.");
-      if (PopUpEd(bgt_accts_file,Fs)) {
-        BgtAcctsRead;
-        BgtRegen;
-      }
-      return TRUE;
-    case 'v':
-      if ((st=BgtPopUpAcct("View Acct\n\n",view_acct))>=0) {
-        StrCpy(view_acct,st);
-        BgtRegen;
-      }
-      return TRUE;
-    case 'n':
-      if (tmpb1=BgtEntryPmt) {
-        BgtIns(tmpb1);
-        BgtRegen;
-      }
-      return TRUE;
-    case 't':
-      if (tmpt1=BgtTemplatePmt) {
-        QueIns(tmpt1,t_head.last);
-        BgtTemplateExpand(tmpt1);
-        BgtRegen;
-      }
-      return TRUE;
-    case 'c':
-      if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
-            doc_ce->type_u8==DOCT_MENU_VAL)
-        tmpb=doc_ce->user_data;
-      else
-        tmpb=NULL;
-      if (tmpb1=BgtEntryPmt(tmpb)) {
-        BgtIns(tmpb1);
-        BgtRegen;
-      }
-      return TRUE;
-    case 'p':
-      if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
-            doc_ce->type_u8==DOCT_MENU_VAL) {
-        tmpb=doc_ce->user_data;
-        if (tmpt1=BgtTemplatePmt(,tmpb)) {
-          BgtTemplateExpand(tmpt1,TRUE);
-          BgtTemplateDel(tmpt1);
-          BgtRegen;
-        }
-      }
-      return TRUE;
-  }
-  return FALSE;
-}
-
-U0 BgtRegen()
-{
-  I64 timeout_jiffy,c,color=COLOR_INVALID;
-  F64 balance=0;
-  CDoc *doc,*pdoc,*ddoc;
-  CDocEntry *doc_ce;
-  CBgtEntry *tmpb=b_head.next,*tmpb_ce;
-  doc=DocNew;
-  doc->flags|=DOCF_FORM;
-  while (tmpb!=&b_head) {
-    if (!StrCmp(view_acct,tmpb->credit))
-      balance-=tmpb->amount;
-    if (!StrCmp(view_acct,tmpb->debit))
-      balance+=tmpb->amount;
-    c=BgtAcctColor(tmpb->credit);
-    if (c!=color) {
-      color=c;
-      DocPrint(doc,"$FG,%d$",color);
-    }
-    tmpb->doc_e=DocPrint(doc,
-          "$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%$Q\",U=0x%X$\n",
-          tmpb->date,tmpb->credit,tmpb->debit,balance,
-          tmpb->amount,tmpb->desc,tmpb);
-    tmpb=tmpb->next;
-  }
-  DocRecalc(doc);
-
-  if (pdoc=Fs->put_doc) {
-    DocLock(pdoc);
-//Now, we want to preserve old position in doc, using ugly brute force.
-    //It's tricky -- can't use old line num because of editor filters.
-
-    //The price we pay for using the standard document editor is this kludge.
-    //When I originally wrote my budget program, I did not have separate budget
-    //and line entries, so we never had to resync.
-
-    doc_ce=pdoc->cur_entry;
-    timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second.
-    while (doc_ce!=pdoc && cnts.jiffies<timeout_jiffy) {
-      while (doc_ce->type_u8!=DOCT_MENU_VAL || !(tmpb_ce=doc_ce->user_data)) {
-        doc_ce=doc_ce->next;
-        if (doc_ce==pdoc) goto br_cont;
-      }
-      tmpb=b_head.next;
-      while (tmpb!=&b_head) {
-        if (tmpb==tmpb_ce) {
-          doc->cur_entry=tmpb->doc_e;
-          doc->cur_col=0;
-          DocCenter(doc);
-          goto br_cont;
-        }
-        tmpb=tmpb->next;
-      }
-      doc_ce=doc_ce->next;
-    }
-  }
-
-  br_cont:
-  ddoc=Fs->display_doc;
-  Fs->put_doc    =doc;
-  Fs->display_doc=doc;
-  DocDel(pdoc);
-  if (pdoc!=ddoc)
-    DocDel(ddoc);
-  doc->user_put_key=&BgtPutKey;
-}
-
-U0 Budget(U8 *dirname="~/Budget")
-{
-  CDoc *pdoc,*ddoc,*old_put,*old_display;
-
-  Cd(dirname);
-  bgt_string_file       =FileNameAbs("Strs.DD.Z");
-  bgt_accts_file        =FileNameAbs("Accts.DD.Z");
-  bgt_data_file         =FileNameAbs("Bgt.DATA.Z");
-
-  BgtAcctsRead;
-  BgtDataRead;
-  CBgtTemplatesExpand;
-  SettingsPush; //See SettingsPush
-  AutoComplete;
-  WinBorder;
-  WinMax;
-  MenuPush(
-        "File {"
-        "  Abort(,CH_SHIFT_ESC);"
-        "  Exit(,CH_ESC);"
-        "}"
-        "Edit {"
-        "  NewEntry(,'n');"
-        "  CopyEntry(,'c');"
-        "  PeriodicEntry(,'p');"
-        "  EditEntry(,'\n');"
-        "  DeleteEntry(,CH_CTRLY);"
-        "  NewTemplate(,'t');"
-        "  AcctsFile(,'a');"
-        "}"
-        "View {"
-        "  ViewAcct(,'v');"
-        "}"
-        );
-  StrCpy(view_acct,"BANK");
-  DocMax;
-  old_put        =Fs->put_doc;
-  old_display    =Fs->display_doc;
-  Fs->put_doc    =NULL;
-  Fs->display_doc=NULL;
-  BgtRegen;
-  try
-    if (View) {
-      BgtDataWrite;
-      BgtAcctsWrite;
-    }
-  catch
-    PutExcept;
-
-  pdoc=Fs->put_doc;
-  ddoc=Fs->display_doc;
-  Fs->put_doc    =old_put;
-  Fs->display_doc=old_display;
-  DocDel(pdoc);
-  if (pdoc!=ddoc)
-    DocDel(ddoc);
-
-  SettingsPop;
-  BgtDel;
-  MenuPop;
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtStrs.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtStrs.HC.HTML deleted file mode 100755 index 7eee491..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtStrs.HC.HTML +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - -
-#define SFT_GENERIC     1
-
-public U8 **StrFileRead(U8 *name,I64 *_max_num=NULL,
-        U8 **_colors=NULL,Bool no_nums=FALSE)
-{
-  CDoc          *doc=DocRead(name,DOCF_DBL_DOLLARS|DOCF_NO_CURSOR);
-  CDocEntry     *doc_e=doc->head.next;
-  I64           i,max_num=0;
-  U8            *ptr,**res,*colors;
-
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TEXT) {
-      if (no_nums)
-        i=++max_num;
-      else {
-        i=Str2I64(doc_e->tag,,&ptr);
-        if (i>max_num) max_num=i;
-        if (*ptr==',') ptr++;
-        ptr=StrNew(ptr);
-        Free(doc_e->tag);
-        doc_e->tag=ptr;
-      }
-      doc_e->user_data=i;
-    }
-    doc_e=doc_e->next;
-  }
-
-  res=CAlloc(sizeof(U8 *)*(max_num+1));
-  colors=CAlloc(sizeof(U8)*(max_num+1));
-  doc_e=doc->head.next;
-  while (doc_e!=doc) {
-    if (doc_e->type_u8==DOCT_TEXT && 0<=doc_e->user_data<=max_num) {
-      res[doc_e->user_data]=doc_e->tag;
-      doc_e->tag=NULL;
-      colors[doc_e->user_data]=doc_e->type.u8[1]&15;
-    }
-    doc_e=doc_e->next;
-  }
-
-  DocDel(doc);
-  if (_max_num) *_max_num=max_num;
-  if (_colors)
-    *_colors=colors;
-  else
-    Free(colors);
-  return res;
-}
-
-public U0 StrFileArrDel(U8 **a,I64 max_num)
-{
-  I64 i;
-  for (i=0;i<=max_num;i++)
-    Free(a[i]);
-  Free(a);
-}
-
-public I64 StrFileAdd(U8 *st,I64 *_num,
-        CHashTable *table,I64 color=COLOR_INVALID)
-{
-  CHashGeneric *tmph;
-  if (!st) return 0;
-  if (!(tmph=HashFind(st,table,SFT_GENERIC))) {
-    tmph=CAlloc(sizeof(CHashGeneric));
-    tmph->type=SFT_GENERIC;
-    tmph->str=StrNew(st);
-    tmph->user_data0=(*_num)++;
-    HashAdd(tmph,table);
-  }
-  if (color!=COLOR_INVALID)
-    tmph->user_data1=color;
-  return tmph->user_data0;
-}
-
-I64 StrEntriesCompare(CHashGeneric *h1,CHashGeneric *h2)
-{
-  return h1->user_data0-h2->user_data0;
-}
-
-public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
-{
-  I64 i,j,cnt,color=BLACK;
-  CDoc *doc=DocNew(name);
-  CHashGeneric *tmph,**a;
-  if (table) {
-    cnt=0;      //Count Strings
-    for (i=0;i<=table->mask;i++)
-      cnt+=LinkedLstCnt(table->body[i]);
-    a=MAlloc(cnt*sizeof(CHashGeneric *));
-    j=0;        //Load Strings
-    for (i=0;i<=table->mask;i++) {
-      tmph=table->body[i];
-      while (tmph) {
-        a[j++]=tmph;
-        tmph=tmph->next;
-      }
-    }
-    QSortI64(a,cnt,&StrEntriesCompare);
-    for (i=0;i<cnt;i++) {
-      tmph=a[i];
-      if (tmph->user_data1&15!=color) {
-        DocPrint(doc,"$FG,%d$",tmph->user_data1&15);
-        color=tmph->user_data1&15;
-      }
-      if (no_nums)
-        DocPrint(doc,"%s\n",tmph->str);
-      else
-        DocPrint(doc,"%d,%s\n",tmph->user_data0,tmph->str);
-    }
-    Free(a);
-  }
-  doc->flags|=DOCF_NO_CURSOR;
-  DocWrite(doc);
-  DocDel(doc);
-}
-
-public U0 StrFileDel(CHashTable *table)
-{
-  I64 i;
-  CHashGeneric *tmph,*tmph1;
-  if (!table) return;
-  for (i=0;i<=table->mask;i++) {
-    tmph=table->body[i];
-    while (tmph) {
-      tmph1=tmph->next;
-      Free(tmph->str);
-      Free(tmph);
-      tmph=tmph1;
-    }
-  }
-  Free(table->body);
-  Free(table);
-}
-
- diff --git a/public/Wb/Home/Src/Apps/Budget/BgtTemplate.HC.HTML b/public/Wb/Home/Src/Apps/Budget/BgtTemplate.HC.HTML deleted file mode 100755 index 354c5f3..0000000 --- a/public/Wb/Home/Src/Apps/Budget/BgtTemplate.HC.HTML +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - -
-U0 BgtTemplatePurge(CBgtTemplate *tmpt)
-{
-  CBgtEntry     *tmpb,*tmpb1;
-  tmpb=b_head.next;
-