templeos-info/public/Wb/Adam/DolDoc/DocRecalcLib.HC.HTML

245 lines
25 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DocCharDist</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y)
<a name="l4"></a>{
<a name="l5"></a>#</span><span class=cF1>assert</span><span class=cF0> </span><span class=cF3>FONT_WIDTH</span><span class=cF0>==</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>
<a name="l6"></a> </span><span class=cF1>return</span><span class=cF0> (</span><span class=cF5>SqrI64</span><span class=cF7>(</span><span class=cF0>doc-&gt;x-x</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>SqrI64</span><span class=cF7>(</span><span class=cF0>doc-&gt;y-y</span><span class=cF7>)</span><span class=cF0>)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l7"></a>}
<a name="l8"></a>
<a name="l9"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocDelToNum</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> num)
<a name="l10"></a>{
<a name="l11"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=doc-&gt;head.next,*doc_e2;
<a name="l12"></a> </span><span class=cF1>while</span><span class=cF0> (num--&gt;0 &amp;&amp; doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l13"></a> doc_e2=doc_e-&gt;next;
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_e-&gt;de_flags &amp; (</span><span class=cF3>DOCEF_HOLD</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) {
<a name="l15"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc-&gt;cur_entry) </span><span class=cF7>{</span><span class=cF0>
<a name="l16"></a> doc-&gt;cur_entry=doc_e2;
<a name="l17"></a> doc-&gt;cur_col=doc_e2-&gt;min_col;
<a name="l18"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l19"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_e);
<a name="l20"></a> }
<a name="l21"></a> doc_e=doc_e2;
<a name="l22"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l23"></a>}
<a name="l24"></a>
<a name="l25"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocDelToEntry</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *clear_entry,</span><span class=cF1>Bool</span><span class=cF0> clear_holds)
<a name="l26"></a>{
<a name="l27"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=doc-&gt;head.next,*doc_e2;
<a name="l28"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l29"></a> doc_e2=doc_e-&gt;next;
<a name="l30"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_e-&gt;de_flags &amp; (</span><span class=cF3>DOCEF_HOLD</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>||clear_holds) {
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc-&gt;cur_entry) </span><span class=cF7>{</span><span class=cF0>
<a name="l32"></a> doc-&gt;cur_entry=doc_e2;
<a name="l33"></a> doc-&gt;cur_col=doc_e2-&gt;min_col;
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l35"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_e);
<a name="l36"></a> }
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==clear_entry)
<a name="l38"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l39"></a> doc_e=doc_e2;
<a name="l40"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l41"></a>}
<a name="l42"></a>
<a name="l43"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocBorderLstDraw</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
<a name="l44"></a>{
<a name="l45"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task=doc-&gt;win_task;
<a name="l46"></a> </span><span class=cF9>I64</span><span class=cF0> i,y=-1,attr=win_task-&gt;border_attr&lt;&lt;8;
<a name="l47"></a> </span><span class=cF9>U64</span><span class=cF0> ch;
<a name="l48"></a> </span><span class=cF9>CDoc</span><span class=cF0> *tmpl=doc;
<a name="l49"></a> </span><span class=cF9>CD3I64</span><span class=cF0> saved_scroll;
<a name="l50"></a> </span><span class=cF1>while</span><span class=cF0> (tmpl &amp;&amp; tmpl-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l51"></a> y+=(</span><span class=cF5>Bsr</span><span class=cF7>(</span><span class=cF0>tmpl-&gt;desc</span><span class=cF7>)</span><span class=cF0>+7)&gt;&gt;3+1; </span><span class=cF2>//StrLen+1</span><span class=cF0>
<a name="l52"></a> tmpl=tmpl-&gt;parent_doc;
<a name="l53"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l54"></a> tmpl=doc;
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (y&gt;win_task-&gt;win_height)
<a name="l56"></a> y=win_task-&gt;win_height;
<a name="l57"></a> </span><span class=cF5>WinScrollNull</span><span class=cF0>(win_task,&amp;saved_scroll);
<a name="l58"></a> </span><span class=cF1>while</span><span class=cF0> (tmpl &amp;&amp; tmpl-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l59"></a> ch=tmpl-&gt;desc;
<a name="l60"></a> i=(</span><span class=cF5>Bsr</span><span class=cF7>(</span><span class=cF0>ch</span><span class=cF7>)</span><span class=cF0>+7)&gt;&gt;3; </span><span class=cF2>//StrLen</span><span class=cF0>
<a name="l61"></a> ch=</span><span class=cF5>EndianI64</span><span class=cF0>(ch&lt;&lt;</span><span class=cF7>(</span><span class=cF0>(8-i)&lt;&lt;3</span><span class=cF7>)</span><span class=cF0>);
<a name="l62"></a> attr=win_task-&gt;border_attr&lt;&lt;8;
<a name="l63"></a> </span><span class=cF1>while</span><span class=cF0> (i-- &amp;&amp; y&gt;0) {
<a name="l64"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,-1,--y,attr+ch&amp;0xFF);
<a name="l65"></a> ch&gt;&gt;=8;
<a name="l66"></a> }
<a name="l67"></a> y--;
<a name="l68"></a> tmpl=tmpl-&gt;parent_doc;
<a name="l69"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l70"></a> </span><span class=cF5>WinScrollRestore</span><span class=cF0>(win_task,&amp;saved_scroll);
<a name="l71"></a>}
<a name="l72"></a>
<a name="l73"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocTop</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l74"></a>{</span><span class=cF2>//Move cursor, cur_entry, to top.</span><span class=cF0>
<a name="l75"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l77"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l78"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l79"></a> doc-&gt;cur_entry=doc-&gt;head.next;
<a name="l80"></a> doc-&gt;cur_col=doc-&gt;cur_entry-&gt;min_col;
<a name="l81"></a> doc-&gt;x=0;
<a name="l82"></a> doc-&gt;y=0;
<a name="l83"></a> doc-&gt;line_start_col=0;
<a name="l84"></a> doc-&gt;top_line_num=0;
<a name="l85"></a>
<a name="l86"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
<a name="l87"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l89"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l90"></a>}
<a name="l91"></a>
<a name="l92"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocCenter</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> recalc_flags=</span><span class=cF3>RECALCt_NORMAL</span><span class=cF0>)
<a name="l93"></a>{</span><span class=cF2>//Center win on doc cursor, cur_entry.</span><span class=cF0>
<a name="l94"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l95"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
<a name="l96"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l97"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l98"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l99"></a> task=doc-&gt;win_task;
<a name="l100"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc,recalc_flags);
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc-&gt;flags&amp;</span><span class=cF3>DOCF_BORDER_DOC</span><span class=cF7>)</span><span class=cF0>)
<a name="l102"></a> doc-&gt;top_line_num=doc-&gt;y-(task-&gt;win_height+1)&gt;&gt;1;
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l104"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l105"></a>}
<a name="l106"></a>
<a name="l107"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocBottom</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l108"></a>{</span><span class=cF2>//Move cursor, cur_entry, to bottom.</span><span class=cF0>
<a name="l109"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l111"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l112"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l113"></a> doc-&gt;cur_entry=doc;
<a name="l114"></a> doc-&gt;cur_col=0;
<a name="l115"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l116"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l117"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l118"></a>}
<a name="l119"></a>
<a name="l120"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocClear</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>Bool</span><span class=cF0> clear_holds=</span><span class=cF3>FALSE</span><span class=cF0>)
<a name="l121"></a>{</span><span class=cF2>//Clear all doc entries, except +H, hold entries.</span><span class=cF0>
<a name="l122"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l124"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l125"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l126"></a> </span><span class=cF5>DocBottom</span><span class=cF0>(doc);
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (clear_holds)
<a name="l128"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$CL+H$&quot;</span><span class=cF0>);
<a name="l129"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l130"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$CL$&quot;</span><span class=cF0>);
<a name="l131"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l132"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l133"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l134"></a>}
<a name="l135"></a>
<a name="l136"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocCursor</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> show=</span><span class=cF3>OFF</span><span class=cF0>,</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l137"></a>{</span><span class=cF2>//Show or hide cursor.</span><span class=cF0>
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l139"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l140"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqu</span><span class=cF0>(&amp;doc-&gt;flags,</span><span class=cF3>DOCf_HIDE_CURSOR</span><span class=cF0>,!show);
<a name="l141"></a>}
<a name="l142"></a>
<a name="l143"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocHighlightCursor</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> show=</span><span class=cF3>OFF</span><span class=cF0>,</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l144"></a>{</span><span class=cF2>//Highlight or Don't highlight cursor.</span><span class=cF0>
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l146"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l147"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqu</span><span class=cF0>(&amp;doc-&gt;flags,</span><span class=cF3>DOCf_DONT_HIGHLIGHT_CURSOR</span><span class=cF0>,!show);
<a name="l148"></a>}
<a name="l149"></a>
<a name="l150"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocScroll</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> val=</span><span class=cF3>OFF</span><span class=cF0>,</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l151"></a>{</span><span class=cF2>//Turn scroll bars OFF/ON.</span><span class=cF0>
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l153"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l154"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqu</span><span class=cF0>(&amp;doc-&gt;flags,</span><span class=cF3>DOCf_NO_SCROLL_BARS</span><span class=cF0>,!val);
<a name="l155"></a>}
<a name="l156"></a>
<a name="l157"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocCollapse</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> collapse=</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l158"></a>{</span><span class=cF2>//Collapse or uncollapse all tree widgets.</span><span class=cF0>
<a name="l159"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l160"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l161"></a> </span><span class=cF1>if</span><span class=cF0> (!doc &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
<a name="l162"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l163"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l164"></a> doc_e=doc-&gt;head.next;
<a name="l165"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l166"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags&amp;</span><span class=cF3>DOCEF_TREE</span><span class=cF0>)
<a name="l167"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&amp;doc_e-&gt;de_flags,</span><span class=cF3>DOCEf_CHECKED_COLLAPSED</span><span class=cF0>,collapse);
<a name="l168"></a> doc_e=doc_e-&gt;next;
<a name="l169"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l170"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l171"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l172"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l173"></a>}
<a name="l174"></a>
<a name="l175"></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="l176"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DocMax</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> i=</span><span class=cF3>I64_MAX</span><span class=cF0>)
<a name="l177"></a>{</span><span class=cF2>//Set max document entries. (Cmd line buffer size.)</span><span class=cF0>
<a name="l178"></a></span><span class=cF2>//Adjusts the size of the cmd line buf.</span><span class=cF0>
<a name="l179"></a> </span><span class=cF2>//Normally, the cmd line deletes entries</span><span class=cF0>
<a name="l180"></a> </span><span class=cF2>//when more are added and the old scroll up.</span><span class=cF0>
<a name="l181"></a> </span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocTerm.HC.HTML#l43"><span class=cF4>max_entries</span></a><span class=cF2>.</span><span class=cF0>
<a name="l182"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l183"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l184"></a> </span><span class=cF1>if</span><span class=cF0> (doc=</span><span class=cF5>DocPut</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l185"></a> res=doc-&gt;max_entries;
<a name="l186"></a> doc-&gt;max_entries=i;
<a name="l187"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l188"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l189"></a> </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l190"></a>}
<a name="l191"></a>
<a name="l192"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc/Task;StdOut/Task&quot;</span><span class=cF0>
<a name="l193"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocUpdateTaskDocs</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task)
<a name="l194"></a>{</span><span class=cF2>//This is called from </span><a href="/Wb/Adam/Gr/GrScrn.HC.HTML#l18"><span class=cF4>GrUpdateTaskWin</span></a><span class=cF2>() by the winmgr at 30fps.</span><span class=cF0>
<a name="l195"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l196"></a> </span><span class=cF9>CD3I64</span><span class=cF0> saved_scroll;
<a name="l197"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;border_src==</span><span class=cF3>BDS_CUR_DRV</span><span class=cF0> &amp;&amp; task-&gt;cur_dv)
<a name="l198"></a> task-&gt;border_attr=</span><span class=cF5>DrvTextAttrGet</span><span class=cF0>(</span><span class=cF5>Drv2Let</span><span class=cF7>(</span><span class=cF0>task-&gt;cur_dv</span><span class=cF7>)</span><span class=cF0>);
<a name="l199"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;title_src==</span><span class=cF3>TTS_TASK_NAME</span><span class=cF0>)
<a name="l200"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(task-&gt;task_title,task-&gt;task_name);
<a name="l201"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocDisplay</span><span class=cF0>(task)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc-&gt;flags&amp;</span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l202"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;border_src==</span><span class=cF3>BDS_ED_FILENAME_DRV</span><span class=cF0>)
<a name="l203"></a> task-&gt;border_attr=</span><span class=cF5>DrvTextAttrGet</span><span class=cF0>(*doc-&gt;filename.name);
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;title_src==</span><span class=cF3>TTS_ED_FILENAME</span><span class=cF0>)
<a name="l205"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(task-&gt;task_title,doc-&gt;filename.name,</span><span class=cF3>STR_LEN</span><span class=cF0>-1);
<a name="l206"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc,</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>|</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>);
<a name="l207"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc=</span><span class=cF5>DocBorder</span><span class=cF0>(task)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>doc-&gt;flags&amp;</span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l209"></a> </span><span class=cF5>WinScrollNull</span><span class=cF0>(task,&amp;saved_scroll);
<a name="l210"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc,</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>);
<a name="l211"></a> </span><span class=cF5>WinScrollRestore</span><span class=cF0>(task,&amp;saved_scroll);
<a name="l212"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l213"></a>}
</span></pre></body>
</html>