Exemplo n.º 1
0
Arquivo: query.c Projeto: dj95/bspwm
int query_node_ids_in(node_t *n, desktop_t *d, monitor_t *m, coordinates_t *ref, coordinates_t *trg, node_select_t *sel, FILE *rsp)
{
	int count = 0;
	if (n == NULL) {
		return 0;
	} else {
		coordinates_t loc = {m, d, n};
		if ((trg->node == NULL || n == trg->node) &&
		    (sel == NULL || node_matches(&loc, ref, *sel))) {
			fprintf(rsp, "0x%08X\n", n->id);
			count++;
		}
		count += query_node_ids_in(n->first_child, d, m, ref, trg, sel, rsp);
		count += query_node_ids_in(n->second_child, d, m, ref, trg, sel, rsp);
	}
	return count;
}
Exemplo n.º 2
0
bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, client_select_t sel)
{
    if (history_needle == NULL)
        history_needle = history_tail;

    history_t *h;
    for (h = history_needle; h != NULL; h = (hdi == HISTORY_OLDER ? h->prev : h->next)) {
        if (h == history_needle
                || !h->latest
                || h->loc.node == NULL
                || !is_visible(h->loc.desktop, h->loc.node)
                || !node_matches(&h->loc, ref, sel))
            continue;
        history_needle = h;
        *dst = h->loc;
        return true;
    }
    return false;
}
Exemplo n.º 3
0
bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, node_select_t sel)
{
	if (history_needle == NULL || record_history) {
		history_needle = history_tail;
	}

	history_t *h;
	for (h = history_needle; h != NULL; h = (hdi == HISTORY_OLDER ? h->prev : h->next)) {
		if (!h->latest ||
		    h->loc.node == NULL ||
		    h->loc.node == ref->node ||
		    !node_matches(&h->loc, ref, sel)) {
			continue;
		}
		if (!record_history) {
			history_needle = h;
		}
		*dst = h->loc;
		return true;
	}
	return false;
}