=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/mode-tree.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/tmux/mode-tree.c 2017/11/02 21:29:17 1.16 --- src/usr.bin/tmux/mode-tree.c 2017/11/02 22:00:42 1.17 *************** *** 1,4 **** ! /* $OpenBSD: mode-tree.c,v 1.16 2017/11/02 21:29:17 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: mode-tree.c,v 1.17 2017/11/02 22:00:42 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott *************** *** 39,48 **** u_int sort_size; u_int sort_type; ! void (*buildcb)(void *, u_int, uint64_t *, ! const char *); ! struct screen *(*drawcb)(void *, void *, u_int, u_int); ! int (*searchcb)(void*, void *, const char *); struct mode_tree_list children; struct mode_tree_list saved; --- 39,47 ---- u_int sort_size; u_int sort_type; ! mode_tree_build_cb buildcb; ! mode_tree_draw_cb drawcb; ! mode_tree_search_cb searchcb; struct mode_tree_list children; struct mode_tree_list saved; *************** *** 265,272 **** } void ! mode_tree_each_tagged(struct mode_tree_data *mtd, void (*cb)(void *, void *, ! struct client *, key_code), struct client *c, key_code key, int current) { struct mode_tree_item *mti; u_int i; --- 264,271 ---- } void ! mode_tree_each_tagged(struct mode_tree_data *mtd, mode_tree_each_cb cb, ! struct client *c, key_code key, int current) { struct mode_tree_item *mti; u_int i; *************** *** 288,297 **** struct mode_tree_data * mode_tree_start(struct window_pane *wp, struct args *args, ! void (*buildcb)(void *, u_int, uint64_t *, const char *), ! struct screen *(*drawcb)(void *, void *, u_int, u_int), ! int (*searchcb)(void *, void *, const char *), void *modedata, ! const char **sort_list, u_int sort_size, struct screen **s) { struct mode_tree_data *mtd; const char *sort; --- 287,295 ---- struct mode_tree_data * mode_tree_start(struct window_pane *wp, struct args *args, ! mode_tree_build_cb buildcb, mode_tree_draw_cb drawcb, ! mode_tree_search_cb searchcb, void *modedata, const char **sort_list, ! u_int sort_size, struct screen **s) { struct mode_tree_data *mtd; const char *sort; *************** *** 463,469 **** mode_tree_draw(struct mode_tree_data *mtd) { struct window_pane *wp = mtd->wp; ! struct screen *s = &mtd->screen, *box = NULL; struct mode_tree_line *line; struct mode_tree_item *mti; struct options *oo = wp->window->options; --- 461,467 ---- mode_tree_draw(struct mode_tree_data *mtd) { struct window_pane *wp = mtd->wp; ! struct screen *s = &mtd->screen; struct mode_tree_line *line; struct mode_tree_item *mti; struct options *oo = wp->window->options; *************** *** 591,603 **** box_x = w - 4; box_y = sy - h - 2; ! if (box_x != 0 && box_y != 0) ! box = mtd->drawcb(mtd->modedata, mti->itemdata, box_x, box_y); ! if (box != NULL) { screen_write_cursormove(&ctx, 2, h + 1); ! screen_write_fast_copy(&ctx, box, 0, 0, box_x, box_y); ! ! screen_free(box); } screen_write_stop(&ctx); --- 589,597 ---- box_x = w - 4; box_y = sy - h - 2; ! if (box_x != 0 && box_y != 0) { screen_write_cursormove(&ctx, 2, h + 1); ! mtd->drawcb(mtd->modedata, mti->itemdata, &ctx, box_x, box_y); } screen_write_stop(&ctx);