aboutsummaryrefslogtreecommitdiff
path: root/sys/teken
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2017-08-18 15:40:40 +0000
committerBruce Evans <bde@FreeBSD.org>2017-08-18 15:40:40 +0000
commit15e0c6511ac1ea694aee312d4553539998d80f59 (patch)
treeb865836400985068f733c8de3c54f45843ff151e /sys/teken
parent5651294282461de8e6c26c195528e420546beddf (diff)
Notes
Diffstat (limited to 'sys/teken')
-rw-r--r--sys/teken/sequences3
-rw-r--r--sys/teken/teken.h2
-rw-r--r--sys/teken/teken_subr_compat.h26
3 files changed, 28 insertions, 3 deletions
diff --git a/sys/teken/sequences b/sys/teken/sequences
index 76eebd185296..0891f17e06b7 100644
--- a/sys/teken/sequences
+++ b/sys/teken/sequences
@@ -103,9 +103,10 @@ VPA Vertical Position Absolute ^[ [ d n
# Cons25 compatibility sequences
C25BLPD Cons25 set bell pitch duration ^[ [ = B r r
C25BORD Cons25 set border ^[ [ = A r
-C25CURS Cons25 set cursor type ^[ [ = S r
C25DBG Cons25 set default background ^[ [ = G r
C25DFG Cons25 set default foreground ^[ [ = F r
+C25GCS Cons25 set global cursor shape ^[ [ = C v
+C25LCT Cons25 set local cursor type ^[ [ = S r
C25MODE Cons25 set terminal mode ^[ [ = T r
C25SGR Cons25 set graphic rendition ^[ [ x r r
C25VTSW Cons25 switch virtual terminal ^[ [ z r
diff --git a/sys/teken/teken.h b/sys/teken/teken.h
index e1ea13673554..61efe5417c0c 100644
--- a/sys/teken/teken.h
+++ b/sys/teken/teken.h
@@ -102,6 +102,8 @@ typedef void tf_param_t(void *, int, unsigned int);
#define TP_SETBELLPD_DURATION(pd) ((pd) & 0xffff)
#define TP_MOUSE 6
#define TP_SETBORDER 7
+#define TP_SETLOCALCURSOR 8
+#define TP_SETGLOBALCURSOR 9
typedef void tf_respond_t(void *, const void *, size_t);
typedef struct {
diff --git a/sys/teken/teken_subr_compat.h b/sys/teken/teken_subr_compat.h
index 64341eec6d17..6142c7958f9f 100644
--- a/sys/teken/teken_subr_compat.h
+++ b/sys/teken/teken_subr_compat.h
@@ -34,10 +34,32 @@ teken_subr_cons25_set_border(teken_t *t, unsigned int c)
}
static void
-teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type)
+teken_subr_cons25_set_global_cursor_shape(teken_t *t, unsigned int ncmds,
+ unsigned int cmds[])
{
+ unsigned int code, i;
- teken_funcs_param(t, TP_SHOWCURSOR, type != 1);
+ /*
+ * Pack the args to work around API deficiencies. This requires
+ * knowing too much about the low level to be fully compatible.
+ * Returning when ncmds > 3 is necessary and happens to be
+ * compatible. Discarding high bits is necessary and happens to
+ * be incompatible only for invalid args when ncmds == 3.
+ */
+ if (ncmds > 3)
+ return;
+ code = 0;
+ for (i = ncmds; i > 0; i--)
+ code = (code << 8) | (cmds[i - 1] & 0xff);
+ code = (code << 8) | ncmds;
+ teken_funcs_param(t, TP_SETGLOBALCURSOR, code);
+}
+
+static void
+teken_subr_cons25_set_local_cursor_type(teken_t *t, unsigned int type)
+{
+
+ teken_funcs_param(t, TP_SETLOCALCURSOR, type);
}
static const teken_color_t cons25_colors[8] = { TC_BLACK, TC_BLUE,