home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / BitmapControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  2.8 KB  |  97 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_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_)
  21. #define AFX_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_
  22.  
  23. #include "..\System.h"  // Added by ClassView
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. // BitmapControl.h : header file
  28. //
  29. #ifndef WM_MAPINFO
  30. #define WM_MAPINFO WM_APP+101
  31. #endif
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // BitmapControl view
  35.  
  36. class BitmapControl : public CScrollView
  37. {
  38.  public:
  39.   BitmapControl();           // protected constructor used by dynamic creation
  40.  protected:
  41.   DECLARE_DYNCREATE(BitmapControl)
  42.  
  43.     // Attributes
  44.     public:
  45.  
  46.   // Operations
  47.  public:
  48.   void setStretch(bool b);
  49.   void refresh();
  50.   void setSize(int w1, int h1);
  51.   void setData(u8 *d);
  52.   void setBmpInfo(BITMAPINFO *info);
  53.   static bool isRegistered;
  54.  
  55.   // Overrides
  56.   // ClassWizard generated virtual function overrides
  57.   //{{AFX_VIRTUAL(BitmapControl)
  58.  protected:
  59.   virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  60.   virtual void OnInitialUpdate();     // first time after construct
  61.   virtual void PostNcDestroy();
  62.   //}}AFX_VIRTUAL
  63.  
  64.   // Implementation
  65.  public:
  66.   bool getStretch();
  67.   virtual ~BitmapControl();
  68.  protected:
  69. #ifdef _DEBUG
  70.   virtual void AssertValid() const;
  71.   virtual void Dump(CDumpContext& dc) const;
  72. #endif
  73.  
  74.   // Generated message map functions
  75.   //{{AFX_MSG(BitmapControl)
  76.   afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  77.   afx_msg void OnSize(UINT nType, int cx, int cy);
  78.   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  79.   //}}AFX_MSG
  80.   DECLARE_MESSAGE_MAP()
  81.     private:
  82.   void registerClass();
  83.   bool stretch;
  84.   u8 colors[3*64];
  85.   BITMAPINFO *bmpInfo;
  86.   u8 * data;
  87.   int h;
  88.   int w;
  89. };
  90.  
  91. /////////////////////////////////////////////////////////////////////////////
  92.  
  93. //{{AFX_INSERT_LOCATION}}
  94. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  95.  
  96. #endif // !defined(AFX_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_)
  97.