A Simple X Image Viewer
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

70 行
1.5 KiB

  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 it
  5. * under the terms of the GNU General Public License as published by the
  6. * Free Software Foundation; either version 2 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  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);
  53. bool tns_scroll(tns_t*, direction_t);
  54. int tns_translate(tns_t*, int, int);
  55. #endif /* THUMBS_H */