Browse Source

TempleOSCDV4.03.ISO

v6
Terry A. Davis 6 years ago committed by minexew
parent
commit
0f1a4a5d65
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 16
      Adam/ABlkDev/ADskA.CPP
  3. 22
      Adam/ADbg.CPP
  4. 4
      Adam/ADefine.CPP
  5. 6
      Adam/AExts.CPP
  6. 2
      Adam/AMem.CPP
  7. 2
      Adam/AutoComplete/ACInit.CPP
  8. 18
      Adam/AutoComplete/ACTask.CPP
  9. 106
      Adam/DolDoc/DocChar.CPP
  10. 22
      Adam/DolDoc/DocCodeTools.CPP
  11. 11
      Adam/DolDoc/DocEd.CPP
  12. 135
      Adam/DolDoc/DocFile.CPP
  13. 8
      Adam/DolDoc/DocFind.CPP
  14. 56
      Adam/DolDoc/DocForm.CPP
  15. 18
      Adam/DolDoc/DocGr.CPP
  16. 2
      Adam/DolDoc/DocHighlight.CPP
  17. 8
      Adam/DolDoc/DocInit.CPP
  18. 4
      Adam/DolDoc/DocMacro.CPP
  19. 55
      Adam/DolDoc/DocNew.CPP
  20. 43
      Adam/DolDoc/DocPlain.CPP
  21. 38
      Adam/DolDoc/DocPutKey.CPP
  22. 65
      Adam/DolDoc/DocPutS.CPP
  23. 183
      Adam/DolDoc/DocRecalc.CPP
  24. 17
      Adam/DolDoc/DocRecalcLib.CPP
  25. 3
      Adam/DolDoc/DocTerm.CPP
  26. 277
      Adam/DolDoc/DocWidgetWiz.CPP
  27. 2
      Adam/God/GodSong.CPP
  28. 2
      Adam/God/HSNotes.TXT
  29. 1
      Adam/Gr/Gr.HPP
  30. 68
      Adam/Gr/GrBitMap.CPP
  31. 11
      Adam/Gr/GrPrimatives.CPP
  32. 16
      Adam/Gr/GrSpritePlot.CPP
  33. 16
      Adam/Gr/SpriteBitMap.CPP
  34. 749
      Adam/Gr/SpriteEd.CPP
  35. 1774
      Adam/Gr/SpriteMain.CPP
  36. 8
      Adam/Opt/Utils/Find.CPP
  37. 2
      Adam/Opt/Utils/HeapLog.CPP
  38. 1
      Adam/Opt/Utils/MakeUtils.CPP
  39. 4
      Adam/Opt/Utils/MemRep.CPP
  40. 6
      Adam/TaskSettings.CPP
  41. 9
      Adam/WinB.CPP
  42. 10
      Apps/Budget/BgtEntry.CPP
  43. 6
      Apps/Budget/Budget.CPP
  44. 6
      Apps/GrModels/BallGen.CPP
  45. 56
      Apps/GrModels/ManGen.CPP
  46. 2
      Apps/Psalmody/PsalmodyDraw.CPP
  47. 6
      Apps/TimeOut/TimeOut.CPP
  48. 4
      Compiler/CInit.CPP
  49. BIN
      Compiler/Compiler.BIN
  50. 203
      Compiler/Compiler.MAP
  51. 1
      Compiler/CompilerB.HPP
  52. 4
      Compiler/PrsStmt.CPP
  53. 6
      Demo/AcctExample/HomeKeyPlugIns.CPP
  54. 2
      Demo/AcctExample/HomePkgs.CPP
  55. 2
      Demo/AcctExample/HomeSys.CPP
  56. BIN
      Demo/AcctExample/PersonalMenu.TXT
  57. 32
      Demo/AcctExample/PersonalNotes.TXT
  58. 6
      Demo/AcctExample/Registry.CPP
  59. 107
      Demo/AcctExample/TOSBlog.CPP
  60. 5
      Demo/AcctExample/TOSCfg.CPP
  61. 142
      Demo/AcctExample/TOSDistro.CPP
  62. 90
      Demo/AcctExample/TOSHolySpirit.CPP
  63. 45
      Demo/AcctExample/TOSMisc.CPP
  64. 441
      Demo/AcctExample/TOSToHtml.CPP
  65. 4
      Demo/DolDoc/Data.CPP
  66. 23
      Demo/DolDoc/Form.CPP
  67. 4
      Demo/Dsk/DataBase.CPP
  68. 6
      Demo/Games/Digits.CPP
  69. BIN
      Demo/Games/Squirt.CPP
  70. BIN
      Demo/Graphics/Elephant.CPP
  71. 22
      Demo/Lectures/Mem/Mem2Meg.CPP
  72. 1
      Demo/Lectures/Mem/PageTableEntries1.CPP
  73. 0
      Demo/Lectures/Mem/PageTableEntries2.CPP
  74. 15
      Demo/Lectures/Mem/Uncached.CPP
  75. 2
      Demo/SortFileExample/SortedF64.DAT
  76. 20
      Demo/SortFileExample/SortedF64.TXT
  77. 2
      Demo/SortFileExample/UnsortedF64.DAT
  78. 20
      Demo/SortFileExample/UnsortedF64.TXT
  79. 17
      Demo/ToHtmlToTXTExample/HtmlGen.CPP
  80. 57
      Demo/ToHtmlToTXTExample/ToHtml.CPP
  81. 2
      Demo/WebLogExample/access_150212.LOG
  82. 4
      Doc/AboutTempleOS.TXT
  83. 46
      Doc/ChangeLog.TXT
  84. 2
      Doc/Credits.TXT
  85. 6
      Doc/DolDocOverview.TXT
  86. BIN
      Doc/HelpIndex.TXT
  87. 4
      Doc/HolyC.TXT
  88. 6
      Doc/MemOverview.TXT
  89. 2
      Doc/SpriteBitMap.TXT
  90. 8
      Doc/SpriteEd.TXT
  91. 2
      Doc/SpriteSideBar.TXT
  92. BIN
      Doc/TaskSrv.TXT
  93. 4
      Doc/Welcome.TXT
  94. 2
      Doc/Widget.TXT
  95. 4
      HomeKeyPlugIns.CPP
  96. 8
      Kernel/BlkDev/DskDirA.CPP
  97. 8
      Kernel/KEnd.CPP
  98. 5
      Kernel/KInts.CPP
  99. 8
      Kernel/KStart.CPP
  100. 103
      Kernel/KTask.CPP
  101. Some files were not shown because too many files have changed in this diff Show More

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

