1 # Source window class definition for GDBtk.
2 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License (GPL) as published by
6 # the Free Software Foundation; either version 2 of the License, or (at
7 # your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
15 # ----------------------------------------------------------------------
16 # Implements a source display widget using primitive widgets as the
19 # The main display for SrcWin is a SrcTextWin widget. This file
20 # should contain all the code for controlling the SrcTextWin.
21 # SrcTextWin should just display the requested file and lines, without
22 # having to be very intelligent. If there are problems, error codes
23 # should be returned and SrcWin should figure out what to do.
24 # ----------------------------------------------------------------------
27 inherit TopLevelWin GDBWin
30 method constructor {args}
32 method download_progress { section num tot {msg ""} }
34 method enable_ui { on }
36 method fillFuncCB {name}
37 method goto_func {w {val ""}}
38 method location {tag linespec}
39 method mode {w new_mode {go 1}}
44 method set_status { {msg ""} {tmp 0} }
45 method set_execution_status { {line ""} {pc ""}}
47 method test_get {var {private_func 0}}
48 method toggle_updates {value}
49 method toolbar {state}
50 method inferior {action}
54 method search {direction string}
56 proc choose_and_update {}
57 proc choose_and_display {tag linespec}
71 method _name {w {val ""}}
72 method _set_name { val {found 1} }
73 method _set_state {varname}
74 method _update_title {name}
77 method _set_tag_to_stack {}
78 proc _choose_window {file}
87 variable do_updates 1 ;# if the window does updates
88 variable _mangled_func
90 variable saved_msg "" ;# static
92 # statics used for downloads
93 variable last_section ""
94 variable last_section_start 0
97 # These keep track of the current PC window and the list of all