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 година
пре 14 година
пре 12 година
пре 12 година
пре 12 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 14 година
пре 13 година
пре 13 година
пре 14 година
пре 14 година
пре 13 година
пре 13 година
пре 14 година
пре 14 година
пре 14 година
пре 13 година
пре 14 година
пре 14 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 WINDOW_H
  19. #define WINDOW_H
  20. #include <X11/Xlib.h>
  21. #include <X11/Xutil.h>
  22. #include "types.h"
  23. enum {
  24. BAR_L_LEN = 512,
  25. BAR_R_LEN = 64
  26. };
  27. typedef struct {
  28. Display *dpy;
  29. int scr;
  30. int scrw, scrh;
  31. Visual *vis;
  32. Colormap cmap;
  33. int depth;
  34. } win_env_t;
  35. typedef struct {
  36. Window xwin;
  37. win_env_t env;
  38. unsigned long white;
  39. unsigned long bgcol;
  40. unsigned long fscol;
  41. unsigned long selcol;
  42. Pixmap pm;
  43. int x;
  44. int y;
  45. unsigned int w;
  46. unsigned int h; /* = win height - bar height */
  47. unsigned int bw;
  48. XSizeHints sizehints;
  49. bool fullscreen;
  50. struct {
  51. unsigned int h;
  52. char l[BAR_L_LEN];
  53. char r[BAR_R_LEN];
  54. unsigned long bgcol;
  55. unsigned long fgcol;
  56. } bar;
  57. } win_t;
  58. extern Atom wm_delete_win;
  59. void win_init(win_t*);
  60. void win_open(win_t*);
  61. void win_close(win_t*);
  62. bool win_configure(win_t*, XConfigureEvent*);
  63. void win_expose(win_t*, XExposeEvent*);
  64. bool win_moveresize(win_t*, int, int, unsigned int, unsigned int);
  65. void win_toggle_fullscreen(win_t*);
  66. void win_toggle_bar(win_t*);
  67. void win_clear(win_t*);
  68. void win_draw(win_t*);
  69. void win_draw_rect(win_t*, Pixmap, int, int, int, int, bool, int,
  70. unsigned long);
  71. void win_update_bar(win_t*);
  72. int win_textwidth(const char*, unsigned int, bool);
  73. void win_set_title(win_t*, const char*);
  74. void win_set_cursor(win_t*, cursor_t);
  75. #endif /* WINDOW_H */