Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sbin/wsconsctl Pull up revision 1.3 (requested by recht...



details:   https://anonhg.NetBSD.org/src/rev/3c7c2e9874cf
branches:  netbsd-2-0
changeset: 561307:3c7c2e9874cf
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jun 07 09:44:07 2004 +0000

description:
Pull up revision 1.3 (requested by recht in ticket #451):
PR/19925: David Ferlier: add scrolling support to wscons

diffstat:

 sbin/wsconsctl/display.c |  30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diffs (67 lines):

diff -r c23fd0126ad9 -r 3c7c2e9874cf sbin/wsconsctl/display.c
--- a/sbin/wsconsctl/display.c  Mon Jun 07 09:38:23 2004 +0000
+++ b/sbin/wsconsctl/display.c  Mon Jun 07 09:44:07 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: display.c,v 1.2 2002/04/07 10:40:04 hannken Exp $ */
+/*     $NetBSD: display.c,v 1.2.4.1 2004/06/07 09:44:07 tron Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,6 +37,7 @@
  */
 
 #include <sys/ioctl.h>
+#include <stdio.h>
 #include <sys/time.h>
 #include <dev/wscons/wsconsio.h>
 #include <err.h>
@@ -44,10 +45,13 @@
 
 static int dpytype;
 static struct wsdisplay_usefontdata font;
+static struct wsdisplay_scroll_data scroll_l;
 
 struct field display_field_tab[] = {
     { "type",                  &dpytype,       FMT_DPYTYPE,    FLG_RDONLY },
     { "font",                  &font.name,     FMT_STRING,     FLG_WRONLY },
+    { "scroll.fastlines",      &scroll_l.fastlines, FMT_UINT, FLG_MODIFY },
+    { "scroll.slowlines",      &scroll_l.slowlines, FMT_UINT, FLG_MODIFY },
 };
 
 int display_field_tab_len = sizeof(display_field_tab)/
@@ -60,6 +64,15 @@
        if (field_by_value(&dpytype)->flags & FLG_GET)
                if (ioctl(fd, WSDISPLAYIO_GTYPE, &dpytype) < 0)
                        err(1, "WSDISPLAYIO_GTYPE");
+       
+       scroll_l.which = 0;
+       if (field_by_value(&scroll_l.fastlines)->flags & FLG_GET)
+               scroll_l.which |= WSDISPLAY_SCROLL_DOFASTLINES;
+       if (field_by_value(&scroll_l.slowlines)->flags & FLG_GET)
+               scroll_l.which |= WSDISPLAY_SCROLL_DOSLOWLINES;
+       if (scroll_l.which != 0 && 
+               ioctl(fd, WSDISPLAYIO_DGSCROLL, &scroll_l) < 0)
+                       err(1, "WSDISPLAYIO_GSCROLL");
 }
 
 void
@@ -71,4 +84,19 @@
                        err(1, "WSDISPLAYIO_SFONT");
                pr_field(field_by_value(&font.name), " -> ");
        }
+       
+       scroll_l.which = 0;
+       if (field_by_value(&scroll_l.fastlines)->flags & FLG_SET)
+               scroll_l.which |= WSDISPLAY_SCROLL_DOFASTLINES;
+       if (field_by_value(&scroll_l.slowlines)->flags & FLG_SET)
+               scroll_l.which |= WSDISPLAY_SCROLL_DOSLOWLINES;
+
+       if (scroll_l.which & WSDISPLAY_SCROLL_DOFASTLINES)
+               pr_field(field_by_value(&scroll_l.fastlines), " -> ");
+       if (scroll_l.which & WSDISPLAY_SCROLL_DOSLOWLINES)
+               pr_field(field_by_value(&scroll_l.slowlines), " -> ");
+       if (scroll_l.which != 0 &&
+               ioctl(fd, WSDISPLAYIO_DSSCROLL, &scroll_l) < 0)
+               err (1, "WSDISPLAYIO_SSCROLL");
+
 }



Home | Main Index | Thread Index | Old Index