1356 lines
139 KiB
Plaintext
1356 lines
139 KiB
Plaintext
|
<!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>"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>DocWordWrapDel</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,
|
||
|
<a name="l4"></a> </span><span class=cF1>Bool</span><span class=cF0> full_refresh,</span><span class=cF1>Bool</span><span class=cF0> same_win,</span><span class=cF9>I64</span><span class=cF0> left_margin,</span><span class=cF9>I64</span><span class=cF0> right_margin,
|
||
|
<a name="l5"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> **_best_doc_e,</span><span class=cF9>I64</span><span class=cF0> *_best_col)
|
||
|
<a name="l6"></a>{
|
||
|
<a name="l7"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e2;
|
||
|
<a name="l8"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr;
|
||
|
<a name="l9"></a> </span><span class=cF9>I64</span><span class=cF0> j,k;
|
||
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_TAG</span><span class=cF0> && doc_e->tag)
|
||
|
<a name="l11"></a> k=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l12"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l13"></a> k=0;
|
||
|
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh)
|
||
|
<a name="l15"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l16"></a> doc_e2=doc_e->next;
|
||
|
<a name="l17"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> && !same_win) {
|
||
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l19"></a> doc->cur_entry=doc_e2->next;
|
||
|
<a name="l20"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l21"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (*_best_doc_e==doc_e2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l23"></a> *_best_doc_e=doc_e2->next;
|
||
|
<a name="l24"></a> *_best_col=0;
|
||
|
<a name="l25"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l26"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_e2);
|
||
|
<a name="l27"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_e</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l28"></a> doc_e->de_flags==doc_e2->de_flags && doc_e->type==doc_e2->type) {
|
||
|
<a name="l29"></a> j=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e2->tag);
|
||
|
<a name="l30"></a> ptr=</span><span class=cF5>MAlloc</span><span class=cF0>(k+j+1,doc->mem_task);
|
||
|
<a name="l31"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(ptr,doc_e->tag,k);
|
||
|
<a name="l32"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(ptr+k,doc_e2->tag,j+1);
|
||
|
<a name="l33"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l34"></a> doc_e->tag=ptr;
|
||
|
<a name="l35"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l36"></a> doc->cur_entry=doc_e;
|
||
|
<a name="l37"></a> doc->cur_col+=k;
|
||
|
<a name="l38"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (*_best_doc_e==doc_e2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l40"></a> *_best_doc_e=doc_e;
|
||
|
<a name="l41"></a> *_best_col=0;
|
||
|
<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_e2);
|
||
|
<a name="l44"></a> k+=j;
|
||
|
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (k></span><span class=cF7>(</span><span class=cF0>right_margin-left_margin+1</span><span class=cF7>)</span><span class=cF0><<1)
|
||
|
<a name="l46"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l47"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l48"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l50"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_SCROLLING_X</span><span class=cF0>)
|
||
|
<a name="l51"></a> k=doc_e->scroll_len;
|
||
|
<a name="l52"></a> </span><span class=cF1>return</span><span class=cF0> k;
|
||
|
<a name="l53"></a>}
|
||
|
<a name="l54"></a>
|
||
|
<a name="l55"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocRecalcXY</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,
|
||
|
<a name="l56"></a> </span><span class=cF9>I64</span><span class=cF0> k,</span><span class=cF9>I64</span><span class=cF0> left,</span><span class=cF9>I64</span><span class=cF0> width,</span><span class=cF9>I64</span><span class=cF0> height,</span><span class=cF9>I64</span><span class=cF0> left_margin,</span><span class=cF9>I64</span><span class=cF0> right_margin,
|
||
|
<a name="l57"></a> </span><span class=cF9>I64</span><span class=cF0> x0,</span><span class=cF9>I64</span><span class=cF0> y0,</span><span class=cF9>I64</span><span class=cF0> *_x,</span><span class=cF9>I64</span><span class=cF0> *_y)
|
||
|
<a name="l58"></a>{
|
||
|
<a name="l59"></a> </span><span class=cF9>I64</span><span class=cF0> i,x=*_x,y=*_y;
|
||
|
<a name="l60"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_MARGIN_REL_X</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LEFT_X</span><span class=cF0>)
|
||
|
<a name="l62"></a> x=left_margin-left;
|
||
|
<a name="l63"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_RIGHT_X</span><span class=cF0>)
|
||
|
<a name="l64"></a> x=right_margin-(k-1)-left;
|
||
|
<a name="l65"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CENTER_X</span><span class=cF0>)
|
||
|
<a name="l66"></a> x=(right_margin+left_margin)>>1-k>>1-left;
|
||
|
<a name="l67"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LEFT_X</span><span class=cF0>)
|
||
|
<a name="l69"></a> x=x0;
|
||
|
<a name="l70"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_RIGHT_X</span><span class=cF0>)
|
||
|
<a name="l71"></a> x=width+x0-k;
|
||
|
<a name="l72"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CENTER_X</span><span class=cF0>)
|
||
|
<a name="l73"></a> x=(width+x0-k)>>1;
|
||
|
<a name="l74"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l75"></a> i=y;
|
||
|
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_PAGE_REL_Y</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l77"></a> doc->flags|=</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF0>;
|
||
|
<a name="l78"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TOP_Y</span><span class=cF0>)
|
||
|
<a name="l79"></a> y-=doc_e->page_line_num;
|
||
|
<a name="l80"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BOTTOM_Y</span><span class=cF0>)
|
||
|
<a name="l81"></a> y+=doc_e->settings.page_len-doc_e->page_line_num;
|
||
|
<a name="l82"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CENTER_Y</span><span class=cF0>)
|
||
|
<a name="l83"></a> y+=doc_e->settings.page_len>>1-doc_e->page_line_num;
|
||
|
<a name="l84"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l85"></a> doc->flags|=</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF0>;
|
||
|
<a name="l86"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TOP_Y</span><span class=cF0>)
|
||
|
<a name="l87"></a> y=y0;
|
||
|
<a name="l88"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BOTTOM_Y</span><span class=cF0>)
|
||
|
<a name="l89"></a> y=height-1+y0;
|
||
|
<a name="l90"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CENTER_Y</span><span class=cF0>)
|
||
|
<a name="l91"></a> y=height>>1+y0;
|
||
|
<a name="l92"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (y!=i) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l94"></a> doc->page_line_num+=y-i;
|
||
|
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num<0)
|
||
|
<a name="l96"></a> doc->page_line_num=doc_e->settings.page_len+
|
||
|
<a name="l97"></a> doc->page_line_num%doc_e->settings.page_len;
|
||
|
<a name="l98"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l99"></a> doc->page_line_num=doc->page_line_num%doc_e->settings.page_len;
|
||
|
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->settings.header!=</span><span class=cF3>DOC_DFT</span><span class=cF0> &&
|
||
|
<a name="l101"></a> doc->page_line_num<doc_e->settings.header) {
|
||
|
<a name="l102"></a> y+=doc_e->settings.header-doc->page_line_num;
|
||
|
<a name="l103"></a> doc->page_line_num=doc_e->settings.header;
|
||
|
<a name="l104"></a> }
|
||
|
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->settings.footer==</span><span class=cF3>DOC_DFT</span><span class=cF0>) {
|
||
|
<a name="l106"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=doc_e->settings.page_len) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->settings.header==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l108"></a> doc->page_line_num=0;
|
||
|
<a name="l109"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l110"></a> doc->page_line_num=doc_e->settings.header;
|
||
|
<a name="l111"></a> y+=doc_e->settings.header;
|
||
|
<a name="l112"></a> }
|
||
|
<a name="l113"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l114"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l115"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=
|
||
|
<a name="l116"></a> doc_e->settings.page_len-doc_e->settings.footer) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l117"></a> y+=doc_e->settings.footer;
|
||
|
<a name="l118"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->settings.header==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l119"></a> doc->page_line_num=0;
|
||
|
<a name="l120"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l121"></a> doc->page_line_num=doc_e->settings.header;
|
||
|
<a name="l122"></a> y+=doc_e->settings.header;
|
||
|
<a name="l123"></a> }
|
||
|
<a name="l124"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l125"></a> }
|
||
|
<a name="l126"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l127"></a> *_x=x;
|
||
|
<a name="l128"></a> *_y=y;
|
||
|
<a name="l129"></a>}
|
||
|
<a name="l130"></a>
|
||
|
<a name="l131"></a></span><span class=cF9>CDocEntry</span><span class=cF0> *</span><span class=cF5>DocSplitTag</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,</span><span class=cF9>I64</span><span class=cF0> i,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y,</span><span class=cF9>I64</span><span class=cF0> type_u8)
|
||
|
<a name="l132"></a>{</span><span class=cF2>//Split tag at i, insert DOCT_SOFT_NEW_LINE, DOCT_MARKER or DOCT_CURSOR</span><span class=cF0>
|
||
|
<a name="l133"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr;
|
||
|
<a name="l134"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e2;
|
||
|
<a name="l135"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && i) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l136"></a> </span><span class=cF1>if</span><span class=cF0> (i<</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l137"></a> doc_e2=</span><span class=cF5>MAllocIdent</span><span class=cF0>(doc_e,doc->mem_task);
|
||
|
<a name="l138"></a> doc_e2->tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->tag+i,doc->mem_task);
|
||
|
<a name="l139"></a> doc_e2->de_flags=doc_e->de_flags&~</span><span class=cF3>DOCEG_HAS_ALLOC</span><span class=cF0>|</span><span class=cF3>DOCEF_TAG</span><span class=cF0>;
|
||
|
<a name="l140"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_e2,doc_e);
|
||
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e && doc->cur_col>=i) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l142"></a> doc->cur_entry=doc_e2;
|
||
|
<a name="l143"></a> doc->cur_col=doc->cur_col-i;
|
||
|
<a name="l144"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l145"></a> doc_e->tag[i]=0;
|
||
|
<a name="l146"></a> ptr=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->tag,doc->mem_task);
|
||
|
<a name="l147"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l148"></a> doc_e->tag=ptr;
|
||
|
<a name="l149"></a> }
|
||
|
<a name="l150"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l151"></a> doc_e=doc_e->last;
|
||
|
<a name="l152"></a> doc_e2=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,type_u8|doc_e->type & 0xFFFFFF00,
|
||
|
<a name="l153"></a> doc_e->de_flags&~</span><span class=cF3>DOCEG_HAS_ARG</span><span class=cF0>,x,y,doc_e->page_line_num);
|
||
|
<a name="l154"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e2->settings,&doc_e->settings,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l155"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_e2,doc_e);
|
||
|
<a name="l156"></a> </span><span class=cF1>return</span><span class=cF0> doc_e2;
|
||
|
<a name="l157"></a>}
|
||
|
<a name="l158"></a>
|
||
|
<a name="l159"></a></span><span class=cF9>CDocEntry</span><span class=cF0> *</span><span class=cF5>DocWordWrapAdd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,
|
||
|
<a name="l160"></a> </span><span class=cF9>I64</span><span class=cF0> *_k,</span><span class=cF9>I64</span><span class=cF0> left,</span><span class=cF9>I64</span><span class=cF0> right_margin,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y)
|
||
|
<a name="l161"></a>{
|
||
|
<a name="l162"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e2;
|
||
|
<a name="l163"></a> </span><span class=cF9>I64</span><span class=cF0> j,i=right_margin+1-(x+left), </span><span class=cF2>//Space left on line</span><span class=cF0>
|
||
|
<a name="l164"></a> ii=x+1-doc_e->settings.left_margin;
|
||
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l166"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e->next) {
|
||
|
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col==doc_e->next->min_col)
|
||
|
<a name="l168"></a> i--;
|
||
|
<a name="l169"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e && doc->cur_col==i)
|
||
|
<a name="l171"></a> i--;
|
||
|
<a name="l172"></a> }
|
||
|
<a name="l173"></a> </span><span class=cF1>if</span><span class=cF0> (*_k>i) {
|
||
|
<a name="l174"></a> </span><span class=cF1>for</span><span class=cF0> (j=i;j>8-ii && j>=0;j--)
|
||
|
<a name="l175"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->tag[j]==</span><span class=cF3>CH_SPACE</span><span class=cF0> || doc_e->tag[j]==</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l176"></a> i=j+1;
|
||
|
<a name="l177"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l178"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l179"></a> </span><span class=cF1>if</span><span class=cF0> (0<i<*_k) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l180"></a> </span><span class=cF5>DocSplitTag</span><span class=cF0>(doc,doc_e,i,x,y,</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>);
|
||
|
<a name="l181"></a> *_k=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l182"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l183"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l184"></a> }
|
||
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (*_k==i)
|
||
|
<a name="l186"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l187"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (*_k>=i) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l189"></a> doc_e2=doc_e->last;
|
||
|
<a name="l190"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->type_u8!=</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> &&
|
||
|
<a name="l191"></a> doc_e2->type_u8!=</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0> &&
|
||
|
<a name="l192"></a> doc_e2->type_u8!=</span><span class=cF3>DOCT_CURSOR_MOVEMENT</span><span class=cF0>) {
|
||
|
<a name="l193"></a> doc_e2=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>|doc_e->type&0xFFFFFF00,
|
||
|
<a name="l194"></a> </span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|doc_e->de_flags&</span><span class=cF7>(</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>|</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|
|
||
|
<a name="l195"></a> </span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>,x,y,doc_e->last->page_line_num);
|
||
|
<a name="l196"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e2->settings,&doc_e->settings,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l197"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_e2,doc_e->last);
|
||
|
<a name="l198"></a> </span><span class=cF1>return</span><span class=cF0> doc_e2;
|
||
|
<a name="l199"></a> }
|
||
|
<a name="l200"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l201"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l202"></a>}
|
||
|
<a name="l203"></a>
|
||
|
<a name="l204"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DocTmpAttr</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,</span><span class=cF9>I64</span><span class=cF0> cur_u8_attr)
|
||
|
<a name="l205"></a>{
|
||
|
<a name="l206"></a> </span><span class=cF9>I64</span><span class=cF0> tmp_u32_attr;
|
||
|
<a name="l207"></a> doc_e->de_flags=doc->flags& (</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>) |
|
||
|
<a name="l208"></a> doc_e->de_flags&~(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>);
|
||
|
<a name="l209"></a> tmp_u32_attr=(cur_u8_attr&0xF0)<<8|
|
||
|
<a name="l210"></a> doc->flags&</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|(doc_e->settings.shifted_x&0x1F)<<16|
|
||
|
<a name="l211"></a> (doc_e->settings.shifted_y&0x1F)<<21;
|
||
|
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_HAS_BIN</span><span class=cF0> && *doc_e->tag==</span><span class=cF6>'<'</span><span class=cF0>)
|
||
|
<a name="l213"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_BIN</span><span class=cF0>;
|
||
|
<a name="l214"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l215"></a> </span><span class=cF1>switch</span><span class=cF0> (doc_e->type_u8) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l216"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SPRITE</span><span class=cF0>:
|
||
|
<a name="l217"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LEFT_EXP</span><span class=cF0>)
|
||
|
<a name="l218"></a> tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||
|
<a name="l219"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LINK</span><span class=cF0>)
|
||
|
<a name="l220"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_LINK</span><span class=cF0>;
|
||
|
<a name="l221"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0>)
|
||
|
<a name="l222"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_MACRO</span><span class=cF0>;
|
||
|
<a name="l223"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_TREE</span><span class=cF0>|</span><span class=cF3>DOCEF_LST</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l224"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_TREE</span><span class=cF0>;
|
||
|
<a name="l225"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l226"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_BIN</span><span class=cF0>;
|
||
|
<a name="l227"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l228"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HTML_CODE</span><span class=cF0>:
|
||
|
<a name="l229"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_BIN</span><span class=cF0>;
|
||
|
<a name="l230"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l231"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LINK</span><span class=cF0>:
|
||
|
<a name="l232"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_LINK</span><span class=cF0>;
|
||
|
<a name="l233"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l234"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_MACRO</span><span class=cF0>:
|
||
|
<a name="l235"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_MACRO</span><span class=cF0>;
|
||
|
<a name="l236"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l237"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_ANCHOR</span><span class=cF0>:
|
||
|
<a name="l238"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_ANCHOR</span><span class=cF0>;
|
||
|
<a name="l239"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l240"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TREE</span><span class=cF0>:
|
||
|
<a name="l241"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LST</span><span class=cF0>:
|
||
|
<a name="l242"></a> tmp_u32_attr.u8[1]|=</span><span class=cF3>DOC_COLOR_TREE</span><span class=cF0>;
|
||
|
<a name="l243"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l244"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l245"></a> tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||
|
<a name="l246"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l247"></a> doc_e->type.u8[1]=tmp_u32_attr.u8[1];
|
||
|
<a name="l248"></a> tmp_u32_attr|=doc_e->type&0xFFFF0000;
|
||
|
<a name="l249"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc->cur_entry && !</span><span class=cF7>(</span><span class=cF0>doc->flags&</span><span class=cF3>DOCF_DONT_HIGHLIGHT_CURSOR</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l250"></a> doc_e->type_u8!=</span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
|
||
|
<a name="l251"></a> tmp_u32_attr^=0xFF00;
|
||
|
<a name="l252"></a> doc_e->settings.final_u32_attr=tmp_u32_attr;
|
||
|
<a name="l253"></a> </span><span class=cF1>return</span><span class=cF0> tmp_u32_attr;
|
||
|
<a name="l254"></a>}
|
||
|
<a name="l255"></a>
|
||
|
<a name="l256"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DocRecalc</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> recalc_flags=</span><span class=cF3>RECALCt_NORMAL</span><span class=cF0>)
|
||
|
<a name="l257"></a>{</span><span class=cF2>//Recalc and fmt. Also used by WinMgr to draw on scrn.</span><span class=cF0>
|
||
|
<a name="l258"></a> </span><span class=cF9>I64</span><span class=cF0> i,ii,j,k,x,x0,y,y0,</span><span class=cF5>D</span><span class=cF0>,d2,col,col2,best_col=0,best_d=</span><span class=cF3>I64_MAX</span><span class=cF0>,xx,yy,zz,
|
||
|
<a name="l259"></a> num_entries=0,i_jif,cur_u8_attr,tmp_u32_attr,
|
||
|
<a name="l260"></a> cursor_y=</span><span class=cF3>I64_MIN</span><span class=cF0>,left_margin,right_margin,y_plot_top,y_plot_bottom,
|
||
|
<a name="l261"></a> top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left;
|
||
|
<a name="l262"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *doc_e,</span><span class=cF1>reg</span><span class=cF0> *doc_e2,*best_doc_e,*next_clear_found=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l263"></a> *added_cursor=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l264"></a> </span><span class=cF9>CDocBin</span><span class=cF0> *tmpb;
|
||
|
<a name="l265"></a> </span><span class=cF9>CDocSettings</span><span class=cF0> *s;
|
||
|
<a name="l266"></a> </span><span class=cF1>Bool</span><span class=cF0> del_doc_e,skipped_update,tree_collapsed,same_win,more=</span><span class=cF3>FALSE</span><span class=cF0>,
|
||
|
<a name="l267"></a> find_cursor=</span><span class=cF3>FALSE</span><span class=cF0>,blink_flag,full_refresh=</span><span class=cF3>TRUE</span><span class=cF0>,unlock,clear_holds;
|
||
|
<a name="l268"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task,*mem_task;
|
||
|
<a name="l269"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc;
|
||
|
<a name="l270"></a> </span><span class=cF1>U8</span><span class=cF0> *bptr,*ptr,buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],ch;
|
||
|
<a name="l271"></a> </span><span class=cF9>U32</span><span class=cF0> *u32_ptr,*hl;
|
||
|
<a name="l272"></a> </span><span class=cF9>I32</span><span class=cF0> *depth_buf=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l273"></a> </span><span class=cF1>F64</span><span class=cF0> cur_time=</span><span class=cF5>tS</span><span class=cF0>;
|
||
|
<a name="l274"></a> </span><span class=cF9>CWinScroll</span><span class=cF0> *vss,*hss;
|
||
|
<a name="l275"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph;
|
||
|
<a name="l276"></a>
|
||
|
<a name="l277"></a> </span><span class=cF1>if</span><span class=cF0> (!doc || doc->doc_signature!=</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l278"></a>
|
||
|
<a name="l279"></a> </span><span class=cF2>//WinMgr updates all wins (30000.0/1001), 33.33333mS</span><span class=cF0>
|
||
|
<a name="l280"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> && doc->owning_task!=</span><span class=cF5>Fs</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l281"></a> i_jif=</span><span class=cFB>cnts</span><span class=cF0>.jiffies+</span><span class=cF3>JIFFY_FREQ</span><span class=cF0>/250; </span><span class=cF2>//4 ms</span><span class=cF0>
|
||
|
<a name="l282"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&doc->locked_flags,</span><span class=cF3>DOClf_LOCKED</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l283"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>cnts</span><span class=cF0>.jiffies>=i_jif)
|
||
|
<a name="l284"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>; </span><span class=cF2>//Bail-out if doc locked.</span><span class=cF0>
|
||
|
<a name="l285"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l286"></a> }
|
||
|
<a name="l287"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l288"></a>
|
||
|
<a name="l289"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature!=</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l291"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l292"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l293"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l294"></a>
|
||
|
<a name="l295"></a> win_task=doc->win_task;
|
||
|
<a name="l296"></a> mem_task=doc->mem_task;
|
||
|
<a name="l297"></a> blink_flag=</span><span class=cF5>Blink</span><span class=cF0>;
|
||
|
<a name="l298"></a> dc=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l299"></a> </span><span class=cF1>switch</span><span class=cF0> [recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>] </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l300"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RECALCt_FIND_CURSOR</span><span class=cF0>:
|
||
|
<a name="l301"></a> find_cursor=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l302"></a> </span><span class=cF1>if</span><span class=cF0> (win_task)
|
||
|
<a name="l303"></a> dc=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,win_task); </span><span class=cF2>//Necessary for sprites</span><span class=cF0>
|
||
|
<a name="l304"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l305"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>:
|
||
|
<a name="l306"></a> </span><span class=cF1>if</span><span class=cF0> (doc->updates_cnt++%</span><span class=cF7>(</span><span class=cF5>ToI64</span><span class=cF0>(</span><span class=cFB>winmgr</span><span class=cF0>.fps/10)+1</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l307"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&doc->flags,</span><span class=cF3>DOCf_DO_FULL_REFRESH</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l308"></a> !</span><span class=cF7>(</span><span class=cF0>doc->flags&</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l309"></a> full_refresh=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l310"></a> </span><span class=cF1>if</span><span class=cF0> (win_task)
|
||
|
<a name="l311"></a> dc=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,win_task);
|
||
|
<a name="l312"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l314"></a>
|
||
|
<a name="l315"></a> </span><span class=cF1>PUSHFD</span><span class=cF0>
|
||
|
<a name="l316"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
||
|
<a name="l317"></a> left =win_task->win_left;
|
||
|
<a name="l318"></a> right =win_task->win_right;
|
||
|
<a name="l319"></a> width =win_task->win_width;
|
||
|
<a name="l320"></a> scroll_x=win_task->scroll_x;
|
||
|
<a name="l321"></a> scroll_y=win_task->scroll_y;
|
||
|
<a name="l322"></a> top =win_task->win_top;
|
||
|
<a name="l323"></a> bottom=win_task->win_bottom;
|
||
|
<a name="l324"></a> height=win_task->win_height;
|
||
|
<a name="l325"></a> pix_left =win_task->pix_left;
|
||
|
<a name="l326"></a> pix_top =win_task->pix_top;
|
||
|
<a name="l327"></a> left_margin=left;
|
||
|
<a name="l328"></a> right_margin=right;
|
||
|
<a name="l329"></a> </span><span class=cF1>POPFD</span><span class=cF0>
|
||
|
<a name="l330"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags&</span><span class=cF3>DOCF_BORDER_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l331"></a> scroll_x=0;
|
||
|
<a name="l332"></a> scroll_y=0;
|
||
|
<a name="l333"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l334"></a> best_doc_e=doc->cur_entry;
|
||
|
<a name="l335"></a>
|
||
|
<a name="l336"></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_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_PLAIN_TEXT_TABS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l337"></a> </span><span class=cF5>FilesFindMatch</span><span class=cF7>(</span><span class=cF0>doc->filename.name,</span><span class=cF3>FILEMASK_SRC</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l338"></a> doc->flags|=</span><span class=cF3>DOCF_HIGHLIGHT</span><span class=cF0>;
|
||
|
<a name="l339"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l340"></a> doc->flags&=~</span><span class=cF3>DOCF_HIGHLIGHT</span><span class=cF0>;
|
||
|
<a name="l341"></a>
|
||
|
<a name="l342"></a> x=y=0;
|
||
|
<a name="l343"></a> doc->page_line_num=0;
|
||
|
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh && !find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l345"></a> doc->x=x;
|
||
|
<a name="l346"></a> doc->y=y;
|
||
|
<a name="l347"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l348"></a>
|
||
|
<a name="l349"></a> hss=&win_task->horz_scroll;
|
||
|
<a name="l350"></a> vss=&win_task->vert_scroll;
|
||
|
<a name="l351"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags&</span><span class=cF3>DOCF_BORDER_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l352"></a> doc->top_line_num=0;
|
||
|
<a name="l353"></a> doc->line_start_col=0;
|
||
|
<a name="l354"></a> recalc_flags&=~</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>;
|
||
|
<a name="l355"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>)
|
||
|
<a name="l356"></a> doc->settings_head.cur_text_attr=
|
||
|
<a name="l357"></a> doc->settings_head.dft_text_attr=win_task->border_attr;
|
||
|
<a name="l358"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l359"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0> && full_refresh) {
|
||
|
<a name="l360"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&hss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>||</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&vss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l361"></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_NO_SCROLL_BARS</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l362"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&hss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l363"></a> doc->line_start_col=hss->pos;
|
||
|
<a name="l364"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&hss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF0>);
|
||
|
<a name="l365"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l366"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&vss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l367"></a> doc->top_line_num=vss->pos;
|
||
|
<a name="l368"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&vss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF0>);
|
||
|
<a name="l369"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l370"></a> }
|
||
|
<a name="l371"></a> doc->x=doc->line_start_col+width/2;
|
||
|
<a name="l372"></a> doc->y=doc->top_line_num+height/2;
|
||
|
<a name="l373"></a> find_cursor=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l374"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l375"></a> }
|
||
|
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>)
|
||
|
<a name="l377"></a> doc->settings_head.cur_text_attr=
|
||
|
<a name="l378"></a> doc->settings_head.dft_text_attr=win_task->text_attr;
|
||
|
<a name="l379"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l380"></a> x0=doc->line_start_col;
|
||
|
<a name="l381"></a> y0=doc->top_line_num;
|
||
|
<a name="l382"></a> same_win=top ==doc->old_win_top &&
|
||
|
<a name="l383"></a> bottom==doc->old_win_bottom &&
|
||
|
<a name="l384"></a> left ==doc->old_win_left &&
|
||
|
<a name="l385"></a> right ==doc->old_win_right &&
|
||
|
<a name="l386"></a> doc->cur_entry==doc->old_cur_entry &&
|
||
|
<a name="l387"></a> doc->cur_col==doc->old_cur_col;
|
||
|
<a name="l388"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l389"></a> y_plot_top=y0-scroll_y/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l390"></a> y_plot_bottom=y0+height-1-scroll_y/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l391"></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="l392"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l393"></a> </span><span class=cF5>DocBorderLstDraw</span><span class=cF0>(doc);
|
||
|
<a name="l394"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l395"></a>
|
||
|
<a name="l396"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<=doc->cur_entry->min_col)
|
||
|
<a name="l397"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l398"></a> doc_e=doc->head.next;
|
||
|
<a name="l399"></a> doc_e->de_flags&=~(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>);
|
||
|
<a name="l400"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc->head.next)
|
||
|
<a name="l401"></a> s=&doc->settings_head;
|
||
|
<a name="l402"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l403"></a> s=&doc_e->last->settings;
|
||
|
<a name="l404"></a> doc->flags=doc_e->de_flags& (</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>) |
|
||
|
<a name="l405"></a> doc->flags&~(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>);
|
||
|
<a name="l406"></a> cur_u8_attr=s->cur_text_attr;
|
||
|
<a name="l407"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc->head.next) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l408"></a> doc->flags&=~</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF0>;
|
||
|
<a name="l409"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> && full_refresh)
|
||
|
<a name="l410"></a> doc->flags&=~</span><span class=cF3>DOCF_HAS_SONG</span><span class=cF0>;
|
||
|
<a name="l411"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l412"></a> doc->flags=doc_e->de_flags& </span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0> |
|
||
|
<a name="l413"></a> doc->flags&~</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>;
|
||
|
<a name="l414"></a>
|
||
|
<a name="l415"></a> </span><span class=cF1>if</span><span class=cF0> (doc->head.next==doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l416"></a> best_doc_e=doc;
|
||
|
<a name="l417"></a> best_col=0;
|
||
|
<a name="l418"></a> doc->cur_entry=doc;
|
||
|
<a name="l419"></a> doc->cur_col=0;
|
||
|
<a name="l420"></a> doc_e=doc;
|
||
|
<a name="l421"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l422"></a> skipped_update= doc_e==doc && doc->head.next!=doc;
|
||
|
<a name="l423"></a>
|
||
|
<a name="l424"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l425"></a> doc->min_x=</span><span class=cF3>I32_MAX</span><span class=cF0>; doc->min_y=</span><span class=cF3>I32_MAX</span><span class=cF0>;
|
||
|
<a name="l426"></a> doc->max_x=</span><span class=cF3>I32_MIN</span><span class=cF0>; doc->max_y=</span><span class=cF3>I32_MIN</span><span class=cF0>;
|
||
|
<a name="l427"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l428"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l429"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
||
|
<a name="l430"></a> del_doc_e=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l431"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l432"></a> doc_e2=doc_e;
|
||
|
<a name="l433"></a> </span><span class=cF1>goto</span><span class=cF0> rc_skip;
|
||
|
<a name="l434"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l435"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e->settings,s,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l436"></a> s=&doc_e->settings;
|
||
|
<a name="l437"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_TAG_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_DEFINE</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l438"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags & </span><span class=cF3>DOCEF_LST</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l439"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l440"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TAG_CB</span><span class=cF0>) {
|
||
|
<a name="l441"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->tag_cb)
|
||
|
<a name="l442"></a> doc_e->tag=(*doc_e->tag_cb)(doc,doc_e,mem_task);
|
||
|
<a name="l443"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l444"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>""</span><span class=cF0>,mem_task);
|
||
|
<a name="l445"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l446"></a> </span><span class=cF1>if</span><span class=cF0> (tmph=</span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>doc_e->define_str,
|
||
|
<a name="l447"></a> win_task->hash_table,</span><span class=cF3>HTT_DEFINE_STR</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l448"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(tmph->data,mem_task);
|
||
|
<a name="l449"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l450"></a> doc_e->tag=</span><span class=cF5>CAlloc</span><span class=cF0>(1,mem_task);
|
||
|
<a name="l451"></a> }
|
||
|
<a name="l452"></a> doc_e->max_col=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l453"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc_e && doc->cur_col>=doc_e->max_col) {
|
||
|
<a name="l454"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->max_col)
|
||
|
<a name="l455"></a> doc->cur_col=doc_e->max_col-1;
|
||
|
<a name="l456"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l457"></a> doc->cur_col=0;
|
||
|
<a name="l458"></a> }
|
||
|
<a name="l459"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l460"></a> k=</span><span class=cF5>DocWordWrapDel</span><span class=cF0>(doc,doc_e,full_refresh,same_win,
|
||
|
<a name="l461"></a> left_margin,right_margin,&best_doc_e,&best_col);
|
||
|
<a name="l462"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_LEFT_X</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_X</span><span class=cF0>|</span><span class=cF3>DOCEF_CENTER_X</span><span class=cF0>|
|
||
|
<a name="l463"></a> </span><span class=cF3>DOCEF_TOP_Y</span><span class=cF0>|</span><span class=cF3>DOCEF_BOTTOM_Y</span><span class=cF0>|</span><span class=cF3>DOCEF_CENTER_Y</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l464"></a> </span><span class=cF5>DocRecalcXY</span><span class=cF0>(doc,doc_e,k,
|
||
|
<a name="l465"></a> left,width,height,left_margin,right_margin,x0,y0,&x,&y);
|
||
|
<a name="l466"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh && k>0 && doc->flags & </span><span class=cF3>DOCF_WORD_WRAP</span><span class=cF0> &&
|
||
|
<a name="l467"></a> </span><span class=cF7>(</span><span class=cF0>doc_e2=</span><span class=cF5>DocWordWrapAdd</span><span class=cF0>(doc,doc_e,&k,left,right_margin,x,y)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l468"></a> doc_e=doc_e2;
|
||
|
<a name="l469"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l470"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l471"></a> }
|
||
|
<a name="l472"></a>
|
||
|
<a name="l473"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) {
|
||
|
<a name="l474"></a> doc_e->x=x;
|
||
|
<a name="l475"></a> doc_e->y=y;
|
||
|
<a name="l476"></a> doc_e->page_line_num=doc->page_line_num;
|
||
|
<a name="l477"></a> </span><span class=cF1>if</span><span class=cF0> (x<doc->min_x) doc->min_x=x;
|
||
|
<a name="l478"></a> </span><span class=cF1>if</span><span class=cF0> (y<doc->min_y) doc->min_y=y;
|
||
|
<a name="l479"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l480"></a> </span><span class=cF5>D</span><span class=cF0>=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l481"></a> col=0;
|
||
|
<a name="l482"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l483"></a> }
|
||
|
<a name="l484"></a> col2=0;
|
||
|
<a name="l485"></a>
|
||
|
<a name="l486"></a> tmp_u32_attr=</span><span class=cF5>DocTmpAttr</span><span class=cF0>(doc,doc_e,cur_u8_attr);
|
||
|
<a name="l487"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc->cur_entry) {
|
||
|
<a name="l488"></a> cursor_y=doc_e->y;
|
||
|
<a name="l489"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCF_ADD_CURSOR</span><span class=cF0> && !added_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l490"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && 0<doc->cur_col<k &&
|
||
|
<a name="l491"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags & ~(</span><span class=cF3>DOCEF_TAG</span><span class=cF0>|</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|
|
||
|
<a name="l492"></a> </span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>|</span><span class=cF3>DOCEF_SKIP</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="l493"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->type&</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l494"></a> added_cursor=</span><span class=cF5>DocSplitTag</span><span class=cF0>(doc,doc_e,doc->cur_col,x,y,</span><span class=cF3>DOCT_CURSOR</span><span class=cF0>);
|
||
|
<a name="l495"></a> k=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l496"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l497"></a> added_cursor=doc_e2=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,
|
||
|
<a name="l498"></a> </span><span class=cF3>DOCT_CURSOR</span><span class=cF0>|doc_e->type&0xFFFFFF00,
|
||
|
<a name="l499"></a> doc_e->de_flags&~</span><span class=cF3>DOCEG_HAS_ARG</span><span class=cF0>,x,y,doc->page_line_num);
|
||
|
<a name="l500"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e2->settings,&doc_e->settings,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l501"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && doc->cur_col>=k)
|
||
|
<a name="l502"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_e2,doc_e);
|
||
|
<a name="l503"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l504"></a> </span><span class=cF5>QueInsRev</span><span class=cF0>(doc_e2,doc_e);
|
||
|
<a name="l505"></a> }
|
||
|
<a name="l506"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l507"></a> }
|
||
|
<a name="l508"></a>
|
||
|
<a name="l509"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_REFRESH_DATA</span><span class=cF0> &&
|
||
|
<a name="l510"></a> </span><span class=cF7>(</span><span class=cF0>doc_e->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0> || doc_e->type_u8==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0> ||
|
||
|
<a name="l511"></a> doc_e->de_flags & </span><span class=cF3>DOCEF_LST</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l512"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l513"></a> k=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l514"></a> }
|
||
|
<a name="l515"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_TAG</span><span class=cF0>) {
|
||
|
<a name="l516"></a> ptr=doc_e->tag;
|
||
|
<a name="l517"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l518"></a> </span><span class=cF1>if</span><span class=cF0> (k>=2) {
|
||
|
<a name="l519"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CHECKED_COLLAPSED</span><span class=cF0>)
|
||
|
<a name="l520"></a> *ptr++=</span><span class=cF6>'+'</span><span class=cF0>;
|
||
|
<a name="l521"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l522"></a> *ptr++=</span><span class=cF6>'-'</span><span class=cF0>;
|
||
|
<a name="l523"></a> *ptr++=</span><span class=cF6>']'</span><span class=cF0>;
|
||
|
<a name="l524"></a> ptr=doc_e->tag;
|
||
|
<a name="l525"></a> }
|
||
|
<a name="l526"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_HAS_BIN</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l527"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr==</span><span class=cF6>'<'</span><span class=cF0> && full_refresh && </span><span class=cF6>'0'</span><span class=cF0><=ptr[1]<=</span><span class=cF6>'9'</span><span class=cF0>) {
|
||
|
<a name="l528"></a> ptr=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"<%d>"</span><span class=cF0>,doc_e->bin_num);
|
||
|
<a name="l529"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l530"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(ptr,mem_task);
|
||
|
<a name="l531"></a> </span><span class=cF5>Free</span><span class=cF0>(ptr);
|
||
|
<a name="l532"></a> ptr=doc_e->tag;
|
||
|
<a name="l533"></a> k=</span><span class=cF5>StrLen</span><span class=cF0>(ptr);
|
||
|
<a name="l534"></a> }
|
||
|
<a name="l535"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l536"></a> </span><span class=cF1>if</span><span class=cF0> (k>=3) {
|
||
|
<a name="l537"></a> *ptr++=</span><span class=cF6>'['</span><span class=cF0>;
|
||
|
<a name="l538"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CHECKED_COLLAPSED</span><span class=cF0>)
|
||
|
<a name="l539"></a> *ptr++=</span><span class=cF6>'X'</span><span class=cF0>;
|
||
|
<a name="l540"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l541"></a> *ptr++=</span><span class=cF3>CH_SPACE</span><span class=cF0>;
|
||
|
<a name="l542"></a> *ptr++=</span><span class=cF6>']'</span><span class=cF0>;
|
||
|
<a name="l543"></a> ptr=doc_e->tag;
|
||
|
<a name="l544"></a> }
|
||
|
<a name="l545"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l546"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_SCROLLING_X</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l547"></a> j=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l548"></a> </span><span class=cF1>if</span><span class=cF0> (j && doc_e->scroll_len) {
|
||
|
<a name="l549"></a> i_jif=</span><span class=cF5>ToI64</span><span class=cF0>(cur_time*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*</span><span class=cF3>DOC_SCROLL_SPEED</span><span class=cF0>)%(j*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>);
|
||
|
<a name="l550"></a> tmp_u32_attr=tmp_u32_attr & 0xFFE0FF00|
|
||
|
<a name="l551"></a> (</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1-i_jif&</span><span class=cF7>(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1</span><span class=cF7>)</span><span class=cF0>)<<16;
|
||
|
<a name="l552"></a>#</span><span class=cF1>assert</span><span class=cF0> </span><span class=cF3>FONT_WIDTH</span><span class=cF0>==8
|
||
|
<a name="l553"></a> i_jif>>=3;
|
||
|
<a name="l554"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k<doc_e->scroll_len;k++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l555"></a> ch=ptr[(i_jif+k)%j];
|
||
|
<a name="l556"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_displayable</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) ch=</span><span class=cF6>'.'</span><span class=cF0>;
|
||
|
<a name="l557"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l558"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l559"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l560"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l561"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l562"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l563"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>FALSE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l564"></a> }
|
||
|
<a name="l565"></a> x++;
|
||
|
<a name="l566"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l567"></a> }
|
||
|
<a name="l568"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) {
|
||
|
<a name="l569"></a> </span><span class=cF5>D</span><span class=cF0>=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,doc_e->x,doc_e->y);
|
||
|
<a name="l570"></a> col=doc_e->min_col;
|
||
|
<a name="l571"></a> }
|
||
|
<a name="l572"></a> col2=doc_e->scroll_len; </span><span class=cF2>//TODO This is flawed</span><span class=cF0>
|
||
|
<a name="l573"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l574"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l575"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l576"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*ptr++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l577"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l578"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l579"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l580"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l581"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) {
|
||
|
<a name="l582"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l583"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l584"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l585"></a> col=col2;
|
||
|
<a name="l586"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l587"></a> }
|
||
|
<a name="l588"></a> col2++;
|
||
|
<a name="l589"></a> x++;
|
||
|
<a name="l590"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l591"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l592"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && doc_e->de_flags&</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>)
|
||
|
<a name="l593"></a> hl=</span><span class=cF5>DocHighlight</span><span class=cF0>(doc_e,ptr,k,tmp_u32_attr);
|
||
|
<a name="l594"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l595"></a> hl=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l596"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l597"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l598"></a></span><span class=cF2>//Technically we should do this for scrolling_x, too.</span><span class=cF0>
|
||
|
<a name="l599"></a> </span><span class=cF1>if</span><span class=cF0> (y>y_plot_bottom)
|
||
|
<a name="l600"></a> more=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l601"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (y>=y_plot_top) {
|
||
|
<a name="l602"></a> </span><span class=cF1>if</span><span class=cF0> (hl)
|
||
|
<a name="l603"></a> </span><span class=cF5>TextLenAttrStr</span><span class=cF0>(win_task,x-x0,y-y0,k,hl);
|
||
|
<a name="l604"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l605"></a> </span><span class=cF5>TextLenStr</span><span class=cF0>(win_task,x-x0,y-y0,k,tmp_u32_attr,ptr);
|
||
|
<a name="l606"></a> }
|
||
|
<a name="l607"></a> col2+=k;
|
||
|
<a name="l608"></a> x+=k;
|
||
|
<a name="l609"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l610"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) {
|
||
|
<a name="l611"></a> </span><span class=cF1>while</span><span class=cF0> (k--) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l612"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l613"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>) {
|
||
|
<a name="l614"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l615"></a> col=col2;
|
||
|
<a name="l616"></a> }
|
||
|
<a name="l617"></a> col2++;
|
||
|
<a name="l618"></a> x++;
|
||
|
<a name="l619"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l620"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l621"></a> col2+=k;
|
||
|
<a name="l622"></a> x+=k;
|
||
|
<a name="l623"></a> }
|
||
|
<a name="l624"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l625"></a> </span><span class=cF5>Free</span><span class=cF0>(hl);
|
||
|
<a name="l626"></a> }
|
||
|
<a name="l627"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l628"></a> }
|
||
|
<a name="l629"></a> </span><span class=cF1>switch</span><span class=cF0> [doc_e->type_u8] {
|
||
|
<a name="l630"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TEXT</span><span class=cF0>:
|
||
|
<a name="l631"></a> </span><span class=cF1>if</span><span class=cF0> (!col2 && !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags
|
||
|
<a name="l632"></a> &(</span><span class=cF3>DOCEF_TREE</span><span class=cF0>|</span><span class=cF3>DOCEF_LST</span><span class=cF0>|</span><span class=cF3>DOCEF_TAG_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_DEFINE</span><span class=cF0>|
|
||
|
<a name="l633"></a> </span><span class=cF3>DOCEF_AUX_STR</span><span class=cF0>|</span><span class=cF3>DOCEF_HTML_LINK</span><span class=cF0>|</span><span class=cF3>DOCEF_BIN_PTR_LINK</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l634"></a> del_doc_e=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l635"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l636"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>:
|
||
|
<a name="l637"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_DEREF_DATA</span><span class=cF0> &&
|
||
|
<a name="l638"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_REMALLOC_DATA</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l639"></a> bptr=doc_e->data;
|
||
|
<a name="l640"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l641"></a> bptr=&doc_e->data;
|
||
|
<a name="l642"></a> k=doc_e->hex_ed_width; </span><span class=cF2>//columns</span><span class=cF0>
|
||
|
<a name="l643"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<doc_e->len;i+=k) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l644"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_ZERO_BASED</span><span class=cF0>)
|
||
|
<a name="l645"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>"%08tX "</span><span class=cF0>,i);
|
||
|
<a name="l646"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l647"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>"%08tX "</span><span class=cF0>,bptr);
|
||
|
<a name="l648"></a> ptr=buf;
|
||
|
<a name="l649"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*ptr++) {
|
||
|
<a name="l650"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l651"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l652"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l653"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l654"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l655"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l656"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>FALSE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l657"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l658"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l659"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l660"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>) {
|
||
|
<a name="l661"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l662"></a> col=i*3;
|
||
|
<a name="l663"></a> }
|
||
|
<a name="l664"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l665"></a> x++;
|
||
|
<a name="l666"></a> }
|
||
|
<a name="l667"></a> </span><span class=cF1>if</span><span class=cF0> (i+k>doc_e->len) k=doc_e->len-i;
|
||
|
<a name="l668"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<k;j++) {
|
||
|
<a name="l669"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>"%02tX"</span><span class=cF0>,*bptr++);
|
||
|
<a name="l670"></a> ptr=buf;
|
||
|
<a name="l671"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*ptr++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l672"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l673"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l674"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l675"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l676"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l677"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l678"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>FALSE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l679"></a> }
|
||
|
<a name="l680"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) {
|
||
|
<a name="l681"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l682"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l683"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l684"></a> col=col2;
|
||
|
<a name="l685"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l686"></a> }
|
||
|
<a name="l687"></a> col2++;
|
||
|
<a name="l688"></a> x++;
|
||
|
<a name="l689"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l690"></a> x++;
|
||
|
<a name="l691"></a> }
|
||
|
<a name="l692"></a> bptr-=j;
|
||
|
<a name="l693"></a> x+=(doc_e->hex_ed_width-k)*3;
|
||
|
<a name="l694"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<k;j++) {
|
||
|
<a name="l695"></a> ch=*bptr++;
|
||
|
<a name="l696"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_displayable</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) ch=</span><span class=cF6>'.'</span><span class=cF0>;
|
||
|
<a name="l697"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l698"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l699"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l700"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l701"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l702"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l703"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>FALSE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+ch);
|
||
|
<a name="l704"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l705"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l706"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l707"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>) {
|
||
|
<a name="l708"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l709"></a> col=col2;
|
||
|
<a name="l710"></a> }
|
||
|
<a name="l711"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l712"></a> col2++;
|
||
|
<a name="l713"></a> x++;
|
||
|
<a name="l714"></a> }
|
||
|
<a name="l715"></a> y++;
|
||
|
<a name="l716"></a> x-=doc_e->hex_ed_width*3+k+9;
|
||
|
<a name="l717"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l718"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l719"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>:
|
||
|
<a name="l720"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>:
|
||
|
<a name="l721"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l722"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>&&
|
||
|
<a name="l723"></a> y_plot_top<=y<=y_plot_bottom)
|
||
|
<a name="l724"></a> </span><span class=cF5>TextLenAttr</span><span class=cF0>(win_task,x-x0,y-y0,width-</span><span class=cF7>(</span><span class=cF0>x-x0</span><span class=cF7>)</span><span class=cF0>,cur_u8_attr<<8);
|
||
|
<a name="l725"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0> && s->state==</span><span class=cF3>DOCSS_CPP_Z_COMMENT</span><span class=cF0>)
|
||
|
<a name="l726"></a> s->state=</span><span class=cF3>DOCSS_NORMAL</span><span class=cF0>;
|
||
|
<a name="l727"></a> y++;
|
||
|
<a name="l728"></a> doc->page_line_num++;
|
||
|
<a name="l729"></a>rc_start_of_line:
|
||
|
<a name="l730"></a> </span><span class=cF1>if</span><span class=cF0> (s->left_margin==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l731"></a> x=s->indent;
|
||
|
<a name="l732"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l733"></a> x=s->indent+s->left_margin;
|
||
|
<a name="l734"></a>rc_adjust_xy:
|
||
|
<a name="l735"></a> i=s->indent+s->left_margin;
|
||
|
<a name="l736"></a> </span><span class=cF1>if</span><span class=cF0> (x<i)
|
||
|
<a name="l737"></a> x=i;
|
||
|
<a name="l738"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num<0)
|
||
|
<a name="l739"></a> doc->page_line_num=s->page_len+doc->page_line_num%s->page_len;
|
||
|
<a name="l740"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l741"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=s->page_len) {
|
||
|
<a name="l742"></a> doc->page_line_num-=s->page_len;
|
||
|
<a name="l743"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=s->page_len) </span><span class=cF2>//avoid extra divide</span><span class=cF0>
|
||
|
<a name="l744"></a> doc->page_line_num=doc->page_line_num%s->page_len;
|
||
|
<a name="l745"></a> }
|
||
|
<a name="l746"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l747"></a> </span><span class=cF1>if</span><span class=cF0> (s->header!=</span><span class=cF3>DOC_DFT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l748"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num<s->header) {
|
||
|
<a name="l749"></a> y+=s->header-doc->page_line_num;
|
||
|
<a name="l750"></a> doc->page_line_num=s->header;
|
||
|
<a name="l751"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l752"></a> }
|
||
|
<a name="l753"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l754"></a> </span><span class=cF1>if</span><span class=cF0> (s->footer==</span><span class=cF3>DOC_DFT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l755"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=s->page_len) {
|
||
|
<a name="l756"></a> </span><span class=cF1>if</span><span class=cF0> (s->header==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l757"></a> doc->page_line_num=0;
|
||
|
<a name="l758"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l759"></a> doc->page_line_num=s->header;
|
||
|
<a name="l760"></a> y+=s->header;
|
||
|
<a name="l761"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l762"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l763"></a> }
|
||
|
<a name="l764"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l765"></a> </span><span class=cF1>if</span><span class=cF0> (doc->page_line_num>=s->page_len-s->footer) {
|
||
|
<a name="l766"></a> y+=s->footer;
|
||
|
<a name="l767"></a> </span><span class=cF1>if</span><span class=cF0> (s->header==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l768"></a> doc->page_line_num=0;
|
||
|
<a name="l769"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l770"></a> doc->page_line_num=s->header;
|
||
|
<a name="l771"></a> y+=s->header;
|
||
|
<a name="l772"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l773"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l774"></a> }
|
||
|
<a name="l775"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l776"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l777"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TAB</span><span class=cF0>:
|
||
|
<a name="l778"></a> k=(x+8) & ~7;
|
||
|
<a name="l779"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BORDER_PLOT</span><span class=cF0> &&
|
||
|
<a name="l780"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l781"></a> </span><span class=cF1>while</span><span class=cF0> (x<k) {
|
||
|
<a name="l782"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l783"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l784"></a> </span><span class=cF5>TextChar</span><span class=cF0>(win_task,</span><span class=cF3>TRUE</span><span class=cF0>,x-x0,y-y0,tmp_u32_attr+</span><span class=cF3>CH_SPACE</span><span class=cF0>);
|
||
|
<a name="l785"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l786"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l787"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>)
|
||
|
<a name="l788"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l789"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l790"></a> x++;
|
||
|
<a name="l791"></a> }
|
||
|
<a name="l792"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l793"></a> k-=x;
|
||
|
<a name="l794"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l795"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l796"></a> </span><span class=cF1>if</span><span class=cF0> (y_plot_top<=y<=y_plot_bottom)
|
||
|
<a name="l797"></a> </span><span class=cF5>TextLenStr</span><span class=cF0>(win_task,x-x0,y-y0,k,tmp_u32_attr,</span><span class=cF6>" "</span><span class=cF0>);
|
||
|
<a name="l798"></a> x+=k;
|
||
|
<a name="l799"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l800"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l801"></a> </span><span class=cF1>while</span><span class=cF0> (k--) {
|
||
|
<a name="l802"></a> d2=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l803"></a> </span><span class=cF1>if</span><span class=cF0> (d2<</span><span class=cF5>D</span><span class=cF0>)
|
||
|
<a name="l804"></a> </span><span class=cF5>D</span><span class=cF0>=d2;
|
||
|
<a name="l805"></a> x++;
|
||
|
<a name="l806"></a> }
|
||
|
<a name="l807"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l808"></a> x+=k;
|
||
|
<a name="l809"></a> }
|
||
|
<a name="l810"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l811"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l812"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_PAGE_BREAK</span><span class=cF0>:
|
||
|
<a name="l813"></a> doc->flags|=</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF0>;
|
||
|
<a name="l814"></a> y+=s->page_len-doc_e->page_line_num;
|
||
|
<a name="l815"></a> doc->page_line_num=0;
|
||
|
<a name="l816"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l817"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CURSOR</span><span class=cF0>:
|
||
|
<a name="l818"></a> </span><span class=cF1>if</span><span class=cF0> (!find_cursor && !</span><span class=cF7>(</span><span class=cF0>doc->flags & </span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l819"></a> doc->cur_entry=doc_e->next;
|
||
|
<a name="l820"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l821"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l822"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=added_cursor)
|
||
|
<a name="l823"></a> del_doc_e=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l824"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l825"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_PMT</span><span class=cF0>:
|
||
|
<a name="l826"></a> cur_u8_attr=cur_u8_attr&0xF0|</span><span class=cF3>DOC_COLOR_PMT</span><span class=cF0>;
|
||
|
<a name="l827"></a> </span><span class=cF1>if</span><span class=cF0> (y==cursor_y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l828"></a> doc->cur_entry=doc_e->next;
|
||
|
<a name="l829"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l830"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l831"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l832"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CLEAR</span><span class=cF0>:
|
||
|
<a name="l833"></a> next_clear_found=doc_e;
|
||
|
<a name="l834"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_HOLD</span><span class=cF0>)
|
||
|
<a name="l835"></a> clear_holds=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l836"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l837"></a> clear_holds=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l838"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l839"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_PAGE_LEN</span><span class=cF0>:
|
||
|
<a name="l840"></a> s->page_len=doc_e->attr;
|
||
|
<a name="l841"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_WIN_REL</span><span class=cF0>)
|
||
|
<a name="l842"></a> s->page_len+=height;
|
||
|
<a name="l843"></a> </span><span class=cF1>goto</span><span class=cF0> rc_adjust_xy;
|
||
|
<a name="l844"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LEFT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l845"></a> i=doc_e->attr;
|
||
|
<a name="l846"></a> left_margin=left+i;
|
||
|
<a name="l847"></a> s->left_margin=i;
|
||
|
<a name="l848"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l849"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_RIGHT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l850"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_WIN_REL</span><span class=cF0>)
|
||
|
<a name="l851"></a> i=width-1-doc_e->attr;
|
||
|
<a name="l852"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l853"></a> i=doc_e->attr;
|
||
|
<a name="l854"></a> right_margin=left+i;
|
||
|
<a name="l855"></a> s->right_margin=i;
|
||
|
<a name="l856"></a> </span><span class=cF1>goto</span><span class=cF0> rc_adjust_xy;
|
||
|
<a name="l857"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEADER</span><span class=cF0>:
|
||
|
<a name="l858"></a> s->header=doc_e->attr;
|
||
|
<a name="l859"></a> </span><span class=cF1>goto</span><span class=cF0> rc_adjust_xy;
|
||
|
<a name="l860"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOOTER</span><span class=cF0>:
|
||
|
<a name="l861"></a> s->footer=doc_e->attr;
|
||
|
<a name="l862"></a> </span><span class=cF1>goto</span><span class=cF0> rc_adjust_xy;
|
||
|
<a name="l863"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INDENT</span><span class=cF0>:
|
||
|
<a name="l864"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LEFT_X</span><span class=cF0>)
|
||
|
<a name="l865"></a> i=doc_e->attr;
|
||
|
<a name="l866"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l867"></a> i=s->indent+doc_e->attr;
|
||
|
<a name="l868"></a> s->indent=i;
|
||
|
<a name="l869"></a> </span><span class=cF1>goto</span><span class=cF0> rc_start_of_line;
|
||
|
<a name="l870"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l871"></a> cur_u8_attr&=0xF0;
|
||
|
<a name="l872"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l873"></a> cur_u8_attr|=s->dft_text_attr&0x0F;
|
||
|
<a name="l874"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l875"></a> cur_u8_attr|=doc_e->attr;
|
||
|
<a name="l876"></a> s->cur_text_attr=cur_u8_attr;
|
||
|
<a name="l877"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l878"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l879"></a> cur_u8_attr&=0x0F;
|
||
|
<a name="l880"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l881"></a> cur_u8_attr|=s->dft_text_attr&0xF0;
|
||
|
<a name="l882"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l883"></a> cur_u8_attr|=doc_e->attr<<4;
|
||
|
<a name="l884"></a> s->cur_text_attr=cur_u8_attr;
|
||
|
<a name="l885"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l886"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l887"></a> cur_u8_attr&=0xF0;
|
||
|
<a name="l888"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l889"></a> cur_u8_attr|=s->dft_text_attr&0xF;
|
||
|
<a name="l890"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l891"></a> cur_u8_attr|=doc_e->attr;
|
||
|
<a name="l892"></a> s->dft_text_attr=s->dft_text_attr&0xF0|cur_u8_attr&0x0F;
|
||
|
<a name="l893"></a> s->cur_text_attr=cur_u8_attr;
|
||
|
<a name="l894"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l895"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l896"></a> cur_u8_attr&=0x0F;
|
||
|
<a name="l897"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr==</span><span class=cF3>DOC_DFT</span><span class=cF0>)
|
||
|
<a name="l898"></a> cur_u8_attr|=s->dft_text_attr&0xF0;
|
||
|
<a name="l899"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l900"></a> cur_u8_attr|=doc_e->attr<<4;
|
||
|
<a name="l901"></a> s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0;
|
||
|
<a name="l902"></a> s->cur_text_attr=cur_u8_attr;
|
||
|
<a name="l903"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l904"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_WORD_WRAP</span><span class=cF0>:
|
||
|
<a name="l905"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr)
|
||
|
<a name="l906"></a> doc->flags|=</span><span class=cF3>DOCF_WORD_WRAP</span><span class=cF0>;
|
||
|
<a name="l907"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l908"></a> doc->flags&=~</span><span class=cF3>DOCF_WORD_WRAP</span><span class=cF0>;
|
||
|
<a name="l909"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l910"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HIGHLIGHT</span><span class=cF0>:
|
||
|
<a name="l911"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr)
|
||
|
<a name="l912"></a> doc->flags|=</span><span class=cF3>DOCF_HIGHLIGHT</span><span class=cF0>;
|
||
|
<a name="l913"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l914"></a> doc->flags&=~</span><span class=cF3>DOCF_HIGHLIGHT</span><span class=cF0>;
|
||
|
<a name="l915"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l916"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BLINK</span><span class=cF0>:
|
||
|
<a name="l917"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr)
|
||
|
<a name="l918"></a> doc->flags|=</span><span class=cF3>DOCF_BLINK</span><span class=cF0>;
|
||
|
<a name="l919"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l920"></a> doc->flags&=~</span><span class=cF3>DOCF_BLINK</span><span class=cF0>;
|
||
|
<a name="l921"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l922"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INVERT</span><span class=cF0>:
|
||
|
<a name="l923"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr)
|
||
|
<a name="l924"></a> doc->flags|=</span><span class=cF3>DOCF_INVERT</span><span class=cF0>;
|
||
|
<a name="l925"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l926"></a> doc->flags&=~</span><span class=cF3>DOCF_INVERT</span><span class=cF0>;
|
||
|
<a name="l927"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l928"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_UNDERLINE</span><span class=cF0>:
|
||
|
<a name="l929"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr)
|
||
|
<a name="l930"></a> doc->flags|=</span><span class=cF3>DOCF_UNDERLINE</span><span class=cF0>;
|
||
|
<a name="l931"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l932"></a> doc->flags&=~</span><span class=cF3>DOCF_UNDERLINE</span><span class=cF0>;
|
||
|
<a name="l933"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l934"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_X</span><span class=cF0>:
|
||
|
<a name="l935"></a> s->shifted_x=doc_e->attr;
|
||
|
<a name="l936"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l937"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l938"></a> s->shifted_y=doc_e->attr;
|
||
|
<a name="l939"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l940"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CURSOR_MOVEMENT</span><span class=cF0>:
|
||
|
<a name="l941"></a> doc->flags|=</span><span class=cF3>DOCF_BWD_MOVEMENT</span><span class=cF0>;
|
||
|
<a name="l942"></a> x+=doc_e->cursor_x_offset;
|
||
|
<a name="l943"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_PAGE_REL_Y</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l944"></a> i=doc->page_line_num;
|
||
|
<a name="l945"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TOP_Y</span><span class=cF0>)
|
||
|
<a name="l946"></a> doc->page_line_num=0;
|
||
|
<a name="l947"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_BOTTOM_Y</span><span class=cF0>)
|
||
|
<a name="l948"></a> doc->page_line_num=s->page_len-1;
|
||
|
<a name="l949"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CENTER_Y</span><span class=cF0>)
|
||
|
<a name="l950"></a> doc->page_line_num=s->page_len>>1;
|
||
|
<a name="l951"></a> y+=doc->page_line_num-i;
|
||
|
<a name="l952"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l953"></a> y+=doc_e->cursor_y_offset;
|
||
|
<a name="l954"></a> doc->page_line_num+=doc_e->cursor_y_offset;
|
||
|
<a name="l955"></a> </span><span class=cF1>goto</span><span class=cF0> rc_adjust_xy;
|
||
|
<a name="l956"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SPRITE</span><span class=cF0>:
|
||
|
<a name="l957"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_e->bin_data && doc->flags&</span><span class=cF3>DOCEF_HAS_BIN</span><span class=cF0>)
|
||
|
<a name="l958"></a> doc_e->bin_data=</span><span class=cF5>DocBinFindNum</span><span class=cF0>(doc,doc_e->bin_num);
|
||
|
<a name="l959"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmpb=doc_e->bin_data</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l960"></a> !tmpb->tag && doc_e->tag && *doc_e->tag)
|
||
|
<a name="l961"></a> tmpb->tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->tag,mem_task);
|
||
|
<a name="l962"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb && dc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l963"></a> </span><span class=cF5>DCRst</span><span class=cF0>(dc);
|
||
|
<a name="l964"></a> dc->flags&=~(</span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>|</span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>);
|
||
|
<a name="l965"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>!=</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> ||
|
||
|
<a name="l966"></a> doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>)
|
||
|
<a name="l967"></a> dc->flags|=</span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>;
|
||
|
<a name="l968"></a> bptr=tmpb->data;
|
||
|
<a name="l969"></a> ii=</span><span class=cF5>SpriteTypeMask</span><span class=cF0>(bptr);
|
||
|
<a name="l970"></a> </span><span class=cF1>if</span><span class=cF0> (ii&1<<</span><span class=cF3>SPT_TYPES_NUM</span><span class=cF0>) {
|
||
|
<a name="l971"></a> bptr=</span><span class=cFB>gr</span><span class=cF0>.empty_sprite;
|
||
|
<a name="l972"></a> ii=</span><span class=cF5>SpriteTypeMask</span><span class=cF0>(bptr);
|
||
|
<a name="l973"></a> }
|
||
|
<a name="l974"></a> </span><span class=cF1>if</span><span class=cF0> (ii&</span><span class=cF7>(</span><span class=cF0>1<<</span><span class=cF3>SPT_FLOOD_FILL</span><span class=cF0>|1<<</span><span class=cF3>SPT_FLOOD_FILL_NOT</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l975"></a> i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
||
|
<a name="l976"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l977"></a> i=tmp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||
|
<a name="l978"></a> </span><span class=cF1>if</span><span class=cF0> (tmp_u32_attr & </span><span class=cF3>DOCET_SEL</span><span class=cF0>)
|
||
|
<a name="l979"></a> i^=0xF;
|
||
|
<a name="l980"></a> </span><span class=cF1>if</span><span class=cF0> (tmp_u32_attr & </span><span class=cF3>DOCET_INVERT</span><span class=cF0>)
|
||
|
<a name="l981"></a> i^=0xF;
|
||
|
<a name="l982"></a> </span><span class=cF1>if</span><span class=cF0> (blink_flag &&
|
||
|
<a name="l983"></a> </span><span class=cF7>(</span><span class=cF0>doc_e==doc->cur_entry || tmp_u32_attr&</span><span class=cF3>DOCET_BLINK</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l984"></a> i^=0xF;
|
||
|
<a name="l985"></a> }
|
||
|
<a name="l986"></a> dc->color=i;
|
||
|
<a name="l987"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor)
|
||
|
<a name="l988"></a> dc->flags|=</span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>;
|
||
|
<a name="l989"></a> dc->cur_x=(doc->x-x0)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>+pix_left+scroll_x;
|
||
|
<a name="l990"></a> dc->cur_y=(doc->y-y0)*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>+pix_top+scroll_y;
|
||
|
<a name="l991"></a> dc->cur_z=0;
|
||
|
<a name="l992"></a> dc->bkcolor=i;
|
||
|
<a name="l993"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_FROM_START</span><span class=cF0>) {
|
||
|
<a name="l994"></a> xx=(x-k-x0)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>; </span><span class=cF2>//TODO: scrolling text is not length k</span><span class=cF0>
|
||
|
<a name="l995"></a> yy=(y-y0)*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l996"></a> zz=0;
|
||
|
<a name="l997"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l998"></a> xx=(x-x0)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
||
|
<a name="l999"></a> yy=(y-y0)*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l1000"></a> zz=0;
|
||
|
<a name="l1001"></a> }
|
||
|
<a name="l1002"></a> </span><span class=cF1>if</span><span class=cF0> (ii&</span><span class=cF7>(</span><span class=cF0>1<<</span><span class=cF3>SPT_MESH</span><span class=cF0>|1<<</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1003"></a> </span><span class=cF1>if</span><span class=cF0> (!depth_buf) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1004"></a> </span><span class=cF5>DCDepthBufAlloc</span><span class=cF0>(dc);
|
||
|
<a name="l1005"></a> depth_buf=dc->depth_buf;
|
||
|
<a name="l1006"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1007"></a> dc->depth_buf=depth_buf;
|
||
|
<a name="l1008"></a> </span><span class=cF5>Mat4x4IdentEqu</span><span class=cF0>(dc->r);
|
||
|
<a name="l1009"></a> </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(dc->r,cur_time*3.1);
|
||
|
<a name="l1010"></a> </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(dc->r,cur_time*1.9);
|
||
|
<a name="l1011"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(dc->r,cur_time);
|
||
|
<a name="l1012"></a> dc->flags|=</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
||
|
<a name="l1013"></a> dc->x=xx;
|
||
|
<a name="l1014"></a> dc->y=yy;
|
||
|
<a name="l1015"></a> dc->z=</span><span class=cF3>GR_Z_ALL</span><span class=cF0>;
|
||
|
<a name="l1016"></a> xx=0; yy=0; zz=0;
|
||
|
<a name="l1017"></a> }
|
||
|
<a name="l1018"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(dc,xx,yy,zz,bptr);
|
||
|
<a name="l1019"></a> dc->depth_buf=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l1020"></a> dc->flags&=~(</span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>|</span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>|</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>);
|
||
|
<a name="l1021"></a> </span><span class=cF1>if</span><span class=cF0> (dc->nearest_dist<=</span><span class=cF5>D</span><span class=cF0>) {
|
||
|
<a name="l1022"></a> </span><span class=cF5>D</span><span class=cF0>=dc->nearest_dist;
|
||
|
<a name="l1023"></a> col=doc_e->min_col;
|
||
|
<a name="l1024"></a> }
|
||
|
<a name="l1025"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1026"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1027"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SONG</span><span class=cF0>:
|
||
|
<a name="l1028"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_focus_task</span><span class=cF0>==win_task &&
|
||
|
<a name="l1029"></a> recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l1030"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1031"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->aux_str &&
|
||
|
<a name="l1032"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cFB>music</span><span class=cF0>.cur_song || </span><span class=cF5>StrCmp</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song,doc_e->aux_str)</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1033"></a> </span><span class=cF5>Free</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song);
|
||
|
<a name="l1034"></a> </span><span class=cF5>MusicSettingsRst</span><span class=cF0>;
|
||
|
<a name="l1035"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song=</span><span class=cF5>AStrNew</span><span class=cF0>(doc_e->aux_str);
|
||
|
<a name="l1036"></a> }
|
||
|
<a name="l1037"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1038"></a> doc->flags|=</span><span class=cF3>DOCF_HAS_SONG</span><span class=cF0>;
|
||
|
<a name="l1039"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1040"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HTML_CODE</span><span class=cF0>:
|
||
|
<a name="l1041"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCF_TO_HTML</span><span class=cF0> &&
|
||
|
<a name="l1042"></a> doc_e->de_flags&</span><span class=cF3>DOCEF_TAG</span><span class=cF0> && doc_e->tag)
|
||
|
<a name="l1043"></a> x-=</span><span class=cF5>StrLen</span><span class=cF0>(doc_e->tag);
|
||
|
<a name="l1044"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1045"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>-1: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l1046"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l1047"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1048"></a> }
|
||
|
<a name="l1049"></a>
|
||
|
<a name="l1050"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_HAS_BORDER</span><span class=cF0>)
|
||
|
<a name="l1051"></a> </span><span class=cF5>TextBorder</span><span class=cF0>(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0,
|
||
|
<a name="l1052"></a> tmp_u32_attr.u8[1],</span><span class=cF5>ToBool</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags & </span><span class=cF3>DOCEF_SOLID_BORDER</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1053"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) {
|
||
|
<a name="l1054"></a> </span><span class=cF1>switch</span><span class=cF0> (doc_e->type_u8) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1055"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>:
|
||
|
<a name="l1056"></a> doc_e->max_col=2;
|
||
|
<a name="l1057"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1058"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LST</span><span class=cF0>:
|
||
|
<a name="l1059"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TREE</span><span class=cF0>:
|
||
|
<a name="l1060"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BTTN</span><span class=cF0>:
|
||
|
<a name="l1061"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LINK</span><span class=cF0>:
|
||
|
<a name="l1062"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>:
|
||
|
<a name="l1063"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_MACRO</span><span class=cF0>:
|
||
|
<a name="l1064"></a> doc_e->max_col=1;
|
||
|
<a name="l1065"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1066"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l1067"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_TREE</span><span class=cF0>|</span><span class=cF3>DOCEF_LST</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1068"></a> doc_e->max_col=1;
|
||
|
<a name="l1069"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1070"></a> doc_e->max_col=col2;
|
||
|
<a name="l1071"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1072"></a>
|
||
|
<a name="l1073"></a> </span><span class=cF1>if</span><span class=cF0> (x>doc->max_x) doc->max_x=x;
|
||
|
<a name="l1074"></a> </span><span class=cF1>if</span><span class=cF0> (y>doc->max_y) doc->max_y=y;
|
||
|
<a name="l1075"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>D</span><span class=cF0><=best_d && !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_NO_CLICK_ON</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1076"></a> best_d=</span><span class=cF5>D</span><span class=cF0>;
|
||
|
<a name="l1077"></a> best_doc_e=doc_e;
|
||
|
<a name="l1078"></a> best_col=col;
|
||
|
<a name="l1079"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1080"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1081"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_CHECKED_COLLAPSED</span><span class=cF0>)
|
||
|
<a name="l1082"></a> tree_collapsed=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1083"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1084"></a> tree_collapsed=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1085"></a> doc_e2=doc_e->next;
|
||
|
<a name="l1086"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e2!=doc && doc_e2->type_u8!=</span><span class=cF3>DOCT_INDENT</span><span class=cF0> &&
|
||
|
<a name="l1087"></a> !</span><span class=cF7>(</span><span class=cF0>doc_e2->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1088"></a> doc_e2=doc_e2->next;
|
||
|
<a name="l1089"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->type_u8==</span><span class=cF3>DOCT_INDENT</span><span class=cF0>) {
|
||
|
<a name="l1090"></a> j=i=s->indent;
|
||
|
<a name="l1091"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1092"></a> </span><span class=cF1>if</span><span class=cF0> (tree_collapsed)
|
||
|
<a name="l1093"></a> doc_e2->de_flags|=</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>;
|
||
|
<a name="l1094"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1095"></a> doc_e2->de_flags&=~</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>;
|
||
|
<a name="l1096"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->type_u8==</span><span class=cF3>DOCT_INDENT</span><span class=cF0>) {
|
||
|
<a name="l1097"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2->de_flags & </span><span class=cF3>DOCEF_LEFT_X</span><span class=cF0>)
|
||
|
<a name="l1098"></a> j=doc_e2->attr;
|
||
|
<a name="l1099"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1100"></a> j+=doc_e2->attr;
|
||
|
<a name="l1101"></a> }
|
||
|
<a name="l1102"></a> doc_e2=doc_e2->next;
|
||
|
<a name="l1103"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (doc_e2!=doc && j>i);
|
||
|
<a name="l1104"></a> }
|
||
|
<a name="l1105"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1106"></a> }
|
||
|
<a name="l1107"></a>
|
||
|
<a name="l1108"></a> doc_e2=doc_e->next;
|
||
|
<a name="l1109"></a>rc_skip:
|
||
|
<a name="l1110"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e2!=doc && doc_e2->de_flags&</span><span class=cF7>(</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1111"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2==doc->cur_entry) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1112"></a> doc->cur_entry=doc_e2->next;
|
||
|
<a name="l1113"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l1114"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1115"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1116"></a> doc_e2->x=x;
|
||
|
<a name="l1117"></a> doc_e2->y=y;
|
||
|
<a name="l1118"></a> doc_e2->page_line_num=doc->page_line_num;
|
||
|
<a name="l1119"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e2->settings,s,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1120"></a> doc_e2->type.u8[1]=cur_u8_attr;
|
||
|
<a name="l1121"></a> doc_e2->de_flags=doc->flags
|
||
|
<a name="l1122"></a> &(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>) |
|
||
|
<a name="l1123"></a> doc_e2->de_flags&~(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>);
|
||
|
<a name="l1124"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1125"></a> doc_e2=doc_e2->next;
|
||
|
<a name="l1126"></a> }
|
||
|
<a name="l1127"></a>
|
||
|
<a name="l1128"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) {
|
||
|
<a name="l1129"></a> </span><span class=cF1>if</span><span class=cF0> (del_doc_e) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1130"></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="l1131"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e==doc->cur_entry) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1132"></a> doc->cur_entry=doc_e2;
|
||
|
<a name="l1133"></a> doc->cur_col=doc_e2->min_col;
|
||
|
<a name="l1134"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1135"></a> </span><span class=cF1>if</span><span class=cF0> (best_doc_e==doc_e) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1136"></a> best_doc_e=doc_e2;
|
||
|
<a name="l1137"></a> best_col=doc_e2->min_col; </span><span class=cF2>//TODO: might be bug</span><span class=cF0>
|
||
|
<a name="l1138"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1139"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l1140"></a> }
|
||
|
<a name="l1141"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1142"></a> }
|
||
|
<a name="l1143"></a> num_entries++;
|
||
|
<a name="l1144"></a> </span><span class=cF1>if</span><span class=cF0> (!full_refresh && doc_e->y>y_plot_bottom)
|
||
|
<a name="l1145"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1146"></a> doc_e=doc_e2;
|
||
|
<a name="l1147"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1148"></a>
|
||
|
<a name="l1149"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1150"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry==doc && recalc_flags&</span><span class=cF3>RECALCF_ADD_CURSOR</span><span class=cF0>) {
|
||
|
<a name="l1151"></a> doc_e2=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,</span><span class=cF3>DOCT_CURSOR</span><span class=cF0>,,x,y,doc->page_line_num);
|
||
|
<a name="l1152"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e2->settings,s,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1153"></a> </span><span class=cF5>QueInsRev</span><span class=cF0>(doc_e2,doc);
|
||
|
<a name="l1154"></a> }
|
||
|
<a name="l1155"></a>
|
||
|
<a name="l1156"></a> </span><span class=cF1>if</span><span class=cF0> (doc->min_x>doc->max_x) {
|
||
|
<a name="l1157"></a> doc->max_x=0;
|
||
|
<a name="l1158"></a> doc->min_x=0;
|
||
|
<a name="l1159"></a> }
|
||
|
<a name="l1160"></a> </span><span class=cF1>if</span><span class=cF0> (doc->min_y>doc->max_y) {
|
||
|
<a name="l1161"></a> doc->max_y=0;
|
||
|
<a name="l1162"></a> doc->min_y=0;
|
||
|
<a name="l1163"></a> }
|
||
|
<a name="l1164"></a>
|
||
|
<a name="l1165"></a> </span><span class=cF2>//Update header</span><span class=cF0>
|
||
|
<a name="l1166"></a> </span><span class=cF1>if</span><span class=cF0> (!skipped_update) {
|
||
|
<a name="l1167"></a> doc_e->x=x;
|
||
|
<a name="l1168"></a> doc_e->y=y;
|
||
|
<a name="l1169"></a> doc_e->page_line_num=doc->page_line_num;
|
||
|
<a name="l1170"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&doc_e->settings,s,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocSettings</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1171"></a> doc_e->type.u8[1]=cur_u8_attr;
|
||
|
<a name="l1172"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1173"></a> </span><span class=cF5>D</span><span class=cF0>=</span><span class=cF5>DocCharDist</span><span class=cF0>(doc,x,y);
|
||
|
<a name="l1174"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>D</span><span class=cF0><best_d && !</span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_NO_CLICK_ON</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1175"></a> best_d=</span><span class=cF5>D</span><span class=cF0>;
|
||
|
<a name="l1176"></a> best_doc_e=doc_e;
|
||
|
<a name="l1177"></a> best_col=0;
|
||
|
<a name="l1178"></a> }
|
||
|
<a name="l1179"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1180"></a> }
|
||
|
<a name="l1181"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags & </span><span class=cF3>DOCF_SIZE_MIN</span><span class=cF0>) {
|
||
|
<a name="l1182"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&win_task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1183"></a> </span><span class=cF1>if</span><span class=cF0> (left<0)
|
||
|
<a name="l1184"></a> left=0;
|
||
|
<a name="l1185"></a> i=left+doc->max_x-doc->min_x;
|
||
|
<a name="l1186"></a> </span><span class=cF1>if</span><span class=cF0> (i></span><span class=cF3>TEXT_COLS</span><span class=cF0>-1)
|
||
|
<a name="l1187"></a> i=</span><span class=cF3>TEXT_COLS</span><span class=cF0>-1;
|
||
|
<a name="l1188"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(left,i,win_task);
|
||
|
<a name="l1189"></a> </span><span class=cF1>if</span><span class=cF0> (top<0)
|
||
|
<a name="l1190"></a> top=0;
|
||
|
<a name="l1191"></a> i=top+doc->max_y-doc->min_y;
|
||
|
<a name="l1192"></a> </span><span class=cF1>if</span><span class=cF0> (i></span><span class=cF3>TEXT_ROWS</span><span class=cF0>-1)
|
||
|
<a name="l1193"></a> i=</span><span class=cF3>TEXT_ROWS</span><span class=cF0>-1;
|
||
|
<a name="l1194"></a> </span><span class=cF5>WinVert</span><span class=cF0>(top,i,win_task);
|
||
|
<a name="l1195"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1196"></a> </span><span class=cF1>if</span><span class=cF0> (left<1)
|
||
|
<a name="l1197"></a> left=1;
|
||
|
<a name="l1198"></a> i=left+doc->max_x-doc->min_x;
|
||
|
<a name="l1199"></a> </span><span class=cF1>if</span><span class=cF0> (i></span><span class=cF3>TEXT_COLS</span><span class=cF0>-2)
|
||
|
<a name="l1200"></a> i=</span><span class=cF3>TEXT_COLS</span><span class=cF0>-2;
|
||
|
<a name="l1201"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(left,i,win_task);
|
||
|
<a name="l1202"></a> </span><span class=cF1>if</span><span class=cF0> (top<1)
|
||
|
<a name="l1203"></a> top=1;
|
||
|
<a name="l1204"></a> i=top+doc->max_y-doc->min_y;
|
||
|
<a name="l1205"></a> </span><span class=cF1>if</span><span class=cF0> (i></span><span class=cF3>TEXT_ROWS</span><span class=cF0>-2)
|
||
|
<a name="l1206"></a> i=</span><span class=cF3>TEXT_ROWS</span><span class=cF0>-2;
|
||
|
<a name="l1207"></a> </span><span class=cF5>WinVert</span><span class=cF0>(top,i,win_task);
|
||
|
<a name="l1208"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1209"></a> }
|
||
|
<a name="l1210"></a> </span><span class=cF1>if</span><span class=cF0> (find_cursor) {
|
||
|
<a name="l1211"></a> doc->cur_entry=best_doc_e;
|
||
|
<a name="l1212"></a> doc->cur_col=best_col;
|
||
|
<a name="l1213"></a> </span><span class=cF5>DocFormBwd</span><span class=cF0>(doc);
|
||
|
<a name="l1214"></a></span><span class=cF2>//We need this because text coordinates are used</span><span class=cF0>
|
||
|
<a name="l1215"></a> </span><span class=cF1>if</span><span class=cF0> (best_d<</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)
|
||
|
<a name="l1216"></a> best_d=0;
|
||
|
<a name="l1217"></a> doc->best_d=best_d;
|
||
|
<a name="l1218"></a> }
|
||
|
<a name="l1219"></a>
|
||
|
<a name="l1220"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry->type_u8!=</span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>) {
|
||
|
<a name="l1221"></a> doc->y=doc->cur_entry->y;
|
||
|
<a name="l1222"></a> doc->x=doc->cur_entry->x+doc->cur_col;
|
||
|
<a name="l1223"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1224"></a> doc->y=doc->cur_entry->y+doc->cur_col/3/doc->cur_entry->hex_ed_width;
|
||
|
<a name="l1225"></a> x=doc->cur_col%(doc->cur_entry->hex_ed_width*3);
|
||
|
<a name="l1226"></a> i=x/doc->cur_entry->hex_ed_width;
|
||
|
<a name="l1227"></a> doc->x=doc->cur_entry->x+9;
|
||
|
<a name="l1228"></a> </span><span class=cF1>if</span><span class=cF0> (i<2)
|
||
|
<a name="l1229"></a> doc->x+=x>>1*3+x&1;
|
||
|
<a name="l1230"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1231"></a> doc->x+=doc->cur_entry->hex_ed_width*3+
|
||
|
<a name="l1232"></a> (x-doc->cur_entry->hex_ed_width<<1);
|
||
|
<a name="l1233"></a> }
|
||
|
<a name="l1234"></a> doc->line=doc->y+1;
|
||
|
<a name="l1235"></a> doc->col=doc->x+1;
|
||
|
<a name="l1236"></a>
|
||
|
<a name="l1237"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>) {
|
||
|
<a name="l1238"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1239"></a> x=0;
|
||
|
<a name="l1240"></a> y=0;
|
||
|
<a name="l1241"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1242"></a> x=scroll_x/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
||
|
<a name="l1243"></a> y=scroll_y/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l1244"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1245"></a> </span><span class=cF1>if</span><span class=cF0> (doc->top_line_num-y+height-1>doc->max_y)
|
||
|
<a name="l1246"></a> doc->top_line_num=doc->max_y-(height-1)+y;
|
||
|
<a name="l1247"></a> </span><span class=cF1>if</span><span class=cF0> (doc->top_line_num-y<doc->min_y)
|
||
|
<a name="l1248"></a> doc->top_line_num=doc->min_y+y;
|
||
|
<a name="l1249"></a>
|
||
|
<a name="l1250"></a> </span><span class=cF1>if</span><span class=cF0> (doc->y-doc->top_line_num+y>height-1)
|
||
|
<a name="l1251"></a> doc->top_line_num=doc->y-(height-1)+y;
|
||
|
<a name="l1252"></a> </span><span class=cF1>if</span><span class=cF0> (doc->y-doc->top_line_num+y<0)
|
||
|
<a name="l1253"></a> doc->top_line_num=doc->y+y;
|
||
|
<a name="l1254"></a>
|
||
|
<a name="l1255"></a> </span><span class=cF1>if</span><span class=cF0> (doc->line_start_col-x+width-1>doc->max_x)
|
||
|
<a name="l1256"></a> doc->line_start_col=doc->max_x-(width-1)+x;
|
||
|
<a name="l1257"></a> </span><span class=cF1>if</span><span class=cF0> (doc->line_start_col-x<doc->min_x)
|
||
|
<a name="l1258"></a> doc->line_start_col=doc->min_x+x;
|
||
|
<a name="l1259"></a>
|
||
|
<a name="l1260"></a> </span><span class=cF1>if</span><span class=cF0> (doc->x-doc->line_start_col+x>width-1)
|
||
|
<a name="l1261"></a> doc->line_start_col=doc->x-(width-1)+x;
|
||
|
<a name="l1262"></a> </span><span class=cF1>if</span><span class=cF0> (doc->x-doc->line_start_col+x<0)
|
||
|
<a name="l1263"></a> doc->line_start_col=doc->x+x;
|
||
|
<a name="l1264"></a> }
|
||
|
<a name="l1265"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1266"></a> </span><span class=cF1>if</span><span class=cF0> (recalc_flags&</span><span class=cF3>RECALCG_MASK</span><span class=cF0>==</span><span class=cF3>RECALCt_TO_SCRN</span><span class=cF0> &&
|
||
|
<a name="l1267"></a> recalc_flags&</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1268"></a> x=doc->x-doc->line_start_col+left +scroll_x/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
||
|
<a name="l1269"></a> y=doc->y-doc->top_line_num+top+scroll_y/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l1270"></a> </span><span class=cF1>if</span><span class=cF0> (0<=x<=right && 0<=y<=bottom &&
|
||
|
<a name="l1271"></a> x<</span><span class=cF3>TEXT_COLS</span><span class=cF0> && y<</span><span class=cF3>TEXT_ROWS</span><span class=cF0> &&
|
||
|
<a name="l1272"></a> !</span><span class=cF7>(</span><span class=cF0>doc->flags&</span><span class=cF3>DOCF_HIDE_CURSOR</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1273"></a> u32_ptr=</span><span class=cFB>gr</span><span class=cF0>.text_base+y*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+x;
|
||
|
<a name="l1274"></a> *u32_ptr|=</span><span class=cF3>DOCET_BLINK</span><span class=cF0>;
|
||
|
<a name="l1275"></a> *u32_ptr^=0xFF00;
|
||
|
<a name="l1276"></a> }
|
||
|
<a name="l1277"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) {
|
||
|
<a name="l1278"></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_NO_SCROLL_BARS</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1279"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&hss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1280"></a> hss->min=doc->min_x;
|
||
|
<a name="l1281"></a> </span><span class=cF1>if</span><span class=cF0> (doc->max_x-width+1<hss->min)
|
||
|
<a name="l1282"></a> hss->max=hss->min;
|
||
|
<a name="l1283"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1284"></a> hss->max=doc->max_x-width+1;
|
||
|
<a name="l1285"></a> hss->pos=doc->line_start_col;
|
||
|
<a name="l1286"></a> }
|
||
|
<a name="l1287"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&vss->flags,</span><span class=cF3>WSSf_SET_TO_POS</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1288"></a> vss->min=doc->min_y;
|
||
|
<a name="l1289"></a> </span><span class=cF1>if</span><span class=cF0> (doc->max_y-height+1<vss->min)
|
||
|
<a name="l1290"></a> vss->max=vss->min;
|
||
|
<a name="l1291"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1292"></a> vss->max=doc->max_y-height+1;
|
||
|
<a name="l1293"></a> vss->pos=doc->top_line_num;
|
||
|
<a name="l1294"></a> }
|
||
|
<a name="l1295"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1296"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&doc->flags,</span><span class=cF3>DOCf_MORE</span><span class=cF0>,more);
|
||
|
<a name="l1297"></a> }
|
||
|
<a name="l1298"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1299"></a> </span><span class=cF1>if</span><span class=cF0> (!same_win) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1300"></a> doc->old_win_top=top;
|
||
|
<a name="l1301"></a> doc->old_win_bottom=bottom;
|
||
|
<a name="l1302"></a> doc->old_win_left=left;
|
||
|
<a name="l1303"></a> doc->old_win_right=right;
|
||
|
<a name="l1304"></a> doc->old_cur_entry=doc->cur_entry;
|
||
|
<a name="l1305"></a> doc->old_cur_col=doc->old_cur_col;
|
||
|
<a name="l1306"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1307"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags & </span><span class=cF3>DOCF_HAS_SONG</span><span class=cF0>)
|
||
|
<a name="l1308"></a> </span><span class=cF5>LBts</span><span class=cF0>(&win_task->task_flags,</span><span class=cF3>TASKf_HAS_SONG</span><span class=cF0>);
|
||
|
<a name="l1309"></a> </span><span class=cF1>if</span><span class=cF0> (full_refresh) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1310"></a> i=num_entries-doc->max_entries;
|
||
|
<a name="l1311"></a> </span><span class=cF1>if</span><span class=cF0> (next_clear_found) {
|
||
|
<a name="l1312"></a> </span><span class=cF5>DocDelToEntry</span><span class=cF0>(doc,next_clear_found,clear_holds);
|
||
|
<a name="l1313"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc,recalc_flags);
|
||
|
<a name="l1314"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i>1024) {
|
||
|
<a name="l1315"></a> </span><span class=cF5>DocDelToNum</span><span class=cF0>(doc,i);
|
||
|
<a name="l1316"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc,recalc_flags);
|
||
|
<a name="l1317"></a> }
|
||
|
<a name="l1318"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1319"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
||
|
<a name="l1320"></a> </span><span class=cF5>Free</span><span class=cF0>(depth_buf);
|
||
|
<a name="l1321"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l1322"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l1323"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1324"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|