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.

преди 12 години
преди 12 години
преди 12 години
преди 12 години
преди 13 години
преди 13 години
преди 14 години
преди 13 години
преди 14 години
преди 14 години
преди 13 години
преди 13 години
преди 13 години
преди 14 години
преди 14 години
преди 14 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. const fileinfo_t *file;
  26. Imlib_Image *im;
  27. int w;
  28. int h;
  29. int x;
  30. int y;
  31. } thumb_t;
  32. typedef struct {
  33. thumb_t *thumbs;
  34. int cap;
  35. int cnt;
  36. int first;
  37. int sel;
  38. win_t *win;
  39. int x;
  40. int y;
  41. int cols;
  42. int rows;
  43. bool alpha;
  44. bool dirty;
  45. } tns_t;
  46. void tns_clean_cache(tns_t*);
  47. void tns_init(tns_t*, int, win_t*);
  48. void tns_free(tns_t*);
  49. bool tns_load(tns_t*, int, const fileinfo_t*, bool, bool);
  50. void tns_render(tns_t*);
  51. void tns_highlight(tns_t*, int, bool);
  52. bool tns_move_selection(tns_t*, direction_t, int);
  53. bool tns_scroll(tns_t*, direction_t, bool);
  54. int tns_translate(tns_t*, int, int);
  55. #endif /* THUMBS_H */