TempleOSCDV5.00.ISO
This commit is contained in:
1 parent
122df6338e
commit
f6eacf7744
374 files changed
+11078
-11204
No files matched your search
@@ -443,7 +443,7 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
I64 i,j,m,y=doc_ce->y;
|
||||
|
||||
if (doc->flags & DOCF_IN_DOLLAR) {
|
||||
if (!Bt(chars_bmp_getkey,ch))
|
||||
if (!Bt(char_bmp_printable,ch))
|
||||
goto ic_done;
|
||||
ChkDollarBufSize(doc);
|
||||
doc->dollar_buf[doc->dollar_buf_ptr++]=ch;
|
||||
@@ -510,7 +510,7 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
goto ic_done;
|
||||
}
|
||||
if (doc->flags & DOCF_OVERSTRIKE) {
|
||||
if (Bt(chars_bmp_displayable,ch)) {
|
||||
if (Bt(char_bmp_displayable,ch)) {
|
||||
ic_overstrike:
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_col<doc_ce->max_col) {
|
||||
@@ -578,7 +578,7 @@ ic_form_tab:
|
||||
DocInsEntry(doc,doc_ne);
|
||||
}
|
||||
} else {
|
||||
if (Bt(chars_bmp_displayable,ch)) {
|
||||
if (Bt(char_bmp_displayable,ch)) {
|
||||
if (doc_ce->type_u8==DOCT_DATA) {
|
||||
while (TRUE) {
|
||||
i=doc_ce->len+doc_ce->min_col;
|
||||
|
||||
+17
-17
@@ -359,7 +359,7 @@ U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
StrCpy(buf,"@@");
|
||||
i=2;
|
||||
while (ch>=0 && i<sizeof(CEdFindText.find_text)) {
|
||||
if (Bt(chars_bmp_alpha_numeric,ch))
|
||||
if (Bt(char_bmp_alpha_numeric,ch))
|
||||
buf[i++]=ch;
|
||||
else
|
||||
break;
|
||||
@@ -367,7 +367,7 @@ U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
}
|
||||
if (i<sizeof(CEdFindText.find_text)) {
|
||||
buf[i++]=0;
|
||||
while (ch>=0 && Bt(chars_bmp_white_space,ch))
|
||||
while (ch>=0 && Bt(char_bmp_white_space,ch))
|
||||
ch=EdRAGetU8(doc);
|
||||
if (ch==':') {
|
||||
ch=EdRAGetU8(doc);
|
||||
@@ -426,7 +426,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
I64 i,start_y,end_y,x,r,goto_line_num;
|
||||
U8 *b,*st,*st2,*prj_file;
|
||||
CTask *task=NULL;
|
||||
CSrvCmd *tmpc;
|
||||
CJob *tmpc;
|
||||
CQueVectU8 *indent;
|
||||
|
||||
DocRecalc(doc);
|
||||
@@ -442,7 +442,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
WinHorz(Fs->win_left,Fs->win_right, task);
|
||||
@@ -455,23 +455,23 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
st2=DirFile(prj_file),
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|
|
||||
1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||
tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|
|
||||
1<<JOBf_FOCUS_MASTER|1<<JOBf_FREE_ON_COMPLETE);
|
||||
Free(st);
|
||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTmp\",\"SysTmp\");",
|
||||
prj_file);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tmpc,&r))
|
||||
if (!r) {
|
||||
tmpc=TaskExe(task,Fs,
|
||||
"Load(\"SysTmp\",LDF_JUST_LOAD);",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
if (JobResScan(tmpc,&r))
|
||||
okay=TRUE;
|
||||
}
|
||||
tmpc=TaskExe(task,Fs,"Del(\"SysTmp.*\");",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
JobResScan(tmpc,&r);
|
||||
} else {
|
||||
Free(prj_file);
|
||||
@@ -483,7 +483,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
else
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||
doc->filename.name);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tmpc,&r) && r)
|
||||
okay=TRUE;
|
||||
@@ -492,10 +492,10 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
}
|
||||
if (!okay) {
|
||||
PopUpOk("Has Errors");
|
||||
while (LBts(&sys_semas[SYS_SEMA_FIX],0))
|
||||
while (LBts(&sys_semas[SEMA_FIX],0))
|
||||
Yield;
|
||||
ToFileLine(dbg.fix_file_line,&st,&i);
|
||||
LBtr(&sys_semas[SYS_SEMA_FIX],0);
|
||||
LBtr(&sys_semas[SEMA_FIX],0);
|
||||
if (!StrCmp(st,doc->filename.name))
|
||||
goto_line_num=i;
|
||||
Free(st);
|
||||
@@ -510,9 +510,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
indent=EdRICode(doc);
|
||||
DocUnlock(doc);
|
||||
if (beep) {
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Snd(86); Sleep(150); Snd;
|
||||
Sleep(100);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Snd(86); Sleep(150); Snd;
|
||||
}
|
||||
DocLock(doc);
|
||||
EdRemFunLeadingSpace(doc);
|
||||
@@ -577,9 +577,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
}
|
||||
DocUnlock(doc);
|
||||
if (beep) {
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Snd(86); Sleep(150); Snd;
|
||||
Sleep(100);
|
||||
Snd(2000); Sleep(150); Snd(0);
|
||||
Snd(86); Sleep(150); Snd;
|
||||
}
|
||||
DocLock(doc);
|
||||
EdRenumAsm(doc);
|
||||
@@ -633,7 +633,7 @@ U0 EdChSC(CDoc *doc)
|
||||
DocPrint(doc,"CH_SPACE,0x%X",sc);
|
||||
else if (ch==CH_SHIFT_SPACE)
|
||||
DocPrint(doc,"CH_SHIFT_SPACE,0x%X",sc);
|
||||
else if (Bt(chars_bmp_displayable,ch))
|
||||
else if (Bt(char_bmp_displayable,ch))
|
||||
DocPrint(doc,"'%c',0x%X",ch,sc);
|
||||
else
|
||||
DocPrint(doc,"0x%X,0x%X",ch,sc);
|
||||
|
||||
@@ -4,6 +4,8 @@ public CDoc *DocPut(CTask *task=NULL)
|
||||
//Basically, StdOut unless double buffering.
|
||||
CDoc *res;
|
||||
if (!task) task=Fs;
|
||||
if (Bt(&task->task_flags,TASKf_INPUT_FILTER_TASK))
|
||||
task=task->parent_task;
|
||||
if ((res=task->put_doc) && res->doc_signature==DOC_SIGNATURE_VAL)
|
||||
return res;
|
||||
else
|
||||
|
||||
@@ -240,7 +240,7 @@ public Bool Plain(U8 *filename,I64 edf_dof_flags=0)
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "DolDoc;Task/Srv/Exe"
|
||||
#help_index "DolDoc;Job/Exe;Task/Job/Exe"
|
||||
public I64 PopUpEd(U8 *filename,CTask *parent=NULL,CTask **_pu_task=NULL)
|
||||
{//Create PopUp win task and edit a doc.
|
||||
U8 *st=MStrPrint("Ed(\"%Q\");",filename);
|
||||
|
||||
@@ -120,9 +120,6 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
case DOCT_TAB:
|
||||
*dst++='\t';
|
||||
break;
|
||||
case DOCT_PAGE_BREAK:
|
||||
*dst++=CH_FORM_FEED;
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
if (doc->flags&DOCF_CARRIAGE_RETURN)
|
||||
*dst++='\r';
|
||||
|
||||
+14
-12
@@ -65,8 +65,9 @@ class CTransformForm
|
||||
F64 z_offset fmtstr "$$DA-TRM,A=\"Z Offset:%12.6f\"$$\n";
|
||||
};
|
||||
|
||||
Bool PopUpTransform(I64 *r)
|
||||
{
|
||||
#help_index "Graphics/Input;Graphics/Math/3D Transformation"
|
||||
public Bool PopUpTransform(I64 *r)
|
||||
{//Prompt for Mat4x4 transform.
|
||||
CTransformForm *tf=MAlloc(sizeof(CTransformForm));
|
||||
tf->x_scale=1.0;
|
||||
tf->y_scale=1.0;
|
||||
@@ -96,6 +97,7 @@ Bool PopUpTransform(I64 *r)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Input"
|
||||
#define PU_SPACING 10
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
@@ -124,7 +126,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
I64 DitherColor2(U8 *header=NULL)
|
||||
{
|
||||
I64 msg_code,a1,a2,res=-1,i,j;
|
||||
I64 msg_code,arg1,arg2,res=-1,i,j;
|
||||
DocClear;
|
||||
"%s",header;
|
||||
DocRecalc(DocPut);
|
||||
@@ -132,21 +134,21 @@ I64 DitherColor2(U8 *header=NULL)
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->draw_it=&DrawIt;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN|1<<MSG_KEY_DOWN);
|
||||
if (msg_code==MSG_IP_L_DOWN) {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
||||
i=a1/PU_SPACING;
|
||||
j=(a2-FramePtr("DitherFrame"))/PU_SPACING;
|
||||
if (a1>=0 && a2>=0 && 0<=j<17 && 0<=i<17) {
|
||||
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_KEY_DOWN);
|
||||
if (msg_code==MSG_MS_L_DOWN) {
|
||||
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP);
|
||||
i=arg1/PU_SPACING;
|
||||
j=(arg2-FramePtr("DitherFrame"))/PU_SPACING;
|
||||
if (arg1>=0 && arg2>=0 && 0<=j<17 && 0<=i<17) {
|
||||
if (j==16) j=TRANSPARENT;
|
||||
if (i==16) i=TRANSPARENT;
|
||||
res=j+i<<16+ROPF_DITHER;
|
||||
goto dc_done;
|
||||
}
|
||||
}
|
||||
} while (!(msg_code==MSG_KEY_DOWN && (a1==CH_ESC || a1==CH_SHIFT_ESC)));
|
||||
do GetMsg(&a1,&a2,1<<MSG_KEY_UP);
|
||||
while (!a1);
|
||||
} while (!(msg_code==MSG_KEY_DOWN && (arg1==CH_ESC || arg1==CH_SHIFT_ESC)));
|
||||
do GetMsg(&arg1,&arg2,1<<MSG_KEY_UP);
|
||||
while (!arg1);
|
||||
dc_done:
|
||||
SettingsPop;
|
||||
FramePtrDel("DitherFrame");
|
||||
|
||||
@@ -12,7 +12,7 @@ U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
|
||||
case DOCSS_NORMAL:
|
||||
hl_normal:
|
||||
while (len) {
|
||||
while (len && !Bt(chars_bmp_alpha_numeric,*src)) {
|
||||
while (len && !Bt(char_bmp_alpha_numeric,*src)) {
|
||||
tmp_u32_attr=_tmp_u32_attr;
|
||||
ch1=*src++;
|
||||
switch (ch1) {
|
||||
@@ -65,7 +65,7 @@ hl_normal:
|
||||
if (!--len) goto hl_normal_done;
|
||||
}
|
||||
ptr=src;
|
||||
while (len && Bt(chars_bmp_alpha_numeric,*src)) {
|
||||
while (len && Bt(char_bmp_alpha_numeric,*src)) {
|
||||
src++;
|
||||
len--;
|
||||
}
|
||||
|
||||
+17
-17
@@ -5,18 +5,18 @@ StrCpy(captured_macro_name,"Test");
|
||||
|
||||
I64 sys_macro_repeat_n=1;
|
||||
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
U0 SysMacroStripKey(CJob *macro_head,I64 arg1,I64 arg2)
|
||||
{
|
||||
CSrvCmd *tmpc,*tmpc1;
|
||||
CJob *tmpc,*tmpc1;
|
||||
tmpc=macro_head->next;
|
||||
while (tmpc!=macro_head) {
|
||||
tmpc1=tmpc->next;
|
||||
if (tmpc->cmd_code==SVCT_MSG &&
|
||||
if (tmpc->job_code==JOBT_MSG &&
|
||||
(tmpc->msg_code==MSG_KEY_DOWN || tmpc->msg_code==MSG_KEY_UP ||
|
||||
tmpc->msg_code==MSG_KEY_DOWN_UP) &&
|
||||
a1 && tmpc->aux1==a1 || !a1 && tmpc->aux2==a2) {
|
||||
arg1 && tmpc->aux1==arg1 || !arg1 && tmpc->aux2==arg2) {
|
||||
QueRem(tmpc);
|
||||
SrvCmdDel(tmpc);
|
||||
JobDel(tmpc);
|
||||
}
|
||||
tmpc=tmpc1;
|
||||
}
|
||||
@@ -33,11 +33,11 @@ class CMacroTmp
|
||||
U8 buf[STR_LEN];
|
||||
};
|
||||
|
||||
CMacroTmp *Cmd2MT(CSrvCmd *tmpc)
|
||||
CMacroTmp *Cmd2MT(CJob *tmpc)
|
||||
{
|
||||
U8 buf[8];
|
||||
CMacroTmp *tmpmt=CAlloc(sizeof(CMacroTmp));
|
||||
if (Bt(chars_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
|
||||
if (Bt(char_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
|
||||
tmpmt->type=MT_CHAR;
|
||||
buf[0]=tmpc->aux1;
|
||||
buf[1]=0;
|
||||
@@ -50,13 +50,13 @@ CMacroTmp *Cmd2MT(CSrvCmd *tmpc)
|
||||
return tmpmt;
|
||||
}
|
||||
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||
U8 *SysMacro2Str(CJob *macro_head)
|
||||
{
|
||||
CSrvCmd *tmpc;
|
||||
CJob *tmpc;
|
||||
I64 cnt=1; //terminating zero
|
||||
U8 *ptr,*m;
|
||||
CMacroTmp *tmpmt,*tmpmt1,head;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
|
||||
QueInit(&head);
|
||||
head.type=MT_NULL;
|
||||
@@ -107,7 +107,7 @@ U0 PlaySysMacro(I64 n=1)
|
||||
CTask *task=sys_focus_task;
|
||||
U8 *m;
|
||||
if (TaskValidate(task)) {
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
m=SysMacro2Str(&sys_macro_head);
|
||||
while (n-- && TaskValidate(task)) {
|
||||
if (task==Fs)
|
||||
@@ -139,7 +139,7 @@ I64 PopUpMacroMenu()
|
||||
{
|
||||
I64 res=0;
|
||||
U8 buf[STR_LEN];
|
||||
CSrvCmd *tmpc;
|
||||
CJob *tmpc;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
||||
doc_e->data=captured_macro_name;
|
||||
@@ -163,7 +163,7 @@ I64 PopUpMacroMenu()
|
||||
Fs->popup_task=sys_macro_task;
|
||||
LBts(&sys_macro_task->display_flags,DISPLAYf_WIN_ON_TOP);
|
||||
tmpc=TaskExe(sys_macro_task,Fs,buf,
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
JobResScan(tmpc,&res);
|
||||
Fs->popup_task=NULL;
|
||||
Kill(sys_macro_task);
|
||||
@@ -183,9 +183,9 @@ U0 MacroTask(I64)
|
||||
WinRefocus(sys_focus_task);
|
||||
switch (i) {
|
||||
case SM_RECORD:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
QueDel(&sys_macro_head,TRUE);
|
||||
LBts(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBts(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case SM_PLAY:
|
||||
PlaySysMacro;
|
||||
@@ -194,10 +194,10 @@ U0 MacroTask(I64)
|
||||
PlaySysMacro(sys_macro_repeat_n);
|
||||
break;
|
||||
case SM_STOP:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case SM_INS:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
LBtr(&sys_semas[SEMA_RECORD_MACRO],0);
|
||||
EdInsCapturedMacro;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
#help_index "DolDoc"
|
||||
|
||||
I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags)
|
||||
{
|
||||
U8 *st,*st2,**_dst;
|
||||
I64 i,res=0;
|
||||
|
||||
if (doc_e->de_flags&DOCEF_LINK && doc_e->de_flags&(DOCEF_AUX_STR|DOCEF_TAG)) {
|
||||
if (doc_e->de_flags & DOCEF_AUX_STR && doc_e->de_flags & DOCEF_TAG &&
|
||||
!MemCmp(doc_e->aux_str,"FI:",3) &&
|
||||
!StrCmp(doc_e->aux_str+3,doc_e->tag)) {
|
||||
Free(doc_e->aux_str);
|
||||
doc_e->aux_str=NULL;
|
||||
doc_e->de_flags&=~DOCEF_AUX_STR;
|
||||
res++;
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_AUX_STR)
|
||||
_dst=&doc_e->aux_str;
|
||||
else
|
||||
_dst=&doc_e->tag;
|
||||
if (StrMatch(".Z",*_dst)) {
|
||||
st=DocLinkFile(*_dst);
|
||||
if (FileFind(st)) {
|
||||
if (IsDotZ(st))
|
||||
st[StrLen(st)-2]=0;
|
||||
i=StrLen(st);
|
||||
if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') {
|
||||
StrCpy(st2+i,st2+i+2);
|
||||
res++;
|
||||
}
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
if (fuf_flags&FUF_RISKY) {
|
||||
if (doc_e->de_flags & DOCEF_AUX_STR) {
|
||||
if (st=StrMatch(".Z",doc_e->aux_str)) {
|
||||
StrCpy(st,st+2);
|
||||
res++;
|
||||
}
|
||||
}
|
||||
if (doc_e->de_flags&DOCEF_TAG) {
|
||||
if (st=StrMatch(".Z",doc_e->tag)) {
|
||||
StrCpy(st,st+2);
|
||||
res++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
|
||||
{//Optimize Doc.
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 res=0;
|
||||
CDocEntry *doc_e,*doc_e1,*doc_e_last;
|
||||
DocRecalc(doc);
|
||||
doc_e_last=NULL;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (res+=DocOptEntry(doc,doc_e,fuf_flags))
|
||||
res+=DocOptEntry(doc,doc_e,fuf_flags);
|
||||
if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 &&
|
||||
doc_e_last->de_flags==doc_e->de_flags &&
|
||||
Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) &&
|
||||
doc_e_last->attr==doc_e->attr) {
|
||||
DocEntryDel(doc,doc_e);
|
||||
res++;
|
||||
} else
|
||||
doc_e_last=doc_e;
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
DocRecalc(doc);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 DocOptFile(U8 *filename,I64 fuf_flags)
|
||||
{//Optimize File.
|
||||
I64 res;
|
||||
CDoc *doc=DocRead(filename);
|
||||
if (res=DocOptDoc(doc,fuf_flags)) {
|
||||
"-%d:%s\n",res,doc->filename.name;
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
I64 DocOptLst(CDirEntry *tmpde,I64 fuf_flags)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tmpde1;
|
||||
while (tmpde) {
|
||||
tmpde1=tmpde->next;
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
if (tmpde->sub) {
|
||||
"Scanning Directory: %s\n",tmpde->full_name;
|
||||
res+=DocOptLst(tmpde->sub,fuf_flags);
|
||||
}
|
||||
} else
|
||||
res+=DocOptFile(tmpde->full_name,fuf_flags);
|
||||
DirEntryDel(tmpde);
|
||||
tmpde=tmpde1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ Files, eliminating aux_str's and .Z's.
|
||||
//+R flag for aggressively risky.
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
|
||||
fuf_flags&~FUG_FILES_FIND);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0)
|
||||
{//Pass doc to PopUp win task for viewing.
|
||||
U8 *buf=MStrPrint("DocEd(0x%X,0x%X);",doc,dof_flags);
|
||||
CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs);
|
||||
TaskExe(task,NULL,buf,1<<SVCf_EXIT_ON_COMPLETE|1<<SVCf_FREE_ON_COMPLETE);
|
||||
TaskExe(task,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
|
||||
Free(buf);
|
||||
return task;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public U8 *PopUpPickDefineSub(U8 *dname)
|
||||
|
||||
#help_index "DolDoc/Input;StdIn/DolDoc"
|
||||
public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL)
|
||||
{//Make PopUp win task with one button.
|
||||
{//Make PopUp win task with one bttn.
|
||||
I64 i,l1=StrLen(b1);
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
@@ -132,7 +132,7 @@ public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL)
|
||||
}
|
||||
|
||||
public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL)
|
||||
{//Make PopUp win task with two buttons.
|
||||
{//Make PopUp win task with two bttns.
|
||||
I64 i,l1=StrLen(b1),l2=StrLen(b2),y;
|
||||
CDoc *doc=DocNew;
|
||||
if (header) {
|
||||
@@ -151,17 +151,17 @@ public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL)
|
||||
}
|
||||
|
||||
public Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL)
|
||||
{//Make PopUp win task with OKAY button.
|
||||
{//Make PopUp win task with OKAY bttn.
|
||||
return PopUp1("OKAY",1,header,footer)>0;
|
||||
}
|
||||
|
||||
public Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL)
|
||||
{//Make PopUp win task with NO/YES buttons.
|
||||
{//Make PopUp win task with NO/YES bttns.
|
||||
return $WW,0$PopUp2("YES",1,"NO",0,header,footer)>0;
|
||||
}
|
||||
|
||||
public Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL)
|
||||
{//Make PopUp win task CANCEL/OKAY buttons.
|
||||
{//Make PopUp win task CANCEL/OKAY bttns.
|
||||
return PopUp2("OKAY",1,"CANCEL",0,header,footer)>0;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ public F64 PopUpRangeF64Log(F64 lo,F64 hi,I64 steps,
|
||||
return PopUpRangeF64Exp(lo,hi,Exp(Ln(hi/lo)/(steps-1)),fmt,header,footer);
|
||||
}
|
||||
|
||||
#help_index "Task/Srv/Exe;Compiler"
|
||||
#help_index "Job/Exe;Task/Job/Exe;Compiler"
|
||||
public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE)
|
||||
{//Make adam_task execute file.
|
||||
Bool okay=TRUE;
|
||||
|
||||
@@ -16,7 +16,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!Bt(doldoc.clean_scan_codes,sc.u8[0]))
|
||||
doc->flags|=DOCF_UNDO_DIRTY;
|
||||
DocCaptureUndo(doc);
|
||||
if (Bt(chars_bmp_getkey,ch) && !(sc&(SCF_CTRL|SCF_ALT))) {
|
||||
if (Bt(char_bmp_printable,ch) && !(sc&(SCF_CTRL|SCF_ALT))) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
st=Char2KeyName(ch,FALSE);
|
||||
KeyDescSet("Char /'%s'",st);
|
||||
@@ -348,7 +348,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
} else {
|
||||
//$LK,"::/Adam/God/HSNotes.DD"$
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
|
||||
if (sc&SCF_SHIFT)
|
||||
GodBiblePassage;
|
||||
else
|
||||
|
||||
+8
-18
@@ -5,7 +5,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
//Does not handle partial Doc entries.
|
||||
//Returns last newly created dollar-sign CDocEntry or NULL.
|
||||
U8 *ptr=st,*ptr2,*st2,*ptr3,*ptr4,*src,
|
||||
*char_bitmap;
|
||||
*char_bmp;
|
||||
Bool unlock;
|
||||
I64 ch,j;
|
||||
CDocEntry *doc_e=NULL,*res=NULL,*doc_ce;
|
||||
@@ -13,16 +13,16 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
return NULL;
|
||||
unlock=DocLock(doc);
|
||||
if (doc->flags & DOCF_PLAIN_TEXT_TABS)
|
||||
char_bitmap=chars_bmp_zero_cr_nl_cursor;
|
||||
char_bmp=char_bmp_zero_cr_nl_cursor;
|
||||
else if (doc->flags & DOCF_PLAIN_TEXT)
|
||||
char_bitmap=chars_bmp_zero_tab_ff_cr_nl_cursor;
|
||||
char_bmp=char_bmp_zero_tab_cr_nl_cursor;
|
||||
else
|
||||
char_bitmap=chars_bmp_zero_tab_ff_cr_nl_cursor_dollar;
|
||||
char_bmp=char_bmp_zero_tab_cr_nl_cursor_dollar;
|
||||
doc_ce=doc->cur_entry;
|
||||
while (*ptr) {
|
||||
ptr2=ptr;
|
||||
do ch=*ptr++;
|
||||
while (!Bt(char_bitmap,ch) || ch==CH_CURSOR && doc->flags&DOCF_NO_CURSOR);
|
||||
while (!Bt(char_bmp,ch) || ch==CH_CURSOR && doc->flags&DOCF_NO_CURSOR);
|
||||
ptr--;
|
||||
if (!ch) {
|
||||
if (j=ptr-ptr2) {
|
||||
@@ -76,12 +76,6 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case CH_FORM_FEED:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case '\t':
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_head.dft_text_attr<<8);
|
||||
@@ -119,10 +113,6 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else if (ch==CH_FORM_FEED) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else
|
||||
*ptr4++=ch;
|
||||
}
|
||||
@@ -184,7 +174,7 @@ public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
|
||||
DocPutKey(doc,ch,0);
|
||||
else
|
||||
while (ch=*ptr) {
|
||||
if (!Bt(chars_bmp_safe_dollar,ch) ||
|
||||
if (!Bt(char_bmp_safe_dollar,ch) ||
|
||||
doc->flags & (DOCF_OVERSTRIKE|DOCF_IN_DOLLAR)) {
|
||||
DocPutKey(doc,ch,0);
|
||||
ptr++;
|
||||
@@ -192,7 +182,7 @@ public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
|
||||
ptr2=ptr++;
|
||||
while (TRUE) {
|
||||
ch=*ptr++;
|
||||
if (!Bt(chars_bmp_safe_dollar,ch))
|
||||
if (!Bt(char_bmp_safe_dollar,ch))
|
||||
break;
|
||||
}
|
||||
ptr--;
|
||||
@@ -271,7 +261,7 @@ U0 DocDump(CDoc *doc,I64 uS_delay=0)
|
||||
doc_e=doc_e2;
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
'\n';
|
||||
BusyWait(uS_delay);
|
||||
Busy(uS_delay);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
i_jif>>=3;
|
||||
for (k=0;k<doc_e->scroll_len;k++) {
|
||||
ch=ptr[(i_jif+k)%j];
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (!Bt(char_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
@@ -693,7 +693,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
x+=(doc_e->hex_ed_width-k)*3;
|
||||
for (j=0;j<k;j++) {
|
||||
ch=*bptr++;
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (!Bt(char_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
@@ -1057,7 +1057,7 @@ rc_adjust_xy:
|
||||
break;
|
||||
case DOCT_LST:
|
||||
case DOCT_TREE:
|
||||
case DOCT_BUTTON:
|
||||
case DOCT_BTTN:
|
||||
case DOCT_LINK:
|
||||
case DOCT_MENU_VAL:
|
||||
case DOCT_MACRO:
|
||||
|
||||
@@ -10,11 +10,11 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
DocLock(doc);
|
||||
if (!exited) {
|
||||
if (doc_e->de_flags & DOCEF_ESC) {
|
||||
Msg(MSG_KEY_DOWN,CH_ESC,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_KEY_DOWN,CH_ESC,0,1<<JOBf_DONT_FILTER);
|
||||
has_action=TRUE;
|
||||
goto er_done;
|
||||
} if (doc_e->de_flags & DOCEF_QUIT) {
|
||||
Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0,1<<JOBf_DONT_FILTER);
|
||||
has_action=TRUE;
|
||||
goto er_done;
|
||||
} else if (doc_e->de_flags & DOCEF_CHECK_COLLAPSABLE) {
|
||||
@@ -31,13 +31,13 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
if (doc_e->de_flags & DOCEF_LEFT_EXP) {
|
||||
res=doc_e->left_exp;
|
||||
has_action=TRUE;
|
||||
Msg(MSG_CMD,res,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_LEFT_CB && doc_e->left_cb) {
|
||||
DocUnlock(doc);
|
||||
res=(*doc_e->left_cb)(doc,doc_e);
|
||||
has_action=TRUE;
|
||||
Msg(MSG_CMD,res,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO) {
|
||||
if (doc_e->de_flags & DOCEF_POPUP) {
|
||||
@@ -70,13 +70,13 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_EXP) {
|
||||
res=doc_e->right_exp;
|
||||
has_action=TRUE;
|
||||
Msg(MSG_CMD,res,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_CB && doc_e->right_cb) {
|
||||
DocUnlock(doc);
|
||||
res=(*doc_e->right_cb)(doc,doc_e);
|
||||
has_action=TRUE;
|
||||
Msg(MSG_CMD,res,0,1<<SVCf_DONT_FILTER);
|
||||
Msg(MSG_CMD,res,0,1<<JOBf_DONT_FILTER);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO) {
|
||||
if (doc_e->de_flags & DOCEF_POPUP) {
|
||||
|
||||
@@ -490,7 +490,7 @@ I64 PopUpWidgetType()
|
||||
"$$MU,\"Page Settings\",LE=DOCT_PAGE_LEN$$\n"
|
||||
"$$MU,\"Cursor Movement\",LE=DOCT_CURSOR_MOVEMENT$$\n"
|
||||
"$$MU,\"Macro\",LE=DOCT_MACRO$$\n"
|
||||
"$$MU,\"Button\",LE=DOCT_BUTTON$$\n"
|
||||
"$$MU,\"Bttn\",LE=DOCT_BTTN$$\n"
|
||||
"$$MU,\"Check Box\",LE=DOCT_CHECK_BOX$$\n"
|
||||
"$$MU,\"List\",LE=DOCT_LST$$\n"
|
||||
"$$MU,\"Menu Val\",LE=DOCT_MENU_VAL$$\n"
|
||||
@@ -661,7 +661,7 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
Free(e);
|
||||
}
|
||||
|
||||
class CEdButton
|
||||
class CEdBttn
|
||||
{
|
||||
U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n";
|
||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
@@ -676,10 +676,10 @@ class CEdButton
|
||||
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
||||
};
|
||||
|
||||
U0 EdInsButton()
|
||||
U0 EdInsBttn()
|
||||
{
|
||||
U8 *st,buf[512];
|
||||
CEdButton *e=CAlloc(sizeof(CEdButton));
|
||||
CEdBttn *e=CAlloc(sizeof(CEdBttn));
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
@@ -1010,8 +1010,8 @@ U0 EdInsWidgetWiz()
|
||||
case DOCT_CURSOR_MOVEMENT:
|
||||
EdInsCursorMovement;
|
||||
break;
|
||||
case DOCT_BUTTON:
|
||||
EdInsButton;
|
||||
case DOCT_BTTN:
|
||||
EdInsBttn;
|
||||
break;
|
||||
case DOCT_DATA:
|
||||
EdInsData;
|
||||
|
||||
@@ -58,7 +58,6 @@ MemSet(&doldoc,0,sizeof(CDolDocGlbls));
|
||||
#include "DocWidgetWiz"
|
||||
#include "DocPutKey"
|
||||
#include "DocPutS"
|
||||
#include "DocOpt"
|
||||
#include "DocCodeTools"
|
||||
#include "DocTree"
|
||||
#include "DocTerm"
|
||||
|
||||
Reference in new issue
Block a user