mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-01-07 05:06:32 +00:00
dbf8647d59
Added top & right borders to RawDr. Improved spacing in some debug and compiler reporting. Fixed RawPutChar and EdLite tab width. Fixed Ui missing '0x' prefix syntax highlighter bug. Added 32BitPaint demo.
1066 lines
134 KiB
HTML
Executable file
1066 lines
134 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.08">
|
|
<style type="text/css">
|
|
body {background-color:#000000;}
|
|
.cF0{color:#ffffff;background-color:#000000;}
|
|
.cF1{color:#3465a4;background-color:#000000;}
|
|
.cF2{color:#4e9a06;background-color:#000000;}
|
|
.cF3{color:#06989a;background-color:#000000;}
|
|
.cF4{color:#a24444;background-color:#000000;}
|
|
.cF5{color:#75507b;background-color:#000000;}
|
|
.cF6{color:#ce982f;background-color:#000000;}
|
|
.cF7{color:#bcc0b9;background-color:#000000;}
|
|
.cF8{color:#555753;background-color:#000000;}
|
|
.cF9{color:#729fcf;background-color:#000000;}
|
|
.cFA{color:#82bc49;background-color:#000000;}
|
|
.cFB{color:#34e2e2;background-color:#000000;}
|
|
.cFC{color:#ac3535;background-color:#000000;}
|
|
.cFD{color:#ad7fa8;background-color:#000000;}
|
|
.cFE{color:#fce94f;background-color:#000000;}
|
|
.cFF{color:#000000;background-color:#000000;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Windows;Task/Delay"</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Refresh</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> count = </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF1>Bool</span><span class=cF0> force = </span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l4"></a>{</span><span class=cF2>//Wait for 60fps WinMgr to start & finish screen refresh.</span><span class=cF0>
|
|
<a name="l5"></a> </span><span class=cF2>//0,FALSE Count Sync to WinMgr.</span><span class=cF0>
|
|
<a name="l6"></a> </span><span class=cF2>//0,TRUE</span><span class=cF0> </span><span class=cF2>Pump Messages.</span><span class=cF0>
|
|
<a name="l7"></a> </span><span class=cF2>//1 Count Wait and Pump Messages.</span><span class=cF0>
|
|
<a name="l8"></a> </span><span class=cF2>//2 Count Make Sure to do a Full Refresh</span><span class=cF0>
|
|
<a name="l9"></a> </span><span class=cF2>//and Set Cur Pos.</span><span class=cF0>
|
|
<a name="l10"></a> </span><span class=cF1>Bool</span><span class=cF0> old_full_refresh, old_idle = </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->task_flags, </span><span class=cF3>TASKf_IDLE</span><span class=cF0>);
|
|
<a name="l11"></a> </span><span class=cF9>CDoc</span><span class=cF0> *old_doc = </span><span class=cF5>DocPut</span><span class=cF0>;
|
|
<a name="l12"></a> </span><span class=cF9>I64</span><span class=cF0> update_count;
|
|
<a name="l13"></a>
|
|
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (!count && force)
|
|
<a name="l15"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_JUST_PUMP_MESSAGES</span><span class=cF0>], </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l16"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>], </span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l17"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (force && </span><span class=cFB>sys_winmgr_task</span><span class=cF0>)
|
|
<a name="l19"></a> </span><span class=cFB>sys_winmgr_task</span><span class=cF0>->wake_jiffy = </span><span class=cFB>counts</span><span class=cF0>.jiffies;
|
|
<a name="l20"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
|
<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> (count > </span><span class=cFE>1</span><span class=cF0> && old_doc)
|
|
<a name="l23"></a> old_full_refresh = </span><span class=cF5>LBts</span><span class=cF0>(&old_doc->flags, </span><span class=cF3>DOCf_DO_FULL_REFRESH</span><span class=cF0>);
|
|
<a name="l24"></a> update_count = </span><span class=cFB>winmgr</span><span class=cF0>.updates+count;
|
|
<a name="l25"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>winmgr</span><span class=cF0>.updates < update_count)
|
|
<a name="l26"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (force && </span><span class=cFB>sys_winmgr_task</span><span class=cF0>)
|
|
<a name="l28"></a> </span><span class=cFB>sys_winmgr_task</span><span class=cF0>->wake_jiffy = </span><span class=cFB>counts</span><span class=cF0>.jiffies;
|
|
<a name="l29"></a> </span><span class=cF5>Sleep</span><span class=cF0>(</span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l30"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (old_doc)
|
|
<a name="l32"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&old_doc->flags, </span><span class=cF3>DOCf_DO_FULL_REFRESH</span><span class=cF0>, old_full_refresh);
|
|
<a name="l33"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->task_flags, </span><span class=cF3>TASKf_IDLE</span><span class=cF0>, old_idle);
|
|
<a name="l34"></a>}
|
|
<a name="l35"></a>
|
|
<a name="l36"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Windows"</span><span class=cF0>
|
|
<a name="l37"></a>
|
|
<a name="l38"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>WinQueueIPMessages</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> que)
|
|
<a name="l39"></a>{
|
|
<a name="l40"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF9>CD3I64</span><span class=cF0> single_mouse = </span><span class=cF7>{</span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l41"></a> </span><span class=cF1>F64</span><span class=cF0> time = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l42"></a> </span><span class=cF9>I64</span><span class=cF0> message_code = </span><span class=cFE>0</span><span class=cF0>, arg1, arg2, single_arg1, single_arg2;
|
|
<a name="l43"></a> </span><span class=cF9>CTask</span><span class=cF0> *task_focus = </span><span class=cFB>sys_focus_task</span><span class=cF0>;
|
|
<a name="l44"></a>
|
|
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (task_focus && !</span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll)
|
|
<a name="l46"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l47"></a> arg1 = </span><span class=cFB>mouse</span><span class=cF0>.pos.x - task_focus->pix_left - task_focus->scroll_x;
|
|
<a name="l48"></a> arg2 = </span><span class=cFB>mouse</span><span class=cF0>.pos.y - task_focus->pix_top - task_focus->scroll_y;
|
|
<a name="l49"></a> single_arg1 = single_mouse.x - task_focus->pix_left - task_focus->scroll_x;
|
|
<a name="l50"></a> single_arg2 = single_mouse.y - task_focus->pix_top - task_focus->scroll_y;
|
|
<a name="l51"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.presnap.x != </span><span class=cFB>mouse</span><span class=cF0>.presnap.x || </span><span class=cFB>old_mouse</span><span class=cF0>.presnap.y != </span><span class=cFB>mouse</span><span class=cF0>.presnap.y)
|
|
<a name="l52"></a> {
|
|
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l54"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l55"></a> message_code = </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>;
|
|
<a name="l56"></a> }
|
|
<a name="l57"></a></span><span class=cF2>//TODO que message for mouse.pos.z?</span><span class=cF0>
|
|
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time)
|
|
<a name="l59"></a> {
|
|
<a name="l60"></a> </span><span class=cF1>if</span><span class=cF0> (time > </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time)
|
|
<a name="l61"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.left_dbl)
|
|
<a name="l63"></a> {
|
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.left_down_sent)
|
|
<a name="l65"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l67"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_D_DOWN</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l68"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_down_sent = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l69"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_D_DOWN</span><span class=cF0>;
|
|
<a name="l70"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l71"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l72"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l74"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_D_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l75"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l76"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_D_UP</span><span class=cF0>;
|
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l78"></a> }
|
|
<a name="l79"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l80"></a> {
|
|
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.left_down_sent)
|
|
<a name="l82"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l83"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l84"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>, single_arg1, single_arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l85"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_down_sent = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l86"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>;
|
|
<a name="l87"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l89"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l91"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l92"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l93"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>;
|
|
<a name="l94"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l95"></a> }
|
|
<a name="l96"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l97"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l98"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l99"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse_last</span><span class=cF0>.lb) {
|
|
<a name="l100"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time = time;
|
|
<a name="l101"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l102"></a> }
|
|
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l104"></a> }
|
|
<a name="l105"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l106"></a> {
|
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task_focus</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task_focus->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_L_D</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l108"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse_last</span><span class=cF0>.lb)
|
|
<a name="l110"></a> {
|
|
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l112"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l113"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>;
|
|
<a name="l114"></a> }
|
|
<a name="l115"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cFB>mouse_last</span><span class=cF0>.lb)
|
|
<a name="l116"></a> {
|
|
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l118"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l119"></a> message_code = </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>;
|
|
<a name="l120"></a> }
|
|
<a name="l121"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l122"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l123"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse_last</span><span class=cF0>.lb)
|
|
<a name="l125"></a> {
|
|
<a name="l126"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l127"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_down_sent = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l128"></a> </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time = time + </span><span class=cFB>mouse</span><span class=cF0>.dbl_time;
|
|
<a name="l129"></a> single_mouse.x = </span><span class=cFB>mouse</span><span class=cF0>.pos.x;
|
|
<a name="l130"></a> single_mouse.y = </span><span class=cFB>mouse</span><span class=cF0>.pos.y;
|
|
<a name="l131"></a> }
|
|
<a name="l132"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l133"></a> }
|
|
<a name="l134"></a>
|
|
<a name="l135"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time)
|
|
<a name="l136"></a> {
|
|
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (time > </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time)
|
|
<a name="l138"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.right_dbl)
|
|
<a name="l140"></a> {
|
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.right_down_sent)
|
|
<a name="l142"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l144"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_D_DOWN</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l145"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_down_sent = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l146"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_D_DOWN</span><span class=cF0>;
|
|
<a name="l147"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l149"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l150"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l151"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_D_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l152"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l153"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_D_UP</span><span class=cF0>;
|
|
<a name="l154"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l155"></a> }
|
|
<a name="l156"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l157"></a> {
|
|
<a name="l158"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.right_down_sent)
|
|
<a name="l159"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l160"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l161"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_DOWN</span><span class=cF0>, single_arg1, single_arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l162"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_down_sent = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l163"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_DOWN</span><span class=cF0>;
|
|
<a name="l164"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l166"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l168"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l169"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l170"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0>;
|
|
<a name="l171"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l172"></a> }
|
|
<a name="l173"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l174"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l175"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l176"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb && !</span><span class=cFB>mouse_last</span><span class=cF0>.rb)
|
|
<a name="l177"></a> {
|
|
<a name="l178"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time = time;
|
|
<a name="l179"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l180"></a> }
|
|
<a name="l181"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l182"></a> }
|
|
<a name="l183"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l184"></a> {
|
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task_focus</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task_focus->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_R_D</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l186"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb && !</span><span class=cFB>mouse_last</span><span class=cF0>.rb) {
|
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l189"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_DOWN</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l190"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_DOWN</span><span class=cF0>;
|
|
<a name="l191"></a> }
|
|
<a name="l192"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>mouse</span><span class=cF0>.rb && </span><span class=cFB>mouse_last</span><span class=cF0>.rb)
|
|
<a name="l193"></a> {
|
|
<a name="l194"></a> </span><span class=cF1>if</span><span class=cF0> (que)
|
|
<a name="l195"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task_focus, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0>, arg1, arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l196"></a> message_code = </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0>;
|
|
<a name="l197"></a> }
|
|
<a name="l198"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l199"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l200"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l201"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb && !</span><span class=cFB>mouse_last</span><span class=cF0>.rb) {
|
|
<a name="l202"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l203"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_down_sent = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l204"></a> </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time = time + </span><span class=cFB>mouse</span><span class=cF0>.dbl_time;
|
|
<a name="l205"></a> single_mouse.x = </span><span class=cFB>mouse</span><span class=cF0>.pos.x;
|
|
<a name="l206"></a> single_mouse.y = </span><span class=cFB>mouse</span><span class=cF0>.pos.y;
|
|
<a name="l207"></a> }
|
|
<a name="l208"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l209"></a> }
|
|
<a name="l210"></a>
|
|
<a name="l211"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&</span><span class=cFB>mouse_last</span><span class=cF0>, &</span><span class=cFB>mouse</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMouseStateGlobals</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l212"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&</span><span class=cFB>old_mouse</span><span class=cF0>, &</span><span class=cFB>mouse</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMouseStateGlobals</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l213"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l214"></a>
|
|
<a name="l215"></a> </span><span class=cF1>return</span><span class=cF0> message_code;
|
|
<a name="l216"></a>}
|
|
<a name="l217"></a>
|
|
<a name="l218"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>WinCalcIdles</span><span class=cF0>()
|
|
<a name="l219"></a>{
|
|
<a name="l220"></a> </span><span class=cF1>F64</span><span class=cF0> calc_idle_time;
|
|
<a name="l221"></a> </span><span class=cF9>I64</span><span class=cF0> i, k, total_jiffies, total_jiffies_delta, idle_pt_hits[</span><span class=cF3>MP_PROCESSORS_NUM</span><span class=cF0>];
|
|
<a name="l222"></a> </span><span class=cF9>CCPU</span><span class=cF0> *c;
|
|
<a name="l223"></a> </span><span class=cF9>CWinMgrTimingGlobals</span><span class=cF0> *t = </span><span class=cFB>winmgr</span><span class=cF0>.t;
|
|
<a name="l224"></a>
|
|
<a name="l225"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>t->calc_idle_delta_time = (calc_idle_time = </span><span class=cF5>tS</span><span class=cF0>) - t->last_calc_idle_time</span><span class=cF7>)</span><span class=cF0> > .</span><span class=cFE>25</span><span class=cF0>)
|
|
<a name="l226"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l227"></a> </span><span class=cF1>PUSHFD</span><span class=cF0>
|
|
<a name="l228"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
|
<a name="l229"></a> total_jiffies = </span><span class=cFB>cpu_structs</span><span class=cF0>[</span><span class=cFE>0</span><span class=cF0>].total_jiffies;
|
|
<a name="l230"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFB>mp_count</span><span class=cF0>; i++)
|
|
<a name="l231"></a> idle_pt_hits[i] = </span><span class=cFB>cpu_structs</span><span class=cF0>[i].idle_pt_hits;
|
|
<a name="l232"></a> </span><span class=cF1>POPFD</span><span class=cF0>
|
|
<a name="l233"></a>
|
|
<a name="l234"></a> total_jiffies_delta = total_jiffies - t->last_total_jiffies;
|
|
<a name="l235"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFB>mp_count</span><span class=cF0>; i++)
|
|
<a name="l236"></a> {
|
|
<a name="l237"></a> c = &</span><span class=cFB>cpu_structs</span><span class=cF0>[i];
|
|
<a name="l238"></a> </span><span class=cF1>if</span><span class=cF0> (total_jiffies_delta && </span><span class=cF7>(</span><span class=cF0>k = idle_pt_hits[i] - t->last_idle_pt_hits[i]</span><span class=cF7>)</span><span class=cF0> >= </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l239"></a> c->idle_factor = </span><span class=cF5>Clamp</span><span class=cF0>(</span><span class=cF5>ToF64</span><span class=cF7>(</span><span class=cF0>k</span><span class=cF7>)</span><span class=cF0> / total_jiffies_delta, </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>01</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>99</span><span class=cF0>);
|
|
<a name="l240"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l241"></a> c->idle_factor = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>01</span><span class=cF0>;
|
|
<a name="l242"></a> t->last_idle_pt_hits[i] = idle_pt_hits[i];
|
|
<a name="l243"></a> }
|
|
<a name="l244"></a> t->last_total_jiffies = total_jiffies;
|
|
<a name="l245"></a> t->last_calc_idle_time = calc_idle_time;
|
|
<a name="l246"></a> t->calc_idle_count++;
|
|
<a name="l247"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l248"></a>}
|
|
<a name="l249"></a>
|
|
<a name="l250"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> flush_messages = </span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l251"></a>{
|
|
<a name="l252"></a> </span><span class=cF9>I64</span><span class=cF0> timeout_val, message_code=</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l253"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c;
|
|
<a name="l254"></a> </span><span class=cF1>Bool</span><span class=cF0> que;
|
|
<a name="l255"></a> </span><span class=cF1>F64</span><span class=cF0> t, t_delta;
|
|
<a name="l256"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
|
<a name="l257"></a> </span><span class=cF9>CDC</span><span class=cF0> *diff;
|
|
<a name="l258"></a> </span><span class=cF9>CDate</span><span class=cF0> cdt;
|
|
<a name="l259"></a>
|
|
<a name="l260"></a> </span><span class=cF5>TimeCal</span><span class=cF0>;
|
|
<a name="l261"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>t_delta = (t = </span><span class=cF5>tS</span><span class=cF0>) - </span><span class=cFB>winmgr</span><span class=cF0>.last_refresh_tS</span><span class=cF7>)</span><span class=cF0> > </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>01</span><span class=cF0>)
|
|
<a name="l262"></a> </span><span class=cFB>winmgr</span><span class=cF0>.fps = </span><span class=cF5>Max</span><span class=cF0>(</span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0> / t_delta, </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l263"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l264"></a> </span><span class=cFB>winmgr</span><span class=cF0>.fps = </span><span class=cFE>99</span><span class=cF0>;
|
|
<a name="l265"></a> </span><span class=cFB>winmgr</span><span class=cF0>.last_refresh_tS = t;
|
|
<a name="l266"></a> </span><span class=cF5>WinCalcIdles</span><span class=cF0>;
|
|
<a name="l267"></a>
|
|
<a name="l268"></a> </span><span class=cF1>if</span><span class=cF0> (flush_messages)
|
|
<a name="l269"></a> </span><span class=cF5>FifoI64Flush</span><span class=cF0>(</span><span class=cFB>kbd</span><span class=cF0>.scan_code_fifo);
|
|
<a name="l270"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l271"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l272"></a> </span><span class=cF5>KbdMessagesQueue</span><span class=cF0>;
|
|
<a name="l273"></a>
|
|
<a name="l274"></a> que = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l275"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0> && !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_CTRLS</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l276"></a> c = </span><span class=cFB>sys_focus_task</span><span class=cF0>->next_ctrl;
|
|
<a name="l277"></a> </span><span class=cF1>while</span><span class=cF0> (c != &</span><span class=cFB>sys_focus_task</span><span class=cF0>->next_ctrl)
|
|
<a name="l278"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l279"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l280"></a> {
|
|
<a name="l281"></a> que = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l282"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l283"></a> }
|
|
<a name="l284"></a> c = c->next;
|
|
<a name="l285"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l286"></a> }
|
|
<a name="l287"></a> message_code = </span><span class=cF5>WinQueueIPMessages</span><span class=cF0>(que);
|
|
<a name="l288"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l289"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l290"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l291"></a> </span><span class=cF5>WinRefocus</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>);
|
|
<a name="l292"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l293"></a> </span><span class=cF5>FifoI64Flush</span><span class=cF0>(</span><span class=cFB>kbd</span><span class=cF0>.scan_code_fifo);
|
|
<a name="l294"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l295"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_focus_task</span><span class=cF0>)
|
|
<a name="l296"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->task_flags, </span><span class=cF3>TASKf_HAS_SONG</span><span class=cF0>);
|
|
<a name="l297"></a> </span><span class=cF5>WinMouseUpdate</span><span class=cF0>;
|
|
<a name="l298"></a>
|
|
<a name="l299"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>LBtr</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_JUST_PUMP_MESSAGES</span><span class=cF0>], </span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l300"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l301"></a> t = </span><span class=cF5>tS</span><span class=cF0> + </span><span class=cF3>WINMGR_PERIOD</span><span class=cF0> / </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l302"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS < t)
|
|
<a name="l303"></a> </span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS += </span><span class=cF3>WINMGR_PERIOD</span><span class=cF0>;
|
|
<a name="l304"></a> timeout_val = </span><span class=cFB>counts</span><span class=cF0>.jiffies + (</span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS - </span><span class=cF5>tS</span><span class=cF0>) * </span><span class=cF3>JIFFY_FREQ</span><span class=cF0>;
|
|
<a name="l305"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>], </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l306"></a> </span><span class=cF5>GrUpdateScreen</span><span class=cF0>;
|
|
<a name="l307"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>], </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>screencast</span><span class=cF0>.record && !</span><span class=cFB>screencast</span><span class=cF0>.just_audio)
|
|
<a name="l309"></a> {
|
|
<a name="l310"></a> cdt = </span><span class=cFB>screencast</span><span class=cF0>.t0_now(</span><span class=cF9>I64</span><span class=cF0>) + </span><span class=cF5>ToI64</span><span class=cF0>(</span><span class=cF3>CDATE_FREQ</span><span class=cF0> * </span><span class=cF7>(</span><span class=cF5>tS</span><span class=cF0> - </span><span class=cFB>screencast</span><span class=cF0>.t0_tS</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l311"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>screencast</span><span class=cF0>.dc)
|
|
<a name="l312"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l313"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc = </span><span class=cF5>DCCopy</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc2_alias);
|
|
<a name="l314"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc->cdt = cdt;
|
|
<a name="l315"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.print_format, cdt);
|
|
<a name="l316"></a> </span><span class=cF5>GRWrite</span><span class=cF0>(st, </span><span class=cFB>screencast</span><span class=cF0>.dc);
|
|
<a name="l317"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l318"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l319"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MemCompare</span><span class=cF7>(</span><span class=cFB>screencast</span><span class=cF0>.dc->body,
|
|
<a name="l320"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc2_alias->body, </span><span class=cF5>MSize</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc2_alias->body)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l321"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l322"></a> diff = </span><span class=cF5>DCDiff</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc, </span><span class=cFB>screencast</span><span class=cF0>.dc2_alias);
|
|
<a name="l323"></a> diff->cdt = cdt;
|
|
<a name="l324"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.print_format, cdt);
|
|
<a name="l325"></a> </span><span class=cF5>GRWrite</span><span class=cF0>(st, diff);
|
|
<a name="l326"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l327"></a> </span><span class=cF5>DCDel</span><span class=cF0>(diff);
|
|
<a name="l328"></a> </span><span class=cF5>Free</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc->body);
|
|
<a name="l329"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc->body = </span><span class=cF5>MAllocIdent</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc2_alias->body);
|
|
<a name="l330"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l331"></a> }
|
|
<a name="l332"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>screencast</span><span class=cF0>.dc)
|
|
<a name="l333"></a> {
|
|
<a name="l334"></a> </span><span class=cF5>DCDel</span><span class=cF0>(</span><span class=cFB>screencast</span><span class=cF0>.dc); </span><span class=cF2>//TODO: </span><a href="https://tomawezome.github.io/ZealOS/System/Utils/MemRep.CC.html#l219"><span class=cF4>MemRep</span></a><span class=cF2> can crash.</span><span class=cF0>
|
|
<a name="l335"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l336"></a> }
|
|
<a name="l337"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_focus_task</span><span class=cF0> && !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_focus_task</span><span class=cF0>->task_flags, </span><span class=cF3>TASKf_HAS_SONG</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l338"></a> {
|
|
<a name="l339"></a> </span><span class=cF5>Free</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song);
|
|
<a name="l340"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l341"></a> }
|
|
<a name="l342"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>music</span><span class=cF0>.cur_song)
|
|
<a name="l343"></a> {
|
|
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>music</span><span class=cF0>.cur_song_task)
|
|
<a name="l345"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song_task = </span><span class=cF5>Spawn</span><span class=cF0>(&</span><span class=cF5>CurSongTask</span><span class=cF0>, </span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF6>"Song"</span><span class=cF0>);
|
|
<a name="l346"></a> }
|
|
<a name="l347"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>music</span><span class=cF0>.cur_song_task)
|
|
<a name="l348"></a> {
|
|
<a name="l349"></a> </span><span class=cF5>Kill</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song_task);
|
|
<a name="l350"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song_task = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l351"></a> }
|
|
<a name="l352"></a> </span><span class=cFB>winmgr</span><span class=cF0>.updates++;
|
|
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse_hard</span><span class=cF0>.install_attempts) </span><span class=cF2>//Don't call before boot mouse install attempt</span><span class=cF0>
|
|
<a name="l354"></a> </span><span class=cF5>KbdMouseHandler</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l355"></a> </span><span class=cF5>SleepUntil</span><span class=cF0>(timeout_val);
|
|
<a name="l356"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l357"></a>
|
|
<a name="l358"></a> </span><span class=cF1>return</span><span class=cF0> message_code;
|
|
<a name="l359"></a>}
|
|
<a name="l360"></a>
|
|
<a name="l361"></a></span><span class=cF9>CDoc</span><span class=cF0> *</span><span class=cF5>WinCursorPosSet</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>I64</span><span class=cF0> mouse_x, </span><span class=cF9>I64</span><span class=cF0> mouse_y, </span><span class=cF1>Bool</span><span class=cF0> set_cursor = </span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l362"></a>{
|
|
<a name="l363"></a> </span><span class=cF9>CDoc</span><span class=cF0> *res = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l364"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
|
<a name="l365"></a> </span><span class=cF9>I64</span><span class=cF0> x0, y0;
|
|
<a name="l366"></a>
|
|
<a name="l367"></a> </span><span class=cF1>if</span><span class=cF0> (!task)
|
|
<a name="l368"></a> task = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l369"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinInside</span><span class=cF7>(</span><span class=cF0>mouse_x, mouse_y, task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l370"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l371"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>res = </span><span class=cF5>DocDisplay</span><span class=cF0>(task)</span><span class=cF7>)</span><span class=cF0> && res->flags & </span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF0>)
|
|
<a name="l372"></a> res = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l373"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (set_cursor)
|
|
<a name="l374"></a> {
|
|
<a name="l375"></a> unlock = </span><span class=cF5>DocLock</span><span class=cF0>(res);
|
|
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (res->doc_signature != </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l377"></a> res = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l378"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l379"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l380"></a> x0 = res->line_start_col;
|
|
<a name="l381"></a> y0 = res->top_line_num;
|
|
<a name="l382"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(res, </span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>);
|
|
<a name="l383"></a> res->x = (mouse_x-task->pix_left - task->scroll_x) / </span><span class=cF3>FONT_WIDTH</span><span class=cF0> + x0;
|
|
<a name="l384"></a> res->y = (mouse_y-task->pix_top - task->scroll_y) / </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + y0;
|
|
<a name="l385"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(res, </span><span class=cF3>RECALCt_FIND_CURSOR</span><span class=cF0>);
|
|
<a name="l386"></a> task->scroll_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l387"></a> task->scroll_y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l388"></a> task->scroll_z = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l389"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
|
<a name="l390"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(res);
|
|
<a name="l391"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l392"></a> }
|
|
<a name="l393"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l394"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l395"></a>
|
|
<a name="l396"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l397"></a>}
|
|
<a name="l398"></a>
|
|
<a name="l399"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>WinKeyNavMenu</span><span class=cF0>()
|
|
<a name="l400"></a>{
|
|
<a name="l401"></a> </span><span class=cF9>I64</span><span class=cF0> i, old_key_count;
|
|
<a name="l402"></a> </span><span class=cF9>CD3I64</span><span class=cF0> old_pos, new_pos;
|
|
<a name="l403"></a> </span><span class=cF9>CMenu</span><span class=cF0> *m;
|
|
<a name="l404"></a> </span><span class=cF9>CMenuEntry</span><span class=cF0> *tmpme;
|
|
<a name="l405"></a> </span><span class=cF9>CTask</span><span class=cF0> *focus = </span><span class=cF5>MenuTask</span><span class=cF0>;
|
|
<a name="l406"></a>
|
|
<a name="l407"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_GUI</span><span class=cF7>)</span><span class=cF0> && focus && </span><span class=cF7>(</span><span class=cF0>m = focus->cur_menu</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l408"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l409"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l410"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0> = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l411"></a> old_pos.x = </span><span class=cFB>mouse</span><span class=cF0>.pos.x;
|
|
<a name="l412"></a> old_pos.y = </span><span class=cFB>mouse</span><span class=cF0>.pos.y;
|
|
<a name="l413"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.x = new_pos.x = </span><span class=cFB>mouse</span><span class=cF0>.pos.y = new_pos.y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l414"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_GUI</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l415"></a> {
|
|
<a name="l416"></a> old_key_count = </span><span class=cFB>kbd</span><span class=cF0>.count;
|
|
<a name="l417"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_LEFT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l418"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l419"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_LEFT</span><span class=cF7>)</span><span class=cF0> && </span><span class=cFB>kbd</span><span class=cF0>.count == old_key_count)
|
|
<a name="l420"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l421"></a> </span><span class=cF1>if</span><span class=cF0> (new_pos.x)
|
|
<a name="l422"></a> {
|
|
<a name="l423"></a> i = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l424"></a> tmpme = m->sub;
|
|
<a name="l425"></a> </span><span class=cF1>while</span><span class=cF0> (tmpme)
|
|
<a name="l426"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l427"></a> </span><span class=cF1>if</span><span class=cF0> (i + </span><span class=cF5>MenuEntryWidth</span><span class=cF7>(</span><span class=cF0>tmpme</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> == new_pos.x)
|
|
<a name="l428"></a> {
|
|
<a name="l429"></a> new_pos.x = i;
|
|
<a name="l430"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l431"></a> }
|
|
<a name="l432"></a> i += </span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme) * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l433"></a> tmpme = tmpme->next;
|
|
<a name="l434"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l435"></a> }
|
|
<a name="l436"></a> new_pos.y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l437"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l438"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_RIGHT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l439"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l440"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_RIGHT</span><span class=cF7>)</span><span class=cF0> && </span><span class=cFB>kbd</span><span class=cF0>.count == old_key_count)
|
|
<a name="l441"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l442"></a> i = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l443"></a> tmpme = m->sub;
|
|
<a name="l444"></a> </span><span class=cF1>while</span><span class=cF0> (tmpme)
|
|
<a name="l445"></a> {
|
|
<a name="l446"></a> </span><span class=cF1>if</span><span class=cF0> (i == new_pos.x)
|
|
<a name="l447"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l448"></a> </span><span class=cF1>if</span><span class=cF0> (tmpme->next)
|
|
<a name="l449"></a> new_pos.x = i + </span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme) * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l450"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l451"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l452"></a> i += </span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme) * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l453"></a> tmpme = tmpme->next;
|
|
<a name="l454"></a> }
|
|
<a name="l455"></a> new_pos.y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l456"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l457"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_UP</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l458"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l459"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_UP</span><span class=cF7>)</span><span class=cF0> && </span><span class=cFB>kbd</span><span class=cF0>.count == old_key_count)
|
|
<a name="l460"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l461"></a> new_pos.y -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l462"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l463"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_DOWN</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l464"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l465"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_CURSOR_DOWN</span><span class=cF7>)</span><span class=cF0> && </span><span class=cFB>kbd</span><span class=cF0>.count == old_key_count)
|
|
<a name="l466"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l467"></a> new_pos.y += </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l468"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l469"></a> new_pos.x = </span><span class=cF5>ClampI64</span><span class=cF0>(new_pos.x, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>GR_WIDTH</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l470"></a> new_pos.y = </span><span class=cF5>ClampI64</span><span class=cF0>(new_pos.y, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>GR_HEIGHT</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l471"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.x = new_pos.x;
|
|
<a name="l472"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.y = new_pos.y;
|
|
<a name="l473"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l474"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
|
|
<a name="l475"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.y = new_pos.y=</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l476"></a> }
|
|
<a name="l477"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
|
|
<a name="l478"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->message_code,
|
|
<a name="l479"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->arg1, </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l480"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l481"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.x = old_pos.x;
|
|
<a name="l482"></a> </span><span class=cFB>mouse</span><span class=cF0>.pos.y = old_pos.y;
|
|
<a name="l483"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l484"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l485"></a>
|
|
<a name="l486"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l487"></a>}
|
|
<a name="l488"></a>
|
|
<a name="l489"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>WinMgrTask</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0>)
|
|
<a name="l490"></a>{
|
|
<a name="l491"></a> </span><span class=cF9>CTask</span><span class=cF0> *task = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l492"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
|
<a name="l493"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
|
<a name="l494"></a> </span><span class=cF9>I64</span><span class=cF0> x, y, z, message_code, my_mouse_z = </span><span class=cFE>0</span><span class=cF0>, left, top, old_flags = </span><span class=cF5>RFlagsGet</span><span class=cF0>;
|
|
<a name="l495"></a> </span><span class=cF1>Bool</span><span class=cF0> has_border;
|
|
<a name="l496"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c;
|
|
<a name="l497"></a>
|
|
<a name="l498"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>TEXT_COLS</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l499"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>TEXT_ROWS</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l500"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->display_flags, </span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF0>);
|
|
<a name="l501"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->display_flags, </span><span class=cF3>DISPLAYf_SHOW</span><span class=cF0>);
|
|
<a name="l502"></a> </span><span class=cFB>gr</span><span class=cF0>.dc->win_task = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l503"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit &= ~</span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>;
|
|
<a name="l504"></a> </span><span class=cF5>GrSetUpTables</span><span class=cF0>;
|
|
<a name="l505"></a> </span><span class=cFB>screencast</span><span class=cF0>.dc2_alias = </span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2);
|
|
<a name="l506"></a> </span><span class=cF5>WinZBufUpdate</span><span class=cF0>;
|
|
<a name="l507"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_WINMGR</span><span class=cF0>);
|
|
<a name="l508"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l509"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l510"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l511"></a> {
|
|
<a name="l512"></a>wmt_start:
|
|
<a name="l513"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_SYSTEM_SERVER</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l514"></a> </span><span class=cF5>TaskKillDying</span><span class=cF0>;
|
|
<a name="l515"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l516"></a>
|
|
<a name="l517"></a> task = </span><span class=cF5>Fs</span><span class=cF0>->last_task;
|
|
<a name="l518"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l519"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l520"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
|
<a name="l521"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l522"></a> {
|
|
<a name="l523"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l524"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l525"></a> }
|
|
<a name="l526"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>(task, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l527"></a> task = task->last_task;
|
|
<a name="l528"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l529"></a> </span><span class=cF1>if</span><span class=cF0> (task == </span><span class=cF5>Fs</span><span class=cF0>)
|
|
<a name="l530"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l531"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l532"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l533"></a>
|
|
<a name="l534"></a> task = </span><span class=cF5>Fs</span><span class=cF0>->last_task;
|
|
<a name="l535"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l536"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l537"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
|
<a name="l538"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l539"></a> {
|
|
<a name="l540"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l541"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l542"></a> }
|
|
<a name="l543"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinInside</span><span class=cF7>(</span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y, task, </span><span class=cF3>FONT_WIDTH</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l544"></a> {
|
|
<a name="l545"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l546"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l547"></a> }
|
|
<a name="l548"></a> </span><span class=cF1>if</span><span class=cF0> (task == </span><span class=cF5>Fs</span><span class=cF0>) { </span><span class=cF2>//Shouldn't happen</span><span class=cF0>
|
|
<a name="l549"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l550"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l551"></a> }
|
|
<a name="l552"></a> task = task->last_task;
|
|
<a name="l553"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(old_flags);
|
|
<a name="l554"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l555"></a>
|
|
<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=cF0>&task->display_flags, </span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l557"></a> has_border = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l558"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l559"></a> has_border = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l560"></a>
|
|
<a name="l561"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l562"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0> = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l563"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0> && !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MENU</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l564"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l565"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinKeyNavMenu</span><span class=cF0>)
|
|
<a name="l566"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l567"></a> </span><span class=cF1>if</span><span class=cF0> (task == </span><span class=cF5>Fs</span><span class=cF0> && </span><span class=cFE>0</span><span class=cF0> <= </span><span class=cFB>mouse</span><span class=cF0>.pos.y < </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> && </span><span class=cFB>mouse_hard</span><span class=cF0>.installed)
|
|
<a name="l568"></a> {
|
|
<a name="l569"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l570"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>old_mouse</span><span class=cF0>.lb)
|
|
<a name="l571"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l572"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l573"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l574"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l575"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
|
|
<a name="l576"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>,
|
|
<a name="l577"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->message_code,
|
|
<a name="l578"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->arg1,
|
|
<a name="l579"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>->arg2, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l580"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l581"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l582"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l583"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l584"></a> }
|
|
<a name="l585"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l586"></a>
|
|
<a name="l587"></a> </span><span class=cF2>//grab scroll</span><span class=cF0>
|
|
<a name="l588"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_GRAB_SCROLL</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l589"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
|
|
<a name="l590"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_GRAB_SCROLL</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l591"></a> </span><span class=cFB>kbd</span><span class=cF0>.scan_code & </span><span class=cF3>SCF_CTRL</span><span class=cF0> && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l592"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l593"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l594"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l595"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>kbd</span><span class=cF0>.scan_code & </span><span class=cF3>SCF_CTRL</span><span class=cF0> && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF7>(</span><span class=cF0>!</span><span class=cFB>ac</span><span class=cF0>.task ||
|
|
<a name="l596"></a> !</span><span class=cF5>WinInside</span><span class=cF0>(</span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y, </span><span class=cFB>ac</span><span class=cF0>.task, </span><span class=cF3>FONT_WIDTH</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l597"></a> {
|
|
<a name="l598"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l599"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l600"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l601"></a> x = </span><span class=cFB>mouse</span><span class=cF0>.pos.x - task->scroll_x;
|
|
<a name="l602"></a> y = </span><span class=cFB>mouse</span><span class=cF0>.pos.y - task->scroll_y;
|
|
<a name="l603"></a> z = </span><span class=cFB>mouse</span><span class=cF0>.pos.z - task->scroll_z;
|
|
<a name="l604"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cFB>kbd</span><span class=cF0>.scan_code & </span><span class=cF3>SCF_CTRL</span><span class=cF0> && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l605"></a> {
|
|
<a name="l606"></a> task->scroll_x = (</span><span class=cFB>mouse</span><span class=cF0>.pos.x - x) & ~</span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l607"></a> task->scroll_y = (</span><span class=cFB>mouse</span><span class=cF0>.pos.y-y) & ~</span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l608"></a> task->scroll_z = </span><span class=cFB>mouse</span><span class=cF0>.pos.z-z;
|
|
<a name="l609"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l610"></a> }
|
|
<a name="l611"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l612"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l613"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l614"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l615"></a> task->scroll_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l616"></a> task->scroll_y = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l617"></a> task->scroll_z = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l618"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<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> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l622"></a> }
|
|
<a name="l623"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l624"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l625"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l626"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l627"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l628"></a>
|
|
<a name="l629"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_CTRLS</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l630"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
|
|
<a name="l631"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_CTRLS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l632"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l633"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>old_mouse</span><span class=cF0>.lb)
|
|
<a name="l634"></a> {
|
|
<a name="l635"></a> c = task->next_ctrl;
|
|
<a name="l636"></a> </span><span class=cF1>while</span><span class=cF0> (c != &task->next_ctrl)
|
|
<a name="l637"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l638"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l639"></a> {
|
|
<a name="l640"></a> left = task->pix_left;
|
|
<a name="l641"></a> top = task->pix_top;
|
|
<a name="l642"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_BORDER</span><span class=cF0>)
|
|
<a name="l643"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l644"></a> left -= </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l645"></a> top -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l646"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l647"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_CAPTURE_LEFT_MS</span><span class=cF0>)
|
|
<a name="l648"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l649"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l650"></a> {
|
|
<a name="l651"></a> </span><span class=cF1>if</span><span class=cF0> (c->left_click)
|
|
<a name="l652"></a> (*c->left_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l653"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l654"></a> }
|
|
<a name="l655"></a> </span><span class=cF1>if</span><span class=cF0> (c->left_click)
|
|
<a name="l656"></a> (*c->left_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l657"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l658"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l659"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l660"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l661"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l662"></a> </span><span class=cF1>if</span><span class=cF0> (c->left_click)
|
|
<a name="l663"></a> (*c->left_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l664"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l665"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l666"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l667"></a> }
|
|
<a name="l668"></a> c = c->next;
|
|
<a name="l669"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l670"></a> }
|
|
<a name="l671"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l672"></a> {
|
|
<a name="l673"></a> c = task->next_ctrl;
|
|
<a name="l674"></a> </span><span class=cF1>while</span><span class=cF0> (c != &task->next_ctrl)
|
|
<a name="l675"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l676"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l677"></a> {
|
|
<a name="l678"></a> left = task->pix_left;
|
|
<a name="l679"></a> top = task->pix_top;
|
|
<a name="l680"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_BORDER</span><span class=cF0>)
|
|
<a name="l681"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l682"></a> left -= </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l683"></a> top -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l684"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l685"></a> </span><span class=cF1>if</span><span class=cF0> (c->left_click)
|
|
<a name="l686"></a> (*c->left_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l687"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l688"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l689"></a> }
|
|
<a name="l690"></a> c = c->next;
|
|
<a name="l691"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l692"></a> }
|
|
<a name="l693"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb && !</span><span class=cFB>old_mouse</span><span class=cF0>.rb)
|
|
<a name="l694"></a> {
|
|
<a name="l695"></a> c = task->next_ctrl;
|
|
<a name="l696"></a> </span><span class=cF1>while</span><span class=cF0> (c != &task->next_ctrl)
|
|
<a name="l697"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l698"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l699"></a> {
|
|
<a name="l700"></a> left = task->pix_left;
|
|
<a name="l701"></a> top = task->pix_top;
|
|
<a name="l702"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_BORDER</span><span class=cF0>)
|
|
<a name="l703"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l704"></a> left -= </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l705"></a> top -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l706"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l707"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_CAPTURE_RIGHT_MS</span><span class=cF0>)
|
|
<a name="l708"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l709"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.rb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l710"></a> {
|
|
<a name="l711"></a> </span><span class=cF1>if</span><span class=cF0> (c->right_click)
|
|
<a name="l712"></a> (*c->right_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l713"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l714"></a> }
|
|
<a name="l715"></a> </span><span class=cF1>if</span><span class=cF0> (c->right_click)
|
|
<a name="l716"></a> (*c->right_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l717"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.rb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l718"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l719"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l720"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l721"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l722"></a> </span><span class=cF1>if</span><span class=cF0> (c->right_click)
|
|
<a name="l723"></a> (*c->right_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l724"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.rb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l725"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l726"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l727"></a> }
|
|
<a name="l728"></a> c = c->next;
|
|
<a name="l729"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l730"></a> }
|
|
<a name="l731"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.rb && !</span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l732"></a> {
|
|
<a name="l733"></a> c = task->next_ctrl;
|
|
<a name="l734"></a> </span><span class=cF1>while</span><span class=cF0> (c != &task->next_ctrl)
|
|
<a name="l735"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l736"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l737"></a> {
|
|
<a name="l738"></a> left = task->pix_left;
|
|
<a name="l739"></a> top = task->pix_top;
|
|
<a name="l740"></a> </span><span class=cF1>if</span><span class=cF0> (c->flags & </span><span class=cF3>CTRLF_BORDER</span><span class=cF0>)
|
|
<a name="l741"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l742"></a> left -= </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l743"></a> top -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l744"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l745"></a> </span><span class=cF1>if</span><span class=cF0> (c->right_click)
|
|
<a name="l746"></a> (*c->right_click)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.x - left, </span><span class=cFB>mouse</span><span class=cF0>.pos.y - top, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l747"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.rb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l748"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l749"></a> }
|
|
<a name="l750"></a> c = c->next;
|
|
<a name="l751"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l752"></a> }
|
|
<a name="l753"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.has_wheel && my_mouse_z != </span><span class=cFB>mouse</span><span class=cF0>.pos.z)
|
|
<a name="l754"></a> {
|
|
<a name="l755"></a> </span><span class=cF1>if</span><span class=cF0> (task == </span><span class=cFB>sys_focus_task</span><span class=cF0>)
|
|
<a name="l756"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l757"></a> c = task->next_ctrl;
|
|
<a name="l758"></a> </span><span class=cF1>while</span><span class=cF0> (c != &task->next_ctrl)
|
|
<a name="l759"></a> {
|
|
<a name="l760"></a> </span><span class=cF1>if</span><span class=cF0> (c->wheel_chg)
|
|
<a name="l761"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l762"></a> (*c->wheel_chg)(c, </span><span class=cFB>mouse</span><span class=cF0>.pos.z - my_mouse_z);
|
|
<a name="l763"></a> my_mouse_z = </span><span class=cFB>mouse</span><span class=cF0>.pos.z;
|
|
<a name="l764"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l765"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l766"></a> c = c->next;
|
|
<a name="l767"></a> }
|
|
<a name="l768"></a> my_mouse_z = </span><span class=cFB>mouse</span><span class=cF0>.pos.z;
|
|
<a name="l769"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l770"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>sys_focus_task</span><span class=cF0>)
|
|
<a name="l771"></a> my_mouse_z = </span><span class=cFB>mouse</span><span class=cF0>.pos.z;
|
|
<a name="l772"></a> }
|
|
<a name="l773"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l774"></a>
|
|
<a name="l775"></a> </span><span class=cF1>if</span><span class=cF0> (task == </span><span class=cF5>Fs</span><span class=cF0>)
|
|
<a name="l776"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l777"></a>
|
|
<a name="l778"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_MS_L</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l779"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l780"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_L</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l781"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l782"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>old_mouse</span><span class=cF0>.lb && </span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l783"></a> {
|
|
<a name="l784"></a> </span><span class=cF1>if</span><span class=cF0> (doc = </span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l785"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l786"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l787"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l788"></a> {
|
|
<a name="l789"></a> doc_e = doc->cur_entry;
|
|
<a name="l790"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc)
|
|
<a name="l791"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l792"></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="l793"></a> doc_e->de_flags |= </span><span class=cF3>DOCEF_SOLID_BORDER</span><span class=cF0>;
|
|
<a name="l794"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l795"></a> }
|
|
<a name="l796"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l797"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l798"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l799"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l800"></a> }
|
|
<a name="l801"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l802"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_MS_R</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l803"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l804"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_R</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l805"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l806"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>old_mouse</span><span class=cF0>.rb && </span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l807"></a> {
|
|
<a name="l808"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l809"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l810"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.rb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l811"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l812"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l813"></a> }
|
|
<a name="l814"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l815"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_BORDER</span><span class=cF7>)</span><span class=cF0> && has_border &&
|
|
<a name="l816"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l817"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_BORDER</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l818"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l819"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l820"></a> {
|
|
<a name="l821"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y == task->win_top - </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l822"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l823"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_left <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x < task->win_left + </span><span class=cFE>4</span><span class=cF0>)
|
|
<a name="l824"></a> {
|
|
<a name="l825"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF3>CH_CTRLM</span><span class=cF0>, </span><span class=cFE>0x43200000432</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l826"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l827"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l828"></a> }
|
|
<a name="l829"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (task->win_right - </span><span class=cFE>2</span><span class=cF0> <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x <= task->win_right)
|
|
<a name="l830"></a> {
|
|
<a name="l831"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l832"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l833"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l834"></a> </span><span class=cF5>Kill</span><span class=cF0>(task, </span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l835"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l836"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l837"></a> }
|
|
<a name="l838"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l839"></a> }
|
|
<a name="l840"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l841"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit, </span><span class=cF3>WIf_SELF_MS_L</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l842"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l843"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_L</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l844"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l845"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.lb && !</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l846"></a> {
|
|
<a name="l847"></a> </span><span class=cF1>if</span><span class=cF0> (doc = </span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y, </span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l848"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l849"></a> </span><span class=cF1>do</span><span class=cF0> message_code = </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l850"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF7>(</span><span class=cFB>mouse</span><span class=cF0>.lb || </span><span class=cFB>mouse</span><span class=cF0>.left_dbl_time</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l851"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l852"></a> {
|
|
<a name="l853"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>)
|
|
<a name="l854"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l855"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l856"></a> {
|
|
<a name="l857"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l858"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l859"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l860"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l861"></a> {
|
|
<a name="l862"></a> doc_e = doc->cur_entry;
|
|
<a name="l863"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc)
|
|
<a name="l864"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l865"></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="l866"></a> doc_e->de_flags &= ~</span><span class=cF3>DOCEF_SOLID_BORDER</span><span class=cF0>;
|
|
<a name="l867"></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_LIST</span><span class=cF0> |
|
|
<a name="l868"></a> </span><span class=cF3>DOCEF_LINK</span><span class=cF0> | </span><span class=cF3>DOCEF_CHECK_COLLAPSABLE</span><span class=cF0> |
|
|
<a name="l869"></a> </span><span class=cF3>DOCEF_LEFT_CB</span><span class=cF0> | </span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0> | </span><span class=cF3>DOCEF_LEFT_EXP</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l870"></a> {
|
|
<a name="l871"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF3>CH_SPACE</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l872"></a> }
|
|
<a name="l873"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l874"></a> }
|
|
<a name="l875"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l876"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l877"></a> }
|
|
<a name="l878"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l879"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_L_D_UP</span><span class=cF0>)
|
|
<a name="l880"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF3>CH_ESC</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l881"></a> }
|
|
<a name="l882"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l883"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l884"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l885"></a> }
|
|
<a name="l886"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l887"></a>
|
|
<a name="l888"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit,</span><span class=cF3>WIf_SELF_MS_R</span><span class=cF7>)</span><span class=cF0>&&
|
|
<a name="l889"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l890"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_MS_R</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l891"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l892"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_mouse</span><span class=cF0>.rb && !</span><span class=cFB>mouse</span><span class=cF0>.rb)
|
|
<a name="l893"></a> {
|
|
<a name="l894"></a> </span><span class=cF1>if</span><span class=cF0> (doc = </span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task, </span><span class=cFB>mouse</span><span class=cF0>.pos.x, </span><span class=cFB>mouse</span><span class=cF0>.pos.y, </span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l895"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l896"></a> </span><span class=cF1>do</span><span class=cF0> message_code = </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l897"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF7>(</span><span class=cFB>mouse</span><span class=cF0>.rb || </span><span class=cFB>mouse</span><span class=cF0>.right_dbl_time</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l898"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l899"></a> {
|
|
<a name="l900"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0>)
|
|
<a name="l901"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l902"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l903"></a> {
|
|
<a name="l904"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
|
<a name="l905"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l906"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l907"></a> </span><span class=cF1>if</span><span class=cF0> (doc->doc_signature == </span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
|
|
<a name="l908"></a> {
|
|
<a name="l909"></a> doc_e = doc->cur_entry;
|
|
<a name="l910"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l911"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_LINK</span><span class=cF0> |
|
|
<a name="l912"></a> </span><span class=cF3>DOCEF_RIGHT_CB</span><span class=cF0> | </span><span class=cF3>DOCEF_RIGHT_MACRO</span><span class=cF0> | </span><span class=cF3>DOCEF_RIGHT_EXP</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l913"></a> {
|
|
<a name="l914"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF6>'\n'</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l915"></a> }
|
|
<a name="l916"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l917"></a> }
|
|
<a name="l918"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
|
<a name="l919"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l920"></a> }
|
|
<a name="l921"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l922"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_R_D_UP</span><span class=cF0>)
|
|
<a name="l923"></a> </span><span class=cF5>TaskMessage</span><span class=cF0>(task, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l924"></a> }
|
|
<a name="l925"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.rb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l926"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l927"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l928"></a> }
|
|
<a name="l929"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l930"></a>
|
|
<a name="l931"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->win_inhibit,</span><span class=cF3>WIf_SELF_BORDER</span><span class=cF7>)</span><span class=cF0> && has_border &&
|
|
<a name="l932"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>) ||
|
|
<a name="l933"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cFB>sys_focus_task</span><span class=cF0>->win_inhibit, </span><span class=cF3>WIf_FOCUS_TASK_BORDER</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l934"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l935"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && !</span><span class=cFB>old_mouse</span><span class=cF0>.lb)
|
|
<a name="l936"></a> {
|
|
<a name="l937"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_top == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y + </span><span class=cFE>1</span><span class=cF0> &&
|
|
<a name="l938"></a> task->win_left - </span><span class=cFE>1</span><span class=cF0> <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x <= task->win_right + </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l939"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l940"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_left <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x < task->win_left + </span><span class=cFE>4</span><span class=cF0>)
|
|
<a name="l941"></a> {
|
|
<a name="l942"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l943"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l944"></a> }
|
|
<a name="l945"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_right - </span><span class=cFE>2</span><span class=cF0> <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x <= task->win_right)
|
|
<a name="l946"></a> {
|
|
<a name="l947"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l948"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l949"></a> }
|
|
<a name="l950"></a> x = </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - task->win_left;
|
|
<a name="l951"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l952"></a> {
|
|
<a name="l953"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l954"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l955"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l956"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - x, task->win_width - </span><span class=cFE>1</span><span class=cF0> + </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - x, task);
|
|
<a name="l957"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y + </span><span class=cFE>1</span><span class=cF0>, task->win_height + </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y, task);
|
|
<a name="l958"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l959"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l960"></a> }
|
|
<a name="l961"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l962"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l963"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l964"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_left == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x + </span><span class=cFE>1</span><span class=cF0> &&
|
|
<a name="l965"></a> task->win_top - </span><span class=cFE>1</span><span class=cF0> <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y <= task->win_bottom + </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l966"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l967"></a> y = </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - task->win_top;
|
|
<a name="l968"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l969"></a> {
|
|
<a name="l970"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l971"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l972"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l973"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cFB>mouse</span><span class=cF0>.pos_text.x + </span><span class=cFE>1</span><span class=cF0>, task->win_width + </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x, task);
|
|
<a name="l974"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - y, task->win_height - </span><span class=cFE>1</span><span class=cF0> + </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - y, task);
|
|
<a name="l975"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l976"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l977"></a> }
|
|
<a name="l978"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l979"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l980"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l981"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_right + </span><span class=cFE>1</span><span class=cF0> == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x &&
|
|
<a name="l982"></a> task->win_bottom + </span><span class=cFE>1</span><span class=cF0> == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y)
|
|
<a name="l983"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l984"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l985"></a> {
|
|
<a name="l986"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l987"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l988"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l989"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(task->win_left, </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - </span><span class=cFE>1</span><span class=cF0>, task);
|
|
<a name="l990"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task->win_top, </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cFE>1</span><span class=cF0>, task);
|
|
<a name="l991"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l992"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l993"></a> }
|
|
<a name="l994"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l995"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l996"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l997"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_bottom == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cFE>1</span><span class=cF0> &&
|
|
<a name="l998"></a> task->win_left <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x <= task->win_right)
|
|
<a name="l999"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l1000"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l1001"></a> {
|
|
<a name="l1002"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l1003"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l1004"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l1005"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task->win_top, </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cFE>1</span><span class=cF0>, task);
|
|
<a name="l1006"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l1007"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1008"></a> }
|
|
<a name="l1009"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l1010"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l1011"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1012"></a> </span><span class=cF1>if</span><span class=cF0> (task->win_right == </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - </span><span class=cFE>1</span><span class=cF0> &&
|
|
<a name="l1013"></a> task->win_top <= </span><span class=cFB>mouse</span><span class=cF0>.pos_text.y <= task->win_bottom)
|
|
<a name="l1014"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l1015"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb)
|
|
<a name="l1016"></a> {
|
|
<a name="l1017"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
|
|
<a name="l1018"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.lb && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l1019"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l1020"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(task->win_left, </span><span class=cFB>mouse</span><span class=cF0>.pos_text.x - </span><span class=cFE>1</span><span class=cF0>, task);
|
|
<a name="l1021"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
|
|
<a name="l1022"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1023"></a> }
|
|
<a name="l1024"></a> </span><span class=cFB>old_mouse</span><span class=cF0>.lb = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l1025"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
|
|
<a name="l1026"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1027"></a> }
|
|
<a name="l1028"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1029"></a> }
|
|
<a name="l1030"></a> </span><span class=cF1>catch</span><span class=cF0>
|
|
<a name="l1031"></a> {
|
|
<a name="l1032"></a> </span><span class=cF5>Beep</span><span class=cF0>;
|
|
<a name="l1033"></a> </span><span class=cF5>Fs</span><span class=cF0>->catch_except = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l1034"></a> task = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l1035"></a> }
|
|
<a name="l1036"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l1037"></a>}
|
|
</span></pre></body>
|
|
</html>
|