summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.gui.ui.html
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-21 00:23:04 +0200
committerhut <hut@lavabit.com>2010-06-21 00:23:04 +0200
commit3817c8b47e85d3644383182c2b3909a2dbdd0b3b (patch)
tree81fb89331bbdc960c5e3cd2b70f1934b4c3441be /doc/pydoc/ranger.gui.ui.html
parent25a4162d4249c0c148438bfa2255c9f6af702569 (diff)
downloadranger-3817c8b47e85d3644383182c2b3909a2dbdd0b3b.tar.gz
removed pydoc since it can be generated with "make doc" easily
Diffstat (limited to 'doc/pydoc/ranger.gui.ui.html')
-rw-r--r--doc/pydoc/ranger.gui.ui.html181
1 files changed, 0 insertions, 181 deletions
diff --git a/doc/pydoc/ranger.gui.ui.html b/doc/pydoc/ranger.gui.ui.html
deleted file mode 100644
index a8a59091..00000000
--- a/doc/pydoc/ranger.gui.ui.html
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module ranger.gui.ui</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-</head><body bgcolor="#f0f0f8">
-
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
-<tr bgcolor="#7799ee">
-<td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.gui.html"><font color="#ffffff">gui</font></a>.ui</strong></big></big></font></td
-><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/code/ranger/ranger/gui/ui.py">/home/hut/code/ranger/ranger/gui/ui.py</a></font></td></tr></table>
-    <p><tt>#&nbsp;Copyright&nbsp;(C)&nbsp;2009,&nbsp;2010&nbsp;&nbsp;Roman&nbsp;Zimbelmann&nbsp;&lt;romanz@lavabit.com&gt;<br>
-#<br>
-#&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>
-#&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>
-#&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br>
-#&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.<br>
-#<br>
-#&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>
-#&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>
-#&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>
-#&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>
-#<br>
-#&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br>
-#&nbsp;along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</tt></p>
-<p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#aa55cc">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="_curses.html">_curses</a><br>
-</td><td width="25%" valign=top><a href="curses.html">curses</a><br>
-</td><td width="25%" valign=top><a href="os.html">os</a><br>
-</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
-</td></tr></table></td></tr></table><p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#ee77aa">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl>
-<dt><font face="helvetica, arial"><a href="ranger.gui.displayable.html#DisplayableContainer">ranger.gui.displayable.DisplayableContainer</a>(<a href="ranger.gui.displayable.html#Displayable">ranger.gui.displayable.Displayable</a>)
-</font></dt><dd>
-<dl>
-<dt><font face="helvetica, arial"><a href="ranger.gui.ui.html#UI">UI</a>
-</font></dt></dl>
-</dd>
-</dl>
- <p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#ffc8d8">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="UI">class <strong>UI</strong></a>(<a href="ranger.gui.displayable.html#DisplayableContainer">ranger.gui.displayable.DisplayableContainer</a>)</font></td></tr>
-    
-<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="ranger.gui.ui.html#UI">UI</a></dd>
-<dd><a href="ranger.gui.displayable.html#DisplayableContainer">ranger.gui.displayable.DisplayableContainer</a></dd>
-<dd><a href="ranger.gui.displayable.html#Displayable">ranger.gui.displayable.Displayable</a></dd>
-<dd><a href="ranger.shared.html#EnvironmentAware">ranger.shared.EnvironmentAware</a></dd>
-<dd><a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a></dd>
-<dd><a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a></dd>
-<dd><a href="ranger.gui.curses_shortcuts.html#CursesShortcuts">ranger.gui.curses_shortcuts.CursesShortcuts</a></dd>
-<dd><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a></dd>
-<dd><a href="builtins.html#object">builtins.object</a></dd>
-</dl>
-<hr>
-Methods defined here:<br>
-<dl><dt><a name="UI-__init__"><strong>__init__</strong></a>(self, env<font color="#909090">=None</font>, fm<font color="#909090">=None</font>)</dt></dl>
-
-<dl><dt><a name="UI-destroy"><strong>destroy</strong></a>(self)</dt><dd><tt>Destroy&nbsp;all&nbsp;widgets&nbsp;and&nbsp;turn&nbsp;off&nbsp;curses</tt></dd></dl>
-
-<dl><dt><a name="UI-draw"><strong>draw</strong></a>(self)</dt><dd><tt>Draw&nbsp;all&nbsp;objects&nbsp;in&nbsp;the&nbsp;container</tt></dd></dl>
-
-<dl><dt><a name="UI-finalize"><strong>finalize</strong></a>(self)</dt><dd><tt>Finalize&nbsp;every&nbsp;object&nbsp;in&nbsp;container&nbsp;and&nbsp;refresh&nbsp;the&nbsp;window</tt></dd></dl>
-
-<dl><dt><a name="UI-handle_input"><strong>handle_input</strong></a>(self)</dt></dl>
-
-<dl><dt><a name="UI-handle_key"><strong>handle_key</strong></a>(self, key)</dt><dd><tt>Handles&nbsp;key&nbsp;input</tt></dd></dl>
-
-<dl><dt><a name="UI-handle_keys"><strong>handle_keys</strong></a>(self, *keys)</dt></dl>
-
-<dl><dt><a name="UI-handle_mouse"><strong>handle_mouse</strong></a>(self)</dt><dd><tt>Handles&nbsp;mouse&nbsp;input</tt></dd></dl>
-
-<dl><dt><a name="UI-initialize"><strong>initialize</strong></a>(self)</dt><dd><tt>initialize&nbsp;curses,&nbsp;then&nbsp;call&nbsp;setup&nbsp;(at&nbsp;the&nbsp;first&nbsp;time)&nbsp;and&nbsp;resize.</tt></dd></dl>
-
-<dl><dt><a name="UI-redraw"><strong>redraw</strong></a>(self)</dt><dd><tt>Redraw&nbsp;all&nbsp;widgets</tt></dd></dl>
-
-<dl><dt><a name="UI-redraw_window"><strong>redraw_window</strong></a>(self)</dt><dd><tt>Redraw&nbsp;the&nbsp;window.&nbsp;This&nbsp;only&nbsp;calls&nbsp;self.<strong>win</strong>.redrawwin().</tt></dd></dl>
-
-<dl><dt><a name="UI-set_load_mode"><strong>set_load_mode</strong></a>(self, boolean)</dt></dl>
-
-<dl><dt><a name="UI-setup"><strong>setup</strong></a>(self)</dt><dd><tt>Called&nbsp;after&nbsp;an&nbsp;<a href="#UI-initialize">initialize</a>()&nbsp;call.<br>
-Override&nbsp;this!</tt></dd></dl>
-
-<dl><dt><a name="UI-suspend"><strong>suspend</strong></a>(self)</dt><dd><tt>Turn&nbsp;off&nbsp;curses</tt></dd></dl>
-
-<dl><dt><a name="UI-update_size"><strong>update_size</strong></a>(self)</dt><dd><tt>Update&nbsp;self.<strong>env</strong>.termsize.<br>
-Extend&nbsp;this&nbsp;method&nbsp;to&nbsp;resize&nbsp;all&nbsp;widgets!</tt></dd></dl>
-
-<hr>
-Data and other attributes defined here:<br>
-<dl><dt><strong>is_set_up</strong> = False</dl>
-
-<dl><dt><strong>load_mode</strong> = False</dl>
-
-<hr>
-Methods inherited from <a href="ranger.gui.displayable.html#DisplayableContainer">ranger.gui.displayable.DisplayableContainer</a>:<br>
-<dl><dt><a name="UI-add_child"><strong>add_child</strong></a>(self, obj)</dt><dd><tt>Add&nbsp;the&nbsp;objects&nbsp;to&nbsp;the&nbsp;container.</tt></dd></dl>
-
-<dl><dt><a name="UI-click"><strong>click</strong></a>(self, event)</dt><dd><tt>Recursively&nbsp;called&nbsp;on&nbsp;objects&nbsp;in&nbsp;container</tt></dd></dl>
-
-<dl><dt><a name="UI-poke"><strong>poke</strong></a>(self)</dt><dd><tt>Recursively&nbsp;called&nbsp;on&nbsp;objects&nbsp;in&nbsp;container</tt></dd></dl>
-
-<dl><dt><a name="UI-press"><strong>press</strong></a>(self, key)</dt><dd><tt>Recursively&nbsp;called&nbsp;on&nbsp;objects&nbsp;in&nbsp;container</tt></dd></dl>
-
-<dl><dt><a name="UI-remove_child"><strong>remove_child</strong></a>(self, obj)</dt><dd><tt>Remove&nbsp;the&nbsp;object&nbsp;from&nbsp;the&nbsp;container.</tt></dd></dl>
-
-<hr>
-Methods inherited from <a href="ranger.gui.displayable.html#Displayable">ranger.gui.displayable.Displayable</a>:<br>
-<dl><dt><a name="UI-__bool__"><strong>__bool__</strong></a> = __nonzero__(self)</dt><dd><tt>Always&nbsp;True</tt></dd></dl>
-
-<dl><dt><a name="UI-__contains__"><strong>__contains__</strong></a>(self, item)</dt><dd><tt>Is&nbsp;item&nbsp;inside&nbsp;the&nbsp;boundaries?<br>
-item&nbsp;can&nbsp;be&nbsp;an&nbsp;iterable&nbsp;like&nbsp;[y,&nbsp;x]&nbsp;or&nbsp;an&nbsp;object&nbsp;with&nbsp;x&nbsp;and&nbsp;y&nbsp;methods.</tt></dd></dl>
-
-<dl><dt><a name="UI-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt><dd><tt>Always&nbsp;True</tt></dd></dl>
-
-<dl><dt><a name="UI-__str__"><strong>__str__</strong></a>(self)</dt></dl>
-
-<dl><dt><a name="UI-contains_point"><strong>contains_point</strong></a>(self, y, x)</dt><dd><tt>Test&nbsp;whether&nbsp;the&nbsp;point&nbsp;(with&nbsp;absolute&nbsp;coordinates)&nbsp;lies<br>
-within&nbsp;the&nbsp;boundaries&nbsp;of&nbsp;this&nbsp;object.</tt></dd></dl>
-
-<dl><dt><a name="UI-resize"><strong>resize</strong></a>(self, y, x, hei<font color="#909090">=None</font>, wid<font color="#909090">=None</font>)</dt><dd><tt>Resize&nbsp;the&nbsp;widget</tt></dd></dl>
-
-<hr>
-Data and other attributes inherited from <a href="ranger.shared.html#EnvironmentAware">ranger.shared.EnvironmentAware</a>:<br>
-<dl><dt><strong>env</strong> = None</dl>
-
-<hr>
-Data and other attributes inherited from <a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>:<br>
-<dl><dt><strong>fm</strong> = None</dl>
-
-<hr>
-Data descriptors inherited from <a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a>:<br>
-<dl><dt><strong>__dict__</strong></dt>
-<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
-</dl>
-<dl><dt><strong>__weakref__</strong></dt>
-<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
-</dl>
-<hr>
-Methods inherited from <a href="ranger.gui.curses_shortcuts.html#CursesShortcuts">ranger.gui.curses_shortcuts.CursesShortcuts</a>:<br>
-<dl><dt><a name="UI-addch"><strong>addch</strong></a>(self, *args)</dt></dl>
-
-<dl><dt><a name="UI-addnstr"><strong>addnstr</strong></a>(self, *args)</dt></dl>
-
-<dl><dt><a name="UI-addstr"><strong>addstr</strong></a>(self, *args)</dt></dl>
-
-<dl><dt><a name="UI-color"><strong>color</strong></a>(self, *keys)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;from&nbsp;now&nbsp;on.</tt></dd></dl>
-
-<dl><dt><a name="UI-color_at"><strong>color_at</strong></a>(self, y, x, wid, *keys)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;at&nbsp;the&nbsp;specified&nbsp;position</tt></dd></dl>
-
-<dl><dt><a name="UI-color_reset"><strong>color_reset</strong></a>(self)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;to&nbsp;the&nbsp;default&nbsp;colors</tt></dd></dl>
-
-<hr>
-Data and other attributes inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
-<dl><dt><strong>settings</strong> = {}</dl>
-
-</td></tr></table></td></tr></table><p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#55aa55">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><strong>MOUSEMASK</strong> = 268435455<br>
-<strong>TERMINALS_WITH_TITLE</strong> = ('xterm', 'xterm-256color', 'rxvt', 'rxvt-256color', 'rxvt-unicode', 'aterm', 'Eterm', 'screen', 'screen-256color')</td></tr></table>
-</body></html>
\ No newline at end of file
ding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
//:: Some helpers for debugging.

