home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / MemoryViewer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  3.3 KB  |  115 lines

  1. // -*- C++ -*-
  2. // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
  3. // Copyright (C) 1999-2003 Forgotten
  4. // Copyright (C) 2004 Forgotten and the VBA development team
  5.  
  6. // This program 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. // This program 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 this program; if not, write to the Free Software Foundation,
  18. // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  
  20. #if !defined(AFX_MEMORYVIEWER_H__52C50474_5399_4D0B_A3E4_4C52C4E0EAA0__INCLUDED_)
  21. #define AFX_MEMORYVIEWER_H__52C50474_5399_4D0B_A3E4_4C52C4E0EAA0__INCLUDED_
  22.  
  23. #include "..\System.h"  // Added by ClassView
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. // MemoryViewer.h : header file
  28. //
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // MemoryViewer window
  32.  
  33. class IMemoryViewerDlg {
  34.  public:
  35.   virtual void setCurrentAddress(u32 address)=0;
  36. };
  37.  
  38. class MemoryViewer : public CWnd
  39. {
  40.   u32 address;
  41.   int addressSize;
  42.   int dataSize;
  43.   bool hasCaret;
  44.   int caretWidth;
  45.   int caretHeight;
  46.   HFONT font;
  47.   CSize fontSize;
  48.   u32 editAddress;
  49.   int editNibble;
  50.   int maxNibble;
  51.   int displayedLines;
  52.   int beginAscii;
  53.   int beginHex;
  54.   bool editAscii;
  55.   IMemoryViewerDlg *dlg;
  56.  
  57.   static bool isRegistered;
  58.   // Construction
  59.  public:
  60.   MemoryViewer();
  61.  
  62.   // Attributes
  63.  public:
  64.  
  65.   // Operations
  66.  public:
  67.   virtual void readData(u32,int,u8 *) = 0;
  68.   virtual void editData(u32,int,int,u32)=0;
  69.  
  70.   // Overrides
  71.   // ClassWizard generated virtual function overrides
  72.   //{{AFX_VIRTUAL(MemoryViewer)
  73.   //}}AFX_VIRTUAL
  74.  
  75.   // Implementation
  76.  public:
  77.   int getSize();
  78.   u32 getCurrentAddress();
  79.   void setAddressSize(int s);
  80.   void registerClass();
  81.   void beep();
  82.   bool OnEditInput(UINT c);
  83.   void moveAddress(s32 offset, int nibbleOff);
  84.   void setCaretPos();
  85.   void destroyEditCaret();
  86.   void createEditCaret(int w, int h);
  87.   void updateScrollInfo(int lines);
  88.   void setSize(int s);
  89.   void setAddress(u32 a);
  90.   void setDialog(IMemoryViewerDlg *d);
  91.   virtual ~MemoryViewer();
  92.  
  93.   // Generated message map functions
  94.  protected:
  95.   //{{AFX_MSG(MemoryViewer)
  96.   afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  97.   afx_msg void OnPaint();
  98.   afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  99.   afx_msg UINT OnGetDlgCode();
  100.   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  101.   afx_msg void OnSetFocus(CWnd* pOldWnd);
  102.   afx_msg void OnKillFocus(CWnd* pNewWnd);
  103.   afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  104.   //}}AFX_MSG
  105.   DECLARE_MESSAGE_MAP()
  106.     afx_msg LRESULT OnWMChar(WPARAM wParam, LPARAM lParam);
  107. };
  108.  
  109. /////////////////////////////////////////////////////////////////////////////
  110.  
  111. //{{AFX_INSERT_LOCATION}}
  112. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  113.  
  114. #endif // !defined(AFX_MEMORYVIEWER_H__52C50474_5399_4D0B_A3E4_4C52C4E0EAA0__INCLUDED_)
  115.