16
Adam/ABlkDev/ADskA.CPP

@ -67,26 +67,28 @@ public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".")
CDirContext *dirc;
CDirEntry *tempde,*tempde1;
U8 *st;
if (!(tempde=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
return FALSE;
if (IsDir(dst_files_find_mask)) {
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
tempde=tempde1;
while (tempde) {
tempde1=tempde->next;
if (!(tempde->attr & RS_ATTR_DIR)) {
st=FileNameAbs(tempde->name);
if (!CopySingle(tempde->full_name,st))
result=FALSE;
Free(st);
}
DirEntryDel(tempde);
tempde=tempde1;
tempde=tempde->next;
}
DirContextDel(dirc);
}
DirTreeDel(tempde1);
return result;
} else
} else {
DirTreeDel(tempde1);
return CopySingle(src_files_find_mask,dst_files_find_mask);
}
}
public Bool Move(U8 *f1,U8 *f2)
@ -206,8 +208,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
{
CDrv *dv=Let2Drv(*filename);
CDirEntry de;
U8 *cur_dir=StrNew(filename),
buf[STR_LEN];
U8 *cur_dir=StrNew(filename),buf[STR_LEN];
if (FileFind(filename,&de,FUF_JUST_FILES)) {
Free(de.full_name);
if (!StrCmp(attr,"+?"))
@ -226,6 +227,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
}
} else
PrintErr("File not found.\n");
Free(cur_dir);
}
public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?",
U8 *fu_flags=NULL,CDate cdt=MIN_I64)

22
Adam/ADbg.CPP

