void do_it(item, event) { Rect *r; Panel panel = xv_get(item, PANEL_PARENT_PANEL); r = (Rect *)xv_get(xv_get(panel, XV_ROOT), WIN_MOUSE_XY); fprintf(stderr, "Root window: "); rect_print(r); fputc('\n', stderr); r = (Rect *)xv_get(xv_get(panel, CANVAS_NTH_PAINT_WINDOW, 0), WIN_MOUSE_XY); fprintf(stderr, "panel window: "); rect_print(r); fputc('\n', stderr); }
void rect_list_print(const list_t rects) { list_node_t *node; int len; len = 0; for (node = rects.head; node; node = node->next) len++; putchar('['); for (node = rects.head; node; node = node->next) { rect_print(((rect_node_t *)node)->rect); if (node->next) { putchar(','); if (len < 4) putchar(' '); else { putchar('\n'); putchar(' '); } } } putchar(']'); }