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 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/BitMaps 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 "*+nnnn", "*-nnnn", "mm/dd", "mm/dd/yy" Str2F64 Funct String to F64. Str2I64 Funct String to I64. Similar to strtoul(). StrScan Funct Opposite of sprintf(). Pass ptrs to data to be scanned-in. ToUpper Funct Cvt char to upper case.
Char/Conversion 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/Define ScanFlags Funct More than 64 flags. Flags passed by ref. StrPrintFlags Funct Only 64 flags. Flags passed by value.
Char/Flags 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/Graphics AreYouSure Funct Print "Are you sure" and waits for Y or N. CKbdStateGlbls Class class CKbdStateGlbls 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. KbdMsEvtTime Funct Timestamp of last key or mouse event. KbdTypeMatic Funct Set speed of repeated keys. 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/Input 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/Lists 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 market 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 Print("") Fmt Strings 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/Operations 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/Output 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.
Char/System 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. TextBorder Funct Plot border square. 30fps in Fs->draw_it() callback. TextChar Funct Plot char. 30fps in Fs->draw_it() callback. TextLenAttr Funct Plot attrs with len. 30fps in Fs->draw_it() callback. TextLenAttrStr Funct Plot attr str with len. 30fps in Fs->draw_it() callback. TextLenStr Funct Plot str with len. 30fps in Fs->draw_it() callback. TextPrint Funct Plot chars. 30fps in Fs->draw_it() callback. TextRect Funct Fill text rect. 30fps in Fs->draw_it() callback.
Char/TextBase Layer