TempleOSCDV4.10.ISO
This commit is contained in:
1 parent
c5954d3371
commit
9206246147
181 files changed
+4468
-4313
No files matched your search
+10
-10
@@ -2,8 +2,8 @@
|
||||
|
||||
CDocBin *DocBinFindNum(CDoc *haystack_doc,I64 needle_num)
|
||||
{
|
||||
CDocBin *b=haystack_doc->bin_root.next;
|
||||
while (b!=&haystack_doc->bin_root) {
|
||||
CDocBin *b=haystack_doc->bin_head.next;
|
||||
while (b!=&haystack_doc->bin_head) {
|
||||
if (b->num==needle_num)
|
||||
return b;
|
||||
b=b->next;
|
||||
@@ -15,8 +15,8 @@ CDocBin *DocBinFindTag(CDoc *haystack_doc,U8 *needle_tag)
|
||||
{
|
||||
CDocBin *b;
|
||||
if (needle_tag) {
|
||||
b=haystack_doc->bin_root.next;
|
||||
while (b!=&haystack_doc->bin_root) {
|
||||
b=haystack_doc->bin_head.next;
|
||||
while (b!=&haystack_doc->bin_head) {
|
||||
if (b->tag && !StrCmp(b->tag,needle_tag))
|
||||
return b;
|
||||
b=b->next;
|
||||
@@ -31,8 +31,8 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
CDocBin *b,*b1;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
I64 renum_num=0;
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b->use_cnt=0;
|
||||
b->temp_use_cnt=0;
|
||||
b->renum_num=-1;
|
||||
@@ -40,7 +40,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
b->tag=NULL;
|
||||
b=b->next;
|
||||
}
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
@@ -61,9 +61,9 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
doc_e=doc_e2;
|
||||
}
|
||||
|
||||
b=doc->bin_root.next;
|
||||
b=doc->bin_head.next;
|
||||
doc->cur_bin_num=1;
|
||||
while (b!=&doc->bin_root) {
|
||||
while (b!=&doc->bin_head) {
|
||||
b1=b->next;
|
||||
if (!b->use_cnt) {
|
||||
QueRem(b);
|
||||
@@ -128,7 +128,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
} else
|
||||
bin_num=0;
|
||||
DocDel(doc2);
|
||||
|
||||
@@ -540,7 +540,7 @@ ic_overstrike:
|
||||
goto ic_done;
|
||||
}
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
} else if (ch=='\n') {
|
||||
@@ -557,10 +557,10 @@ ic_not_overstrike:
|
||||
if (ch=='\n') {
|
||||
if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
} else {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
|
||||
}
|
||||
DocInsEntry(doc,doc_ne);
|
||||
} else if (ch=='\t') {
|
||||
@@ -574,7 +574,7 @@ ic_form_tab:
|
||||
DocFormFwd(doc);
|
||||
goto ic_done;
|
||||
} else {
|
||||
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_ne);
|
||||
}
|
||||
} else {
|
||||
@@ -616,7 +616,7 @@ ic_form_tab:
|
||||
doc->cur_col++;
|
||||
} else {
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_ne->x=doc_ce->x+1;
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
|
||||
@@ -12,14 +12,14 @@ public U0 EdCopyToClipboard(CDoc *doc)
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_ne;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_ne;
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
@@ -35,7 +35,7 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e1,*doc_ne,*doc_e2=NULL;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e1,*doc_ne,*doc_e2=NULL;
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
@@ -43,7 +43,7 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (doc_e==doc->cur_entry || doc_e==doc_e2)
|
||||
doc_e2=doc_e->next;
|
||||
@@ -69,7 +69,7 @@ public U0 EdPasteClipboard(CDoc *doc)
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
if (doc_ce->type_u8==DOCT_DATA) {
|
||||
doc_e=doc2->root.next;
|
||||
doc_e=doc2->head.next;
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->de_flags&DOCEF_TAG)
|
||||
DocPrintPartial(doc,"%s",doc_e->tag);
|
||||
@@ -111,7 +111,7 @@ public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
while (start!=doc) {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
|
||||
@@ -343,7 +343,7 @@ I64 EdRAGetU8(CDoc *doc)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 EdRACollect(CDoc *doc,CRenum *root)
|
||||
U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
{
|
||||
I64 ch,i;
|
||||
CRenum *tempr;
|
||||
@@ -373,7 +373,7 @@ U0 EdRACollect(CDoc *doc,CRenum *root)
|
||||
ch=EdRAGetU8(doc);
|
||||
tempr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tempr->label,buf);
|
||||
QueIns(tempr,root->last);
|
||||
QueIns(tempr,head->last);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,16 +388,16 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 num=0;
|
||||
CRenum root,*tempr,*tempr1;
|
||||
CRenum head,*tempr,*tempr1;
|
||||
U8 buf[sizeof(CEdFindText.find_text)],
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
QueInit(&root);
|
||||
QueInit(&head);
|
||||
EdSelFun(doc,TRUE);
|
||||
EdRACollect(doc,&root);
|
||||
EdRACollect(doc,&head);
|
||||
|
||||
tempr=root.next;
|
||||
while (tempr!=&root) {
|
||||
tempr=head.next;
|
||||
while (tempr!=&head) {
|
||||
tempr1=tempr->next;
|
||||
num+=ASM_RENUM_SPACING;
|
||||
StrPrint(buf,"@#%02d",num);
|
||||
@@ -531,7 +531,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
x=doc_e->x+1;
|
||||
while (i>8) {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8,,
|
||||
DOCT_TAB|doc->settings_head.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
MemCpy(&doc_ne->settings,
|
||||
&doc_e->settings,sizeof(CDocSettings));
|
||||
@@ -544,7 +544,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
MemSet(b,CH_SPACE,i);
|
||||
b[i]=0;
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8,,
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
|
||||
@@ -159,7 +159,7 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
|
||||
DocLock(doc);
|
||||
if (res) {
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX)
|
||||
DocDataScan(doc,doc_e);
|
||||
|
||||
+27
-24
@@ -20,7 +20,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
MemCpy(tempb->data,src,tempb->size);
|
||||
src+=tempb->size;
|
||||
}
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
if (tempb->num>=doc->cur_bin_num)
|
||||
doc->cur_bin_num=tempb->num+1;
|
||||
}
|
||||
@@ -37,16 +37,19 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
|
||||
CDoc *doc=DocNew;
|
||||
U8 *src,*name2;
|
||||
I64 size=0;
|
||||
CDirContext *dirc;
|
||||
if (!name) name=blkdev.temp_filename;
|
||||
doc->flags|=flags;
|
||||
name2=FileNameAbs(name);
|
||||
StrCpy(doc->filename.name,name2);
|
||||
src=FileRead(name2,&size,&doc->file_attr);
|
||||
Free(name2);
|
||||
if (src) {
|
||||
DocLoad(doc,src,size);
|
||||
if (src=FileRead(name2,&size,&doc->file_attr)) {
|
||||
if (dirc=DirContextNew(name2)) {
|
||||
DocLoad(doc,src,size);
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
Free(src);
|
||||
}
|
||||
Free(name2);
|
||||
return doc;
|
||||
}
|
||||
|
||||
@@ -64,10 +67,10 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
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.
|
||||
if (doc->head.next->type_u8==DOCT_CURSOR)
|
||||
DocEntryDel(doc,doc->head.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) {
|
||||
for (doc_e=doc->head.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:
|
||||
@@ -100,12 +103,12 @@ 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_head.next;b!=&doc->bin_head;b=b->next)
|
||||
if (b->use_cnt>b->temp_use_cnt)
|
||||
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||
res=MAlloc(cnt);
|
||||
dst=res;
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8))
|
||||
@@ -151,8 +154,8 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
*dst++=0;
|
||||
b=doc->bin_root.next;
|
||||
if (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
if (b!=&doc->bin_head) {
|
||||
do {
|
||||
if (b->use_cnt>b->temp_use_cnt) {
|
||||
MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
@@ -161,7 +164,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
dst+=b->size;
|
||||
}
|
||||
b=b->next;
|
||||
} while (b!=&doc->bin_root);
|
||||
} while (b!=&doc->bin_head);
|
||||
} else
|
||||
cnt--; //No terminator
|
||||
if (_size) *_size=cnt;
|
||||
@@ -189,7 +192,7 @@ public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
|
||||
//TODO: $LK,"DocRst",A="MN:DocRst"$
|
||||
U8 *dst;
|
||||
Bool unlock_doc,unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ne,*doc_e=doc2->root.next,*doc_ce;
|
||||
CDocEntry *doc_ne,*doc_e=doc2->head.next,*doc_ce;
|
||||
if (!doc) doc=DocPut;
|
||||
unlock_doc=DocLock(doc),
|
||||
DocRemSoftNewLines(doc,NULL);
|
||||
@@ -227,7 +230,7 @@ public U0 StreamDoc(CDoc *doc)
|
||||
{//Inject doc into compile stream. Use inside #exe{}.
|
||||
//TODO: $LK,"DocRst",A="MN:DocRst"$
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
StreamPrint("%s",doc_e->tag);
|
||||
@@ -251,7 +254,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
unlock=DocLock(doc);
|
||||
time_stamp=GetTSC;
|
||||
if (doc->flags&DOCF_UNDO_DIRTY &&
|
||||
time_stamp>doc->undo_root.last->time_stamp+cnts.time_stamp_freq<<4 ||
|
||||
time_stamp>doc->undo_head.last->time_stamp+cnts.time_stamp_freq<<4 ||
|
||||
force) {
|
||||
u=CAlloc(sizeof(CDocUndo),doc->mem_task);
|
||||
u->time_stamp=time_stamp;
|
||||
@@ -259,7 +262,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
doc->flags&=~DOCF_NO_CURSOR;
|
||||
u->body=DocSave(doc,&u->size);
|
||||
doc->flags=flags;
|
||||
QueIns(u,doc->undo_root.last);
|
||||
QueIns(u,doc->undo_head.last);
|
||||
doc->flags&=~DOCF_UNDO_DIRTY;
|
||||
doc->undo_cnt++;
|
||||
u->doc_flags=doc->flags;
|
||||
@@ -274,19 +277,19 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
U0 DocUndoRestore(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocUndo *u=doc->undo_root.last,*u_next,*u_last;
|
||||
if (u!=&doc->undo_root) {
|
||||
CDocUndo *u=doc->undo_head.last,*u_next,*u_last;
|
||||
if (u!=&doc->undo_head) {
|
||||
QueRem(u);
|
||||
u_next=doc->undo_root.next;
|
||||
u_last=doc->undo_root.last;
|
||||
QueInit(&doc->undo_root);
|
||||
u_next=doc->undo_head.next;
|
||||
u_last=doc->undo_head.last;
|
||||
QueInit(&doc->undo_head);
|
||||
DocRst(doc,TRUE);
|
||||
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;
|
||||
doc->undo_head.next=u_next;
|
||||
doc->undo_head.last=u_last;
|
||||
}
|
||||
DocUndoCntSet(doc);
|
||||
doc->flags&=~DOCF_UNDO_DIRTY;
|
||||
|
||||
@@ -28,7 +28,7 @@ U8 *needle,I64 match=1)
|
||||
unlock=DocLock(haystack_doc);
|
||||
if (start_line_num==MIN_I64) {
|
||||
res=TRUE;
|
||||
doc_e=haystack_doc->root.next;
|
||||
doc_e=haystack_doc->head.next;
|
||||
} else {
|
||||
res=DocLineNumGoTo(haystack_doc,start_line_num);
|
||||
doc_e=haystack_doc->cur_entry;
|
||||
@@ -69,7 +69,7 @@ public Bool DocAnchorFind(CDoc *haystack_doc,U8 *needle_str)
|
||||
CDocEntry *doc_e;
|
||||
if (haystack_doc) {
|
||||
unlock=DocLock(haystack_doc);
|
||||
doc_e=haystack_doc->root.next;
|
||||
doc_e=haystack_doc->head.next;
|
||||
if (needle_str)
|
||||
while (doc_e!=haystack_doc) {
|
||||
if (doc_e->type_u8==DOCT_ANCHOR && doc_e->de_flags & DOCEF_AUX_STR) {
|
||||
@@ -170,7 +170,7 @@ fn_skip:
|
||||
public U0 EdSelAll(CDoc *doc,Bool sel)
|
||||
{//Set state of $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries.
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
BEqu(&doc_e->type,DOCEt_SEL,sel);
|
||||
doc_e=doc_e->next;
|
||||
@@ -401,7 +401,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
sf_flags|=SFG_WHOLE_LABELS;
|
||||
|
||||
if (i=doc->find_replace->filter_lines) {
|
||||
doc_ce=doc->root.next;
|
||||
doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
|
||||
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
|
||||
@@ -413,7 +413,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
|
||||
doc_ce=doc->root.next;
|
||||
doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) {
|
||||
found=FALSE;
|
||||
@@ -459,7 +459,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
if (!plen)
|
||||
goto fr_unlock_done;
|
||||
rlen=StrLen(doc->find_replace->replace_text);
|
||||
if (doc->root.next!=doc) {
|
||||
if (doc->head.next!=doc) {
|
||||
doc_e=doc_marker=DocSplitTag(doc,doc->cur_entry,doc->cur_col,
|
||||
doc->cur_entry->x+doc->cur_col,doc->cur_entry->y,DOCT_MARKER);
|
||||
do {
|
||||
|
||||
@@ -260,7 +260,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
ml=ml->next;
|
||||
}
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
if (doc->root.next!=doc) {
|
||||
if (doc->head.next!=doc) {
|
||||
Fs->border_src=BDS_CONST;
|
||||
DocRecalc(doc);
|
||||
if (DocEd(doc,dof_flags)) {
|
||||
@@ -273,7 +273,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
}
|
||||
}
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
*doc_e->user_data(U8 **)=doc_e->data;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
U0 EdUndoFilter(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_ce=doc->root.next;
|
||||
CDocEntry *doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
doc_ce->de_flags&=~DOCEF_FILTER_SKIP;
|
||||
doc_ce=doc_ce->next;
|
||||
|
||||
+25
-8
@@ -7,9 +7,9 @@ U0 DocInit()
|
||||
CHashGeneric *temph;
|
||||
|
||||
DefineLstLoad("ST_DOC_CMDS",
|
||||
"TX\0CR\0SR\0CU\0MK\0TB\0CL\0PB\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
"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");
|
||||
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
"BG\0FD\0BD\0WW\0HL\0BK\0IV\0UL\0SX\0SY\0CM\0AN\0LK\0BT\0"
|
||||
"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"
|
||||
@@ -52,6 +52,7 @@ U0 DocInit()
|
||||
|
||||
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
|
||||
doldoc.type_flags_nontag_invisible[0]=
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_PAGE_LEN|
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
1<<DOCT_RIGHT_MARGIN|
|
||||
@@ -62,18 +63,34 @@ U0 DocInit()
|
||||
1<<DOCT_BACKGROUND|
|
||||
1<<DOCT_DFT_FOREGROUND|
|
||||
1<<DOCT_DFT_BACKGROUND|
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_WORD_WRAP|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_HIGHLIGHT|
|
||||
1<<DOCT_BLINK|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_SHIFTED_X|
|
||||
1<<DOCT_SHIFTED_Y|
|
||||
1<<DOCT_SPRITE|
|
||||
1<<DOCT_HIGHLIGHT;
|
||||
1<<DOCT_SPRITE;
|
||||
|
||||
doldoc.type_flags_data[0]=1<<DOCT_DATA|1<<DOCT_HEX_ED|1<<DOCT_CHECK_BOX;
|
||||
|
||||
doldoc.type_flags_chk_dup[0]=
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
1<<DOCT_RIGHT_MARGIN|
|
||||
1<<DOCT_HEADER|
|
||||
1<<DOCT_FOOTER|
|
||||
1<<DOCT_FOREGROUND|
|
||||
1<<DOCT_BACKGROUND|
|
||||
1<<DOCT_DFT_FOREGROUND|
|
||||
1<<DOCT_DFT_BACKGROUND|
|
||||
1<<DOCT_WORD_WRAP|
|
||||
1<<DOCT_HIGHLIGHT|
|
||||
1<<DOCT_BLINK|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_SHIFTED_X|
|
||||
1<<DOCT_SHIFTED_Y;
|
||||
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_RIGHT);
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_LEFT);
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_UP);
|
||||
|
||||
+16
-16
@@ -5,11 +5,11 @@ StrCpy(captured_macro_name,"Test");
|
||||
|
||||
I64 sys_macro_repeat_n=1;
|
||||
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_root,I64 a1,I64 a2)
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
tempc=macro_root->next;
|
||||
while (tempc!=macro_root) {
|
||||
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 ||
|
||||
@@ -50,20 +50,20 @@ CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
||||
return tempmt;
|
||||
}
|
||||
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_root)
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||
{
|
||||
CSrvCmd *tempc;
|
||||
I64 cnt=1; //terminating zero
|
||||
U8 *ptr,*m;
|
||||
CMacroTemp *tempmt,*tempmt1,root;
|
||||
CMacroTemp *tempmt,*tempmt1,head;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
|
||||
QueInit(&root);
|
||||
root.type=MT_NULL;
|
||||
tempc=macro_root->next;
|
||||
while (tempc!=macro_root) {
|
||||
QueInit(&head);
|
||||
head.type=MT_NULL;
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
tempmt=Cmd2MT(tempc);
|
||||
QueIns(tempmt,root.last);
|
||||
QueIns(tempmt,head.last);
|
||||
cnt+=StrLen(tempmt->buf);
|
||||
if (tempmt->type==MT_CHAR) {
|
||||
if (tempmt->last->type!=MT_CHAR)
|
||||
@@ -77,8 +77,8 @@ U8 *SysMacro2Str(CSrvCmd *macro_root)
|
||||
m=MAlloc(cnt);
|
||||
ptr=m;
|
||||
|
||||
tempmt=root.next;
|
||||
while (tempmt!=&root) {
|
||||
tempmt=head.next;
|
||||
while (tempmt!=&head) {
|
||||
tempmt1=tempmt->next;
|
||||
if (tempmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tempmt->buf);
|
||||
@@ -108,7 +108,7 @@ U0 PlaySysMacro(I64 n=1)
|
||||
U8 *m;
|
||||
if (TaskValidate(task)) {
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
m=SysMacro2Str(&sys_macro_root);
|
||||
m=SysMacro2Str(&sys_macro_head);
|
||||
while (n-- && TaskValidate(task)) {
|
||||
if (task==Fs)
|
||||
AutoStr("%s",m);
|
||||
@@ -121,9 +121,9 @@ U0 PlaySysMacro(I64 n=1)
|
||||
|
||||
U0 EdInsCapturedMacro()
|
||||
{
|
||||
U8 *st=SysMacro2Str(&sys_macro_root);
|
||||
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+LA,T=\"%s\",LM=\"%$$Q\"$$",
|
||||
captured_macro_name,st);
|
||||
Free(st);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ U0 MacroTask(I64)
|
||||
switch (i) {
|
||||
case SM_RECORD:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
QueDel(&sys_macro_root,TRUE);
|
||||
QueDel(&sys_macro_head,TRUE);
|
||||
LBts(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case SM_PLAY:
|
||||
|
||||
+20
-20
@@ -123,9 +123,9 @@ U0 DocUndoDel(CDoc *,CDocUndo *u)
|
||||
U0 DocUndoCntSet(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocUndo *u=doc->undo_root.next;
|
||||
CDocUndo *u=doc->undo_head.next;
|
||||
doc->undo_cnt=0;
|
||||
while (u!=&doc->undo_root) {
|
||||
while (u!=&doc->undo_head) {
|
||||
doc->undo_cnt++;
|
||||
u=u->next;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=StrNew(doc_e->tag,task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
doc_ne->data=MAllocIdent(doc_e->data,task);
|
||||
@@ -179,7 +179,7 @@ U0 DocRemSoftNewLines(CDoc *doc=NULL,CDocEntry *doc_e=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
if (!doc_e) doc_e=doc->root.next;
|
||||
if (!doc_e) doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e->type_u8==DOCT_SOFT_NEW_LINE) {
|
||||
@@ -244,20 +244,20 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
if (is_old) {
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
DocEntryDel(doc,doc_e);
|
||||
doc_e=doc_e2;
|
||||
}
|
||||
u=doc->undo_root.next;
|
||||
while (u!=&doc->undo_root) {
|
||||
u=doc->undo_head.next;
|
||||
while (u!=&doc->undo_head) {
|
||||
u8=u->next;
|
||||
DocUndoDel(doc,u);
|
||||
u=u8;
|
||||
}
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b1=b->next;
|
||||
QueRem(b);
|
||||
Free(b->data);
|
||||
@@ -267,10 +267,10 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
}
|
||||
//Check $LK,"DocInsDoc",A="MN:DocInsDoc"$
|
||||
doc->flags&=DOCF_BREAK_UNLOCKED;
|
||||
doc->root.next=doc->root.last=doc;
|
||||
QueInit(&doc->bin_root);
|
||||
QueInit(&doc->undo_root);
|
||||
doc->undo_root.time_stamp=0;
|
||||
doc->head.next=doc->head.last=doc;
|
||||
QueInit(&doc->bin_head);
|
||||
QueInit(&doc->undo_head);
|
||||
doc->undo_head.time_stamp=0;
|
||||
doc->undo_cnt=0;
|
||||
doc->cur_bin_num=1;
|
||||
doc->dollar_buf_ptr=0;
|
||||
@@ -278,7 +278,7 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
doc->page_line_num=0;
|
||||
doc->best_d=MAX_I64;
|
||||
|
||||
s=&doc->settings_root;
|
||||
s=&doc->settings_head;
|
||||
s->left_margin=DOC_DFT;
|
||||
s->right_margin=DOC_DFT;
|
||||
s->indent=0;
|
||||
@@ -293,7 +293,7 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
s->shifted_y=0;
|
||||
s->cur_text_attr=s->dft_text_attr=DOC_ATTR_DFT_TEXT;
|
||||
|
||||
doc_e=&doc->root;
|
||||
doc_e=&doc->head;
|
||||
doc_e->type=DOCT_ERROR;
|
||||
doc_e->de_flags=0;
|
||||
doc_e->x=0;
|
||||
@@ -331,21 +331,21 @@ public I64 DocSize(CDoc *doc)
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return 0;
|
||||
unlock=DocLock(doc);
|
||||
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
res+=DocEntrySize(doc,doc_e);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
|
||||
u=doc->undo_root.next;
|
||||
while (u!=&doc->undo_root) {
|
||||
u=doc->undo_head.next;
|
||||
while (u!=&doc->undo_head) {
|
||||
res+=MSize2(u->body);
|
||||
res+=MSize2(u);
|
||||
u=u->next;
|
||||
}
|
||||
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
res+=MSize2(b->data);
|
||||
res+=MSize2(b);
|
||||
b=b->next;
|
||||
|
||||
+13
-3
@@ -53,13 +53,23 @@ I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
|
||||
{//Optimize Doc.
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 res=0;
|
||||
CDocEntry *doc_e;
|
||||
CDocEntry *doc_e,*doc_e1,*doc_e_last;
|
||||
DocRecalc(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e_last=NULL;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (res+=DocOptEntry(doc,doc_e,fuf_flags))
|
||||
res+=DocOptEntry(doc,doc_e,fuf_flags);
|
||||
doc_e=doc_e->next;
|
||||
if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 &&
|
||||
doc_e_last->de_flags==doc_e->de_flags &&
|
||||
Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) &&
|
||||
doc_e_last->attr==doc_e->attr) {
|
||||
DocEntryDel(doc,doc_e);
|
||||
res++;
|
||||
} else
|
||||
doc_e_last=doc_e;
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
DocRecalc(doc);
|
||||
if (unlock)
|
||||
|
||||
+13
-13
@@ -10,10 +10,10 @@ I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||
if (res<64) {
|
||||
BEqu(_de_flags,res,turn_on);
|
||||
switch (res) {
|
||||
case DOCEf_SEL:
|
||||
case DOCEf_UNDERLINE:
|
||||
case DOCEf_INVERT:
|
||||
case DOCEf_BLINK:
|
||||
case DOCEf_INVERT:
|
||||
case DOCEf_UNDERLINE:
|
||||
case DOCEf_SEL:
|
||||
BEqu(_type,res,turn_on);
|
||||
break;
|
||||
}
|
||||
@@ -105,9 +105,9 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
case DOCT_INDENT:
|
||||
case DOCT_WORD_WRAP:
|
||||
case DOCT_HIGHLIGHT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_BLINK:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_SHIFTED_X:
|
||||
case DOCT_SHIFTED_Y:
|
||||
if (attr!=DOC_DFT) {
|
||||
@@ -273,9 +273,9 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
case DOCT_DFT_BACKGROUND:
|
||||
case DOCT_WORD_WRAP:
|
||||
case DOCT_HIGHLIGHT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_BLINK:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_SHIFTED_X:
|
||||
case DOCT_SHIFTED_Y:
|
||||
while (cc->token==',')
|
||||
@@ -575,7 +575,7 @@ U0 DocEntryToggle(CDoc *doc)
|
||||
st=Doc2PlainText(doc,doc_ce);
|
||||
LBEqu(&doc->flags,DOCf_COLOR_NAMES,old_color_names);
|
||||
DocEntryDel(doc,doc_ce);
|
||||
DocPrint(doc,"$$$$%Q$$$$",st);
|
||||
DocPrint(doc,"$$$$%$$Q$$$$",st);
|
||||
}
|
||||
DocRecalc(doc);
|
||||
}
|
||||
@@ -593,13 +593,13 @@ U0 DocFlagsToggle(CDoc *doc,I64 tog_flags)
|
||||
doc->flags=doc->flags&~DOCF_NO_CURSOR|DOCF_COLOR_NAMES;
|
||||
st=DocSave(doc,&size);
|
||||
|
||||
u_next=doc->undo_root.next;
|
||||
u_last=doc->undo_root.last;
|
||||
doc->undo_root.next=doc->undo_root.last=&doc->undo_root;
|
||||
u_next=doc->undo_head.next;
|
||||
u_last=doc->undo_head.last;
|
||||
doc->undo_head.next=doc->undo_head.last=&doc->undo_head;
|
||||
|
||||
DocRst(doc,TRUE);
|
||||
doc->undo_root.next=u_next;
|
||||
doc->undo_root.last=u_last;
|
||||
doc->undo_head.next=u_next;
|
||||
doc->undo_head.last=u_last;
|
||||
DocUndoCntSet(doc);
|
||||
doc->flags=flags&~(DOCF_NO_CURSOR|DOCG_BL_IV_UL|DOCF_WORD_WRAP);
|
||||
DocLoad(doc,st,size);
|
||||
|
||||
@@ -97,7 +97,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->last;
|
||||
}
|
||||
doc_ce=doc->cur_entry=doc->root.next;
|
||||
doc_ce=doc->cur_entry=doc->head.next;
|
||||
doc->cur_col=doc_ce->min_col;
|
||||
DocFormFwd(doc);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
(doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y>i ||
|
||||
doc_ce->type_u8==DOCT_HEX_ED &&
|
||||
doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width>i) &&
|
||||
doc_ce->y!=doc->root.next->y) {
|
||||
doc_ce->y!=doc->head.next->y) {
|
||||
EdLineUp(doc,sc);
|
||||
//paranoid check for stuck on same node
|
||||
if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED)
|
||||
@@ -256,7 +256,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (TaskValidate(sys_macro_task))
|
||||
PostMsgWait(sys_macro_task,
|
||||
MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
SysMacroStripKey(&sys_macro_root,ch,sc);
|
||||
SysMacroStripKey(&sys_macro_head,ch,sc);
|
||||
PlaySysMacro;
|
||||
} else
|
||||
EdMacroUtil;
|
||||
|
||||
+12
-12
@@ -27,7 +27,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
if (!ch) {
|
||||
if (j=ptr-ptr2) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -46,7 +46,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
if (j=ptr-ptr2) {
|
||||
*ptr=0;
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -72,19 +72,19 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
switch (ch) {
|
||||
case CH_CURSOR:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case CH_FORM_FEED:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case '\t':
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TAB|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
@@ -97,13 +97,13 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
*ptr=0; //zero second dollar
|
||||
if (ptr-1==ptr2 && *ptr2==CH_CURSOR) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr2++;
|
||||
}
|
||||
if (ptr==ptr2) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
doc_e->max_col=1;
|
||||
if (doc->flags & DOCF_DBL_DOLLARS)
|
||||
doc_e->tag=StrNew("$$$$",doc->mem_task);
|
||||
@@ -117,11 +117,11 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
while (ch=*ptr3++) {
|
||||
if (ch==CH_CURSOR) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else if (ch==CH_FORM_FEED) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else
|
||||
*ptr4++=ch;
|
||||
@@ -138,7 +138,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
break;
|
||||
default:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
if (ch=='\r')
|
||||
while (*ptr=='\r')
|
||||
@@ -214,7 +214,7 @@ public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
|
||||
doc_ce->tag=st;
|
||||
} else {
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,ptr2);
|
||||
doc_ne->type=DOCT_TEXT|doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT|doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
doc->cur_entry=doc_ne;
|
||||
@@ -263,7 +263,7 @@ U0 DocDump(CDoc *doc,I64 uS_delay=0)
|
||||
U8 *st;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
st=DocScanLine(doc,doc_e,NULL,&doc_e2);
|
||||
"%s",st;
|
||||
|
||||
+93
-93
@@ -353,8 +353,8 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->line_start_col=0;
|
||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_root.cur_text_attr=
|
||||
doc->settings_root.dft_text_attr=win_task->border_attr;
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->border_attr;
|
||||
} else {
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) {
|
||||
if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) {
|
||||
@@ -374,8 +374,8 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_root.cur_text_attr=
|
||||
doc->settings_root.dft_text_attr=win_task->text_attr;
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->text_attr;
|
||||
}
|
||||
x0=doc->line_start_col;
|
||||
y0=doc->top_line_num;
|
||||
@@ -395,16 +395,16 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
|
||||
if (doc->cur_col<=doc->cur_entry->min_col)
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
doc_e->de_flags&=~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
|
||||
if (doc_e==doc->root.next)
|
||||
s=&doc->settings_root;
|
||||
if (doc_e==doc->head.next)
|
||||
s=&doc->settings_head;
|
||||
else
|
||||
s=&doc_e->last->settings;
|
||||
doc->flags=doc_e->de_flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP) |
|
||||
doc->flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP);
|
||||
cur_u8_attr=s->cur_text_attr;
|
||||
if (doc_e==doc->root.next) {
|
||||
if (doc_e==doc->head.next) {
|
||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
@@ -412,14 +412,14 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
doc->flags&~DOCEF_HIGHLIGHT;
|
||||
|
||||
if (doc->root.next==doc) {
|
||||
if (doc->head.next==doc) {
|
||||
best_doc_e=doc;
|
||||
best_col=0;
|
||||
doc->cur_entry=doc;
|
||||
doc->cur_col=0;
|
||||
doc_e=doc;
|
||||
}
|
||||
skipped_update= doc_e==doc && doc->root.next!=doc;
|
||||
skipped_update= doc_e==doc && doc->head.next!=doc;
|
||||
|
||||
if (full_refresh) {
|
||||
doc->min_x=MAX_I32; doc->min_y=MAX_I32;
|
||||
@@ -716,41 +716,6 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
x-=doc_e->hex_ed_width*3+k+9;
|
||||
}
|
||||
break;
|
||||
case DOCT_TAB:
|
||||
k=(x+8) & ~7;
|
||||
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 &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(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," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
while (k--) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
x++;
|
||||
}
|
||||
} else
|
||||
x+=k;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
@@ -809,34 +774,68 @@ rc_adjust_xy:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DOCT_CURSOR_MOVEMENT:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
x+=doc_e->cursor_x_offset;
|
||||
if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
|
||||
i=doc->page_line_num;
|
||||
if (doc_e->de_flags & DOCEF_TOP_Y)
|
||||
doc->page_line_num=0;
|
||||
else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
|
||||
doc->page_line_num=s->page_len-1;
|
||||
else if (doc_e->de_flags & DOCEF_CENTER_Y)
|
||||
doc->page_line_num=s->page_len>>1;
|
||||
y+=doc->page_line_num-i;
|
||||
case DOCT_TAB:
|
||||
k=(x+8) & ~7;
|
||||
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 &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(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," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
while (k--) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
x++;
|
||||
}
|
||||
} else
|
||||
x+=k;
|
||||
}
|
||||
}
|
||||
y+=doc_e->cursor_y_offset;
|
||||
doc->page_line_num+=doc_e->cursor_y_offset;
|
||||
goto rc_adjust_xy;
|
||||
break;
|
||||
case DOCT_PAGE_BREAK:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
y+=s->page_len-doc_e->page_line_num;
|
||||
doc->page_line_num=0;
|
||||
goto rc_start_of_line;
|
||||
case DOCT_INDENT:
|
||||
if (doc_e->de_flags & DOCEF_LEFT_X)
|
||||
i=doc_e->attr;
|
||||
case DOCT_CURSOR:
|
||||
if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
if (doc_e!=added_cursor)
|
||||
del_doc_e=TRUE;
|
||||
break;
|
||||
case DOCT_PMT:
|
||||
cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT;
|
||||
if (y==cursor_y) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
break;
|
||||
case DOCT_CLEAR:
|
||||
next_clear_found=doc_e;
|
||||
if (doc_e->de_flags&DOCEF_HOLD)
|
||||
clear_holds=TRUE;
|
||||
else
|
||||
i=s->indent+doc_e->attr;
|
||||
s->indent=i;
|
||||
goto rc_start_of_line;
|
||||
clear_holds=FALSE;
|
||||
break;
|
||||
case DOCT_PAGE_LEN:
|
||||
s->page_len=doc_e->attr;
|
||||
if (doc_e->de_flags & DOCEF_WIN_REL)
|
||||
@@ -861,6 +860,13 @@ rc_adjust_xy:
|
||||
case DOCT_FOOTER:
|
||||
s->footer=doc_e->attr;
|
||||
goto rc_adjust_xy;
|
||||
case DOCT_INDENT:
|
||||
if (doc_e->de_flags & DOCEF_LEFT_X)
|
||||
i=doc_e->attr;
|
||||
else
|
||||
i=s->indent+doc_e->attr;
|
||||
s->indent=i;
|
||||
goto rc_start_of_line;
|
||||
case DOCT_FOREGROUND:
|
||||
cur_u8_attr&=0xF0;
|
||||
if (doc_e->attr==DOC_DFT)
|
||||
@@ -895,13 +901,6 @@ rc_adjust_xy:
|
||||
s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0;
|
||||
s->cur_text_attr=cur_u8_attr;
|
||||
break;
|
||||
case DOCT_PMT:
|
||||
cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT;
|
||||
if (y==cursor_y) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
break;
|
||||
case DOCT_WORD_WRAP:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_WORD_WRAP;
|
||||
@@ -914,11 +913,11 @@ rc_adjust_xy:
|
||||
else
|
||||
doc->flags&=~DOCF_HIGHLIGHT;
|
||||
break;
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_BLINK:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_UNDERLINE;
|
||||
doc->flags|=DOCF_BLINK;
|
||||
else
|
||||
doc->flags&=~DOCF_UNDERLINE;
|
||||
doc->flags&=~DOCF_BLINK;
|
||||
break;
|
||||
case DOCT_INVERT:
|
||||
if (doc_e->attr)
|
||||
@@ -926,11 +925,11 @@ rc_adjust_xy:
|
||||
else
|
||||
doc->flags&=~DOCF_INVERT;
|
||||
break;
|
||||
case DOCT_BLINK:
|
||||
case DOCT_UNDERLINE:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_BLINK;
|
||||
doc->flags|=DOCF_UNDERLINE;
|
||||
else
|
||||
doc->flags&=~DOCF_BLINK;
|
||||
doc->flags&=~DOCF_UNDERLINE;
|
||||
break;
|
||||
case DOCT_SHIFTED_X:
|
||||
s->shifted_x=doc_e->attr;
|
||||
@@ -938,14 +937,22 @@ rc_adjust_xy:
|
||||
case DOCT_SHIFTED_Y:
|
||||
s->shifted_y=doc_e->attr;
|
||||
break;
|
||||
case DOCT_CURSOR:
|
||||
if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
case DOCT_CURSOR_MOVEMENT:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
x+=doc_e->cursor_x_offset;
|
||||
if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
|
||||
i=doc->page_line_num;
|
||||
if (doc_e->de_flags & DOCEF_TOP_Y)
|
||||
doc->page_line_num=0;
|
||||
else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
|
||||
doc->page_line_num=s->page_len-1;
|
||||
else if (doc_e->de_flags & DOCEF_CENTER_Y)
|
||||
doc->page_line_num=s->page_len>>1;
|
||||
y+=doc->page_line_num-i;
|
||||
}
|
||||
if (doc_e!=added_cursor)
|
||||
del_doc_e=TRUE;
|
||||
break;
|
||||
y+=doc_e->cursor_y_offset;
|
||||
doc->page_line_num+=doc_e->cursor_y_offset;
|
||||
goto 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);
|
||||
@@ -1040,13 +1047,6 @@ rc_adjust_xy:
|
||||
}
|
||||
doc->flags|=DOCF_HAS_SONG;
|
||||
break;
|
||||
case DOCT_CLEAR:
|
||||
next_clear_found=doc_e;
|
||||
if (doc_e->de_flags&DOCEF_HOLD)
|
||||
clear_holds=TRUE;
|
||||
else
|
||||
clear_holds=FALSE;
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
if (recalc_flags&RECALCF_TO_HTML &&
|
||||
doc_e->de_flags&DOCEF_TAG && doc_e->tag)
|
||||
|
||||
@@ -8,7 +8,7 @@ I64 DocCharDist(CDoc *doc,I64 x,I64 y)
|
||||
|
||||
U0 DocDelToNum(CDoc *doc,I64 num)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e2;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e2;
|
||||
while (num-->0 && doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) {
|
||||
@@ -24,7 +24,7 @@ U0 DocDelToNum(CDoc *doc,I64 num)
|
||||
|
||||
U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e2;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e2;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) {
|
||||
@@ -76,7 +76,7 @@ public U0 DocTop(CDoc *doc=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
doc->cur_entry=doc->root.next;
|
||||
doc->cur_entry=doc->head.next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
doc->x=0;
|
||||
doc->y=0;
|
||||
@@ -161,7 +161,7 @@ public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_TREE)
|
||||
BEqu(&doc_e->de_flags,DOCEf_CHECKED_COLLAPSED,collapse);
|
||||
|
||||
@@ -7,7 +7,7 @@ public Bool DocTreeFind(CDoc *haystack_doc,U8 *needle_path,
|
||||
I64 i=0,k=0;
|
||||
U8 *st1=StrNew(needle_path),*st2=MAlloc(StrLen(needle_path)+1);
|
||||
Bool res=FALSE,unlock_doc=DocLock(haystack_doc);
|
||||
CDocEntry *doc_e=haystack_doc->root.next;
|
||||
CDocEntry *doc_e=haystack_doc->head.next;
|
||||
if (_tree_entry) *_tree_entry=haystack_doc;
|
||||
if (_start_indent) *_start_indent=haystack_doc;
|
||||
if (_end_indent) *_end_indent=haystack_doc;
|
||||
@@ -65,7 +65,7 @@ public Bool DocTreeMake(CDoc *doc,U8 *path)
|
||||
*st2=MAlloc(StrLen(path)+1),
|
||||
*st3=StrNew(path);
|
||||
Bool res=TRUE,unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
doc->cur_entry=doc;
|
||||
doc->cur_col=0;
|
||||
while (*st1 && doc_e!=doc) {
|
||||
|
||||
@@ -363,22 +363,23 @@ U0 EdInsLink()
|
||||
switch (type) {
|
||||
case LK_PLACE_ANCHOR:
|
||||
if (html_link)
|
||||
st=MStrPrint("$$AN,\"%Q\",A=\"%Q\",HTML=\"%Q\"$$",tag,link,html_link);
|
||||
st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$",
|
||||
tag,link,html_link);
|
||||
else
|
||||
st=MStrPrint("$$AN,\"%Q\",A=\"%Q\"$$",tag,link);
|
||||
st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\"$$",tag,link);
|
||||
break;
|
||||
default:
|
||||
if (html_link)
|
||||
st=MStrPrint("$$LK%s,\"%Q\",A=\"%Q\",HTML=\"%Q\"$$",
|
||||
st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$",
|
||||
pop_up_st,tag,link,html_link);
|
||||
else
|
||||
st=MStrPrint("$$LK%s,\"%Q\",A=\"%Q\"$$",pop_up_st,tag,link);
|
||||
st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\"$$",pop_up_st,tag,link);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (st) {
|
||||
if (quote)
|
||||
"%Q",st;
|
||||
"%$$Q",st;
|
||||
else
|
||||
"%s",st;
|
||||
}
|
||||
@@ -540,7 +541,7 @@ U0 EdInsText()
|
||||
if (e->tree) CatPrint(buf,"+TR");
|
||||
if (e->collapsed) CatPrint(buf,"+C");
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$TX%s,\"%Q\"",buf,st;
|
||||
"$$TX%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->shift_x)
|
||||
",SX=%s",e->shift_x;
|
||||
@@ -550,12 +551,12 @@ U0 EdInsText()
|
||||
",SCX=%s",e->scroll_x;
|
||||
if (*e->define_str) {
|
||||
st=MStrPrint("%q",e->define_str);
|
||||
",D=\"%Q\"",st;
|
||||
",D=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->html_link) {
|
||||
st=MStrPrint("%q",e->html_link);
|
||||
",HTML=\"%Q\"",st;
|
||||
",HTML=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$";
|
||||
@@ -573,7 +574,7 @@ U0 EdInsSong()
|
||||
{
|
||||
CEdSong *e=CAlloc(sizeof(CEdSong));
|
||||
if (DocForm(e,,,,ctrl_L_footer))
|
||||
"$$SO,\"%Q\",A=\"%s\"$$",e->tag,e->song;
|
||||
"$$SO,\"%$$Q\",A=\"%s\"$$",e->tag,e->song;
|
||||
Free(e);
|
||||
}
|
||||
|
||||
@@ -586,7 +587,7 @@ U0 EdInsHtml()
|
||||
{
|
||||
CEdHtmlCode *e=CAlloc(sizeof(CEdHtmlCode));
|
||||
if (DocForm(e,,,,ctrl_L_footer))
|
||||
"$$HC,\"%Q\"$$",e->tag;
|
||||
"$$HC,\"%$$Q\"$$",e->tag;
|
||||
Free(e);
|
||||
}
|
||||
|
||||
@@ -632,20 +633,20 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
if (is_macro) {
|
||||
if (*e->tag) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$MA%s,\"%Q\"",buf,st;
|
||||
"$$MA%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
} else
|
||||
"$$MA%s",buf;
|
||||
} else {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$MU%s,\"%Q\"",buf,st;
|
||||
"$$MU%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\"%Q\"",st;
|
||||
",LM=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->shift_x)
|
||||
@@ -692,25 +693,25 @@ U0 EdInsButton()
|
||||
if (*e->tag) {
|
||||
if (e->quote) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$$$BT%s,\\\"%Q\\\"",buf,st;
|
||||
"$$$$BT%s,\\\"%$$Q\\\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\\\"%Q\\\"",st;
|
||||
",LM=\\\"%$$Q\\\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$$$";
|
||||
} else {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$BT%s,\"%Q\"",buf,st;
|
||||
"$$BT%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\"%Q\"",st;
|
||||
",LM=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$";
|
||||
@@ -820,11 +821,11 @@ U0 EdInsData()
|
||||
|
||||
st=MStrPrint("%q",e->fmt_str);
|
||||
if (e->remalloc)
|
||||
"$$$$DA%s,A=\\\"%Q\\\"$$$$",buf,st;
|
||||
"$$$$DA%s,A=\\\"%$$Q\\\"$$$$",buf,st;
|
||||
else if (e->len==DOCE_LEN_DFT)
|
||||
"$$$$DA%s%s,A=\\\"%Q\\\"$$$$",buf,raw_type,st;
|
||||
"$$$$DA%s%s,A=\\\"%$$Q\\\"$$$$",buf,raw_type,st;
|
||||
else
|
||||
"$$$$DA%s,LEN=%d%s,A=\\\"%Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
"$$$$DA%s,LEN=%d%s,A=\\\"%$$Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
@@ -852,7 +853,7 @@ U0 EdInsCheckBox()
|
||||
StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES");
|
||||
if (e->refresh) CatPrint(buf,"+RD");
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$$$CB%s%s,\\\"%Q\\\"$$$$",buf,raw_type,st;
|
||||
"$$$$CB%s%s,\\\"%$$Q\\\"$$$$",buf,raw_type,st;
|
||||
Free(st);
|
||||
}
|
||||
Free(e);
|
||||
@@ -885,9 +886,9 @@ U0 EdInsLst()
|
||||
st1=MStrPrint("%q",e->tag);
|
||||
st2=MStrPrint("%q",e->define_str);
|
||||
if (st1)
|
||||
"$$$$LS%s%s,\\\"%Q\\\",D=\\\"%Q\\\"$$$$",buf,raw_type,st1,st2;
|
||||
"$$$$LS%s%s,\\\"%$$Q\\\",D=\\\"%$$Q\\\"$$$$",buf,raw_type,st1,st2;
|
||||
else
|
||||
"$$$$LS%s%s,D=\\\"%Q\\\"$$$$",buf,raw_type,st2;
|
||||
"$$$$LS%s%s,D=\\\"%$$Q\\\"$$$$",buf,raw_type,st2;
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -940,14 +941,14 @@ U0 EdInsBin(I64 bin_num,I64 type)
|
||||
"bin tag.\n\n",ctrl_L_footer)) {
|
||||
if (*e->bin_ptr_link_file) {
|
||||
if (*e->bin_ptr_link_tag)
|
||||
"$$%Z,\"%Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
"$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
e->bin_ptr_link_file,e->bin_ptr_link_tag;
|
||||
else
|
||||
"$$%Z,\"%Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
"$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
e->bin_ptr_link_file,e->bin_ptr_link_bin_num;
|
||||
} else {
|
||||
if (DocBinFindNum(DocPut,e->bin_num))
|
||||
"$$%Z,\"%Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num;
|
||||
"$$%Z,\"%$$Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num;
|
||||
else
|
||||
PopUpOk("Invalid Binary Num");
|
||||
}
|
||||
@@ -972,7 +973,7 @@ U0 EdInsTree()
|
||||
*buf=0;
|
||||
if (!e->collapsed) CatPrint(buf,"-C");
|
||||
st1=MStrPrint("%q",e->tag);
|
||||
st2=MStrPrint("$$TR%s,\"%Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
st2=MStrPrint("$$TR%s,\"%$$Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
buf,st1,e->indent,-e->indent);
|
||||
DocPrintAtomic(DocPut,"%s",st2);
|
||||
Free(st1);
|
||||
@@ -1097,7 +1098,7 @@ U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
I64 type=PopUpLinkType(FALSE);
|
||||
*_html_link=NULL;
|
||||
if (type>=0 && GetLink(type,&tag,&link,_pop_up,"e,_html_link))
|
||||
res=MStrPrint("\"%Q\",A=\"%Q\"",tag,link);
|
||||
res=MStrPrint("\"%$$Q\",A=\"%$$Q\"",tag,link);
|
||||
Free(tag);
|
||||
Free(link);
|
||||
return res;
|
||||
@@ -1122,7 +1123,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
if (e->popup) CatPrint(buf,"+PU");
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st=MStrPrint("%q",e->exp);
|
||||
st1=MStrPrint("\"%Q\",LM=\"%Q\"",e->tag,st);
|
||||
st1=MStrPrint("\"%$$Q\",LM=\"%$$Q\"",e->tag,st);
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
@@ -1130,7 +1131,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,"CEdMenuSprite",,,ctrl_L_footer)) {
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st1=MStrPrint("\"%Q\",LE=%s",e->tag,e->exp);
|
||||
st1=MStrPrint("\"%$$Q\",LE=%s",e->tag,e->exp);
|
||||
}
|
||||
break;
|
||||
case EST_SPRITE_LINK:
|
||||
@@ -1151,7 +1152,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
}
|
||||
if (st1) {
|
||||
if (html_link)
|
||||
st2=MStrPrint("$$SP%s,%s,HTML=\"%Q\",BI=%d$$",buf,st1,html_link,bin_num);
|
||||
st2=MStrPrint("$$SP%s,%s,HTML=\"%$$Q\",BI=%d$$",buf,st1,html_link,bin_num);
|
||||
else
|
||||
st2=MStrPrint("$$SP%s,%s,BI=%d$$",buf,st1,bin_num);
|
||||
Free(st1);
|
||||
|
||||
@@ -25,6 +25,7 @@ public class CDolDocGlbls
|
||||
type_flags_nontag_invisible [(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],
|
||||
clean_scan_codes [4];
|
||||
I32 dft_type_flags [DOCT_NUM_TYPES];
|
||||
} doldoc;
|
||||
|
||||
Reference in new issue
Block a user