rlm@1: // -*- C++ -*- rlm@1: // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. rlm@1: // Copyright (C) 1999-2003 Forgotten rlm@1: // Copyright (C) 2004 Forgotten and the VBA development team rlm@1: rlm@1: // This program is free software; you can redistribute it and/or modify rlm@1: // it under the terms of the GNU General Public License as published by rlm@1: // the Free Software Foundation; either version 2, or(at your option) rlm@1: // any later version. rlm@1: // rlm@1: // This program is distributed in the hope that it will be useful, rlm@1: // but WITHOUT ANY WARRANTY; without even the implied warranty of rlm@1: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the rlm@1: // GNU General Public License for more details. rlm@1: // rlm@1: // You should have received a copy of the GNU General Public License rlm@1: // along with this program; if not, write to the Free Software Foundation, rlm@1: // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. rlm@1: rlm@1: #ifndef __VBA_JOYPADCONFIG_H__ rlm@1: #define __VBA_JOYPADCONFIG_H__ rlm@1: rlm@1: #include rlm@1: rlm@1: #include rlm@1: #include rlm@1: rlm@1: #ifndef GTKMM20 rlm@1: # include "sigccompat.h" rlm@1: #endif // ! GTKMM20 rlm@1: rlm@1: #include "input.h" rlm@1: rlm@1: namespace VBA rlm@1: { rlm@1: rlm@1: class JoypadConfig rlm@1: { rlm@1: public: rlm@1: guint m_uiUp; rlm@1: guint m_uiDown; rlm@1: guint m_uiLeft; rlm@1: guint m_uiRight; rlm@1: guint m_uiA; rlm@1: guint m_uiB; rlm@1: guint m_uiL; rlm@1: guint m_uiR; rlm@1: guint m_uiSelect; rlm@1: guint m_uiStart; rlm@1: guint m_uiSpeed; rlm@1: guint m_uiCapture; rlm@1: rlm@1: guint * puiAt(int _iIndex); rlm@1: int iFind(guint _uiKeycode); rlm@1: void vSetDefault(); rlm@1: Keymap * poCreateKeymap() const; rlm@1: }; rlm@1: rlm@1: class JoypadConfigDialog : public Gtk::Dialog rlm@1: { rlm@1: public: rlm@1: JoypadConfigDialog(GtkDialog * _pstDialog, rlm@1: const Glib::RefPtr & _poXml); rlm@1: virtual ~JoypadConfigDialog(); rlm@1: rlm@1: void vSetConfig(const JoypadConfig & _roConfig); rlm@1: inline JoypadConfig stGetConfig() const { return m_oConfig; } rlm@1: rlm@1: protected: rlm@1: bool bOnEntryFocusIn(GdkEventFocus * _pstEvent, guint _uiEntry); rlm@1: bool bOnEntryFocusOut(GdkEventFocus * _pstEvent); rlm@1: rlm@1: bool on_key_press_event(GdkEventKey * _pstEvent); rlm@1: rlm@1: private: rlm@1: JoypadConfig m_oConfig; rlm@1: Gtk::Button * m_poOkButton; rlm@1: std::vector m_oEntries; rlm@1: guint * m_puiCurrentKeyCode; rlm@1: guint m_uiCurrentEntry; rlm@1: rlm@1: void vUpdateEntries(); rlm@1: }; rlm@1: rlm@1: } // namespace VBA rlm@1: rlm@1: rlm@1: #endif // __VBA_JOYPADCONFIG_H__