Skip to content

Commit

Permalink
Dissolve the WM_KEY macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Aug 4, 2024
1 parent 466e164 commit 779367f
Show file tree
Hide file tree
Showing 11 changed files with 257 additions and 366 deletions.
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ SET(ICE_COMMON_SRCS udir.cc upath.cc yapp.cc yxapp.cc ytimer.cc yprefs.cc
ypipereader.cc yxembed.cc yconfig.cc yfont.cc ysvg.cc
ypixmap.cc yimage2.cc yimage_gdk.cc yximage.cc ycolor.cc
ytooltip.cc ylocale.cc yarray.cc yfileio.cc ytime.cc
ystring.cc mstring.cc ref.cc keysyms.cc logevent.cc misc.cc)
ystring.cc mstring.cc ref.cc bindkey.cc keysyms.cc
logevent.cc misc.cc)

if(CONFIG_XFREETYPE)
list(APPEND ICE_COMMON_SRCS yfontxft.cc)
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ libice_la_SOURCES = \
argument.h \
ascii.h \
base.h \
bindkey.cc \
bindkey.h \
debug.h \
default.h \
Expand Down
303 changes: 97 additions & 206 deletions src/bindkey.h
Original file line number Diff line number Diff line change
@@ -1,210 +1,101 @@
#define defgMouseWinMove XK_Pointer_Button1, kfAlt, "Alt+Pointer_Button1"
#define defgMouseWinSize XK_Pointer_Button3, kfAlt, "Alt+Pointer_Button3"
#define defgMouseWinRaise XK_Pointer_Button1, kfCtrl+kfAlt, "Ctrl+Alt+Pointer_Button1"
#define defgMouseWinLower XK_Pointer_Button1, kfCtrl+kfAlt, "Ctrl+Alt+Pointer_Button1"
#define defgMouseWinTabbing XK_Pointer_Button2, kfShift, "Shift+Pointer_Button2"