@ -35,7 +35,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
ptr=*ptr;
if (ChkPtr(ptr)) {
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,64,A=\"%%40ts\"$$\n");
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data=ptr;
DocDataFmt(doc,doc_e);
} else
@ -46,13 +46,13 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) {
if (j==1) {
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=U8,A=\"%%c\"$$\n");
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,64,A=\"%%40ts\"$$\n");
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data=ptr;
DocDataFmt(doc,doc_e);
} else
@ -66,56 +66,56 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
break;
case RT_I8:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=I8,A=\"%%02X\"$$ ");
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,32,RT=U8,A=\"%%02X\"$$ ");
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,32,RT=I16,A=\"%%04X\"$$ ");
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,32,RT=U16,A=\"%%04X\"$$ ");
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,32,RT=I32,A=\"%%08X\"$$ ");
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,32,RT=U32,A=\"%%08X\"$$ ");
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_F64:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=F64,A=\"%%16g\"$$ ");
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,32,A=\"%%016X\"$$ ");
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,A=\"%%016X\"$$ ");
doc_e->data=ptr(I64 *)++;
} else
DocPrint(doc,"%016X ",*ptr(I64 *)++);

4
Adam/ADefine.CPP

@ -11,8 +11,8 @@ U0 LoadDocDefines()
//This is cut and replaced when I generate a distro.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","118,999");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,991");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,687");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,688");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;

6
Adam/AExts.CPP

@ -16,7 +16,7 @@ extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,
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=DOC_RECALC);
extern U0 DocCenter(CDoc *doc=NULL,I64 recalc=RECALCt_NORMAL);
extern U0 DocClear(CDoc *doc=NULL);
extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocD(U8 *buf,I64 cnt=0x80);
@ -25,9 +25,11 @@ 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 DocHelpIndex(CDoc *doc,U8 *index);
extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocInsDoc(CDoc *doc,CDoc *doc2);
extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
extern Bool DocLock(CDoc *doc);
@ -36,7 +38,7 @@ extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
extern CDocEntry *DocPrint(CDoc *doc,U8 *src,...);
extern CDoc *DocPut(CTask *task=NULL);
extern CDoc *DocRead(U8 *name=NULL,I64 flags=0);
extern Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC);
extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL);
extern U0 DocRst(CDoc *doc,Bool is_old);
extern CDocEntry *DocSprite(CDoc *doc,U8 *elems,U8 *fmt=NULL);
extern U0 DocTop(CDoc *doc=NULL);

2
Adam/AMem.CPP

