A Simple X Image Viewer
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
1.2 KiB

  1. /* Copyright 2011, 2014 Bert Muennich
  2. *
  3. * This file is part of sxiv.
  4. *
  5. * sxiv is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published
  7. * by the Free Software Foundation; either version 2 of the License,
  8. * or (at your option) any later version.
  9. *
  10. * sxiv is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with sxiv. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef COMMANDS_H
  19. #define COMMANDS_H
  20. #include <X11/Xlib.h>
  21. #include "types.h"
  22. typedef void* arg_t;
  23. typedef bool (*cmd_f)(arg_t);
  24. #define G_CMD(c) g_##c,
  25. #define I_CMD(c) i_##c,
  26. #define T_CMD(c) t_##c,
  27. typedef enum {
  28. #include "commands.lst"
  29. CMD_COUNT
  30. } cmd_id_t;
  31. typedef struct {
  32. int mode;
  33. cmd_f func;
  34. } cmd_t;
  35. typedef struct {
  36. unsigned int mask;
  37. KeySym ksym;
  38. cmd_id_t cmd;
  39. arg_t arg;
  40. } keymap_t;
  41. typedef struct {
  42. unsigned int mask;
  43. unsigned int button;
  44. cmd_id_t cmd;
  45. arg_t arg;
  46. } button_t;
  47. const extern cmd_t cmds[CMD_COUNT];
  48. #endif /* COMMANDS_H */