vt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"

At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it will
soon be passed as argument to a new callback, replacing vd_bitbltchr_t.

MFC after:	1 week
This commit is contained in:
Jean-Sébastien Pédron 2014-08-21 19:42:24 +00:00
parent 943c702a1b
commit 02ebdd502d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=270293
3 changed files with 21 additions and 19 deletions

View file

@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
#include <dev/vt/vt.h>
#ifndef SC_NO_CUTPASTE
struct mouse_cursor vt_default_mouse_pointer = {
struct vt_mouse_cursor vt_default_mouse_pointer = {
.map = {
0x00, /* "__ " */
0x40, /* "_*_ " */
@ -64,7 +64,7 @@ struct mouse_cursor vt_default_mouse_pointer = {
0x0f, /* " ____" */
0x0f, /* " ____" */
},
.w = 8,
.h = 13,
.width = 8,
.height = 13,
};
#endif

View file

@ -284,6 +284,15 @@ struct vt_window {
* (VDF_TEXTMODE).
*/
#ifndef SC_NO_CUTPASTE
struct vt_mouse_cursor {
uint8_t map[64 * 64 / 8];
uint8_t mask[64 * 64 / 8];
uint8_t width;
uint8_t height;
};
#endif
typedef int vd_init_t(struct vt_device *vd);
typedef int vd_probe_t(struct vt_device *vd);
typedef void vd_postswitch_t(struct vt_device *vd);
@ -377,15 +386,6 @@ struct vt_font {
unsigned int vf_refcount;
};
#ifndef SC_NO_CUTPASTE
struct mouse_cursor {
uint8_t map[64 * 64 / 8];
uint8_t mask[64 * 64 / 8];
uint8_t w;
uint8_t h;
};
#endif
const uint8_t *vtfont_lookup(const struct vt_font *vf, term_char_t c);
struct vt_font *vtfont_ref(struct vt_font *vf);
void vtfont_unref(struct vt_font *vf);

View file

@ -134,7 +134,7 @@ extern unsigned char vt_logo_image[];
/* Font. */
extern struct vt_font vt_font_default;
#ifndef SC_NO_CUTPASTE
extern struct mouse_cursor vt_default_mouse_pointer;
extern struct vt_mouse_cursor vt_default_mouse_pointer;
#endif
static int signal_vt_rel(struct vt_window *);
@ -853,7 +853,7 @@ vt_flush(struct vt_device *vd)
term_pos_t size;
term_char_t *r;
#ifndef SC_NO_CUTPASTE
struct mouse_cursor *cursor;
struct vt_mouse_cursor *cursor;
int bpl, h, w;
#endif
@ -940,13 +940,15 @@ vt_flush(struct vt_device *vd)
#ifndef SC_NO_CUTPASTE
if (cursor != NULL) {
bpl = (cursor->w + 7) >> 3; /* Bytes per source line. */
w = cursor->w;
h = cursor->h;
bpl = (cursor->width + 7) >> 3; /* Bytes per source line. */
w = cursor->width;
h = cursor->height;
if ((vd->vd_mx + cursor->w) > (size.tp_col * vf->vf_width))
if ((vd->vd_mx + cursor->width) >
(size.tp_col * vf->vf_width))
w = (size.tp_col * vf->vf_width) - vd->vd_mx - 1;
if ((vd->vd_my + cursor->h) > (size.tp_row * vf->vf_height))
if ((vd->vd_my + cursor->height) >
(size.tp_row * vf->vf_height))
h = (size.tp_row * vf->vf_height) - vd->vd_my - 1;
vd->vd_driver->vd_bitbltchr(vd, cursor->map, cursor->mask, bpl,