home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / PaletteViewControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  2.6 KB  |  91 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_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_)
  21. #define AFX_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_
  22.  
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // PaletteViewControl.h : header file
  27. //
  28. #define WM_PALINFO WM_APP+1
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // PaletteViewControl window
  32.  
  33. class PaletteViewControl : public CWnd
  34. {
  35.   int w;
  36.   int h;
  37.   int colors;
  38.   u8 *data;
  39.   BITMAPINFO bmpInfo;
  40.   static bool isRegistered;
  41.   int selected;
  42.  protected:
  43.   u16 palette[256];
  44.   int paletteAddress;  
  45.   // Construction
  46.  public:
  47.   PaletteViewControl();
  48.  
  49.   virtual void updatePalette()=0;
  50.  
  51.   // Attributes
  52.  public:
  53.  
  54.   // Operations
  55.  public:
  56.  
  57.   // Overrides
  58.   // ClassWizard generated virtual function overrides
  59.   //{{AFX_VIRTUAL(PaletteViewControl)
  60.   //}}AFX_VIRTUAL
  61.  
  62.   // Implementation
  63.  public:
  64.   void registerClass();
  65.   void refresh();
  66.   void render(u16 color, int x, int y);
  67.   void setSelected(int s);
  68.   void setPaletteAddress(int address);
  69.   bool saveJASCPAL(const char *name);
  70.   bool saveMSPAL(const char *name);
  71.   bool saveAdobe(const char *name);
  72.   void init(int c, int w, int h);
  73.   virtual ~PaletteViewControl();
  74.  
  75.   // Generated message map functions
  76.  protected:
  77.   //{{AFX_MSG(PaletteViewControl)
  78.   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  79.   afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  80.   afx_msg void OnPaint();
  81.   //}}AFX_MSG
  82.   DECLARE_MESSAGE_MAP()
  83.     };
  84.  
  85.     /////////////////////////////////////////////////////////////////////////////
  86.  
  87. //{{AFX_INSERT_LOCATION}}
  88. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  89.  
  90. #endif // !defined(AFX_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_)
  91.