mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
275 lines
29 KiB
HTML
Executable file
275 lines
29 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.06">
|
|
<style type="text/css">
|
|
body {background-color:#1f1f1f;}
|
|
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
|
|
.cF1{color:#4f84a6;background-color:#1f1f1f;}
|
|
.cF2{color:#73a255;background-color:#1f1f1f;}
|
|
.cF3{color:#297582;background-color:#1f1f1f;}
|
|
.cF4{color:#b34f4b;background-color:#1f1f1f;}
|
|
.cF5{color:#8a52c3;background-color:#1f1f1f;}
|
|
.cF6{color:#b7822f;background-color:#1f1f1f;}
|
|
.cF7{color:#444444;background-color:#1f1f1f;}
|
|
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
|
|
.cF9{color:#94bfde;background-color:#1f1f1f;}
|
|
.cFA{color:#a1ce97;background-color:#1f1f1f;}
|
|
.cFB{color:#6db4be;background-color:#1f1f1f;}
|
|
.cFC{color:#e88e88;background-color:#1f1f1f;}
|
|
.cFD{color:#ca94e8;background-color:#1f1f1f;}
|
|
.cFE{color:#d4b475;background-color:#1f1f1f;}
|
|
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
|
|
</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>"DolDoc"</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->x - x</span><span class=cF7>)</span><span class=cF0> + </span><span class=cF5>SqrI64</span><span class=cF7>(</span><span class=cF0>doc->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->head.next, *doc_e2;
|
|
<a name="l12"></a>
|
|
<a name="l13"></a> </span><span class=cF1>while</span><span class=cF0> (num-- > </span><span class=cFE>0</span><span class=cF0> && doc_e != doc)
|
|
<a name="l14"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l15"></a> doc_e2 = doc_e->next;
|
|
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags & (</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="l17"></a> {
|
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e == doc->cur_entry)
|
|
<a name="l19"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l20"></a> doc->cur_entry = doc_e2;
|
|
<a name="l21"></a> doc->cur_col = doc_e2->min_col;
|
|
<a name="l22"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l23"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc, doc_e);
|
|
<a name="l24"></a> }
|
|
<a name="l25"></a> doc_e = doc_e2;
|
|
<a name="l26"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l27"></a>}
|
|
<a name="l28"></a>
|
|
<a name="l29"></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="l30"></a>{
|
|
<a name="l31"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e = doc->head.next, *doc_e2;
|
|
<a name="l32"></a>
|
|
<a name="l33"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
|
|
<a name="l34"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l35"></a> doc_e2 = doc_e->next;
|
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags & (</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="l37"></a> {
|
|
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e == doc->cur_entry)
|
|
<a name="l39"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l40"></a> doc->cur_entry = doc_e2;
|
|
<a name="l41"></a> doc->cur_col = doc_e2->min_col;
|
|
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l43"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc, doc_e);
|
|
<a name="l44"></a> }
|
|
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e == clear_entry)
|
|
<a name="l46"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l47"></a> doc_e = doc_e2;
|
|
<a name="l48"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l49"></a>}
|
|
<a name="l50"></a>
|
|
<a name="l51"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocBorderListDraw</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
|
<a name="l52"></a>{
|
|
<a name="l53"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task = doc->win_task;
|
|
<a name="l54"></a> </span><span class=cF9>I64</span><span class=cF0> i, y = -</span><span class=cFE>1</span><span class=cF0>, attr = win_task->border_attr << </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l55"></a> </span><span class=cF9>U64</span><span class=cF0> ch;
|
|
<a name="l56"></a> </span><span class=cF9>CDoc</span><span class=cF0> *tmpl = doc;
|
|
<a name="l57"></a> </span><span class=cF9>CD3I64</span><span class=cF0> saved_scroll;
|
|
<a name="l58"></a>
|
|
<a name="l59"></a> </span><span class=cF1>while</span><span class=cF0> (tmpl && tmpl->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l60"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l61"></a> y += (</span><span class=cF5>Bsr</span><span class=cF7>(</span><span class=cF0>tmpl->desc</span><span class=cF7>)</span><span class=cF0> + </span><span class=cFE>7</span><span class=cF0>) >> </span><span class=cFE>3</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>; </span><span class=cF2>//StrLen+1</span><span class=cF0>
|
|
<a name="l62"></a> tmpl = tmpl->parent_doc;
|
|
<a name="l63"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l64"></a> tmpl = doc;
|
|
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (y > win_task->win_height)
|
|
<a name="l66"></a> y = win_task->win_height;
|
|
<a name="l67"></a> </span><span class=cF5>WinScrollNull</span><span class=cF0>(win_task, &saved_scroll);
|
|
<a name="l68"></a> </span><span class=cF1>while</span><span class=cF0> (tmpl && tmpl->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l69"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l70"></a> ch = tmpl->desc;
|
|
<a name="l71"></a> i = (</span><span class=cF5>Bsr</span><span class=cF7>(</span><span class=cF0>ch</span><span class=cF7>)</span><span class=cF0> + </span><span class=cFE>7</span><span class=cF0>) >> </span><span class=cFE>3</span><span class=cF0>; </span><span class=cF2>//StrLen</span><span class=cF0>
|
|
<a name="l72"></a> ch = </span><span class=cF5>EndianU64</span><span class=cF0>(ch << </span><span class=cF7>(</span><span class=cF0>(</span><span class=cFE>8</span><span class=cF0> - i) << </span><span class=cFE>3</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l73"></a> attr = win_task->border_attr << </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l74"></a> </span><span class=cF1>while</span><span class=cF0> (i-- && y > </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l75"></a> {
|
|
<a name="l76"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>TextChar(win_task, TRUE, -1, --y, attr + ch & 0xFF);</span><span class=cF0>
|
|
<a name="l77"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task, </span><span class=cF3>TRUE</span><span class=cF0>, -</span><span class=cFE>1</span><span class=cF0>, --y, </span><span class=cF7>(</span><span class=cF0>attr >> </span><span class=cFE>8</span><span class=cF0> & </span><span class=cFE>0xF</span><span class=cF7>)</span><span class=cF0> << </span><span class=cFE>12</span><span class=cF0> + </span><span class=cF7>(</span><span class=cF0>attr >> </span><span class=cFE>12</span><span class=cF0> & </span><span class=cFE>0xF</span><span class=cF7>)</span><span class=cF0> << </span><span class=cFE>8</span><span class=cF0> + ch & </span><span class=cFE>0xFF</span><span class=cF0>);
|
|
<a name="l78"></a> ch >>= </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l79"></a> }
|
|
<a name="l80"></a> y--;
|
|
<a name="l81"></a> tmpl = tmpl->parent_doc;
|
|
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l83"></a> </span><span class=cF5>WinScrollRestore</span><span class=cF0>(win_task, &saved_scroll);
|
|
<a name="l84"></a>}
|
|
<a name="l85"></a>
|
|
<a name="l86"></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="l87"></a>{</span><span class=cF2>//Move cursor, cur_entry, to top.</span><span class=cF0>
|
|
<a name="l88"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l89"></a>
|
|
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l91"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l92"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l93"></a> doc->cur_entry = doc->head.next;
|
|
<a name="l94"></a> doc->cur_col = doc->cur_entry->min_col;
|
|
<a name="l95"></a> doc->x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l96"></a> doc->y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l97"></a> doc->line_start_col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l98"></a> doc->top_line_num = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l99"></a>
|
|
<a name="l100"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
|
|
<a name="l101"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
|
<a name="l102"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l103"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l104"></a>}
|
|
<a name="l105"></a>
|
|
<a name="l106"></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="l107"></a>{</span><span class=cF2>//Center win on doc cursor, cur_entry.</span><span class=cF0>
|
|
<a name="l108"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l109"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
|
|
<a name="l110"></a>
|
|
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l112"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l113"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l114"></a> task = doc->win_task;
|
|
<a name="l115"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc, recalc_flags);
|
|
<a name="l116"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc->flags & </span><span class=cF3>DOCF_BORDER_DOC</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l117"></a> doc->top_line_num = doc->y - (task->win_height + </span><span class=cFE>1</span><span class=cF0>) >> </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l118"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l119"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l120"></a>}
|
|
<a name="l121"></a>
|
|
<a name="l122"></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="l123"></a>{</span><span class=cF2>//Move cursor, cur_entry, to bottom.</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l125"></a>
|
|
<a name="l126"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l127"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l128"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l129"></a> doc->cur_entry = doc;
|
|
<a name="l130"></a> doc->cur_col = </span><span class=cFE>0</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>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="l137"></a>{</span><span class=cF2>//Clear all doc entries, except +H, hold entries.</span><span class=cF0>
|
|
<a name="l138"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l139"></a>
|
|
<a name="l140"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l141"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
|
|
<a name="l143"></a> {
|
|
<a name="l144"></a> </span><span class=cFB>text</span><span class=cF0>.raw_col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l145"></a> </span><span class=cF5>MemSet</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.fb_alias, </span><span class=cF3>BLACK32</span><span class=cF0>, </span><span class=cFB>text</span><span class=cF0>.buffer_size);
|
|
<a name="l146"></a> }
|
|
<a name="l147"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l148"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l149"></a>
|
|
<a name="l150"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l151"></a> </span><span class=cF5>DocBottom</span><span class=cF0>(doc);
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (clear_holds)
|
|
<a name="l153"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$CL+H$"</span><span class=cF0>);
|
|
<a name="l154"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l155"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$CL$"</span><span class=cF0>);
|
|
<a name="l156"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
|
<a name="l157"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l158"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l159"></a>}
|
|
<a name="l160"></a>
|
|
<a name="l161"></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="l162"></a>{</span><span class=cF2>//Show or hide cursor.</span><span class=cF0>
|
|
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l164"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l165"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqual</span><span class=cF0>(&doc->flags, </span><span class=cF3>DOCf_HIDE_CURSOR</span><span class=cF0>, !show);
|
|
<a name="l166"></a>}
|
|
<a name="l167"></a>
|
|
<a name="l168"></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="l169"></a>{</span><span class=cF2>//Highlight or Don't highlight cursor.</span><span class=cF0>
|
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l171"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l172"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqual</span><span class=cF0>(&doc->flags, </span><span class=cF3>DOCf_DONT_HIGHLIGHT_CURSOR</span><span class=cF0>, !show);
|
|
<a name="l173"></a>}
|
|
<a name="l174"></a>
|
|
<a name="l175"></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="l176"></a>{</span><span class=cF2>//Turn scroll bars OFF/ON.</span><span class=cF0>
|
|
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l178"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l179"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqual</span><span class=cF0>(&doc->flags, </span><span class=cF3>DOCf_NO_SCROLL_BARS</span><span class=cF0>, !val);
|
|
<a name="l180"></a>}
|
|
<a name="l181"></a>
|
|
<a name="l182"></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="l183"></a>{</span><span class=cF2>//Collapse or uncollapse all tree widgets.</span><span class=cF0>
|
|
<a name="l184"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
|
<a name="l185"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l186"></a>
|
|
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (!doc && !</span><span class=cF7>(</span><span class=cF0>doc = </span><span class=cF5>DocPut</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l188"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l189"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l190"></a> doc_e = doc->head.next;
|
|
<a name="l191"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != doc)
|
|
<a name="l192"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l193"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF0>)
|
|
<a name="l194"></a> </span><span class=cF5>BEqual</span><span class=cF0>(&doc_e->de_flags, </span><span class=cF3>DOCEf_CHECKED_COLLAPSED</span><span class=cF0>, collapse);
|
|
<a name="l195"></a> doc_e = doc_e->next;
|
|
<a name="l196"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l197"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
|
<a name="l198"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l199"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l200"></a>}
|
|
<a name="l201"></a>
|
|
<a name="l202"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"DolDoc/Cmd Line (Typically);Cmd Line (Typically)"</span><span class=cF0>
|
|
<a name="l203"></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="l204"></a>{</span><span class=cF2>//Set max document entries. (Cmd line buffer size.)</span><span class=cF0>
|
|
<a name="l205"></a></span><span class=cF2>//Adjusts the size of the cmd line buf.</span><span class=cF0>
|
|
<a name="l206"></a> </span><span class=cF2>//Normally, the cmd line deletes entries</span><span class=cF0>
|
|
<a name="l207"></a> </span><span class=cF2>//when more are added and the old scroll up.</span><span class=cF0>
|
|
<a name="l208"></a> </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocTerm.CC.html#l47"><span class=cF4>max_entries</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l209"></a> </span><span class=cF9>I64</span><span class=cF0> res;
|
|
<a name="l210"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
|
<a name="l211"></a>
|
|
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (doc = </span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l213"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l214"></a> res = doc->max_entries;
|
|
<a name="l215"></a> doc->max_entries = i;
|
|
<a name="l216"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l217"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l218"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l219"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l220"></a>}
|
|
<a name="l221"></a>
|
|
<a name="l222"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"DolDoc/Task;StdOut/Task"</span><span class=cF0>
|
|
<a name="l223"></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="l224"></a>{</span><span class=cF2>//This is called from </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/GrScreen.CC.html#l19"><span class=cF4>GrUpdateTaskWin</span></a><span class=cF2>() by the winmgr at 60fps.</span><span class=cF0>
|
|
<a name="l225"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
|
<a name="l226"></a> </span><span class=cF9>CD3I64</span><span class=cF0> saved_scroll;
|
|
<a name="l227"></a>
|
|
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (task->border_src == </span><span class=cF3>BDS_CUR_DRIVE</span><span class=cF0> && task->cur_dv)
|
|
<a name="l229"></a> task->border_attr = </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(</span><span class=cF5>Drive2Letter</span><span class=cF7>(</span><span class=cF0>task->cur_dv</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l230"></a> </span><span class=cF1>if</span><span class=cF0> (task->title_src == </span><span class=cF3>TTS_TASK_NAME</span><span class=cF0>)
|
|
<a name="l231"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(task->task_title, task->task_name);
|
|
<a name="l232"></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> && !</span><span class=cF7>(</span><span class=cF0>doc->flags & </span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l233"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l234"></a> </span><span class=cF1>if</span><span class=cF0> (task->border_src == </span><span class=cF3>BDS_ED_FILENAME_DRIVE</span><span class=cF0>)
|
|
<a name="l235"></a> task->border_attr = </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(*doc->filename.name);
|
|
<a name="l236"></a> </span><span class=cF1>if</span><span class=cF0> (task->title_src == </span><span class=cF3>TTS_ED_FILENAME</span><span class=cF0>)
|
|
<a name="l237"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(task->task_title, doc->filename.name, </span><span class=cF3>STR_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l238"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc, </span><span class=cF3>RECALCt_TO_SCREEN</span><span class=cF0> | </span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>);
|
|
<a name="l239"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l240"></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> && !</span><span class=cF7>(</span><span class=cF0>doc->flags & </span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l241"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l242"></a> </span><span class=cF5>WinScrollNull</span><span class=cF0>(task, &saved_scroll);
|
|
<a name="l243"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc, </span><span class=cF3>RECALCt_TO_SCREEN</span><span class=cF0>);
|
|
<a name="l244"></a> </span><span class=cF5>WinScrollRestore</span><span class=cF0>(task, &saved_scroll);
|
|
<a name="l245"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l246"></a>}
|
|
</span></pre></body>
|
|
</html>
|