#define defgKeyWinRaise XK_F1, kfAlt, "Alt+F1"
#define defgKeyWinOccupyAll XK_F2, kfAlt, "Alt+F2"
#define defgKeyWinLower XK_F3, kfAlt, "Alt+F3"
#define defgKeyWinClose XK_F4, kfAlt, "Alt+F4"
#define defgKeyWinRestore XK_F5, kfAlt, "Alt+F5"
#define defgKeyWinNext XK_F6, kfAlt, "Alt+F6"
#define defgKeyWinPrev XK_F6, kfAlt+kfShift, "Alt+Shift+F6"
#define defgKeyWinMove XK_F7, kfAlt, "Alt+F7"
#define defgKeyWinSize XK_F8, kfAlt, "Alt+F8"
#define defgKeyWinMinimize XK_F9, kfAlt, "Alt+F9"
#define defgKeyWinMaximize XK_F10, kfAlt, "Alt+F10"
#define defgKeyWinMaximizeVert XK_F10, kfAlt+kfShift, "Alt+Shift+F10"
#define defgKeyWinMaximizeHoriz 0, 0, ""
#define defgKeyWinFullscreen XK_F11, kfAlt, "Alt+F11"
#define defgKeyWinHide XK_F12, kfAlt+kfShift, "Alt+Shift+F12"
#define defgKeyWinRollup XK_F12, kfAlt, "Alt+F12"
#define defgKeyWinArrangeN XK_KP_Up, kfCtrl+kfAlt, "Ctrl+Alt+KP_Up"
#define defgKeyWinArrangeNE XK_KP_Prior, kfCtrl+kfAlt, "Ctrl+Alt+KP_Prior"
#define defgKeyWinArrangeE XK_KP_Right, kfCtrl+kfAlt, "Ctrl+Alt+KP_Right"
#define defgKeyWinArrangeSE XK_KP_Next, kfCtrl+kfAlt, "Ctrl+Alt+KP_Next"
#define defgKeyWinArrangeS XK_KP_Down, kfCtrl+kfAlt, "Ctrl+Alt+KP_Down"
#define defgKeyWinArrangeSW XK_KP_End, kfCtrl+kfAlt, "Ctrl+Alt+KP_End"
#define defgKeyWinArrangeW XK_KP_Left, kfCtrl+kfAlt, "Ctrl+Alt+KP_Left"
#define defgKeyWinArrangeNW XK_KP_Home, kfCtrl+kfAlt, "Ctrl+Alt+KP_Home"
#define defgKeyWinArrangeC XK_KP_Begin, kfCtrl+kfAlt, "Ctrl+Alt+KP_Begin"
#define defgKeyWinTileLeft 0, 0, ""
#define defgKeyWinTileRight 0, 0, ""
#define defgKeyWinTileTop 0, 0, ""
#define defgKeyWinTileBottom 0, 0, ""
#define defgKeyWinTileTopLeft 0, 0, ""
#define defgKeyWinTileTopRight 0, 0, ""
#define defgKeyWinTileBottomLeft 0, 0, ""
#define defgKeyWinTileBottomRight 0, 0, ""
#define defgKeyWinTileCenter 0, 0, ""
#define defgKeyWinSmartPlace XK_KP_Begin, kfCtrl+kfAlt+kfShift, "Ctrl+Alt+Shift+KP_Begin"
#define defgKeySysSwitchNext XK_Tab, kfAlt, "Alt+Tab"
#define defgKeySysSwitchLast XK_Tab, kfAlt+kfShift, "Alt+Shift+Tab"
#define defgKeySysSwitchClass XK_grave, kfAlt, "Alt+grave"
#define defgKeyTaskBarSwitchNext 0, 0, ""
#define defgKeyTaskBarSwitchPrev 0, 0, ""
#define defgKeyTaskBarMoveNext 0, 0, ""
#define defgKeyTaskBarMovePrev 0, 0, ""
#define defgKeySysWinNext XK_Escape, kfAlt, "Alt+Esc"
#define defgKeySysWinPrev XK_Escape, kfAlt+kfShift, "Alt+Shift+Esc"
#define defgKeySysWinMenu XK_Escape, kfShift, "Shift+Esc"
#define defgKeySysDialog XK_Delete, kfAlt+kfCtrl, "Alt+Ctrl+Del"
#define defgKeySysMenu XK_Escape, kfCtrl, "Ctrl+Esc"
#define defgKeySysWindowList XK_Escape, kfCtrl+kfAlt, "Alt+Ctrl+Esc"
#define defgKeySysWinListMenu 0, 0, ""
#define defgKeySysKeyboardNext 0, 0, ""
#define defgKeySysAddressBar ' ', kfAlt+kfCtrl, "Alt+Ctrl+space"
#define defgKeyWinMenu ' ', kfAlt, "Alt+space"
#define defgKeySysWorkspacePrev XK_Left, kfAlt+kfCtrl, "Alt+Ctrl+Left"
#define defgKeySysWorkspaceNext XK_Right, kfAlt+kfCtrl, "Alt+Ctrl+Right"
#define defgKeySysWorkspaceLast XK_Down, kfAlt+kfCtrl, "Alt+Ctrl+Down"
#define defgKeySysWorkspacePrevTakeWin XK_Left, kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+Left"
#define defgKeySysWorkspaceNextTakeWin XK_Right, kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+Right"
#define defgKeySysWorkspaceLastTakeWin XK_Down, kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+Down"
#define defgKeySysWorkspace1 '1', kfAlt+kfCtrl, "Alt+Ctrl+1"
#define defgKeySysWorkspace2 '2', kfAlt+kfCtrl, "Alt+Ctrl+2"
#define defgKeySysWorkspace3 '3', kfAlt+kfCtrl, "Alt+Ctrl+3"
#define defgKeySysWorkspace4 '4', kfAlt+kfCtrl, "Alt+Ctrl+4"
#define defgKeySysWorkspace5 '5', kfAlt+kfCtrl, "Alt+Ctrl+5"
#define defgKeySysWorkspace6 '6', kfAlt+kfCtrl, "Alt+Ctrl+6"
#define defgKeySysWorkspace7 '7', kfAlt+kfCtrl, "Alt+Ctrl+7"
#define defgKeySysWorkspace8 '8', kfAlt+kfCtrl, "Alt+Ctrl+8"
#define defgKeySysWorkspace9 '9', kfAlt+kfCtrl, "Alt+Ctrl+9"
#define defgKeySysWorkspace10 '0', kfAlt+kfCtrl, "Alt+Ctrl+0"
#define defgKeySysWorkspace11 '-', kfAlt+kfCtrl, "Alt+Ctrl+minus"
#define defgKeySysWorkspace12 '=', kfAlt+kfCtrl, "Alt+Ctrl+equal"
#define defgKeySysWorkspace1TakeWin '1', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+1"
#define defgKeySysWorkspace2TakeWin '2', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+2"
#define defgKeySysWorkspace3TakeWin '3', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+3"
#define defgKeySysWorkspace4TakeWin '4', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+4"
#define defgKeySysWorkspace5TakeWin '5', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+5"
#define defgKeySysWorkspace6TakeWin '6', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+6"
#define defgKeySysWorkspace7TakeWin '7', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+7"
#define defgKeySysWorkspace8TakeWin '8', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+8"
#define defgKeySysWorkspace9TakeWin '9', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+9"
#define defgKeySysWorkspace10TakeWin '0', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+0"
#define defgKeySysWorkspace11TakeWin '-', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+minus"
#define defgKeySysWorkspace12TakeWin '=', kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+equal"
#define defgKeySysTileVertical XK_F2, kfAlt+kfShift, "Alt+Shift+F2"
#define defgKeySysTileHorizontal XK_F3, kfAlt+kfShift, "Alt+Shift+F3"
#define defgKeySysCascade XK_F4, kfAlt+kfShift, "Alt+Shift+F4"
#define defgKeySysArrange XK_F5, kfAlt+kfShift, "Alt+Shift+F5"
#define defgKeySysArrangeIcons XK_F8, kfAlt+kfShift, "Alt+Shift+F8"
#define defgKeySysMinimizeAll XK_F9, kfAlt+kfShift, "Alt+Shift+F9"
#define defgKeySysHideAll XK_F11, kfAlt+kfShift, "Alt+Shift+F11"
#define defgKeySysUndoArrange XK_F7, kfAlt+kfShift, "Alt+Shift+F7"
#define defgKeySysShowDesktop 'd', kfAlt+kfCtrl, "Alt+Ctrl+d"
#define defgKeySysCollapseTaskBar 'h', kfAlt+kfCtrl, "Alt+Ctrl+h"
extern WMKey gMouseWinMove;
extern WMKey gMouseWinSize;
extern WMKey gMouseWinRaise;
extern WMKey gMouseWinLower;
extern WMKey gMouseWinTabbing;

