A Simple X Image Viewer
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

86 行
2.0 KiB

  1. /* sxiv: window.h
  2. * Copyright (c) 2012 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. #define BAR_SEPARATOR " | "
  23. typedef struct {
  24. Display *dpy;
  25. int scr;
  26. int scrw, scrh;
  27. Visual *vis;
  28. Colormap cmap;
  29. int depth;
  30. } win_env_t;
  31. typedef struct {
  32. Window xwin;
  33. win_env_t env;
  34. unsigned long black;
  35. unsigned long white;
  36. unsigned long bgcol;
  37. unsigned long selcol;
  38. unsigned long barbgcol;
  39. unsigned long barfgcol;
  40. Pixmap pm;
  41. int x;
  42. int y;
  43. unsigned int w;
  44. unsigned int h; /* = win height - bar height */
  45. unsigned int barh;
  46. unsigned int bw;
  47. bool fullscreen;
  48. const char *lbar;
  49. const char *rbar;
  50. } win_t;
  51. extern Atom wm_delete_win;
  52. void win_init(win_t*);
  53. void win_open(win_t*);
  54. void win_close(win_t*);
  55. bool win_configure(win_t*, XConfigureEvent*);
  56. bool win_moveresize(win_t*, int, int, unsigned int, unsigned int);
  57. void win_toggle_fullscreen(win_t*);
  58. void win_toggle_bar(win_t*);
  59. void win_clear(win_t*);
  60. void win_draw(win_t*);
  61. void win_draw_rect(win_t*, Pixmap, int, int, int, int, bool, int,
  62. unsigned long);
  63. int win_textwidth(const char*, unsigned int, bool);
  64. void win_set_title(win_t*, const char*);
  65. void win_set_bar_info(win_t*, const char*, const char*);
  66. void win_set_cursor(win_t*, cursor_t);
  67. #endif /* WINDOW_H */