Char

CTextGlbls Class class CTextGlbls TEXT_COLS DefineStr HashPublic("TEXT_COLS",HTT_DEFINE_STR);;; TEXT_ROWS DefineStr HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;; text GlbVar CTextGlbls text;

Char/BitMaps

char_bmp_alpha GlbVar char_bmp_alpha[16]= char_bmp_alpha_numericGlbVar char_bmp_alpha_numeric[16]= char_bmp_alpha_numeric_no_atGlbVar char_bmp_alpha_numeric_no_at[16]= char_bmp_dec_numericGlbVar char_bmp_dec_numeric[16]= char_bmp_displayableGlbVar char_bmp_displayable[16]= char_bmp_filename GlbVar char_bmp_filename[16]= char_bmp_hex_numericGlbVar char_bmp_hex_numeric[16]= char_bmp_macro GlbVar char_bmp_macro[16]= char_bmp_non_eol GlbVar char_bmp_non_eol[16]= char_bmp_non_eol_white_spaceGlbVar char_bmp_non_eol_white_space[16]= char_bmp_printable GlbVar char_bmp_printable[16]= char_bmp_safe_dollarGlbVar char_bmp_safe_dollar[16]= char_bmp_white_spaceGlbVar char_bmp_white_space[16]= char_bmp_word GlbVar char_bmp_word[16]= char_bmp_zero_cr_nl_cursorGlbVar char_bmp_zero_cr_nl_cursor[16]= char_bmp_zero_tab_cr_nl_cursorGlbVar char_bmp_zero_tab_cr_nl_cursor[16]= char_bmp_zero_tab_cr_nl_cursor_dollarGlbVar char_bmp_zero_tab_cr_nl_cursor_dollar[16]=

Char/Conversion