#ifdef CFGDEF
#define DEF_WMKEY(k) WMKey k( def##k )
#else

#define DEF_WMKEY(k) extern WMKey k
#define IS_WMKEY(k,m,b) b.eq(k,m)
#define KEY_NAME(k) k.name
#endif

DEF_WMKEY(gMouseWinMove);
DEF_WMKEY(gMouseWinSize);
DEF_WMKEY(gMouseWinRaise);
DEF_WMKEY(gMouseWinLower);
DEF_WMKEY(gMouseWinTabbing);

DEF_WMKEY(gKeyWinRaise);
DEF_WMKEY(gKeyWinOccupyAll);
DEF_WMKEY(gKeyWinLower);
DEF_WMKEY(gKeyWinClose);
DEF_WMKEY(gKeyWinRestore);
DEF_WMKEY(gKeyWinPrev);
DEF_WMKEY(gKeyWinNext);
DEF_WMKEY(gKeyWinMove);
DEF_WMKEY(gKeyWinSize);
DEF_WMKEY(gKeyWinMinimize);
DEF_WMKEY(gKeyWinMaximize);
DEF_WMKEY(gKeyWinMaximizeVert);
DEF_WMKEY(gKeyWinMaximizeHoriz);
DEF_WMKEY(gKeyWinFullscreen);
DEF_WMKEY(gKeyWinHide);
DEF_WMKEY(gKeyWinRollup);
DEF_WMKEY(gKeyWinArrangeN);
DEF_WMKEY(gKeyWinArrangeNE);
DEF_WMKEY(gKeyWinArrangeE);
DEF_WMKEY(gKeyWinArrangeSE);
DEF_WMKEY(gKeyWinArrangeS);
DEF_WMKEY(gKeyWinArrangeSW);
DEF_WMKEY(gKeyWinArrangeW);
DEF_WMKEY(gKeyWinArrangeNW);
DEF_WMKEY(gKeyWinArrangeC);
DEF_WMKEY(gKeyWinTileLeft);
DEF_WMKEY(gKeyWinTileRight);
DEF_WMKEY(gKeyWinTileTop);
DEF_WMKEY(gKeyWinTileBottom);
DEF_WMKEY(gKeyWinTileTopLeft);
DEF_WMKEY(gKeyWinTileTopRight);
DEF_WMKEY(gKeyWinTileBottomLeft);
DEF_WMKEY(gKeyWinTileBottomRight);
DEF_WMKEY(gKeyWinTileCenter);
DEF_WMKEY(gKeyWinSmartPlace);
DEF_WMKEY(gKeyWinMenu);
DEF_WMKEY(gKeySysSwitchNext);
DEF_WMKEY(gKeySysSwitchLast);
DEF_WMKEY(gKeySysSwitchClass);
DEF_WMKEY(gKeySysWinNext);
DEF_WMKEY(gKeySysWinPrev);
DEF_WMKEY(gKeyTaskBarSwitchNext);
DEF_WMKEY(gKeyTaskBarSwitchPrev);
DEF_WMKEY(gKeyTaskBarMoveNext);
DEF_WMKEY(gKeyTaskBarMovePrev);
DEF_WMKEY(gKeySysWinMenu);
DEF_WMKEY(gKeySysDialog);
DEF_WMKEY(gKeySysMenu);
DEF_WMKEY(gKeySysWindowList);
DEF_WMKEY(gKeySysWinListMenu);
DEF_WMKEY(gKeySysKeyboardNext);
DEF_WMKEY(gKeySysAddressBar);
DEF_WMKEY(gKeySysWorkspacePrev);
DEF_WMKEY(gKeySysWorkspaceNext);
DEF_WMKEY(gKeySysWorkspaceLast);
DEF_WMKEY(gKeySysWorkspacePrevTakeWin);
DEF_WMKEY(gKeySysWorkspaceNextTakeWin);
DEF_WMKEY(gKeySysWorkspaceLastTakeWin);
DEF_WMKEY(gKeySysWorkspace1);
DEF_WMKEY(gKeySysWorkspace2);
DEF_WMKEY(gKeySysWorkspace3);
DEF_WMKEY(gKeySysWorkspace4);
DEF_WMKEY(gKeySysWorkspace5);
DEF_WMKEY(gKeySysWorkspace6);
DEF_WMKEY(gKeySysWorkspace7);
DEF_WMKEY(gKeySysWorkspace8);
DEF_WMKEY(gKeySysWorkspace9);
DEF_WMKEY(gKeySysWorkspace10);
DEF_WMKEY(gKeySysWorkspace11);
DEF_WMKEY(gKeySysWorkspace12);
DEF_WMKEY(gKeySysWorkspace1TakeWin);
DEF_WMKEY(gKeySysWorkspace2TakeWin);
DEF_WMKEY(gKeySysWorkspace3TakeWin);
DEF_WMKEY(gKeySysWorkspace4TakeWin);
DEF_WMKEY(gKeySysWorkspace5TakeWin);
DEF_WMKEY(gKeySysWorkspace6TakeWin);
DEF_WMKEY(gKeySysWorkspace7TakeWin);
DEF_WMKEY(gKeySysWorkspace8TakeWin);
DEF_WMKEY(gKeySysWorkspace9TakeWin);
DEF_WMKEY(gKeySysWorkspace10TakeWin);
DEF_WMKEY(gKeySysWorkspace11TakeWin);
DEF_WMKEY(gKeySysWorkspace12TakeWin);
DEF_WMKEY(gKeySysTileVertical);
DEF_WMKEY(gKeySysTileHorizontal);
DEF_WMKEY(gKeySysCascade);
DEF_WMKEY(gKeySysArrange);
DEF_WMKEY(gKeySysArrangeIcons);
DEF_WMKEY(gKeySysMinimizeAll);
DEF_WMKEY(gKeySysHideAll);
DEF_WMKEY(gKeySysUndoArrange);
DEF_WMKEY(gKeySysShowDesktop);
DEF_WMKEY(gKeySysCollapseTaskBar);

