static void rearrange(WMBox * box) { BoxData eData; eData.box = box; eData.x = eData.y = box->borderWidth; eData.w = eData.h = 1; eData.expands = 0; if (box->horizontal) { eData.ye = box->borderWidth; eData.xe = WMWidgetWidth(box) - box->borderWidth; eData.h = WMWidgetHeight(box) - 2 * box->borderWidth; eData.total = WMWidgetWidth(box) - 2 * box->borderWidth; } else { eData.xe = box->borderWidth; eData.ye = WMWidgetHeight(box) - box->borderWidth; eData.w = WMWidgetWidth(box) - 2 * box->borderWidth; eData.total = WMWidgetHeight(box) - 2 * box->borderWidth; } if (eData.w <= 0 || eData.h <= 0 || eData.total <= 0) { return; } WMMapArray(box->subviews, computeExpansion, &eData); WMMapArray(box->subviews, doRearrange, &eData); }
void ForEachDisplay(void (*f) (struct display *)) { if (displays != NULL) { WMMapArray(displays, (void (*) (void *, void *)) f, NULL); } }