diff src/gtk/screenarea.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/gtk/screenarea.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,81 @@
     1.4 +// -*- C++ -*-
     1.5 +// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
     1.6 +// Copyright (C) 1999-2003 Forgotten
     1.7 +// Copyright (C) 2004 Forgotten and the VBA development team
     1.8 +
     1.9 +// This program is free software; you can redistribute it and/or modify
    1.10 +// it under the terms of the GNU General Public License as published by
    1.11 +// the Free Software Foundation; either version 2, or(at your option)
    1.12 +// any later version.
    1.13 +//
    1.14 +// This program is distributed in the hope that it will be useful,
    1.15 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 +// GNU General Public License for more details.
    1.18 +//
    1.19 +// You should have received a copy of the GNU General Public License
    1.20 +// along with this program; if not, write to the Free Software Foundation,
    1.21 +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1.22 +
    1.23 +#ifndef __VBA_SCREENAREA_H__
    1.24 +#define __VBA_SCREENAREA_H__
    1.25 +
    1.26 +#include <gtkmm/drawingarea.h>
    1.27 +#include <gdkmm/cursor.h>
    1.28 +
    1.29 +#ifndef GTKMM20
    1.30 +# include "sigccompat.h"
    1.31 +#endif // ! GTKMM20
    1.32 +
    1.33 +#include "filters.h"
    1.34 +
    1.35 +namespace VBA
    1.36 +{
    1.37 +
    1.38 +class ScreenArea : public Gtk::DrawingArea
    1.39 +{
    1.40 +public:
    1.41 +  ScreenArea(int _iWidth, int _iHeight, int _iScale = 1);
    1.42 +  virtual ~ScreenArea();
    1.43 +
    1.44 +  void vSetSize(int _iWidth, int _iHeight);
    1.45 +  void vSetScale(int _iScale);
    1.46 +  void vSetFilter2x(EFilter2x _eFilter2x);
    1.47 +  void vSetFilterIB(EFilterIB _eFilterIB);
    1.48 +  void vDrawPixels(u8 * _puiData);
    1.49 +  void vDrawColor(u32 _uiColor); // 0xRRGGBB
    1.50 +
    1.51 +protected:
    1.52 +  virtual bool on_expose_event(GdkEventExpose * _pstEvent);
    1.53 +  virtual bool on_motion_notify_event(GdkEventMotion * _pstEvent);
    1.54 +  virtual bool on_enter_notify_event(GdkEventCrossing * _pstEvent);
    1.55 +  virtual bool on_leave_notify_event(GdkEventCrossing * _pstEvent);
    1.56 +  virtual bool bOnCursorTimeout();
    1.57 +
    1.58 +private:
    1.59 +  int      m_iWidth;
    1.60 +  int      m_iHeight;
    1.61 +  int      m_iScale;
    1.62 +  int      m_iAreaWidth;
    1.63 +  int      m_iAreaHeight;
    1.64 +  int      m_iRowStride;
    1.65 +  u32 *    m_puiPixels;
    1.66 +  u8 *     m_puiDelta;
    1.67 +  Filter2x m_vFilter2x;
    1.68 +  FilterIB m_vFilterIB;
    1.69 +
    1.70 +  bool             m_bShowCursor;
    1.71 +  Gdk::Cursor *    m_poEmptyCursor;
    1.72 +  SigC::connection m_oCursorSig;
    1.73 +
    1.74 +  void vUpdateSize();
    1.75 +  void vStartCursorTimeout();
    1.76 +  void vStopCursorTimeout();
    1.77 +  void vHideCursor();
    1.78 +  void vShowCursor();
    1.79 +};
    1.80 +
    1.81 +} // namespace VBA
    1.82 +
    1.83 +
    1.84 +#endif // __VBA_SCREENAREA_H__