summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gdb/mswin/srcwin.h
blob: bf29b53657e430649eac3fddfa42ae3d592ea5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// source.h : header file
//


/////////////////////////////////////////////////////////////////////////////

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

class CSrcSplit : public CMDIChildWnd
{
  DECLARE_DYNCREATE(CSrcSplit)
 protected:
  CSrcSplit();			// protected constructor used by dynamic creation
  
public:
#define ASMISH 0
#define SRCISH 1
#define ON 0
#define OFF 1
#define TOGGLE 2
  void set_type(int type, int what, int which);
  
  
  class CSrcScroll1 *panes[2];
  
  // Attributes
protected:
public:
  class CTabView *sel;
  CStatic fname;
//  class CSrcInfoView *info;
  CSplitterWnd split;
  int active;
  
public:
  
  class CSrcFile *visible_file;	// pointer to file involved with the window
  static void Initialize();
  static void Terminate();
  // Operations
public:
  void select_title(const char *);
  void select_symtab(class CSymtab *);
  void select_function (const char *, CORE_ADDR low, CORE_ADDR high);
  void new_pc(CORE_ADDR pc);
  // Overrides
  // ClassWizard generated virtual function overrides
  //{{AFX_VIRTUAL(CSrcSplit)
protected:
  virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  //}}AFX_VIRTUAL
  
  // Implementation
public:
  virtual ~CSrcSplit();
  
  void hit( int *);
  // Generated message map functions
  //{{AFX_MSG(CSrcSplit)
  afx_msg void OnSize(UINT nType, int cx, int cy);
  afx_msg void OnFileOpen();
  afx_msg void OnTabClose();
	afx_msg void OnDestroy();
	//}}AFX_MSG
  DECLARE_MESSAGE_MAP()
  };

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CSrcScroll view




/////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////
// CSrcScroll1 view




class CSrcScroll1 : public CScrollView
{
public:
  int init;
  int winindex;
  int show_assembly() ;
  int show_source() ;
  void toggle(int *p);
  int srcb;  /* 1 to show src */
  int asmb;  /* 1 to show asm, 2 when showing asm because src not available */ 
  int lineb;
  int bptb;
  class  CSrcD * getdoc() { return (CSrcD*)(GetDocument());}
  void workout_source();
private:
  class CSrcFile *get_visible_file() 
    { return parent->visible_file; }
  class CSrcFrom *visible_buffer;
  
  void show_file(const char *n);
  void set_invert(int );
  int get_scroll_y();
  void scroll_to_show_line (int i);

  
  int width;
  int splatx;
  int srcx;
  enum { BPT, SRC }  zone; 
  int srcline_index;
  int depth;
  int get_top_line();
  int line_with_pc;
  int line_with_show_line;
  int line_from_0basedy(int y);
  int addr_in_line (int line, CORE_ADDR pc, int sp);
  int find_line_of_pc (CORE_ADDR);
  void calc_visible_lines(int*first_visible_line,
			  int *last_visible_line);
  void splat(CDC *pDC, int red, int y)  ;
  void redraw_line(int y, int off);
  
  
  
protected:
  CSrcScroll1();		// protected constructor used by dynamic creation
  DECLARE_DYNCREATE(CSrcScroll1)
    
    // Attributes
  public:
  class CSrcSplit *parent;
  // Operations
public:
  int want_to_show_line ;  
  // Overrides
  // ClassWizard generated virtual function overrides
  //{{AFX_VIRTUAL(CSrcScroll1)
  virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
protected:
  virtual void OnDraw(CDC* pDC); // overridden to draw this view
  virtual void OnInitialUpdate(); // first time after construct

  //}}AFX_VIRTUAL
  
  // Implementation
protected:
  virtual ~CSrcScroll1();
public:  
  // Generated message map functions
  //{{AFX_MSG(CSrcScroll1)
  afx_msg void OnS();
  afx_msg void OnN();
  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  afx_msg void OnUpdateShowAsm(CCmdUI* pCmdUI);
  afx_msg void OnUpdateShowSource(CCmdUI* pCmdUI);
  afx_msg void OnUpdateShowLine(CCmdUI* pCmdUI);
  afx_msg void OnUpdateShowBpts(CCmdUI* pCmdUI);
  afx_msg void OnShowAsm();
  afx_msg void OnShowSource();
  afx_msg void OnWatch();
  afx_msg void OnShowLine();
  afx_msg void OnShowBpts();
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	//}}AFX_MSG
  DECLARE_MESSAGE_MAP()
  };

/////////////////////////////////////////////////////////////////////////////



void      redraw_allsrcwins();
/////////////////////////////////////////////////////////////////////////////