xref: /netbsd/sys/dev/wscons/wsemulvar.h (revision 82229420)
1*82229420Smacallan /* $NetBSD: wsemulvar.h,v 1.16 2017/05/19 19:22:33 macallan Exp $ */
2b31e6386Sdrochner 
3b31e6386Sdrochner /*
4b31e6386Sdrochner  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
5b31e6386Sdrochner  *
6b31e6386Sdrochner  * Redistribution and use in source and binary forms, with or without
7b31e6386Sdrochner  * modification, are permitted provided that the following conditions
8b31e6386Sdrochner  * are met:
9b31e6386Sdrochner  * 1. Redistributions of source code must retain the above copyright
10b31e6386Sdrochner  *    notice, this list of conditions and the following disclaimer.
11b31e6386Sdrochner  * 2. Redistributions in binary form must reproduce the above copyright
12b31e6386Sdrochner  *    notice, this list of conditions and the following disclaimer in the
13b31e6386Sdrochner  *    documentation and/or other materials provided with the distribution.
14b31e6386Sdrochner  * 3. All advertising materials mentioning features or use of this software
15b31e6386Sdrochner  *    must display the following acknowledgement:
16b31e6386Sdrochner  *      This product includes software developed by Christopher G. Demetriou
17b31e6386Sdrochner  *	for the NetBSD Project.
18b31e6386Sdrochner  * 4. The name of the author may not be used to endorse or promote products
19b31e6386Sdrochner  *    derived from this software without specific prior written permission
20b31e6386Sdrochner  *
21b31e6386Sdrochner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22b31e6386Sdrochner  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23b31e6386Sdrochner  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24b31e6386Sdrochner  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25b31e6386Sdrochner  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26b31e6386Sdrochner  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27b31e6386Sdrochner  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28b31e6386Sdrochner  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29b31e6386Sdrochner  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30b31e6386Sdrochner  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31b31e6386Sdrochner  */
32b31e6386Sdrochner 
33b31e6386Sdrochner struct wsdisplay_emulops;
34b31e6386Sdrochner 
352bfadc6aSdrochner enum wsemul_resetops {
362bfadc6aSdrochner 	WSEMUL_RESET,
37b69b2fd8Sdrochner 	WSEMUL_SYNCFONT,
38b69b2fd8Sdrochner 	WSEMUL_CLEARSCREEN
392bfadc6aSdrochner };
402bfadc6aSdrochner 
41b31e6386Sdrochner struct wsemul_ops {
42b31e6386Sdrochner 	const char *name;
43b31e6386Sdrochner 
4482e5e6abSaugustss 	void	*(*cnattach)(const struct wsscreen_descr *, void *,
4582e5e6abSaugustss 				  int, int, long);
4682e5e6abSaugustss 	void	*(*attach)(int console, const struct wsscreen_descr *, void *,
4782e5e6abSaugustss 				int, int, void *, long);
4885e327e2Speter 	void	(*output)(void *, const u_char *, u_int, int);
49f90bcf3aSchristos 	int	(*translate)(void *, keysym_t, const char **);
5085e327e2Speter 	void	(*detach)(void *, u_int *, u_int *);
5182e5e6abSaugustss 	void    (*reset)(void *, enum wsemul_resetops);
5292f81ea7Sjmmv 	void	(*getmsgattrs)(void *, struct wsdisplay_msgattrs *);
5392f81ea7Sjmmv 	void	(*setmsgattrs)(void *, const struct wsscreen_descr *,
5492f81ea7Sjmmv 		               const struct wsdisplay_msgattrs *);
55*82229420Smacallan 	void	(*resize)(void *, const struct wsscreen_descr *);
56b31e6386Sdrochner };
57b31e6386Sdrochner 
58c13e3a66Smrg #if defined(_KERNEL_OPT)
59085787ddSthorpej #include "opt_wsemul.h"
60085787ddSthorpej #endif
61085787ddSthorpej 
62b31e6386Sdrochner #ifndef WSEMUL_NO_DUMB
63b31e6386Sdrochner extern const struct wsemul_ops wsemul_dumb_ops;
64b31e6386Sdrochner #endif
65b31e6386Sdrochner #ifdef WSEMUL_SUN
66b31e6386Sdrochner extern const struct wsemul_ops wsemul_sun_ops;
67b31e6386Sdrochner #endif
68bd3b88b6Sdrochner #ifdef WSEMUL_VT100
69bd3b88b6Sdrochner extern const struct wsemul_ops wsemul_vt100_ops;
70bd3b88b6Sdrochner #endif
71b31e6386Sdrochner 
7282e5e6abSaugustss const struct wsemul_ops *wsemul_pick(const char *);
731921d00aSdrochner void wsemul_drop(const struct wsemul_ops *);
741921d00aSdrochner int wsemul_add(const struct wsemul_ops *);
751921d00aSdrochner int wsemul_remove(const struct wsemul_ops *);
76b31e6386Sdrochner 
77b31e6386Sdrochner /*
78b31e6386Sdrochner  * Callbacks from the emulation code to the display interface driver.
79b31e6386Sdrochner  */
8085e327e2Speter void	wsdisplay_emulbell(void *);
8185e327e2Speter void	wsdisplay_emulinput(void *, const u_char *, u_int);
82