A Simple X Image Viewer
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

window.h 1.9 KiB

14 anos atrás
14 anos atrás
14 anos atrás
14 anos atrás
14 anos atrás
14 anos atrás
13 anos atrás
14 anos atrás
13 anos atrás
13 anos atrás
14 anos atrás
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* sxiv: window.h
  2. * Copyright (c) 2011 Bert Muennich <be.muennich at googlemail.com>
  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 WINDOW_H
  19. #define WINDOW_H
  20. #include <X11/Xlib.h>
  21. #include "types.h"
  22. typedef struct {
  23. Display *dpy;
  24. int scr;
  25. int scrw, scrh;
  26. Visual *vis;
  27. Colormap cmap;
  28. int depth;
  29. } win_env_t;
  30. typedef struct {
  31. Window xwin;
  32. win_env_t env;
  33. unsigned long black;
  34. unsigned long white;
  35. unsigned long bgcol;
  36. unsigned long selcol;
  37. unsigned long barbgcol;
  38. unsigned long barfgcol;
  39. Pixmap pm;
  40. int x;
  41. int y;
  42. unsigned int w;
  43. unsigned int h;
  44. unsigned int barh;
  45. unsigned int bw;
  46. bool fullscreen;
  47. const char *lbar;
  48. const char *rbar;
  49. } win_t;
  50. extern Atom wm_delete_win;
  51. void win_init(win_t*);
  52. void win_open(win_t*);
  53. void win_close(win_t*);
  54. bool win_configure(win_t*, XConfigureEvent*);
  55. bool win_moveresize(win_t*, int, int, unsigned int, unsigned int);
  56. void win_toggle_fullscreen(win_t*);
  57. void win_clear(win_t*);
  58. void win_draw(win_t*);
  59. void win_draw_rect(win_t*, Pixmap, int, int, int, int, bool, int,
  60. unsigned long);
  61. void win_set_title(win_t*, const char*);
  62. void win_set_bar_info(win_t*, const char*, const char*);
  63. void win_set_cursor(win_t*, cursor_t);
  64. #endif /* WINDOW_H */