Char2KeyName Funct ASCII val to key name. Char2ScanCode Funct ASCII val to scan code (Slow). ScanCode2Char Funct Scan code to ASCII val. ScanCode2KeyName Funct Scan code to key name. Str2Date Funct { Str2F64 Funct { Str2I64 Funct String to I64. Similar to strtoul(). StrScan Funct { ToLower Funct Basic lower case conversion implementation ToUpper Funct Cvt char to upper case.

Char/Define

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. Define Funct Look for DEFINE named in hash table, return ptr string. DefineCnt Funct Return cnt of entries in define list. DefineLoad Funct Create DEFINE hash entry with string. DefineLstLoad Funct Create DEFINE list. Not efficient, but handy. DefineMatch Funct Find match for string in define list. DefinePrint Funct Create DEFINE entry with Print()ed string. DefineSub Funct Return DEFINE list entry indexed by number. HashDefineLstAdd Funct Add define list to a hash table. See ::/Adam/DolDoc/DocInit.HC. PopUpPickDefineSub Funct Prompt for Define lst entry in PopUp win task.

Char/Flags

ScanFlags Funct { StrPrintFlags Funct Only 64 flags. Flags passed by value. print_all will print false flags using `-`.

Char/Graphics

GrPrint Funct 2D. Clipping but not transformation. GrPrint3 Funct 3D. Transformation. DCF_SYMMETRY is silly. GrPutChar Funct 2D. Clipping but not transformation. GrPutChar3 Funct 3D. Transformation. DCF_SYMMETRY is silly. GrTextBox3 Funct 3D. Transformation. DCF_SYMMETRY is silly. GrTextDiamond3 Funct 3D. Transformation. DCF_SYMMETRY is silly. GrVPrint Funct 2D. Vertical text. Clipping but not transformation. GrVPrint3 Funct 3D. Vertical text. Transformation. DCF_SYMMETRY is silly.

Char/Input

AreYouSure Funct Print "Are you sure" and waits for Y or N. CKbdStateGlbls Class class CKbdStateGlbls DisableMouse Funct { EnableMouse Funct { GetChar Funct Waits for non-zero ASCII key. GetDate Funct Prompt user for date expression. (Use Now() if you want current time.) GetF64 Funct Prompt user for F64 expression. GetI64 Funct Prompt user for I64 expression. GetKey Funct Waits for MSG_KEY_DOWN message and returns ASCII. GetS Funct Prompt into fixed length string. Size must include terminator. GetStr Funct Returns a MAlloc()ed prompted string. See Flags. KbdCmdFlush Funct { KbdCmdRead Funct { KbdCmdSend Funct { KbdMsCmdAck Funct { KbdMsEvtTime Funct Timestamp of last key or mouse event. KbdPktInject Funct Inject a 1 or 2 byte keyboard packet from an external non-PS/2 source KbdTypeMatic Funct Set speed of repeated keys. MsHardHndlr Funct { MsHardRst Funct { MsPktInject Funct Inject a mouse packet from an external non-PS/2 source MsRaw Funct Places mouse in "raw" mode, button presses will not go to windows manager when true MsRawRst Funct { PressAKey Funct Print "Press a key" and wait for non-zero ASCII key. ScanChar Funct Checks for MSG_KEY_DOWN and returns 0 immediately if no key. ScanKey Funct Checks for MSG_KEY_DOWN and returns FALSE immediately if no key. YorN Funct Wait for user to answer Y or N. kbd GlbVar CKbdStateGlbls kbd;

Char/Lists

DefineCnt Funct Return cnt of entries in define list. DefineLstLoad Funct Create DEFINE list. Not efficient, but handy. DefineMatch Funct Find match for string in define list. DefineSub Funct Return DEFINE list entry indexed by number. HashDefineLstAdd Funct Add define list to a hash table. See ::/Adam/DolDoc/DocInit.HC. HashLstAdd Funct Add a list to a hash table. LstMatch Funct -2 if Ambiguous LstSub Funct Point to lst entry. PopUpPickDefineSub Funct Prompt for Define lst entry in PopUp win task. PopUpPickLst Funct Prompt for lst entry in PopUp win task.

Char/Operations

AStrNew Funct Alloc copy of string in Adam's heap. CatPrint Funct StrCat(). See StrPrintJoin(). MStrPrint Funct MAlloc StrPrint. See StrPrintJoin(). MStrUtil Funct MAlloc StrUtil(). ScaleIndent Funct MAlloced str. 8*0.25-->2 or 8*2.0-->16 Spaces2Tabs Funct Src buf with spaces to dst buf without. StrCmp Funct Compare two strings. StrCpy Funct Copy string. StrFind Funct Find needle_str in haystack_str with options. StrFirstOcc Funct Point to 1st occurrence of marker set in str. StrFirstRem Funct Remove first str segment and place in dst buf or NULL. StrICmp Funct Compare two strings, ignoring case. StrIMatch Funct Scan for string in string, ignoring case. StrLastOcc Funct Point to last occurrence of marker set in str. StrLastRem Funct Remove last str segment and place in dst buf or NULL. StrLen Funct String length. StrMatch Funct Scan for string in string. StrNCmp Funct Compare N bytes in two strings. StrNICmp Funct Compare N bytes in two strings, ignoring case. StrNew Funct Accepts a CTask or CHeapCtrl. NULL allocs off current task's heap. StrOcc Funct Count occurrences of a char. StrPrint Funct See StrPrintJoin(). StrPrintJoin Funct { StrReplace Funct Replace all instances of old with new in str. free_str aids in chain replacement. StrUtil Funct Modifies in place. See flags for all the options. Tabs2Spaces Funct MAlloc str with tabs to spaces. WildMatch Funct Wildcard match with '*' and '?'.

Char/Output

GetOutOfDollar Funct If a $ has been printed, print another $ to exit mode. IsSilent Funct Return StdOut turned-off? Print Funct Print("") Fmt Strings. See StrPrintJoin(). PrintErr Funct Print "Err:" and msg in blinking red. PrintWarn Funct Print "Warn:" and msg in blinking red. PutChars Funct Output chars. Up to 8 chars in a single U64. PutKey Funct See Keyboard Devices. Silent Funct Turn-off StdOut console text. (Not sound.)

Char/System

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. CtrlAltCBSet Funct Set callback for <CTRL-ALT-letter>. KeyDescSet Funct Call this from key hndlr to report desc in KeyMap(). KeyDevAdd Funct Places hook in StdOut chain. See Keyboard Devices. KeyDevRem Funct Remove StdOut hook and free.