TempleOSCD_150720.ISO
This commit is contained in:
1 parent
401601816c
commit
f8c05f98f4
554 files changed
+26046
-24853
No files matched your search
+13
-13
@@ -1,8 +1,8 @@
|
||||
U8 *tSCB(CDoc *,CDocEntry *,CTask *mem_task)
|
||||
{//This is called by the window mgr.
|
||||
//Things would get corrupted
|
||||
//if the window mgr used it's own
|
||||
//heap, so we use the owning task's heap.
|
||||
//if the window mgr used it's own
|
||||
//heap, so we use the owning task's heap.
|
||||
U8 *st=MAlloc(64,mem_task);
|
||||
CDate cdt=tS*CDATE_FREQ;
|
||||
//Doesn't have to be fixed width!!
|
||||
@@ -30,18 +30,18 @@ U0 DoIt()
|
||||
doc_e=DocPrint(bdoc,"$$TX+TC,\" \"$$");
|
||||
//The TC flag is "has tag callback".
|
||||
|
||||
//Flags are explained here:
|
||||
//$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$
|
||||
//$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$
|
||||
//Flags are explained here:
|
||||
//$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$
|
||||
//$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$
|
||||
doc_e->tag_cb=&tSCB;
|
||||
DocPrint(bdoc,"$$FG$$");
|
||||
DocUnlock(bdoc);
|
||||
|
||||
//$BK,1$WARNING:$BK,0$ If you use the put_doc you
|
||||
//run the risk of the user pressing
|
||||
//<CTRL-t> or using the clipboard, both
|
||||
//of which will crash. So, you might want
|
||||
//to use the border_doc.
|
||||
//$BK,1$WARNING:$BK,0$ If you use the put_doc you
|
||||
//run the risk of the user pressing
|
||||
//<CTRL-t> or using the clipboard, both
|
||||
//of which will crash. So, you might want
|
||||
//to use the border_doc.
|
||||
|
||||
DocLock(pdoc);
|
||||
DocPrint(pdoc,"$$LTRED$$");
|
||||
@@ -50,9 +50,9 @@ U0 DoIt()
|
||||
DocPrint(pdoc,"$$FG$$");
|
||||
DocUnlock(pdoc);
|
||||
|
||||
//Send carriage return, new line, so
|
||||
//that the timer string is not part
|
||||
//of the next cmd on the cmd line.
|
||||
//Send carriage return, new line, so
|
||||
//that the timer string is not part
|
||||
//of the next cmd on the cmd line.
|
||||
'\n';
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ U0 ClickCallBack()
|
||||
doc_e=DocPrint(DocPut,"\n$$MA+LC,\"Click Me\"$$ ");
|
||||
//The LC flag is "has left callback".
|
||||
|
||||
//Flags are explained here:
|
||||
//$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$
|
||||
//$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$
|
||||
//Flags are explained here:
|
||||
//$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$
|
||||
//$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$
|
||||
"(Not preserved when <CTRL-t> and back.)\n\n";
|
||||
doc_e->left_cb=&MyLeftCB1;
|
||||
DocUnlock(DocPut);
|
||||
|
||||
@@ -8,9 +8,9 @@ U0 CursorMovementDemo()
|
||||
"$$CM,4,-10$$";
|
||||
}
|
||||
|
||||
//+LX is relative to left side.
|
||||
//See <CTRL-l> with cursor-movement for all the flags.
|
||||
//Check "Quote" to set-up a cmd for in quotes.
|
||||
//+LX is relative to left side.
|
||||
//See <CTRL-l> with cursor-movement for all the flags.
|
||||
//Check "Quote" to set-up a cmd for in quotes.
|
||||
"$$CM+LX,0,+10$$\n";
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -29,24 +29,24 @@ U0 DataDemo()
|
||||
{
|
||||
CDocEntry *doc_e;
|
||||
|
||||
//This is the command line document.
|
||||
//This is the command line document.
|
||||
CDoc *doc=DocPut;
|
||||
|
||||
//We do this to prevent access to
|
||||
//doc_e->data before it is set.
|
||||
//We do this to prevent access to
|
||||
//doc_e->data before it is set.
|
||||
Bool unlock=DocLock(doc);
|
||||
|
||||
//You might set the $LK,"DOCF_FORM",A="MN:DOCF_FORM"$ flag.
|
||||
// doc->flags|=DOCF_FORM
|
||||
//if you wish.
|
||||
//You might set the $LK,"DOCF_FORM",A="MN:DOCF_FORM"$ flag.
|
||||
// doc->flags|=DOCF_FORM
|
||||
//if you wish.
|
||||
|
||||
Spawn(&UpdateGlblTask,NULL,"Update Glbl",,Fs);
|
||||
|
||||
"Enter editor overstrike mode\n"
|
||||
"and you can modify the val.\n"
|
||||
"However, changes happen immediately,\n"
|
||||
"so it's tricky.\n\n";
|
||||
//Use <CTRL-l> for the $$DA...$$ format.
|
||||
"and you can modify the val.\n"
|
||||
"However, changes happen immediately,\n"
|
||||
"so it's tricky.\n\n";
|
||||
//Use <CTRL-l> for the $$DA...$$ format.
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,32,RT=I16,A=\"%%7d\"$$\n");
|
||||
doc_e->data=&i;
|
||||
|
||||
|
||||
+25
-13
@@ -1,15 +1,15 @@
|
||||
public U0 DocProfile(U8 *filename,I64 flags)
|
||||
{
|
||||
I64 i,*cmd_stats=CAlloc(sizeof(I64)*DOCT_NUM_TYPES),
|
||||
*flags_stats=CAlloc(sizeof(I64)*64),
|
||||
*type_flags_stats=CAlloc(sizeof(I64)*64);
|
||||
*flags_stats=CAlloc(sizeof(I64)*64),
|
||||
*type_flags_stats=CAlloc(sizeof(I64)*64);
|
||||
//Note: word wrap is determined by
|
||||
//doc->win_task when a $LK,"CDoc",A="MN:CDoc"$ is recalculated
|
||||
//use $LK,"DocRecalc",A="MN:DocRecalc"$().
|
||||
//doc->win_task when a $LK,"CDoc",A="MN:CDoc"$ is recalculated
|
||||
//use $LK,"DocRecalc",A="MN:DocRecalc"$().
|
||||
CDoc *doc=DocRead(filename,flags);
|
||||
|
||||
//doc->root which is equal to doc is the
|
||||
//header of the CQue and represents the end-of-file marker.
|
||||
//doc->root which is equal to doc is the
|
||||
//header of the CQue and represents the end-of-file marker.
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
cmd_stats[doc_e->type_u8]++;
|
||||
@@ -24,23 +24,35 @@ public U0 DocProfile(U8 *filename,I64 flags)
|
||||
DocDel(doc);
|
||||
|
||||
"$$PURPLE$$-------%s-------\n",filename;
|
||||
"$$GREEN$$The lowest byte of the 32-bit 'doc_e->type', '$$PURPLE$$doc_e->type.u8[0]$$GREEN$$', is cmd and accessed with the union '$$PURPLE$$doc_e->type_u8$$GREEN$$'. "
|
||||
"See $$LK,\"CDocEntry\",A=\"MN:CDocEntry\"$$, "
|
||||
"$$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$$ and $$LK,\"Doc Type Codes\",A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_CMDS\"$$.\n$$FG$$";
|
||||
"$$GREEN$$The lowest byte of the 32-bit 'doc_e->type', "
|
||||
"'$$PURPLE$$doc_e->type.u8[0]$$GREEN$$', "
|
||||
"is cmd and accessed with the union "
|
||||
"'$$PURPLE$$doc_e->type_u8$$GREEN$$'. "
|
||||
"See $$LK,\"CDocEntry\",A=\"MN:CDocEntry\"$$, "
|
||||
"$$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$$ and "
|
||||
"$$LK,\"Doc Type Codes\","
|
||||
"A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_CMDS\"$$.\n"
|
||||
"$$FG$$";
|
||||
for (i=0;i<DOCT_NUM_TYPES;i++)
|
||||
if (cmd_stats[i])
|
||||
"%4Z:%d\n",i,"ST_DOC_CMDS",cmd_stats[i];
|
||||
|
||||
"\n$$GREEN$$'$$PURPLE$$doc_e->type.u8[1]$$GREEN$$' is the screen color attr of the entry. "
|
||||
"'$$PURPLE$$doc_e->type.u16[1]$$GREEN$$' is some flags for blinking and stuff. "
|
||||
"See $$LK,\"Doc Type Flag Defines\",A=\"MN:DOCET_BLINK\"$$.\n$$FG$$";
|
||||
"\n$$GREEN$$'$$PURPLE$$doc_e->type.u8[1]$$GREEN$$' is "
|
||||
"the screen color attr of the "
|
||||
"entry. '$$PURPLE$$doc_e->type.u16[1]"
|
||||
"$$GREEN$$' is some flags for blinking and "
|
||||
"stuff. See $$LK,\"Doc Type Flag "
|
||||
"Defines\",A=\"MN:DOCET_BLINK\"$$.\n$$FG$$";
|
||||
|
||||
for (i=16;i<32;i++)
|
||||
if (type_flags_stats[i])
|
||||
"%4d:%d\n",i,type_flags_stats[i];
|
||||
|
||||
"$$GREEN$$\n'$$PURPLE$$doc_e->de_flags$$GREEN$$' is 64-bit. "
|
||||
"See $$LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$$ and $$LK,\"Doc Flag Codes\",A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS\"$$.\n$$FG$$";
|
||||
"See $$LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$$ and "
|
||||
"$$LK,\"Doc Flag Codes\","
|
||||
"A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS\"$$.\n"
|
||||
"$$FG$$";
|
||||
for (i=0;i<64;i++)
|
||||
if (flags_stats[i])
|
||||
"%4Z:%d\n",i,"ST_DOC_FLAGS",flags_stats[i];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class FDStruct
|
||||
{//Use <CTRL-l> and select "Data" to generate the fmtstrs
|
||||
|
||||
//The number is the field from after the ':' to the end.
|
||||
//See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$.
|
||||
//The number is the field from after the ':' to the end.
|
||||
//See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$.
|
||||
|
||||
F64 num1 fmtstr "$$DA-TRM,32,RT=F64,A=\"F64 1:%12.8f\"$$\n";
|
||||
F64 num2 fmtstr "$$DA-TRM,32,RT=F64,A=\"F64 2:%12e\"$$\n";
|
||||
@@ -26,7 +26,7 @@ U0 FormDemo()
|
||||
StrCpy(&fds.name,"John");
|
||||
fds.datetime=Now;
|
||||
fds.check=TRUE;
|
||||
if (DocFormDo(&fds)) {
|
||||
if (DocForm(&fds)) {
|
||||
"#1\t=%e\n",fds.num1;
|
||||
"#2\t=%e\n",fds.num2;
|
||||
"#3\t=%d\n",fds.num3;
|
||||
@@ -41,7 +41,7 @@ U0 FormDemo()
|
||||
"\n\nClassRep Example\n";
|
||||
ClassRep(&fds);
|
||||
|
||||
//See also $LK,"ClassRepD",A="MN:ClassRepD"$().
|
||||
//See also $LK,"ClassRepD",A="MN:ClassRepD"$().
|
||||
}
|
||||
|
||||
FormDemo;
|
||||
@@ -40,9 +40,9 @@ U0 MenuButton()
|
||||
else
|
||||
"\n$$BT,\"Snd Off\",LE=MU_SND_OFF$$\n\n\n";
|
||||
"\n$$BT,\"Set Freq\",LE=MU_SET_FREQ$$\n\n\n"
|
||||
"\n$$BT,\"Nothing\",LE=MU_NOTHING$$\n\n\n"
|
||||
"\n$$BT,\"Done\",LE=DOCM_CANCEL$$\n\n\n";
|
||||
i=DocMenuDo(DocPut);
|
||||
"\n$$BT,\"Nothing\",LE=MU_NOTHING$$\n\n\n"
|
||||
"\n$$BT,\"Done\",LE=DOCM_CANCEL$$\n\n\n";
|
||||
i=DocMenu(DocPut);
|
||||
DocBottom;
|
||||
switch (i) {
|
||||
case MU_NOTHING:
|
||||
@@ -67,7 +67,7 @@ U0 MenuButton()
|
||||
}
|
||||
} while (!done);
|
||||
DocPut->flags=DocPut->flags&~DOCF_FORM |
|
||||
old_flags & DOCF_FORM;
|
||||
old_flags & DOCF_FORM;
|
||||
DocClear;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
// This makes a new Bible file
|
||||
//with line numbers.
|
||||
|
||||
U0 NumBible()
|
||||
{
|
||||
CDoc *doc_in=DocRead("::/Misc/Bible.TXT.Z",DOCF_PLAIN_TEXT_WITH_TABS),
|
||||
*doc_out=DocNew("::/Home/NumBible.TXT.Z");
|
||||
CDocEntry *doc_e=doc_in->root.next;
|
||||
while (doc_e!=doc_in) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
DocPrint(doc_out,"%05d %s",doc_e->y+1,doc_e->tag);
|
||||
doc_e=doc_e->next;
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
DocPrint(doc_out,"\n");
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
DocPrint(doc_out,"%05d\n",doc_e->y+1);
|
||||
doc_e=doc_e->next;
|
||||
} else
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocWrite(doc_out);
|
||||
DocDel(doc_out);
|
||||
DocDel(doc_in);
|
||||
}
|
||||
|
||||
NumBible;
|
||||
@@ -20,7 +20,7 @@ U0 TreeSub(CDoc *doc,CDirEntry *tempde)
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
DocPrint(doc,"$$TR,\"\"$$");
|
||||
DocPrint(doc,"$$MA,T=\"%s\",LM=\"Cd(\\\"%s\\\");Dir;\n\"$$\n",
|
||||
tempde->name,tempde->full_name);
|
||||
tempde->name,tempde->full_name);
|
||||
if (tempde->sub) {
|
||||
DocPrint(doc,"$$ID,+2$$");
|
||||
TreeSub(doc,tempde->sub);
|
||||
@@ -28,10 +28,10 @@ U0 TreeSub(CDoc *doc,CDirEntry *tempde)
|
||||
}
|
||||
} else
|
||||
DocPrint(doc,"$$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||
tempde->name,tempde->full_name);
|
||||
//Note there is also a routine
|
||||
//to delete an entire CDirEntry tree.
|
||||
//See $LK,"DirTreeDel",A="MN:DirTreeDel"$().
|
||||
tempde->name,tempde->full_name);
|
||||
//Note there is also a routine
|
||||
//to delete an entire CDirEntry tree.
|
||||
//See $LK,"DirTreeDel",A="MN:DirTreeDel"$().
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user