vt_core.c (270589) | vt_core.c (270613) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> | 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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/vt/vt_core.c 270589 2014-08-25 17:08:38Z dumbbell $"); | 34__FBSDID("$FreeBSD: head/sys/dev/vt/vt_core.c 270613 2014-08-25 19:06:31Z dumbbell $"); |
35 36#include "opt_compat.h" 37 38#include <sys/param.h> 39#include <sys/consio.h> 40#include <sys/eventhandler.h> 41#include <sys/fbio.h> 42#include <sys/kbio.h> --- 780 unchanged lines hidden (view full) --- 823vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) 824{ 825 unsigned int mx, my, x1, y1, x2, y2; 826 827 /* 828 * We use the cursor position saved during the current refresh, 829 * in case the cursor moved since. 830 */ | 35 36#include "opt_compat.h" 37 38#include <sys/param.h> 39#include <sys/consio.h> 40#include <sys/eventhandler.h> 41#include <sys/fbio.h> 42#include <sys/kbio.h> --- 780 unchanged lines hidden (view full) --- 823vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) 824{ 825 unsigned int mx, my, x1, y1, x2, y2; 826 827 /* 828 * We use the cursor position saved during the current refresh, 829 * in case the cursor moved since. 830 */ |
831 mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_offset.tp_col; 832 my = vd->vd_my_drawn + vd->vd_curwindow->vw_offset.tp_row; | 831 mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_col; 832 my = vd->vd_my_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_row; |
833 834 x1 = area->tr_begin.tp_col; 835 y1 = area->tr_begin.tp_row; 836 x2 = area->tr_end.tp_col; 837 y2 = area->tr_end.tp_row; 838 839 if (((mx >= x1 && x2 - 1 >= mx) || 840 (mx < x1 && mx + vd->vd_mcursor->width >= x1)) && --- 356 unchanged lines hidden (view full) --- 1197 struct vt_device *vd = vw->vw_device; 1198 int x, y, off_x, off_y; 1199 1200 if (vd->vd_driver->vd_drawrect == NULL) 1201 return (ENOTSUP); 1202 1203 x = vd->vd_width - 1; 1204 y = vd->vd_height - 1; | 833 834 x1 = area->tr_begin.tp_col; 835 y1 = area->tr_begin.tp_row; 836 x2 = area->tr_end.tp_col; 837 y2 = area->tr_end.tp_row; 838 839 if (((mx >= x1 && x2 - 1 >= mx) || 840 (mx < x1 && mx + vd->vd_mcursor->width >= x1)) && --- 356 unchanged lines hidden (view full) --- 1197 struct vt_device *vd = vw->vw_device; 1198 int x, y, off_x, off_y; 1199 1200 if (vd->vd_driver->vd_drawrect == NULL) 1201 return (ENOTSUP); 1202 1203 x = vd->vd_width - 1; 1204 y = vd->vd_height - 1; |
1205 off_x = vw->vw_offset.tp_col; 1206 off_y = vw->vw_offset.tp_row; | 1205 off_x = vw->vw_draw_area.tr_begin.tp_col; 1206 off_y = vw->vw_draw_area.tr_begin.tp_row; |
1207 1208 /* Top bar. */ 1209 if (off_y > 0) 1210 vd->vd_driver->vd_drawrect(vd, 0, 0, x, off_y - 1, 1, c); 1211 /* Left bar. */ 1212 if (off_x > 0) 1213 vd->vd_driver->vd_drawrect(vd, 0, off_y, off_x - 1, y - off_y, 1214 1, c); --- 37 unchanged lines hidden (view full) --- 1252 VT_UNLOCK(vd); 1253 return (ENOTTY); 1254 } 1255 vw->vw_flags |= VWF_BUSY; 1256 VT_UNLOCK(vd); 1257 1258 vt_termsize(vd, vf, &size); 1259 vt_winsize(vd, vf, &wsz); | 1207 1208 /* Top bar. */ 1209 if (off_y > 0) 1210 vd->vd_driver->vd_drawrect(vd, 0, 0, x, off_y - 1, 1, c); 1211 /* Left bar. */ 1212 if (off_x > 0) 1213 vd->vd_driver->vd_drawrect(vd, 0, off_y, off_x - 1, y - off_y, 1214 1, c); --- 37 unchanged lines hidden (view full) --- 1252 VT_UNLOCK(vd); 1253 return (ENOTTY); 1254 } 1255 vw->vw_flags |= VWF_BUSY; 1256 VT_UNLOCK(vd); 1257 1258 vt_termsize(vd, vf, &size); 1259 vt_winsize(vd, vf, &wsz); |
1260 /* Save offset to font aligned area. */ 1261 vw->vw_offset.tp_col = (vd->vd_width % vf->vf_width) / 2; 1262 vw->vw_offset.tp_row = (vd->vd_height % vf->vf_height) / 2; | |
1263 | 1260 |
1261 /* 1262 * Compute the drawable area, so that the text is centered on 1263 * the screen. 1264 */ 1265 vw->vw_draw_area.tr_begin.tp_col = (vd->vd_width % vf->vf_width) / 2; 1266 vw->vw_draw_area.tr_begin.tp_row = (vd->vd_height % vf->vf_height) / 2; 1267 vw->vw_draw_area.tr_end.tp_col = vw->vw_draw_area.tr_begin.tp_col + 1268 vd->vd_width / vf->vf_width * vf->vf_width; 1269 vw->vw_draw_area.tr_end.tp_row = vw->vw_draw_area.tr_begin.tp_row + 1270 vd->vd_height / vf->vf_height * vf->vf_height; 1271 |
|
1264 /* Grow the screen buffer and terminal. */ 1265 terminal_mute(tm, 1); 1266 vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); 1267 terminal_set_winsize_blank(tm, &wsz, 0, NULL); 1268 terminal_mute(tm, 0); 1269 1270 /* Actually apply the font to the current window. */ 1271 VT_LOCK(vd); --- 974 unchanged lines hidden --- | 1272 /* Grow the screen buffer and terminal. */ 1273 terminal_mute(tm, 1); 1274 vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); 1275 terminal_set_winsize_blank(tm, &wsz, 0, NULL); 1276 terminal_mute(tm, 0); 1277 1278 /* Actually apply the font to the current window. */ 1279 VT_LOCK(vd); --- 974 unchanged lines hidden --- |