2012-12-24 05:20:12 +04:00
|
|
|
/* $NetBSD: wsconsctl.h,v 1.12 2012/12/24 01:20:44 khorben Exp $ */
|
1998-12-28 17:01:16 +03:00
|
|
|
|
|
|
|
/*-
|
2012-12-24 05:20:12 +04:00
|
|
|
* Copyright (c) 1998, 2004, 2012 The NetBSD Foundation, Inc.
|
1998-12-28 17:01:16 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Juergen Hannken-Illjes.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <dev/wscons/wsksymvar.h>
|
|
|
|
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
/* fg / bg values. Made identical to ANSI terminal color codes. */
|
|
|
|
#define WSCOL_UNSUPPORTED -1
|
|
|
|
#define WSCOL_BLACK 0
|
|
|
|
#define WSCOL_RED 1
|
|
|
|
#define WSCOL_GREEN 2
|
|
|
|
#define WSCOL_BROWN 3
|
|
|
|
#define WSCOL_BLUE 4
|
|
|
|
#define WSCOL_MAGENTA 5
|
|
|
|
#define WSCOL_CYAN 6
|
|
|
|
#define WSCOL_WHITE 7
|
|
|
|
/* flag values: */
|
|
|
|
#define WSATTR_NONE 0
|
|
|
|
#define WSATTR_REVERSE 1
|
|
|
|
#define WSATTR_HILIT 2
|
|
|
|
#define WSATTR_BLINK 4
|
|
|
|
#define WSATTR_UNDERLINE 8
|
|
|
|
#define WSATTR_WSCOLORS 16
|
|
|
|
|
1998-12-28 17:01:16 +03:00
|
|
|
struct field {
|
2005-06-27 02:45:50 +04:00
|
|
|
const char *name;
|
1998-12-28 17:01:16 +03:00
|
|
|
void *valp;
|
|
|
|
#define FMT_UINT 1 /* unsigned integer */
|
2002-04-07 14:40:04 +04:00
|
|
|
#define FMT_STRING 2 /* zero terminated string */
|
2006-02-05 20:38:33 +03:00
|
|
|
#define FMT_BITFIELD 3 /* bit field */
|
2012-12-24 05:20:12 +04:00
|
|
|
#define FMT_INT 4 /* signed integer */
|
1998-12-28 17:01:16 +03:00
|
|
|
#define FMT_KBDTYPE 101 /* keyboard type */
|
|
|
|
#define FMT_MSTYPE 102 /* mouse type */
|
|
|
|
#define FMT_DPYTYPE 103 /* display type */
|
|
|
|
#define FMT_KBDENC 104 /* keyboard encoding */
|
|
|
|
#define FMT_KBMAP 105 /* keyboard map */
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
#define FMT_COLOR 201 /* display color */
|
|
|
|
#define FMT_ATTRS 202 /* display attributes */
|
1998-12-28 17:01:16 +03:00
|
|
|
int format;
|
|
|
|
#define FLG_RDONLY 0x0001 /* variable cannot be modified */
|
|
|
|
#define FLG_WRONLY 0x0002 /* variable cannot be displayed */
|
|
|
|
#define FLG_NOAUTO 0x0004 /* skip variable on -a flag */
|
|
|
|
#define FLG_MODIFY 0x0008 /* variable may be modified with += */
|
2004-07-30 15:08:03 +04:00
|
|
|
#define FLG_DISABLED 0x0010 /* variable is not available */
|
1998-12-28 17:01:16 +03:00
|
|
|
#define FLG_GET 0x0100 /* read this variable from driver */
|
|
|
|
#define FLG_SET 0x0200 /* write this variable to driver */
|
|
|
|
int flags;
|
|
|
|
};
|
|
|
|
|
2005-01-19 23:37:52 +03:00
|
|
|
void field_setup(struct field *, int);
|
|
|
|
struct field *field_by_name(char *);
|
|
|
|
struct field *field_by_value(void *);
|
|
|
|
void field_disable_by_value(void *);
|
2005-06-27 02:45:50 +04:00
|
|
|
void pr_field(struct field *, const char *);
|
2005-01-19 23:37:52 +03:00
|
|
|
void rd_field(struct field *, char *, int);
|
|
|
|
int name2ksym(char *);
|
2005-06-27 02:45:50 +04:00
|
|
|
const char *ksym2name(int);
|
2005-01-19 23:37:52 +03:00
|
|
|
keysym_t ksym_upcase(keysym_t);
|
|
|
|
void keyboard_get_values(int);
|
|
|
|
void keyboard_put_values(int);
|
|
|
|
void mouse_get_values(int);
|
|
|
|
void mouse_put_values(int);
|
|
|
|
void display_get_values(int);
|
|
|
|
void display_put_values(int);
|
2001-02-05 00:16:59 +03:00
|
|
|
#ifndef YYEMPTY
|
2005-01-19 23:37:52 +03:00
|
|
|
int yyparse(void);
|
2001-02-05 00:16:59 +03:00
|
|
|
#endif
|
2005-01-19 23:37:52 +03:00
|
|
|
int yylex(void);
|
|
|
|
void map_scan_setinput(char *);
|