A Simple X Image Viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

81 lines
2.1 KiB

  1. /* Copyright 2011 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 enum {
  23. CMD_INVALID = -1,
  24. CMD_OK = 0,
  25. CMD_DIRTY = 1
  26. } cmdreturn_t;
  27. typedef void* arg_t;
  28. typedef cmdreturn_t (*command_f)(arg_t);
  29. typedef struct {
  30. unsigned int mask;
  31. KeySym ksym;
  32. command_f cmd;
  33. arg_t arg;
  34. } keymap_t;
  35. typedef struct {
  36. unsigned int mask;
  37. unsigned int button;
  38. command_f cmd;
  39. arg_t arg;
  40. } button_t;
  41. cmdreturn_t it_quit(arg_t);
  42. cmdreturn_t it_switch_mode(arg_t);
  43. cmdreturn_t it_toggle_fullscreen(arg_t);
  44. cmdreturn_t it_toggle_bar(arg_t);
  45. cmdreturn_t t_reload_all(arg_t);
  46. cmdreturn_t it_reload_image(arg_t);
  47. cmdreturn_t it_remove_image(arg_t);
  48. cmdreturn_t i_navigate(arg_t);
  49. cmdreturn_t i_alternate(arg_t);
  50. cmdreturn_t it_first(arg_t);
  51. cmdreturn_t it_n_or_last(arg_t);
  52. cmdreturn_t i_navigate_frame(arg_t);
  53. cmdreturn_t i_toggle_animation(arg_t);
  54. cmdreturn_t it_toggle_image_mark(arg_t);
  55. cmdreturn_t it_reverse_marks(arg_t);
  56. cmdreturn_t it_navigate_marked(arg_t);
  57. cmdreturn_t it_scroll_move(arg_t);
  58. cmdreturn_t it_scroll_screen(arg_t);
  59. cmdreturn_t i_scroll_to_edge(arg_t);
  60. cmdreturn_t i_drag(arg_t);
  61. cmdreturn_t i_zoom(arg_t);
  62. cmdreturn_t i_set_zoom(arg_t);
  63. cmdreturn_t i_fit_to_win(arg_t);
  64. cmdreturn_t i_fit_to_img(arg_t);
  65. cmdreturn_t i_rotate(arg_t);
  66. cmdreturn_t i_flip(arg_t);
  67. cmdreturn_t i_slideshow(arg_t);
  68. cmdreturn_t i_toggle_antialias(arg_t);
  69. cmdreturn_t it_toggle_alpha(arg_t);
  70. cmdreturn_t i_change_gamma(arg_t);
  71. #endif /* COMMANDS_H */