2 * wibox.c - wibox functions
4 * Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
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.
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.
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.
22 #include <xcb/shape.h>
32 #include "common/xcursor.h"
33 #include "common/xutil.h"
35 LUA_OBJECT_FUNCS(wibox_class
, wibox_t
, wibox
)
37 /** Take care of garbage collecting a wibox.
38 * \param L The Lua VM state.
39 * \return The number of elements pushed on stack, 0!
42 luaA_wibox_gc(lua_State
*L
)
44 wibox_t
*wibox
= luaA_checkudata(L
, 1, &wibox_class
);
45 p_delete(&wibox
->cursor
);
47 button_array_wipe(&wibox
->buttons
);
48 widget_node_array_wipe(&wibox
->widgets
);
49 return luaA_object_gc(L
);
53 wibox_unref_simplified(wibox_t
**item
)
55 luaA_object_unref(globalconf
.L
, *item
);
59 wibox_need_update(wibox_t
*wibox
)
61 wibox
->need_update
= true;
62 wibox_clear_mouse_over(wibox
);
68 const xcb_query_extension_reply_t
*reply
;
70 reply
= xcb_get_extension_data(globalconf
.connection
, &xcb_shape_id
);
71 if (!reply
|| !reply
->present
)
74 /* We don't need a specific version of SHAPE, no version check required */
79 shape_update(xcb_window_t win
, xcb_shape_kind_t kind
, image_t
*image
, int offset
)
84 shape
= image_to_1bit_pixmap(image
, win
);
89 xcb_shape_mask(globalconf
.connection
, XCB_SHAPE_SO_SET
, kind
,
90 win
, offset
, offset
, shape
);
92 if (shape
!= XCB_NONE
)
93 xcb_free_pixmap(globalconf
.connection
, shape
);
96 /** Update the window's shape.
97 * \param wibox The simple window whose shape should be updated.
100 wibox_shape_update(wibox_t
*wibox
)
102 if(wibox
->window
== XCB_NONE
)
107 static bool warned
= false;
109 warn("The X server doesn't have the SHAPE extension; "
110 "can't change window's shape");
115 shape_update(wibox
->window
, XCB_SHAPE_SK_CLIP
, wibox
->shape
.clip
, 0);
116 shape_update(wibox
->window
, XCB_SHAPE_SK_BOUNDING
, wibox
->shape
.bounding
, - wibox
->border_width
);
118 wibox
->need_shape_update
= false;
122 wibox_draw_context_update(wibox_t
*w
, xcb_screen_t
*s
)
124 xcolor_t fg
= w
->ctx
.fg
, bg
= w
->ctx
.bg
;
125 int phys_screen
= w
->ctx
.phys_screen
;
127 draw_context_wipe(&w
->ctx
);
129 /* update draw context */
130 switch(w
->orientation
)
134 /* we need a new pixmap this way [ ] to render */
135 w
->ctx
.pixmap
= xcb_generate_id(globalconf
.connection
);
136 xcb_create_pixmap(globalconf
.connection
,
138 w
->ctx
.pixmap
, s
->root
,
141 draw_context_init(&w
->ctx
, phys_screen
,
144 w
->ctx
.pixmap
, &fg
, &bg
);
147 draw_context_init(&w
->ctx
, phys_screen
,
150 w
->pixmap
, &fg
, &bg
);
155 /** Initialize a wibox.
156 * \param w The wibox to initialize.
157 * \param phys_screen Physical screen number.
160 wibox_init(wibox_t
*w
, int phys_screen
)
162 xcb_screen_t
*s
= xutil_screen_get(globalconf
.connection
, phys_screen
);
164 w
->window
= xcb_generate_id(globalconf
.connection
);
165 xcb_create_window(globalconf
.connection
, s
->root_depth
, w
->window
, s
->root
,
166 w
->geometry
.x
, w
->geometry
.y
,
167 w
->geometry
.width
, w
->geometry
.height
,
168 w
->border_width
, XCB_COPY_FROM_PARENT
, s
->root_visual
,
169 XCB_CW_BACK_PIXEL
| XCB_CW_BORDER_PIXEL
| XCB_CW_BIT_GRAVITY
170 | XCB_CW_OVERRIDE_REDIRECT
| XCB_CW_EVENT_MASK
,
174 w
->border_color
.pixel
,
175 XCB_GRAVITY_NORTH_WEST
,
177 XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT
178 | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
| XCB_EVENT_MASK_ENTER_WINDOW
179 | XCB_EVENT_MASK_LEAVE_WINDOW
| XCB_EVENT_MASK_STRUCTURE_NOTIFY
180 | XCB_EVENT_MASK_BUTTON_PRESS
| XCB_EVENT_MASK_BUTTON_RELEASE
181 | XCB_EVENT_MASK_POINTER_MOTION
| XCB_EVENT_MASK_EXPOSURE
182 | XCB_EVENT_MASK_PROPERTY_CHANGE
185 /* Create a pixmap. */
186 w
->pixmap
= xcb_generate_id(globalconf
.connection
);
187 xcb_create_pixmap(globalconf
.connection
, s
->root_depth
, w
->pixmap
, s
->root
,
188 w
->geometry
.width
, w
->geometry
.height
);
190 /* Update draw context physical screen, important for Zaphod. */
191 w
->ctx
.phys_screen
= phys_screen
;
192 wibox_draw_context_update(w
, s
);
194 /* The default GC is just a newly created associated to the root window */
195 w
->gc
= xcb_generate_id(globalconf
.connection
);
196 xcb_create_gc(globalconf
.connection
, w
->gc
, s
->root
, XCB_GC_FOREGROUND
| XCB_GC_BACKGROUND
,
197 (const uint32_t[]) { s
->black_pixel
, s
->white_pixel
});
199 wibox_shape_update(w
);
202 /** Refresh the window content by copying its pixmap data to its window.
203 * \param w The wibox to refresh.
206 wibox_refresh_pixmap(wibox_t
*w
)
208 wibox_refresh_pixmap_partial(w
, 0, 0, w
->geometry
.width
, w
->geometry
.height
);
211 /** Move and/or resize a wibox
212 * \param L The Lua VM state.
213 * \param udx The index of the wibox.
214 * \param geometry The new geometry.
217 wibox_moveresize(lua_State
*L
, int udx
, area_t geometry
)
219 wibox_t
*w
= luaA_checkudata(L
, udx
, &wibox_class
);
222 int number_of_vals
= 0;
223 uint32_t moveresize_win_vals
[4], mask_vals
= 0;
225 if(w
->geometry
.x
!= geometry
.x
)
227 w
->geometry
.x
= moveresize_win_vals
[number_of_vals
++] = geometry
.x
;
228 mask_vals
|= XCB_CONFIG_WINDOW_X
;
231 if(w
->geometry
.y
!= geometry
.y
)
233 w
->geometry
.y
= moveresize_win_vals
[number_of_vals
++] = geometry
.y
;
234 mask_vals
|= XCB_CONFIG_WINDOW_Y
;
237 if(geometry
.width
> 0 && w
->geometry
.width
!= geometry
.width
)
239 w
->geometry
.width
= moveresize_win_vals
[number_of_vals
++] = geometry
.width
;
240 mask_vals
|= XCB_CONFIG_WINDOW_WIDTH
;
243 if(geometry
.height
> 0 && w
->geometry
.height
!= geometry
.height
)
245 w
->geometry
.height
= moveresize_win_vals
[number_of_vals
++] = geometry
.height
;
246 mask_vals
|= XCB_CONFIG_WINDOW_HEIGHT
;
249 if(mask_vals
& (XCB_CONFIG_WINDOW_WIDTH
| XCB_CONFIG_WINDOW_HEIGHT
))
251 xcb_free_pixmap(globalconf
.connection
, w
->pixmap
);
252 /* orientation != East */
253 if(w
->pixmap
!= w
->ctx
.pixmap
)
254 xcb_free_pixmap(globalconf
.connection
, w
->ctx
.pixmap
);
255 w
->pixmap
= xcb_generate_id(globalconf
.connection
);
256 xcb_screen_t
*s
= xutil_screen_get(globalconf
.connection
, w
->ctx
.phys_screen
);
257 xcb_create_pixmap(globalconf
.connection
, s
->root_depth
, w
->pixmap
, s
->root
,
258 w
->geometry
.width
, w
->geometry
.height
);
259 wibox_draw_context_update(w
, s
);
263 client_ignore_enterleave_events();
266 xcb_configure_window(globalconf
.connection
, w
->window
, mask_vals
, moveresize_win_vals
);
269 client_restore_enterleave_events();
271 w
->screen
= screen_getbycoord(w
->screen
, w
->geometry
.x
, w
->geometry
.y
);
273 if(mask_vals
& XCB_CONFIG_WINDOW_X
)
274 luaA_object_emit_signal(L
, udx
, "property::x", 0);
275 if(mask_vals
& XCB_CONFIG_WINDOW_Y
)
276 luaA_object_emit_signal(L
, udx
, "property::y", 0);
277 if(mask_vals
& XCB_CONFIG_WINDOW_WIDTH
)
278 luaA_object_emit_signal(L
, udx
, "property::width", 0);
279 if(mask_vals
& XCB_CONFIG_WINDOW_HEIGHT
)
280 luaA_object_emit_signal(L
, udx
, "property::height", 0);
284 #define DO_WIBOX_GEOMETRY_CHECK_AND_EMIT(prop) \
285 if(w->geometry.prop != geometry.prop) \
287 w->geometry.prop = geometry.prop; \
288 luaA_object_emit_signal(L, udx, "property::" #prop, 0); \
290 DO_WIBOX_GEOMETRY_CHECK_AND_EMIT(x
)
291 DO_WIBOX_GEOMETRY_CHECK_AND_EMIT(y
)
292 DO_WIBOX_GEOMETRY_CHECK_AND_EMIT(width
)
293 DO_WIBOX_GEOMETRY_CHECK_AND_EMIT(height
)
294 #undef DO_WIBOX_GEOMETRY_CHECK_AND_EMIT
297 wibox_need_update(w
);
300 /** Refresh the window content by copying its pixmap data to its window.
301 * \param wibox The wibox to refresh.
302 * \param x The copy starting point x component.
303 * \param y The copy starting point y component.
304 * \param w The copy width from the x component.
305 * \param h The copy height from the y component.
308 wibox_refresh_pixmap_partial(wibox_t
*wibox
,
309 int16_t x
, int16_t y
,
310 uint16_t w
, uint16_t h
)
312 xcb_copy_area(globalconf
.connection
, wibox
->pixmap
,
313 wibox
->window
, wibox
->gc
, x
, y
, x
, y
,
318 wibox_set_opacity(lua_State
*L
, int udx
, double opacity
)
320 wibox_t
*w
= luaA_checkudata(L
, udx
, &wibox_class
);
321 if(w
->opacity
!= opacity
)
323 w
->opacity
= opacity
;
325 window_opacity_set(w
->window
, opacity
);
326 luaA_object_emit_signal(L
, udx
, "property::opacity", 0);
330 /** Set a wibox border color.
331 * \param L The Lua VM state.
332 * \param udx The wibox to change border width.
333 * \param color The border color.
336 wibox_set_border_color(lua_State
*L
, int udx
, const xcolor_t
*color
)
338 wibox_t
*w
= luaA_checkudata(L
, udx
, &wibox_class
);
339 if (w
->window
!= XCB_NONE
)
340 xcb_change_window_attributes(globalconf
.connection
, w
->window
,
341 XCB_CW_BORDER_PIXEL
, &color
->pixel
);
342 w
->border_color
= *color
;
343 luaA_object_emit_signal(L
, udx
, "property::border_color", 0);
346 /** Set wibox orientation.
347 * \param L The Lua VM state.
348 * \param udx The wibox to change orientation.
349 * \param o The new orientation.
352 wibox_set_orientation(lua_State
*L
, int udx
, orientation_t o
)
354 wibox_t
*w
= luaA_checkudata(L
, udx
, &wibox_class
);
355 if(o
!= w
->orientation
)
357 xcb_screen_t
*s
= xutil_screen_get(globalconf
.connection
, w
->ctx
.phys_screen
);
359 /* orientation != East */
360 if(w
->pixmap
!= w
->ctx
.pixmap
)
361 xcb_free_pixmap(globalconf
.connection
, w
->ctx
.pixmap
);
362 wibox_draw_context_update(w
, s
);
363 luaA_object_emit_signal(L
, udx
, "property::orientation", 0);
368 wibox_map(wibox_t
*wibox
)
371 client_ignore_enterleave_events();
373 xcb_map_window(globalconf
.connection
, wibox
->window
);
375 client_restore_enterleave_events();
376 /* We must make sure the wibox does not display garbage */
377 wibox_need_update(wibox
);
378 /* Stack this wibox correctly */
382 /** Kick out systray windows.
383 * \param phys_screen Physical screen number.
386 wibox_systray_kickout(int phys_screen
)
388 xcb_screen_t
*s
= xutil_screen_get(globalconf
.connection
, phys_screen
);
390 if(globalconf
.screens
.tab
[phys_screen
].systray
.parent
!= s
->root
)
392 /* Who! Check that we're not deleting a wibox with a systray, because it
393 * may be its parent. If so, we reparent to root before, otherwise it will
395 xcb_reparent_window(globalconf
.connection
,
396 globalconf
.screens
.tab
[phys_screen
].systray
.window
,
397 s
->root
, -512, -512);
399 globalconf
.screens
.tab
[phys_screen
].systray
.parent
= s
->root
;
404 wibox_systray_refresh(wibox_t
*wibox
)
409 for(int i
= 0; i
< wibox
->widgets
.len
; i
++)
411 widget_node_t
*systray
= &wibox
->widgets
.tab
[i
];
412 if(systray
->widget
->type
== widget_systray
)
414 uint32_t config_back
[] = { wibox
->ctx
.bg
.pixel
};
415 uint32_t config_win_vals
[4];
416 uint32_t config_win_vals_off
[2] = { -512, -512 };
418 int phys_screen
= wibox
->ctx
.phys_screen
;
421 && systray
->widget
->isvisible
422 && systray
->geometry
.width
)
424 /* Set background of the systray window. */
425 xcb_change_window_attributes(globalconf
.connection
,
426 globalconf
.screens
.tab
[phys_screen
].systray
.window
,
427 XCB_CW_BACK_PIXEL
, config_back
);
429 xcb_map_window(globalconf
.connection
, globalconf
.screens
.tab
[phys_screen
].systray
.window
);
431 switch(wibox
->orientation
)
434 config_win_vals
[0] = systray
->geometry
.y
;
435 config_win_vals
[1] = wibox
->geometry
.height
- systray
->geometry
.x
- systray
->geometry
.width
;
436 config_win_vals
[2] = systray
->geometry
.height
;
437 config_win_vals
[3] = systray
->geometry
.width
;
440 config_win_vals
[0] = systray
->geometry
.y
;
441 config_win_vals
[1] = systray
->geometry
.x
;
442 config_win_vals
[2] = systray
->geometry
.height
;
443 config_win_vals
[3] = systray
->geometry
.width
;
446 config_win_vals
[0] = systray
->geometry
.x
;
447 config_win_vals
[1] = systray
->geometry
.y
;
448 config_win_vals
[2] = systray
->geometry
.width
;
449 config_win_vals
[3] = systray
->geometry
.height
;
453 if(globalconf
.screens
.tab
[phys_screen
].systray
.parent
!= wibox
->window
)
455 xcb_reparent_window(globalconf
.connection
,
456 globalconf
.screens
.tab
[phys_screen
].systray
.window
,
458 config_win_vals
[0], config_win_vals
[1]);
459 globalconf
.screens
.tab
[phys_screen
].systray
.parent
= wibox
->window
;
461 xcb_configure_window(globalconf
.connection
,
462 globalconf
.screens
.tab
[phys_screen
].systray
.window
,
464 | XCB_CONFIG_WINDOW_Y
465 | XCB_CONFIG_WINDOW_WIDTH
466 | XCB_CONFIG_WINDOW_HEIGHT
,
468 /* width = height = systray height */
469 config_win_vals
[2] = config_win_vals
[3] = systray
->geometry
.height
;
470 config_win_vals
[0] = 0;
473 return wibox_systray_kickout(phys_screen
);
475 switch(wibox
->orientation
)
478 config_win_vals
[1] = systray
->geometry
.width
- config_win_vals
[3];
479 for(int j
= 0; j
< globalconf
.embedded
.len
; j
++)
481 em
= &globalconf
.embedded
.tab
[j
];
482 if(em
->phys_screen
== phys_screen
)
484 if(config_win_vals
[1] - config_win_vals
[2] >= (uint32_t) wibox
->geometry
.y
)
486 xcb_map_window(globalconf
.connection
, em
->win
);
487 xcb_configure_window(globalconf
.connection
, em
->win
,
489 | XCB_CONFIG_WINDOW_Y
490 | XCB_CONFIG_WINDOW_WIDTH
491 | XCB_CONFIG_WINDOW_HEIGHT
,
493 config_win_vals
[1] -= config_win_vals
[3];
496 xcb_configure_window(globalconf
.connection
, em
->win
,
498 | XCB_CONFIG_WINDOW_Y
,
499 config_win_vals_off
);
504 config_win_vals
[1] = 0;
505 for(int j
= 0; j
< globalconf
.embedded
.len
; j
++)
507 em
= &globalconf
.embedded
.tab
[j
];
508 if(em
->phys_screen
== phys_screen
)
510 /* if(y + width <= wibox.y + systray.right) */
511 if(config_win_vals
[1] + config_win_vals
[3] <= (uint32_t) wibox
->geometry
.y
+ AREA_RIGHT(systray
->geometry
))
513 xcb_map_window(globalconf
.connection
, em
->win
);
514 xcb_configure_window(globalconf
.connection
, em
->win
,
516 | XCB_CONFIG_WINDOW_Y
517 | XCB_CONFIG_WINDOW_WIDTH
518 | XCB_CONFIG_WINDOW_HEIGHT
,
520 config_win_vals
[1] += config_win_vals
[3];
523 xcb_configure_window(globalconf
.connection
, em
->win
,
525 | XCB_CONFIG_WINDOW_Y
,
526 config_win_vals_off
);
531 config_win_vals
[1] = 0;
532 for(int j
= 0; j
< globalconf
.embedded
.len
; j
++)
534 em
= &globalconf
.embedded
.tab
[j
];
535 if(em
->phys_screen
== phys_screen
)
537 /* if(x + width < systray.x + systray.width) */
538 if(config_win_vals
[0] + config_win_vals
[2] <= (uint32_t) AREA_RIGHT(systray
->geometry
) + wibox
->geometry
.x
)
540 xcb_map_window(globalconf
.connection
, em
->win
);
541 xcb_configure_window(globalconf
.connection
, em
->win
,
543 | XCB_CONFIG_WINDOW_Y
544 | XCB_CONFIG_WINDOW_WIDTH
545 | XCB_CONFIG_WINDOW_HEIGHT
,
547 config_win_vals
[0] += config_win_vals
[2];
550 xcb_configure_window(globalconf
.connection
, em
->win
,
552 | XCB_CONFIG_WINDOW_Y
,
553 config_win_vals_off
);
563 /** Get a wibox by its window.
564 * \param win The window id.
565 * \return A wibox if found, NULL otherwise.
568 wibox_getbywin(xcb_window_t win
)
570 foreach(w
, globalconf
.wiboxes
)
571 if((*w
)->window
== win
)
574 foreach(_c
, globalconf
.clients
)
577 if(c
->titlebar
&& c
->titlebar
->window
== win
)
585 * \param wibox The wibox to draw.
588 wibox_draw(wibox_t
*wibox
)
592 widget_render(wibox
);
593 wibox_refresh_pixmap(wibox
);
595 wibox
->need_update
= false;
598 wibox_systray_refresh(wibox
);
601 /** Refresh all wiboxes.
606 foreach(w
, globalconf
.wiboxes
)
608 if((*w
)->need_shape_update
)
609 wibox_shape_update(*w
);
610 if((*w
)->need_update
)
614 foreach(_c
, globalconf
.clients
)
617 if(c
->titlebar
&& c
->titlebar
->need_update
)
618 wibox_draw(c
->titlebar
);
622 /** Clear the wibox' mouse_over pointer.
623 * \param wibox The wibox.
626 wibox_clear_mouse_over(wibox_t
*wibox
)
628 if (wibox
->mouse_over
)
630 luaA_object_unref(globalconf
.L
, wibox
->mouse_over
);
631 wibox
->mouse_over
= NULL
;
635 /** Set a wibox visible or not.
636 * \param L The Lua VM state.
637 * \param udx The wibox.
638 * \param v The visible value.
641 wibox_set_visible(lua_State
*L
, int udx
, bool v
)
643 wibox_t
*wibox
= luaA_checkudata(L
, udx
, &wibox_class
);
644 if(v
!= wibox
->visible
)
647 wibox_clear_mouse_over(wibox
);
656 client_ignore_enterleave_events();
658 xcb_unmap_window(globalconf
.connection
, wibox
->window
);
660 client_restore_enterleave_events();
663 /* kick out systray if needed */
664 wibox_systray_refresh(wibox
);
667 luaA_object_emit_signal(L
, udx
, "property::visible", 0);
669 hook_property(wibox
, "visible");
673 /** Destroy all X resources of a wibox.
674 * \param w The wibox to wipe.
677 wibox_wipe(wibox_t
*w
)
682 client_ignore_enterleave_events();
683 xcb_destroy_window(globalconf
.connection
, w
->window
);
685 client_restore_enterleave_events();
686 w
->window
= XCB_NONE
;
690 xcb_free_pixmap(globalconf
.connection
, w
->pixmap
);
691 w
->pixmap
= XCB_NONE
;
695 xcb_free_gc(globalconf
.connection
, w
->gc
);
698 draw_context_wipe(&w
->ctx
);
701 /** Remove a wibox from a screen.
702 * \param L The Lua VM state.
703 * \param udx Wibox to detach from screen.
706 wibox_detach(lua_State
*L
, int udx
)
708 wibox_t
*wibox
= luaA_checkudata(L
, udx
, &wibox_class
);
713 /* save visible state */
715 wibox
->visible
= false;
716 wibox_systray_refresh(wibox
);
717 /* restore visibility */
720 wibox_clear_mouse_over(wibox
);
724 foreach(item
, globalconf
.wiboxes
)
727 wibox_array_remove(&globalconf
.wiboxes
, item
);
731 hook_property(wibox
, "screen");
733 if(strut_has_value(&wibox
->strut
))
734 screen_emit_signal(L
, wibox
->screen
, "property::workarea", 0);
736 wibox
->screen
= NULL
;
737 luaA_object_emit_signal(L
, udx
, "property::screen", 0);
739 luaA_object_unref(globalconf
.L
, wibox
);
743 /** Attach a wibox that is on top of the stack.
744 * \param L The Lua VM state.
745 * \param udx The wibox to attach.
746 * \param s The screen to attach the wibox to.
749 wibox_attach(lua_State
*L
, int udx
, screen_t
*s
)
751 int phys_screen
= screen_virttophys(screen_array_indexof(&globalconf
.screens
, s
));
753 /* duplicate wibox */
754 lua_pushvalue(L
, udx
);
756 wibox_t
*wibox
= luaA_object_ref_class(globalconf
.L
, -1, &wibox_class
);
758 wibox_detach(L
, udx
);
760 /* Set the wibox screen */
763 /* Check that the wibox coordinates matches the screen. */
765 screen_getbycoord(wibox
->screen
, wibox
->geometry
.x
, wibox
->geometry
.y
);
767 /* If it does not match, move it to the screen coordinates */
768 if(cscreen
!= wibox
->screen
)
769 wibox_moveresize(L
, udx
, (area_t
) { .x
= s
->geometry
.x
,
771 .width
= wibox
->geometry
.width
,
772 .height
= wibox
->geometry
.height
});
774 wibox_array_append(&globalconf
.wiboxes
, wibox
);
776 wibox_init(wibox
, phys_screen
);
778 window_set_cursor(wibox
->window
,
779 xcursor_new(globalconf
.connection
, xcursor_font_fromstr(wibox
->cursor
)));
781 if(wibox
->opacity
!= -1)
782 window_opacity_set(wibox
->window
, wibox
->opacity
);
784 ewmh_update_strut(wibox
->window
, &wibox
->strut
);
789 wibox_need_update(wibox
);
791 hook_property(wibox
, "screen");
792 luaA_object_emit_signal(L
, udx
, "property::screen", 0);
794 if(strut_has_value(&wibox
->strut
))
795 screen_emit_signal(L
, wibox
->screen
, "property::workarea", 0);
798 /** Create a new wibox.
799 * \param L The Lua VM state.
802 * \lparam A table with optionally defined values:
803 * fg, bg, border_width, border_color, ontop, width and height.
804 * \lreturn A brand new wibox.
807 luaA_wibox_new(lua_State
*L
)
809 luaA_class_new(L
, &wibox_class
);
811 wibox_t
*w
= luaA_checkudata(L
, -1, &wibox_class
);
813 if(!w
->ctx
.fg
.initialized
)
814 w
->ctx
.fg
= globalconf
.colors
.fg
;
816 if(!w
->ctx
.bg
.initialized
)
817 w
->ctx
.bg
= globalconf
.colors
.bg
;
819 if(!w
->border_color
.initialized
)
820 w
->border_color
= globalconf
.colors
.bg
;
828 w
->cursor
= a_strdup("left_ptr");
830 if(!w
->geometry
.width
)
831 w
->geometry
.width
= 1;
833 if(!w
->geometry
.height
)
834 w
->geometry
.height
= 1;
839 /** Check if a wibox widget table has an item.
840 * \param L The Lua VM state.
841 * \param wibox The wibox.
842 * \param item The item to look for.
845 luaA_wibox_hasitem(lua_State
*L
, wibox_t
*wibox
, const void *item
)
847 if(wibox
->widgets_table
)
849 luaA_object_push(L
, wibox
);
850 luaA_object_push_item(L
, -1, wibox
->widgets_table
);
852 if(lua_topointer(L
, -1) == item
|| luaA_hasitem(L
, item
))
858 /** Invalidate a wibox by a Lua object (table, etc).
859 * \param L The Lua VM state.
860 * \param item The object identifier.
863 luaA_wibox_invalidate_byitem(lua_State
*L
, const void *item
)
865 foreach(w
, globalconf
.wiboxes
)
868 if(luaA_wibox_hasitem(L
, wibox
, item
))
871 wibox_need_update(wibox
);
872 lua_pop(L
, 1); /* remove widgets table */
877 foreach(_c
, globalconf
.clients
)
880 if(c
->titlebar
&& luaA_wibox_hasitem(L
, c
->titlebar
, item
))
883 wibox_need_update(c
->titlebar
);
884 lua_pop(L
, 1); /* remove widgets table */
889 /* Set or get the wibox geometry.
890 * \param L The Lua VM state.
891 * \return The number of elements pushed on stack.
893 * \lparam An optional table with wibox geometry.
894 * \lreturn The wibox geometry.
897 luaA_wibox_geometry(lua_State
*L
)
899 wibox_t
*wibox
= luaA_checkudata(L
, 1, &wibox_class
);
901 if(lua_gettop(L
) == 2)
905 luaA_checktable(L
, 2);
906 wingeom
.x
= luaA_getopt_number(L
, 2, "x", wibox
->geometry
.x
);
907 wingeom
.y
= luaA_getopt_number(L
, 2, "y", wibox
->geometry
.y
);
908 wingeom
.width
= luaA_getopt_number(L
, 2, "width", wibox
->geometry
.width
);
909 wingeom
.height
= luaA_getopt_number(L
, 2, "height", wibox
->geometry
.height
);
911 if(wingeom
.width
> 0 && wingeom
.height
> 0)
914 case WIBOX_TYPE_TITLEBAR
:
915 wibox_moveresize(L
, 1, (area_t
) { .x
= wibox
->geometry
.x
,
916 .y
= wibox
->geometry
.y
,
917 .width
= wingeom
.width
,
918 .height
= wingeom
.height
});
920 case WIBOX_TYPE_NORMAL
:
921 wibox_moveresize(L
, 1, wingeom
);
926 return luaA_pusharea(L
, wibox
->geometry
);
930 luaA_wibox_struts(lua_State
*L
)
932 wibox_t
*w
= luaA_checkudata(L
, 1, &wibox_class
);
934 if(lua_gettop(L
) == 2)
936 luaA_tostrut(L
, 2, &w
->strut
);
938 ewmh_update_strut(w
->window
, &w
->strut
);
939 luaA_object_emit_signal(L
, 1, "property::struts", 0);
941 screen_emit_signal(L
, w
->screen
, "property::workarea", 0);
944 return luaA_pushstrut(L
, w
->strut
);
947 LUA_OBJECT_EXPORT_PROPERTY(wibox
, wibox_t
, ontop
, lua_pushboolean
)
948 LUA_OBJECT_EXPORT_PROPERTY(wibox
, wibox_t
, cursor
, lua_pushstring
)
949 LUA_OBJECT_EXPORT_PROPERTY(wibox
, wibox_t
, visible
, lua_pushboolean
)
950 LUA_OBJECT_EXPORT_PROPERTY(wibox
, wibox_t
, border_width
, lua_pushnumber
)
951 LUA_OBJECT_EXPORT_PROPERTY(wibox
, wibox_t
, border_color
, luaA_pushxcolor
)
954 luaA_wibox_set_x(lua_State
*L
, wibox_t
*wibox
)
956 wibox_moveresize(L
, -3, (area_t
) { .x
= luaL_checknumber(L
, -1),
957 .y
= wibox
->geometry
.y
,
958 .width
= wibox
->geometry
.width
,
959 .height
= wibox
->geometry
.height
});
964 luaA_wibox_get_x(lua_State
*L
, wibox_t
*wibox
)
966 lua_pushnumber(L
, wibox
->geometry
.x
);
971 luaA_wibox_set_y(lua_State
*L
, wibox_t
*wibox
)
973 wibox_moveresize(L
, -3, (area_t
) { .x
= wibox
->geometry
.x
,
974 .y
= luaL_checknumber(L
, -1),
975 .width
= wibox
->geometry
.width
,
976 .height
= wibox
->geometry
.height
});
981 luaA_wibox_get_y(lua_State
*L
, wibox_t
*wibox
)
983 lua_pushnumber(L
, wibox
->geometry
.y
);
988 luaA_wibox_set_width(lua_State
*L
, wibox_t
*wibox
)
990 int width
= luaL_checknumber(L
, -1);
992 luaL_error(L
, "invalid width");
993 wibox_moveresize(L
, -3, (area_t
) { .x
= wibox
->geometry
.x
,
994 .y
= wibox
->geometry
.y
,
996 .height
= wibox
->geometry
.height
});
1001 luaA_wibox_get_width(lua_State
*L
, wibox_t
*wibox
)
1003 lua_pushnumber(L
, wibox
->geometry
.width
);
1008 luaA_wibox_set_height(lua_State
*L
, wibox_t
*wibox
)
1010 int height
= luaL_checknumber(L
, -1);
1012 luaL_error(L
, "invalid height");
1013 wibox_moveresize(L
, -3, (area_t
) { .x
= wibox
->geometry
.x
,
1014 .y
= wibox
->geometry
.y
,
1015 .width
= wibox
->geometry
.width
,
1016 .height
= height
});
1021 luaA_wibox_get_height(lua_State
*L
, wibox_t
*wibox
)
1023 lua_pushnumber(L
, wibox
->geometry
.height
);
1027 /** Set the wibox foreground color.
1028 * \param L The Lua VM state.
1029 * \param wibox The wibox object.
1030 * \return The number of elements pushed on stack.
1033 luaA_wibox_set_fg(lua_State
*L
, wibox_t
*wibox
)
1036 const char *buf
= luaL_checklstring(L
, -1, &len
);
1037 if(xcolor_init_reply(xcolor_init_unchecked(&wibox
->ctx
.fg
, buf
, len
)))
1038 wibox
->need_update
= true;
1039 luaA_object_emit_signal(L
, -3, "property::fg", 0);
1043 /** Get the wibox foreground color.
1044 * \param L The Lua VM state.
1045 * \param wibox The wibox object.
1046 * \return The number of elements pushed on stack.
1049 luaA_wibox_get_fg(lua_State
*L
, wibox_t
*wibox
)
1051 return luaA_pushxcolor(L
, wibox
->ctx
.fg
);
1054 /** Set the wibox background color.
1055 * \param L The Lua VM state.
1056 * \param wibox The wibox object.
1057 * \return The number of elements pushed on stack.
1060 luaA_wibox_set_bg(lua_State
*L
, wibox_t
*wibox
)
1063 const char *buf
= luaL_checklstring(L
, -1, &len
);
1064 if(xcolor_init_reply(xcolor_init_unchecked(&wibox
->ctx
.bg
, buf
, len
)))
1066 uint32_t mask
= XCB_CW_BACK_PIXEL
;
1067 uint32_t values
[] = { wibox
->ctx
.bg
.pixel
};
1069 wibox
->need_update
= true;
1071 if (wibox
->window
!= XCB_NONE
)
1072 xcb_change_window_attributes(globalconf
.connection
,
1077 luaA_object_emit_signal(L
, -3, "property::bg", 0);
1081 /** Get the wibox background color.
1082 * \param L The Lua VM state.
1083 * \param wibox The wibox object.
1084 * \return The number of elements pushed on stack.
1087 luaA_wibox_get_bg(lua_State
*L
, wibox_t
*wibox
)
1089 return luaA_pushxcolor(L
, wibox
->ctx
.bg
);
1092 /** Set the wibox background image.
1093 * \param L The Lua VM state.
1094 * \param wibox The wibox object.
1095 * \return The number of elements pushed on stack.
1098 luaA_wibox_set_bg_image(lua_State
*L
, wibox_t
*wibox
)
1100 luaA_checkudata(L
, -1, &image_class
);
1101 luaA_object_unref_item(L
, -3, wibox
->bg_image
);
1102 wibox
->bg_image
= luaA_object_ref_item(L
, -3, -1);
1103 wibox
->need_update
= true;
1104 luaA_object_emit_signal(L
, -2, "property::bg_image", 0);
1108 /** Get the wibox background image.
1109 * \param L The Lua VM state.
1110 * \param wibox The wibox object.
1111 * \return The number of elements pushed on stack.
1114 luaA_wibox_get_bg_image(lua_State
*L
, wibox_t
*wibox
)
1116 return luaA_object_push_item(L
, 1, wibox
->bg_image
);
1119 /** Set the wibox on top status.
1120 * \param L The Lua VM state.
1121 * \param wibox The wibox object.
1122 * \return The number of elements pushed on stack.
1125 luaA_wibox_set_ontop(lua_State
*L
, wibox_t
*wibox
)
1127 bool b
= luaA_checkboolean(L
, -1);
1128 if(b
!= wibox
->ontop
)
1132 luaA_object_emit_signal(L
, -3, "property::ontop", 0);
1137 /** Set the wibox opacity.
1138 * \param L The Lua VM state.
1139 * \param wibox The wibox object.
1140 * \return The number of elements pushed on stack.
1143 luaA_wibox_set_opacity(lua_State
*L
, wibox_t
*wibox
)
1145 if(lua_isnil(L
, -1))
1146 wibox_set_opacity(L
, -3, -1);
1149 double d
= luaL_checknumber(L
, -1);
1150 if(d
>= 0 && d
<= 1)
1151 wibox_set_opacity(L
, -3, d
);
1156 /** Get the wibox opacity.
1157 * \param L The Lua VM state.
1158 * \param wibox The wibox object.
1159 * \return The number of elements pushed on stack.
1162 luaA_wibox_get_opacity(lua_State
*L
, wibox_t
*wibox
)
1164 if (wibox
->opacity
>= 0)
1166 lua_pushnumber(L
, wibox
->opacity
);
1172 /** Set the wibox alignment.
1173 * \param L The Lua VM state.
1174 * \param wibox The wibox object.
1175 * \return The number of elements pushed on stack.
1178 luaA_wibox_set_align(lua_State
*L
, wibox_t
*wibox
)
1181 const char *buf
= luaL_checklstring(L
, -1, &len
);
1182 wibox
->align
= draw_align_fromstr(buf
, len
);
1183 luaA_object_emit_signal(L
, -3, "property::align", 0);
1186 case WIBOX_TYPE_NORMAL
:
1187 luaA_deprecate(L
, "awful.wibox.align");
1189 case WIBOX_TYPE_TITLEBAR
:
1190 titlebar_update_geometry(client_getbytitlebar(wibox
));
1196 /** Get the wibox alignment.
1197 * \param L The Lua VM state.
1198 * \param wibox The wibox object.
1199 * \return The number of elements pushed on stack.
1202 luaA_wibox_get_align(lua_State
*L
, wibox_t
*wibox
)
1204 if(wibox
->type
== WIBOX_TYPE_NORMAL
)
1205 luaA_deprecate(L
, "awful.wibox.align");
1206 lua_pushstring(L
, draw_align_tostr(wibox
->align
));
1210 /** Set the wibox position.
1211 * \param L The Lua VM state.
1212 * \param wibox The wibox object.
1213 * \return The number of elements pushed on stack.
1216 luaA_wibox_set_position(lua_State
*L
, wibox_t
*wibox
)
1220 case WIBOX_TYPE_NORMAL
:
1224 if((buf
= luaL_checklstring(L
, -1, &len
)))
1226 luaA_deprecate(L
, "awful.wibox.attach");
1227 wibox
->position
= position_fromstr(buf
, len
);
1231 case WIBOX_TYPE_TITLEBAR
:
1232 return luaA_titlebar_set_position(L
, -3);
1237 /** Get the wibox position.
1238 * \param L The Lua VM state.
1239 * \param wibox The wibox object.
1240 * \return The number of elements pushed on stack.
1243 luaA_wibox_get_position(lua_State
*L
, wibox_t
*wibox
)
1245 if(wibox
->type
== WIBOX_TYPE_NORMAL
)
1246 luaA_deprecate(L
, "awful.wibox.attach");
1247 lua_pushstring(L
, position_tostr(wibox
->position
));
1251 /** Set the wibox (titlebar) client.
1252 * \param L The Lua VM state.
1253 * \param wibox The wibox object.
1254 * \return The number of elements pushed on stack.
1257 luaA_wibox_set_client(lua_State
*L
, wibox_t
*wibox
)
1260 if(lua_isnil(L
, -1))
1261 titlebar_client_detach(client_getbytitlebar(wibox
));
1264 client_t
*c
= luaA_client_checkudata(L
, -1);
1265 lua_pushvalue(L
, -3);
1266 titlebar_client_attach(c
);
1271 /** Get the wibox (titlebar) client.
1272 * \param L The Lua VM state.
1273 * \param wibox The wibox object.
1274 * \return The number of elements pushed on stack.
1277 luaA_wibox_get_client(lua_State
*L
, wibox_t
*wibox
)
1279 return luaA_object_push(L
, client_getbytitlebar(wibox
));
1282 /** Set the wibox cursor.
1283 * \param L The Lua VM state.
1284 * \param wibox The wibox object.
1285 * \return The number of elements pushed on stack.
1288 luaA_wibox_set_cursor(lua_State
*L
, wibox_t
*wibox
)
1290 const char *buf
= luaL_checkstring(L
, -1);
1293 uint16_t cursor_font
= xcursor_font_fromstr(buf
);
1296 xcb_cursor_t cursor
= xcursor_new(globalconf
.connection
, cursor_font
);
1297 p_delete(&wibox
->cursor
);
1298 wibox
->cursor
= a_strdup(buf
);
1299 window_set_cursor(wibox
->window
, cursor
);
1300 luaA_object_emit_signal(L
, -3, "property::cursor", 0);
1306 /** Set the wibox screen.
1307 * \param L The Lua VM state.
1308 * \param wibox The wibox object.
1309 * \return The number of elements pushed on stack.
1312 luaA_wibox_set_screen(lua_State
*L
, wibox_t
*wibox
)
1314 if(lua_isnil(L
, -1))
1316 wibox_detach(L
, -3);
1317 titlebar_client_detach(client_getbytitlebar(wibox
));
1321 int screen
= luaL_checknumber(L
, -1) - 1;
1322 luaA_checkscreen(screen
);
1323 if(!wibox
->screen
|| screen
!= screen_array_indexof(&globalconf
.screens
, wibox
->screen
))
1325 titlebar_client_detach(client_getbytitlebar(wibox
));
1326 wibox_attach(L
, -3, &globalconf
.screens
.tab
[screen
]);
1332 /** Get the wibox screen.
1333 * \param L The Lua VM state.
1334 * \param wibox The wibox object.
1335 * \return The number of elements pushed on stack.
1338 luaA_wibox_get_screen(lua_State
*L
, wibox_t
*wibox
)
1342 lua_pushnumber(L
, screen_array_indexof(&globalconf
.screens
, wibox
->screen
) + 1);
1346 /** Set the wibox orientation.
1347 * \param L The Lua VM state.
1348 * \param wibox The wibox object.
1349 * \return The number of elements pushed on stack.
1352 luaA_wibox_set_orientation(lua_State
*L
, wibox_t
*wibox
)
1355 const char *buf
= luaL_checklstring(L
, -1, &len
);
1358 wibox_set_orientation(L
, -3, orientation_fromstr(buf
, len
));
1359 wibox_need_update(wibox
);
1364 /** Get the wibox orientation.
1365 * \param L The Lua VM state.
1366 * \param wibox The wibox object.
1367 * \return The number of elements pushed on stack.
1370 luaA_wibox_get_orientation(lua_State
*L
, wibox_t
*wibox
)
1372 lua_pushstring(L
, orientation_tostr(wibox
->orientation
));
1376 /** Set the wibox border color.
1377 * \param L The Lua VM state.
1378 * \param wibox The wibox object.
1379 * \return The number of elements pushed on stack.
1382 luaA_wibox_set_border_color(lua_State
*L
, wibox_t
*wibox
)
1385 const char *buf
= luaL_checklstring(L
, -1, &len
);
1387 if(xcolor_init_reply(xcolor_init_unchecked(&wibox
->border_color
, buf
, len
)))
1389 wibox_set_border_color(L
, -3, &wibox
->border_color
);
1393 /** Set the wibox visibility.
1394 * \param L The Lua VM state.
1395 * \param wibox The wibox object.
1396 * \return The number of elements pushed on stack.
1399 luaA_wibox_set_visible(lua_State
*L
, wibox_t
*wibox
)
1401 bool b
= luaA_checkboolean(L
, -1);
1402 if(b
!= wibox
->visible
)
1405 case WIBOX_TYPE_NORMAL
:
1406 wibox_set_visible(L
, -3, b
);
1408 case WIBOX_TYPE_TITLEBAR
:
1409 titlebar_set_visible(wibox
, b
);
1415 /** Set the wibox widgets.
1416 * \param L The Lua VM state.
1417 * \param wibox The wibox object.
1418 * \return The number of elements pushed on stack.
1421 luaA_wibox_set_widgets(lua_State
*L
, wibox_t
*wibox
)
1423 if(luaA_isloop(L
, -1))
1425 luaA_warn(L
, "table is looping, cannot use this as widget table");
1428 /* duplicate table because next function will eat it */
1429 lua_pushvalue(L
, -1);
1430 wibox
->widgets_table
= luaA_object_ref_item(L
, -4, -1);
1431 luaA_object_emit_signal(L
, -3, "property::widgets", 0);
1432 wibox_need_update(wibox
);
1433 luaA_table2wtable(L
);
1437 /** Get the wibox widgets.
1438 * \param L The Lua VM state.
1439 * \param wibox The wibox object.
1440 * \return The number of elements pushed on stack.
1443 luaA_wibox_get_widgets(lua_State
*L
, wibox_t
*wibox
)
1445 return luaA_object_push_item(L
, 1, wibox
->widgets_table
);
1448 /** Get or set mouse buttons bindings to a wibox.
1449 * \param L The Lua VM state.
1452 * \lparam An array of mouse button bindings objects, or nothing.
1453 * \return The array of mouse button bindings objects of this wibox.
1456 luaA_wibox_buttons(lua_State
*L
)
1458 wibox_t
*wibox
= luaA_checkudata(L
, 1, &wibox_class
);
1460 if(lua_gettop(L
) == 2)
1462 luaA_button_array_set(L
, 1, 2, &wibox
->buttons
);
1463 luaA_object_emit_signal(L
, 1, "property::buttons", 0);
1466 return luaA_button_array_get(L
, 1, &wibox
->buttons
);
1469 /** Set the wibox border width.
1470 * \param L The Lua VM state.
1471 * \param wibox The wibox object.
1472 * \return The number of elements pushed on stack.
1475 luaA_wibox_set_border_width(lua_State
*L
, wibox_t
*wibox
)
1477 wibox_t
*w
= luaA_checkudata(L
, -3, &wibox_class
);
1478 int32_t border_width
= luaL_checknumber(L
, -1);
1479 if(border_width
!= w
->border_width
&& border_width
>= 0)
1481 if (w
->window
!= XCB_NONE
)
1482 xcb_configure_window(globalconf
.connection
, w
->window
, XCB_CONFIG_WINDOW_BORDER_WIDTH
,
1483 (uint32_t[]) { border_width
});
1484 w
->border_width
= border_width
;
1485 /* Need update if transparent background */
1486 wibox_need_update(w
);
1487 luaA_object_emit_signal(L
, -3, "property::border_width", 0);
1493 luaA_wibox_set_shape_bounding(lua_State
*L
, wibox_t
*wibox
)
1495 luaA_checkudata(L
, -1, &image_class
);
1496 luaA_object_unref_item(L
, -3, wibox
->shape
.bounding
);
1497 wibox
->shape
.bounding
= luaA_object_ref_item(L
, -3, -1);
1498 wibox
->need_shape_update
= true;
1499 luaA_object_emit_signal(L
, -2, "property::shape_bounding", 0);
1504 luaA_wibox_get_shape_bounding(lua_State
*L
, wibox_t
*wibox
)
1506 return luaA_object_push_item(L
, 1, wibox
->shape
.bounding
);
1510 luaA_wibox_set_shape_clip(lua_State
*L
, wibox_t
*wibox
)
1512 luaA_checkudata(L
, -1, &image_class
);
1513 luaA_object_unref_item(L
, -3, wibox
->shape
.clip
);
1514 wibox
->shape
.clip
= luaA_object_ref_item(L
, -3, -1);
1515 wibox
->need_shape_update
= true;
1516 luaA_object_emit_signal(L
, -2, "property::shape_clip", 0);
1521 luaA_wibox_get_shape_clip(lua_State
*L
, wibox_t
*wibox
)
1523 return luaA_object_push_item(L
, 1, wibox
->shape
.clip
);
1527 wibox_class_setup(lua_State
*L
)
1529 static const struct luaL_reg wibox_methods
[] =
1531 LUA_CLASS_METHODS(wibox
)
1532 { "__call", luaA_wibox_new
},
1536 static const struct luaL_reg wibox_meta
[] =
1538 LUA_OBJECT_META(wibox
)
1540 { "struts", luaA_wibox_struts
},
1541 { "buttons", luaA_wibox_buttons
},
1542 { "geometry", luaA_wibox_geometry
},
1543 { "__gc", luaA_wibox_gc
},
1547 luaA_class_setup(L
, &wibox_class
, "wibox", (lua_class_allocator_t
) wibox_new
,
1548 luaA_class_index_miss_property
, luaA_class_newindex_miss_property
,
1549 wibox_methods
, wibox_meta
);
1550 luaA_class_add_property(&wibox_class
, A_TK_WIDGETS
,
1551 (lua_class_propfunc_t
) luaA_wibox_set_widgets
,
1552 (lua_class_propfunc_t
) luaA_wibox_get_widgets
,
1553 (lua_class_propfunc_t
) luaA_wibox_set_widgets
);
1554 luaA_class_add_property(&wibox_class
, A_TK_OPACITY
,
1555 (lua_class_propfunc_t
) luaA_wibox_set_opacity
,
1556 (lua_class_propfunc_t
) luaA_wibox_get_opacity
,
1557 (lua_class_propfunc_t
) luaA_wibox_set_opacity
);
1558 luaA_class_add_property(&wibox_class
, A_TK_VISIBLE
,
1559 (lua_class_propfunc_t
) luaA_wibox_set_visible
,
1560 (lua_class_propfunc_t
) luaA_wibox_get_visible
,
1561 (lua_class_propfunc_t
) luaA_wibox_set_visible
);
1562 luaA_class_add_property(&wibox_class
, A_TK_BORDER_COLOR
,
1563 (lua_class_propfunc_t
) luaA_wibox_set_border_color
,
1564 (lua_class_propfunc_t
) luaA_wibox_get_border_color
,
1565 (lua_class_propfunc_t
) luaA_wibox_set_border_color
);
1566 luaA_class_add_property(&wibox_class
, A_TK_BORDER_WIDTH
,
1567 (lua_class_propfunc_t
) luaA_wibox_set_border_width
,
1568 (lua_class_propfunc_t
) luaA_wibox_get_border_width
,
1569 (lua_class_propfunc_t
) luaA_wibox_set_border_width
);
1570 luaA_class_add_property(&wibox_class
, A_TK_ORIENTATION
,
1571 (lua_class_propfunc_t
) luaA_wibox_set_orientation
,
1572 (lua_class_propfunc_t
) luaA_wibox_get_orientation
,
1573 (lua_class_propfunc_t
) luaA_wibox_set_orientation
);
1574 luaA_class_add_property(&wibox_class
, A_TK_ONTOP
,
1575 (lua_class_propfunc_t
) luaA_wibox_set_ontop
,
1576 (lua_class_propfunc_t
) luaA_wibox_get_ontop
,
1577 (lua_class_propfunc_t
) luaA_wibox_set_ontop
);
1578 luaA_class_add_property(&wibox_class
, A_TK_SCREEN
,
1580 (lua_class_propfunc_t
) luaA_wibox_get_screen
,
1581 (lua_class_propfunc_t
) luaA_wibox_set_screen
);
1582 luaA_class_add_property(&wibox_class
, A_TK_CURSOR
,
1583 (lua_class_propfunc_t
) luaA_wibox_set_cursor
,
1584 (lua_class_propfunc_t
) luaA_wibox_get_cursor
,
1585 (lua_class_propfunc_t
) luaA_wibox_set_cursor
);
1586 luaA_class_add_property(&wibox_class
, A_TK_CLIENT
,
1587 (lua_class_propfunc_t
) luaA_wibox_set_client
,
1588 (lua_class_propfunc_t
) luaA_wibox_get_client
,
1589 (lua_class_propfunc_t
) luaA_wibox_set_client
);
1590 luaA_class_add_property(&wibox_class
, A_TK_POSITION
,
1591 (lua_class_propfunc_t
) luaA_wibox_set_position
,
1592 (lua_class_propfunc_t
) luaA_wibox_get_position
,
1593 (lua_class_propfunc_t
) luaA_wibox_set_position
);
1594 luaA_class_add_property(&wibox_class
, A_TK_ALIGN
,
1595 (lua_class_propfunc_t
) luaA_wibox_set_align
,
1596 (lua_class_propfunc_t
) luaA_wibox_get_align
,
1597 (lua_class_propfunc_t
) luaA_wibox_set_align
);
1598 luaA_class_add_property(&wibox_class
, A_TK_FG
,
1599 (lua_class_propfunc_t
) luaA_wibox_set_fg
,
1600 (lua_class_propfunc_t
) luaA_wibox_get_fg
,
1601 (lua_class_propfunc_t
) luaA_wibox_set_fg
);
1602 luaA_class_add_property(&wibox_class
, A_TK_BG
,
1603 (lua_class_propfunc_t
) luaA_wibox_set_bg
,
1604 (lua_class_propfunc_t
) luaA_wibox_get_bg
,
1605 (lua_class_propfunc_t
) luaA_wibox_set_bg
);
1606 luaA_class_add_property(&wibox_class
, A_TK_BG_IMAGE
,
1607 (lua_class_propfunc_t
) luaA_wibox_set_bg_image
,
1608 (lua_class_propfunc_t
) luaA_wibox_get_bg_image
,
1609 (lua_class_propfunc_t
) luaA_wibox_set_bg_image
);
1610 luaA_class_add_property(&wibox_class
, A_TK_X
,
1611 (lua_class_propfunc_t
) luaA_wibox_set_x
,
1612 (lua_class_propfunc_t
) luaA_wibox_get_x
,
1613 (lua_class_propfunc_t
) luaA_wibox_set_x
);
1614 luaA_class_add_property(&wibox_class
, A_TK_Y
,
1615 (lua_class_propfunc_t
) luaA_wibox_set_y
,
1616 (lua_class_propfunc_t
) luaA_wibox_get_y
,
1617 (lua_class_propfunc_t
) luaA_wibox_set_y
);
1618 luaA_class_add_property(&wibox_class
, A_TK_WIDTH
,
1619 (lua_class_propfunc_t
) luaA_wibox_set_width
,
1620 (lua_class_propfunc_t
) luaA_wibox_get_width
,
1621 (lua_class_propfunc_t
) luaA_wibox_set_width
);
1622 luaA_class_add_property(&wibox_class
, A_TK_HEIGHT
,
1623 (lua_class_propfunc_t
) luaA_wibox_set_height
,
1624 (lua_class_propfunc_t
) luaA_wibox_get_height
,
1625 (lua_class_propfunc_t
) luaA_wibox_set_height
);
1626 luaA_class_add_property(&wibox_class
, A_TK_SHAPE_BOUNDING
,
1627 (lua_class_propfunc_t
) luaA_wibox_set_shape_bounding
,
1628 (lua_class_propfunc_t
) luaA_wibox_get_shape_bounding
,
1629 (lua_class_propfunc_t
) luaA_wibox_set_shape_bounding
);
1630 luaA_class_add_property(&wibox_class
, A_TK_SHAPE_CLIP
,
1631 (lua_class_propfunc_t
) luaA_wibox_set_shape_clip
,
1632 (lua_class_propfunc_t
) luaA_wibox_get_shape_clip
,
1633 (lua_class_propfunc_t
) luaA_wibox_set_shape_clip
);
1636 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80