| 1 | /* source.h -*- C++ -*-
|
|---|
| 2 | Copyright (c) 1996 Eberhard Mattes
|
|---|
| 3 |
|
|---|
| 4 | This file is part of pmgdb.
|
|---|
| 5 |
|
|---|
| 6 | pmgdb is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | pmgdb is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with pmgdb; see the file COPYING. If not, write to
|
|---|
| 18 | the Free Software Foundation, 59 Temple Place - Suite 330,
|
|---|
| 19 | Boston, MA 02111-1307, USA. */
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | class command_window;
|
|---|
| 23 | class gdbio;
|
|---|
| 24 |
|
|---|
| 25 | class source_window : public pmtxt
|
|---|
| 26 | {
|
|---|
| 27 | public:
|
|---|
| 28 |
|
|---|
| 29 | typedef pmtxt parent;
|
|---|
| 30 |
|
|---|
| 31 | // Constructors and destructors
|
|---|
| 32 | source_window (pmapp *app, unsigned id, const char *fontnamesize,
|
|---|
| 33 | const char *short_fname, const char *long_fname,
|
|---|
| 34 | command_window *cmd, gdbio *gdb);
|
|---|
| 35 | ~source_window ();
|
|---|
| 36 |
|
|---|
| 37 | // Painting
|
|---|
| 38 | void show_line (int lineno);
|
|---|
| 39 | void select_line (int lineno);
|
|---|
| 40 | ULONG selected_addr ();
|
|---|
| 41 | void set_breakpoint (int lineno, bool set, bool paint);
|
|---|
| 42 |
|
|---|
| 43 | // Querying members
|
|---|
| 44 | const char *get_short_filename () const { return short_filename; }
|
|---|
| 45 | const char *get_long_filename () const { return long_filename; }
|
|---|
| 46 |
|
|---|
| 47 | // Dialog box
|
|---|
| 48 | MRESULT goto_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 49 | MRESULT find_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 50 |
|
|---|
| 51 | private:
|
|---|
| 52 | void load ();
|
|---|
| 53 | void button1_lineno (int line, int clicks);
|
|---|
| 54 | void button1_source (int line, int column, int clicks);
|
|---|
| 55 | void find (bool start, bool forward);
|
|---|
| 56 |
|
|---|
| 57 | // Override member functions of pmframe
|
|---|
| 58 | bool wm_user (HWND, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 59 | MRESULT wm_activate (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 60 | MRESULT wm_char (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 61 | MRESULT wm_command (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 62 | MRESULT wm_close (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 63 | void button_event (int line, int column, int tab, int button, int clicks);
|
|---|
| 64 |
|
|---|
| 65 | command_window *cmd;
|
|---|
| 66 | gdbio *gdb;
|
|---|
| 67 | fstring short_filename; // File name of source file (symtab)
|
|---|
| 68 | fstring long_filename; // Path name of source file
|
|---|
| 69 | int cur_lineno; // Current line# (1-based) or -1
|
|---|
| 70 | int sel_lineno; // Selected line# (1-based) or -1
|
|---|
| 71 | pmtxt_attr hilite_attr; // Attribute used for hilighting current line
|
|---|
| 72 | pmtxt_attr sel_attr; // Attribute used for hilighting selection
|
|---|
| 73 | pmtxt_attr bpt_attr; // Attribute used for breakpoints
|
|---|
| 74 | pmtxt_attr sel_bpt_attr; // Select and breakpoint
|
|---|
| 75 |
|
|---|
| 76 | int exp_lineno, exp_column;
|
|---|
| 77 | size_t exp_len;
|
|---|
| 78 |
|
|---|
| 79 | int find_lineno;
|
|---|
| 80 | vstring find_string;
|
|---|
| 81 | };
|
|---|