xref: /openbsd-src/lib/libcurses/tty/tty_input.h (revision 81d8c4e1e65ef590376b5b08744af794c42bd575)
1*81d8c4e1Snicm /* $OpenBSD: tty_input.h,v 1.3 2010/01/12 23:22:07 nicm Exp $ */
292dd1ec0Smillert 
392dd1ec0Smillert /****************************************************************************
484af20ceSmillert  * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
592dd1ec0Smillert  *                                                                          *
692dd1ec0Smillert  * Permission is hereby granted, free of charge, to any person obtaining a  *
792dd1ec0Smillert  * copy of this software and associated documentation files (the            *
892dd1ec0Smillert  * "Software"), to deal in the Software without restriction, including      *
992dd1ec0Smillert  * without limitation the rights to use, copy, modify, merge, publish,      *
1092dd1ec0Smillert  * distribute, distribute with modifications, sublicense, and/or sell       *
1192dd1ec0Smillert  * copies of the Software, and to permit persons to whom the Software is    *
1292dd1ec0Smillert  * furnished to do so, subject to the following conditions:                 *
1392dd1ec0Smillert  *                                                                          *
1492dd1ec0Smillert  * The above copyright notice and this permission notice shall be included  *
1592dd1ec0Smillert  * in all copies or substantial portions of the Software.                   *
1692dd1ec0Smillert  *                                                                          *
1792dd1ec0Smillert  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1892dd1ec0Smillert  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1992dd1ec0Smillert  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
2092dd1ec0Smillert  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
2192dd1ec0Smillert  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
2292dd1ec0Smillert  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2392dd1ec0Smillert  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2492dd1ec0Smillert  *                                                                          *
2592dd1ec0Smillert  * Except as contained in this notice, the name(s) of the above copyright   *
2692dd1ec0Smillert  * holders shall not be used in advertising or otherwise to promote the     *
2792dd1ec0Smillert  * sale, use or other dealings in this Software without prior written       *
2892dd1ec0Smillert  * authorization.                                                           *
2992dd1ec0Smillert  ****************************************************************************/
3092dd1ec0Smillert 
3192dd1ec0Smillert /*
32*81d8c4e1Snicm  * $Id: tty_input.h,v 1.3 2010/01/12 23:22:07 nicm Exp $
3392dd1ec0Smillert  */
3492dd1ec0Smillert 
3592dd1ec0Smillert #ifndef TTY_INPUT_H
3692dd1ec0Smillert #define TTY_INPUT_H 1
3792dd1ec0Smillert 
3884af20ceSmillert extern NCURSES_EXPORT(bool) _nc_tty_mouse_mask (mmask_t);
3984af20ceSmillert extern NCURSES_EXPORT(bool) _nc_tty_pending (void);
4084af20ceSmillert extern NCURSES_EXPORT(int)  _nc_tty_next_event (int);
4184af20ceSmillert extern NCURSES_EXPORT(void) _nc_tty_flags_changed (void);
4284af20ceSmillert extern NCURSES_EXPORT(void) _nc_tty_flush (void);
4384af20ceSmillert extern NCURSES_EXPORT(void) _nc_tty_input_resume (void);
4484af20ceSmillert extern NCURSES_EXPORT(void) _nc_tty_input_suspend (void);
4592dd1ec0Smillert 
4692dd1ec0Smillert struct tty_input_data {
4792dd1ec0Smillert 	int             _ifd;           /* input file ptr for screen        */
4892dd1ec0Smillert 	int             _keypad_xmit;   /* current terminal state           */
4992dd1ec0Smillert 	int             _meta_on;       /* current terminal state           */
5092dd1ec0Smillert 
5192dd1ec0Smillert 	/*
5292dd1ec0Smillert 	 * These are the data that support the mouse interface.
5392dd1ec0Smillert 	 */
5492dd1ec0Smillert 	bool            (*_mouse_event) (SCREEN *);
5592dd1ec0Smillert 	bool            (*_mouse_inline)(SCREEN *);
5692dd1ec0Smillert 	bool            (*_mouse_parse) (int);
5792dd1ec0Smillert 	void            (*_mouse_resume)(SCREEN *);
5892dd1ec0Smillert 	void            (*_mouse_wrap)  (SCREEN *);
5992dd1ec0Smillert 	int             _mouse_fd;      /* file-descriptor, if any */
6092dd1ec0Smillert 	int             mousetype;
6192dd1ec0Smillert };
6292dd1ec0Smillert 
6392dd1ec0Smillert #endif /* TTY_INPUT_H */
64