//: Load the 'map' file generated during 'subx --debug translate' when running
//: 'subx --debug --trace run'.
//: (It'll only affect the trace.)

:(before "End Globals")
map</*address*/uint32_t, string> Symbol_name;  // used only by 'subx run'
map</*address*/uint32_t, string> Source_line;  // used only by 'subx run'
:(before "End --debug Settings")
load_labels();
load_source_lines();
:(code)
void load_labels() {
  ifstream fin("labels");
  fin >> std::hex;
  while (has_data(fin)) {
    uint32_t addr = 0;
    fin >> addr;
    string name;
    fin >> name;
    put(Symbol_name, addr, name);
  }
}

void load_source_lines() {
  ifstream fin("source_lines");
  fin >> std::hex;
  while (has_data(fin)) {
    uint32_t addr = 0;
    fin >> addr;
    string line;
    getline(fin, line);
    put(Source_line, addr, hacky_squeeze_out_whitespace(line));
  }
}

:(after "Run One Instruction")
if (contains_key(Symbol_name, EIP))
  trace(Callstack_depth, "run") << "== label " << get(Symbol_name, EIP) << end();
if (contains_key(Source_line, EIP))
  trace(Callstack_depth, "run") << "0x" << HEXWORD << EIP << ": " << get(Source_line, EIP) << end();
