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.6 KiB

13 vuotta sitten
13 vuotta sitten
13 vuotta sitten
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. fileinfo_t *files;
  33. thumb_t *thumbs;
  34. const int *cnt;
  35. int *sel;
  36. int initnext;
  37. int loadnext;
  38. int first, end;
  39. int r_first, r_end;
  40. win_t *win;
  41. int x;
  42. int y;
  43. int cols;
  44. int rows;
  45. int zl;
  46. int bw;
  47. int dim;
  48. bool dirty;
  49. } tns_t;
  50. void tns_clean_cache(tns_t*);
  51. void tns_init(tns_t*, fileinfo_t*, const int*, int*, win_t*);
  52. CLEANUP void tns_free(tns_t*);
  53. bool tns_load(tns_t*, int, bool, bool);
  54. void tns_unload(tns_t*, int);
  55. void tns_render(tns_t*);
  56. void tns_mark(tns_t*, int, bool);
  57. void tns_highlight(tns_t*, int, bool);
  58. bool tns_move_selection(tns_t*, direction_t, int);
  59. bool tns_scroll(tns_t*, direction_t, bool);
  60. bool tns_zoom(tns_t*, int);
  61. int tns_translate(tns_t*, int, int);
  62. #endif /* THUMBS_H */