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.

13 年之前
13 年之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* sxiv: thumbs.h
  2. * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef THUMBS_H
  19. #define THUMBS_H
  20. #include <Imlib2.h>
  21. #include "types.h"
  22. #include "window.h"
  23. typedef struct {
  24. Imlib_Image *im;
  25. const char *filename;
  26. int x;
  27. int y;
  28. int w;
  29. int h;
  30. } thumb_t;
  31. typedef struct {
  32. thumb_t *thumbs;
  33. int cap;
  34. int cnt;
  35. int x;
  36. int y;
  37. int cols;
  38. int rows;
  39. int first;
  40. int sel;
  41. unsigned char dirty;
  42. } tns_t;
  43. void tns_clean_cache(tns_t*);
  44. void tns_init(tns_t*, int);
  45. void tns_free(tns_t*);
  46. int tns_load(tns_t*, int, const char*, unsigned char);
  47. void tns_render(tns_t*, win_t*);
  48. void tns_highlight(tns_t*, win_t*, int, Bool);
  49. int tns_move_selection(tns_t*, win_t*, direction_t);
  50. int tns_scroll(tns_t*, direction_t);
  51. int tns_translate(tns_t*, int, int);
  52. #endif /* THUMBS_H */