@ -96,7 +96,7 @@ public Bool IsInHeapCtrl(U8 *a,CHeapCtrl *hc,Bool lock=TRUE)
PAUSE
m=hc->next_mem_blk;
while (m!=&hc->next_mem_blk) {
if (a>=m && a<m(U8 *)+m->pages*MEM_PAGE_SIZE) {
if (a>=m && a<m(U8 *)+m->pages<<MEM_PAGE_BITS) {
if (lock)
LBtr(&hc->locked_flags,HClf_LOCKED);
POPFD

2
Adam/AutoComplete/ACInit.CPP

@ -129,6 +129,7 @@ public U0 ACInit(U8 *mask=NULL)
Bool start_flag;
CBlkDev *bd=Let2BlkDev;
LBtr(&sys_run_level,RLf_AUTO_COMPLETE);
AutoComplete;
while (LBts(&ac.flags,ACf_INIT_IN_PROGRESS))
Yield;
@ -155,6 +156,7 @@ public U0 ACInit(U8 *mask=NULL)
ACDWordsLoad;
LBtr(&ac.flags,ACf_INIT_IN_PROGRESS);
LBts(&sys_run_level,RLf_AUTO_COMPLETE);
AutoComplete(ON);
}

18
Adam/AutoComplete/ACTask.CPP

@ -263,16 +263,19 @@ public Bool AutoComplete(Bool val=OFF)
while (Bt(&ac.flags,ACf_INIT_IN_PROGRESS))
Sleep(10);
if (val) {
if (TaskValidate(ac.task))
old_autocomplete=TRUE;
else {
ac.task=Spawn(&ACTask,NULL,"AutoComplete");
TaskWait(ac.task);
if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) {
if (TaskValidate(ac.task))
old_autocomplete=TRUE;
else {
ac.task=Spawn(&ACTask,NULL,"AutoComplete");
TaskWait(ac.task);
}
WinToTop(ac.task);
}
WinToTop(ac.task);
} else {
if (TaskValidate(ac.task)) {
old_autocomplete=TRUE;
if (Bt(&sys_run_level,RLf_AUTO_COMPLETE))
old_autocomplete=TRUE;
Kill(ac.task);
while (TaskValidate(ac.task))
Yield;
@ -280,4 +283,3 @@ public Bool AutoComplete(Bool val=OFF)
}
return old_autocomplete;
}

106
Adam/DolDoc/DocChar.CPP

@ -35,7 +35,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
if (cc>doc_ce->min_col) {
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
dst=doc_ce->tag+cc;
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
doc_ce->max_col=cc;
QueIns(doc_ne,doc_ce);
@ -43,7 +43,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
cc--;
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
dst=doc_ce->tag+cc;
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
doc_ce->max_col=cc;
QueIns(doc_ne,doc_ce);
@ -68,7 +68,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
cc=doc_ce->max_col-1;
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
dst=doc_ce->tag+cc;
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
doc_ce->max_col=cc;
QueIns(doc_ne,doc_ce);
@ -112,7 +112,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
if (cc<doc_ce->max_col) {
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
dst=doc_ce->tag+cc;
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
doc_ce->max_col=cc;
QueIns(doc_ne,doc_ce);
@ -126,7 +126,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
dst=doc_ce->tag+cc;
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
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];
@ -188,7 +188,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
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=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
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;
@ -255,7 +255,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
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=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
if (sc>=0) {
if (sc&SCF_SHIFT)
@ -301,7 +301,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
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=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
*dst=0;
if (sc>=0) {
if (sc&SCF_SHIFT)
@ -362,7 +362,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
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=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
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];
@ -385,7 +385,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
DocUnlock(doc);
}
U0 EdDelChar(CDoc *doc)
U0 EdCharDel(CDoc *doc)
{
Bool unlock=DocLock(doc);
CDocEntry *doc_ce=doc->cur_entry;
@ -435,10 +435,10 @@ U0 ChkDollarBufSize(CDoc *doc)
}
}
U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
{
Bool unlock=DocLock(doc);
U8 *b,*src,*dst;
U8 *st,*src,*dst;
CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
I64 i,j,m,y=doc_ce->y;
@ -470,7 +470,7 @@ U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
}
if (ch=='\r') goto ic_done;
ic_cont:
ic_cont:
if ((ch==CH_SPACE || ch=='\n') &&
!(sc & (SCF_CTRL|SCF_SHIFT)) &&
doc_ce->de_flags &
@ -483,15 +483,16 @@ ic_cont:
goto ic_done;
}
if (doc_ce->type_u8==DOCT_HEX_ED) {
if (doc_ce->de_flags & DOCEF_DATA_IS_PTR)
b=doc_ce->data;
if (doc_ce->de_flags&DOCEF_DEREF_DATA &&
!(doc_ce->de_flags&DOCEF_REMALLOC_DATA))
st=doc_ce->data;
else
b=&doc_ce->data;
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)
b[j-doc_ce->hex_ed_width<<1+m]=ch;
st[j-doc_ce->hex_ed_width<<1+m]=ch;
else {
ch=ToUpper(ch)-'0';
if (ch>9) {
@ -501,16 +502,16 @@ ic_cont:
}
m=j>>1+m;
if (j & 1)
b[m]=b[m] & 0xF0| ch;
st[m]=st[m] & 0xF0| ch;
else
b[m]=b[m] & 0xF | ch<<4;
st[m]=st[m] & 0xF | ch<<4;
}
doc->cur_col++;
goto ic_done;
}
if (doc->flags & DOCF_OVERSTRIKE) {
if (Bt(chars_bmp_displayable,ch)) {
ic_overstrike_char:
ic_overstrike:
if (IsEditableText(doc_ce)) {
if (doc->cur_col<doc_ce->max_col) {
if (doc_ce->tag[doc->cur_col]) {
@ -521,7 +522,7 @@ ic_overstrike_char:
doc_ce=doc_ce->next;
doc->cur_entry=doc_ce;
doc->cur_col=doc_ce->min_col;
goto ic_overstrike_char;
goto ic_overstrike;
}
} else if (doc_ce->type_u8==DOCT_DATA) {
if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) {
@ -532,15 +533,13 @@ ic_overstrike_char:
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;
}
b=MAlloc(2,doc->mem_task);
*b=ch;
b[1]=0;
doc_ne=DocEntryNew(doc,doc_ce,b);
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
QueIns(doc_ne,doc_ce->last);
@ -554,14 +553,14 @@ ic_overstrike_char:
}
goto ic_done;
}
ic_not_overstrike:
if (ch=='\n') {
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
doc_ne->type=DOCT_PAGE_BREAK | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_PAGE_BREAK];
doc_ne=DocEntryNewBase(doc,
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
} else {
doc_ne->type=DOCT_NEW_LINE | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_NEW_LINE];
doc_ne=DocEntryNewBase(doc,
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
}
DocInsEntry(doc,doc_ne);
} else if (ch=='\t') {
@ -575,26 +574,36 @@ ic_form_tab:
DocFormFwd(doc);
goto ic_done;
} else {
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
doc_ne->type=DOCT_TAB | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TAB];
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_root.dft_text_attr<<8);
DocInsEntry(doc,doc_ne);
}
} else {
if (Bt(chars_bmp_displayable,ch)) {
if (doc_ce->type_u8==DOCT_DATA) {
i=doc_ce->len+doc_ce->min_col;
if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR)
i++;
if (i>doc_ce->max_col) {
b=doc_ce->tag;
doc_ce->max_col++;
for (i=doc_ce->max_col;i>doc->cur_col;i--)
b[i]=b[i-1];
b[doc->cur_col++]=ch;
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 $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$
Free(doc_ce->data);
doc_ce->data=MAlloc(doc_ce->len+2,doc->mem_task);
} else
break;
}
} else if (IsEditableText(doc_ce)) {
dst=b=MAlloc(doc_ce->max_col+2,doc->mem_task);
dst=st=MAlloc(doc_ce->max_col+2,doc->mem_task);
src=doc_ce->tag;
i=doc->cur_col;
while (i-->0)
@ -602,14 +611,11 @@ ic_form_tab:
*dst++=ch;
while (*dst++=*src++);
Free(doc_ce->tag);
doc_ce->tag=b;
doc_ce->tag=st;
doc_ce->max_col++;
doc->cur_col++;
} else {
b=MAlloc(2,doc->mem_task);
*b=ch;
b[1]=0;
doc_ne=DocEntryNew(doc,doc_ce,b);
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
doc_ne->x=doc_ce->x+1;
@ -627,7 +633,7 @@ ic_done:
DocUnlock(doc);
}
U0 EdDelLine(CDoc *doc)
U0 EdLineDel(CDoc *doc)
{
CDocEntry *doc_ce=doc->cur_entry,*doc_ce2;
I64 y;

22
Adam/DolDoc/DocCodeTools.CPP

@ -272,7 +272,7 @@ U0 EdRemFunLeadingSpace(CDoc *doc)
do {
doc_e2=doc_e->next;
if (doc_e!=doc && doc_e!=doc->cur_entry &&
!(doc_e->de_flags&(DOCEG1_DONT_EDIT-DOCEF_SCROLLING_X)))
!(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X)))
switch (doc_e->type_u8) {
case DOCT_TEXT:
ptr=doc_e->tag;
@ -511,7 +511,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
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&(DOCEG1_DONT_EDIT-DOCEF_SCROLLING_X))) {
!(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;
@ -520,12 +520,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES;
x=doc_e->x+1;
while (i>8) {
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
doc_ne->type=DOCT_TAB | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TAB];
doc_ne->x=x;
doc_ne->y=doc_e->y;
doc_ne->page_line_num=doc_e->page_line_num;
doc_ne=DocEntryNewBase(doc,
DOCT_TAB|doc->settings_root.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);
@ -536,14 +533,11 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
b=MAlloc(i+1,doc->mem_task);
MemSet(b,CH_SPACE,i);
b[i]=0;
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
doc_ne=DocEntryNewBase(doc,
DOCT_TEXT|doc->settings_root.dft_text_attr<<8,,
x,doc_e->y,doc_e->page_line_num);
doc_ne->tag=b;
doc_ne->max_col=1;
doc_ne->x=x;
doc_ne->y=doc_e->y;
doc_ne->page_line_num=doc_e->page_line_num;
MemCpy(&doc_ne->settings,
&doc_e->settings,sizeof(CDocSettings));
QueIns(doc_ne,doc_e->last);

11
Adam/DolDoc/DocEd.CPP

@ -95,15 +95,16 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=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,TASK_TITLE_LEN);
MemCpy(Fs->task_title,doc->filename.name,STR_LEN-1);
}
doc_e=DocPrint(bdoc,"$$DA-TRM-P+BD+RD+CX+IV,140,A=\"%%s...\",SCX=16$$");
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,32,RT=U32,A=\"Undo:%%03d\"$$\n");
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,RT=U32,A=\"Undo:%%03d\"$$\n");
doc_e->data=&doc->undo_cnt;
DocDataFmt(bdoc,doc_e);
}
@ -124,10 +125,10 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
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,32,A=\"Line:%%04d \"$$");
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,32,A=\"Col:%%04d\"$$\n");
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Col:%%04d\"$$\n");
doc_e->data=&doc->col;
DocDataFmt(bdoc,doc_e);