else
  // no source line info; do what you can
  trace(Callstack_depth, "run") << "0x" << HEXWORD << EIP << ": " << debug_info(EIP) << end();

:(code)
string debug_info(uint32_t inst_address) {
  uint8_t op = read_mem_u8(inst_address);
  if (op != 0xe8) {
    ostringstream out;
    out << HEXBYTE << NUM(op);
    return out.str();
  }
  int32_t offset = read_mem_i32(inst_address+/*skip op*/1);
  uint32_t next_eip = inst_address+/*inst length*/5+offset;
  if (contains_key(Symbol_name, next_eip))
    return "e8/call "+get(Symbol_name, next_eip);
  ostringstream out;
  out << "e8/call 0x" << HEXWORD << next_eip;
  return out.str();
}

//: If a label starts with '$watch-', make a note of the effective address
//: computed by the next instruction. Start dumping out its contents to the
//: trace after every subsequent instruction.

:(after "Run One Instruction")
dump_watch_points();
:(before "End Globals")
map<string, uint32_t> Watch_points;
:(before "End Reset")
Watch_points.clear();
:(code)
void dump_watch_points() {
  if (Watch_points.empty()) return;
  trace(Callstack_depth, "dbg") << "watch points:" << end();
  for (map<string, uint32_t>::iterator p = Watch_points.begin();  p != Watch_points.end();  ++p)
    trace(Callstack_depth, "dbg") << "  " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end();
}

