ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

remap-dialog.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef REMAP_DIALOG_H
00024 #define REMAP_DIALOG_H
00025 
00026 #include "common/scummsys.h"
00027 
00028 #ifdef ENABLE_KEYMAPPER
00029 
00030 #include "backends/keymapper/keymapper.h"
00031 #include "gui/dialog.h"
00032 
00033 namespace GUI {
00034 class ButtonWidget;
00035 class PopUpWidget;
00036 class ScrollBarWidget;
00037 class StaticTextWidget;
00038 }
00039 
00040 namespace Common {
00041 
00042 class RemapDialog : public GUI::Dialog {
00043 public:
00044     RemapDialog();
00045     virtual ~RemapDialog();
00046     virtual void open();
00047     virtual void close();
00048     virtual void reflowLayout();
00049     virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
00050     virtual void handleKeyDown(Common::KeyState state);
00051     virtual void handleKeyUp(Common::KeyState state);
00052     virtual void handleMouseDown(int x, int y, int button, int clickCount);
00053     virtual void handleTickle();
00054     virtual void handleOtherEvent(Common::Event ev);
00055 
00056 protected:
00057     struct ActionWidgets {
00058         GUI::StaticTextWidget *actionText;
00059         GUI::ButtonWidget *keyButton;
00060         GUI::ButtonWidget *clearButton;
00061     };
00062     struct ActionInfo {
00063         Action *action;
00064         bool inherited;
00065         String description;
00066     };
00067 
00068     void loadKeymap();
00069     void refreshKeymap();
00070     void clearMapping(uint i);
00071     void startRemapping(uint i);
00072     void stopRemapping(bool force = false);
00073 
00074     Keymapper *_keymapper;
00075     Keymap** _keymapTable;
00076 
00077     Array<ActionInfo> _currentActions;
00078     int _topAction;
00079 
00080     Rect _keymapArea;
00081 
00082     GUI::StaticTextWidget *_kmPopUpDesc;
00083     GUI::PopUpWidget *_kmPopUp;
00084     //GUI::ContainerWidget *_container;
00085     GUI::ScrollBarWidget *_scrollBar;
00086 
00087     uint _rowCount;
00088 
00089     Array<ActionWidgets> _keymapWidgets;
00090     uint32 _remapTimeout;
00091     static const uint32 kRemapTimeoutDelay = 3000;
00092 
00093     bool _changes;
00094 
00095     bool _topKeymapIsGui;
00096 
00097 };
00098 
00099 } // End of namespace Common
00100 
00101 #endif // #ifdef ENABLE_KEYMAPPER
00102 
00103 #endif // #ifndef REMAP_DIALOG_H


Generated on Sat Feb 16 2019 05:01:02 for ResidualVM by doxygen 1.7.1
curved edge   curved edge