From owner-svn-src-user@FreeBSD.ORG Mon Nov 11 12:34:30 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EFEA8729; Mon, 11 Nov 2013 12:34:30 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C62BE23D1; Mon, 11 Nov 2013 12:34:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rABCYUCf042923; Mon, 11 Nov 2013 12:34:30 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rABCYUGZ042922; Mon, 11 Nov 2013 12:34:30 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201311111234.rABCYUGZ042922@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 11 Nov 2013 12:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r257981 - user/ed/newcons/sys/dev/vt X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 12:34:31 -0000 Author: ray Date: Mon Nov 11 12:34:30 2013 New Revision: 257981 URL: http://svnweb.freebsd.org/changeset/base/257981 Log: o Update vt_flush to care about mouse pointer. o Sort variable declarations. o Disable mouse support for DDB. o Expose region to update on old mouse position. o Draw mouse cursor on current position. There is some extra bits for calculation of size to copy bitmap to screen. It is not supported by drivers, but will be changed in following commits. Sponsored by: The FreeBSD Foundation Modified: user/ed/newcons/sys/dev/vt/vt_core.c Modified: user/ed/newcons/sys/dev/vt/vt_core.c ============================================================================== --- user/ed/newcons/sys/dev/vt/vt_core.c Mon Nov 11 12:26:35 2013 (r257980) +++ user/ed/newcons/sys/dev/vt/vt_core.c Mon Nov 11 12:34:30 2013 (r257981) @@ -652,11 +652,13 @@ vt_flush(struct vt_device *vd) { struct vt_window *vw = vd->vd_curwindow; struct vt_font *vf = vw->vw_font; - term_pos_t size; - term_rect_t tarea; struct vt_bufmask tmask; + struct mouse_cursor *m; unsigned int row, col; + term_rect_t tarea; + term_pos_t size; term_char_t *r; + int h, w; if (vd->vd_flags & VDF_SPLASH || vw->vw_flags & VWF_BUSY) return; @@ -673,6 +675,12 @@ vt_flush(struct vt_device *vd) vd->vd_flags &= ~VDF_INVALID; } + /* No mouse for DDB. */ + if (kdb_active || panicstr != NULL) + return; + + /* Mark last mouse position as dirty to erase. */ + vtbuf_mouse_cursor_position(&vw->vw_buf, vd->vd_mdirtyx, vd->vd_mdirtyy); for (row = tarea.tr_begin.tp_row; row < tarea.tr_end.tp_row; row++) { if (!VTBUF_DIRTYROW(&tmask, row)) @@ -687,6 +695,26 @@ vt_flush(struct vt_device *vd) VTBUF_ISCURSOR(&vw->vw_buf, row, col), row, col); } } + + if ((vd->vd_flags & (VDF_MOUSECURSOR|VDF_TEXTMODE)) == + VDF_MOUSECURSOR) { + m = &vt_default_mouse_pointer; + w = m->w; + h = m->h; + + if ((vd->vd_mx + m->w) > (size.tp_col * vf->vf_width)) + w = (size.tp_col * vf->vf_width) - vd->vd_mx - 1; + if ((vd->vd_my + m->h) > (size.tp_row * vf->vf_height)) + h = (size.tp_row * vf->vf_height) - vd->vd_my - 1; + + vd->vd_driver->vd_bitbltchr(vd, m->map, + vd->vd_offset.tp_row + vd->vd_my, + vd->vd_offset.tp_col + vd->vd_mx, + w, h, TC_WHITE, TC_BLACK); + /* Save point of last mouse cursor to erase it later. */ + vd->vd_mdirtyx = vd->vd_mx / vf->vf_width; + vd->vd_mdirtyy = vd->vd_my / vf->vf_height; + } } static void