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.

thumbs.h 1.5 KiB

14 vuotta sitten
14 vuotta sitten
13 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 THUMBS_H
  19. #define THUMBS_H
  20. #include <X11/Xlib.h>
  21. #include <Imlib2.h>
  22. #include "types.h"
  23. #include "window.h"
  24. typedef struct {
  25. Imlib_Image im;
  26. int w;
  27. int h;
  28. int x;
  29. int y;
  30. } thumb_t;
  31. typedef struct {
  32. const fileinfo_t *files;
  33. thumb_t *thumbs;
  34. int cnt;
  35. int loadnext;
  36. int first, end;
  37. int r_first, r_end;
  38. int *sel;
  39. win_t *win;
  40. int x;
  41. int y;
  42. int cols;
  43. int rows;
  44. int zl;
  45. int dim;
  46. bool dirty;
  47. } tns_t;
  48. void tns_clean_cache(tns_t*);
  49. void tns_init(tns_t*, const fileinfo_t*, int, int*, win_t*);
  50. void tns_free(tns_t*);
  51. bool tns_load(tns_t*, int, bool);
  52. void tns_unload(tns_t*, int);
  53. void tns_render(tns_t*);
  54. void tns_mark(tns_t*, int, bool);
  55. void tns_highlight(tns_t*, int, bool);
  56. bool tns_move_selection(tns_t*, direction_t, int);
  57. bool tns_scroll(tns_t*, direction_t, bool);
  58. bool tns_zoom(tns_t*, int);
  59. int tns_translate(tns_t*, int, int);
  60. #endif /* THUMBS_H */