135
Adam/DolDoc/DocFile.CPP

@ -27,8 +27,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
}
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
DocBinsValidate(doc);
DocTop(doc); //DOCT_CURSOR will set it in recalc
DocRecalc(doc);
DocTop(doc); //Calls $LK,"DocRecalc",A="MN:DocRecalc"$(). DOCT_CURSOR will be set.
if (unlock)
DocUnlock(doc);
}
@ -53,24 +52,27 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
{//Store doc to raw mem buf.
CDocEntry *doc_e;
CDocEntry *doc_e,*doc_e1;
CDocBin *b;
Bool unlock=DocLock(doc);
I64 ch,i,cnt;
I64 ch,cnt=1;//terminator
U8 *st,*result,*dst,*src;
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
DocBinsValidate(doc);
DocRecalc(doc);
if (doc->flags&DOCF_NO_CURSOR || doc->root.next==doc)
cnt=1; //terminator
else
cnt=2; //cursor + terminator
if (doc->flags&DOCF_NO_CURSOR)
DocRecalc(doc);
else {
DocRecalc(doc,RECALCF_ADD_CURSOR);
if (doc->root.next->type_u8==DOCT_CURSOR)
DocEntryDel(doc,doc->root.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
}
for (doc_e=doc->root.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:
@ -81,12 +83,12 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
break;
case DOCT_SOFT_NEW_LINE:
break;
case DOCT_TEXT://$BK,1$Update $LK,"DOCT_TEXT",A="FF:D:/Compiler/Lex.CPP,DOCT_TEXT"$$BK,0$
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)) ||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) ||
doc->flags&DOCF_DBL_DOLLARS)
cnt+=StrOcc(doc_e->tag,'$$');
break;
@ -98,72 +100,57 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
}
}
}
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next) {
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next)
if (b->use_cnt>b->temp_use_cnt)
cnt+=offset(CDocBin.end)-
offset(CDocBin.start)+b->size;
}
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
result=MAlloc(cnt);
dst=result;
for (doc_e=doc->root.next;doc_e!=doc;doc_e=doc_e->next) {
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
if (doc_e->type_u8==DOCT_TEXT &&
!(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;
i=0;
while (ch=*src++) {
if (doc_e==doc->cur_entry && i++==doc->cur_col &&
!(doc->flags&DOCF_NO_CURSOR))
*dst++=CH_CURSOR;
*dst++=ch;
if (ch=='$$') {
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_TABS)) ||
doc->flags&DOCF_DBL_DOLLARS)
*dst++=ch;
}
}
if (doc_e==doc->cur_entry && i++==doc->cur_col &&
!(doc->flags&DOCF_NO_CURSOR))
*dst++=CH_CURSOR;
} else {
if (doc_e==doc->cur_entry && !(doc->flags&DOCF_NO_CURSOR))
doc_e=doc->root.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;
switch (doc_e->type_u8) {
case DOCT_TAB:
*dst++='\t';
break;
case DOCT_PAGE_BREAK:
*dst++=CH_FORM_FEED;
break;
case DOCT_NEW_LINE:
if (doc->flags&DOCF_CARRIAGE_RETURN)
*dst++='\r';
*dst++='\n';
break;
case DOCT_SOFT_NEW_LINE:
break;
case DOCT_TAB:
*dst++='\t';
break;
case DOCT_PAGE_BREAK:
*dst++=CH_FORM_FEED;
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);
}
}
default:
*dst++='$$';
st=Doc2PlainText(doc,doc_e);
StrCpy(dst,st);
dst+=StrLen(st);
*dst++='$$';
Free(st);
}
}
doc_e=doc_e1;
}
if (doc->cur_entry==doc && doc->root.next!=doc &&
!(doc->flags&DOCF_NO_CURSOR))
*dst++=CH_CURSOR;
*dst++=0;
if (*result==CH_CURSOR) {
MemCpy(result,result+1,dst-result-1);
cnt--;
dst--;
}
b=doc->bin_root.next;
if (b!=&doc->bin_root) {
do {
@ -210,7 +197,7 @@ public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
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=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
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;
@ -258,7 +245,7 @@ public U0 StreamDoc(CDoc *doc)
Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
{
Bool result=FALSE,unlock;
I64 time_stamp;
I64 time_stamp,flags;
CDocUndo *u;
if (doc->flags&DOCF_ALLOW_UNDO) {
unlock=DocLock(doc);
@ -268,7 +255,10 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
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_root.last);
doc->flags&=~DOCF_UNDO_DIRTY;
doc->undo_cnt++;
@ -291,8 +281,9 @@ U0 DocUndoRestore(CDoc *doc)
u_last=doc->undo_root.last;
QueInit(&doc->undo_root);
DocRst(doc,TRUE);
doc->flags=u->doc_flags;
doc->flags=u->doc_flags&~DOCF_NO_CURSOR;
DocLoad(doc,u->body,u->size);
doc->flags=u->doc_flags;
DocUndoDel(doc,u);
doc->undo_root.next=u_next;
doc->undo_root.last=u_last;

8
Adam/DolDoc/DocFind.CPP

@ -7,7 +7,7 @@ public Bool DocLineNumGoTo(CDoc *doc,I64 line_num) //one based
unlock=DocLock(doc);
doc->x=0;
doc->y=line_num-1;
DocRecalc(doc,FALSE,DOC_RECALC_FIND_CURSOR);
DocRecalc(doc,RECALCt_FIND_CURSOR);
DocCenter(doc);
if (doc->cur_entry->y==line_num-1)
result=TRUE;
@ -105,7 +105,7 @@ public U0 EdFindNext(CDoc *doc)
do {
if (doc_e!=doc) {
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
!(doc_e->de_flags&(DOCEG1_DONT_EDIT|DOCEF_FILTER_SKIP))) {
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
if (doc_e->type & DOCET_SELECTED ||
!doc->find_replace->scan_selected_text) {
if (doc->find_replace->scan_fwd) {
@ -473,7 +473,7 @@ I64 EdFindReplace(CDoc *doc)
break;
}
if (doc_e->type_u8==DOCT_TEXT &&
!(doc_e->de_flags&(DOCEG1_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
(doc_e->type & DOCET_SELECTED ||
!doc->find_replace->scan_selected_text&&
!doc->find_replace->local_var)) {
@ -571,7 +571,7 @@ Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
class CEdLineGoTo
{
I64 line fmtstr "$$DA,256,A=\"Go to Line:%d\"$$";
I64 line fmtstr "$$DA,A=\"Go to Line:%d\"$$";
};
U0 EdGoToLine(CDoc *doc)

56
Adam/DolDoc/DocForm.CPP

@ -59,12 +59,13 @@ U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE)
U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
{
I64 i;
U8 *ptr;
U8 *ptr,*ptr2;
CHashDefineStr *temph;
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_DATA_IS_PTR) {
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;
@ -81,13 +82,32 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
}
}
if (doc_e->type_u8==DOCT_DATA) {
StrPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data);
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) {
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 $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,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=StrLen(doc_e->tag);
doc_e->max_col=i;
} else if (doc_e->de_flags & DOCEF_LST) {
if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str,
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<temph->cnt) {
@ -115,7 +135,8 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
CHashDefineStr *temph;
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_DATA_IS_PTR) {
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;
@ -130,7 +151,14 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
doc_e->tag[i]='_';
} else if (RT_I64<=doc_e->raw_type<=RT_UF64) {
StrScan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data);
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;
@ -201,7 +229,11 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
while (ml) {
if (fmtstr=MemberMetaData("fmtstr",ml)) {
doc_e=DocPrint(doc,"%s",fmtstr);
doc_e->data=_d+ml->offset;
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("fmtdata",ml);
DocDataFmt(doc,doc_e);
}
@ -221,6 +253,14 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
}
}
}
doc_e=doc->root.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 result;

18
Adam/DolDoc/DocGr.CPP

@ -53,16 +53,16 @@ public I64 PopUpColorLighting(U8 *header=NULL)
class CTransformForm
{
F64 x_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"X Scale :%12.6f\"$$\n";
F64 y_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"Y Scale :%12.6f\"$$\n";
F64 z_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"Z Scale :%12.6f\"$$\n";
F64 x_scale fmtstr "$$DA-TRM,RT=F64,A=\"X Scale :%12.6f\"$$\n";
F64 y_scale fmtstr "$$DA-TRM,RT=F64,A=\"Y Scale :%12.6f\"$$\n";
F64 z_scale fmtstr "$$DA-TRM,RT=F64,A=\"Z Scale :%12.6f\"$$\n";
F64 é_z fmtstr
"\nAngles are in degrees\n$$DA-TRM,32,RT=F64,A=\"Z-Axis :%12.6f\"$$\n";
F64 é_y fmtstr "$$DA-TRM,32,RT=F64,A=\"Y-Axis :%12.6f\"$$\n";
F64 é_x fmtstr "$$DA-TRM,32,RT=F64,A=\"X-Axis :%12.6f\"$$\n";
F64 x_offset fmtstr "\n$$DA-TRM,32,RT=F64,A=\"X Offset:%12.6f\"$$\n";
F64 y_offset fmtstr "$$DA-TRM,32,RT=F64,A=\"Y Offset:%12.6f\"$$\n";
F64 z_offset fmtstr "$$DA-TRM,32,RT=F64,A=\"Z Offset:%12.6f\"$$\n";
"\nAngles are in degrees\n$$DA-TRM,RT=F64,A=\"Z-Axis :%12.6f\"$$\n";
F64 é_y fmtstr "$$DA-TRM,RT=F64,A=\"Y-Axis :%12.6f\"$$\n";
F64 é_x fmtstr "$$DA-TRM,RT=F64,A=\"X-Axis :%12.6f\"$$\n";
F64 x_offset fmtstr "\n$$DA-TRM,RT=F64,A=\"X Offset:%12.6f\"$$\n";
F64 y_offset fmtstr "$$DA-TRM,RT=F64,A=\"Y Offset:%12.6f\"$$\n";
F64 z_offset fmtstr "$$DA-TRM,RT=F64,A=\"Z Offset:%12.6f\"$$\n";
};
Bool PopUpTransform(I64 *r)

2
Adam/DolDoc/DocHighlight.CPP

@ -1,7 +1,7 @@
#help_index "DolDoc/Misc"
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
{//Be aware of $LK,"::/Adam/Opt/Utils/ToHtml.CPP"$.
{//Be aware of $LK,"::/Demo/ToHtmlToTXTExample/ToHtml.CPP"$.
U32 *result=MAlloc((len+1)*sizeof(U32)),*dst=result;
U8 *ptr;
CDocSettings *s=&doc_e->settings;

8
Adam/DolDoc/DocInit.CPP

@ -11,11 +11,11 @@ U0 DocInit()
"BG\0FD\0BD\0PT\0WW\0UL\0IV\0BK\0SX\0SY\0CM\0AN\0LK\0BT\0"
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HL\0HC\0ER\0");
DefineLstLoad("ST_DOC_FLAGS",
"T\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
"LC\0LA\0RC\0RA\0TC\0LX\0CX\0RX\0TY\0CY\0BY\0"
"T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
"LC\0LA\0RC\0RA\0LX\0CX\0RX\0TY\0CY\0BY\0"
"HL\0WW\0BK\0IV\0SEL\0UL\0"
"PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0UD\0P\0TRM\0Z\0H\0"
"TR\0LS\0SK\0PU\0SIF\0FS\0NC\0DD\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\0");
DefineLstLoad("ST_LINK_TYPES",
"FI\0FA\0FF\0FL\0MN\0PI\0PF\0PL\0BF\0DN\0HI\0AD\0AI\0AA\0AF\0AL\0");

4
Adam/DolDoc/DocMacro.CPP

@ -141,11 +141,11 @@ I64 PopUpMacroMenu()
U8 buf[STR_LEN];
CSrvCmd *tempc;
CDoc *doc=DocNew;
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,STR_LEN-1,A=\"Name:%%s\"$$");
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,32,A=\"Repeat N:%%d\"$$");
doc_e=DocPrint(doc,"\n$$DA,A=\"Repeat N:%%d\"$$");
doc_e->data=&sys_macro_repeat_n;
DocDataFmt(doc,doc_e);

55
Adam/DolDoc/DocNew.CPP