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.

property.h 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * property.h - property handlers header
  3. *
  4. * Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. */
  21. #ifndef AWESOME_PROPERTY_H
  22. #define AWESOME_PROPERTY_H
  23. #include "objects/client.h"
  24. #define PROPERTY(funcname) \
  25. xcb_get_property_cookie_t property_get_##funcname(client_t *c); \
  26. void property_update_##funcname(client_t *c, xcb_get_property_cookie_t cookie)
  27. PROPERTY(wm_name);
  28. PROPERTY(net_wm_name);
  29. PROPERTY(wm_icon_name);
  30. PROPERTY(net_wm_icon_name);
  31. PROPERTY(wm_client_machine);
  32. PROPERTY(wm_window_role);
  33. PROPERTY(wm_transient_for);
  34. PROPERTY(wm_client_leader);
  35. PROPERTY(wm_normal_hints);
  36. PROPERTY(wm_hints);
  37. PROPERTY(wm_class);
  38. PROPERTY(wm_protocols);
  39. PROPERTY(net_wm_pid);
  40. PROPERTY(net_wm_icon);
  41. PROPERTY(motif_wm_hints);
  42. #undef PROPERTY
  43. void property_handle_propertynotify(xcb_property_notify_event_t *ev);
  44. int luaA_register_xproperty(lua_State *L);
  45. int luaA_set_xproperty(lua_State *L);
  46. int luaA_get_xproperty(lua_State *L);
  47. struct xproperty {
  48. xcb_atom_t atom;
  49. const char *name;
  50. enum {
  51. /* UTF8_STRING */
  52. PROP_STRING,
  53. /* CARDINAL */
  54. PROP_NUMBER,
  55. /* CARDINAL with values 0 and 1 (or "0 and != 0") */
  56. PROP_BOOLEAN
  57. } type;
  58. };
  59. static inline int
  60. xproperty_cmp(const void *a, const void *b)
  61. {
  62. const xproperty_t *x = a, *y = b;
  63. return x->atom - y->atom;
  64. }
  65. BARRAY_FUNCS(xproperty_t, xproperty, DO_NOTHING, xproperty_cmp)
  66. #endif
  67. // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80