vt.h (271952) | vt.h (271973) |
---|---|
1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: stable/10/sys/dev/vt/vt.h 271952 2014-09-22 10:21:08Z ray $ | 32 * $FreeBSD: stable/10/sys/dev/vt/vt.h 271973 2014-09-22 16:13:33Z dumbbell $ |
33 */ 34 35#ifndef _DEV_VT_VT_H_ 36#define _DEV_VT_VT_H_ 37 38#include <sys/param.h> 39#include <sys/_lock.h> 40#include <sys/_mutex.h> --- 127 unchanged lines hidden (view full) --- 168 * Because redrawing is performed asynchronously, the buffer keeps track 169 * of a rectangle that needs to be redrawn (vb_dirtyrect). Because this 170 * approach seemed to cause suboptimal performance (when the top left 171 * and the bottom right of the screen are modified), it also uses a set 172 * of bitmasks to keep track of the rows and columns (mod 64) that have 173 * been modified. 174 */ 175 | 33 */ 34 35#ifndef _DEV_VT_VT_H_ 36#define _DEV_VT_VT_H_ 37 38#include <sys/param.h> 39#include <sys/_lock.h> 40#include <sys/_mutex.h> --- 127 unchanged lines hidden (view full) --- 168 * Because redrawing is performed asynchronously, the buffer keeps track 169 * of a rectangle that needs to be redrawn (vb_dirtyrect). Because this 170 * approach seemed to cause suboptimal performance (when the top left 171 * and the bottom right of the screen are modified), it also uses a set 172 * of bitmasks to keep track of the rows and columns (mod 64) that have 173 * been modified. 174 */ 175 |
176struct vt_bufmask { 177 uint64_t vbm_row, vbm_col; 178#define VBM_DIRTY UINT64_MAX 179}; 180 | |
181struct vt_buf { 182 struct mtx vb_lock; /* Buffer lock. */ 183 term_pos_t vb_scr_size; /* (b) Screen dimensions. */ 184 int vb_flags; /* (b) Flags. */ 185#define VBF_CURSOR 0x1 /* Cursor visible. */ 186#define VBF_STATIC 0x2 /* Buffer is statically allocated. */ 187#define VBF_MTX_INIT 0x4 /* Mutex initialized. */ 188#define VBF_SCROLL 0x8 /* scroll locked mode. */ 189#define VBF_HISTORY_FULL 0x10 /* All rows filled. */ 190 unsigned int vb_history_size; 191#define VBF_DEFAULT_HISTORY_SIZE 500 192 int vb_roffset; /* (b) History rows offset. */ 193 int vb_curroffset; /* (b) Saved rows offset. */ 194 term_pos_t vb_cursor; /* (u) Cursor position. */ 195 term_pos_t vb_mark_start; /* (b) Copy region start. */ 196 term_pos_t vb_mark_end; /* (b) Copy region end. */ 197 int vb_mark_last; /* Last mouse event. */ 198 term_rect_t vb_dirtyrect; /* (b) Dirty rectangle. */ | 176struct vt_buf { 177 struct mtx vb_lock; /* Buffer lock. */ 178 term_pos_t vb_scr_size; /* (b) Screen dimensions. */ 179 int vb_flags; /* (b) Flags. */ 180#define VBF_CURSOR 0x1 /* Cursor visible. */ 181#define VBF_STATIC 0x2 /* Buffer is statically allocated. */ 182#define VBF_MTX_INIT 0x4 /* Mutex initialized. */ 183#define VBF_SCROLL 0x8 /* scroll locked mode. */ 184#define VBF_HISTORY_FULL 0x10 /* All rows filled. */ 185 unsigned int vb_history_size; 186#define VBF_DEFAULT_HISTORY_SIZE 500 187 int vb_roffset; /* (b) History rows offset. */ 188 int vb_curroffset; /* (b) Saved rows offset. */ 189 term_pos_t vb_cursor; /* (u) Cursor position. */ 190 term_pos_t vb_mark_start; /* (b) Copy region start. */ 191 term_pos_t vb_mark_end; /* (b) Copy region end. */ 192 int vb_mark_last; /* Last mouse event. */ 193 term_rect_t vb_dirtyrect; /* (b) Dirty rectangle. */ |
199 struct vt_bufmask vb_dirtymask; /* (b) Dirty bitmasks. */ | |
200 term_char_t *vb_buffer; /* (u) Data buffer. */ 201 term_char_t **vb_rows; /* (u) Array of rows */ 202}; 203 204void vtbuf_copy(struct vt_buf *, const term_rect_t *, const term_pos_t *); 205void vtbuf_fill_locked(struct vt_buf *, const term_rect_t *, term_char_t); 206void vtbuf_init_early(struct vt_buf *); 207void vtbuf_init(struct vt_buf *, const term_pos_t *); 208void vtbuf_grow(struct vt_buf *, const term_pos_t *, unsigned int); 209void vtbuf_putchar(struct vt_buf *, const term_pos_t *, term_char_t); 210void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); 211void vtbuf_scroll_mode(struct vt_buf *vb, int yes); 212void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area); | 194 term_char_t *vb_buffer; /* (u) Data buffer. */ 195 term_char_t **vb_rows; /* (u) Array of rows */ 196}; 197 198void vtbuf_copy(struct vt_buf *, const term_rect_t *, const term_pos_t *); 199void vtbuf_fill_locked(struct vt_buf *, const term_rect_t *, term_char_t); 200void vtbuf_init_early(struct vt_buf *); 201void vtbuf_init(struct vt_buf *, const term_pos_t *); 202void vtbuf_grow(struct vt_buf *, const term_pos_t *, unsigned int); 203void vtbuf_putchar(struct vt_buf *, const term_pos_t *, term_char_t); 204void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); 205void vtbuf_scroll_mode(struct vt_buf *vb, int yes); 206void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area); |
213void vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask *); | 207void vtbuf_undirty(struct vt_buf *, term_rect_t *); |
214void vtbuf_sethistory_size(struct vt_buf *, int); 215int vtbuf_iscursor(const struct vt_buf *vb, int row, int col); 216void vtbuf_cursor_visibility(struct vt_buf *, int); 217#ifndef SC_NO_CUTPASTE 218int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row); 219int vtbuf_get_marked_len(struct vt_buf *vb); 220void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz); 221#endif --- 202 unchanged lines hidden --- | 208void vtbuf_sethistory_size(struct vt_buf *, int); 209int vtbuf_iscursor(const struct vt_buf *vb, int row, int col); 210void vtbuf_cursor_visibility(struct vt_buf *, int); 211#ifndef SC_NO_CUTPASTE 212int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row); 213int vtbuf_get_marked_len(struct vt_buf *vb); 214void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz); 215#endif --- 202 unchanged lines hidden --- |