keys: implement parsing key configuration file

This commit is contained in:
Andrzej Rybczak
2012-09-05 18:02:37 +02:00
parent 95e2cfe6e1
commit 7c6467a9e7
10 changed files with 655 additions and 298 deletions

View File

@@ -28,7 +28,7 @@
enum ActionType
{
aMacroUtility,
aMouseEvent, aScrollUp, aScrollDown, aScrollUpArtist, aScrollUpAlbum, aScrollDownArtist,
aDummy, aMouseEvent, aScrollUp, aScrollDown, aScrollUpArtist, aScrollUpAlbum, aScrollDownArtist,
aScrollDownAlbum, aPageUp, aPageDown, aMoveHome, aMoveEnd, aToggleInterface, aJumpToParentDir,
aPressEnter, aPressSpace, aPreviousColumn, aNextColumn, aMasterScreen, aSlaveScreen, aVolumeUp,
aVolumeDown, aDelete, aReplaySong, aPreviousSong, aNextSong, aPause, aStop, aSavePlaylist,
@@ -79,6 +79,7 @@ struct Action
static bool isMPDMusicDirSet();
static Action *Get(ActionType);
static Action *Get(const std::string &name);
static bool OriginalStatusbarVisibility;
static bool DesignChanged;
@@ -100,9 +101,12 @@ struct Action
private:
ActionType itsType;
const char *itsName;
static void insertAction(Action *a) { Actions[a->Type()] = a; }
static std::map<ActionType, Action *> Actions;
};
struct Dummy : public Action
{
Dummy() : Action(aDummy, "dummy") { }
virtual void Run() { }
};
struct MouseEvent : public Action