#undef DEF_WMKEY
extern WMKey gKeyWinRaise;
extern WMKey gKeyWinOccupyAll;
extern WMKey gKeyWinLower;
extern WMKey gKeyWinClose;
extern WMKey gKeyWinRestore;
extern WMKey gKeyWinPrev;
extern WMKey gKeyWinNext;
extern WMKey gKeyWinMove;
extern WMKey gKeyWinSize;
extern WMKey gKeyWinMinimize;
extern WMKey gKeyWinMaximize;
extern WMKey gKeyWinMaximizeVert;
extern WMKey gKeyWinMaximizeHoriz;
extern WMKey gKeyWinFullscreen;
extern WMKey gKeyWinHide;
extern WMKey gKeyWinRollup;
extern WMKey gKeyWinArrangeN;
extern WMKey gKeyWinArrangeNE;
extern WMKey gKeyWinArrangeE;
extern WMKey gKeyWinArrangeSE;
extern WMKey gKeyWinArrangeS;
extern WMKey gKeyWinArrangeSW;
extern WMKey gKeyWinArrangeW;
extern WMKey gKeyWinArrangeNW;
extern WMKey gKeyWinArrangeC;
extern WMKey gKeyWinTileLeft;
extern WMKey gKeyWinTileRight;
extern WMKey gKeyWinTileTop;
extern WMKey gKeyWinTileBottom;
extern WMKey gKeyWinTileTopLeft;
extern WMKey gKeyWinTileTopRight;
extern WMKey gKeyWinTileBottomLeft;
extern WMKey gKeyWinTileBottomRight;
extern WMKey gKeyWinTileCenter;
extern WMKey gKeyWinSmartPlace;
extern WMKey gKeyWinMenu;
extern WMKey gKeySysSwitchNext;
extern WMKey gKeySysSwitchLast;
extern WMKey gKeySysSwitchClass;
extern WMKey gKeySysWinNext;
extern WMKey gKeySysWinPrev;
extern WMKey gKeyTaskBarSwitchNext;
extern WMKey gKeyTaskBarSwitchPrev;
extern WMKey gKeyTaskBarMoveNext;
extern WMKey gKeyTaskBarMovePrev;
extern WMKey gKeySysWinMenu;
extern WMKey gKeySysDialog;
extern WMKey gKeySysMenu;
extern WMKey gKeySysWindowList;
extern WMKey gKeySysWinListMenu;
extern WMKey gKeySysKeyboardNext;
extern WMKey gKeySysAddressBar;
extern WMKey gKeySysWorkspacePrev;
extern WMKey gKeySysWorkspaceNext;
extern WMKey gKeySysWorkspaceLast;
extern WMKey gKeySysWorkspacePrevTakeWin;
extern WMKey gKeySysWorkspaceNextTakeWin;
extern WMKey gKeySysWorkspaceLastTakeWin;
extern WMKey gKeySysWorkspace1;
extern WMKey gKeySysWorkspace2;
extern WMKey gKeySysWorkspace3;
extern WMKey gKeySysWorkspace4;
extern WMKey gKeySysWorkspace5;
extern WMKey gKeySysWorkspace6;
extern WMKey gKeySysWorkspace7;
extern WMKey gKeySysWorkspace8;
extern WMKey gKeySysWorkspace9;
extern WMKey gKeySysWorkspace10;
extern WMKey gKeySysWorkspace11;
extern WMKey gKeySysWorkspace12;
extern WMKey gKeySysWorkspace1TakeWin;
extern WMKey gKeySysWorkspace2TakeWin;
extern WMKey gKeySysWorkspace3TakeWin;
extern WMKey gKeySysWorkspace4TakeWin;
extern WMKey gKeySysWorkspace5TakeWin;
extern WMKey gKeySysWorkspace6TakeWin;
extern WMKey gKeySysWorkspace7TakeWin;
extern WMKey gKeySysWorkspace8TakeWin;
extern WMKey gKeySysWorkspace9TakeWin;
extern WMKey gKeySysWorkspace10TakeWin;
extern WMKey gKeySysWorkspace11TakeWin;
extern WMKey gKeySysWorkspace12TakeWin;
extern WMKey gKeySysTileVertical;
extern WMKey gKeySysTileHorizontal;
extern WMKey gKeySysCascade;
extern WMKey gKeySysArrange;
extern WMKey gKeySysArrangeIcons;
extern WMKey gKeySysMinimizeAll;
extern WMKey gKeySysHideAll;
extern WMKey gKeySysUndoArrange;
extern WMKey gKeySysShowDesktop;
extern WMKey gKeySysCollapseTaskBar;

// vim: set sw=4 ts=4 et:
2 changes: 0 additions & 2 deletions src/genpref.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ void addKeyboard(const char *, const char *, bool) {}
void setLook(const char *, const char *, bool) {}
void addBgImage(const char *, const char *, bool) {}

//#include "bindkey.h"
//#include "default.h"
#define CFGDEF
#define GENPREF
#define extern
Expand Down
Loading

0 comments on commit 779367f

Please sign in to comment.