diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 05:48:01 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 05:48:01 -0800 |
commit | fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a (patch) | |
tree | ea6e8e1c988a67e302d9f6abe6fda46e1648dc72 /html/085scenario_console.cc.html | |
parent | a802f0cedc7b5580d746f46ae62fcf8074ae3c49 (diff) | |
download | mu-fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a.tar.gz |
3750
Diffstat (limited to 'html/085scenario_console.cc.html')
-rw-r--r-- | html/085scenario_console.cc.html | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/html/085scenario_console.cc.html b/html/085scenario_console.cc.html index 951253a5..869ec321 100644 --- a/html/085scenario_console.cc.html +++ b/html/085scenario_console.cc.html @@ -126,7 +126,7 @@ if ('onhashchange' in window) { <span id="L66" class="LineNr"> 66 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>steps<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L67" class="LineNr"> 67 </span> <span class="Normal">const</span> instruction& inst = r<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L68" class="LineNr"> 68 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name == <span class="Constant">"left-click"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L69" class="LineNr"> 69 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'left-click' event starting at "</span> << Current_routine<span class="Delimiter">-></span>alloc << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L69" class="LineNr"> 69 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'left-click' event starting at "</span> << Current_routine<span class="Delimiter">-></span>alloc << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L70" class="LineNr"> 70 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">tag for 'touch-event' variant of 'event' exclusive-container</span><span class="Comment">*/</span><span class="Constant">2</span><span class="Delimiter">);</span> <span id="L71" class="LineNr"> 71 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Comment">/*</span><span class="Comment">skip tag</span><span class="Comment">*/</span><span class="Constant">1</span>+<span class="Comment">/*</span><span class="Comment">offset of 'type' in 'mouse-event'</span><span class="Comment">*/</span><span class="Constant">0</span><span class="Delimiter">,</span> TB_KEY_MOUSE_LEFT<span class="Delimiter">);</span> <span id="L72" class="LineNr"> 72 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Comment">/*</span><span class="Comment">skip tag</span><span class="Comment">*/</span><span class="Constant">1</span>+<span class="Comment">/*</span><span class="Comment">offset of 'row' in 'mouse-event'</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">,</span> <a href='002test.cc.html#L92'>to_integer</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">));</span> @@ -134,14 +134,14 @@ if ('onhashchange' in window) { <span id="L74" class="LineNr"> 74 </span> curr_address += <a href='085scenario_console.cc.html#L295'>size_of_event</a><span class="Delimiter">();</span> <span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">}</span> <span id="L76" class="LineNr"> 76 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name == <span class="Constant">"press"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L77" class="LineNr"> 77 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'press' event starting at "</span> << curr_address << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L77" class="LineNr"> 77 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'press' event starting at "</span> << curr_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L78" class="LineNr"> 78 </span> string key = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> <span id="L79" class="LineNr"> 79 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='002test.cc.html#L86'>is_integer</a><span class="Delimiter">(</span>key<span class="Delimiter">))</span> <span id="L80" class="LineNr"> 80 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Constant">1</span><span class="Delimiter">,</span> <a href='002test.cc.html#L92'>to_integer</a><span class="Delimiter">(</span>key<span class="Delimiter">));</span> <span id="L81" class="LineNr"> 81 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Key<span class="Delimiter">,</span> key<span class="Delimiter">))</span> <span id="L82" class="LineNr"> 82 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Constant">1</span><span class="Delimiter">,</span> Key[key]<span class="Delimiter">);</span> <span id="L83" class="LineNr"> 83 </span> <span class="Normal">else</span> -<span id="L84" class="LineNr"> 84 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"assume-console: can't press '"</span> << key << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L84" class="LineNr"> 84 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"assume-console: can't press '"</span> << key << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L85" class="LineNr"> 85 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Constant">1</span><span class="Delimiter">)</span> < <span class="Constant">256</span><span class="Delimiter">)</span> <span id="L86" class="LineNr"> 86 </span> <span class="Comment">// these keys are in ascii</span> <span id="L87" class="LineNr"> 87 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">tag for 'text' variant of 'event' exclusive-container</span><span class="Comment">*/</span><span class="Constant">0</span><span class="Delimiter">);</span> @@ -155,18 +155,18 @@ if ('onhashchange' in window) { <span id="L95" class="LineNr"> 95 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L96" class="LineNr"> 96 </span> <span class="Comment">// keyboard input</span> <span id="L97" class="LineNr"> 97 </span> assert<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name == <span class="Constant">"type"</span><span class="Delimiter">);</span> -<span id="L98" class="LineNr"> 98 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'type' event starting at "</span> << curr_address << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L98" class="LineNr"> 98 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'type' event starting at "</span> << curr_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L99" class="LineNr"> 99 </span> <span class="Normal">const</span> string& contents = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> <span id="L100" class="LineNr">100 </span> <span class="Normal">const</span> <span class="Normal">char</span>* raw_contents = contents<span class="Delimiter">.</span>c_str<span class="Delimiter">();</span> <span id="L101" class="LineNr">101 </span> <span class="Normal">int</span> num_keyboard_events = <a href='038new_text.cc.html#L131'>unicode_length</a><span class="Delimiter">(</span>contents<span class="Delimiter">);</span> <span id="L102" class="LineNr">102 </span> <span class="Normal">int</span> curr = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L103" class="LineNr">103 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < num_keyboard_events<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L104" class="LineNr">104 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'text' tag at "</span> << curr_address << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L104" class="LineNr">104 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 'text' tag at "</span> << curr_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L105" class="LineNr">105 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">tag for 'text' variant of 'event' exclusive-container</span><span class="Comment">*/</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L106" class="LineNr">106 </span> <span class="Normal">uint32_t</span> curr_character<span class="Delimiter">;</span> <span id="L107" class="LineNr">107 </span> assert<span class="Delimiter">(</span>curr < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>contents<span class="Delimiter">));</span> <span id="L108" class="LineNr">108 </span> tb_utf8_char_to_unicode<span class="Delimiter">(</span>&curr_character<span class="Delimiter">,</span> &raw_contents[curr]<span class="Delimiter">);</span> -<span id="L109" class="LineNr">109 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing character "</span> << curr_character << <span class="Constant">" at "</span> << curr_address+<span class="Comment">/*</span><span class="Comment">skip exclusive container tag</span><span class="Comment">*/</span><span class="Constant">1</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L109" class="LineNr">109 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing character "</span> << curr_character << <span class="Constant">" at "</span> << curr_address+<span class="Comment">/*</span><span class="Comment">skip exclusive container tag</span><span class="Comment">*/</span><span class="Constant">1</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L110" class="LineNr">110 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address+<span class="Comment">/*</span><span class="Comment">skip exclusive container tag</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">,</span> curr_character<span class="Delimiter">);</span> <span id="L111" class="LineNr">111 </span> curr += tb_utf8_char_length<span class="Delimiter">(</span>raw_contents[curr]<span class="Delimiter">);</span> <span id="L112" class="LineNr">112 </span> curr_address += <a href='085scenario_console.cc.html#L295'>size_of_event</a><span class="Delimiter">();</span> @@ -176,9 +176,9 @@ if ('onhashchange' in window) { <span id="L116" class="LineNr">116 </span> assert<span class="Delimiter">(</span>curr_address == event_data_address+size<span class="Delimiter">);</span> <span id="L117" class="LineNr">117 </span> <span class="Comment">// wrap the array of events in a console object</span> <span id="L118" class="LineNr">118 </span> <span class="Normal">int</span> console_address = allocate<span class="Delimiter">(</span><a href='085scenario_console.cc.html#L305'>size_of_console</a><span class="Delimiter">());</span> -<span id="L119" class="LineNr">119 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing console in "</span> << console_address << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L119" class="LineNr">119 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing console in "</span> << console_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L120" class="LineNr">120 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> CONSOLE<span class="Delimiter">,</span> console_address<span class="Delimiter">);</span> -<span id="L121" class="LineNr">121 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing console data in "</span> << console_address+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span>+<span class="Comment">/*</span><span class="Comment">offset of 'data' in container 'events'</span><span class="Comment">*/</span><span class="Constant">1</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L121" class="LineNr">121 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing console data in "</span> << console_address+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span>+<span class="Comment">/*</span><span class="Comment">offset of 'data' in container 'events'</span><span class="Comment">*/</span><span class="Constant">1</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L122" class="LineNr">122 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> console_address+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span>+<span class="Comment">/*</span><span class="Comment">offset of 'data' in container 'events'</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">,</span> event_data_address<span class="Delimiter">);</span> <span id="L123" class="LineNr">123 </span> <span class="Comment">// increment refcount for event data</span> <span id="L124" class="LineNr">124 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> event_data_address<span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> @@ -324,7 +324,7 @@ if ('onhashchange' in window) { <span id="L264" class="LineNr">264 </span><span class="Normal">case</span> REPLACE_IN_CONSOLE: <span class="Delimiter">{</span> <span id="L265" class="LineNr">265 </span> assert<span class="Delimiter">(</span>scalar<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)));</span> <span id="L266" class="LineNr">266 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> CONSOLE<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L267" class="LineNr">267 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"console not initialized</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L267" class="LineNr">267 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"console not initialized</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L268" class="LineNr">268 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L269" class="LineNr">269 </span> <span class="Delimiter">}</span> <span id="L270" class="LineNr">270 </span> <span class="Normal">int</span> console_address = <a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> CONSOLE<span class="Delimiter">);</span> |