Ejemplo n.º 1
0
/*
  Resize the column string if necessary and then append c to the
  end of the column string, incrementing the column position pointer.
*/
static inline void push(tokenizer_t *self, char c, int col)
{
    if (self->col_ptrs[col] - self->output_cols[col] >=
        self->output_len[col])
    {
        resize_col(self, col);
    }

    *self->col_ptrs[col]++ = c;
}
Ejemplo n.º 2
0
wm_mousemove(TableUI *tui, unsigned x, unsigned y) {
    if (tui->mouse_mode == MOUSE_MODE_RESIZING) {
        resize_col(tui, tui->resizing_col, x - get_cell_x(tui, tui->resizing_col + 1));
        redraw_rows(tui, 0, -1);
    } else {
        unsigned row, col, is_resize;
        get_cell_under(tui, x, y, &row, &col, &is_resize);
        if (is_resize)
            SetCursor(cursor_resize_col);
        else if (GetCursor() == cursor_resize_col)
            SetCursor(cursor_arrow);
    }
}