:(before "End Globals")
string Watch_this_effective_address;
:(after "Run One Instruction")
Watch_this_effective_address = "";
if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-"))
  Watch_this_effective_address = get(Symbol_name, EIP);
:(after "Found effective_address(addr)")
if (!Watch_this_effective_address.empty()) {
  dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end();
  put(Watch_points, Watch_this_effective_address, addr);
}

//: Special label that dumps regions of memory.
//: Not a general mechanism; by the time you get here you're willing to hack
//: on the emulator.
:(after "Run One Instruction")
if (contains_key(Symbol_name, EIP) && get(Symbol_name, EIP) == "$dump-stream-at-EAX")
  dump_stream_at(Reg[EAX].u);
:(code)
void dump_stream_at(uint32_t stream_start) {
  int32_t stream_length = read_mem_i32(stream_start + 8);
  dbg << "stream length: " << std::dec << stream_length << end();
  for (int i = 0;  i < stream_length + 12;  ++i)
    dbg << "0x" << HEXWORD << (stream_start+i) << ": " << HEXBYTE << NUM(read_mem_u8(stream_start+i)) << end();
}

//: helpers

:(code)
string hacky_squeeze_out_whitespace(const string& s) {
  // strip whitespace at start
  string::const_iterator first = s.begin();
  while (first != s.end() && isspace(*first))
    ++first;
  if (first == s.end()) return "";

  // strip whitespace at end
  string::const_iterator last = --s.end();
  while (last != s.begin() && isspace(*last))
    --last;
  ++last;

  // replace runs of spaces/dots with single space until comment or string
  // TODO:
  //   leave alone dots not surrounded by whitespace
  //   leave alone '#' within word
  //   leave alone '"' within word
  //   squeeze spaces after end of string
  ostringstream out;
  bool previous_was_space = false;
  bool in_comment_or_string = false;
  for (string::const_iterator curr = first;  curr != last;  ++curr) {
    if (in_comment_or_string)
      out << *curr;
    else if (isspace(*curr) || *curr == '.')
      previous_was_space = true;
    else {
      if (previous_was_space)
        out << ' ';
      out << *curr;
      previous_was_space = false;
      if (*curr == '#' || *curr == '"') in_comment_or_string = true;
    }
  }
  return out.str();
}