Mirror of Awesome WM window manager
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.

color.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * color.h - color functions header
  3. *
  4. * Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
  5. * Copyright © 2009 Uli Schlachter <psychon@znc.in>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. */
  22. #ifndef AWESOME_COLOR_H
  23. #define AWESOME_COLOR_H
  24. #include <xcb/xcb.h>
  25. #include <stdbool.h>
  26. #include <lua.h>
  27. typedef struct
  28. {
  29. uint32_t pixel;
  30. uint16_t red;
  31. uint16_t green;
  32. uint16_t blue;
  33. uint16_t alpha;
  34. bool initialized;
  35. } color_t;
  36. typedef struct
  37. {
  38. xcb_alloc_color_cookie_t cookie_hexa;
  39. color_t *color;
  40. bool has_error;
  41. const char *colstr;
  42. } color_init_request_t;
  43. color_init_request_t color_init_unchecked(color_t *, const char *, ssize_t, xcb_visualtype_t *visual);
  44. bool color_init_reply(color_init_request_t);
  45. int luaA_pushcolor(lua_State *, const color_t);
  46. #endif
  47. // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80