ZealOS/docs/System/DolDoc/DocEd.CC.html

332 lines
32 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.05">
<style type="text/css">
body {background-color:#000000;}
.cF0{color:#ffffff;background-color:#000000;}
.cF1{color:#3465a4;background-color:#000000;}
.cF2{color:#4e9a06;background-color:#000000;}
.cF3{color:#06989a;background-color:#000000;}
.cF4{color:#a24444;background-color:#000000;}
.cF5{color:#75507b;background-color:#000000;}
.cF6{color:#ce982f;background-color:#000000;}
.cF7{color:#bcc0b9;background-color:#000000;}
.cF8{color:#555753;background-color:#000000;}
.cF9{color:#729fcf;background-color:#000000;}
.cFA{color:#82bc49;background-color:#000000;}
.cFB{color:#34e2e2;background-color:#000000;}
.cFC{color:#ac3535;background-color:#000000;}
.cFD{color:#ad7fa8;background-color:#000000;}
.cFE{color:#fce94f;background-color:#000000;}
.cFF{color:#000000;background-color:#000000;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc/Output;StdOut/DolDoc&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>View</span><span class=cF0>()
<a name="l4"></a>{</span><span class=cF2>//Go live for user interaction until &lt;ESC&gt; or &lt;SHIFT-ESC&gt;.</span><span class=cF0>
<a name="l5"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
<a name="l6"></a>
<a name="l7"></a> </span><span class=cF1>do</span><span class=cF0> ch = </span><span class=cF5>DocKeyGet</span><span class=cF0>;
<a name="l8"></a> </span><span class=cF1>while</span><span class=cF0> (ch != </span><span class=cF3>CH_ESC</span><span class=cF0> &amp;&amp; ch != </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>);
<a name="l9"></a>
<a name="l10"></a> </span><span class=cF1>return</span><span class=cF0> ch == </span><span class=cF3>CH_ESC</span><span class=cF0>;
<a name="l11"></a>}
<a name="l12"></a>
<a name="l13"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc&quot;</span><span class=cF0>
<a name="l14"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdOverStrikeCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l15"></a>{
<a name="l16"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l17"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l18"></a>
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_OVERSTRIKE</span><span class=cF0>)
<a name="l20"></a> *st = </span><span class=cF6>'O'</span><span class=cF0>;
<a name="l21"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l22"></a> *st = </span><span class=cF6>'.'</span><span class=cF0>;
<a name="l23"></a> st[</span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l24"></a>
<a name="l25"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l26"></a>}
<a name="l27"></a>
<a name="l28"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdAutoSaveCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l29"></a>{
<a name="l30"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l31"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l32"></a>
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_AUTO_SAVE</span><span class=cF0>)
<a name="l34"></a> *st = </span><span class=cF6>'S'</span><span class=cF0>;
<a name="l35"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l36"></a> *st = </span><span class=cF6>'.'</span><span class=cF0>;
<a name="l37"></a> st[</span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l38"></a>
<a name="l39"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l40"></a>}
<a name="l41"></a>
<a name="l42"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdFilterCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l43"></a>{
<a name="l44"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l45"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l46"></a>
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;find_replace-&gt;filter_lines)
<a name="l48"></a> *st = </span><span class=cF6>'F'</span><span class=cF0>;
<a name="l49"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l50"></a> *st = </span><span class=cF6>'.'</span><span class=cF0>;
<a name="l51"></a> st[</span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l52"></a>
<a name="l53"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l54"></a>}
<a name="l55"></a>
<a name="l56"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdDollarCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l57"></a>{
<a name="l58"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l59"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l60"></a>
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_IN_DOLLAR</span><span class=cF0>)
<a name="l62"></a> *st = </span><span class=cF6>'$'</span><span class=cF0>;
<a name="l63"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l64"></a> *st = </span><span class=cF6>'.'</span><span class=cF0>;
<a name="l65"></a> st[</span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l66"></a>
<a name="l67"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l68"></a>}
<a name="l69"></a>
<a name="l70"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdMoreCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l71"></a>{
<a name="l72"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l73"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l74"></a>
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_MORE</span><span class=cF0>)
<a name="l76"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(st, </span><span class=cF6>&quot;More.&quot;</span><span class=cF0>);
<a name="l77"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l78"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(st, </span><span class=cF6>&quot;.....&quot;</span><span class=cF0>);
<a name="l79"></a>
<a name="l80"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l81"></a>}
<a name="l82"></a>
<a name="l83"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>EdDollarTypeCB</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *, </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e, </span><span class=cF9>CTask</span><span class=cF0> *mem_task)
<a name="l84"></a>{
<a name="l85"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = doc_e-&gt;user_data;
<a name="l86"></a> </span><span class=cF1>U8</span><span class=cF0> *src = </span><span class=cF5>DefineSub</span><span class=cF0>(doc-&gt;cur_entry-&gt;type_u8, </span><span class=cF6>&quot;ST_DOC_CMDS&quot;</span><span class=cF0>), *st = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0>, mem_task);
<a name="l87"></a>
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;cur_entry == doc)
<a name="l89"></a> src = </span><span class=cF6>&quot;EOF&quot;</span><span class=cF0>;
<a name="l90"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!src)
<a name="l91"></a> src = </span><span class=cF6>&quot;ERR&quot;</span><span class=cF0>;
<a name="l92"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(st, </span><span class=cF6>&quot;%-3ts&quot;</span><span class=cF0>, src);
<a name="l93"></a>
<a name="l94"></a> </span><span class=cF1>return</span><span class=cF0> st;
<a name="l95"></a>}
<a name="l96"></a>
<a name="l97"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocEd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF9>I64</span><span class=cF0> dof_flags=</span><span class=cFE>0</span><span class=cF0>)
<a name="l98"></a>{</span><span class=cF2>//Live for user interaction. End on &lt;ESC&gt; or &lt;SHIFT-ESC&gt;.</span><span class=cF0>
<a name="l99"></a> </span><span class=cF9>CDoc</span><span class=cF0> *old_put_doc = </span><span class=cF5>DocPut</span><span class=cF0>,
<a name="l100"></a> *old_display_doc = </span><span class=cF5>DocDisplay</span><span class=cF0>,
<a name="l101"></a> *old_border_doc = </span><span class=cF5>DocBorder</span><span class=cF0>,
<a name="l102"></a> *bdoc;
<a name="l103"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l104"></a> </span><span class=cF9>I64</span><span class=cF0> old_attr = </span><span class=cF5>Fs</span><span class=cF0>-&gt;text_attr,
<a name="l105"></a> old_top = </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_top,
<a name="l106"></a> old_bottom = </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_bottom,
<a name="l107"></a> old_left = </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_left,
<a name="l108"></a> old_right = </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_right,
<a name="l109"></a> old_title_src = </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src;
<a name="l110"></a> </span><span class=cF1>Bool</span><span class=cF0> res, unlock;
<a name="l111"></a> </span><span class=cF1>U8</span><span class=cF0> *old_task_title;
<a name="l112"></a>
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (dof_flags &amp; </span><span class=cF3>DOF_WIN_MAX</span><span class=cF0>)
<a name="l114"></a> </span><span class=cF5>WinMax</span><span class=cF0>;
<a name="l115"></a>
<a name="l116"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l117"></a> doc-&gt;win_task = </span><span class=cF5>Fs</span><span class=cF0>;
<a name="l118"></a> bdoc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l119"></a> bdoc-&gt;flags |= </span><span class=cF3>DOCF_BORDER_DOC</span><span class=cF0>;
<a name="l120"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$CM+TY+LX+NC,0,-1$&quot;</span><span class=cF0>);
<a name="l121"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$BG,LTRED$$LTGRAY$$TX+RX+BD,\&quot;[X]\&quot;$$FG$$BG$&quot;</span><span class=cF0>);
<a name="l122"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$BG,BROWN$$YELLOW$$TX+LX+BD,\&quot;MENU\&quot;$$FG$$BG$&quot;</span><span class=cF0>);
<a name="l123"></a>
<a name="l124"></a> old_task_title = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title);
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src != </span><span class=cF3>TTS_LOCKED_CONST</span><span class=cF0>)
<a name="l126"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l127"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src = </span><span class=cF3>TTS_ED_FILENAME</span><span class=cF0>;
<a name="l128"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title, doc-&gt;filename.name, </span><span class=cF3>STR_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
<a name="l129"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l130"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$DA-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1,A=\&quot;%%s\&quot;$&quot;</span><span class=cF0>);
<a name="l131"></a> doc_e-&gt;data = &amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title;
<a name="l132"></a> </span><span class=cF5>DocDataFormat</span><span class=cF0>(bdoc, doc_e);
<a name="l133"></a>
<a name="l134"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_ALLOW_UNDO</span><span class=cF0>)
<a name="l135"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l136"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$CM+BY+LX+NC,1,1$&quot;</span><span class=cF0>);
<a name="l137"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$DA+BD+RD-TRM,RT=U32,A=\&quot;Undo:%%03d\&quot;$\n&quot;</span><span class=cF0>);
<a name="l138"></a> doc_e-&gt;data = &amp;doc-&gt;undo_count;
<a name="l139"></a> </span><span class=cF5>DocDataFormat</span><span class=cF0>(bdoc, doc_e);
<a name="l140"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l141"></a>
<a name="l142"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$CM+BY+RX+NC,-31,1$&quot;</span><span class=cF0>);
<a name="l143"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l144"></a> doc_e-&gt;user_data = doc;
<a name="l145"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdMoreCB</span><span class=cF0>;
<a name="l146"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l147"></a> doc_e-&gt;user_data = doc;
<a name="l148"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdDollarTypeCB</span><span class=cF0>;
<a name="l149"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l150"></a> doc_e-&gt;user_data = doc;
<a name="l151"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdFilterCB</span><span class=cF0>;
<a name="l152"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l153"></a> doc_e-&gt;user_data = doc;
<a name="l154"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdOverStrikeCB</span><span class=cF0>;
<a name="l155"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l156"></a> doc_e-&gt;user_data = doc;
<a name="l157"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdAutoSaveCB</span><span class=cF0>;
<a name="l158"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$TX+BD+TC,\&quot; \&quot;$&quot;</span><span class=cF0>);
<a name="l159"></a> doc_e-&gt;user_data = doc;
<a name="l160"></a> doc_e-&gt;tag_cb = &amp;</span><span class=cF5>EdDollarCB</span><span class=cF0>;
<a name="l161"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$DA+BD+RD-TRM,A=\&quot;Line:%%04d \&quot;$&quot;</span><span class=cF0>);
<a name="l162"></a> doc_e-&gt;data = &amp;doc-&gt;line;
<a name="l163"></a> </span><span class=cF5>DocDataFormat</span><span class=cF0>(bdoc,doc_e);
<a name="l164"></a> doc_e = </span><span class=cF5>DocPrint</span><span class=cF0>(bdoc, </span><span class=cF6>&quot;$DA+BD+RD-TRM,A=\&quot;Col:%%04d\&quot;$\n&quot;</span><span class=cF0>);
<a name="l165"></a> doc_e-&gt;data = &amp;doc-&gt;col;
<a name="l166"></a> </span><span class=cF5>DocDataFormat</span><span class=cF0>(bdoc, doc_e);
<a name="l167"></a>
<a name="l168"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(bdoc);
<a name="l169"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dof_flags &amp; </span><span class=cF3>DOF_DONT_HOME</span><span class=cF7>)</span><span class=cF0>)
<a name="l171"></a> </span><span class=cF5>DocTop</span><span class=cF0>(doc);
<a name="l172"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_doc = bdoc;
<a name="l173"></a> </span><span class=cF1>if</span><span class=cF0> (doc != old_display_doc)
<a name="l174"></a> doc-&gt;parent_doc = old_display_doc;
<a name="l175"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc = doc;
<a name="l176"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dof_flags &amp; </span><span class=cF3>DOF_DONT_TEXT_ATTR</span><span class=cF7>)</span><span class=cF0>)
<a name="l177"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;text_attr = </span><span class=cF3>DOC_ATTR_DEFAULT_TEXT</span><span class=cF0>;
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dof_flags &amp; </span><span class=cF3>DOF_DONT_SHOW</span><span class=cF7>)</span><span class=cF0>)
<a name="l179"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l180"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;display_flags, </span><span class=cF3>DISPLAYf_SHOW</span><span class=cF0>);
<a name="l181"></a> </span><span class=cF5>WinZBufUpdate</span><span class=cF0>;
<a name="l182"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l183"></a> </span><span class=cF1>if</span><span class=cF0> (dof_flags &amp; </span><span class=cF3>DOF_SIZE_MIN</span><span class=cF0>)
<a name="l184"></a> doc-&gt;flags |= </span><span class=cF3>DOCF_SIZE_MIN</span><span class=cF0>;
<a name="l185"></a>
<a name="l186"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dof_flags &amp; </span><span class=cF3>DOF_DONT_WINMGR_SYNC</span><span class=cF7>)</span><span class=cF0>)
<a name="l188"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l189"></a> </span><span class=cF5>Refresh</span><span class=cF0>(</span><span class=cFE>2</span><span class=cF0>, </span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l190"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;flags &amp; </span><span class=cF3>DOCF_SIZE_MIN</span><span class=cF0>)
<a name="l191"></a> </span><span class=cF5>Refresh</span><span class=cF0>(</span><span class=cFE>2</span><span class=cF0>, </span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l192"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l193"></a> res = </span><span class=cF5>View</span><span class=cF0>;
<a name="l194"></a>
<a name="l195"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (res)
<a name="l197"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l198"></a> doc_e = doc-&gt;head.next;
<a name="l199"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
<a name="l200"></a> {
<a name="l201"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;type_u8 == </span><span class=cF3>DOCT_DATA</span><span class=cF0> || doc_e-&gt;type_u8 == </span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>)
<a name="l202"></a> </span><span class=cF5>DocDataScan</span><span class=cF0>(doc, doc_e);
<a name="l203"></a> doc_e = doc_e-&gt;next;
<a name="l204"></a> }
<a name="l205"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l206"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l207"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l208"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_doc = old_border_doc;
<a name="l209"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;display_doc = old_display_doc;
<a name="l210"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;put_doc = old_put_doc;
<a name="l211"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;text_attr = old_attr;
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src != </span><span class=cF3>TTS_LOCKED_CONST</span><span class=cF0>)
<a name="l213"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l214"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src = old_title_src;
<a name="l215"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title, old_task_title);
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l217"></a> </span><span class=cF5>Free</span><span class=cF0>(old_task_title);
<a name="l218"></a> </span><span class=cF5>DocDel</span><span class=cF0>(bdoc);
<a name="l219"></a> </span><span class=cF1>if</span><span class=cF0> (dof_flags &amp; </span><span class=cF3>DOF_SIZE_MIN</span><span class=cF0>)
<a name="l220"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l221"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(old_left, old_right);
<a name="l222"></a> </span><span class=cF5>WinVert</span><span class=cF0>(old_top, old_bottom);
<a name="l223"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l224"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l225"></a>}
<a name="l226"></a>
<a name="l227"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc/Cmd Line (Typically);Cmd Line (Typically)&quot;</span><span class=cF0>
<a name="l228"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Ed</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *link_st=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags=</span><span class=cFE>0</span><span class=cF0>)
<a name="l229"></a>{</span><span class=cF2>//Invoke document editor.</span><span class=cF0>
<a name="l230"></a> </span><span class=cF1>U8</span><span class=cF0> *filename, *needle_str;
<a name="l231"></a> </span><span class=cF9>I64</span><span class=cF0> i, num;
<a name="l232"></a> </span><span class=cF1>Bool</span><span class=cF0> cont, res = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l233"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l234"></a>
<a name="l235"></a> </span><span class=cF1>if</span><span class=cF0> (!link_st)
<a name="l236"></a> link_st = </span><span class=cF6>&quot;&quot;</span><span class=cF0>;
<a name="l237"></a>
<a name="l238"></a> </span><span class=cF1>switch</span><span class=cF0> (i = </span><span class=cF5>EdLinkConvert</span><span class=cF7>(</span><span class=cF0>link_st, &amp;filename, &amp;needle_str, &amp;num, edf_dof_flags</span><span class=cF7>)</span><span class=cF0>)
<a name="l239"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l240"></a> </span><span class=cF1>case</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>:
<a name="l241"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l242"></a>
<a name="l243"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_DEF</span><span class=cF0>:
<a name="l244"></a> doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l245"></a> doc-&gt;desc = </span><span class=cF6>'DictDef'</span><span class=cF0>;
<a name="l246"></a> </span><span class=cF5>ACDDefsPut</span><span class=cF0>(doc, filename, num);
<a name="l247"></a> </span><span class=cF1>goto</span><span class=cF0> ej_doc;
<a name="l248"></a>
<a name="l249"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>LK_HELP_INDEX</span><span class=cF0>:
<a name="l250"></a> doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l251"></a> doc-&gt;desc = </span><span class=cF6>'HelpIndx'</span><span class=cF0>;
<a name="l252"></a> </span><span class=cF5>DocHelpIdx</span><span class=cF0>(doc, filename);
<a name="l253"></a>ej_doc:
<a name="l254"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>edf_dof_flags &amp; </span><span class=cF3>EDF_BAIL</span><span class=cF7>)</span><span class=cF0>)
<a name="l255"></a> {
<a name="l256"></a> </span><span class=cF5>DocEd</span><span class=cF0>(doc);
<a name="l257"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l258"></a> }
<a name="l259"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>edf_dof_flags &amp; </span><span class=cF3>EDF_WAS_WRITE</span><span class=cF7>)</span><span class=cF0>)
<a name="l260"></a> res = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l261"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l262"></a>
<a name="l263"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
<a name="l265"></a> res = </span><span class=cF5>EdLite</span><span class=cF0>(filename, num, edf_dof_flags);
<a name="l266"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l267"></a> {
<a name="l268"></a> cont = </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l269"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>edf_dof_flags &amp; </span><span class=cF3>EDF_BAIL</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !</span><span class=cF7>(</span><span class=cF3>LK_DOC</span><span class=cF0> &lt;= i &lt;= </span><span class=cF3>LK_DOC_LINE</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l270"></a> !</span><span class=cF5>FilesFindMatch</span><span class=cF7>(</span><span class=cF0>filename, </span><span class=cF3>FILEMASK_TXT</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l271"></a> !</span><span class=cF5>PopUpCancelOk</span><span class=cF7>(</span><span class=cF3>ST_WARN_ST</span><span class=cF0> </span><span class=cF6>&quot;Not Text File\n\n&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l272"></a> cont = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l273"></a> </span><span class=cF1>if</span><span class=cF0> (cont)
<a name="l274"></a> res = </span><span class=cF5>DocFileEd</span><span class=cF0>(i, filename, needle_str, &amp;num, edf_dof_flags);
<a name="l275"></a> }
<a name="l276"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l277"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
<a name="l278"></a> </span><span class=cF5>Free</span><span class=cF0>(needle_str);
<a name="l279"></a>
<a name="l280"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l281"></a>}
<a name="l282"></a>
<a name="l283"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Plain</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags=</span><span class=cFE>0</span><span class=cF0>)
<a name="l284"></a>{</span><span class=cF2>//Edit document in plain text mode, so dollar signs are not special.</span><span class=cF0>
<a name="l285"></a> </span><span class=cF1>Bool</span><span class=cF0> res;
<a name="l286"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;PI:%s&quot;</span><span class=cF0>, filename);
<a name="l287"></a>
<a name="l288"></a> res = </span><span class=cF5>Ed</span><span class=cF0>(st, edf_dof_flags);
<a name="l289"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l290"></a>
<a name="l291"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l292"></a>}
<a name="l293"></a>
<a name="l294"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc;Job/Exe;Task/Job/Exe&quot;</span><span class=cF0>
<a name="l295"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpEd</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>CTask</span><span class=cF0> *parent=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF9>CTask</span><span class=cF0> **_pu_task=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l296"></a>{</span><span class=cF2>//Create PopUp win task and edit a doc.</span><span class=cF0>
<a name="l297"></a> </span><span class=cF1>U8</span><span class=cF0> *st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;Ed(\&quot;%Q\&quot;);&quot;</span><span class=cF0>, filename);
<a name="l298"></a> </span><span class=cF9>I64</span><span class=cF0> res = </span><span class=cF5>PopUp</span><span class=cF0>(st, parent, _pu_task);
<a name="l299"></a>
<a name="l300"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l301"></a>
<a name="l302"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l303"></a>}
</span></pre></body>
</html>