TempleOSCDV4.02.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:54 +02:00
1 parent fedf66361e
commit 1541d7328d
171 files changed
+5326 -5237

No files matched your search

+1 -1
View File
@@ -462,7 +462,7 @@ U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
} else
goto ic_done;
}
if (ch=='$$' && !(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))) {
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;
+20 -27
View File
@@ -25,7 +25,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
doc->cur_bin_num=tempb->num+1;
}
}
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS)))
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
DocBinsValidate(doc);
DocTop(doc); //DOCT_CURSOR will set it in recalc
DocRecalc(doc);
@@ -59,14 +59,13 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
I64 ch,i,cnt;
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_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS)))
DocBinsValidate(doc);
DocRecalc(doc);
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) {
@@ -80,27 +79,22 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
else
cnt++;
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$
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_WITH_TABS)) ||
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_TABS)) ||
doc->flags&DOCF_DBL_DOLLARS)
cnt+=StrOcc(doc_e->tag,'$$');
} else {
st=Doc2PlainText(doc,doc_e);
cnt+=StrLen(st)+2;
Free(st);
break;
}
break;
default:
if (doc_e->type_u8!=DOCT_SOFT_NEW_LINE &&
doc_e->type_u8!=DOCT_CURSOR) {
st=Doc2PlainText(doc,doc_e);
cnt+=StrLen(st)+2;
Free(st);
}
st=Doc2PlainText(doc,doc_e);
cnt+=StrLen(st)+2;
Free(st);
}
}
}
@@ -125,7 +119,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
*dst++=CH_CURSOR;
*dst++=ch;
if (ch=='$$') {
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_WITH_TABS)) ||
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_TABS)) ||
doc->flags&DOCF_DBL_DOLLARS)
*dst++=ch;
}
@@ -148,16 +142,15 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
*dst++='\r';
*dst++='\n';
break;
case DOCT_SOFT_NEW_LINE:
break;
default:
if (doc_e->type_u8!=DOCT_SOFT_NEW_LINE &&
doc_e->type_u8!=DOCT_CURSOR) {//(Cursor is set by cur_entry)
*dst++='$$';
st=Doc2PlainText(doc,doc_e);
StrCpy(dst,st);
dst+=StrLen(st);
*dst++='$$';
Free(st);
}
*dst++='$$';
st=Doc2PlainText(doc,doc_e);
StrCpy(dst,st);
dst+=StrLen(st);
*dst++='$$';
Free(st);
}
}
}
+1 -1
View File
@@ -17,7 +17,7 @@ U0 DocInit()
"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");
DefineLstLoad("ST_LINK_TYPES",
"FI\0FA\0FF\0FL\0MN\0PI\0PF\0PL\0BF\0DF\0HI\0AD\0AI\0AA\0AF\0AL\0");
"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);
+7 -7
View File
@@ -13,8 +13,8 @@
"PF:haystack_filename,needle_str:occurnum"
"PL:filename,linenum"
"BF:haystack_bible_book,needle_str"
"DF:word"
"DF:word,defnum"
"DN:word"
"DN:word,defnum"
"HI:index"
"AD:code_address_number"
@@ -67,7 +67,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
try {
switch (type) {
case LK_PLAIN:
flags=DOCF_PLAIN_TEXT;
flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
case LK_DOC:
type=LK_FILE;
break;
@@ -75,17 +75,17 @@ Bool DocFileEd(I64 _type,U8 *filename,
type=LK_FILE_ANCHOR;
break;
case LK_PLAIN_FIND:
flags=DOCF_PLAIN_TEXT;
flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
case LK_DOC_FIND:
type=LK_FILE_FIND;
break;
case LK_PLAIN_LINE:
flags=DOCF_PLAIN_TEXT;
flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
case LK_DOC_LINE:
type=LK_FILE_LINE;
break;
case LK_BIBLE_FIND:
flags=DOCF_PLAIN_TEXT;
flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
break;
}
@@ -309,7 +309,7 @@ public Bool DocLinkChk(U8 *link_st)
result=TRUE;
Free(st);
break;
default://TODO: Need to validate HI: and DF:
default://TODO: Need to validate HI: and DN:
if (Ed(link_st,EDF_BAIL))
result=TRUE;
}
+9 -11
View File
@@ -12,11 +12,9 @@ U0 SysMacroStripKey(CSrvCmd *macro_root,I64 a1,I64 a2)
while (tempc!=macro_root) {
tempc1=tempc->next;
if (tempc->cmd_code==SVCT_MSG &&
(tempc->msg_code==MSG_KEY_DOWN ||
tempc->msg_code==MSG_KEY_UP ||
(tempc->msg_code==MSG_KEY_DOWN || tempc->msg_code==MSG_KEY_UP ||
tempc->msg_code==MSG_KEY_DOWN_UP) &&
a1 && tempc->aux1==a1 ||
!a1 && tempc->aux2==a2) {
a1 && tempc->aux1==a1 || !a1 && tempc->aux2==a2) {
QueRem(tempc);
SrvCmdDel(tempc);
}
@@ -161,15 +159,15 @@ I64 PopUpMacroMenu()
"\n\n\n$$GREEN$$SHIFT-F2$$FG$$ will play macro.\n");
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
StrPrint(buf,"DocMenu(%d);",doc);
sys_macro_util_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
Fs->popup_task=sys_macro_util_task;
LBts(&sys_macro_util_task->display_flags,DISPLAYf_WIN_ON_TOP);
tempc=TaskExe(sys_macro_util_task,Fs,buf,
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);
tempc=TaskExe(sys_macro_task,Fs,buf,
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
JobResultScan(tempc,&result);
Fs->popup_task=NULL;
Kill(sys_macro_util_task);
sys_macro_util_task=NULL;
Kill(sys_macro_task);
sys_macro_task=NULL;
DocDataScan(doc,doc_e);
DocDel(doc);
return result;
@@ -208,6 +206,6 @@ U0 MacroTask(I64)
U0 EdMacroUtil()
{
if (!sys_macro_util_task)
if (!sys_macro_task)
Spawn(&MacroTask,NULL,"Macro");
}
+4 -3
View File
@@ -497,7 +497,7 @@ U0 DocEntryToggle(CDoc *doc)
U8 ch,*st,*st2;
I64 i,j,k;
if (doc_ce!=doc &&
!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))) {
!(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)) &&
@@ -593,7 +593,7 @@ U0 DocFlagsToggle(CDoc *doc,I64 tog_flags)
U8 *st;
CDocUndo *u_next,*u_last;
doc->flags|=DOCF_COLOR_NAMES;
doc->flags=doc->flags&~DOCF_NO_CURSOR|DOCF_COLOR_NAMES;
st=DocSave(doc,&size);
u_next=doc->undo_root.next;
@@ -604,8 +604,9 @@ U0 DocFlagsToggle(CDoc *doc,I64 tog_flags)
doc->undo_root.next=u_next;
doc->undo_root.last=u_last;
DocUndoCntSet(doc);
doc->flags=flags & ~(DOCG_BL_IV_UL|DOCF_WORD_WRAP);
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);
+1 -1
View File
@@ -15,7 +15,7 @@ U0 PopUpViewPrintEndCB()
}
public CTask *PopUpViewPrint(U8 *fmt,...)
{//View Print statement in PopUp win task.
{//View Print stmt in PopUp win task.
CTask *task;
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
CDoc *doc=DocNew;
+5 -5
View File
@@ -253,8 +253,8 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
} else {
DocUnlock(doc);
if (sc&SCF_SHIFT) {
if (TaskValidate(sys_macro_util_task))
PostMsgWait(sys_macro_util_task,
if (TaskValidate(sys_macro_task))
PostMsgWait(sys_macro_task,
MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0);
SysMacroStripKey(&sys_macro_root,ch,sc);
PlaySysMacro;
@@ -557,7 +557,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Sprite Graphic Resource");
else {
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))) {
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
DocUnlock(doc);
if (doc_ce->type_u8==DOCT_SPRITE)
EdSpriteEd(doc,
@@ -577,7 +577,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Find Misspelled");
else
ACFindMisspelled(doc);
ACMisspelledFind(doc);
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Save");
@@ -596,7 +596,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
KeyDescSet("Edit/Toggle Plain Text Display");
else
if (!(doc->flags&DOCF_FORM) ||
doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))
doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
}
break;
+1 -1
View File
@@ -12,7 +12,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
if (!st || !doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
return NULL;
unlock=DocLock(doc);
if (doc->flags & DOCF_PLAIN_TEXT_WITH_TABS)
if (doc->flags & DOCF_PLAIN_TEXT_TABS)
char_bitmap=chars_bmp_zero_cr_nl_cursor;
else if (doc->flags & DOCF_PLAIN_TEXT)
char_bitmap=chars_bmp_zero_tab_ff_cr_nl_cursor;
+1 -1
View File
@@ -329,7 +329,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
}
best_doc_e=doc->cur_entry;
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS)) &&
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) &&
FilesFindMatch(doc->filename.name,FILEMASK_SRC))
doc->flags|=DOCF_HIGHLIGHT;
else
+3 -15
View File
@@ -182,27 +182,15 @@ public I64 DocMax(I64 i=MAX_I64)
#help_index "DolDoc/Task;StdOut/Task"
U0 DocUpdateTaskDocs(CTask *task)
{//This is called from $LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() by the winmgr at 30fps.
CDrv *dv;
CDoc *doc;
CD3I64 saved_scroll;
I64 border_attr;
if (task->border_src==BDS_CUR_DRV && task->cur_dv) {
border_attr=task->cur_dv->text_attr;
if (border_attr&15!=border_attr>>4)
task->border_attr=border_attr;
}
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)
try {
if (dv=Let2Drv(*doc->filename.name)) {
border_attr=dv->text_attr;
if (border_attr&15!=border_attr>>4)
task->border_attr=border_attr;
}
} catch
Fs->catch_except=TRUE;
task->border_attr=DrvTextAttrGet(*doc->filename.name);
if (task->title_src==TTS_ED_FILENAME)
MemCpy(task->task_title,doc->filename.name,TASK_TITLE_LEN);
DocRecalc(doc,TRUE,DOC_RECALC_TO_SCREEN);
+24 -17
View File
@@ -296,9 +296,9 @@ Bool GetLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,
else
*_tag=StrNew(e->tag);
if (e->num<0)
*_link=MStrPrint("DF:%s",e->aux);
*_link=MStrPrint("DN:%s",e->aux);
else
*_link=MStrPrint("DF:%s,%d",e->aux,e->num);
*_link=MStrPrint("DN:%s,%d",e->aux,e->num);
}
break;
@@ -906,7 +906,7 @@ U0 EdInsHexEd()
Free(e);
}
class CEdBinary
class CEdBin
{
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
I64 bin_num fmtstr "$$DA,512,A=\"Bin Num:%d\"$$\n";
@@ -915,9 +915,9 @@ class CEdBinary
U8 bin_ptr_link_tag[512] fmtstr "$$DA-P,511,A=\"File Bin Tag:%s\"$$\n";
};
U0 EdInsBinary(I64 bin_num,I64 type)
U0 EdInsBin(I64 bin_num,I64 type)
{
CEdBinary *e=CAlloc(sizeof(CEdBinary));
CEdBin *e=CAlloc(sizeof(CEdBin));
StrPrint(e->tag,"<%d>",bin_num);
e->bin_num=bin_num;
e->bin_ptr_link_bin_num=1;
@@ -1036,15 +1036,22 @@ 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.TXT.Z\"$$\n"
"\n$$LTBLUE$$$$MU,\"Make Sprite\",LE=EST_SPRITE$$\n"
"$$MU,\"Pointer to Sprite\",LE=EST_SPRITE_PTR$$\n"
"$$MU,\"Duplicate Sprite\",LE=EST_DUP_SPRITE$$\n"
"$$MU,\"Sprite Size (not really needed)\",LE=EST_SPRITE_SIZE$$\n"
"$$MU,\"Sprite Macro (Icon)\",LE=EST_SPRITE_MACRO$$\n"
"$$MU,\"Sprite Menu Item\",LE=EST_SPRITE_MENU$$\n"
"$$MU,\"Sprite Link\",LE=EST_SPRITE_LINK$$\n"
"\n$$MU,\"Abort\",LE=DOCM_CANCEL$$\n\n");
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/Resource.TXT.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;
@@ -1123,13 +1130,13 @@ U8 *EdSprite(I64 bin_num)
CatPrint(buf,"+PU");
break;
case EST_SPRITE_PTR:
EdInsBinary(--bin_num,DOCT_INS_BINARY);
EdInsBin(--bin_num,DOCT_INS_BIN);
break;
case EST_SPRITE_SIZE:
EdInsBinary(--bin_num,DOCT_INS_BINARY_SIZE);
EdInsBin(--bin_num,DOCT_INS_BIN_SIZE);
break;
case EST_DUP_SPRITE:
EdInsBinary(--bin_num,DOCT_SPRITE);
EdInsBin(--bin_num,DOCT_SPRITE);
break;
}
if (st1) {