TempleOSCD_150216.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:15 +02:00
1 parent 64f679eeb9
commit 401601816c
531 files changed
+23341 -22071

No files matched your search

+7 -4
View File
@@ -76,12 +76,15 @@ public class CDolDocGlbls
} doldoc;
MemSet(&doldoc,0,sizeof(CDolDocGlbls));
#help_index "God"
#define BIBLE_FILENAME "::/Misc/Bible.TXT.Z"
#include "DocNew"
#include "DocPlain"
#include "DocInit"
#include "DocHighlight"
#include "DocRecalc2a"
#include "DocRecalc2b"
#include "DocRecalcA"
#include "DocRecalcB"
sys_clipboard_doc=DocNew;
#include "DocFile"
#include "DocOpt"
@@ -89,8 +92,8 @@ sys_clipboard_doc=DocNew;
#include "DocCtrlL"
#include "DocMacro"
#include "DocFind"
#include "DocEd2a"
#include "DocEd2b"
#include "DocEdA"
#include "DocEdB"
#include "DocCodeTools"
#include "DocTree"
#include "DocMain"
+26 -39
View File
@@ -6,7 +6,7 @@
#define EF_REINDENT 0
#define EF_CHK_COMPILE 1
#define EF_RENUM_ASM 2
#define EF_SLIDER_CTRL 3
#define EF_CTRL_SLIDER 3
#define EF_CH_SC 4
I64 PopUpEdFmt()
@@ -16,7 +16,7 @@ I64 PopUpEdFmt()
DocPrint(doc,"$$LTBLUE$$$$MU,\"Check Compile\",LE=EF_CHK_COMPILE$$\n"
"$$MU,\"Reindent CPP.Z Fun\",LE=EF_REINDENT$$\n"
"$$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$$\n"
"$$MU,\"Insert Template Code: Slider Ctrl\",LE=EF_SLIDER_CTRL$$\n"
"$$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$$\n"
"$$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\",LE=EF_CH_SC$$\n\n"
"$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n\n"
"$$GREEN$$<ALT-BACKSPACE>$$FG$$ to undo if not happy\n"
@@ -30,43 +30,32 @@ class CRILex
{
CLex *lx1,*lx2;
CQueVectU8 *indent;
I64 depth,exp_depth;
Bool was_new_line,is_not_cont,one_shot;
I64 depth,exp_depth,one_shot;
Bool was_new_line,is_not_cont;
};
I64 EdRILex(CRILex *rx)
{
Bool is_not_cont=FALSE;
I64 i,k;
rx->is_not_cont=FALSE;
I64 i;
do {
Lex(rx->lx1);
Lex(rx->lx2);
if (rx->lx1->token=='\n') {
if (rx->lx2->token==TK_IDENT)
i=PrsKeyWord(rx->lx2);
else
i=-1;
if (rx->lx2->token==';' || rx->lx2->token=='{' || rx->lx2->token=='}' ||
rx->lx2->token==':' || rx->lx2->token==')' && !rx->exp_depth ||
i==KW_ELSE || i==KW_CATCH || i==KW_DO)
is_not_cont=TRUE;
}
k=PrsKeyWord(rx->lx2);
i=PrsKeyWord(rx->lx2);
if (rx->lx1->token=='\n' && rx->lx2->token==';' || rx->lx2->token=='{' ||
rx->lx2->token=='}' || rx->lx2->token==':' || rx->lx2->token==')' &&
!rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO)
rx->is_not_cont=TRUE;
if (rx->was_new_line && (rx->lx1->token!=':' ||
k==KW_DFT || k==KW_SUB_SWITCH_START || k==KW_SUB_SWITCH_END)) {
if (rx->one_shot) {
QueVectU8Put(rx->indent,rx->lx2->lfns[0].cur_entry->y,rx->depth+3);
rx->one_shot=FALSE;
} else
QueVectU8Put(rx->indent,rx->lx2->lfns[0].cur_entry->y,rx->depth);
i==KW_DFT || i==KW_SUB_SWITCH_START || i==KW_SUB_SWITCH_END)) {
QueVectU8Put(rx->indent,rx->lx2->lfns[0].cur_entry->y,rx->depth+rx->one_shot);
rx->one_shot=0;
}
if (rx->lx2->token=='\n')
rx->was_new_line=TRUE;
else
rx->was_new_line=FALSE;
} while (rx->lx1->token=='\n');
rx->is_not_cont=is_not_cont;
return rx->lx1->token;
}
@@ -182,16 +171,14 @@ U0 EdRIStmt(CRILex *rx,Bool indent)
default:
if (rx->lx1->token==TK_IDENT && rx->lx1->hash_entry &&
rx->lx1->hash_entry->type&(HTT_OPCODE|HTT_ASM_KEYWORD)) {
i=rx->depth;
rx->depth=4;
rx->one_shot=FALSE;
rx->one_shot=4-rx->depth;
do EdRILex(rx);
while (rx->lx2->token && rx->lx2->token!='\n');
rx->depth=i;
rx->is_not_cont=TRUE;
} else {
while (rx->lx1->token && rx->lx1->token!=';' && rx->lx1->token!=':') {
if (rx->lx2->token=='\n' && !rx->is_not_cont)
rx->one_shot=TRUE;
rx->one_shot=3;
EdRILex(rx);
}
if (rx->lx1->token==':')
@@ -211,11 +198,11 @@ CQueVectU8 *EdRICode(CDoc *doc)
CRILex *rx=CAlloc(sizeof(CRILex));
rx->lx1=LexNew(,LF_KEEP_NEW_LINES|LF_DONT_FREE_BUF,doc->filename.name);
Free(rx->lx1->lfns[0].name);
Free(rx->lx1->lfns[0].full_name);
LexAttachDoc(rx->lx1,&rx->lx1->lfns[0],doc,,doc->cur_entry,doc->cur_data_col);
rx->lx2=LexNew(,LF_KEEP_NEW_LINES|LF_DONT_FREE_BUF,doc->filename.name);
Free(rx->lx2->lfns[0].name);
Free(rx->lx2->lfns[0].full_name);
LexAttachDoc(rx->lx2,&rx->lx2->lfns[0],doc,,doc->cur_entry,doc->cur_data_col);
rx->indent=QueVectU8New(doc->cur_entry->y);
@@ -400,17 +387,17 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action)
if (doc->flags&DOCF_PLAIN_TEXT)
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
DocWrite(doc);
task=Spawn(&SrvUserCmdLine,NULL,"Srv",,Fs);
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
st2=CurDir;
st=MStrPrint("Cd(\"%s\");",st2);
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
Free(st2);
Free(st);
SetWinHorz(Fs->win_left,Fs->win_right, task);
SetWinVert(Fs->win_top, Fs->win_bottom,task);
WinHorz(Fs->win_left,Fs->win_right, task);
WinVert(Fs->win_top, Fs->win_bottom,task);
if (ScanResult(tempc,&r)) {
st=DirFile(doc->filename.name,,"PRJ.Z"),
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
st=DirFile(doc->filename.name,,"PRJ.Z");
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
Free(st);
if (FileFind(prj_file)) {
st2=DirFile(prj_file),
@@ -597,8 +584,8 @@ U0 EdCodeTools(CDoc *doc)
case EF_RENUM_ASM:
EdCodeTools2(doc,tool_action);
break;
case EF_SLIDER_CTRL:
TemplateSliderCtrl(doc);
case EF_CTRL_SLIDER:
TemplateCtrlSlider(doc);
break;
case EF_CH_SC:
EdChSC(doc);
+21 -21
View File
@@ -1005,13 +1005,13 @@ U0 EdInsDollarCmd()
}
}
#define PT_SPRITE 0
#define PT_SPRITE_PTR 1
#define PT_DUP_SPRITE 2
#define PT_SPRITE_SIZE 3
#define PT_SPRITE_MACRO 4
#define PT_SPRITE_MENU 5
#define PT_SPRITE_LINK 6
#define DVT_SPRITE 0
#define DVT_SPRITE_PTR 1
#define DVT_DUP_SPRITE 2
#define DVT_SPRITE_SIZE 3
#define DVT_SPRITE_MACRO 4
#define DVT_SPRITE_MENU 5
#define DVT_SPRITE_LINK 6
I64 PopUpSpriteType()
{
@@ -1019,13 +1019,13 @@ I64 PopUpSpriteType()
CDoc *doc=DocNew;
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Graphic Resource Menu\"$$\n"
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/Resource.TXT.Z\"$$\n"
"\n$$LTBLUE$$$$MU,\"Make Sprite\",LE=PT_SPRITE$$\n"
"$$MU,\"Pointer to Sprite\",LE=PT_SPRITE_PTR$$\n"
"$$MU,\"Duplicate Sprite\",LE=PT_DUP_SPRITE$$\n"
"$$MU,\"Sprite Size (not really needed)\",LE=PT_SPRITE_SIZE$$\n"
"$$MU,\"Sprite Macro (Icon)\",LE=PT_SPRITE_MACRO$$\n"
"$$MU,\"Sprite Menu Item\",LE=PT_SPRITE_MENU$$\n"
"$$MU,\"Sprite Link\",LE=PT_SPRITE_LINK$$\n"
"\n$$LTBLUE$$$$MU,\"Make Sprite\",LE=DVT_SPRITE$$\n"
"$$MU,\"Pointer to Sprite\",LE=DVT_SPRITE_PTR$$\n"
"$$MU,\"Duplicate Sprite\",LE=DVT_DUP_SPRITE$$\n"
"$$MU,\"Sprite Size (not really needed)\",LE=DVT_SPRITE_SIZE$$\n"
"$$MU,\"Sprite Macro (Icon)\",LE=DVT_SPRITE_MACRO$$\n"
"$$MU,\"Sprite Menu Item\",LE=DVT_SPRITE_MENU$$\n"
"$$MU,\"Sprite Link\",LE=DVT_SPRITE_LINK$$\n"
"\n$$MU,\"Abort\",LE=DOCM_CANCEL$$\n\n");
i=PopUpMenu(doc);
DocDel(doc);
@@ -1074,12 +1074,12 @@ U8 *EdSprite(I64 bin_num)
CEdMacroSprite *e=CAlloc(sizeof(CEdMacroSprite));
*buf=0;
switch (type) {
case PT_SPRITE:
case DVT_SPRITE:
StrPrint(e->tag,"<%d>",bin_num);
if (DocFormDo(e,"CEdJustSprite",,,ctrl_L_footer))
st1=MStrPrint("\"%Q\"",e->tag);
break;
case PT_SPRITE_MACRO:
case DVT_SPRITE_MACRO:
e->escape=TRUE;
if (DocFormDo(e,,,,ctrl_L_footer)) {
CatPrint(buf,"+UL");
@@ -1091,26 +1091,26 @@ U8 *EdSprite(I64 bin_num)
Free(st);
}
break;
case PT_SPRITE_MENU:
case DVT_SPRITE_MENU:
e->escape=TRUE;
if (DocFormDo(e,"CEdMenuSprite",,,ctrl_L_footer)) {
if (e->escape) CatPrint(buf,"+X");
st1=MStrPrint("\"%Q\",LE=%s",e->tag,e->exp);
}
break;
case PT_SPRITE_LINK:
case DVT_SPRITE_LINK:
CatPrint(buf,"+L");
st1=EdSpriteLink(&pop_up,&html_link);
if (pop_up)
CatPrint(buf,"+PU");
break;
case PT_SPRITE_PTR:
case DVT_SPRITE_PTR:
EdInsBinary(--bin_num,DOCT_INS_BINARY);
break;
case PT_SPRITE_SIZE:
case DVT_SPRITE_SIZE:
EdInsBinary(--bin_num,DOCT_INS_BINARY_SIZE);
break;
case PT_DUP_SPRITE:
case DVT_DUP_SPRITE:
EdInsBinary(--bin_num,DOCT_SPRITE);
break;
}
@@ -224,7 +224,8 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
doc_ce=doc_ce->next;
if (doc->flags & DOCF_FORM) {
while (doc_ce->next->x==x &&
(!Bt(doldoc.type_flags_form,doc_ce->type_u8) ||
(!Bt(doldoc.type_flags_form,doc_ce->type_u8) &&
!(doc_ce->de_flags&DOCEF_LINK)||
doc_ce->de_flags&DOCEF_SKIP_IN_FORM))
doc_ce=doc_ce->next;
}
@@ -566,8 +567,9 @@ ic_overstrike_char:
DocInsEntry(doc,doc_ne);
} else if (ch=='\t') {
if (doc->flags&DOCF_FORM &&
Bt(doldoc.type_flags_form,doc->cur_entry->type_u8) &&
!(doc->cur_entry->de_flags&DOCEF_SKIP_IN_FORM)) {
(Bt(doldoc.type_flags_form,doc->cur_entry->type_u8) ||
doc->cur_entry->de_flags&DOCEF_LINK) &&
!(doc->cur_entry->de_flags&DOCEF_SKIP_IN_FORM)) {
ic_form_tab:
doc->cur_entry=doc->cur_entry->next;
doc->cur_data_col=doc->cur_entry->min_col;
@@ -652,12 +654,16 @@ U0 DocEntryToggle(CDoc *doc)
U8 ch,*st,*st2;
I64 i,j,k;
if (doc_ce!=doc && !(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))) {
if (doc_ce->type_u8==DOCT_TEXT && !(doc_ce->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_HARD_SKIP|DOCEF_FILTER_SKIP))) {
if (doc_ce->type_u8==DOCT_TEXT &&
!(doc_ce->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_HARD_SKIP|DOCEF_FILTER_SKIP)) &&
!(doc_ce->type&DOCG_BL_IV_UL)) {
doc_ce2=doc_ce->last;
for (k=0;k<20;k++) {
if (doc_ce2!=doc) {
cl1=doc_ce2->last;
if (doc_ce2->type_u8==DOCT_TEXT && doc_ce->de_flags==doc_ce2->de_flags && doc_ce->type==doc_ce2->type) {
if (doc_ce2->type_u8==DOCT_TEXT &&
doc_ce->de_flags==doc_ce2->de_flags &&
doc_ce->type==doc_ce2->type) {
i=StrLen(doc_ce2->tag);
j=StrLen(doc_ce->tag);
st=MAlloc(i+j+1,doc->mem_task);
@@ -680,7 +686,9 @@ U0 DocEntryToggle(CDoc *doc)
for (k=0;k<20;k++) {
if (doc_ce2!=doc) {
cl1=doc_ce2->next;
if (doc_ce2->type_u8==DOCT_TEXT && doc_ce->de_flags==doc_ce2->de_flags && doc_ce->type==doc_ce2->type) {
if (doc_ce2->type_u8==DOCT_TEXT &&
doc_ce->de_flags==doc_ce2->de_flags &&
doc_ce->type==doc_ce2->type) {
i=StrLen(doc_ce->tag);
j=StrLen(doc_ce2->tag);
st=MAlloc(i+j+1,doc->mem_task);
@@ -704,7 +712,8 @@ U0 DocEntryToggle(CDoc *doc)
j=doc->cur_data_col+1;
while (j<doc_ce->max_col && doc_ce->tag[j]!='$$')
j++;
if (i<j-1 && doc_ce->min_col<=i<j<doc_ce->max_col && doc_ce->tag[i]=='$$' && doc_ce->tag[j]=='$$') {
if (i<j-1 && doc_ce->min_col<=i<j<doc_ce->max_col &&
doc_ce->tag[i]=='$$' && doc_ce->tag[j]=='$$') {
ch=doc_ce->tag[j+1];
doc_ce->tag[j+1]=0;
st=StrNew(doc_ce->tag+i);
@@ -20,7 +20,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
!(sc&(SCF_CTRL|SCF_ALT))) {
if (sc&SCF_KEY_DESC) {
st=Char2KeyName(ch,FALSE);
SetKeyDesc("Char/'%s'",st);
KeyDescSet("Char/'%s'",st);
Free(st);
} else
EdInsChar(ch,sc,doc);
@@ -31,25 +31,25 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
switch (ch) {
case CH_CTRLA:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Save As");
KeyDescSet("Edit/Save As");
else
DocWrite(doc,TRUE);
break;
case CH_CTRLB:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Win/Toggle Border");
KeyDescSet("Win/Toggle Border");
else
WinBorder(Bt(&doc->win_task->display_flags,DISPLAYf_NO_BORDER),doc->win_task);
break;
case CH_CTRLC:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Copy to Clipboard");
KeyDescSet("Edit/Copy to Clipboard");
else
EdCopyToClipboard(doc);
break;
case CH_CTRLD:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Cmd/Jump to File Manager");
KeyDescSet("Cmd/Jump to File Manager");
else {
DocUnlock(doc);
FileMgr;
@@ -59,31 +59,31 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLF:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Cmd/Grep Wizard");
KeyDescSet("Cmd/Find Wizard");
else
GrepWiz;
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Find & Replace");
KeyDescSet("Edit/Find & Replace");
else
EdFindReplace(doc);
}
break;
case CH_CTRLG:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/GoTo Line Num");
KeyDescSet("Edit/GoTo Line Num");
else
EdGoToLine(doc);
break;
case CH_BACKSPACE: //<CTRL-H>
if (sc&SCF_ALT && !(sc&SCF_CTRL)) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Undo");
KeyDescSet("Edit/Undo");
else
DocUndoRestore(doc);
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Char/Back Space");
KeyDescSet("Char/Back Space");
else {
DocCaptureUndo(doc);
doc_ce=doc->cur_entry;
@@ -110,12 +110,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLI:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Indent Out");
KeyDescSet("Dollar/Indent Out");
else
DocPrint(doc,"$$ID,-2$$");
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Indent In");
KeyDescSet("Dollar/Indent In");
else
DocPrint(doc,"$$ID,2$$");
}
@@ -123,15 +123,15 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case '\n':
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Char/Return");
KeyDescSet("Char/Return");
else
SetKeyDesc("Char/Page Break");
KeyDescSet("Char/Page Break");
} else
EdInsChar(ch,sc,doc);
break;
case CH_CTRLK:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Blinking Text");
KeyDescSet("Dollar/Toggle Blinking Text");
else if (sc&SCF_SHIFT)
DocPrint(doc,"$$BK,0$$");
else
@@ -140,9 +140,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLL:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Code Tools");
KeyDescSet("Edit/Code Tools");
else
SetKeyDesc("Dollar/Wizard");
KeyDescSet("Dollar/Wizard");
} else {
if (sc&SCF_SHIFT)
EdCodeTools(doc);
@@ -156,14 +156,14 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLM:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Cmd/Jump to Notes File");
KeyDescSet("Cmd/Jump to Notes File");
else
SetKeyDesc("Cmd/Jump to Menu");
KeyDescSet("Cmd/Jump to Menu");
} else {
if (sc&SCF_SHIFT)
Ed("HOME/PersonalNotes.TXT.Z");
Ed("::/Home/PersonalNotes.TXT.Z");
else {
m=DocRead("HOME/PersonalMenu.TXT.Z");
m=DocRead("::/Home/PersonalMenu.TXT.Z");
DocMenuDo(m);
DocDel(m);
}
@@ -172,9 +172,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLO:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Collapse");
KeyDescSet("Edit/Collapse");
else
SetKeyDesc("Edit/Uncolapse");
KeyDescSet("Edit/Uncolapse");
} else {
if (sc&SCF_SHIFT)
DocCollapse(TRUE,doc);
@@ -185,21 +185,21 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLP:
if (doc->flags & (DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE)) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Super or Sub script");
KeyDescSet("Dollar/Toggle Super or Sub script");
else {
DocPrint(doc,"$$SY,0$$");
doc->flags&=~(DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE);
}
} else if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Subscript");
KeyDescSet("Dollar/Toggle Subscript");
else {
DocPrint(doc,"$$SY,3$$");
doc->flags|=DOCF_SUBSCRIPT_MODE;
}
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Superscript");
KeyDescSet("Dollar/Toggle Superscript");
else {
DocPrint(doc,"$$SY,-3$$");
doc->flags|=DOCF_SUPERSCRIPT_MODE;
@@ -210,7 +210,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
break;
case CH_CTRLR:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Edit or Create Graphic");
KeyDescSet("Dollar/Edit or Create Graphic");
else {
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))) {
DocUnlock(doc);
@@ -229,12 +229,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLS:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Find Misspelled");
KeyDescSet("Edit/Find Misspelled");
else
WSFindMisspelled(doc);
ACFindMisspelled(doc);
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Save");
KeyDescSet("Edit/Save");
else
DocWrite(doc);
}
@@ -242,12 +242,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case CH_CTRLT:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Single Entry Toggle Plain Text");
KeyDescSet("Edit/Single Entry Toggle Plain Text");
else
DocEntryToggle(doc);
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Toggle Plain Text Display");
KeyDescSet("Edit/Toggle Plain Text Display");
else
if (!(doc->flags&DOCF_FORM) || doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS))
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
@@ -255,7 +255,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
break;
case CH_CTRLU:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Underline");
KeyDescSet("Dollar/Toggle Underline");
else if (sc&SCF_SHIFT)
DocPrint(doc,"$$UL,0$$");
else
@@ -263,13 +263,13 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
break;
case CH_CTRLV:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Paste Clipboard");
KeyDescSet("Edit/Paste Clipboard");
else
EdPasteClipboard(doc);
break;
case CH_CTRLW:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Word Wrap");
KeyDescSet("Dollar/Toggle Word Wrap");
else if (sc&SCF_SHIFT)
DocPrint(doc,"$$WW,0$$");
else
@@ -277,19 +277,19 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
break;
case CH_CTRLX:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Cut To Clipboard");
KeyDescSet("Edit/Cut To Clipboard");
else
EdCutToClipboard(doc);
break;
case CH_CTRLY:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Delete Line");
KeyDescSet("Edit/Delete Line");
else
EdDelLine(doc);
break;
case CH_CTRLZ:
if (sc&SCF_KEY_DESC)
SetKeyDesc("Dollar/Toggle Inverted Text");
KeyDescSet("Dollar/Toggle Inverted Text");
else if (sc&SCF_SHIFT)
DocPrint(doc,"$$IV,0$$");
else
@@ -300,23 +300,23 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc&SCF_CTRL) {
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Jump to Word Definition");
KeyDescSet("Edit/Jump to Word Definition");
else
SetKeyDesc("Edit/Autocomplete Word");
KeyDescSet("Edit/Autocomplete Word");
} else {
if (WordStat(ON)) {
if (AutoComplete(ON)) {
DocUnlock(doc);
if (sc&SCF_SHIFT)
WSDDef(ch-'0',Fs);
ACDDef(ch-'0',Fs);
else
WSDFillin(ch-'0');
ACDFillin(ch-'0');
DocLock(doc);
}
}
}
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/Enter extended-ASCII");
KeyDescSet("Edit/Enter extended-ASCII");
else {
if (++doc->ext_ascii_cnt==1)
doc->ext_ascii_val=ch-'0';
@@ -333,12 +333,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (!(sc&SCF_ALT) && sc&SCF_CTRL) {
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/GoTo matching brace");
KeyDescSet("Edit/GoTo matching brace");
else
EdFindPaired(doc,'}','{',FALSE);
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/GoTo matching bracket");
KeyDescSet("Edit/GoTo matching bracket");
else
EdFindPaired(doc,']','[',FALSE);
}
@@ -348,12 +348,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (!(sc&SCF_ALT) && sc&SCF_CTRL) {
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/GoTo matching brace");
KeyDescSet("Edit/GoTo matching brace");
else
EdFindPaired(doc,'{','}',TRUE);
} else {
if (sc&SCF_KEY_DESC)
SetKeyDesc("Edit/GoTo matching bracket");
KeyDescSet("Edit/GoTo matching bracket");
else
EdFindPaired(doc,'[',']',TRUE);
}
@@ -366,16 +366,16 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc&SCF_CTRL) {
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Jump to Src of Sym");
KeyDescSet("Edit/Jump to Src of Sym");
else
SetKeyDesc("Edit/Autocomplete Sym");
KeyDescSet("Edit/Autocomplete Sym");
} else {
DocUnlock(doc);
if (WordStat(ON)) {
if (AutoComplete(ON)) {
if (sc&SCF_SHIFT)
WSMan(sc2-SC_F1+1,Fs);
ACMan(sc2-SC_F1+1,Fs);
else
WSFillIn(sc2-SC_F1+1);
ACFillIn(sc2-SC_F1+1);
}
DocLock(doc);
}
@@ -384,12 +384,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F1:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("About");
KeyDescSet("About");
else
SetKeyDesc("Help");
KeyDescSet("Help");
} else {
if (sc&SCF_SHIFT)
Ed("::/Doc/Splash.TXT.Z");
Ed("::/Doc/AboutTempleOS.TXT.Z");
else
Ed("::/Doc/HelpIndex.TXT.Z");
}
@@ -397,9 +397,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F2:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Play Macro");
KeyDescSet("Edit/Play Macro");
else
SetKeyDesc("Edit/Macro");
KeyDescSet("Edit/Macro");
} else {
DocUnlock(doc);
if (sc&SCF_SHIFT) {
@@ -415,9 +415,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F3:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Find Last");
KeyDescSet("Edit/Find Last");
else
SetKeyDesc("Edit/Find Next");
KeyDescSet("Edit/Find Next");
}else {
doc->find_replace->scan_fwd=!(sc&SCF_SHIFT);
EdFindNext(doc);
@@ -426,9 +426,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F4:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Misc/Insert Directory Name");
KeyDescSet("Misc/Insert Directory Name");
else
SetKeyDesc("Misc/Insert FileName");
KeyDescSet("Misc/Insert FileName");
} else {
DocUnlock(doc);
if (sc&SCF_SHIFT)
@@ -445,9 +445,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F5:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Cmd/Adam Include");
KeyDescSet("Cmd/Adam Include");
else
SetKeyDesc("Cmd/Run (Execute);Dbg/Go");
KeyDescSet("Cmd/Run (Execute);Dbg/Go");
} else {
if (st2=DocEntryLink(doc,doc_ce)) {
st=DocLinkFile(st2);
@@ -475,9 +475,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F6:
if (sc&SCF_KEY_DESC) {
if (sc & SCF_SHIFT)
SetKeyDesc("God Doodle");
KeyDescSet("God Doodle");
else
SetKeyDesc("God Song");
KeyDescSet("God Song");
} else {
//$LK,"::/Adam/God/HSNotes.TXT"$
if (sc & SCF_SHIFT)
@@ -489,9 +489,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_F7:
if (sc&SCF_KEY_DESC) {
if (sc & SCF_SHIFT)
SetKeyDesc("God Passage");
KeyDescSet("God Passage");
else
SetKeyDesc("God Word");
KeyDescSet("God Word");
} else {
//$LK,"::/Adam/God/HSNotes.TXT"$
FifoU8Flush(god.fifo);
@@ -511,9 +511,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc2==SC_END || sc&SCF_CTRL) {
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/GoTo Doc End, Select");
KeyDescSet("Edit/GoTo Doc End, Select");
else
SetKeyDesc("Edit/GoTo Doc End");
KeyDescSet("Edit/GoTo Doc End");
} else {
while (doc_ce!=doc) {
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
@@ -524,9 +524,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
}
} else if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Cursor Down, Select");
KeyDescSet("Edit/Cursor Down, Select");
else
SetKeyDesc("Edit/Cursor Down");
KeyDescSet("Edit/Cursor Down");
} else
EdLineDown(doc,sc);
break;
@@ -535,9 +535,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
if (sc2==SC_HOME || sc&SCF_CTRL) {
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/GoTo Top of Doc, Select");
KeyDescSet("Edit/GoTo Top of Doc, Select");
else
SetKeyDesc("Edit/GoTo Top of Doc");
KeyDescSet("Edit/GoTo Top of Doc");
} else {
if (doc_ce==doc) doc_ce=doc_ce->last;
while (doc_ce!=doc) {
@@ -550,18 +550,18 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
}
} else if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Cursor Up, Select");
KeyDescSet("Edit/Cursor Up, Select");
else
SetKeyDesc("Edit/Cursor Up");
KeyDescSet("Edit/Cursor Up");
} else
EdLineUp(doc,sc);
break;
case SC_PAGE_DOWN:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Page Down, Select");
KeyDescSet("Edit/Page Down, Select");
else
SetKeyDesc("Edit/Page Down");
KeyDescSet("Edit/Page Down");
} else {
i=doc_ce->y+doc->win_task->win_height-1;
if (doc_ce->type_u8==DOCT_HEX_ED)
@@ -580,9 +580,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_PAGE_UP:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Page Up, Select");
KeyDescSet("Edit/Page Up, Select");
else
SetKeyDesc("Edit/Page Up");
KeyDescSet("Edit/Page Up");
}else {
i=doc_ce->y-(doc->win_task->win_height-1);
if (doc_ce->type_u8==DOCT_HEX_ED)
@@ -602,12 +602,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_CURSOR_LEFT:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_CTRL)
SetKeyDesc("Edit/GoTo Start of Line");
KeyDescSet("Edit/GoTo Start of Line");
else {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Cursor Left, Select");
KeyDescSet("Edit/Cursor Left, Select");
else
SetKeyDesc("Edit/Cursor Left");
KeyDescSet("Edit/Cursor Left");
}
} else
EdCursorLeft(doc,sc);
@@ -615,12 +615,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_CURSOR_RIGHT:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_CTRL)
SetKeyDesc("Edit/GoTo End of Line");
KeyDescSet("Edit/GoTo End of Line");
else {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Cursor Right, Select");
KeyDescSet("Edit/Cursor Right, Select");
else
SetKeyDesc("Edit/Cursor Right");
KeyDescSet("Edit/Cursor Right");
}
} else
EdCursorRight(doc,sc);
@@ -628,9 +628,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_DELETE:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Cut To Clipboard");
KeyDescSet("Edit/Cut To Clipboard");
else
SetKeyDesc("Char/Delete");
KeyDescSet("Char/Delete");
} else {
if (sc&SCF_SHIFT)
EdCutToClipboard(doc);
@@ -641,11 +641,11 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
case SC_INS:
if (sc&SCF_KEY_DESC) {
if (sc&SCF_SHIFT)
SetKeyDesc("Edit/Paste Clipboard");
KeyDescSet("Edit/Paste Clipboard");
else if (sc&SCF_CTRL)
SetKeyDesc("Edit/Copy to Clipboard");
KeyDescSet("Edit/Copy to Clipboard");
else
SetKeyDesc("Edit/Toggle Overstrike");
KeyDescSet("Edit/Toggle Overstrike");
} else {
if (sc&SCF_SHIFT)
EdPasteClipboard(doc);
@@ -791,7 +791,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
if (!FileNameChk(st2))
doc=NULL;
else {
Silent(ON);
Silent;
if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
result=FileFind(filename,,
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
@@ -802,7 +802,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
doc=DocRead(filename,flags);
doc->desc='Edit';
Silent(old_silent);
Fs->border_src=BDS_ED_FILENAME_PRT;
Fs->border_src=BDS_ED_FILENAME_DRV;
}
Free(st1);
@@ -835,14 +835,19 @@ Bool DocFileEd(I64 _type,U8 *filename,
}
*_num=doc->cur_entry->y+1;
if (edf_dof_flags&EDF_WAS_WRITE)
result=FALSE;
if (!(edf_dof_flags&EDF_BAIL) && DocDo(doc,edf_dof_flags|DOF_DONT_HOME)) {
DocLock(doc);
doc_e=doc->cur_entry;
if (doc_e!=doc)
DocEntryRun(doc,doc_e,TRUE);
DocUnlock(doc);
if (!(LK_DOC<=_type<=LK_DOC_LINE))
if (!(LK_DOC<=_type<=LK_DOC_LINE)) {
DocWrite(doc);
if (edf_dof_flags&EDF_WAS_WRITE)
result=TRUE;
}
}
if (!(LK_DOC<=_type<=LK_DOC_LINE))
DocDel(doc);
@@ -912,7 +917,7 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
result=-1;
else {
num=Str2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
filename2=Define("ST_BIBLE_FILE");
filename2=BIBLE_FILENAME;
}
break;
case LK_FILE_LINE:
+10 -9
View File
@@ -81,7 +81,8 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
cnt++;
break;
case DOCT_TEXT://$BK,1$Update $LK,"DOCT_TEXT",A="FF:D:/Compiler/Lex.CPP,DOCT_TEXT"$$BK,0$
if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_HARD_SKIP|DOCEF_FILTER_SKIP))) {
if (!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_HARD_SKIP|DOCEF_FILTER_SKIP)) &&
!(doc_e->type&DOCG_BL_IV_UL)) {
cnt+=StrLen(doc_e->tag);
if (!(doc->flags & (DOCF_PLAIN_TEXT | DOCF_PLAIN_TEXT_WITH_TABS)) ||
doc->flags&DOCF_DBL_DOLLARS)
@@ -112,7 +113,8 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
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_HARD_SKIP|DOCEF_FILTER_SKIP))) {
!(doc_e->de_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_HARD_SKIP|DOCEF_FILTER_SKIP)) &&
!(doc_e->type&DOCG_BL_IV_UL)) {
src=doc_e->tag;
i=0;
while (ch=*src++) {
@@ -187,10 +189,9 @@ public Bool DocWrite(CDoc *doc,Bool prompt=FALSE)
{//Store doc to disk.
I64 size;
U8 *buf;
if (prompt && !DocFormDo(&doc->filename))
return FALSE;
if (doc->filename.name[0]=='A'&&doc->filename.name[2]==':')
return FALSE; //LK_DOC,LK_DOC_ANCHOR,LK_DOC_FIND,LK_DOC_LINE
if (prompt && !DocFormDo(&doc->filename) ||
doc->filename.name[0]=='A' && doc->filename.name[2]==':')
return FALSE; //CANCEL || LK_DOC,LK_DOC_ANCHOR,LK_DOC_FIND,LK_DOC_LINE?
buf=DocSave(doc,&size);
FileWrite(doc->filename.name,buf,size,0,doc->file_attr);
Free(buf);
@@ -440,13 +441,13 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
DocDel(doc2);
result=TRUE;
} else if (FilesFindMatch(filename,"*.BMP.Z")) {
DocBMPFile(doc,filename,FALSE);
DocBMP(doc,filename,,FALSE);
result=TRUE;
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
DocBMPFile(doc,filename,TRUE);
DocBMP(doc,filename,,TRUE);
result=TRUE;
} else if (FilesFindMatch(filename,"*.GRA*")) {
DocGRAFile(doc,filename);
DocGRA(doc,filename);
result=TRUE;
}
if (result)
+2 -2
View File
@@ -14,8 +14,8 @@ U0 DocInit()
"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"
"HL\0WW\0BK\0IV\0SEL\0UL\0"
"PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0P\0TRM\0Z\0H\0"
"TR\0LS\0SK\0PU\0SIF\0HS\0FS\0NC\0DD\0UD\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\0HS\0FS\0NC\0DD\0");
DefineLstLoad("ST_LINK_TYPES",
"FI\0FA\0FF\0FL\0MN\0PI\0PF\0PL\0BF\0DF\0HI\0AD\0AI\0AA\0AF\0AL\0");
+2 -2
View File
@@ -168,7 +168,7 @@ I64 PopUpMacroMenu()
"\n\n\n$$GREEN$$SHIFT-F2$$FG$$ will play macro.\n");
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
StrPrint(buf,"DocMenuDo(%d);",doc);
sys_macro_util_task=Spawn(&SrvUserCmdLine,NULL,"Macro Popup",,Fs);
sys_macro_util_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
Fs->popup_task=sys_macro_util_task;
LBts(&sys_macro_util_task->display_flags,DISPLAYf_WIN_ON_TOP);
tempc=TaskExe(sys_macro_util_task,Fs,buf,
@@ -189,7 +189,7 @@ U0 MacroTask(I64)
sys_macro_repeat_n=1;
do {
i=PopUpMacroMenu;
WinRefocus;
WinRefocus(sys_focus_task);
switch (i) {
case SM_RECORD:
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
+9 -8
View File
@@ -13,7 +13,7 @@ public Bool Ed(U8 *link_st,I64 edf_dof_flags=0)
case LK_DEF:
doc=DocNew;
doc->desc='DictDef';
WSDDefsPut(doc,filename,num);
ACDDefsPut(doc,filename,num);
goto ej_doc;
case LK_HELP_INDEX:
doc=DocNew;
@@ -24,11 +24,12 @@ ej_doc:
DocDo(doc);
DocDel(doc);
}
result=TRUE;
if (!(edf_dof_flags&EDF_WAS_WRITE))
result=TRUE;
break;
default:
if (IsRaw)
EdLite(filename,num);
result=EdLite(filename,num,edf_dof_flags);
else {
cont=TRUE;
if (!(edf_dof_flags&EDF_BAIL) && !(LK_DOC<=i<=LK_DOC_LINE) &&
@@ -44,11 +45,11 @@ ej_doc:
return result;
}
public Bool Plain(U8 *filename)
public Bool Plain(U8 *filename,I64 edf_dof_flags=0)
{//Edit document in plain text mode, so dollar signs are not special.
Bool result;
U8 *st=MStrPrint("PI:%s",filename);
result=Ed(st);
result=Ed(st,edf_dof_flags);
Free(st);
return result;
}
@@ -97,7 +98,7 @@ public U8 *DocLinkFile(U8 *link_st,CTask *mem_task=NULL)
Free(st);
break;
case LK_BIBLE_FIND:
result=StrNew(Define("ST_BIBLE_FILE"),mem_task);
result=StrNew(BIBLE_FILENAME,mem_task);
break;
}
Free(filename);
@@ -148,7 +149,7 @@ public U0 DocTermNew()
CDoc *pdoc=DocNew;
pdoc->right_click_link=&TermRightClickLink;
pdoc->max_entries=4096;
Fs->border_src=BDS_CUR_PRT;
Fs->border_src=BDS_CUR_DRV;
pdoc->desc='Term';
Fs->put_doc=Fs->display_doc=pdoc;
Fs->border_doc=DocBorderNew(pdoc);
@@ -531,7 +532,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
}
"AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
WinZBufUpdate;
AutoStr("%F\n",st);
AutoFile(st);
result=TRUE;
break;
}
+6 -4
View File
@@ -265,8 +265,9 @@ U0 DocFormFwd(CDoc *doc,Bool giveup=FALSE)
CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e;
if (doc->flags & DOCF_FORM) {
if (doc_e==doc) goto ff_recover;
while (!Bt(doldoc.type_flags_form,doc_e->type_u8) ||
doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
while (!Bt(doldoc.type_flags_form,doc_e->type_u8) &&
!(doc_e->de_flags&DOCEF_LINK) ||
doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
doc_e=doc_e->next;
if (doc_e==doc) {
ff_recover:
@@ -292,8 +293,9 @@ U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE)
{
CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e;
if (doc->flags & DOCF_FORM) {
while (!Bt(doldoc.type_flags_form,doc_e->type_u8) ||
doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
while (!Bt(doldoc.type_flags_form,doc_e->type_u8) &&
!(doc_e->de_flags&DOCEF_LINK) ||
doc_e->de_flags&DOCEF_SKIP_IN_FORM) {
doc_e=doc_e->last;
if (doc_e==doc) {
doc->cur_data_col=0;
+9 -34
View File
@@ -302,8 +302,8 @@ public Bool DocDo(CDoc *doc,I64 dof_flags=0)
Free(old_task_title);
DocDel(bdoc);
if (dof_flags&DOF_MIN_SIZE) {
SetWinHorz(old_left,old_right);
SetWinVert(old_top,old_bottom);
WinHorz(old_left,old_right);
WinVert(old_top,old_bottom);
}
Preempt(old_preempt);
return result;
@@ -403,32 +403,7 @@ md_restart:
return result;
}
#help_index "Task/Srv"
public I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL)
{//Execute code text in PopUp win task.
I64 result;
CSrvCmd *tempc;
Bool old_preempt=Preempt(OFF);
CTask *task=Spawn(&SrvUserCmdLine,NULL,"System",,parent);
if (!parent) {
TaskExe(task,parent,buf,1<<SVCf_EXIT_ON_COMPLETE|1<<SVCf_FREE_ON_COMPLETE);
if (_pu_task) *_pu_task=task;
Preempt(old_preempt);
return 0;
} else {
Fs->popup_task=task;
tempc=TaskExe(task,parent,buf,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
if (_pu_task) *_pu_task=task;
ScanResult(tempc,&result);
Fs->popup_task=NULL;
Kill(task);
if (_pu_task) *_pu_task=NULL;
Preempt(old_preempt);
return result;
}
}
#help_index "DolDoc;Task/Srv"
#help_index "DolDoc;Task/Srv/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);
@@ -441,7 +416,7 @@ public I64 PopUpEd(U8 *filename,CTask *parent=NULL,CTask **_pu_task=NULL)
public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0)
{//Pass doc to PopUp win task for viewing.
U8 *buf=MStrPrint("Preempt(ON);DocDo(0x%X,0x%X);",doc,dof_flags);
CTask *task=Spawn(&SrvUserCmdLine,NULL,"View",,Fs);
CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs);
TaskExe(task,NULL,buf,1<<SVCf_EXIT_ON_COMPLETE|1<<SVCf_FREE_ON_COMPLETE);
Free(buf);
return task;
@@ -470,13 +445,13 @@ public CTask *PopUpViewPrint(U8 *fmt,...)
public I64 PopUpMenu(CDoc *doc,I64 dof_flags=0)
{//Do (Run) menu chooser doc in PopUp win task.
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
return SrvUser("DocMenuDo(0x%X,0x%X);",doc,dof_flags);
return PopUpPrint("DocMenuDo(0x%X,0x%X);",doc,dof_flags);
}
public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,I64 dof_flags=DOF_MIN_SIZE,
U8 *header=NULL,U8 *footer=NULL)
{//See $LK,"::/Demo/DolDoc/Form.CPP"$ and $LK,"::/Demo/LastClass.CPP"$.
return SrvUser("DocFormDo(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name,
return PopUpPrint("DocFormDo(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name,
dof_flags,header,footer);
}
@@ -727,7 +702,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"
#help_index "Task/Srv/Exe"
public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE)
{//Tell adam task to compile and run a file.
Bool okay=TRUE;
@@ -875,8 +850,8 @@ U0 DrawIt(CTask *task,CDC *dc)
}
i=(17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH;
if (doc->max_x>i) i=doc->max_x;
SetWinHorz(task->win_left,task->win_left+i,task);
SetWinVert(task->win_top,task->win_top+doc->max_y+(17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH,task);
WinHorz(task->win_left,task->win_left+i,task);
WinVert(task->win_top,task->win_top+doc->max_y+(17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH,task);
}
I64 DitherColorDo(U8 *header=NULL)
@@ -169,23 +169,23 @@ public U0 DocPrintAtomic(CDoc *doc,U8 *fmt,...)
#help_index "DolDoc/Task"
U0 DocUpdateTaskDocs(CTask *task)
{//This is called from $LK,"GrUpdateWins",A="MN:GrUpdateWins"$() by the winmgr at 30fps.
CPrt *p;
CDrv *dv;
CDoc *doc;
CD3I64 saved_scroll;
Bool old_preempt=Preempt(OFF);
I64 border_attr;
if (task->border_src==BDS_CUR_PRT && task->cur_prt) {
border_attr=task->cur_prt->text_attr;
if (task->border_src==BDS_CUR_DRV && task->cur_dv) {
border_attr=task->cur_dv->text_attr;
if (border_attr&15!=border_attr>>4)
task->border_attr=border_attr;
}
if (task->title_src==TTS_TASK_NAME)
StrCpy(task->task_title,task->task_name);
if ((doc=DocDisplay(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
if (task->border_src==BDS_ED_FILENAME_PRT)
if (task->border_src==BDS_ED_FILENAME_DRV)
try {
if (p=Drv2Prt(*doc->filename.name)) {
border_attr=p->text_attr;
if (dv=Let2Drv(*doc->filename.name)) {
border_attr=dv->text_attr;
if (border_attr&15!=border_attr>>4)
task->border_attr=border_attr;
}
@@ -294,7 +294,7 @@ public Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC)
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
break;
case DOC_RECALC_TO_SCREEN:
if (doc->refresh_cnt++%(ToI64(winmgr.fps/10)+1) &&
if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
!(doc->flags&DOCF_BWD_MOVEMENT))
full_refresh=FALSE;
@@ -1127,26 +1127,26 @@ rc_skip:
i=left+doc->max_x-doc->min_x;
if (i>TEXT_COLS-1)
i=TEXT_COLS-1;
SetWinHorz(left,i,win_task);
WinHorz(left,i,win_task);
if (top<0)
top=0;
i=top+doc->max_y-doc->min_y;
if (i>TEXT_ROWS-1)
i=TEXT_ROWS-1;
SetWinVert(top,i,win_task);
WinVert(top,i,win_task);
} else {
if (left<1)
left=1;
i=left+doc->max_x-doc->min_x;
if (i>TEXT_COLS-2)
i=TEXT_COLS-2;
SetWinHorz(left,i,win_task);
WinHorz(left,i,win_task);
if (top<1)
top=1;
i=top+doc->max_y-doc->min_y;
if (i>TEXT_ROWS-2)
i=TEXT_ROWS-2;
SetWinVert(top,i,win_task);
WinVert(top,i,win_task);
}
}
if (find_cursor) {