TempleOSCDV4.03.ISO
This commit is contained in:
1 parent
1541d7328d
commit
0f1a4a5d65
115 files changed
+5372
-4617
No files matched your search
Binary file not shown.
@@ -67,26 +67,28 @@ public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".")
|
||||
CDirContext *dirc;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *st;
|
||||
if (!(tempde=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||
if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||
return FALSE;
|
||||
if (IsDir(dst_files_find_mask)) {
|
||||
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
|
||||
tempde=tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (!(tempde->attr & RS_ATTR_DIR)) {
|
||||
st=FileNameAbs(tempde->name);
|
||||
if (!CopySingle(tempde->full_name,st))
|
||||
result=FALSE;
|
||||
Free(st);
|
||||
}
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
return result;
|
||||
} else
|
||||
} else {
|
||||
DirTreeDel(tempde1);
|
||||
return CopySingle(src_files_find_mask,dst_files_find_mask);
|
||||
}
|
||||
}
|
||||
|
||||
public Bool Move(U8 *f1,U8 *f2)
|
||||
@@ -206,8 +208,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
|
||||
{
|
||||
CDrv *dv=Let2Drv(*filename);
|
||||
CDirEntry de;
|
||||
U8 *cur_dir=StrNew(filename),
|
||||
buf[STR_LEN];
|
||||
U8 *cur_dir=StrNew(filename),buf[STR_LEN];
|
||||
if (FileFind(filename,&de,FUF_JUST_FILES)) {
|
||||
Free(de.full_name);
|
||||
if (!StrCmp(attr,"+?"))
|
||||
@@ -226,6 +227,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
|
||||
}
|
||||
} else
|
||||
PrintErr("File not found.\n");
|
||||
Free(cur_dir);
|
||||
}
|
||||
public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?",
|
||||
U8 *fu_flags=NULL,CDate cdt=MIN_I64)
|
||||
|
||||
+11
-11
@@ -35,7 +35,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
ptr=*ptr;
|
||||
if (ChkPtr(ptr)) {
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,64,A=\"%%40ts\"$$\n");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
|
||||
doc_e->data=ptr;
|
||||
DocDataFmt(doc,doc_e);
|
||||
} else
|
||||
@@ -46,13 +46,13 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) {
|
||||
if (j==1) {
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=U8,A=\"%%c\"$$\n");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n");
|
||||
doc_e->data=ptr;
|
||||
} else
|
||||
DocPrint(doc,"%c\n",*ptr(U8 *));
|
||||
} else {
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,64,A=\"%%40ts\"$$\n");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
|
||||
doc_e->data=ptr;
|
||||
DocDataFmt(doc,doc_e);
|
||||
} else
|
||||
@@ -66,56 +66,56 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
break;
|
||||
case RT_I8:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=I8,A=\"%%02X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$$ ");
|
||||
doc_e->data=ptr(I8 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%02X ",*ptr(I8 *)++);
|
||||
break;
|
||||
case RT_U8:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=U8,A=\"%%02X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$$ ");
|
||||
doc_e->data=ptr(U8 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%02X ",*ptr(U8 *)++);
|
||||
break;
|
||||
case RT_I16:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=I16,A=\"%%04X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$$ ");
|
||||
doc_e->data=ptr(I16 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%04X ",*ptr(I16 *)++);
|
||||
break;
|
||||
case RT_U16:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=U16,A=\"%%04X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$$ ");
|
||||
doc_e->data=ptr(U16 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%04X ",*ptr(U16 *)++);
|
||||
break;
|
||||
case RT_I32:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=I32,A=\"%%08X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$$ ");
|
||||
doc_e->data=ptr(I32 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%08X ",*ptr(I32 *)++);
|
||||
break;
|
||||
case RT_U32:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=U32,A=\"%%08X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$$ ");
|
||||
doc_e->data=ptr(U32 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%08X ",*ptr(U32 *)++);
|
||||
break;
|
||||
case RT_F64:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=F64,A=\"%%16g\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$$ ");
|
||||
doc_e->data=ptr(F64 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%16g ",*ptr(I64 *)++);
|
||||
break;
|
||||
default:
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,A=\"%%016X\"$$ ");
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,A=\"%%016X\"$$ ");
|
||||
doc_e->data=ptr(I64 *)++;
|
||||
} else
|
||||
DocPrint(doc,"%016X ",*ptr(I64 *)++);
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ U0 LoadDocDefines()
|
||||
//This is cut and replaced when I generate a distro.
|
||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","118,999");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,991");
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,687");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,688");
|
||||
$ID,-4$
|
||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
|
||||
+4
-2
@@ -16,7 +16,7 @@ extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,
|
||||
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
|
||||
extern U0 DocBinsValidate(CDoc *doc);
|
||||
extern U0 DocBottom(CDoc *doc=NULL);
|
||||
extern U0 DocCenter(CDoc *doc=NULL,I64 recalc=DOC_RECALC);
|
||||
extern U0 DocCenter(CDoc *doc=NULL,I64 recalc=RECALCt_NORMAL);
|
||||
extern U0 DocClear(CDoc *doc=NULL);
|
||||
extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL);
|
||||
extern U0 DocD(U8 *buf,I64 cnt=0x80);
|
||||
@@ -25,9 +25,11 @@ extern U0 DocDel(CDoc *doc);
|
||||
extern CDoc *DocDisplay(CTask *task=NULL);
|
||||
extern U0 DocDump(CDoc *doc,I64 uS_delay=0);
|
||||
extern CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e);
|
||||
extern U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e);
|
||||
extern Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL);
|
||||
extern U0 DocHelpIndex(CDoc *doc,U8 *index);
|
||||
extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL);
|
||||
extern U0 DocInsDoc(CDoc *doc,CDoc *doc2);
|
||||
extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
|
||||
extern Bool DocLock(CDoc *doc);
|
||||
@@ -36,7 +38,7 @@ extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
|
||||
extern CDocEntry *DocPrint(CDoc *doc,U8 *src,...);
|
||||
extern CDoc *DocPut(CTask *task=NULL);
|
||||
extern CDoc *DocRead(U8 *name=NULL,I64 flags=0);
|
||||
extern Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC);
|
||||
extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL);
|
||||
extern U0 DocRst(CDoc *doc,Bool is_old);
|
||||
extern CDocEntry *DocSprite(CDoc *doc,U8 *elems,U8 *fmt=NULL);
|
||||
extern U0 DocTop(CDoc *doc=NULL);
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public Bool IsInHeapCtrl(U8 *a,CHeapCtrl *hc,Bool lock=TRUE)
|
||||
PAUSE
|
||||
m=hc->next_mem_blk;
|
||||
while (m!=&hc->next_mem_blk) {
|
||||
if (a>=m && a<m(U8 *)+m->pages*MEM_PAGE_SIZE) {
|
||||
if (a>=m && a<m(U8 *)+m->pages<<MEM_PAGE_BITS) {
|
||||
if (lock)
|
||||
LBtr(&hc->locked_flags,HClf_LOCKED);
|
||||
POPFD
|
||||
|
||||
@@ -129,6 +129,7 @@ public U0 ACInit(U8 *mask=NULL)
|
||||
Bool start_flag;
|
||||
CBlkDev *bd=Let2BlkDev;
|
||||
|
||||
LBtr(&sys_run_level,RLf_AUTO_COMPLETE);
|
||||
AutoComplete;
|
||||
while (LBts(&ac.flags,ACf_INIT_IN_PROGRESS))
|
||||
Yield;
|
||||
@@ -155,6 +156,7 @@ public U0 ACInit(U8 *mask=NULL)
|
||||
|
||||
ACDWordsLoad;
|
||||
LBtr(&ac.flags,ACf_INIT_IN_PROGRESS);
|
||||
LBts(&sys_run_level,RLf_AUTO_COMPLETE);
|
||||
AutoComplete(ON);
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +263,7 @@ public Bool AutoComplete(Bool val=OFF)
|
||||
while (Bt(&ac.flags,ACf_INIT_IN_PROGRESS))
|
||||
Sleep(10);
|
||||
if (val) {
|
||||
if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) {
|
||||
if (TaskValidate(ac.task))
|
||||
old_autocomplete=TRUE;
|
||||
else {
|
||||
@@ -270,8 +271,10 @@ public Bool AutoComplete(Bool val=OFF)
|
||||
TaskWait(ac.task);
|
||||
}
|
||||
WinToTop(ac.task);
|
||||
}
|
||||
} else {
|
||||
if (TaskValidate(ac.task)) {
|
||||
if (Bt(&sys_run_level,RLf_AUTO_COMPLETE))
|
||||
old_autocomplete=TRUE;
|
||||
Kill(ac.task);
|
||||
while (TaskValidate(ac.task))
|
||||
@@ -280,4 +283,3 @@ public Bool AutoComplete(Bool val=OFF)
|
||||
}
|
||||
return old_autocomplete;
|
||||
}
|
||||
|
||||
+51
-45
@@ -35,7 +35,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (cc>doc_ce->min_col) {
|
||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -43,7 +43,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
cc--;
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -68,7 +68,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
cc=doc_ce->max_col-1;
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -112,7 +112,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (cc<doc_ce->max_col) {
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -126,7 +126,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT | old_color & -0x100;
|
||||
doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT];
|
||||
@@ -188,7 +188,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->x=doc_ce->x+doc->cur_col;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
@@ -255,7 +255,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (IsEditableText(doc_ce) && doc_ce->x<x) {
|
||||
if (doc->cur_col<doc_ce->max_col-1) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
@@ -301,7 +301,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_col>doc_ce->min_col && doc->cur_col<doc_ce->max_col-1) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
@@ -362,7 +362,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc->cur_col=doc_ce->min_col;
|
||||
if (IsEditableText(doc_ce)&&doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT | old_color & -0x100;
|
||||
doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT];
|
||||
@@ -385,7 +385,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
U0 EdDelChar(CDoc *doc)
|
||||
U0 EdCharDel(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
@@ -435,10 +435,10 @@ U0 ChkDollarBufSize(CDoc *doc)
|
||||
}
|
||||
}
|
||||
|
||||
U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
|
||||
U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
U8 *b,*src,*dst;
|
||||
U8 *st,*src,*dst;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
|
||||
I64 i,j,m,y=doc_ce->y;
|
||||
|
||||
@@ -470,7 +470,7 @@ U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
|
||||
}
|
||||
if (ch=='\r') goto ic_done;
|
||||
|
||||
ic_cont:
|
||||
ic_cont:
|
||||
if ((ch==CH_SPACE || ch=='\n') &&
|
||||
!(sc & (SCF_CTRL|SCF_SHIFT)) &&
|
||||
doc_ce->de_flags &
|
||||
@@ -483,15 +483,16 @@ ic_cont:
|
||||
goto ic_done;
|
||||
}
|
||||
if (doc_ce->type_u8==DOCT_HEX_ED) {
|
||||
if (doc_ce->de_flags & DOCEF_DATA_IS_PTR)
|
||||
b=doc_ce->data;
|
||||
if (doc_ce->de_flags&DOCEF_DEREF_DATA &&
|
||||
!(doc_ce->de_flags&DOCEF_REMALLOC_DATA))
|
||||
st=doc_ce->data;
|
||||
else
|
||||
b=&doc_ce->data;
|
||||
st=&doc_ce->data;
|
||||
i=doc->cur_col;
|
||||
j=i%(doc_ce->hex_ed_width*3);
|
||||
m=i/(doc_ce->hex_ed_width*3)*doc_ce->hex_ed_width;
|
||||
if (j>=doc_ce->hex_ed_width<<1)
|
||||
b[j-doc_ce->hex_ed_width<<1+m]=ch;
|
||||
st[j-doc_ce->hex_ed_width<<1+m]=ch;
|
||||
else {
|
||||
ch=ToUpper(ch)-'0';
|
||||
if (ch>9) {
|
||||
@@ -501,16 +502,16 @@ ic_cont:
|
||||
}
|
||||
m=j>>1+m;
|
||||
if (j & 1)
|
||||
b[m]=b[m] & 0xF0| ch;
|
||||
st[m]=st[m] & 0xF0| ch;
|
||||
else
|
||||
b[m]=b[m] & 0xF | ch<<4;
|
||||
st[m]=st[m] & 0xF | ch<<4;
|
||||
}
|
||||
doc->cur_col++;
|
||||
goto ic_done;
|
||||
}
|
||||
if (doc->flags & DOCF_OVERSTRIKE) {
|
||||
if (Bt(chars_bmp_displayable,ch)) {
|
||||
ic_overstrike_char:
|
||||
ic_overstrike:
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_col<doc_ce->max_col) {
|
||||
if (doc_ce->tag[doc->cur_col]) {
|
||||
@@ -521,7 +522,7 @@ ic_overstrike_char:
|
||||
doc_ce=doc_ce->next;
|
||||
doc->cur_entry=doc_ce;
|
||||
doc->cur_col=doc_ce->min_col;
|
||||
goto ic_overstrike_char;
|
||||
goto ic_overstrike;
|
||||
}
|
||||
} else if (doc_ce->type_u8==DOCT_DATA) {
|
||||
if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) {
|
||||
@@ -532,15 +533,13 @@ ic_overstrike_char:
|
||||
doc_ce->tag[doc->cur_col]='_';
|
||||
doc_ce->tag[doc->cur_col+1]=0;
|
||||
}
|
||||
}
|
||||
} else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA)
|
||||
goto ic_not_overstrike;
|
||||
} else if (doc_ce->tag[doc->cur_col])
|
||||
doc_ce->tag[doc->cur_col++]=ch;
|
||||
goto ic_done;
|
||||
}
|
||||
b=MAlloc(2,doc->mem_task);
|
||||
*b=ch;
|
||||
b[1]=0;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,b);
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
@@ -554,14 +553,14 @@ ic_overstrike_char:
|
||||
}
|
||||
goto ic_done;
|
||||
}
|
||||
ic_not_overstrike:
|
||||
if (ch=='\n') {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
|
||||
doc_ne->type=DOCT_PAGE_BREAK | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_PAGE_BREAK];
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
} else {
|
||||
doc_ne->type=DOCT_NEW_LINE | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_NEW_LINE];
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
}
|
||||
DocInsEntry(doc,doc_ne);
|
||||
} else if (ch=='\t') {
|
||||
@@ -575,26 +574,36 @@ ic_form_tab:
|
||||
DocFormFwd(doc);
|
||||
goto ic_done;
|
||||
} else {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TAB | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TAB];
|
||||
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_ne);
|
||||
}
|
||||
} else {
|
||||
if (Bt(chars_bmp_displayable,ch)) {
|
||||
if (doc_ce->type_u8==DOCT_DATA) {
|
||||
while (TRUE) {
|
||||
i=doc_ce->len+doc_ce->min_col;
|
||||
if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR)
|
||||
i++;
|
||||
if (i>doc_ce->max_col) {
|
||||
b=doc_ce->tag;
|
||||
if (doc_ce->max_col<i) {
|
||||
st=doc_ce->tag;
|
||||
doc_ce->max_col++;
|
||||
for (i=doc_ce->max_col;i>doc->cur_col;i--)
|
||||
b[i]=b[i-1];
|
||||
b[doc->cur_col++]=ch;
|
||||
st[i]=st[i-1];
|
||||
st[doc->cur_col++]=ch;
|
||||
break;
|
||||
} else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) {
|
||||
st=MAlloc(doc_ce->max_col+8,doc->mem_task);
|
||||
MemCpy(st,doc_ce->tag,doc_ce->max_col+1);
|
||||
Free(doc_ce->tag);
|
||||
doc_ce->tag=st;
|
||||
doc_ce->len=MSize(st)-doc_ce->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$
|
||||
Free(doc_ce->data);
|
||||
doc_ce->data=MAlloc(doc_ce->len+2,doc->mem_task);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
} else if (IsEditableText(doc_ce)) {
|
||||
dst=b=MAlloc(doc_ce->max_col+2,doc->mem_task);
|
||||
dst=st=MAlloc(doc_ce->max_col+2,doc->mem_task);
|
||||
src=doc_ce->tag;
|
||||
i=doc->cur_col;
|
||||
while (i-->0)
|
||||
@@ -602,14 +611,11 @@ ic_form_tab:
|
||||
*dst++=ch;
|
||||
while (*dst++=*src++);
|
||||
Free(doc_ce->tag);
|
||||
doc_ce->tag=b;
|
||||
doc_ce->tag=st;
|
||||
doc_ce->max_col++;
|
||||
doc->cur_col++;
|
||||
} else {
|
||||
b=MAlloc(2,doc->mem_task);
|
||||
*b=ch;
|
||||
b[1]=0;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,b);
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_ne->x=doc_ce->x+1;
|
||||
@@ -627,7 +633,7 @@ ic_done:
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
U0 EdDelLine(CDoc *doc)
|
||||
U0 EdLineDel(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_ce2;
|
||||
I64 y;
|
||||
|
||||
@@ -272,7 +272,7 @@ U0 EdRemFunLeadingSpace(CDoc *doc)
|
||||
do {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e!=doc && doc_e!=doc->cur_entry &&
|
||||
!(doc_e->de_flags&(DOCEG1_DONT_EDIT-DOCEF_SCROLLING_X)))
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X)))
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_TEXT:
|
||||
ptr=doc_e->tag;
|
||||
@@ -511,7 +511,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
end_y=start_y+indent->total_cnt;
|
||||
while (start_y<=doc_e->y<end_y) {
|
||||
if (doc_e!=doc && doc_e!=doc->cur_entry &&
|
||||
!(doc_e->de_flags&(DOCEG1_DONT_EDIT-DOCEF_SCROLLING_X))) {
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE||
|
||||
doc_e->type_u8==DOCT_SOFT_NEW_LINE)
|
||||
start_of_line=TRUE;
|
||||
@@ -520,12 +520,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES;
|
||||
x=doc_e->x+1;
|
||||
while (i>8) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TAB | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TAB];
|
||||
doc_ne->x=x;
|
||||
doc_ne->y=doc_e->y;
|
||||
doc_ne->page_line_num=doc_e->page_line_num;
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
MemCpy(&doc_ne->settings,
|
||||
&doc_e->settings,sizeof(CDocSettings));
|
||||
QueIns(doc_ne,doc_e->last);
|
||||
@@ -536,14 +533,11 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
b=MAlloc(i+1,doc->mem_task);
|
||||
MemSet(b,CH_SPACE,i);
|
||||
b[i]=0;
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
doc_ne->x=x;
|
||||
doc_ne->y=doc_e->y;
|
||||
doc_ne->page_line_num=doc_e->page_line_num;
|
||||
MemCpy(&doc_ne->settings,
|
||||
&doc_e->settings,sizeof(CDocSettings));
|
||||
QueIns(doc_ne,doc_e->last);
|
||||
|
||||
@@ -95,15 +95,16 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
old_task_title=StrNew(Fs->task_title);
|
||||
if (Fs->title_src!=TTS_LOCKED_CONST) {
|
||||
Fs->title_src=TTS_ED_FILENAME;
|
||||
MemCpy(Fs->task_title,doc->filename.name,TASK_TITLE_LEN);
|
||||
MemCpy(Fs->task_title,doc->filename.name,STR_LEN-1);
|
||||
}
|
||||
doc_e=DocPrint(bdoc,"$$DA-TRM-P+BD+RD+CX+IV,140,A=\"%%s...\",SCX=16$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1,"
|
||||
"A=\"%%s...\",SCX=16$$");
|
||||
doc_e->data=&Fs->task_title;
|
||||
DocDataFmt(bdoc,doc_e);
|
||||
|
||||
if (doc->flags & DOCF_ALLOW_UNDO) {
|
||||
DocPrint(bdoc,"$$CM+BY+LX+NC,1,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,32,RT=U32,A=\"Undo:%%03d\"$$\n");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,RT=U32,A=\"Undo:%%03d\"$$\n");
|
||||
doc_e->data=&doc->undo_cnt;
|
||||
DocDataFmt(bdoc,doc_e);
|
||||
}
|
||||
@@ -124,10 +125,10 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdDollarCB;
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,32,A=\"Line:%%04d \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Line:%%04d \"$$");
|
||||
doc_e->data=&doc->line;
|
||||
DocDataFmt(bdoc,doc_e);
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,32,A=\"Col:%%04d\"$$\n");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Col:%%04d\"$$\n");
|
||||
doc_e->data=&doc->col;
|
||||
DocDataFmt(bdoc,doc_e);
|
||||
|
||||
|
||||
+43
-52
@@ -27,8 +27,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
}
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
|
||||
DocBinsValidate(doc);
|
||||
DocTop(doc); //DOCT_CURSOR will set it in recalc
|
||||
DocRecalc(doc);
|
||||
DocTop(doc); //Calls $LK,"DocRecalc",A="MN:DocRecalc"$(). DOCT_CURSOR will be set.
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
@@ -53,24 +52,27 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
|
||||
|
||||
public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
{//Store doc to raw mem buf.
|
||||
CDocEntry *doc_e;
|
||||
CDocEntry *doc_e,*doc_e1;
|
||||
CDocBin *b;
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 ch,i,cnt;
|
||||
I64 ch,cnt=1;//terminator
|
||||
U8 *st,*result,*dst,*src;
|
||||
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
|
||||
DocBinsValidate(doc);
|
||||
if (doc->flags&DOCF_NO_CURSOR)
|
||||
DocRecalc(doc);
|
||||
if (doc->flags&DOCF_NO_CURSOR || doc->root.next==doc)
|
||||
cnt=1; //terminator
|
||||
else
|
||||
cnt=2; //cursor + terminator
|
||||
else {
|
||||
DocRecalc(doc,RECALCF_ADD_CURSOR);
|
||||
if (doc->root.next->type_u8==DOCT_CURSOR)
|
||||
DocEntryDel(doc,doc->root.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
|
||||
}
|
||||
for (doc_e=doc->root.next;doc_e!=doc;doc_e=doc_e->next) {
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_TAB:
|
||||
case DOCT_PAGE_BREAK:
|
||||
case DOCT_CURSOR:
|
||||
cnt++;
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
@@ -81,12 +83,12 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
break;
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
break;
|
||||
case DOCT_TEXT://$BK,1$Update $LK,"DOCT_TEXT",A="FF:D:/Compiler/Lex.CPP,DOCT_TEXT"$$BK,0$
|
||||
case DOCT_TEXT:
|
||||
if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
|
||||
DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP))&&
|
||||
!(doc_e->type&DOCG_BL_IV_UL)) {
|
||||
cnt+=StrLen(doc_e->tag);
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_TABS)) ||
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) ||
|
||||
doc->flags&DOCF_DBL_DOLLARS)
|
||||
cnt+=StrOcc(doc_e->tag,'$$');
|
||||
break;
|
||||
@@ -98,39 +100,20 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next) {
|
||||
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next)
|
||||
if (b->use_cnt>b->temp_use_cnt)
|
||||
cnt+=offset(CDocBin.end)-
|
||||
offset(CDocBin.start)+b->size;
|
||||
}
|
||||
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||
result=MAlloc(cnt);
|
||||
dst=result;
|
||||
for (doc_e=doc->root.next;doc_e!=doc;doc_e=doc_e->next) {
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
if (doc_e->type_u8==DOCT_TEXT &&
|
||||
!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
|
||||
DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
|
||||
!(doc_e->type&DOCG_BL_IV_UL)) {
|
||||
src=doc_e->tag;
|
||||
i=0;
|
||||
while (ch=*src++) {
|
||||
if (doc_e==doc->cur_entry && i++==doc->cur_col &&
|
||||
!(doc->flags&DOCF_NO_CURSOR))
|
||||
*dst++=CH_CURSOR;
|
||||
*dst++=ch;
|
||||
if (ch=='$$') {
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_TABS)) ||
|
||||
doc->flags&DOCF_DBL_DOLLARS)
|
||||
*dst++=ch;
|
||||
}
|
||||
}
|
||||
if (doc_e==doc->cur_entry && i++==doc->cur_col &&
|
||||
!(doc->flags&DOCF_NO_CURSOR))
|
||||
*dst++=CH_CURSOR;
|
||||
} else {
|
||||
if (doc_e==doc->cur_entry && !(doc->flags&DOCF_NO_CURSOR))
|
||||
*dst++=CH_CURSOR;
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8))
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_CURSOR:
|
||||
DocEntryDel(doc,doc_e);
|
||||
*dst++=CH_CURSOR;
|
||||
break;
|
||||
case DOCT_TAB:
|
||||
*dst++='\t';
|
||||
break;
|
||||
@@ -144,6 +127,19 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
break;
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
break;
|
||||
case DOCT_TEXT:
|
||||
if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
|
||||
DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
|
||||
!(doc_e->type&DOCG_BL_IV_UL)) {
|
||||
src=doc_e->tag;
|
||||
while (ch=*src++) {
|
||||
*dst++=ch;
|
||||
if (ch=='$$' && (!(doc->flags & (DOCF_PLAIN_TEXT|
|
||||
DOCF_PLAIN_TEXT_TABS)) || doc->flags&DOCF_DBL_DOLLARS))
|
||||
*dst++=ch;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
*dst++='$$';
|
||||
st=Doc2PlainText(doc,doc_e);
|
||||
@@ -152,18 +148,9 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
*dst++='$$';
|
||||
Free(st);
|
||||
}
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doc->cur_entry==doc && doc->root.next!=doc &&
|
||||
!(doc->flags&DOCF_NO_CURSOR))
|
||||
*dst++=CH_CURSOR;
|
||||
*dst++=0;
|
||||
if (*result==CH_CURSOR) {
|
||||
MemCpy(result,result+1,dst-result-1);
|
||||
cnt--;
|
||||
dst--;
|
||||
}
|
||||
b=doc->bin_root.next;
|
||||
if (b!=&doc->bin_root) {
|
||||
do {
|
||||
@@ -210,7 +197,7 @@ public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
|
||||
if (doc_ce->type_u8==DOCT_TEXT && doc->cur_col>doc_ce->min_col) {
|
||||
if (doc->cur_col<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT | doc_ce->type & 0xFFFFFF00;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
@@ -258,7 +245,7 @@ public U0 StreamDoc(CDoc *doc)
|
||||
Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
{
|
||||
Bool result=FALSE,unlock;
|
||||
I64 time_stamp;
|
||||
I64 time_stamp,flags;
|
||||
CDocUndo *u;
|
||||
if (doc->flags&DOCF_ALLOW_UNDO) {
|
||||
unlock=DocLock(doc);
|
||||
@@ -268,7 +255,10 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
force) {
|
||||
u=CAlloc(sizeof(CDocUndo),doc->mem_task);
|
||||
u->time_stamp=time_stamp;
|
||||
flags=doc->flags;
|
||||
doc->flags&=~DOCF_NO_CURSOR;
|
||||
u->body=DocSave(doc,&u->size);
|
||||
doc->flags=flags;
|
||||
QueIns(u,doc->undo_root.last);
|
||||
doc->flags&=~DOCF_UNDO_DIRTY;
|
||||
doc->undo_cnt++;
|
||||
@@ -291,8 +281,9 @@ U0 DocUndoRestore(CDoc *doc)
|
||||
u_last=doc->undo_root.last;
|
||||
QueInit(&doc->undo_root);
|
||||
DocRst(doc,TRUE);
|
||||
doc->flags=u->doc_flags;
|
||||
doc->flags=u->doc_flags&~DOCF_NO_CURSOR;
|
||||
DocLoad(doc,u->body,u->size);
|
||||
doc->flags=u->doc_flags;
|
||||
DocUndoDel(doc,u);
|
||||
doc->undo_root.next=u_next;
|
||||
doc->undo_root.last=u_last;
|
||||
|
||||
@@ -7,7 +7,7 @@ public Bool DocLineNumGoTo(CDoc *doc,I64 line_num) //one based
|
||||
unlock=DocLock(doc);
|
||||
doc->x=0;
|
||||
doc->y=line_num-1;
|
||||
DocRecalc(doc,FALSE,DOC_RECALC_FIND_CURSOR);
|
||||
DocRecalc(doc,RECALCt_FIND_CURSOR);
|
||||
DocCenter(doc);
|
||||
if (doc->cur_entry->y==line_num-1)
|
||||
result=TRUE;
|
||||
@@ -105,7 +105,7 @@ public U0 EdFindNext(CDoc *doc)
|
||||
do {
|
||||
if (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
|
||||
!(doc_e->de_flags&(DOCEG1_DONT_EDIT|DOCEF_FILTER_SKIP))) {
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
|
||||
if (doc_e->type & DOCET_SELECTED ||
|
||||
!doc->find_replace->scan_selected_text) {
|
||||
if (doc->find_replace->scan_fwd) {
|
||||
@@ -473,7 +473,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
break;
|
||||
}
|
||||
if (doc_e->type_u8==DOCT_TEXT &&
|
||||
!(doc_e->de_flags&(DOCEG1_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
|
||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
|
||||
(doc_e->type & DOCET_SELECTED ||
|
||||
!doc->find_replace->scan_selected_text&&
|
||||
!doc->find_replace->local_var)) {
|
||||
@@ -571,7 +571,7 @@ Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
||||
|
||||
class CEdLineGoTo
|
||||
{
|
||||
I64 line fmtstr "$$DA,256,A=\"Go to Line:%d\"$$";
|
||||
I64 line fmtstr "$$DA,A=\"Go to Line:%d\"$$";
|
||||
};
|
||||
|
||||
U0 EdGoToLine(CDoc *doc)
|
||||
|
||||
+45
-5
@@ -59,12 +59,13 @@ U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE)
|
||||
U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
{
|
||||
I64 i;
|
||||
U8 *ptr;
|
||||
U8 *ptr,*ptr2;
|
||||
CHashDefineStr *temph;
|
||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||
if (d==DOCM_CANCEL) {
|
||||
if (doc_e->de_flags & DOCEF_DATA_IS_PTR) {
|
||||
if (doc_e->de_flags&DOCEF_DEREF_DATA &&
|
||||
!(doc_e->de_flags&DOCEF_REMALLOC_DATA)) {
|
||||
if (!(ptr=doc_e->data)) return;
|
||||
} else
|
||||
ptr=&doc_e->data;
|
||||
@@ -81,13 +82,32 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
}
|
||||
}
|
||||
if (doc_e->type_u8==DOCT_DATA) {
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA) {
|
||||
ptr=MStrPrint(doc_e->aux_str,d,doc_e->my_fmt_data);
|
||||
i=StrLen(ptr);
|
||||
if (!doc_e->data) {
|
||||
doc_e->data=CAlloc(2,doc->mem_task);
|
||||
doc_e->len=MSize(doc_e->data)-2;
|
||||
}
|
||||
if (doc_e->len+doc_e->min_col>i)
|
||||
MemCpy(doc_e->tag,ptr,i+1);
|
||||
else {
|
||||
ptr2=MAlloc(i+8,doc->mem_task);
|
||||
doc_e->len=MSize(ptr2)-doc_e->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$
|
||||
MemCpy(ptr2,ptr,i+1);
|
||||
Free(doc_e->tag);
|
||||
doc_e->tag=ptr2;
|
||||
}
|
||||
Free(ptr);
|
||||
} else {
|
||||
StrPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data);
|
||||
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) {
|
||||
i=StrLen(doc_e->tag);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) {
|
||||
doc_e->tag[i++]='_';
|
||||
doc_e->tag[i]=0;
|
||||
}
|
||||
doc_e->max_col=StrLen(doc_e->tag);
|
||||
doc_e->max_col=i;
|
||||
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||
if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<temph->cnt) {
|
||||
@@ -115,7 +135,8 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
CHashDefineStr *temph;
|
||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||
if (doc_e->de_flags & DOCEF_DATA_IS_PTR) {
|
||||
if (doc_e->de_flags&DOCEF_DEREF_DATA &&
|
||||
!(doc_e->de_flags&DOCEF_REMALLOC_DATA)) {
|
||||
if (!(ptr=doc_e->data)) return;
|
||||
} else
|
||||
ptr=&doc_e->data;
|
||||
@@ -130,6 +151,13 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
|
||||
doc_e->tag[i]='_';
|
||||
} else if (RT_I64<=doc_e->raw_type<=RT_UF64) {
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA) {
|
||||
ptr=MAlloc(i-doc_e->min_col+8,doc->mem_task);
|
||||
MemCpy(ptr,doc_e->tag+doc_e->min_col,i-doc_e->min_col+1);
|
||||
Free(doc_e->data);
|
||||
doc_e->data=ptr;
|
||||
doc_e->len=MSize(ptr)-1;
|
||||
} else
|
||||
StrScan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data);
|
||||
if (doc_e->de_flags & DOCEF_HAS_TERMINATOR)
|
||||
doc_e->tag[i]='_';
|
||||
@@ -201,6 +229,10 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
while (ml) {
|
||||
if (fmtstr=MemberMetaData("fmtstr",ml)) {
|
||||
doc_e=DocPrint(doc,"%s",fmtstr);
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
doc_e->user_data=_d+ml->offset;
|
||||
doc_e->data=*doc_e->user_data(U8 **);
|
||||
} else
|
||||
doc_e->data=_d+ml->offset;
|
||||
doc_e->my_fmt_data=MemberMetaData("fmtdata",ml);
|
||||
DocDataFmt(doc,doc_e);
|
||||
@@ -221,6 +253,14 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
}
|
||||
}
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
*doc_e->user_data(U8 **)=doc_e->data;
|
||||
doc_e->data=NULL;
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
Fs->border_src=old_border_src;
|
||||
return result;
|
||||
|
||||
@@ -53,16 +53,16 @@ public I64 PopUpColorLighting(U8 *header=NULL)
|
||||
|
||||
class CTransformForm
|
||||
{
|
||||
F64 x_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"X Scale :%12.6f\"$$\n";
|
||||
F64 y_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"Y Scale :%12.6f\"$$\n";
|
||||
F64 z_scale fmtstr "$$DA-TRM,32,RT=F64,A=\"Z Scale :%12.6f\"$$\n";
|
||||
F64 x_scale fmtstr "$$DA-TRM,RT=F64,A=\"X Scale :%12.6f\"$$\n";
|
||||
F64 y_scale fmtstr "$$DA-TRM,RT=F64,A=\"Y Scale :%12.6f\"$$\n";
|
||||
F64 z_scale fmtstr "$$DA-TRM,RT=F64,A=\"Z Scale :%12.6f\"$$\n";
|
||||
F64 é_z fmtstr
|
||||
"\nAngles are in degrees\n$$DA-TRM,32,RT=F64,A=\"Z-Axis :%12.6f\"$$\n";
|
||||
F64 é_y fmtstr "$$DA-TRM,32,RT=F64,A=\"Y-Axis :%12.6f\"$$\n";
|
||||
F64 é_x fmtstr "$$DA-TRM,32,RT=F64,A=\"X-Axis :%12.6f\"$$\n";
|
||||
F64 x_offset fmtstr "\n$$DA-TRM,32,RT=F64,A=\"X Offset:%12.6f\"$$\n";
|
||||
F64 y_offset fmtstr "$$DA-TRM,32,RT=F64,A=\"Y Offset:%12.6f\"$$\n";
|
||||
F64 z_offset fmtstr "$$DA-TRM,32,RT=F64,A=\"Z Offset:%12.6f\"$$\n";
|
||||
"\nAngles are in degrees\n$$DA-TRM,RT=F64,A=\"Z-Axis :%12.6f\"$$\n";
|
||||
F64 é_y fmtstr "$$DA-TRM,RT=F64,A=\"Y-Axis :%12.6f\"$$\n";
|
||||
F64 é_x fmtstr "$$DA-TRM,RT=F64,A=\"X-Axis :%12.6f\"$$\n";
|
||||
F64 x_offset fmtstr "\n$$DA-TRM,RT=F64,A=\"X Offset:%12.6f\"$$\n";
|
||||
F64 y_offset fmtstr "$$DA-TRM,RT=F64,A=\"Y Offset:%12.6f\"$$\n";
|
||||
F64 z_offset fmtstr "$$DA-TRM,RT=F64,A=\"Z Offset:%12.6f\"$$\n";
|
||||
};
|
||||
|
||||
Bool PopUpTransform(I64 *r)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#help_index "DolDoc/Misc"
|
||||
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
||||
{//Be aware of $LK,"::/Adam/Opt/Utils/ToHtml.CPP"$.
|
||||
{//Be aware of $LK,"::/Demo/ToHtmlToTXTExample/ToHtml.CPP"$.
|
||||
U32 *result=MAlloc((len+1)*sizeof(U32)),*dst=result;
|
||||
U8 *ptr;
|
||||
CDocSettings *s=&doc_e->settings;
|
||||
|
||||
@@ -11,11 +11,11 @@ U0 DocInit()
|
||||
"BG\0FD\0BD\0PT\0WW\0UL\0IV\0BK\0SX\0SY\0CM\0AN\0LK\0BT\0"
|
||||
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HL\0HC\0ER\0");
|
||||
DefineLstLoad("ST_DOC_FLAGS",
|
||||
"T\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
|
||||
"LC\0LA\0RC\0RA\0TC\0LX\0CX\0RX\0TY\0CY\0BY\0"
|
||||
"T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
|
||||
"LC\0LA\0RC\0RA\0LX\0CX\0RX\0TY\0CY\0BY\0"
|
||||
"HL\0WW\0BK\0IV\0SEL\0UL\0"
|
||||
"PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0UD\0P\0TRM\0Z\0H\0"
|
||||
"TR\0LS\0SK\0PU\0SIF\0FS\0NC\0DD\0");
|
||||
"TC\0PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0UD\0P\0M\0"
|
||||
"TRM\0Z\0H\0TR\0LS\0SK\0PU\0SIF\0FS\0NC\0DD\0");
|
||||
DefineLstLoad("ST_LINK_TYPES",
|
||||
"FI\0FA\0FF\0FL\0MN\0PI\0PF\0PL\0BF\0DN\0HI\0AD\0AI\0AA\0AF\0AL\0");
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ I64 PopUpMacroMenu()
|
||||
U8 buf[STR_LEN];
|
||||
CSrvCmd *tempc;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,STR_LEN-1,A=\"Name:%%s\"$$");
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
||||
doc_e->data=captured_macro_name;
|
||||
DocDataFmt(doc,doc_e);
|
||||
|
||||
doc_e=DocPrint(doc,"\n$$DA,32,A=\"Repeat N:%%d\"$$");
|
||||
doc_e=DocPrint(doc,"\n$$DA,A=\"Repeat N:%%d\"$$");
|
||||
doc_e->data=&sys_macro_repeat_n;
|
||||
DocDataFmt(doc,doc_e);
|
||||
|
||||
|
||||
+36
-19
@@ -29,22 +29,33 @@ public Bool DocUnlock(CDoc *doc)
|
||||
|
||||
Bool IsEditableText(CDocEntry *doc_e)
|
||||
{
|
||||
if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG1_DONT_EDIT))
|
||||
if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG_DONT_EDIT))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CDocEntry *DocEntryNew(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
|
||||
{
|
||||
CDocEntry *DocEntryNewBase(CDoc *doc,I64 type,I64 de_flags=0,
|
||||
I64 x=0,I64 y=0,I64 page_line_num=0)
|
||||
{//See also $LK,"MAllocIdentical",A="FF:::/Adam/DolDoc/DocRecalc.CPP,MAllocIdentical"$ and $MA-X+PU,"CDocEntry",LM="F(\"sizeof(CDocEntry)\");View;"$.
|
||||
CDocEntry *result=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
result->type=doc_ce->type;
|
||||
result->de_flags=doc_ce->de_flags;
|
||||
result->tag=tag;
|
||||
result->max_col=StrLen(tag);
|
||||
result->x=doc_ce->x;
|
||||
result->y=doc_ce->y;
|
||||
result->page_line_num=doc_ce->page_line_num;
|
||||
result->type=type;
|
||||
result->de_flags=de_flags|doldoc.dft_de_flags[type.u8[0]];
|
||||
result->x=x;
|
||||
result->y=y;
|
||||
result->page_line_num=page_line_num;
|
||||
return result;
|
||||
}
|
||||
|
||||
CDocEntry *DocEntryNewTag(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
|
||||
{
|
||||
I64 l=StrLen(tag);
|
||||
CDocEntry *result=DocEntryNewBase(doc,doc_ce->type,doc_ce->de_flags,
|
||||
doc_ce->x,doc_ce->y,doc_ce->page_line_num);
|
||||
result->de_flags=doc_ce->de_flags; //Override
|
||||
result->max_col=l;
|
||||
result->tag=MAlloc(l+1,doc->mem_task);
|
||||
MemCpy(result->tag,tag,l+1);
|
||||
MemCpy(&result->settings,&doc_ce->settings,sizeof(CDocSettings));
|
||||
return result;
|
||||
}
|
||||
@@ -59,20 +70,22 @@ public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e)
|
||||
QueRem(doc_e);
|
||||
if (doc_e->de_flags & DOCEF_TAG)
|
||||
Free(doc_e->tag);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
Free(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
Free(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_AUX_STR)
|
||||
Free(doc_e->aux_str);
|
||||
if (doc_e->de_flags & DOCEF_DEFINE)
|
||||
Free(doc_e->define_str);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
Free(doc_e->html_link);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
Free(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
Free(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
Free(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN)
|
||||
DocBinDel(doc,doc_e->bin_data);
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
Free(doc_e->data);
|
||||
Free(doc_e);
|
||||
}
|
||||
}
|
||||
@@ -90,12 +103,14 @@ public I64 DocEntrySize(CDoc *,CDocEntry *doc_e)
|
||||
result+=MSize2(doc_e->define_str);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
result+=MSize2(doc_e->html_link);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
result+=MSize2(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
result+=MSize2(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
result+=MSize2(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
result+=MSize2(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
result+=MSize2(doc_e->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -134,12 +149,12 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
doc_ne->define_str=MAllocIdentical(doc_e->define_str,task);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
doc_ne->html_link=MAllocIdentical(doc_e->html_link,task);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
doc_ne->bin_ptr_link=MAllocIdentical(doc_e->bin_ptr_link,task);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
doc_ne->left_macro=MAllocIdentical(doc_e->left_macro,task);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
doc_ne->right_macro=MAllocIdentical(doc_e->right_macro,task);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
doc_ne->bin_ptr_link=MAllocIdentical(doc_e->bin_ptr_link,task);
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
tempb=MAllocIdentical(doc_e->bin_data,task);
|
||||
tempb->data=MAllocIdentical(doc_e->bin_data->data,task);
|
||||
@@ -152,6 +167,8 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
doc_ne->data=MAllocIdentical(doc_e->data,task);
|
||||
return doc_ne;
|
||||
}
|
||||
|
||||
@@ -195,7 +212,7 @@ public U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e)
|
||||
DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)) &&
|
||||
doc->cur_col<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
|
||||
+15
-20
@@ -61,7 +61,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
for (i=0;i<DOCEf_NUM_FLAGS;i++)
|
||||
if (Bt(&f1,i)!=Bt(&de_flags,i)) {
|
||||
if (Bt(&de_flags,i)) {
|
||||
if (!(1<<i&DOCEG1_HAS_ARG)) {
|
||||
if (!(1<<i&DOCEG_HAS_ARG)) {
|
||||
buf2=MStrPrint("%s+%Z",buf,i,"ST_DOC_FLAGS");
|
||||
Free(buf); buf=buf2;
|
||||
}
|
||||
@@ -82,19 +82,12 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
buf2=MStrPrint("%s,",buf);
|
||||
Free(buf); buf=buf2;
|
||||
nobound_switch (doc_e->type_u8) {
|
||||
sub_switch_start:
|
||||
case DOCT_DATA:
|
||||
buf2=MStrPrint("%s%d,",buf,doc_e->len);
|
||||
break;
|
||||
case DOCT_HEX_ED:
|
||||
buf2=MStrPrint("%s%d,",buf,doc_e->len);
|
||||
Free(buf); buf=buf2;
|
||||
buf2=MStrPrint("%s%d,",buf,doc_e->hex_ed_width);
|
||||
break;
|
||||
sub_switch_end:
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
|
||||
case DOCT_FOREGROUND:
|
||||
case DOCT_BACKGROUND:
|
||||
case DOCT_DFT_FOREGROUND:
|
||||
@@ -124,7 +117,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
case DOCT_NUM_TYPES-1: //nobound_switch
|
||||
break;
|
||||
}
|
||||
de_flags=doc_e->de_flags & DOCEG1_HAS_ARG;
|
||||
de_flags=doc_e->de_flags & DOCEG_HAS_ARG;
|
||||
while (de_flags) {
|
||||
j=Bsf(de_flags);
|
||||
Btr(&de_flags,j);
|
||||
@@ -158,6 +151,9 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
buf2=MStrPrint("%sT=\"%$$Q\",",buf,buf2);
|
||||
}
|
||||
break;
|
||||
case DOCEf_LEN:
|
||||
buf2=MStrPrint("%sLEN=%d,",buf,doc_e->len);
|
||||
break;
|
||||
case DOCEf_AUX_STR:
|
||||
buf2=MStrPrint("%sA=\"%$$Q\",",buf,doc_e->aux_str);
|
||||
break;
|
||||
@@ -244,17 +240,10 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
doc_e->de_flags=doldoc.dft_de_flags[i];
|
||||
doc_e->type|=doldoc.dft_type_flags[i];
|
||||
doc_e->raw_type=RT_I64;
|
||||
doc_e->len=DOCE_LEN_DFT;
|
||||
j=PrsDocFlags(cc,&doc_e->de_flags,&doc_e->type);
|
||||
cc->htc.hash_table_lst=old_hash_table_lst;
|
||||
nobound_switch (i) {
|
||||
case DOCT_DATA:
|
||||
while (cc->token==',')
|
||||
Lex(cc);
|
||||
if (cc->token)
|
||||
doc_e->len=LexExpressionI64(cc);
|
||||
else
|
||||
goto pd_err;
|
||||
break;
|
||||
case DOCT_CHECK_BOX:
|
||||
doc_e->raw_type=RT_I8;
|
||||
break;
|
||||
@@ -308,7 +297,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
Lex(cc);
|
||||
cc->htc.hash_table_lst=old_hash_table_lst;
|
||||
j=PrsDocFlagSingle(cc,&doc_e->de_flags,&doc_e->type,TRUE);
|
||||
if (!(de_flags=~processed_flags & doc_e->de_flags & DOCEG1_HAS_ARG))
|
||||
if (!(de_flags=~processed_flags & doc_e->de_flags & DOCEG_HAS_ARG))
|
||||
break;
|
||||
if (cc->token=='=')
|
||||
Lex(cc);
|
||||
@@ -348,6 +337,12 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
goto pd_err;
|
||||
}
|
||||
break;
|
||||
case DOCEf_LEN:
|
||||
if (cc->token)
|
||||
doc_e->len=LexExpression(cc);
|
||||
else
|
||||
goto pd_err;
|
||||
break;
|
||||
case DOCEf_AUX_STR:
|
||||
if (cc->token==TK_STR) {
|
||||
st2=LexExtStr(cc);
|
||||
@@ -474,8 +469,8 @@ pd_err:
|
||||
doc_e->type=DOCT_ERROR;
|
||||
doc_e->de_flags=0;
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_LST &&
|
||||
!(doc_e->de_flags & DOCEF_DATA_IS_PTR)) {
|
||||
if (doc_e->de_flags&DOCEF_LST && (doc_e->de_flags&DOCEF_REMALLOC_DATA ||
|
||||
!(doc_e->de_flags&DOCEF_DEREF_DATA))) {
|
||||
DocDataScan(doc,doc_e);
|
||||
DocDataFmt(doc,doc_e);
|
||||
}
|
||||
|
||||
+15
-21
@@ -22,7 +22,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
KeyDescSet("Char /'%s'",st);
|
||||
Free(st);
|
||||
} else
|
||||
EdInsChar(ch,sc,doc);
|
||||
EdCharIns(ch,sc,doc);
|
||||
} else {
|
||||
doc_ce=doc->cur_entry;
|
||||
x=doc->x; y=doc->y;
|
||||
@@ -189,7 +189,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc&SCF_SHIFT)
|
||||
EdCutToClipboard(doc);
|
||||
else
|
||||
EdDelChar(doc);
|
||||
EdCharDel(doc);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -435,11 +435,11 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
doc->cur_col=doc_ce->max_col;
|
||||
if (doc->cur_col>doc_ce->min_col)
|
||||
doc->cur_col--;
|
||||
EdDelChar(doc);
|
||||
EdCharDel(doc);
|
||||
}
|
||||
} else {
|
||||
doc->cur_col--;
|
||||
EdDelChar(doc);
|
||||
EdCharDel(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,12 +448,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc.u8[0]!=SC_TAB) {
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /Indent Out");
|
||||
KeyDescSet("Dol /Unindent 2");
|
||||
else
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /Indent In");
|
||||
KeyDescSet("Dol /Indent 2");
|
||||
else
|
||||
DocPrint(doc,"$$ID,2$$");
|
||||
}
|
||||
@@ -466,7 +466,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
else
|
||||
KeyDescSet("Char /Page Break");
|
||||
} else
|
||||
EdInsChar(ch,sc,doc);
|
||||
EdCharIns(ch,sc,doc);
|
||||
break;
|
||||
case CH_CTRLK:
|
||||
if (sc&SCF_SHIFT) {
|
||||
@@ -556,21 +556,17 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Sprite Graphic Resource");
|
||||
else {
|
||||
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
|
||||
else
|
||||
if (!(doc->flags&DOCF_FORM) &&
|
||||
!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) {
|
||||
DocUnlock(doc);
|
||||
if (doc_ce->type_u8==DOCT_SPRITE)
|
||||
EdSpriteEd(doc,
|
||||
(doc_ce->x-doc->line_start_col+doc_ce->max_col)*
|
||||
FONT_WIDTH,(doc_ce->y-doc->top_line_num)*FONT_HEIGHT);
|
||||
EdSpriteEd(doc);
|
||||
else
|
||||
EdSpriteIns(doc,
|
||||
(doc_ce->x+doc->cur_col-doc->line_start_col)*FONT_WIDTH,
|
||||
(doc_ce->y-doc->top_line_num)*FONT_HEIGHT);
|
||||
EdSpriteIns(doc);
|
||||
DocLock(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CH_CTRLS:
|
||||
if (sc&SCF_SHIFT) {
|
||||
@@ -589,14 +585,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Single Entry Toggle Plain Text");
|
||||
else
|
||||
else if (!(doc->flags&DOCF_FORM))
|
||||
DocEntryToggle(doc);
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Toggle Plain Text Display");
|
||||
else
|
||||
if (!(doc->flags&DOCF_FORM) ||
|
||||
doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))
|
||||
else if (!(doc->flags&DOCF_FORM))
|
||||
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
|
||||
}
|
||||
break;
|
||||
@@ -647,7 +641,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Delete Line");
|
||||
else
|
||||
EdDelLine(doc);
|
||||
EdLineDel(doc);
|
||||
}
|
||||
break;
|
||||
case CH_CTRLZ:
|
||||
|
||||
+26
-39
@@ -26,9 +26,8 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
ptr--;
|
||||
if (!ch) {
|
||||
if (j=ptr-ptr2) {
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -46,9 +45,8 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
} else {
|
||||
if (j=ptr-ptr2) {
|
||||
*ptr=0;
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -73,23 +71,20 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
}
|
||||
switch (ch) {
|
||||
case CH_CURSOR:
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_CURSOR | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_CURSOR];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case CH_FORM_FEED:
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_PAGE_BREAK | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_PAGE_BREAK];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case '\t':
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_TAB | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_TAB];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
@@ -101,21 +96,19 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
if (*ptr) {
|
||||
*ptr=0; //zero second dollar
|
||||
if (ptr-1==ptr2 && *ptr2==CH_CURSOR) {
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_CURSOR | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_CURSOR];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr2++;
|
||||
}
|
||||
if (ptr==ptr2) {
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
doc_e->max_col=1;
|
||||
if (doc->flags & DOCF_DBL_DOLLARS)
|
||||
doc_e->tag=StrNew("$$$$",doc->mem_task);
|
||||
else
|
||||
doc_e->tag=StrNew("$$",doc->mem_task);
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else {
|
||||
st2=MAlloc(ptr-ptr2+1);
|
||||
@@ -123,15 +116,12 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
ptr4=st2;
|
||||
while (ch=*ptr3++) {
|
||||
if (ch==CH_CURSOR) {
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_CURSOR | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_CURSOR];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else if (ch==CH_FORM_FEED) {
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_PAGE_BREAK |
|
||||
doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_PAGE_BREAK];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else
|
||||
*ptr4++=ch;
|
||||
@@ -147,9 +137,8 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
doc_e=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e->type=DOCT_NEW_LINE | doc->settings_root.dft_text_attr<<8;
|
||||
doc_e->de_flags=doldoc.dft_de_flags[DOCT_NEW_LINE];
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
if (ch=='\r')
|
||||
while (*ptr=='\r')
|
||||
@@ -176,7 +165,7 @@ public CDocEntry *DocPrint(CDoc *doc,U8 *fmt,...)
|
||||
|
||||
public U0 DocPrintPartial(CDoc *doc,U8 *fmt,...)
|
||||
{//Lets you print half a doc cmd, if you like.
|
||||
U8 *buf,*b,*src,*dst,*ptr,*ptr2;
|
||||
U8 *buf,*st,*src,*dst,*ptr,*ptr2;
|
||||
Bool unlock;
|
||||
CDocEntry *doc_ce,*doc_ne;
|
||||
I64 ch,i,j;
|
||||
@@ -195,7 +184,7 @@ public U0 DocPrintPartial(CDoc *doc,U8 *fmt,...)
|
||||
else
|
||||
while (ch=*ptr) {
|
||||
if (!Bt(chars_bmp_safe_dollar,ch) ||
|
||||
doc->flags & (DOCF_OVERSTRIKE | DOCF_IN_DOLLAR)) {
|
||||
doc->flags & (DOCF_OVERSTRIKE|DOCF_IN_DOLLAR)) {
|
||||
DocPutKey(doc,ch,0);
|
||||
ptr++;
|
||||
} else {
|
||||
@@ -210,7 +199,7 @@ public U0 DocPrintPartial(CDoc *doc,U8 *fmt,...)
|
||||
doc_ce=doc->cur_entry;
|
||||
j=ptr-ptr2;
|
||||
if (IsEditableText(doc_ce)) {
|
||||
dst=b=MAlloc(doc_ce->max_col+j+1,doc->mem_task);
|
||||
dst=st=MAlloc(doc_ce->max_col+j+1,doc->mem_task);
|
||||
src=doc_ce->tag;
|
||||
i=doc->cur_col;
|
||||
doc->cur_col+=j;
|
||||
@@ -221,12 +210,10 @@ public U0 DocPrintPartial(CDoc *doc,U8 *fmt,...)
|
||||
*dst++=*ptr2++;
|
||||
while (*dst++=*src++);
|
||||
Free(doc_ce->tag);
|
||||
doc_ce->tag=b;
|
||||
doc_ce->tag=st;
|
||||
} else {
|
||||
dst=MAlloc(j+1,doc->mem_task);
|
||||
MemCpy(dst,ptr2,j+1);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,dst);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,ptr2);
|
||||
doc_ne->type=DOCT_TEXT|doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
doc->cur_entry=doc_ne;
|
||||
|
||||
+106
-71
@@ -128,13 +128,33 @@ U0 DocRecalcXY(CDoc *doc,CDocEntry *doc_e,
|
||||
*_y=y;
|
||||
}
|
||||
|
||||
CDocEntry *DocSplitTag(CDoc *doc,CDocEntry *doc_e,I64 i,I64 x,I64 y,I64 type_u8)
|
||||
{//Split tag at i, insert DOCT_SOFT_NEW_LINE or DOCT_CURSOR
|
||||
U8 *ptr;
|
||||
CDocEntry *doc_e2=MAllocIdentical(doc_e,doc->mem_task);
|
||||
doc_e2->tag=StrNew(doc_e->tag+i,doc->mem_task);
|
||||
doc_e2->de_flags=doc_e->de_flags&~DOCEG_HAS_ALLOC|DOCEF_TAG;
|
||||
QueIns(doc_e2,doc_e);
|
||||
if (doc->cur_entry==doc_e && doc->cur_col>=i) {
|
||||
doc->cur_entry=doc_e2;
|
||||
doc->cur_col=doc->cur_col-i;
|
||||
}
|
||||
doc_e->tag[i]=0;
|
||||
ptr=StrNew(doc_e->tag,doc->mem_task);
|
||||
Free(doc_e->tag);
|
||||
doc_e->tag=ptr;
|
||||
doc_e2=DocEntryNewBase(doc,type_u8|doc_e->type & 0xFFFFFF00,
|
||||
doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc_e->page_line_num);
|
||||
MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
|
||||
QueIns(doc_e2,doc_e);
|
||||
return doc_e2;
|
||||
}
|
||||
|
||||
CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
||||
I64 *_k,I64 left,I64 right_margin,I64 x,I64 y)
|
||||
{
|
||||
CDocEntry *doc_e2;
|
||||
U8 *ptr;
|
||||
I64 i,ii,j;
|
||||
i=right_margin+1-(x+left); //Space left on line
|
||||
I64 j,i=right_margin+1-(x+left), //Space left on line
|
||||
ii=x+1-doc_e->settings.left_margin;
|
||||
if (IsEditableText(doc_e)) {
|
||||
if (doc->cur_entry==doc_e->next) {
|
||||
@@ -146,32 +166,12 @@ CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
||||
}
|
||||
if (*_k>i) {
|
||||
for (j=i;j>8-ii && j>=0;j--)
|
||||
if (doc_e->tag[j]==CH_SPACE ||
|
||||
doc_e->tag[j]==CH_SHIFT_SPACE) {
|
||||
if (doc_e->tag[j]==CH_SPACE || doc_e->tag[j]==CH_SHIFT_SPACE) {
|
||||
i=j+1;
|
||||
break;
|
||||
}
|
||||
if (*_k>i && i>0) {
|
||||
doc_e2=MAllocIdentical(doc_e,doc->mem_task);
|
||||
doc_e2->tag=StrNew(doc_e->tag+i,doc->mem_task);
|
||||
QueIns(doc_e2,doc_e);
|
||||
if (doc->cur_entry==doc_e && doc->cur_col>=i) {
|
||||
doc->cur_entry=doc_e2;
|
||||
doc->cur_col=doc->cur_col-i;
|
||||
}
|
||||
doc_e->tag[i]=0;
|
||||
ptr=StrNew(doc_e->tag,doc->mem_task);
|
||||
Free(doc_e->tag);
|
||||
doc_e->tag=ptr;
|
||||
doc_e2=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e2->type=DOCT_SOFT_NEW_LINE | doc_e->type & 0xFFFFFF00;
|
||||
doc_e2->de_flags=doc_e->de_flags
|
||||
&~DOCEF_TAG|doldoc.dft_de_flags[DOCT_SOFT_NEW_LINE];
|
||||
doc_e2->x=x;
|
||||
doc_e2->y=y;
|
||||
doc_e2->page_line_num=doc_e->page_line_num;
|
||||
MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
|
||||
QueIns(doc_e2,doc_e);
|
||||
if (0<i<*_k) {
|
||||
DocSplitTag(doc,doc_e,i,x,y,DOCT_SOFT_NEW_LINE);
|
||||
*_k=StrLen(doc_e->tag);
|
||||
return NULL;
|
||||
}
|
||||
@@ -184,14 +184,9 @@ CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
||||
if (doc_e2->type_u8!=DOCT_SOFT_NEW_LINE &&
|
||||
doc_e2->type_u8!=DOCT_NEW_LINE &&
|
||||
doc_e2->type_u8!=DOCT_CURSOR_MOVEMENT) {
|
||||
doc_e2=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_e2->type=DOCT_SOFT_NEW_LINE | doc_e->type & 0xFFFFFF00;
|
||||
doc_e2->de_flags=DOCEF_WORD_WRAP|doldoc.dft_de_flags[DOCT_SOFT_NEW_LINE]|
|
||||
doc_e->de_flags&(DOCEF_HIGHLIGHT|DOCG_BL_IV_UL|
|
||||
DOCEF_SKIP|DOCEF_FILTER_SKIP);
|
||||
doc_e2->x=x;
|
||||
doc_e2->y=y;
|
||||
doc_e2->page_line_num=doc_e->last->page_line_num;
|
||||
doc_e2=DocEntryNewBase(doc,DOCT_SOFT_NEW_LINE|doc_e->type&0xFFFFFF00,
|
||||
DOCEF_WORD_WRAP|doc_e->de_flags&(DOCEF_HIGHLIGHT|DOCG_BL_IV_UL|
|
||||
DOCEF_SKIP|DOCEF_FILTER_SKIP),x,y,doc_e->last->page_line_num);
|
||||
MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
|
||||
QueIns(doc_e2,doc_e->last);
|
||||
return doc_e2;
|
||||
@@ -245,19 +240,21 @@ I64 DocTempAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
|
||||
}
|
||||
doc_e->type.u8[1]=temp_u32_attr.u8[1];
|
||||
temp_u32_attr|=doc_e->type&0xFFFF0000;
|
||||
if (doc_e==doc->cur_entry && doc_e->type_u8!=DOCT_TEXT)
|
||||
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;
|
||||
}
|
||||
|
||||
public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
{//Recalc and fmt. Also used by WinMgr to draw on screen.
|
||||
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,ijif,cur_u8_attr,temp_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;
|
||||
CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL,
|
||||
*added_cursor=NULL;
|
||||
CDocBin *tempb;
|
||||
CDocSettings *s;
|
||||
Bool del_cl,skipped_update,tree_collapsed,same_win,more=FALSE,
|
||||
@@ -273,7 +270,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
||||
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && doc->owning_task!=Fs) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) {
|
||||
ijif=cnts.jiffies+JIFFY_FREQ/240;
|
||||
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
|
||||
if (cnts.jiffies>=ijif)
|
||||
@@ -292,13 +289,13 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
mem_task=doc->mem_task;
|
||||
blink_flag=Blink;
|
||||
dc=NULL;
|
||||
nobound_switch (recalc) {
|
||||
case DOC_RECALC_FIND_CURSOR:
|
||||
nobound_switch (recalc_flags&RECALCG_MASK) {
|
||||
case RECALCt_FIND_CURSOR:
|
||||
find_cursor=TRUE;
|
||||
if (win_task)
|
||||
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
||||
break;
|
||||
case DOC_RECALC_TO_SCREEN:
|
||||
case RECALCt_TO_SCREEN:
|
||||
if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
|
||||
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
|
||||
!(doc->flags&DOCF_BWD_MOVEMENT))
|
||||
@@ -347,12 +344,12 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
if (doc->flags&DOCF_BORDER_DOC) {
|
||||
doc->top_line_num=0;
|
||||
doc->line_start_col=0;
|
||||
has_cursor=FALSE;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN)
|
||||
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;
|
||||
} else {
|
||||
if (has_cursor && full_refresh) {
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) {
|
||||
if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) {
|
||||
if (!(doc->flags&DOCF_NO_SCROLL_BARS)) {
|
||||
if (Bt(&hss->flags,WSSf_SET_TO_POS)) {
|
||||
@@ -369,7 +366,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
find_cursor=TRUE;
|
||||
}
|
||||
}
|
||||
if (recalc==DOC_RECALC_TO_SCREEN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_root.cur_text_attr=
|
||||
doc->settings_root.dft_text_attr=win_task->text_attr;
|
||||
}
|
||||
@@ -381,7 +378,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
right ==doc->old_win_right &&
|
||||
doc->cur_entry==doc->old_cur_entry &&
|
||||
doc->cur_col==doc->old_cur_col;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
y_plot_top=y0-scroll_y/FONT_HEIGHT;
|
||||
y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
|
||||
if (!(doc->flags&DOCF_BORDER_DOC) &&
|
||||
@@ -402,7 +399,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
cur_u8_attr=s->cur_text_attr;
|
||||
if (doc_e==doc->root.next) {
|
||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && full_refresh)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
} else
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
@@ -480,8 +477,27 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
col2=0;
|
||||
|
||||
temp_u32_attr=DocTempAttr(doc,doc_e,cur_u8_attr);
|
||||
if (doc_e==doc->cur_entry)
|
||||
if (doc_e==doc->cur_entry) {
|
||||
cursor_y=doc_e->y;
|
||||
if (recalc_flags&RECALCF_ADD_CURSOR && doc_e!=added_cursor) {
|
||||
if (doc_e->type_u8==DOCT_TEXT && 0<doc->cur_col<k &&
|
||||
!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|
|
||||
DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) &&
|
||||
!(doc_e->type&DOCG_BL_IV_UL)) {
|
||||
added_cursor=DocSplitTag(doc,doc_e,doc->cur_col,x,y,DOCT_CURSOR);
|
||||
k=StrLen(doc_e->tag);
|
||||
} else {
|
||||
added_cursor=doc_e2=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc_e->type&0xFFFFFF00,
|
||||
doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc->page_line_num);
|
||||
MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings));
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc->cur_col>=k)
|
||||
QueIns(doc_e2,doc_e);
|
||||
else
|
||||
QueInsRev(doc_e2,doc_e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doc_e->de_flags & DOCEF_REFRESH_DATA &&
|
||||
(doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX ||
|
||||
@@ -504,7 +520,9 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
if (*ptr=='<' && full_refresh && '0'<=ptr[1]<='9') {
|
||||
ptr=MStrPrint("<%d>",doc_e->bin_num);
|
||||
Free(doc_e->tag);
|
||||
ptr=doc_e->tag=StrNew(ptr,mem_task);
|
||||
doc_e->tag=StrNew(ptr,mem_task);
|
||||
Free(ptr);
|
||||
ptr=doc_e->tag;
|
||||
k=StrLen(ptr);
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_CHECK_BOX) {
|
||||
@@ -530,7 +548,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
for (k=0;k<doc_e->scroll_len;k++) {
|
||||
ch=ptr[(ijif+k)%j];
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@@ -550,7 +568,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (ch=*ptr++) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
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);
|
||||
else
|
||||
@@ -569,7 +587,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
hl=DocHighlight(doc_e,ptr,k,temp_u32_attr);
|
||||
else
|
||||
hl=NULL;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
//Technically we should do this for scrolling_x, too.
|
||||
if (y>y_plot_bottom)
|
||||
@@ -610,7 +628,8 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
del_cl=TRUE;
|
||||
break;
|
||||
case DOCT_HEX_ED:
|
||||
if (doc_e->de_flags & DOCEF_DATA_IS_PTR)
|
||||
if (doc_e->de_flags&DOCEF_DEREF_DATA &&
|
||||
!(doc_e->de_flags&DOCEF_REMALLOC_DATA))
|
||||
bptr=doc_e->data;
|
||||
else
|
||||
bptr=&doc_e->data;
|
||||
@@ -622,7 +641,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
StrPrint(buf,"%08tX ",bptr);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@@ -644,7 +663,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
StrPrint(buf,"%02tX",*bptr++);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@@ -669,7 +688,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
for (j=0;j<k;j++) {
|
||||
ch=*bptr++;
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@@ -696,7 +715,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (x<k) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
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) {
|
||||
@@ -708,7 +727,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&
|
||||
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," ");
|
||||
@@ -728,13 +747,12 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc==DOC_RECALC_TO_SCREEN &&!(doc_e->de_flags&DOCEF_DONT_DRAW)&&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(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);
|
||||
if (doc_e->de_flags&DOCEF_HIGHLIGHT) {
|
||||
if (s->state==DOCSS_CPP_Z_COMMENT)
|
||||
if (doc_e->de_flags&DOCEF_HIGHLIGHT && s->state==DOCSS_CPP_Z_COMMENT)
|
||||
s->state=DOCSS_NORMAL;
|
||||
}
|
||||
y++;
|
||||
doc->page_line_num++;
|
||||
rc_start_of_line:
|
||||
@@ -919,6 +937,7 @@ rc_adjust_xy:
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
if (doc_e!=added_cursor)
|
||||
del_cl=TRUE;
|
||||
break;
|
||||
case DOCT_SPRITE:
|
||||
@@ -930,7 +949,8 @@ rc_adjust_xy:
|
||||
if (tempb && dc) {
|
||||
DCRst(dc);
|
||||
dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST);
|
||||
if (recalc!=DOC_RECALC_TO_SCREEN || doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCREEN ||
|
||||
doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||
dc->flags|=DCF_DONT_DRAW;
|
||||
bptr=tempb->data;
|
||||
ii=SpriteTypeMask(bptr);
|
||||
@@ -953,7 +973,8 @@ rc_adjust_xy:
|
||||
dc->color=i;
|
||||
if (find_cursor)
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && doc->cur_sprite==bptr) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
doc->cur_sprite==bptr) {
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
dc->cur_x=ip.pos.x;
|
||||
dc->cur_y=ip.pos.y;
|
||||
@@ -990,7 +1011,8 @@ rc_adjust_xy:
|
||||
}
|
||||
Sprite3(dc,xx,yy,zz,bptr);
|
||||
dc->depth_buf=NULL;
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && doc->cur_sprite==bptr)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
doc->cur_sprite==bptr)
|
||||
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
|
||||
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
|
||||
if (dc->nearest_dist<=D) {
|
||||
@@ -1000,7 +1022,8 @@ rc_adjust_xy:
|
||||
}
|
||||
break;
|
||||
case DOCT_SONG:
|
||||
if (sys_focus_task==win_task && recalc==DOC_RECALC_TO_SCREEN &&
|
||||
if (sys_focus_task==win_task &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->aux_str &&
|
||||
(!music.cur_song || StrCmp(music.cur_song,doc_e->aux_str))) {
|
||||
@@ -1014,6 +1037,11 @@ rc_adjust_xy:
|
||||
case DOCT_CLEAR:
|
||||
next_clear_found=doc_e;
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
if (recalc_flags&RECALCF_TO_HTML &&
|
||||
doc_e->de_flags&DOCEF_TAG && doc_e->tag)
|
||||
x-=StrLen(doc_e->tag);
|
||||
break;
|
||||
case DOCT_NUM_TYPES-1: //nobound_switch
|
||||
default:
|
||||
break;
|
||||
@@ -1119,6 +1147,12 @@ rc_skip:
|
||||
}
|
||||
|
||||
if (full_refresh) {
|
||||
if (doc->cur_entry==doc && recalc_flags&RECALCF_ADD_CURSOR) {
|
||||
doc_e2=DocEntryNewBase(doc,DOCT_CURSOR,,x,y,doc->page_line_num);
|
||||
MemCpy(&doc_e2->settings,s,sizeof(CDocSettings));
|
||||
QueInsRev(doc_e2,doc);
|
||||
}
|
||||
|
||||
if (doc->min_x>doc->max_x) {
|
||||
doc->max_x=0;
|
||||
doc->min_x=0;
|
||||
@@ -1200,8 +1234,8 @@ rc_skip:
|
||||
doc->line=doc->y+1;
|
||||
doc->col=doc->x+1;
|
||||
|
||||
if (has_cursor) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN) {
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
x=0;
|
||||
y=0;
|
||||
} else {
|
||||
@@ -1229,7 +1263,8 @@ rc_skip:
|
||||
doc->line_start_col=doc->x+x;
|
||||
}
|
||||
}
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && has_cursor) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
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;
|
||||
if (0<=x<=right && 0<=y<=bottom &&
|
||||
@@ -1275,10 +1310,10 @@ rc_skip:
|
||||
i=num_entries-doc->max_entries;
|
||||
if (next_clear_found) {
|
||||
DocDelToEntry(doc,next_clear_found);
|
||||
DocRecalc(doc,has_cursor,recalc);
|
||||
DocRecalc(doc,recalc_flags);
|
||||
} else if (i>1024) {
|
||||
DocDelToNum(doc,i);
|
||||
DocRecalc(doc,has_cursor,recalc);
|
||||
DocRecalc(doc,recalc_flags);
|
||||
}
|
||||
}
|
||||
DCDel(dc);
|
||||
|
||||
@@ -89,7 +89,7 @@ public U0 DocTop(CDoc *doc=NULL)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
public U0 DocCenter(CDoc *doc=NULL,I64 recalc=DOC_RECALC)
|
||||
public U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL)
|
||||
{//Center win on doc cursor, cur_entry.
|
||||
Bool unlock;
|
||||
CTask *task;
|
||||
@@ -97,7 +97,7 @@ public U0 DocCenter(CDoc *doc=NULL,I64 recalc=DOC_RECALC)
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
task=doc->win_task;
|
||||
DocRecalc(doc,FALSE,recalc);
|
||||
DocRecalc(doc,recalc_flags);
|
||||
if (!(doc->flags&DOCF_BORDER_DOC))
|
||||
doc->top_line_num=doc->y-(task->win_height+1)>>1;
|
||||
if (unlock)
|
||||
@@ -137,6 +137,13 @@ public Bool DocCursor(Bool show=OFF,CDoc *doc=NULL)
|
||||
return !LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!show);
|
||||
}
|
||||
|
||||
public Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL)
|
||||
{//Highlight or Don't highlight cursor.
|
||||
if (!doc && !(doc=DocPut))
|
||||
return FALSE;
|
||||
return !LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!show);
|
||||
}
|
||||
|
||||
public Bool DocScroll(Bool val=OFF,CDoc *doc=NULL)
|
||||
{//Turn scroll bars OFF/ON.
|
||||
if (!doc && !(doc=DocPut))
|
||||
@@ -192,12 +199,12 @@ U0 DocUpdateTaskDocs(CTask *task)
|
||||
if (task->border_src==BDS_ED_FILENAME_DRV)
|
||||
task->border_attr=DrvTextAttrGet(*doc->filename.name);
|
||||
if (task->title_src==TTS_ED_FILENAME)
|
||||
MemCpy(task->task_title,doc->filename.name,TASK_TITLE_LEN);
|
||||
DocRecalc(doc,TRUE,DOC_RECALC_TO_SCREEN);
|
||||
MemCpy(task->task_title,doc->filename.name,STR_LEN-1);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN|RECALCF_HAS_CURSOR);
|
||||
}
|
||||
if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
|
||||
WinScrollNull(task,&saved_scroll);
|
||||
DocRecalc(doc,FALSE,DOC_RECALC_TO_SCREEN);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN);
|
||||
WinScrollRestore(task,&saved_scroll);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,8 @@ public CDoc *DocBorderNew(CDoc *pdoc)
|
||||
doc_e->tag_cb=&EdDollarTypeCB;
|
||||
}
|
||||
DocPrint(bdoc,"$$CM+H+TY+NC,0,-1$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+H-TRM-P+BD+RD+CX+IV,140,A=\"%%s...\",SCX=15$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+H-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1,"
|
||||
"A=\"%%s...\",SCX=15$$");
|
||||
doc_e->data=&Fs->task_title;
|
||||
DocDataFmt(bdoc,doc_e);
|
||||
DocPrint(bdoc,"$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$",Fs);
|
||||
|
||||
+141
-118
@@ -31,12 +31,12 @@ I64 PopUpLinkType(Bool include_anchor)
|
||||
|
||||
class CEdFileLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,511,A=\"File :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,LEN=511,A=\"File :%s\"$$\n";
|
||||
I64 book;
|
||||
U8 aux[512];
|
||||
I64 num;
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -44,12 +44,12 @@ class CEdFileLink
|
||||
|
||||
class CEdFileAnchorLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,511,A=\"File :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,LEN=511,A=\"File :%s\"$$\n";
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Anchor Label :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Anchor Label :%s\"$$\n";
|
||||
I64 num;
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -57,12 +57,12 @@ class CEdFileAnchorLink
|
||||
|
||||
class CEdFileFindLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,511,A=\"File :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,LEN=511,A=\"File :%s\"$$\n";
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Str :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,511,A=\"Occurrence Num:%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Str :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,A=\"Occurrence Num:%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -70,12 +70,12 @@ class CEdFileFindLink
|
||||
|
||||
class CEdFileLineLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,511,A=\"File :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,LEN=511,A=\"File :%s\"$$\n";
|
||||
I64 book;
|
||||
U8 aux[512];
|
||||
I64 num fmtstr "$$DA-TRM,511,A=\"Line Num :%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,A=\"Line Num :%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -83,12 +83,12 @@ class CEdFileLineLink
|
||||
|
||||
class CEdManPageLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512];
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Label :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Label :%s\"$$\n";
|
||||
I64 num;
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -96,12 +96,12 @@ class CEdManPageLink
|
||||
|
||||
class CEdAddrLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512];
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Addr Exp :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,511,A=\"Bin Size :%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Addr Exp :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,A=\"Bin Size :%04d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -109,12 +109,12 @@ class CEdAddrLink
|
||||
|
||||
class CEdPlaceAnchor
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512];
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Anchor Label :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Anchor Label :%s\"$$\n";
|
||||
I64 num;
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up,
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide fmtstr "$$CB,\"Hide\"$$\n";
|
||||
@@ -122,13 +122,13 @@ class CEdPlaceAnchor
|
||||
|
||||
class CEdBibleLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512];
|
||||
I64 book fmtstr "$$LS,D=\"ST_BIBLE_BOOKS\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Chapter Verse :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Chapter Verse :%s\"$$\n";
|
||||
I64 num;
|
||||
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -136,12 +136,12 @@ class CEdBibleLink
|
||||
|
||||
class CEdDefLink
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512];
|
||||
I64 book;
|
||||
U8 aux[512] fmtstr "$$DA-P,511,A=\"Word :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,511,A=\"Def Num :%4d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 aux[512] fmtstr "$$DA-P,LEN=511,A=\"Word :%s\"$$\n";
|
||||
I64 num fmtstr "$$DA-TRM,A=\"Def Num :%4d\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -149,12 +149,12 @@ class CEdDefLink
|
||||
|
||||
class CEdProject
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,511,A=\"File :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
file[512] fmtstr "$$DA-P,LEN=511,A=\"File :%s\"$$\n";
|
||||
I64 book;
|
||||
U8 aux[512];
|
||||
I64 num;
|
||||
U8 html_link[512] fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
U8 html_link[512] fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
quote fmtstr "$$CB,\"Quote\"$$\n",
|
||||
hide;
|
||||
@@ -433,13 +433,13 @@ U0 EdInsColor()
|
||||
|
||||
class CEdPageSetting1
|
||||
{
|
||||
U8 val[512] fmtstr "$$DA-P,511,A=\"Setting Val:%s\"$$\n";
|
||||
U8 val[512] fmtstr "$$DA-P,LEN=511,A=\"Setting Val:%s\"$$\n";
|
||||
Bool winrel;
|
||||
};
|
||||
|
||||
class CEdPageSetting2
|
||||
{
|
||||
U8 val[512] fmtstr "$$DA-P,511,A=\"Setting Val:%s\"$$\n";
|
||||
U8 val[512] fmtstr "$$DA-P,LEN=511,A=\"Setting Val:%s\"$$\n";
|
||||
Bool winrel fmtstr "$$CB,\"Win Relative\"$$\n";
|
||||
};
|
||||
|
||||
@@ -474,6 +474,9 @@ U0 EdInsPageSetting()
|
||||
Free(e);
|
||||
}
|
||||
|
||||
#define WIZ_HIGHLIGHT_ON (DOCT_ERROR+1)
|
||||
#define WIZ_HIGHLIGHT_OFF (DOCT_ERROR+2)
|
||||
|
||||
I64 PopUpWidgetType()
|
||||
{
|
||||
I64 i;
|
||||
@@ -492,7 +495,8 @@ I64 PopUpWidgetType()
|
||||
"$$MU,\"Menu Val\",LE=DOCT_MENU_VAL$$\n"
|
||||
"$$MU,\"Data\",LE=DOCT_DATA$$\n"
|
||||
"$$MU,\"Hex Edit\",LE=DOCT_HEX_ED$$\n"
|
||||
"$$MU,\"Syntax Highlighting\",LE=DOCT_HIGHLIGHT$$\n"
|
||||
"$$MU,\"Syntax Highlight ON\",LE=WIZ_HIGHLIGHT_ON$$\n"
|
||||
"$$MU,\"Syntax Highlight OFF\",LE=WIZ_HIGHLIGHT_OFF$$\n"
|
||||
"$$MU,\"HTML\",LE=DOCT_HTML_CODE$$\n"
|
||||
"$$MU,\"Song\",LE=DOCT_SONG$$\n"
|
||||
"%s",ctrl_L_footer);
|
||||
@@ -503,7 +507,7 @@ I64 PopUpWidgetType()
|
||||
|
||||
class CEdText
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n";
|
||||
Bool left_x fmtstr "$$CB,\"Left X\"$$\n",
|
||||
center_x fmtstr "$$CB,\"Center X\"$$\n",
|
||||
right_x fmtstr "$$CB,\"Right X\"$$\n",
|
||||
@@ -514,15 +518,15 @@ class CEdText
|
||||
tree fmtstr "$$CB,\"Tree\"$$\n",
|
||||
collapsed fmtstr "$$CB,\"Collapsed\"$$\n";
|
||||
U8 scroll_x [512]
|
||||
fmtstr "$$DA-P,511,A=\"Scroll X Length Expression:%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Scroll X Length Expression:%s\"$$\n",
|
||||
shift_x [512]
|
||||
fmtstr "$$DA-P,511,A=\"X Offset Expression :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"X Offset Expression :%s\"$$\n",
|
||||
shift_y [512]
|
||||
fmtstr "$$DA-P,511,A=\"Y Offset Expression :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Y Offset Expression :%s\"$$\n",
|
||||
define_str[512]
|
||||
fmtstr "$$DA-P,511,A=\"Define Str :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Define Str :%s\"$$\n",
|
||||
html_link[512]
|
||||
fmtstr "$$DA-P,511,A=\"Html Link :%s\"$$\n";
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Html Link :%s\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsText()
|
||||
@@ -566,8 +570,8 @@ U0 EdInsText()
|
||||
|
||||
class CEdSong
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
song[512] fmtstr "$$DA-P,511,A=\"Song :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
song[512] fmtstr "$$DA-P,LEN=511,A=\"Song :%s\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsSong()
|
||||
@@ -578,22 +582,9 @@ U0 EdInsSong()
|
||||
Free(e);
|
||||
}
|
||||
|
||||
class CEdHighlight
|
||||
{
|
||||
Bool highlight_on fmtstr "$$CB,\"Highlight On\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsHighlight()
|
||||
{
|
||||
CEdHighlight *e=CAlloc(sizeof(CEdHighlight));
|
||||
if (DocForm(e,,,,ctrl_L_footer))
|
||||
"$$HL,%d$$",e->highlight_on;
|
||||
Free(e);
|
||||
}
|
||||
|
||||
class CEdHtmlCode
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Html Code:%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Html Code:%s\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsHtml()
|
||||
@@ -607,11 +598,11 @@ U0 EdInsHtml()
|
||||
class CEdMacroMenu
|
||||
{
|
||||
U8 tag[512]
|
||||
fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
left_macro[512]
|
||||
fmtstr "$$DA-P,511,A=\"Left Click Macro :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Left Click Macro :%s\"$$\n",
|
||||
left_exp[512]
|
||||
fmtstr "$$DA-P,511,A=\"Left Click Expression :%s\"$$\n";
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Left Click Expression :%s\"$$\n";
|
||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n",
|
||||
left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||
@@ -623,11 +614,11 @@ class CEdMacroMenu
|
||||
underline fmtstr "$$CB,\"Underline\"$$\n",
|
||||
escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||
U8 scroll_x[512]
|
||||
fmtstr "$$DA-P,511,A=\"Scroll X Length Expression:%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Scroll X Length Expression:%s\"$$\n",
|
||||
shift_x[512]
|
||||
fmtstr "$$DA-P,511,A=\"X Offset Expression :%s\"$$\n",
|
||||
fmtstr "$$DA-P,LEN=511,A=\"X Offset Expression :%s\"$$\n",
|
||||
shift_y[512]
|
||||
fmtstr "$$DA-P,511,A=\"Y Offset Expression :%s\"$$\n";
|
||||
fmtstr "$$DA-P,LEN=511,A=\"Y Offset Expression :%s\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsMacroMenu(Bool is_macro)
|
||||
@@ -682,16 +673,17 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
|
||||
class CEdButton
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n";
|
||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
||||
right_x fmtstr "$$CB,\"Right X \"$$\n",
|
||||
margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n",
|
||||
escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||
U8 left_macro[512] fmtstr "$$DA-P,511,A=\"Left Click Macro:%s\"$$\n";
|
||||
U8 left_macro[512] fmtstr "$$DA-P,LEN=511,A=\"Left Click Macro:%s\"$$\n";
|
||||
Bool left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n";
|
||||
U8 left_exp[512] fmtstr "$$DA-P,511,A=\"Left Click Expression:%s\"$$\n";
|
||||
U8 left_exp[512] fmtstr "$$DA-P,LEN=511,"
|
||||
"A=\"Left Click Expression:%s\"$$\n";
|
||||
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
||||
};
|
||||
|
||||
@@ -742,8 +734,8 @@ U0 EdInsButton()
|
||||
|
||||
class CEdCursorMovement
|
||||
{
|
||||
U8 left_exp[512] fmtstr "$$DA-P,511,A=\"X Expression (LE):%s\"$$\n",
|
||||
right_exp[512] fmtstr "$$DA-P,511,A=\"Y Expression (RE):%s\"$$\n";
|
||||
U8 left_exp[512] fmtstr "$$DA-P,LEN=511,A=\"X Expression (LE):%s\"$$\n",
|
||||
right_exp[512] fmtstr "$$DA-P,LEN=511,A=\"Y Expression (RE):%s\"$$\n";
|
||||
Bool left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
||||
right_x fmtstr "$$CB,\"Right X \"$$\n",
|
||||
@@ -785,56 +777,87 @@ U0 EdInsCursorMovement()
|
||||
Free(e);
|
||||
}
|
||||
|
||||
class CEdData
|
||||
class CEdDataNum
|
||||
{
|
||||
U8 fmt_str[512] fmtstr "$$DA-P,511,A=\"Format Str:%s\"$$\n";
|
||||
I64 len fmtstr "$$DA,512,A=\"Length:%d\"$$\n";
|
||||
Bool term fmtstr "$$CB,\"Terminator\"$$\n",
|
||||
str fmtstr "$$CB,\"Str\"$$\n",
|
||||
U8 fmt_str[512] fmtstr "$$DA-P,LEN=511,A=\"Format Str:%s\"$$\n";
|
||||
I64 len;
|
||||
Bool term fmtstr "$$CB,\"Form Field Terminator\"$$\n",
|
||||
remalloc,
|
||||
refresh fmtstr "$$CB,\"Refresh Data\"$$\n",
|
||||
update fmtstr "$$CB,\"Update Data\"$$\n";
|
||||
};
|
||||
|
||||
class CEdDataStr
|
||||
{
|
||||
U8 fmt_str[512] fmtstr "$$DA-P,LEN=511,A=\"Format Str:%s\"$$\n";
|
||||
I64 len fmtstr "$$DA,A=\"Length:%d\"$$\n";
|
||||
Bool term fmtstr "$$CB,\"Zero Terminator\"$$\n",
|
||||
remalloc fmtstr "$$CB,\"Remalloc for Unlimited Length\"$$\n",
|
||||
refresh fmtstr "$$CB,\"Refresh Data\"$$\n",
|
||||
update fmtstr "$$CB,\"Update Data\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_RAW_TYPES\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsData()
|
||||
{
|
||||
I64 i,type=RT_I64;
|
||||
U8 *st,buf[512],raw_type[16];
|
||||
CEdData *e=CAlloc(sizeof(CEdData));
|
||||
CEdDataNum *e=CAlloc(sizeof(CEdDataNum));
|
||||
e->term=TRUE;
|
||||
e->len=512;
|
||||
e->type=RT_I64;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
e->len=DOCE_LEN_DFT;
|
||||
if ((i=PopUpPickDefineSub("ST_NATURAL_TYPES"))>=0) {
|
||||
*buf=0;
|
||||
if (e->type==RT_I64)
|
||||
i+=RT_I8;
|
||||
if (i==RT_F32)
|
||||
i=RT_F64;
|
||||
if (i==RT_UF32) {//U8 *
|
||||
i=DocForm(e(CEdDataStr *),,,,ctrl_L_footer);
|
||||
if (e->remalloc) {
|
||||
CatPrint(buf,"+M");
|
||||
e->term=TRUE;
|
||||
} else
|
||||
CatPrint(buf,"-P");
|
||||
} else {
|
||||
type=i;
|
||||
i=DocForm(e,,,,ctrl_L_footer);
|
||||
}
|
||||
if (i) {
|
||||
if (type==RT_I64)
|
||||
*raw_type=0;
|
||||
else
|
||||
StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES");
|
||||
if (e->str) CatPrint(buf,"-P");
|
||||
StrPrint(raw_type,",RT=%Z",type,"ST_RAW_TYPES");
|
||||
|
||||
if (!e->term) CatPrint(buf,"-TRM");
|
||||
if (e->refresh) CatPrint(buf,"+RD");
|
||||
if (e->update) CatPrint(buf,"+UD");
|
||||
|
||||
st=MStrPrint("%q",e->fmt_str);
|
||||
"$$$$DA%s,%d%s,A=\\\"%Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
if (e->remalloc)
|
||||
"$$$$DA%s,A=\\\"%Q\\\"$$$$",buf,st;
|
||||
else if (e->len==DOCE_LEN_DFT)
|
||||
"$$$$DA%s%s,A=\\\"%Q\\\"$$$$",buf,raw_type,st;
|
||||
else
|
||||
"$$$$DA%s,LEN=%d%s,A=\\\"%Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
Free(e);
|
||||
}
|
||||
|
||||
class CEdCheckBox
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n";
|
||||
Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_RAW_TYPES\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsCheckBox()
|
||||
{
|
||||
U8 *st,buf[512],raw_type[16];
|
||||
CEdCheckBox *e=CAlloc(sizeof(CEdCheckBox));
|
||||
e->type=RT_I8;
|
||||
e->type=RT_I8-RT_I8;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
e->type+=RT_I8;
|
||||
if (e->type==RT_I8)
|
||||
*raw_type=0;
|
||||
else
|
||||
@@ -849,19 +872,20 @@ U0 EdInsCheckBox()
|
||||
|
||||
class CEdLst
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Dft Select :%s\"$$\n",
|
||||
define_str[512] fmtstr "$$DA-P,511,A=\"Define Str :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Dft Select :%s\"$$\n",
|
||||
define_str[512] fmtstr "$$DA-P,LEN=511,A=\"Define Str :%s\"$$\n";
|
||||
Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_RAW_TYPES\"$$\n";
|
||||
I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsLst()
|
||||
{
|
||||
U8 *st1,*st2,buf[512],raw_type[16];
|
||||
CEdLst *e=CAlloc(sizeof(CEdLst));
|
||||
e->type=RT_I64;
|
||||
e->type=RT_I64-RT_I8;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
e->type+=RT_I8;
|
||||
if (e->type==RT_I64)
|
||||
*raw_type=0;
|
||||
else
|
||||
@@ -884,8 +908,8 @@ U0 EdInsLst()
|
||||
|
||||
class CEdHexEd
|
||||
{
|
||||
I64 cnt fmtstr "$$DA,512,A=\"Count:%d\"$$\n",
|
||||
cols fmtstr "$$DA,512,A=\"Columns:%d\"$$\n";
|
||||
I64 cnt fmtstr "$$DA,A=\"Count:%d\"$$\n",
|
||||
cols fmtstr "$$DA,A=\"Columns:%d\"$$\n";
|
||||
Bool zero fmtstr "$$CB,\"Zero Based\"$$\n",
|
||||
refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
||||
};
|
||||
@@ -908,11 +932,12 @@ U0 EdInsHexEd()
|
||||
|
||||
class CEdBin
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
I64 bin_num fmtstr "$$DA,512,A=\"Bin Num:%d\"$$\n";
|
||||
U8 bin_ptr_link_file[512] fmtstr "$$DA-P,511,A=\"File:%s\"$$\n";
|
||||
I64 bin_ptr_link_bin_num fmtstr "$$DA,512,A=\"File Bin Num:%d\"$$\n";
|
||||
U8 bin_ptr_link_tag[512] fmtstr "$$DA-P,511,A=\"File Bin Tag:%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,"
|
||||
"A=\"Tag Text :%s\"$$\n";
|
||||
I64 bin_num fmtstr "$$DA,A=\"Bin Num:%d\"$$\n";
|
||||
U8 bin_ptr_link_file[512] fmtstr "$$DA-P,LEN=511,A=\"File:%s\"$$\n";
|
||||
I64 bin_ptr_link_bin_num fmtstr "$$DA,A=\"File Bin Num:%d\"$$\n";
|
||||
U8 bin_ptr_link_tag[512] fmtstr "$$DA-P,LEN=511,A=\"File Bin Tag:%s\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsBin(I64 bin_num,I64 type)
|
||||
@@ -945,8 +970,8 @@ U0 EdInsBin(I64 bin_num,I64 type)
|
||||
|
||||
class CEdTree
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
I64 indent fmtstr "$$DA,511,A=\"Indention:%d\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n";
|
||||
I64 indent fmtstr "$$DA,A=\"Indention:%d\"$$\n";
|
||||
Bool collapsed fmtstr "$$CB,\"Collapsed\"$$\n";
|
||||
};
|
||||
|
||||
@@ -1015,8 +1040,11 @@ U0 EdInsWidgetWiz()
|
||||
case DOCT_SONG:
|
||||
EdInsSong;
|
||||
break;
|
||||
case DOCT_HIGHLIGHT:
|
||||
EdInsHighlight;
|
||||
case WIZ_HIGHLIGHT_ON:
|
||||
"$$HL,1$$";
|
||||
break;
|
||||
case WIZ_HIGHLIGHT_OFF:
|
||||
"$$HL,0$$";
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
EdInsHtml;
|
||||
@@ -1057,15 +1085,10 @@ I64 PopUpSpriteType()
|
||||
return i;
|
||||
}
|
||||
|
||||
class CEdJustSprite
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n";
|
||||
};
|
||||
|
||||
class CEdMacroSprite
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
exp[512] fmtstr "$$DA-P,511,A=\"Macro :%s\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
exp[512] fmtstr "$$DA-P,LEN=511,A=\"Macro :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
is_auto fmtstr "$$CB,\"AutoStr\"$$\n";
|
||||
@@ -1073,9 +1096,11 @@ class CEdMacroSprite
|
||||
|
||||
class CEdMenuSprite
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,511,A=\"Tag Text :%s\"$$\n",
|
||||
exp[512] fmtstr "$$DA-P,511,A=\"Expression :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||
U8 tag[512] fmtstr "$$DA-P,LEN=511,A=\"Tag Text :%s\"$$\n",
|
||||
exp[512] fmtstr "$$DA-P,LEN=511,A=\"Expression :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup,
|
||||
is_auto;
|
||||
};
|
||||
|
||||
U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
@@ -1100,15 +1125,13 @@ U8 *EdSprite(I64 bin_num)
|
||||
*buf=0;
|
||||
switch (type) {
|
||||
case EST_SPRITE:
|
||||
StrPrint(e->tag,"<%d>",bin_num);
|
||||
if (DocForm(e,"CEdJustSprite",,,ctrl_L_footer))
|
||||
st1=MStrPrint("\"%Q\"",e->tag);
|
||||
st1=MStrPrint("\"<%d>\"",bin_num);
|
||||
break;
|
||||
case EST_SPRITE_MACRO:
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
CatPrint(buf,"+UL");
|
||||
if (e->is_auto)CatPrint(buf,"+LA");
|
||||
if (e->is_auto) CatPrint(buf,"+LA");
|
||||
if (e->popup) CatPrint(buf,"+PU");
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st=MStrPrint("%q",e->exp);
|
||||
|
||||
@@ -7,7 +7,7 @@ class MakeSongSettings
|
||||
I64 complexity fmtstr "$$LS,D=\"ST_RHYTHM_COMPLEXITY\"$$\n";
|
||||
Bool rests fmtstr "$$CB,\"Rests\"$$\n";
|
||||
Bool six_eight fmtstr "$$CB,\"Six Eight\"$$\n";
|
||||
I64 octave fmtstr "$$DA-TRM,32,A=\"Octave:%d\"$$\n";
|
||||
I64 octave fmtstr "$$DA-TRM,A=\"Octave:%d\"$$\n";
|
||||
};
|
||||
|
||||
U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j)
|
||||
|
||||
@@ -88,7 +88,7 @@ Favorite animal? $FG,4$"Elephant two"$FG$
|
||||
Favorite animal? $FG,4$"Bears"$FG$
|
||||
Favorite color? $FG,4$"Jude" (Jade Blue?)$FG$
|
||||
Favorite color? $FG,4$"Gold"$FG$
|
||||
Favorite color? $FG,4$$TX,"\"Iceberg\" blue",HTML="http://en.wikipedia.org/wiki/Blue_iceberg"$$FG$
|
||||
Favorite color? $FG,4$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.org/wikipedia/commons/3/38/Blue_ice_in_South_Greenland_-_Visit_Greenland.jpg"$$FG$
|
||||
Money? $FG,4$"Enough vehemently better"$FG$
|
||||
$FG,4$"Pride [or] money, choose_one"$FG$
|
||||
Favorite car? $FG,4$Beamer$FG$
|
||||
|
||||
@@ -153,6 +153,7 @@ public class CSpritePtMeshU8s : CSpriteBase
|
||||
public class CSprite
|
||||
{
|
||||
CSprite *next,*last;
|
||||
Bool selected;
|
||||
U0 start;
|
||||
union {
|
||||
U8 type;
|
||||
|
||||
+50
-18
@@ -4,11 +4,16 @@ public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//2D. No clipping or transformation or pen width.
|
||||
U8 *dst;
|
||||
I32 *db;
|
||||
I64 d;
|
||||
I64 d,dist;
|
||||
CColorROPU32 c,color=dc->color,bkcolor=dc->bkcolor;
|
||||
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||
if (x<dc->min_x) dc->min_x=x;
|
||||
if (x>dc->max_x) dc->max_x=x;
|
||||
@@ -65,7 +70,7 @@ public I64 GrPeek0(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
|
||||
public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
{//2D. Clipping but not transformation..
|
||||
I64 i,j,k,k1,kk,kk1,w1,h1,w2,h2,
|
||||
I64 i,j,k,k1,kk,kk1,w1,h1,w2,h2,dist,
|
||||
leading_pixels,leading_pixel_mask,whole_I64s,
|
||||
trailing_pixels,trailing_pixel_mask,
|
||||
reg bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,
|
||||
@@ -95,8 +100,13 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
@@ -632,7 +642,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
{//2D. Clipping but not transformation.
|
||||
U8 reg *src,reg *dst,*font_ptr;
|
||||
I64 i,m,leading_pixels,trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
|
||||
j,k1,kk1,w1,h1,w2,h2,reg bit_shift,reg color_mask;
|
||||
j,k1,kk1,w1,h1,w2,h2,reg bit_shift,reg color_mask,dist;
|
||||
CColorROPU32 color,c;
|
||||
CTask *win_task;
|
||||
|
||||
@@ -657,8 +667,13 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
@@ -910,7 +925,7 @@ public I64 GrVPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...)
|
||||
public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
{//2D. Width Height. Clipping but not transformation.
|
||||
//Returns cnt of pixs changed.
|
||||
I64 i,result=0,j,k1,kk1,w1,h1,w2,h2,
|
||||
I64 i,result=0,j,k1,kk1,w1,h1,w2,h2,dist,
|
||||
leading_pixels,original_leading_pixels,whole_I64s,
|
||||
trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
|
||||
win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,color_mask;
|
||||
@@ -943,9 +958,13 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
}
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {//TODO:Untested
|
||||
if (x<=dc->cur_x<=x+w && y<=dc->cur_y<=y+h)
|
||||
dc->dist=0;
|
||||
dist=0;
|
||||
else
|
||||
dc->dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y);
|
||||
dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
@@ -1418,7 +1437,7 @@ gr_done:
|
||||
I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
{
|
||||
//Returns cnt of pixs changed
|
||||
I64 result=0,d,x=*x1,x2,x3,y3;
|
||||
I64 result=0,d,x=*x1,x2,x3,y3,dist;
|
||||
Bool plot,dither,probability_dither,
|
||||
not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
|
||||
U8 *dst,*dst2;
|
||||
@@ -1494,8 +1513,13 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
|
||||
if ((not_color && c!=dc->color2 ||
|
||||
!not_color && c==dc->color2) && plot) {
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||
if (x3<dc->min_x) dc->min_x=x3;
|
||||
if (x3>dc->max_x) dc->max_x=x3;
|
||||
@@ -1566,8 +1590,13 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
|
||||
if ((not_color && c!=dc->color2 ||
|
||||
!not_color && c==dc->color2) && plot) {
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||
if (x3<dc->min_x) dc->min_x=x3;
|
||||
if (x3>dc->max_x) dc->max_x=x3;
|
||||
@@ -1692,7 +1721,10 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
else
|
||||
dist=SqrI64(dc->cur_x-x2);
|
||||
dist+=SqrI64(y-dc->cur_y);
|
||||
dc->dist=dist;
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_DONT_DRAW)
|
||||
goto gr_done;
|
||||
|
||||
@@ -305,7 +305,7 @@ gr_done:
|
||||
|
||||
public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
{//3D. Clipping and transformation and pen width.
|
||||
I64 _x,_y,_z,i,j,w;
|
||||
I64 _x,_y,_z,i,j,w,dist;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
Bool record,was_transform=FALSE,was_symmetry=FALSE;
|
||||
CTask *win_task;
|
||||
@@ -382,8 +382,13 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
}
|
||||
if (dc->flags & DCF_LOCATE_NEAREST)
|
||||
dc->dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
|
||||
if (dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dist;
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||
if (x-w<dc->min_x) dc->min_x=x-w;
|
||||
if (y-w<dc->min_y) dc->min_y=y-w;
|
||||
|
||||
@@ -31,9 +31,10 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
MemCpy(&old_sym,&dc->sym,sizeof(CGrSym));
|
||||
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||
dc->nearest_sprite_elem_num=0;
|
||||
dc->dist=dc->nearest_dist=MAX_I64;
|
||||
dc->nearest_dist=MAX_I64;
|
||||
}
|
||||
while (tempg->type) {
|
||||
dc->cur_sprite_elem_num=cur_sprite_elem_num;
|
||||
switch (tempg->type) {
|
||||
case SPT_COLOR:
|
||||
dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tempg->c.color;
|
||||
@@ -248,10 +249,6 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (dc->flags & DCF_LOCATE_NEAREST && dc->dist<dc->nearest_dist) {
|
||||
dc->nearest_dist=dc->dist;
|
||||
dc->nearest_sprite_elem_num=cur_sprite_elem_num;
|
||||
}
|
||||
cur_sprite_elem_num++;
|
||||
if (just_one_elem) break;
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
@@ -276,15 +273,14 @@ public U0 Sprite3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems)
|
||||
|
||||
public U0 SpriteMat3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,I64 *m)
|
||||
{//Plot rotated by matrix.
|
||||
I64 r[16],*old_r=dc->r,old_m[16],
|
||||
I64 r[16],*old_r=dc->r,new_m[16],
|
||||
old_flags=dc->flags&DCF_TRANSFORMATION;
|
||||
MemCpy(old_m,m,16*sizeof(I64));
|
||||
MemCpy(new_m,m,16*sizeof(I64));
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
Mat4x4TranslationAdd(m,x,y,z);
|
||||
dc->r=Mat4x4MulMat4x4Equ(r,old_r,m);
|
||||
Mat4x4TranslationAdd(new_m,x,y,z);
|
||||
dc->r=Mat4x4MulMat4x4Equ(r,old_r,new_m);
|
||||
Sprite3(dc,0,0,0,elems);
|
||||
dc->r=old_r;
|
||||
MemCpy(m,old_m,16*sizeof(I64));
|
||||
dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
|
||||
st1=buf;
|
||||
st2="";
|
||||
}
|
||||
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.TXT.Z\"$$\n"
|
||||
"\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=GBM_COLOR$$\n"
|
||||
@@ -262,12 +261,10 @@ bm_menu:
|
||||
case GBM_MAIN_MENU:
|
||||
result=GE_CONT;
|
||||
goto bm_done;
|
||||
|
||||
case GBM_COLOR:
|
||||
i=PopUpColor(,,FALSE);
|
||||
if (i>=0) color=i;
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_FIND_AND_REPLACE:
|
||||
i=PopUpColor("Find Color\n",,FALSE);
|
||||
if (i>=0) {
|
||||
@@ -278,12 +275,10 @@ bm_menu:
|
||||
}
|
||||
}
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_TRIM_TO_EXTENTS:
|
||||
GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_ADD_OUTLINE:
|
||||
i=PopUpRangeI64(1,16,1,"Outline Width\n");
|
||||
if (i>=0) {
|
||||
@@ -291,7 +286,6 @@ bm_menu:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_ETCH:
|
||||
i=PopUpRangeI64(1,16,1,"Etch Width\n");
|
||||
if (i>=0) {
|
||||
@@ -299,39 +293,33 @@ bm_menu:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_SAVE_BMP:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
BMPWrite(filename.name,img);
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_SAVE_GRA:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
GRAWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_DITHER_COLOR:
|
||||
i=PopUpColorDither;
|
||||
if (i>=0) color=i;
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_WIDTH:
|
||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||
if (i>=0) width=i;
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_UNDO:
|
||||
if (undo) {
|
||||
Beep;
|
||||
DCFill(img,bkcolor);
|
||||
img->color=ROP_EQU;
|
||||
GrBlot(img,0,0,undo);
|
||||
DCDel(undo);
|
||||
undo=NULL;
|
||||
}
|
||||
goto bm_menu;
|
||||
|
||||
case GBM_PT:
|
||||
case GBM_LINE:
|
||||
case GBM_ARROW:
|
||||
@@ -347,7 +335,6 @@ bm_menu:
|
||||
case GBM_PASTE_TRANSPARENT:
|
||||
mode=i;
|
||||
break;
|
||||
|
||||
case GBM_TEXT:
|
||||
case GBM_TEXT_BOX:
|
||||
case GBM_TEXT_DIAMOND:
|
||||
@@ -358,7 +345,6 @@ bm_menu:
|
||||
else
|
||||
goto bm_menu;
|
||||
break;
|
||||
|
||||
}
|
||||
DCDel(undo);
|
||||
undo=DCExtract(img,0,0,img->width-1,img->height-1);
|
||||
|
||||
+188
-129
@@ -1,5 +1,54 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *root,I64 elem_num,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
|
||||
I64 *_xx=NULL,I64 *_yy=NULL)
|
||||
{
|
||||
CSprite *result=root->next;
|
||||
I64 width=1,xx=0,yy=0;
|
||||
CColorROPU32 color=BLACK;
|
||||
if (dc) DCRst(dc);
|
||||
while (elem_num-->0 && result!=root) {
|
||||
switch (result->type) {
|
||||
case SPT_COLOR:
|
||||
color=result->c.color;
|
||||
if (dc) dc->color=color;
|
||||
break;
|
||||
case SPT_DITHER_COLOR:
|
||||
color=result->d.dither_color.u8[0]|
|
||||
result->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||
if (dc) dc->color=color;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
width=result->w.width;
|
||||
if (dc) dc->pen_width=width;
|
||||
break;
|
||||
case SPT_SHIFT:
|
||||
xx+=result->p.x1;
|
||||
yy+=result->p.y1;
|
||||
x+=result->p.x1;
|
||||
y+=result->p.y1;
|
||||
break;
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
if (dc) {
|
||||
if (DCSymmetry3Set(dc,result->pp.x1+x,result->pp.y1+y,0,
|
||||
result->pp.x2+x,result->pp.y2+y,0,
|
||||
result->pp.x2+x,result->pp.y2+y,1))
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
else
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
}
|
||||
break;
|
||||
}
|
||||
result=result->next;
|
||||
}
|
||||
if (_color) *_color=color;
|
||||
if (_width) *_width=width;
|
||||
if (_xx) *_xx=xx;
|
||||
if (_yy) *_yy=yy;
|
||||
return result;
|
||||
}
|
||||
|
||||
Bool SpritePolyPtPlot(CSprite *root,I64 x,I64 y,I64)
|
||||
{
|
||||
CSprite *tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PT));
|
||||
@@ -10,23 +59,6 @@ Bool SpritePolyPtPlot(CSprite *root,I64 x,I64 y,I64)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CSprite *SpriteElemNum2QueEntry(CSprite *root,I64 elem_num,
|
||||
I64 *_x=NULL,I64 *_y=NULL)
|
||||
{
|
||||
I64 xx=0,yy=0;
|
||||
CSprite *result=root->next;
|
||||
while (result!=root && elem_num--) {
|
||||
if (result->type==SPT_SHIFT) {
|
||||
xx+=result->p.x1;
|
||||
yy+=result->p.y1;
|
||||
}
|
||||
result=result->next;
|
||||
}
|
||||
if (_x) *_x=xx;
|
||||
if (_y) *_y=yy;
|
||||
return result;
|
||||
}
|
||||
|
||||
CSprite *Sprite2SpriteQue(U8 *elems)
|
||||
{
|
||||
I64 s;
|
||||
@@ -37,6 +69,7 @@ CSprite *Sprite2SpriteQue(U8 *elems)
|
||||
tempg1=MAlloc(SpriteElemSize(tempg)+offset(CSprite.start));
|
||||
s=SpriteElemSize(tempg);
|
||||
MemCpy(&tempg1->start,&tempg->start,s);
|
||||
tempg1->selected=FALSE;
|
||||
QueIns(tempg1,result->last);
|
||||
tempg(U8 *)+=s;
|
||||
}
|
||||
@@ -65,8 +98,9 @@ U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL)
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 SpriteEdUpdate(CDoc *doc,CDocBin *tempb,CSprite *root)
|
||||
U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *root)
|
||||
{
|
||||
CDocBin *tempb=doc_ce->bin_data;
|
||||
I64 size;
|
||||
Bool unlock=DocLock(doc);
|
||||
Free(tempb->data);
|
||||
@@ -83,6 +117,7 @@ U0 SpriteSetOrigin(CSprite *root,I64 dx,I64 dy,I64 dz)
|
||||
CD3I32 *p;
|
||||
CSprite *tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
if (tempg->selected)
|
||||
switch (tempg->type) {
|
||||
case SPT_ARROW:
|
||||
case SPT_LINE:
|
||||
@@ -168,6 +203,7 @@ CSprite *SpriteTransformCircle(I64 *r,CSprite *tempg)
|
||||
tempg1->pwha.height=ToI64(m2)/0x10000;
|
||||
tempg1->pwha.angle=-a1;
|
||||
|
||||
tempg1->selected=tempg->selected;
|
||||
return tempg1;
|
||||
}
|
||||
|
||||
@@ -208,6 +244,7 @@ CSprite *SpriteTransformEllipse(I64 *r,CSprite *tempg)
|
||||
if (tempg1->pwha.height<1) tempg1->pwha.height=1;
|
||||
tempg1->pwha.angle=-a1;
|
||||
|
||||
tempg1->selected=tempg->selected;
|
||||
return tempg1;
|
||||
}
|
||||
|
||||
@@ -249,12 +286,13 @@ CSprite *SpriteTransformRect(I64 *r,CSprite *tempg,F64
|
||||
tempg1->ppa.y2=tempg1->ppa.y1+h;
|
||||
tempg1->ppa.angle=-a1;
|
||||
|
||||
tempg1->selected=tempg->selected;
|
||||
return tempg1;
|
||||
}
|
||||
|
||||
CSprite *SpriteTransformBitmap(I64 *r,CSprite *tempg)
|
||||
CSprite *SpriteTransformBitMap(I64 *r,CSprite *tempg)
|
||||
{
|
||||
CDC *img,*tempb;
|
||||
CDC *img,*dc3;
|
||||
U8 *elems;
|
||||
I64 x,y,z,minx,maxx,miny,maxy,minz,maxz;
|
||||
CSprite *tempg1;
|
||||
@@ -292,7 +330,7 @@ CSprite *SpriteTransformBitmap(I64 *r,CSprite *tempg)
|
||||
if (z<minx) minz=z;
|
||||
if (z>maxx) maxz=z;
|
||||
|
||||
tempb=DCNew(maxx-minx+1,maxy-miny+1);
|
||||
dc3=DCNew(maxx-minx+1,maxy-miny+1);
|
||||
|
||||
img=CAlloc(sizeof(CDC));
|
||||
img->width=tempg->pwhu.width;
|
||||
@@ -301,22 +339,22 @@ CSprite *SpriteTransformBitmap(I64 *r,CSprite *tempg)
|
||||
img->body=&tempg->pwhu.u;
|
||||
img->dc_signature=DCS_SIGNATURE_VAL;
|
||||
|
||||
tempb->color=TRANSPARENT;
|
||||
GrRect(tempb,0,0,maxx-minx+1,maxy-miny+1);
|
||||
dc3->color=TRANSPARENT;
|
||||
GrRect(dc3,0,0,maxx-minx+1,maxy-miny+1);
|
||||
|
||||
Free(tempb->r);
|
||||
DCMat4x4Set(tempb,r);
|
||||
tempb->flags|=DCF_TRANSFORMATION;
|
||||
Free(dc3->r);
|
||||
DCMat4x4Set(dc3,r);
|
||||
dc3->flags|=DCF_TRANSFORMATION;
|
||||
|
||||
tempb->x=-minx;
|
||||
tempb->y=-miny;
|
||||
tempb->z=-minz;
|
||||
GrBlot3(tempb,0,0,0,img);
|
||||
dc3->x=-minx;
|
||||
dc3->y=-miny;
|
||||
dc3->z=-minz;
|
||||
GrBlot3(dc3,0,0,0,img);
|
||||
Free(img);
|
||||
|
||||
elems=DC2Sprite(tempb);
|
||||
tempb->r=NULL;
|
||||
DCDel(tempb);
|
||||
elems=DC2Sprite(dc3);
|
||||
dc3->r=NULL;
|
||||
DCDel(dc3);
|
||||
tempg1=CAlloc(offset(CSprite.start)+MSize(elems));
|
||||
MemCpy(tempg1(U8 *)+offset(CSprite.start),elems,MSize(elems));
|
||||
tempg1->type=tempg->type;
|
||||
@@ -342,6 +380,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
CD3I32 *p;
|
||||
CSprite *tempg=root->next,root2,*tempg1,*tempg2,*tempg3;
|
||||
while (tempg!=root) {
|
||||
if (tempg->selected)
|
||||
switch (tempg->type) {
|
||||
case SPT_WIDTH:
|
||||
tempg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
|
||||
@@ -366,7 +405,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
tempg->p.y1=y;
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
tempg1=SpriteTransformBitmap(r,tempg);
|
||||
tempg1=SpriteTransformBitMap(r,tempg);
|
||||
QueIns(tempg1,tempg);
|
||||
QueRem(tempg);
|
||||
Free(tempg);
|
||||
@@ -467,6 +506,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
tempg3->npu.num=num;
|
||||
QueIns(tempg3,tempg);
|
||||
QueRem(tempg);
|
||||
tempg3->selected=tempg->selected;
|
||||
Free(tempg);
|
||||
tempg=tempg3;
|
||||
break;
|
||||
@@ -513,6 +553,31 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
}
|
||||
}
|
||||
|
||||
I64 SpriteQueSelectCnt(CSprite *root,Bool val=TRUE)
|
||||
{
|
||||
I64 result=0;
|
||||
CSprite *tempg=root->next;
|
||||
val=ToBool(val);
|
||||
while (tempg!=root) {
|
||||
if (ToBool(tempg->selected)==val)
|
||||
result++;
|
||||
tempg=tempg->next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 SpriteQueSelectAll(CSprite *root,Bool val=TRUE)
|
||||
{
|
||||
I64 result=0;
|
||||
CSprite *tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
tempg->selected=val;
|
||||
result++;
|
||||
tempg=tempg->next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
||||
{//For the side-bar
|
||||
CSprite *result=CAlloc(sizeof(CSprite)),*tempg;
|
||||
@@ -522,9 +587,10 @@ CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
||||
QueInit(result);
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
|
||||
tempg=SpriteElemNum2QueEntry(root,doc_e->left_exp);
|
||||
tempg=SpriteSetSettings(,root,doc_e->left_exp);
|
||||
if (tempg!=root) {
|
||||
tempg=MAllocIdentical(tempg);
|
||||
tempg->selected=Bt(&doc_e->type,DOCEt_SELECTED);
|
||||
if (*_cur_elem_num==doc_e->left_exp) {
|
||||
*_cur_elem_num=num;
|
||||
found=TRUE;
|
||||
@@ -545,36 +611,36 @@ CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
||||
U0 SpriteSideBarPickNew(CDoc *doc,CSprite *root,I64 old_num)
|
||||
{
|
||||
CSprite *tempg;
|
||||
CDocEntry *doc_e=NULL;
|
||||
CDocEntry *doc_cur_e=NULL,*doc_e;
|
||||
I64 cur_elem_num=0;
|
||||
U8 *st;
|
||||
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\","
|
||||
"A=\"FI:::/Doc/SpriteSideBar.TXT.Z\"$$\n\n");
|
||||
|
||||
tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
st=SpriteElem2Summary(tempg);
|
||||
if (cur_elem_num==old_num) {
|
||||
DocPrint(doc,"$$LTRED$$");
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
doc_e=doc_cur_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
} else {
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
}
|
||||
BEqu(&doc_e->de_flags,DOCEf_SELECTED,tempg->selected);
|
||||
BEqu(&doc_e->type,DOCEt_SELECTED,tempg->selected);
|
||||
Free(st);
|
||||
tempg=tempg->next;
|
||||
}
|
||||
if (cur_elem_num==old_num) {
|
||||
DocPrint(doc,"$$LTRED$$");
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
doc_cur_e=DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
} else {
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
}
|
||||
if (doc_e)
|
||||
doc->cur_entry=doc_e;
|
||||
if (doc_cur_e)
|
||||
doc->cur_entry=doc_cur_e;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask2(CTask *grand_parent)
|
||||
@@ -601,6 +667,7 @@ U0 SpriteSideBarTask(CTask *parent,CSprite **_root,I64 *_cur_elem_num)
|
||||
doc->flags|=DOCF_MIN_SIZE|DOCF_FORM;
|
||||
while (TRUE) {
|
||||
SpriteSideBarPickNew(doc,*_root,*_cur_elem_num);
|
||||
DocHighlightCursor(,doc);
|
||||
View;
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL)
|
||||
@@ -648,24 +715,26 @@ Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
||||
return result;
|
||||
}
|
||||
|
||||
#define GED_SHIFT_PTS 0
|
||||
#define GED_SHIFT_RECTS 1
|
||||
#define GED_TEXT_ED 2
|
||||
#define GED_TRANSFORM 3
|
||||
#define GED_SET_ORIGIN 4
|
||||
#define GED_SHIFT_ORIGIN 5
|
||||
#define GED_SHIFT_SUB_ORIGIN 6
|
||||
#define GED_PICK_GRAPHICALLY 7
|
||||
#define GED_DELETE 8
|
||||
#define GED_INS_CLIPBOARD 9
|
||||
#define GED_MAIN_MENU 10
|
||||
#define GED_EXIT 11
|
||||
#define GED_SELECT_UNSELECT_ALL 0
|
||||
#define GED_SELECT 1
|
||||
#define GED_UNSELECT 2
|
||||
#define GED_SHIFT_PTS 3
|
||||
#define GED_SHIFT_RECTS 4
|
||||
#define GED_SHIFT_SELECTED 5
|
||||
#define GED_TRANSFORM_SELECTED 6
|
||||
#define GED_SET_ORIGIN 7
|
||||
#define GED_SHIFT_SUB_ORIGIN 8
|
||||
#define GED_TEXT_ED 9
|
||||
#define GED_INS_CLIPBOARD 10
|
||||
#define GED_MAIN_MENU 11
|
||||
#define GED_EXIT 12
|
||||
|
||||
U0 GrInit3()
|
||||
{
|
||||
DefineLstLoad("ST_SPRITE_ED_MENU","Shift Points\0Shift Rects\0"
|
||||
"Edit as Text\0Transform\0Set Origin\0Shift Origin\0Shift SubOrigin\0"
|
||||
"Pick Graphically\0Delete Object\0Insert Clipboard\0Main Menu\0");
|
||||
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unslesct All\0"
|
||||
"Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0"
|
||||
"Transform Selected\0Set Origin\0Insert Shift SubOrigin\0"
|
||||
"Edit as Text\0Insert Clipboard\0Main Menu\0");
|
||||
}
|
||||
GrInit3;
|
||||
|
||||
@@ -677,18 +746,18 @@ I64 PopUpSpriteEd(CSprite **_root,I64 *_cur_elem_num)
|
||||
CDoc *doc=DocNew;
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Edit Menu\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.TXT.Z\"$$\n\n"
|
||||
"$$LTBLUE$$$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n"
|
||||
"$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=GED_SELECT_UNSELECT_ALL$$\n"
|
||||
"$$MU-UL,\"Select Elems\",LE=GED_SELECT$$\n"
|
||||
"$$MU-UL,\"Unselect Elems\",LE=GED_UNSELECT$$\n\n"
|
||||
"$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n"
|
||||
"$$MU-UL,\"Shift Points with Rects\",LE=GED_SHIFT_RECTS$$\n"
|
||||
"$$MU-UL,\"Edit as Text\",LE=GED_TEXT_ED$$\n"
|
||||
"$$MU-UL,\"Transform\",LE=GED_TRANSFORM$$\n"
|
||||
"$$MU-UL,\"Shift Selected Elems\",LE=GED_SHIFT_SELECTED$$\n"
|
||||
"$$MU-UL,\"Transform Selected Elems\",LE=GED_TRANSFORM_SELECTED$$\n\n"
|
||||
"$$MU-UL,\"Set Origin\",LE=GED_SET_ORIGIN$$\n"
|
||||
"$$MU-UL,\"Shift Origin\",LE=GED_SHIFT_ORIGIN$$\n"
|
||||
"$$MU-UL,\"Insert Shift SubOrigin\",LE=GED_SHIFT_SUB_ORIGIN$$\n"
|
||||
"$$MU-UL,\"Pick or Delete Objects Graphically\","
|
||||
"LE=GED_PICK_GRAPHICALLY$$\n"
|
||||
"$$MU-UL,\"Delete\",LE=GED_DELETE$$\n"
|
||||
"$$MU-UL,\"Insert Clipboard Sprite's\",LE=GED_INS_CLIPBOARD$$\n"
|
||||
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GED_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Insert Shift SubOrigin\",LE=GED_SHIFT_SUB_ORIGIN$$\n\n"
|
||||
"$$MU-UL,\"Edit as Text\",LE=GED_TEXT_ED$$\n"
|
||||
"$$MU-UL,\"Insert Clipboard Sprite's\",LE=GED_INS_CLIPBOARD$$\n\n"
|
||||
"$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GED_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=GED_EXIT$$\n"
|
||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$");
|
||||
st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_root,_cur_elem_num);
|
||||
@@ -1007,72 +1076,64 @@ gs_done:
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
CSprite **_root,I64 *_cur_elem_num)
|
||||
{
|
||||
CDocEntry *doc_e2;
|
||||
CDocBin *tempb;
|
||||
Bool unlock,del_down;
|
||||
Bool unlock;
|
||||
I64 i,r[16],msg_code,a1,a2,xx,yy,
|
||||
old_de_flags;
|
||||
CSprite *cur_elem,*root2,*next,*last,*tempg,*insert_pt;
|
||||
|
||||
old_de_flags=doc_e->de_flags;
|
||||
tempb=doc_e->bin_data;
|
||||
old_de_flags=doc_ce->de_flags;
|
||||
tempb=doc_ce->bin_data;
|
||||
DocUnlock(doc);
|
||||
SpriteQueSelectAll(*_root,FALSE);
|
||||
do {
|
||||
if (winmgr.fps<10)
|
||||
doc_e->de_flags|=DOCEF_DONT_DRAW;
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
StrCpy(Fs->task_title,"Sprite Edit Menu");
|
||||
i=PopUpSpriteEd(_root,_cur_elem_num);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
if (0<=i<GED_EXIT) {
|
||||
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_ED_MENU"));
|
||||
switch (i) {
|
||||
case GED_PICK_GRAPHICALLY:
|
||||
RegOneTimePopUp(ARf_CSPRITE_PICK_GRAPHICALLY,
|
||||
"You can delete elements by\n"
|
||||
"holding $$GREEN$$Delete$$FG$$ and clicking.\n");
|
||||
doc_e->de_flags=old_de_flags;
|
||||
case GED_SELECT_UNSELECT_ALL:
|
||||
if (!SpriteQueSelectCnt(*_root))
|
||||
SpriteQueSelectAll(*_root);
|
||||
else
|
||||
SpriteQueSelectAll(*_root,FALSE);
|
||||
break;
|
||||
case GED_SELECT:
|
||||
case GED_UNSELECT:
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
doc->cur_sprite=tempb->data;
|
||||
doc->nearest_sprite_elem_num=0;
|
||||
del_down=FALSE;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP|1<<MSG_IP_R_UP|1<<MSG_KEY_DOWN|1<<MSG_KEY_UP);
|
||||
if (a2.u8[0]==SC_DELETE&& !(a2&SCF_IP_L_DOWN)) {
|
||||
if (msg_code==MSG_KEY_DOWN)
|
||||
del_down=TRUE;
|
||||
else if (msg_code==MSG_KEY_UP)
|
||||
del_down=FALSE;
|
||||
}
|
||||
if (msg_code==MSG_IP_L_UP && kbd.scan_code&SCF_DELETE ||
|
||||
msg_code==MSG_KEY_DOWN && a2&SCF_IP_L_DOWN &&
|
||||
a2.u8[0]==SC_DELETE) {
|
||||
*_cur_elem_num=doc->nearest_sprite_elem_num;
|
||||
cur_elem=SpriteElemNum2QueEntry(*_root,*_cur_elem_num);
|
||||
if (cur_elem!=*_root) {
|
||||
QueRem(cur_elem);
|
||||
Free(cur_elem);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
}
|
||||
doc->cur_sprite=tempb->data;
|
||||
doc->nearest_sprite_elem_num=0;
|
||||
if (msg_code==MSG_KEY_DOWN)
|
||||
GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
||||
}
|
||||
} while (del_down || msg_code!=MSG_IP_L_UP && msg_code!=MSG_IP_R_UP);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN|1<<MSG_IP_R_UP);
|
||||
WinMgrSync(2);
|
||||
if (msg_code==MSG_IP_L_DOWN) {
|
||||
*_cur_elem_num=doc->nearest_sprite_elem_num;
|
||||
cur_elem=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
cur_elem->selected=ToBool(i==GED_SELECT);
|
||||
GetMsg(,,1<<MSG_IP_L_UP);
|
||||
}
|
||||
} while (msg_code!=MSG_IP_R_UP);
|
||||
doc->cur_sprite=NULL;
|
||||
break;
|
||||
case GED_SET_ORIGIN:
|
||||
doc_e->de_flags=old_de_flags;
|
||||
SpriteQueSelectAll(*_root);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
||||
SpriteSetOrigin(*_root,x-a1,y-a2,0);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteQueSelectAll(*_root,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_ORIGIN:
|
||||
doc_e->de_flags=old_de_flags;
|
||||
case GED_SHIFT_SELECTED:
|
||||
if (!SpriteQueSelectCnt(*_root))
|
||||
SpriteQueSelectAll(*_root);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN);
|
||||
xx=a1; yy=a2;
|
||||
do {
|
||||
@@ -1080,8 +1141,10 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteSetOrigin(*_root,a1-xx,a2-yy,0);
|
||||
xx=a1; yy=a2;
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
if (!SpriteQueSelectCnt(*_root,FALSE))
|
||||
SpriteQueSelectAll(*_root,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_PTS:
|
||||
case GED_SHIFT_RECTS:
|
||||
@@ -1090,24 +1153,28 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
"and rectangles with '$$GREEN$$p$$FG$$' and '$$GREEN$$r$$FG$$'.\n"
|
||||
"Press '$$GREEN$$r$$FG$$' after one rectangle\n"
|
||||
"to OR another rectangle.\n");
|
||||
doc_e->de_flags=old_de_flags;
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
if (SpriteShiftPts(tempb->data,x,y,_cur_elem_num,i)) {
|
||||
QueDel(*_root);
|
||||
Free(*_root);
|
||||
*_root=Sprite2SpriteQue(tempb->data);
|
||||
} else
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
break;
|
||||
case GED_TRANSFORM:
|
||||
case GED_TRANSFORM_SELECTED:
|
||||
if (!SpriteQueSelectCnt(*_root))
|
||||
SpriteQueSelectAll(*_root);
|
||||
if (PopUpTransform(r)) {
|
||||
SpriteTransform(r,*_root);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
}
|
||||
if (!SpriteQueSelectCnt(*_root,FALSE))
|
||||
SpriteQueSelectAll(*_root,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_SUB_ORIGIN:
|
||||
doc_e->de_flags=old_de_flags;
|
||||
insert_pt=SpriteElemNum2QueEntry(*_root,*_cur_elem_num);
|
||||
tempg=MAlloc(SpriteElemQuedBaseSize(SPT_SHIFT));
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
insert_pt=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFT));
|
||||
tempg->type=SPT_SHIFT;
|
||||
tempg->p.x1=0;
|
||||
tempg->p.y1=0;
|
||||
@@ -1119,7 +1186,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
tempg->p.x1=a1-xx;
|
||||
tempg->p.y1=a2-yy;
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
*_cur_elem_num+=1;
|
||||
break;
|
||||
@@ -1130,7 +1197,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
"'Insert shift sub-origin' after picking the\n"
|
||||
"element to insert before. Or,\n"
|
||||
"use 'shift points'.\n");
|
||||
insert_pt=SpriteElemNum2QueEntry(*_root,*_cur_elem_num);
|
||||
insert_pt=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
unlock=DocLock(sys_clipboard_doc);
|
||||
doc_e2=sys_clipboard_doc->root.next;
|
||||
while (doc_e2!=sys_clipboard_doc) {
|
||||
@@ -1155,24 +1222,16 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_e,I64 x,I64 y,
|
||||
}
|
||||
if (unlock)
|
||||
DocUnlock(sys_clipboard_doc);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
break;
|
||||
case GED_DELETE:
|
||||
cur_elem=SpriteElemNum2QueEntry(*_root,*_cur_elem_num);
|
||||
if (cur_elem!=*_root) {
|
||||
QueRem(cur_elem);
|
||||
Free(cur_elem);
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
}
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
break;
|
||||
case GED_TEXT_ED:
|
||||
if (SpriteEdText(_root,_cur_elem_num))
|
||||
SpriteEdUpdate(doc,tempb,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (i!=DOCM_CANCEL && i!=GED_EXIT && i!=GED_MAIN_MENU);
|
||||
doc_e->de_flags=old_de_flags;
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
|
||||
switch (i) {
|
||||
case DOCM_CANCEL: return GE_ABORT;
|
||||
|
||||
+943
-897
File diff suppressed because it is too large.
Load diff
@@ -197,12 +197,14 @@ public I64 FileOcc(U8 *needle_str,
|
||||
|
||||
class CFind
|
||||
{
|
||||
U8 find_text[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"FIND :%s\"$$\n";
|
||||
U8 replace_text[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"REPLACE :%s\"$$\n";
|
||||
U8 find_text[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,"
|
||||
"A=\"FIND :%s\"$$\n";
|
||||
U8 replace_text[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,"
|
||||
"A=\"REPLACE :%s\"$$\n";
|
||||
Bool replace fmtstr "$$CB,\"REPLACE\"$$\n";
|
||||
Bool match_case fmtstr "$$CB,\"MATCH CASE\"$$\n";
|
||||
Bool whole_labels fmtstr "$$CB,\"WHOLE LABELS\"$$\n";
|
||||
U8 filemask[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"FILE MASK :%s\"$$\n";
|
||||
U8 filemask[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"FILE MASK :%s\"$$\n";
|
||||
Bool recurse fmtstr "$$CB,\"RECURSE\"$$\n";
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#help_index "Debugging/Heap"
|
||||
#help_file "::/Doc/HeapDbg"
|
||||
|
||||
#define HL_CALLER_DEPTH 4
|
||||
#define HL_CALLER_DEPTH 5 //Feel free to change this.
|
||||
#define HL_HASH_SIZE 0x1000
|
||||
|
||||
class CHeapLog
|
||||
|
||||
@@ -10,6 +10,5 @@ Cd(__DIR__);;
|
||||
#include "Profiler"
|
||||
#include "StrUtils"
|
||||
#include "ToDolDoc"
|
||||
#include "ToHtml"
|
||||
#include "ToTXT"
|
||||
Cd("..");;
|
||||
@@ -227,9 +227,5 @@ public U0 MemRep()
|
||||
MemRepTask(c->idle_task,TRUE);
|
||||
"$$ID,-2$$";
|
||||
}
|
||||
|
||||
"$$GREEN$$Independent Heaps$$FG$$\n$$ID,2$$";
|
||||
"$$BLACK$$dev.uncached_heap:%010X Used:%010X$$FG$$\n",
|
||||
dev.uncached_heap->bp->alloced_u8s,dev.uncached_heap->used_u8s;
|
||||
"$$ID,-2$$\n";
|
||||
}
|
||||
@@ -28,7 +28,8 @@ public CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0)
|
||||
task->animate_task=NULL;
|
||||
|
||||
if (doc=DocPut(task)) {
|
||||
tempse->cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
||||
tempse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
||||
tempse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
|
||||
tempse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
|
||||
}
|
||||
|
||||
@@ -63,7 +64,8 @@ U0 SettingsPop2(CTask *task,CTaskSettings *tempse)
|
||||
CDoc *doc;
|
||||
|
||||
if (doc=DocPut(task)) {
|
||||
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tempse->cursor);
|
||||
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tempse->hide_cursor);
|
||||
LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tempse->highlight_cursor);
|
||||
LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tempse->scroll);
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -316,10 +316,10 @@ CDoc *WinCursorPosSet(CTask *task,I64 ipx,I64 ipy,Bool set_cursor=TRUE)
|
||||
else {
|
||||
x0=result->line_start_col;
|
||||
y0=result->top_line_num;
|
||||
DocRecalc(result,TRUE);
|
||||
DocRecalc(result,RECALCF_HAS_CURSOR);
|
||||
result->x=(ipx-task->pix_left-task->scroll_x)/FONT_WIDTH +x0;
|
||||
result->y=(ipy-task->pix_top -task->scroll_y)/FONT_HEIGHT+y0;
|
||||
DocRecalc(result,FALSE,DOC_RECALC_FIND_CURSOR);
|
||||
DocRecalc(result,RECALCt_FIND_CURSOR);
|
||||
task->scroll_x=0;
|
||||
task->scroll_y=0;
|
||||
task->scroll_z=0;
|
||||
@@ -440,10 +440,9 @@ U0 WinMgrTask(I64)
|
||||
while (TRUE) {
|
||||
try {
|
||||
wmt_start:
|
||||
if (Bt(&sys_run_level,RLf_ADAM_SERVER))
|
||||
TaskKillDying;
|
||||
WinMgrSleep;
|
||||
//We delay freeing in case lingering
|
||||
//references are made to task's.
|
||||
TaskFinishOffDying;
|
||||
|
||||
task=Fs->last_task;
|
||||
while (TRUE) {
|
||||
|
||||
@@ -23,11 +23,11 @@ U0 BgtIns(CBgtEntry *tempb)
|
||||
|
||||
class CBgtEntryForm
|
||||
{
|
||||
U8 date[512] fmtstr "$$DA-P,511,A=\"Date :%s\"$$\n";
|
||||
F64 amount fmtstr "Amount $$$$$$DA,511,A=\"%6.2f\"$$\n";
|
||||
U8 credit[512] fmtstr "$$DA-P,511,A=\"Credit Acct:%s\"$$\n";
|
||||
U8 debit [512] fmtstr "$$DA-P,511,A=\"Debit Acct:%s\"$$\n";
|
||||
U8 desc [512] fmtstr "$$DA-P,511,A=\"Desc :%s\"$$\n";
|
||||
U8 date[512] fmtstr "$$DA-P,LEN=511,A=\"Date :%s\"$$\n";
|
||||
F64 amount fmtstr "Amount $$$$$$DA,A=\"%6.2f\"$$\n";
|
||||
U8 credit[512] fmtstr "$$DA-P,LEN=511,A=\"Credit Acct:%s\"$$\n";
|
||||
U8 debit [512] fmtstr "$$DA-P,LEN=511,A=\"Debit Acct:%s\"$$\n";
|
||||
U8 desc [512] fmtstr "$$DA-P,LEN=511,A=\"Desc :%s\"$$\n";
|
||||
};
|
||||
|
||||
CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
||||
|
||||
@@ -44,9 +44,9 @@ class CBgtTemplate
|
||||
U0 start;
|
||||
U16 type fmtstr "$$LS,RT=U16,D=\"ST_BGT_TEMPLATE_TYPES\"$$\n";
|
||||
U16 flags;
|
||||
U8 start_date[16] fmtstr "$$DA-P,15,A=\"Start Date:%s\"$$\n";
|
||||
U8 end_date[16] fmtstr "$$DA-P,15,A=\"End Date :%s\"$$\n";
|
||||
F64 period fmtstr "$$DA,511, A=\"Period :%6.2f\"$$\n";
|
||||
U8 start_date[16] fmtstr "$$DA-P,LEN=15,A=\"Start Date:%s\"$$\n";
|
||||
U8 end_date[16] fmtstr "$$DA-P,LEN=15,A=\"End Date :%s\"$$\n";
|
||||
F64 period fmtstr "$$DA,A=\"Period :%6.2f\"$$\n";
|
||||
U0 end;
|
||||
|
||||
CBgtEntry b;
|
||||
|
||||
@@ -13,9 +13,9 @@ class Ball
|
||||
|
||||
class BallDefineStruct
|
||||
{
|
||||
F64 radius fmtstr "$$DA-TRM,32,RT=F64,A=\"Radius :%8.3f\"$$\n";
|
||||
I64 n_longitude fmtstr "$$DA-TRM,32,A=\"Longitude Faces:%5d\"$$\n";
|
||||
I64 n_lattitude fmtstr "$$DA-TRM,32,A=\"Lattitude Rings:%5d\"$$\n";
|
||||
F64 radius fmtstr "$$DA-TRM,RT=F64,A=\"Radius :%8.3f\"$$\n";
|
||||
I64 n_longitude fmtstr "$$DA-TRM,A=\"Longitude Faces:%5d\"$$\n";
|
||||
I64 n_lattitude fmtstr "$$DA-TRM,A=\"Lattitude Rings:%5d\"$$\n";
|
||||
};
|
||||
|
||||
U0 BDInit(BallDefineStruct *bd)
|
||||
|
||||
+28
-28
@@ -14,66 +14,66 @@ class Man
|
||||
class ManDefineStruct
|
||||
{
|
||||
F64 head_rad fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Head Radius :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Head Radius :%8.3f\"$$\n";
|
||||
|
||||
F64 torso_len fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Torso Length :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Torso Length :%8.3f\"$$\n";
|
||||
F64 arm_len fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Arm Length :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Arm Length :%8.3f\"$$\n";
|
||||
F64 hand_len fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Hand Length :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Hand Length :%8.3f\"$$\n";
|
||||
F64 leg_len fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Leg Length :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Leg Length :%8.3f\"$$\n";
|
||||
F64 foot_len fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Foot Length :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Foot Length :%8.3f\"$$\n";
|
||||
F64 torso_width fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Torso Width :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Torso Width :%8.3f\"$$\n";
|
||||
F64 torso_depth fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Torso Depth :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Torso Depth :%8.3f\"$$\n";
|
||||
F64 arm_rad fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Arm Radius :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Arm Radius :%8.3f\"$$\n";
|
||||
F64 hand_rad fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Hand Radius :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Hand Radius :%8.3f\"$$\n";
|
||||
F64 leg_rad fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Leg Radius :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Leg Radius :%8.3f\"$$\n";
|
||||
F64 foot_rad fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"Foot Radius :%8.3f\"$$\n\n";
|
||||
"$$DA-TRM,RT=F64,A=\"Foot Radius :%8.3f\"$$\n\n";
|
||||
|
||||
F64 r_shoulder_a1 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Shoulder Front/Back Angle:%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Shoulder Front/Back Angle:%8.3f\"$$\n";
|
||||
F64 l_shoulder_a1 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Shoulder Front/Back Angle:%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Shoulder Front/Back Angle:%8.3f\"$$\n";
|
||||
F64 r_hip_a1 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Hip Front/Back Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Hip Front/Back Angle :%8.3f\"$$\n";
|
||||
F64 l_hip_a1 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Hip Front/Back Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Hip Front/Back Angle :%8.3f\"$$\n";
|
||||
|
||||
F64 r_shoulder_a2 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Shoulder Side Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Shoulder Side Angle :%8.3f\"$$\n";
|
||||
F64 l_shoulder_a2 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Shoulder Side Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Shoulder Side Angle :%8.3f\"$$\n";
|
||||
F64 r_hip_a2 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Hip Side Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Hip Side Angle :%8.3f\"$$\n";
|
||||
F64 l_hip_a2 fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Hip Side Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Hip Side Angle :%8.3f\"$$\n";
|
||||
|
||||
F64 r_elbow_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Elbow Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Elbow Angle :%8.3f\"$$\n";
|
||||
F64 l_elbow_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Elbow Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Elbow Angle :%8.3f\"$$\n";
|
||||
F64 r_knee_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Knee Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Knee Angle :%8.3f\"$$\n";
|
||||
F64 l_knee_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Knee Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Knee Angle :%8.3f\"$$\n";
|
||||
|
||||
F64 r_wrist_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Wrist Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Wrist Angle :%8.3f\"$$\n";
|
||||
F64 l_wrist_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Wrist Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Wrist Angle :%8.3f\"$$\n";
|
||||
F64 r_ankle_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"R.Ankle Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"R.Ankle Angle :%8.3f\"$$\n";
|
||||
F64 l_ankle_a fmtstr
|
||||
"$$DA-TRM,32,RT=F64,A=\"L.Ankle Angle :%8.3f\"$$\n";
|
||||
"$$DA-TRM,RT=F64,A=\"L.Ankle Angle :%8.3f\"$$\n";
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ $SP,"<17>",BI=17$
|
||||
U0 PsmMenu(I64 psm_octave)
|
||||
{
|
||||
DocClear;
|
||||
"$$BD,WHITE$$$$FD,GREEN$$$$CM,0,12$$\n";
|
||||
"$$BG,WHITE$$$$FD,GREEN$$$$CM,0,12$$\n";
|
||||
Sprite($IB,"<17>",BI=17$);
|
||||
'\n\n\n\n\n';
|
||||
|
||||
|
||||
@@ -336,6 +336,7 @@ U0 Init()
|
||||
ls[1].img=landscape_imgs[LANDSCAPE_TYPES-2]; //mountain
|
||||
ls[2].img=landscape_imgs[LANDSCAPE_TYPES-1]; //castle
|
||||
|
||||
MemSet(m,0,sizeof(m));
|
||||
for (i=0,tempm=m;i<MAX_MAN;i++,tempm++) {
|
||||
if (i<MAX_FRIENDLY) {
|
||||
tempm->friendly=TRUE;
|
||||
@@ -353,9 +354,10 @@ U0 Init()
|
||||
tempm->dead=FALSE;
|
||||
tempm->x=xx+64*RandI32/MAX_I32+100;
|
||||
tempm->y=yy+64*RandU32/MAX_I32-64+100;
|
||||
tempm->corpse_timeout=0;
|
||||
tempm->phase=2*ã*Rand;
|
||||
tempm->best_dd=MAX_I64;
|
||||
tempm->é=0;
|
||||
tempm->phase=2*ã*Rand;
|
||||
tempm->corpse_timeout=0;
|
||||
}
|
||||
for (i=0;i<MAX_BULLETS;i++)
|
||||
b[i].dead=TRUE;
|
||||
|
||||
@@ -207,6 +207,10 @@ U0 CmpLoadDefines()
|
||||
DefineLstLoad("ST_RAW_TYPES",
|
||||
" \0 \0I0\0U0\0I8\0U8\0I16\0U16\0I32\0U32\0I64\0U64\0"
|
||||
"F32\0UF32\0F64\0UF64\0");
|
||||
DefineLstLoad("ST_NATURAL_TYPES",
|
||||
"I8\0U8\0I16\0U16\0I32\0U32\0I64\0U64\0F64\0String\0");
|
||||
DefineLstLoad("ST_INT_SIZE_TYPES",
|
||||
"I8\0U8\0I16\0U16\0I32\0U32\0I64\0U64\0");
|
||||
DefineLstLoad("ST_TY_TYPES","NULL\0IMM\0REG\0DISP\0SIB\0RIP\0STK\0");
|
||||
DefineLstLoad("ST_U8_REGS","AL\0CL\0DL\0BL\0AH\0CH\0DH\0BH\0"
|
||||
"R8u8\0R9u8\0R10u8\0R11u8\0R12u8\0R13u8\0R14u8\0R15u8\0");
|
||||
|
||||
Binary file not shown.
+104
-97
@@ -41,7 +41,7 @@ $LK,"ICU32",A="FL:::/Compiler/BackLib.CPP.Z,47",BI=32$
|
||||
$LK,"ICU24",A="FL:::/Compiler/BackLib.CPP.Z,41",BI=33$
|
||||
$LK,"ICU16",A="FL:::/Compiler/BackLib.CPP.Z,35",BI=34$
|
||||
$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.CPP.Z,260"$
|
||||
$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,236",BI=35$
|
||||
$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,240",BI=35$
|
||||
$LK,"AOTStoreCodeU32",A="FL:::/Compiler/AsmLib.CPP.Z,30",BI=36$
|
||||
$LK,"ICU64",A="FL:::/Compiler/BackLib.CPP.Z,53",BI=37$
|
||||
$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.CPP.Z,254"$
|
||||
@@ -334,102 +334,109 @@ $LK,"InstEntryFind",A="FL:::/Compiler/UAsm.CPP.Z,66",BI=262$
|
||||
$LK,"PrsDotDotDot",A="FL:::/Compiler/PrsVar.CPP.Z,381",BI=263$
|
||||
$LK,"ICMulEqu",A="FL:::/Compiler/BackA.CPP.Z,344",BI=264$
|
||||
$LK,"AsmPrsInsFlags",A="FL:::/Compiler/AsmInit.CPP.Z,1",BI=265$
|
||||
| ||||