TempleOSCDV4.12.ISO
This commit is contained in:
1 parent
93ca216483
commit
b84bbff6db
381 files changed
+18356
-18798
No files matched your search
+16
-16
@@ -34,7 +34,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b->use_cnt=0;
|
||||
b->temp_use_cnt=0;
|
||||
b->tmp_use_cnt=0;
|
||||
b->renum_num=-1;
|
||||
Free(b->tag);
|
||||
b->tag=NULL;
|
||||
@@ -46,7 +46,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
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->temp_use_cnt=MAX_I32;
|
||||
b->tmp_use_cnt=MAX_I32;
|
||||
if (!b->use_cnt++)
|
||||
b->renum_num=++renum_num;
|
||||
doc_e->bin_num=b->renum_num;
|
||||
@@ -98,7 +98,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
{
|
||||
U8 *st,*st2;
|
||||
CDoc *doc2;
|
||||
CDocBin *tempb,*tempb2;
|
||||
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)) {
|
||||
@@ -109,26 +109,26 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
i=Str2I64(st2);
|
||||
if (i>0||*st2) {
|
||||
doc2=DocRead(st);
|
||||
if (i>0 && (tempb2=DocBinFindNum(doc2,i)) ||
|
||||
i==0 && (tempb2=DocBinFindTag(doc2,st2))) {
|
||||
if (i>0 && (tmpb2=DocBinFindNum(doc2,i)) ||
|
||||
i==0 && (tmpb2=DocBinFindTag(doc2,st2))) {
|
||||
i=1;
|
||||
if (bin_num>0) {
|
||||
if (tempb=DocBinFindNum(doc,bin_num)) {
|
||||
i=tempb->use_cnt;
|
||||
DocBinDel(doc,tempb);
|
||||
if (tmpb=DocBinFindNum(doc,bin_num)) {
|
||||
i=tmpb->use_cnt;
|
||||
DocBinDel(doc,tmpb);
|
||||
}
|
||||
} else
|
||||
bin_num=doc->cur_bin_num++;
|
||||
tempb=MAllocIdent(tempb2,doc->mem_task);
|
||||
tempb->use_cnt=i;
|
||||
tempb->data=MAllocIdent(tempb2->data,doc->mem_task);
|
||||
tempb->num=bin_num;
|
||||
doc_e->bin_data=tempb;
|
||||
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)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
tmpb->tag=NULL;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
} else
|
||||
bin_num=0;
|
||||
DocDel(doc2);
|
||||
|
||||
@@ -344,7 +344,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
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_invisible,doc_ce2->type_u8)) && sc>=0)
|
||||
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;
|
||||
@@ -455,7 +455,7 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
} else {
|
||||
doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
||||
doc->flags&=~DOCF_IN_DOLLAR;
|
||||
DocPrint(doc,doc->dollar_buf);
|
||||
DocPrint(doc,"%s",doc->dollar_buf);
|
||||
doc->dollar_buf_ptr=0;
|
||||
goto ic_done;
|
||||
}
|
||||
@@ -475,8 +475,8 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
!(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_AUTO |
|
||||
DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_AUTO)) {
|
||||
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);
|
||||
|
||||
+30
-30
@@ -66,7 +66,7 @@ I64 EdRILex(CRILex *rx)
|
||||
{
|
||||
rx->is_not_cont=FALSE;
|
||||
I64 i;
|
||||
CLexFile *tempf;
|
||||
CLexFile *tmpf;
|
||||
do {
|
||||
Lex(rx->cc1);
|
||||
Lex(rx->cc2);
|
||||
@@ -77,10 +77,10 @@ I64 EdRILex(CRILex *rx)
|
||||
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)) {
|
||||
tempf=rx->cc2->lex_include_stk;
|
||||
while (tempf->next)
|
||||
tempf=tempf->next;
|
||||
QueVectU8Put(rx->indent,tempf->cur_entry->y,rx->depth+rx->one_shot);
|
||||
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')
|
||||
@@ -346,7 +346,7 @@ I64 EdRAGetU8(CDoc *doc)
|
||||
U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
{
|
||||
I64 ch,i;
|
||||
CRenum *tempr;
|
||||
CRenum *tmpr;
|
||||
U8 buf[sizeof(CEdFindText.find_text)];
|
||||
ch=EdRAGetU8(doc);
|
||||
while (ch>=0) {
|
||||
@@ -371,9 +371,9 @@ U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
ch=EdRAGetU8(doc);
|
||||
if (ch==':') {
|
||||
ch=EdRAGetU8(doc);
|
||||
tempr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tempr->label,buf);
|
||||
QueIns(tempr,head->last);
|
||||
tmpr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tmpr->label,buf);
|
||||
QueIns(tmpr,head->last);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,7 +388,7 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 num=0;
|
||||
CRenum head,*tempr,*tempr1;
|
||||
CRenum head,*tmpr,*tmpr1;
|
||||
U8 buf[sizeof(CEdFindText.find_text)],
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
@@ -396,14 +396,14 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
EdSelFun(doc,TRUE);
|
||||
EdRACollect(doc,&head);
|
||||
|
||||
tempr=head.next;
|
||||
while (tempr!=&head) {
|
||||
tempr1=tempr->next;
|
||||
tmpr=head.next;
|
||||
while (tmpr!=&head) {
|
||||
tmpr1=tmpr->next;
|
||||
num+=ASM_RENUM_SPACING;
|
||||
StrPrint(buf,"@#%02d",num);
|
||||
EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE);
|
||||
Free(tempr);
|
||||
tempr=tempr1;
|
||||
EdReplace(doc,tmpr->label,buf,TRUE,TRUE,TRUE);
|
||||
Free(tmpr);
|
||||
tmpr=tmpr1;
|
||||
}
|
||||
|
||||
while (num) {
|
||||
@@ -426,7 +426,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
I64 i,start_y,end_y,x,r,goto_line_num;
|
||||
U8 *b,*st,*st2,*prj_file;
|
||||
CTask *task=NULL;
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
CQueVectU8 *indent;
|
||||
|
||||
DocRecalc(doc);
|
||||
@@ -442,12 +442,12 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
WinHorz(Fs->win_left,Fs->win_right, task);
|
||||
WinVert(Fs->win_top, Fs->win_bottom,task);
|
||||
if (JobResScan(tempc,&r)) {
|
||||
if (JobResScan(tmpc,&r)) {
|
||||
st=DirFile(doc->filename.name,,"PRJ.Z");
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
@@ -455,24 +455,24 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
st2=DirFile(prj_file),
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|
|
||||
1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||
Free(st);
|
||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",
|
||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTmp\",\"SysTmp\");",
|
||||
prj_file);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tempc,&r))
|
||||
if (JobResScan(tmpc,&r))
|
||||
if (!r) {
|
||||
tempc=TaskExe(task,Fs,
|
||||
"Load(\"SysTemp\",LDF_JUST_LOAD);",
|
||||
tmpc=TaskExe(task,Fs,
|
||||
"Load(\"SysTmp\",LDF_JUST_LOAD);",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
if (JobResScan(tempc,&r))
|
||||
if (JobResScan(tmpc,&r))
|
||||
okay=TRUE;
|
||||
}
|
||||
tempc=TaskExe(task,Fs,"Del(\"SysTemp.*\");",
|
||||
tmpc=TaskExe(task,Fs,"Del(\"SysTmp.*\");",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
JobResScan(tempc,&r);
|
||||
JobResScan(tmpc,&r);
|
||||
} else {
|
||||
Free(prj_file);
|
||||
st=DirFile(doc->filename.name,"Load","HC.Z");
|
||||
@@ -483,9 +483,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
else
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||
doc->filename.name);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tempc,&r) && r)
|
||||
if (JobResScan(tmpc,&r) && r)
|
||||
okay=TRUE;
|
||||
}
|
||||
Free(prj_file);
|
||||
|
||||
@@ -151,9 +151,9 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
|
||||
DocUnlock(doc);
|
||||
if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
if (doc->flags&DOCF_MIN_SIZE)
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
}
|
||||
res=View;
|
||||
|
||||
|
||||
+17
-17
@@ -5,24 +5,24 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
I64 i;
|
||||
U8 *src;
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
doc->find_replace->filter_lines=0;
|
||||
if (src2) {
|
||||
DocPutS(doc,src2); //Too big $LK,"DocPrint",A="MN:DocPrint"$() is wasteful.
|
||||
src=src2+StrLen(src2)+1;
|
||||
i=size-(offset(CDocBin.end)-offset(CDocBin.start));
|
||||
while (src<=src2+i) {
|
||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
MemCpy(&tempb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
MemCpy(&tmpb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
src+=offset(CDocBin.end)-offset(CDocBin.start);
|
||||
tempb->data=MAlloc(tempb->size,doc->mem_task);
|
||||
if (tempb->size) {
|
||||
MemCpy(tempb->data,src,tempb->size);
|
||||
src+=tempb->size;
|
||||
tmpb->data=MAlloc(tmpb->size,doc->mem_task);
|
||||
if (tmpb->size) {
|
||||
MemCpy(tmpb->data,src,tmpb->size);
|
||||
src+=tmpb->size;
|
||||
}
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
if (tempb->num>=doc->cur_bin_num)
|
||||
doc->cur_bin_num=tempb->num+1;
|
||||
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)))
|
||||
@@ -38,7 +38,7 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
|
||||
U8 *src,*name2;
|
||||
I64 size=0;
|
||||
CDirContext *dirc;
|
||||
if (!name) name=blkdev.temp_filename;
|
||||
if (!name) name=blkdev.tmp_filename;
|
||||
doc->flags|=flags;
|
||||
name2=FileNameAbs(name);
|
||||
StrCpy(doc->filename.name,name2);
|
||||
@@ -104,7 +104,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
}
|
||||
}
|
||||
for (b=doc->bin_head.next;b!=&doc->bin_head;b=b->next)
|
||||
if (b->use_cnt>b->temp_use_cnt)
|
||||
if (b->use_cnt>b->tmp_use_cnt)
|
||||
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||
res=MAlloc(cnt);
|
||||
dst=res;
|
||||
@@ -157,7 +157,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
b=doc->bin_head.next;
|
||||
if (b!=&doc->bin_head) {
|
||||
do {
|
||||
if (b->use_cnt>b->temp_use_cnt) {
|
||||
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);
|
||||
@@ -297,7 +297,7 @@ U0 DocUndoRestore(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GRA Files;"\
|
||||
#help_index "Graphics/Windows BMP Files;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.
|
||||
@@ -318,8 +318,8 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
|
||||
DocBMP(doc,filename,,TRUE);
|
||||
res=TRUE;
|
||||
} else if (FilesFindMatch(filename,"*.GRA*")) {
|
||||
DocGRA(doc,filename);
|
||||
} else if (FilesFindMatch(filename,"*.GR*")) {
|
||||
DocGR(doc,filename);
|
||||
res=TRUE;
|
||||
}
|
||||
if (res)
|
||||
@@ -327,7 +327,7 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GRA Files;"\
|
||||
#help_index "Graphics/Windows BMP Files;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)
|
||||
|
||||
+17
-17
@@ -60,7 +60,7 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
{
|
||||
I64 i;
|
||||
U8 *ptr,*ptr2;
|
||||
CHashDefineStr *temph;
|
||||
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) {
|
||||
@@ -109,9 +109,9 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
}
|
||||
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) {
|
||||
ptr=MStrPrint("[%s]",temph->sub_idx[d]);
|
||||
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);
|
||||
@@ -132,7 +132,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
{
|
||||
I64 i,d;
|
||||
U8 *ptr,*ptr1,*ptr2;
|
||||
CHashDefineStr *temph;
|
||||
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 &&
|
||||
@@ -166,7 +166,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||
d=0;
|
||||
if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE &&
|
||||
(temph=HashFind(doc_e->define_str,
|
||||
(tmph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR))) {
|
||||
ptr1=ptr2=StrNew(doc_e->tag);
|
||||
if (*ptr2=='[') {
|
||||
@@ -175,7 +175,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
if (ptr2[i-1]==']')
|
||||
ptr2[i-1]=0;
|
||||
}
|
||||
d=LstMatch(ptr2,temph->data);
|
||||
d=LstMatch(ptr2,tmph->data);
|
||||
Free(ptr1);
|
||||
}
|
||||
} else {
|
||||
@@ -213,11 +213,11 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
CMemberLst *ml;
|
||||
CDocEntry *doc_e;
|
||||
U8 *fmtstr;
|
||||
CHashClass *tempc,*tempc2;
|
||||
CHashClass *tmpc,*tmpc2;
|
||||
CDoc *doc;
|
||||
Bool res=FALSE;
|
||||
I64 old_border_src=Fs->border_src,has_action;
|
||||
if (!(tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS)))
|
||||
if (!(tmpc=HashFind(class_name,Fs->hash_table,HTT_CLASS)))
|
||||
return FALSE;
|
||||
doc=DocNew;
|
||||
doc->desc='Form';
|
||||
@@ -225,18 +225,18 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
|
||||
if (dof_flags&DOF_MIN_SIZE)
|
||||
doc->flags|=DOCF_MIN_SIZE;
|
||||
ml=tempc->member_lst_and_root;
|
||||
ml=tmpc->member_lst_and_root;
|
||||
while (ml) {
|
||||
if ((fmtstr=MemberMetaData("fmtstr",ml)) &&
|
||||
(doc_e=DocPrint(doc,"%s",fmtstr))) {
|
||||
tempc2=ml->member_class;
|
||||
tmpc2=ml->member_class;
|
||||
if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX) && !tempc2->ptr_stars_cnt) {
|
||||
tempc2=OptClassFwd(tempc2);
|
||||
tempc2-=tempc2->ptr_stars_cnt;
|
||||
if (tempc2->type & HTT_INTERNAL_TYPE) {
|
||||
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 (tempc2->raw_type==RT_U8 &&
|
||||
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)
|
||||
@@ -246,7 +246,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
doc->mem_task); //+2 because "_\0"
|
||||
}
|
||||
} else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE))
|
||||
doc_e->raw_type=tempc2->raw_type;
|
||||
doc_e->raw_type=tmpc2->raw_type;
|
||||
}
|
||||
}
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
|
||||
+33
-33
@@ -1,33 +1,33 @@
|
||||
#help_index "DolDoc/Misc"
|
||||
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
|
||||
{//Be aware of $LK,"::/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,temp_u32_attr,mask_temp_u32_attr=_temp_u32_attr&0xFFFFF000,
|
||||
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 *temph;
|
||||
CHash *tmph;
|
||||
switch [s->state] {
|
||||
case DOCSS_NORMAL:
|
||||
hl_normal:
|
||||
while (len) {
|
||||
while (len && !Bt(chars_bmp_alpha_numeric,*src)) {
|
||||
temp_u32_attr=_temp_u32_attr;
|
||||
tmp_u32_attr=_tmp_u32_attr;
|
||||
ch1=*src++;
|
||||
switch (ch1) {
|
||||
case '/':
|
||||
if (len>=2) {
|
||||
if (*src=='/') {
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
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=='*') {
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
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;
|
||||
@@ -35,33 +35,33 @@ hl_normal:
|
||||
}
|
||||
break;
|
||||
case '\'':
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
len--;
|
||||
goto hl_single_quote;
|
||||
case '\"':
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
len--;
|
||||
goto hl_dbl_quote;
|
||||
case '(':
|
||||
if (paren_depth++&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case ')':
|
||||
if (--paren_depth&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case '{':
|
||||
if (brace_depth++&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case '}':
|
||||
if (--brace_depth&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
}
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (!--len) goto hl_normal_done;
|
||||
}
|
||||
ptr=src;
|
||||
@@ -71,16 +71,16 @@ hl_normal:
|
||||
}
|
||||
ch=*src;
|
||||
*src=0;
|
||||
if (temph=HashFind(ptr,cmp.asm_hash,
|
||||
if (tmph=HashFind(ptr,cmp.asm_hash,
|
||||
HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) {
|
||||
if (temph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
||||
temp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_temp_u32_attr;
|
||||
if (tmph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
||||
tmp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_tmp_u32_attr;
|
||||
else
|
||||
temp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_tmp_u32_attr;
|
||||
} else
|
||||
temp_u32_attr=_temp_u32_attr;
|
||||
tmp_u32_attr=_tmp_u32_attr;
|
||||
while (ch1=*ptr++)
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
*src=ch;
|
||||
}
|
||||
hl_normal_done:
|
||||
@@ -88,12 +88,12 @@ hl_normal_done:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_SINGLE_QUOTE:
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
hl_single_quote:
|
||||
last_ch=0;
|
||||
while (len--) {
|
||||
ch1=*src++;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch!='\\' && ch1=='\'')
|
||||
goto hl_normal;
|
||||
if (last_ch=='\\' && ch1=='\\')
|
||||
@@ -105,12 +105,12 @@ hl_single_quote:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_DBL_QUOTE:
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
hl_dbl_quote:
|
||||
last_ch=0;
|
||||
while (len--) {
|
||||
ch1=*src++;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch!='\\' && ch1=='\"')
|
||||
goto hl_normal;
|
||||
if (last_ch=='\\' && ch1=='\\')
|
||||
@@ -122,13 +122,13 @@ hl_dbl_quote:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_COMMENT:
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
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+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch=='*' && ch1=='/') {
|
||||
if (!--comment_depth)
|
||||
goto hl_normal;
|
||||
@@ -140,10 +140,10 @@ hl_comment:
|
||||
s->comment_depth=comment_depth;
|
||||
break;
|
||||
case DOCSS_CPP_Z_COMMENT:
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||
hl_cpp_comment:
|
||||
while (len--)
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
*dst++=*src++ +tmp_u32_attr;
|
||||
s->state=DOCSS_CPP_Z_COMMENT;
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,7 @@ U0 DocInit()
|
||||
{//$LK-UL,"CMD Defines",A="MN:DOCT_TEXT"$
|
||||
CCmpCtrl *cc;
|
||||
I64 i;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
|
||||
DefineLstLoad("ST_DOC_CMDS",
|
||||
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
@@ -12,7 +12,7 @@ U0 DocInit()
|
||||
"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\0LA\0RC\0RA\0LX\0CX\0RX\0TY\0CY\0BY\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");
|
||||
@@ -32,8 +32,8 @@ U0 DocInit()
|
||||
cc->htc.hash_table_lst=NULL;
|
||||
Lex(cc);
|
||||
while (cc->token==TK_IDENT) {
|
||||
if (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
|
||||
i=temph->user_data0;
|
||||
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]);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ U0 DocInit()
|
||||
Bts(doldoc.type_flags_form,i);
|
||||
|
||||
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
|
||||
doldoc.type_flags_nontag_invisible[0]=
|
||||
doldoc.type_flags_nontag_invis[0]=
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_PAGE_LEN|
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
|
||||
+28
-20
@@ -95,11 +95,9 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
doc=Str2I64(filename);//See $LK,"SpriteEdText",A="MN:SpriteEdText"$()
|
||||
res=TRUE;
|
||||
} else {
|
||||
|
||||
st1=StrNew(filename);
|
||||
st2=StrNew(filename);
|
||||
StrLastRem(st1,"/",st2); //st2 is name without dir
|
||||
|
||||
if (!FileNameChk(st2))
|
||||
doc=NULL;
|
||||
else {
|
||||
@@ -107,8 +105,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
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)))
|
||||
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);
|
||||
@@ -116,7 +113,6 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
Silent(old_silent);
|
||||
Fs->border_src=BDS_ED_FILENAME_DRV;
|
||||
}
|
||||
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -149,17 +145,24 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
|
||||
if (edf_dof_flags&EDF_WAS_WRITE)
|
||||
res=FALSE;
|
||||
if (!(edf_dof_flags&EDF_BAIL) && 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;
|
||||
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);
|
||||
@@ -179,11 +182,11 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
|
||||
{//$LK,"Editor Link",A="MN:LK_FILE"$--> filename, needle_str and line number.
|
||||
U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
|
||||
I64 res,i,num=1;
|
||||
CHashSrcSym *temph;
|
||||
CHashSrcSym *tmph;
|
||||
if (!link_st||!*link_st) {
|
||||
if (edf_dof_flags&EDF_BAIL)
|
||||
return -1;
|
||||
link_st=blkdev.temp_filename;
|
||||
link_st=blkdev.tmp_filename;
|
||||
}
|
||||
st=StrNew(link_st);
|
||||
res=LK_FILE;
|
||||
@@ -192,8 +195,8 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
|
||||
filename2=st+3;
|
||||
switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
|
||||
case LK_MAN_PAGE:
|
||||
if (temph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
|
||||
res=EdLinkCvt(temph->src_link,&filename,
|
||||
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;
|
||||
@@ -292,11 +295,15 @@ lc_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocLinkChk(U8 *link_st)
|
||||
public Bool DocLinkChk(CDoc *doc,U8 *link_st)
|
||||
{//Check for bad $LK,"Editor Link",A="MN:LK_FILE"$.
|
||||
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;
|
||||
@@ -320,6 +327,7 @@ public Bool DocLinkChk(U8 *link_st)
|
||||
res=TRUE;
|
||||
}
|
||||
Free(filename);
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+51
-51
@@ -7,18 +7,18 @@ I64 sys_macro_repeat_n=1;
|
||||
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
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_UP) &&
|
||||
a1 && tempc->aux1==a1 || !a1 && tempc->aux2==a2) {
|
||||
QueRem(tempc);
|
||||
SrvCmdDel(tempc);
|
||||
CSrvCmd *tmpc,*tmpc1;
|
||||
tmpc=macro_head->next;
|
||||
while (tmpc!=macro_head) {
|
||||
tmpc1=tmpc->next;
|
||||
if (tmpc->cmd_code==SVCT_MSG &&
|
||||
(tmpc->msg_code==MSG_KEY_DOWN || tmpc->msg_code==MSG_KEY_UP ||
|
||||
tmpc->msg_code==MSG_KEY_DOWN_UP) &&
|
||||
a1 && tmpc->aux1==a1 || !a1 && tmpc->aux2==a2) {
|
||||
QueRem(tmpc);
|
||||
SrvCmdDel(tmpc);
|
||||
}
|
||||
tempc=tempc1;
|
||||
tmpc=tmpc1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,77 +26,77 @@ U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
#define MT_MSG 1
|
||||
#define MT_CHAR 2
|
||||
|
||||
class CMacroTemp
|
||||
class CMacroTmp
|
||||
{
|
||||
CMacroTemp *next,*last;
|
||||
CMacroTmp *next,*last;
|
||||
I64 type;
|
||||
U8 buf[STR_LEN];
|
||||
};
|
||||
|
||||
CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
||||
CMacroTmp *Cmd2MT(CSrvCmd *tmpc)
|
||||
{
|
||||
U8 buf[8];
|
||||
CMacroTemp *tempmt=CAlloc(sizeof(CMacroTemp));
|
||||
if (Bt(chars_bmp_macro,tempc->aux1) && tempc->msg_code==MSG_KEY_DOWN) {
|
||||
tempmt->type=MT_CHAR;
|
||||
buf[0]=tempc->aux1;
|
||||
CMacroTmp *tmpmt=CAlloc(sizeof(CMacroTmp));
|
||||
if (Bt(chars_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
|
||||
tmpmt->type=MT_CHAR;
|
||||
buf[0]=tmpc->aux1;
|
||||
buf[1]=0;
|
||||
StrPrint(tempmt->buf,"%Q",buf);
|
||||
StrPrint(tmpmt->buf,"%Q",buf);
|
||||
} else {
|
||||
tempmt->type=MT_MSG;
|
||||
StrPrint(tempmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
tempc->msg_code,tempc->aux1,tempc->aux2);
|
||||
tmpmt->type=MT_MSG;
|
||||
StrPrint(tmpmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
tmpc->msg_code,tmpc->aux1,tmpc->aux2);
|
||||
}
|
||||
return tempmt;
|
||||
return tmpmt;
|
||||
}
|
||||
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||
{
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
I64 cnt=1; //terminating zero
|
||||
U8 *ptr,*m;
|
||||
CMacroTemp *tempmt,*tempmt1,head;
|
||||
CMacroTmp *tmpmt,*tmpmt1,head;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
|
||||
QueInit(&head);
|
||||
head.type=MT_NULL;
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
tempmt=Cmd2MT(tempc);
|
||||
QueIns(tempmt,head.last);
|
||||
cnt+=StrLen(tempmt->buf);
|
||||
if (tempmt->type==MT_CHAR) {
|
||||
if (tempmt->last->type!=MT_CHAR)
|
||||
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 (tempmt->next->type!=MT_CHAR)
|
||||
if (tmpmt->next->type!=MT_CHAR)
|
||||
cnt+=StrLen("\";");
|
||||
}
|
||||
tempc=tempc->next;
|
||||
tmpc=tmpc->next;
|
||||
}
|
||||
|
||||
m=MAlloc(cnt);
|
||||
ptr=m;
|
||||
|
||||
tempmt=head.next;
|
||||
while (tempmt!=&head) {
|
||||
tempmt1=tempmt->next;
|
||||
if (tempmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tempmt->buf);
|
||||
ptr+=StrLen(tempmt->buf);
|
||||
tmpmt=head.next;
|
||||
while (tmpmt!=&head) {
|
||||
tmpmt1=tmpmt->next;
|
||||
if (tmpmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tmpmt->buf);
|
||||
ptr+=StrLen(tmpmt->buf);
|
||||
} else {
|
||||
if (tempmt->last->type!=MT_CHAR) {
|
||||
if (tmpmt->last->type!=MT_CHAR) {
|
||||
StrCpy(ptr, "\"");
|
||||
ptr+=StrLen("\"");
|
||||
}
|
||||
StrCpy(ptr,tempmt->buf);
|
||||
ptr+=StrLen(tempmt->buf);
|
||||
if (tempmt->next->type!=MT_CHAR) {
|
||||
StrCpy(ptr,tmpmt->buf);
|
||||
ptr+=StrLen(tmpmt->buf);
|
||||
if (tmpmt->next->type!=MT_CHAR) {
|
||||
StrCpy(ptr, "\";");
|
||||
ptr+=StrLen("\";");
|
||||
}
|
||||
}
|
||||
Free(tempmt);
|
||||
tempmt=tempmt1;
|
||||
Free(tmpmt);
|
||||
tmpmt=tmpmt1;
|
||||
}
|
||||
*ptr=0;
|
||||
return m;
|
||||
@@ -111,7 +111,7 @@ U0 PlaySysMacro(I64 n=1)
|
||||
m=SysMacro2Str(&sys_macro_head);
|
||||
while (n-- && TaskValidate(task)) {
|
||||
if (task==Fs)
|
||||
AutoStr("%s",m);
|
||||
InStr("%s",m);
|
||||
else
|
||||
XTalkStrWait(task,"%s",m);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ U0 EdInsCapturedMacro()
|
||||
{
|
||||
U8 *st=SysMacro2Str(&sys_macro_head);
|
||||
if (sys_focus_task) {
|
||||
XTalk(sys_focus_task,"$$MA+LA,T=\"%s\",LM=\"%$$Q\"$$",
|
||||
XTalk(sys_focus_task,"$$MA+LIS,T=\"%s\",LM=\"%$$Q\"$$",
|
||||
captured_macro_name,st);
|
||||
Free(st);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ I64 PopUpMacroMenu()
|
||||
{
|
||||
I64 res=0;
|
||||
U8 buf[STR_LEN];
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
||||
doc_e->data=captured_macro_name;
|
||||
@@ -162,9 +162,9 @@ I64 PopUpMacroMenu()
|
||||
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,
|
||||
tmpc=TaskExe(sys_macro_task,Fs,buf,
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
JobResScan(tempc,&res);
|
||||
JobResScan(tmpc,&res);
|
||||
Fs->popup_task=NULL;
|
||||
Kill(sys_macro_task);
|
||||
sys_macro_task=NULL;
|
||||
|
||||
@@ -136,7 +136,7 @@ U0 DocUndoCntSet(CDoc *doc)
|
||||
public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
{//Make copy of entry and all parts of entry.
|
||||
CDocEntry *doc_ne;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
CTask *task=doc->mem_task;
|
||||
doc_ne=MAllocIdent(doc_e,task);
|
||||
doc_ne->next=doc_ne;
|
||||
@@ -156,16 +156,16 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
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) {
|
||||
tempb=MAllocIdent(doc_e->bin_data,task);
|
||||
tempb->data=MAllocIdent(doc_e->bin_data->data,task);
|
||||
tmpb=MAllocIdent(doc_e->bin_data,task);
|
||||
tmpb->data=MAllocIdent(doc_e->bin_data->data,task);
|
||||
doc_ne->bin_num=doc->cur_bin_num;
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
doc_ne->bin_data=tempb;
|
||||
tmpb->num=doc->cur_bin_num++;
|
||||
doc_ne->bin_data=tmpb;
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,task);
|
||||
tmpb->tag=StrNew(doc_e->tag,task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
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);
|
||||
@@ -368,7 +368,7 @@ public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL)
|
||||
if (filename)
|
||||
StrCpy(doc->filename.name,filename);
|
||||
else
|
||||
StrCpy(doc->filename.name,blkdev.temp_filename);
|
||||
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;
|
||||
|
||||
+12
-12
@@ -88,21 +88,21 @@ I64 DocOptFile(U8 *filename,I64 fuf_flags)
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
I64 DocOptLst(CDirEntry *tempde,I64 fuf_flags)
|
||||
I64 DocOptLst(CDirEntry *tmpde,I64 fuf_flags)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub) {
|
||||
"Scanning Directory: %s\n",tempde->full_name;
|
||||
res+=DocOptLst(tempde->sub,fuf_flags);
|
||||
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(tempde->full_name,fuf_flags);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
res+=DocOptFile(tmpde->full_name,fuf_flags);
|
||||
DirEntryDel(tmpde);
|
||||
tmpde=tmpde1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ 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+T");
|
||||
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);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||
{
|
||||
I64 res=-1;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
if (cc->token==TK_IDENT &&
|
||||
(temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
|
||||
res=temph->user_data0;
|
||||
(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) {
|
||||
@@ -219,18 +219,18 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
I64 i,j,de_flags,processed_flags,attr=DOC_DFT;
|
||||
U8 *ptr,*st2;
|
||||
CDocEntry *doc_e=NULL;
|
||||
CHashGeneric *temph;
|
||||
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 (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
|
||||
if (temph->type&DHT_DOC_CMD)
|
||||
i=temph->user_data0;
|
||||
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=temph->user_data0;
|
||||
attr=tmph->user_data0;
|
||||
}
|
||||
} else
|
||||
goto pd_err;
|
||||
|
||||
@@ -296,7 +296,7 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
||||
okay=FALSE;
|
||||
if (okay) {
|
||||
st=MStrPrint(
|
||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||
"\"$$$$WW+H,1$$$$\";In(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||
"UserTaskCont;",
|
||||
name2);
|
||||
res=PopUp(st,parent,_pu_task);
|
||||
|
||||
@@ -364,8 +364,11 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Save As");
|
||||
else
|
||||
DocWrite(doc,TRUE);
|
||||
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:
|
||||
|
||||
+72
-72
@@ -201,67 +201,67 @@ CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
I64 DocTempAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
|
||||
I64 DocTmpAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
|
||||
{
|
||||
I64 temp_u32_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);
|
||||
temp_u32_attr=(cur_u8_attr&0xF0)<<8|
|
||||
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=='<')
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
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)
|
||||
temp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
else if (doc_e->de_flags & DOCEF_LINK)
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
else if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
else if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST))
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
else
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
break;
|
||||
case DOCT_LINK:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
break;
|
||||
case DOCT_MACRO:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
break;
|
||||
case DOCT_ANCHOR:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
||||
break;
|
||||
case DOCT_TREE:
|
||||
case DOCT_LST:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
break;
|
||||
default:
|
||||
temp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
}
|
||||
doc_e->type.u8[1]=temp_u32_attr.u8[1];
|
||||
temp_u32_attr|=doc_e->type&0xFFFF0000;
|
||||
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)
|
||||
temp_u32_attr^=0xFF00;
|
||||
doc_e->settings.final_u32_attr=temp_u32_attr;
|
||||
return temp_u32_attr;
|
||||
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 screen.
|
||||
{//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=MAX_I64,xx,yy,zz,
|
||||
num_entries=0,i_jif,cur_u8_attr,temp_u32_attr,
|
||||
num_entries=0,i_jif,cur_u8_attr,tmp_u32_attr,
|
||||
cursor_y=MIN_I64,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 *tempb;
|
||||
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;
|
||||
@@ -272,12 +272,12 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
I32 *depth_buf=NULL;
|
||||
F64 cur_time=tS;
|
||||
CWinScroll *vss,*hss;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
||||
|
||||
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) {
|
||||
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)
|
||||
@@ -302,7 +302,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (win_task)
|
||||
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
||||
break;
|
||||
case RECALCt_TO_SCREEN:
|
||||
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))
|
||||
@@ -352,7 +352,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->top_line_num=0;
|
||||
doc->line_start_col=0;
|
||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
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 {
|
||||
@@ -373,7 +373,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
find_cursor=TRUE;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->text_attr;
|
||||
}
|
||||
@@ -385,7 +385,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
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_SCREEN) {
|
||||
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) &&
|
||||
@@ -406,7 +406,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
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_SCREEN && full_refresh)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
} else
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
@@ -443,9 +443,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
else
|
||||
doc_e->tag=StrNew("",mem_task);
|
||||
} else {
|
||||
if (temph=HashFind(doc_e->define_str,
|
||||
if (tmph=HashFind(doc_e->define_str,
|
||||
win_task->hash_table,HTT_DEFINE_STR))
|
||||
doc_e->tag=StrNew(temph->data,mem_task);
|
||||
doc_e->tag=StrNew(tmph->data,mem_task);
|
||||
else
|
||||
doc_e->tag=CAlloc(1,mem_task);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
col2=0;
|
||||
|
||||
temp_u32_attr=DocTempAttr(doc,doc_e,cur_u8_attr);
|
||||
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) {
|
||||
@@ -547,20 +547,20 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
j=StrLen(doc_e->tag);
|
||||
if (j && doc_e->scroll_len) {
|
||||
i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH);
|
||||
temp_u32_attr=temp_u32_attr & 0xFFE0FF00|
|
||||
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(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
x++;
|
||||
}
|
||||
@@ -574,9 +574,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
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_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -590,10 +590,10 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
} else {
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT)
|
||||
hl=DocHighlight(doc_e,ptr,k,temp_u32_attr);
|
||||
hl=DocHighlight(doc_e,ptr,k,tmp_u32_attr);
|
||||
else
|
||||
hl=NULL;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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)
|
||||
@@ -602,7 +602,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (hl)
|
||||
TextLenAttrStr(win_task,x-x0,y-y0,k,hl);
|
||||
else
|
||||
TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr,ptr);
|
||||
TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr,ptr);
|
||||
}
|
||||
col2+=k;
|
||||
x+=k;
|
||||
@@ -647,13 +647,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%08tX ",bptr);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -669,13 +669,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%02tX",*bptr++);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -694,13 +694,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
for (j=0;j<k;j++) {
|
||||
ch=*bptr++;
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -718,7 +718,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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);
|
||||
@@ -779,9 +779,9 @@ rc_adjust_xy:
|
||||
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_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
@@ -791,10 +791,10 @@ rc_adjust_xy:
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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,temp_u32_attr," ");
|
||||
TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
@@ -956,16 +956,16 @@ 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 ((tempb=doc_e->bin_data) &&
|
||||
!tempb->tag && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,mem_task);
|
||||
if (tempb && dc) {
|
||||
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_SCREEN ||
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCRN ||
|
||||
doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||
dc->flags|=DCF_DONT_DRAW;
|
||||
bptr=tempb->data;
|
||||
bptr=tmpb->data;
|
||||
ii=SpriteTypeMask(bptr);
|
||||
if (ii&1<<SPT_NUM_TYPES) {
|
||||
bptr=gr.empty_sprite;
|
||||
@@ -974,19 +974,19 @@ rc_adjust_xy:
|
||||
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=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
if (temp_u32_attr & DOCET_SEL)
|
||||
i=tmp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
if (tmp_u32_attr & DOCET_SEL)
|
||||
i^=0xF;
|
||||
if (temp_u32_attr & DOCET_INVERT)
|
||||
if (tmp_u32_attr & DOCET_INVERT)
|
||||
i^=0xF;
|
||||
if (blink_flag &&
|
||||
(doc_e==doc->cur_entry || temp_u32_attr&DOCET_BLINK))
|
||||
(doc_e==doc->cur_entry || tmp_u32_attr&DOCET_BLINK))
|
||||
i^=0xF;
|
||||
}
|
||||
dc->color=i;
|
||||
if (find_cursor)
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
doc->cur_sprite==bptr) {
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
dc->cur_x=ip.pos.x;
|
||||
@@ -1024,7 +1024,7 @@ rc_adjust_xy:
|
||||
}
|
||||
Sprite3(dc,xx,yy,zz,bptr);
|
||||
dc->depth_buf=NULL;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
doc->cur_sprite==bptr)
|
||||
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
|
||||
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
|
||||
@@ -1036,7 +1036,7 @@ rc_adjust_xy:
|
||||
break;
|
||||
case DOCT_SONG:
|
||||
if (sys_focus_task==win_task &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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))) {
|
||||
@@ -1059,7 +1059,7 @@ rc_adjust_xy:
|
||||
|
||||
if (doc_e->de_flags & DOCEF_HAS_BORDER)
|
||||
TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0,
|
||||
temp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER));
|
||||
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:
|
||||
@@ -1245,7 +1245,7 @@ rc_skip:
|
||||
doc->col=doc->x+1;
|
||||
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||
x=0;
|
||||
y=0;
|
||||
} else {
|
||||
@@ -1273,7 +1273,7 @@ rc_skip:
|
||||
doc->line_start_col=doc->x+x;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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;
|
||||
|
||||
+10
-10
@@ -45,18 +45,18 @@ U0 DocBorderLstDraw(CDoc *doc)
|
||||
CTask *win_task=doc->win_task;
|
||||
I64 i,y=-1,attr=win_task->border_attr<<8;
|
||||
U64 ch;
|
||||
CDoc *templ=doc;
|
||||
CDoc *tmpl=doc;
|
||||
CD3I64 saved_scroll;
|
||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
y+=(Bsr(templ->desc)+7)>>3+1; //StrLen+1
|
||||
templ=templ->parent_doc;
|
||||
while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
y+=(Bsr(tmpl->desc)+7)>>3+1; //StrLen+1
|
||||
tmpl=tmpl->parent_doc;
|
||||
}
|
||||
templ=doc;
|
||||
tmpl=doc;
|
||||
if (y>win_task->win_height)
|
||||
y=win_task->win_height;
|
||||
WinScrollNull(win_task,&saved_scroll);
|
||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
ch=templ->desc;
|
||||
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;
|
||||
@@ -65,7 +65,7 @@ U0 DocBorderLstDraw(CDoc *doc)
|
||||
ch>>=8;
|
||||
}
|
||||
y--;
|
||||
templ=templ->parent_doc;
|
||||
tmpl=tmpl->parent_doc;
|
||||
}
|
||||
WinScrollRestore(win_task,&saved_scroll);
|
||||
}
|
||||
@@ -203,11 +203,11 @@ U0 DocUpdateTaskDocs(CTask *task)
|
||||
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_SCREEN|RECALCF_HAS_CURSOR);
|
||||
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_SCREEN);
|
||||
DocRecalc(doc,RECALCt_TO_SCRN);
|
||||
WinScrollRestore(task,&saved_scroll);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
//Sometimes returns locked, sometimes unlocked
|
||||
U8 ch=doc->cmd_U8,*st;
|
||||
I64 res=DOCM_CANCEL,has_action=FALSE;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
DocLock(doc);
|
||||
if (!exited) {
|
||||
if (doc_e->de_flags & DOCEF_ESC) {
|
||||
@@ -46,18 +46,18 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
PopUp(st,Fs);
|
||||
Free(st);
|
||||
} else {
|
||||
if (doc_e->de_flags & DOCEF_LEFT_AUTO)
|
||||
AutoStr("%s",doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_IN_STR)
|
||||
InStr("%s",doc_e->left_macro);
|
||||
else
|
||||
Auto("%s",doc_e->left_macro);
|
||||
In("%s",doc_e->left_macro);
|
||||
}
|
||||
has_action=TRUE;
|
||||
}
|
||||
if (!exited && doc_e->de_flags & DOCEF_LST &&
|
||||
doc_e->de_flags & DOCEF_DEFINE &&
|
||||
(temph=HashFind(doc_e->define_str,
|
||||
(tmph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR)) &&
|
||||
(res=PopUpPickLst(temph->data))!=DOCM_CANCEL) {
|
||||
(res=PopUpPickLst(tmph->data))!=DOCM_CANCEL) {
|
||||
DocDataFmt(doc,doc_e,res);
|
||||
DocDataScan(doc,doc_e);
|
||||
has_action=TRUE;
|
||||
@@ -85,10 +85,10 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
PopUp(st,Fs);
|
||||
Free(st);
|
||||
} else {
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_AUTO)
|
||||
AutoStr("%s",doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_IN_STR)
|
||||
InStr("%s",doc_e->right_macro);
|
||||
else
|
||||
Auto("%s",doc_e->right_macro);
|
||||
In("%s",doc_e->right_macro);
|
||||
}
|
||||
has_action=TRUE;
|
||||
}
|
||||
|
||||
+25
-19
@@ -61,7 +61,7 @@ public U0 DocTermNew()
|
||||
#define RIGHT_ED 6
|
||||
#define RIGHT_MOUNT 7
|
||||
#define RIGHT_PLAIN 8
|
||||
#define RIGHT_AUTOFILE 9
|
||||
#define RIGHT_INFILE 9
|
||||
|
||||
I64 PopUpTermRight(U8 *header)
|
||||
{
|
||||
@@ -69,19 +69,19 @@ I64 PopUpTermRight(U8 *header)
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"\n\n"
|
||||
"TXT=%s\nJIT=%s\nGRA=%s"
|
||||
"$$CM+LX,1,3 $$$$BT,\"INCLUDE JIT\",LE=RIGHT_INCLUDE$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"ADAM_INCLUDE JIT\",LE=RIGHT_AINCLUDE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"COPY \",LE=RIGHT_COPY$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"MOVE OR RENAME \",LE=RIGHT_MOVE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=RIGHT_DELETE$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"TYPE TXT;GRA\",LE=RIGHT_TYPE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"ED TXT\",LE=RIGHT_ED$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"PLAIN ED TXT\",LE=RIGHT_PLAIN$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"AUTOFILE AUT\",LE=RIGHT_AUTOFILE$$\n"
|
||||
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$",
|
||||
FILEMASK_TXT,FILEMASK_JIT,FILEMASK_GRA);
|
||||
"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;
|
||||
@@ -159,6 +159,12 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
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;
|
||||
@@ -178,16 +184,16 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
"Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
res=Plain(st);
|
||||
break;
|
||||
case RIGHT_AUTOFILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) {
|
||||
case RIGHT_INFILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.IN*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .IN File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
"AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
"InFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
WinZBufUpdate;
|
||||
AutoFile(st);
|
||||
InFile(st);
|
||||
res=TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ class CEdMacroMenu
|
||||
left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n",
|
||||
left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n";
|
||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n",
|
||||
left_is_in_str fmtstr "$$CB,\"Left is InStr\"$$\n",
|
||||
left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
||||
right_x fmtstr "$$CB,\"Right X \"$$\n",
|
||||
@@ -628,7 +628,7 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
if (e->invert) CatPrint(buf,"+IV");
|
||||
if (!e->underline) CatPrint(buf,"-UL");
|
||||
if (!e->escape) CatPrint(buf,"-X");
|
||||
if (e->left_is_auto) CatPrint(buf,"+LA");
|
||||
if (e->left_is_in_str) CatPrint(buf,"+LIS");
|
||||
if (*e->tag || is_macro) {
|
||||
if (is_macro) {
|
||||
if (*e->tag) {
|
||||
@@ -671,7 +671,7 @@ class CEdButton
|
||||
margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n",
|
||||
escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||
U8 left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro:%s\"$$\n";
|
||||
Bool left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n";
|
||||
Bool left_is_in_str fmtstr "$$CB,\"Left is InStr\"$$\n";
|
||||
U8 left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression:%s\"$$\n";
|
||||
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
||||
};
|
||||
@@ -689,7 +689,7 @@ U0 EdInsButton()
|
||||
if (e->right_x ) CatPrint(buf,"+RX");
|
||||
if (e->margin_rel) CatPrint(buf,"+MRX");
|
||||
if (!e->escape) CatPrint(buf,"-X");
|
||||
if (e->left_is_auto) CatPrint(buf,"+LA");
|
||||
if (e->left_is_in_str) CatPrint(buf,"+LIS");
|
||||
if (*e->tag) {
|
||||
if (e->quote) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
@@ -1079,7 +1079,7 @@ class CEdMacroSprite
|
||||
exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
is_auto fmtstr "$$CB,\"AutoStr\"$$\n";
|
||||
is_in_str fmtstr "$$CB,\"InStr\"$$\n";
|
||||
};
|
||||
|
||||
class CEdMenuSprite
|
||||
@@ -1088,7 +1088,7 @@ class CEdMenuSprite
|
||||
exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup,
|
||||
is_auto;
|
||||
is_in_str;
|
||||
};
|
||||
|
||||
U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
@@ -1119,7 +1119,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
CatPrint(buf,"+UL");
|
||||
if (e->is_auto) CatPrint(buf,"+LA");
|
||||
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);
|
||||
|
||||
@@ -5,10 +5,10 @@ Cd(__DIR__);;
|
||||
|
||||
/*
|
||||
TempleOS DolDoc's can have "cursor movement" cmds which can move the cursor up
|
||||
the screen and layer on existing text. It can also have callback funs which
|
||||
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 visible portion of the document is and must process much
|
||||
of the document each time it is placed on the screen, becoming CPU
|
||||
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 $LK,"::/Doc/DolDocOverview.DD"$
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ public class CDolDocGlbls
|
||||
{
|
||||
CHashTable *hash;
|
||||
I64 dft_de_flags [DOCT_NUM_TYPES],
|
||||
type_flags_nontag_invisible [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_nontag_invis [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_form [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_data [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_chk_dup [(DOCT_NUM_TYPES+63)/64],
|
||||
|
||||
Reference in new issue
Block a user