annotate 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
rev   line source
rlm@1 1 // -*- C++ -*-
rlm@1 2 // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
rlm@1 3 // Copyright (C) 1999-2003 Forgotten
rlm@1 4 // Copyright (C) 2004 Forgotten and the VBA development team
rlm@1 5
rlm@1 6 // This program is free software; you can redistribute it and/or modify
rlm@1 7 // it under the terms of the GNU General Public License as published by
rlm@1 8 // the Free Software Foundation; either version 2, or(at your option)
rlm@1 9 // any later version.
rlm@1 10 //
rlm@1 11 // This program is distributed in the hope that it will be useful,
rlm@1 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
rlm@1 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rlm@1 14 // GNU General Public License for more details.
rlm@1 15 //
rlm@1 16 // You should have received a copy of the GNU General Public License
rlm@1 17 // along with this program; if not, write to the Free Software Foundation,
rlm@1 18 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
rlm@1 19
rlm@1 20 #ifndef __VBA_SCREENAREA_H__
rlm@1 21 #define __VBA_SCREENAREA_H__
rlm@1 22
rlm@1 23 #include <gtkmm/drawingarea.h>
rlm@1 24 #include <gdkmm/cursor.h>
rlm@1 25
rlm@1 26 #ifndef GTKMM20
rlm@1 27 # include "sigccompat.h"
rlm@1 28 #endif // ! GTKMM20
rlm@1 29
rlm@1 30 #include "filters.h"
rlm@1 31
rlm@1 32 namespace VBA
rlm@1 33 {
rlm@1 34
rlm@1 35 class ScreenArea : public Gtk::DrawingArea
rlm@1 36 {
rlm@1 37 public:
rlm@1 38 ScreenArea(int _iWidth, int _iHeight, int _iScale = 1);
rlm@1 39 virtual ~ScreenArea();
rlm@1 40
rlm@1 41 void vSetSize(int _iWidth, int _iHeight);
rlm@1 42 void vSetScale(int _iScale);
rlm@1 43 void vSetFilter2x(EFilter2x _eFilter2x);
rlm@1 44 void vSetFilterIB(EFilterIB _eFilterIB);
rlm@1 45 void vDrawPixels(u8 * _puiData);
rlm@1 46 void vDrawColor(u32 _uiColor); // 0xRRGGBB
rlm@1 47
rlm@1 48 protected:
rlm@1 49 virtual bool on_expose_event(GdkEventExpose * _pstEvent);
rlm@1 50 virtual bool on_motion_notify_event(GdkEventMotion * _pstEvent);
rlm@1 51 virtual bool on_enter_notify_event(GdkEventCrossing * _pstEvent);
rlm@1 52 virtual bool on_leave_notify_event(GdkEventCrossing * _pstEvent);
rlm@1 53 virtual bool bOnCursorTimeout();
rlm@1 54
rlm@1 55 private:
rlm@1 56 int m_iWidth;
rlm@1 57 int m_iHeight;
rlm@1 58 int m_iScale;
rlm@1 59 int m_iAreaWidth;
rlm@1 60 int m_iAreaHeight;
rlm@1 61 int m_iRowStride;
rlm@1 62 u32 * m_puiPixels;
rlm@1 63 u8 * m_puiDelta;
rlm@1 64 Filter2x m_vFilter2x;
rlm@1 65 FilterIB m_vFilterIB;
rlm@1 66
rlm@1 67 bool m_bShowCursor;
rlm@1 68 Gdk::Cursor * m_poEmptyCursor;
rlm@1 69 SigC::connection m_oCursorSig;
rlm@1 70
rlm@1 71 void vUpdateSize();
rlm@1 72 void vStartCursorTimeout();
rlm@1 73 void vStopCursorTimeout();
rlm@1 74 void vHideCursor();
rlm@1 75 void vShowCursor();
rlm@1 76 };
rlm@1 77
rlm@1 78 } // namespace VBA
rlm@1 79
rlm@1 80
rlm@1 81 #endif // __VBA_SCREENAREA_H__