| 1 | /* srcfiles.h -*- C++ -*-
|
|---|
| 2 | Copyright (c) 1996-1998 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 |
|
|---|
| 24 | class source_files_window : public pmtxt
|
|---|
| 25 | {
|
|---|
| 26 | public:
|
|---|
| 27 |
|
|---|
| 28 | typedef pmtxt parent;
|
|---|
| 29 | struct srcs_node;
|
|---|
| 30 |
|
|---|
| 31 | // Constructors and destructors
|
|---|
| 32 | source_files_window (command_window *cmd, unsigned id, const SWP *pswp,
|
|---|
| 33 | const char *fontnamesize);
|
|---|
| 34 | ~source_files_window ();
|
|---|
| 35 | void add (const char *fname);
|
|---|
| 36 | void done ();
|
|---|
| 37 | void delete_all ();
|
|---|
| 38 | void select (const char *fname);
|
|---|
| 39 |
|
|---|
| 40 | class iterator
|
|---|
| 41 | {
|
|---|
| 42 | public:
|
|---|
| 43 | iterator (const source_files_window &s) { cur = s.head; }
|
|---|
| 44 | ~iterator () {}
|
|---|
| 45 | bool ok () { return cur != NULL; }
|
|---|
| 46 | void next () { cur = cur->next; }
|
|---|
| 47 | operator const char * () { return cur->fname; }
|
|---|
| 48 |
|
|---|
| 49 | private:
|
|---|
| 50 | const srcs_node *cur;
|
|---|
| 51 | };
|
|---|
| 52 |
|
|---|
| 53 | private:
|
|---|
| 54 |
|
|---|
| 55 | // Override member functions of pmframe
|
|---|
| 56 | MRESULT wm_activate (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 57 | MRESULT wm_command (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 58 | MRESULT wm_close (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
|---|
| 59 | void button_event (int line, int column, int tab, int button, int clicks);
|
|---|
| 60 |
|
|---|
| 61 | srcs_node *find_by_line (int line);
|
|---|
| 62 | void select_line (int line, bool toggle = false);
|
|---|
| 63 |
|
|---|
| 64 | command_window *cmd;
|
|---|
| 65 | srcs_node *head;
|
|---|
| 66 | int lines;
|
|---|
| 67 | int sel_line;
|
|---|
| 68 | pmtxt_attr sel_attr;
|
|---|
| 69 |
|
|---|
| 70 | struct srcs_node
|
|---|
| 71 | {
|
|---|
| 72 | struct srcs_node *next;
|
|---|
| 73 | fstring fname;
|
|---|
| 74 | };
|
|---|
| 75 |
|
|---|
| 76 | friend class iterator;
|
|---|
| 77 | };
|
|---|