A Simple X Image Viewer
 
 
 
 
 
 

37 lines
1.5 KiB

  1. /* default window dimensions (overwritten via -g option): */
  2. enum { WIN_WIDTH = 800, WIN_HEIGHT = 600 };
  3. /* default color for window background: *
  4. * (see X(7) "COLOR NAMES" section for valid values) */
  5. static const char * const BG_COLOR = "#999999";
  6. /* default color for thumbnail selection: */
  7. static const char * const SEL_COLOR = "#0066FF";
  8. /* how should images be scaled when they are loaded?: *
  9. * (also controllable via -d/-s/-Z/-z options) *
  10. * SCALE_DOWN: 100%, but fit large images into window, *
  11. * SCALE_FIT: fit all images into window, *
  12. * SCALE_ZOOM: use current zoom level, 100% at startup */
  13. static const scalemode_t SCALE_MODE = SCALE_DOWN;
  14. /* levels (percent) to use when zooming via '-' and '+': */
  15. static const float zoom_levels[] = {
  16. 12.5, 25.0, 50.0, 75.0,
  17. 100.0, 150.0, 200.0, 400.0, 800.0
  18. };
  19. /* default dimension of thumbnails (width == height): */
  20. enum { THUMB_SIZE = 60 };
  21. /* enable external commands (defined below)? 0=off, 1=on: */
  22. enum { EXT_COMMANDS = 0 };
  23. /* external commands and corresponding key mappings: */
  24. static const command_t commands[] = {
  25. /* ctrl-... reload? command, '#' is replaced by filename */
  26. { ',', 1, "jpegtran -rotate 270 -copy all -outfile # #" },
  27. { '.', 1, "jpegtran -rotate 90 -copy all -outfile # #" },
  28. { '<', 1, "mogrify -rotate -90 #" },
  29. { '>', 1, "mogrify -rotate +90 #" }
  30. };