1 /* $NetBSD: wsmoused.h,v 1.1 2002/06/26 23:13:11 christos Exp $ */ 2 3 /* 4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Julio Merino. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. The name authors may not be used to endorse or promote products 16 * derived from this software without specific prior written 17 * permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS 20 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _WSMOUSED_WSMOUSED_H 33 #define _WSMOUSED_WSMOUSED_H 34 35 struct mouse { 36 /* File descriptors and names */ 37 int fd; 38 int tty_fd; 39 int stat_fd; 40 int fifo_fd; 41 char *device_name; 42 char *fifo_name; 43 44 /* Screen coordinates */ 45 size_t row, col; 46 size_t max_row, max_col; 47 48 /* Movement information */ 49 size_t slowdown_x, slowdown_y; 50 size_t count_row, count_col; 51 52 int cursor; 53 int selecting; 54 int disabled; 55 }; 56 57 /* Prototypes for wsmoused.c */ 58 void char_invert(struct mouse *, size_t, size_t); 59 void mouse_cursor_show(struct mouse *); 60 void mouse_cursor_hide(struct mouse *); 61 void mouse_open_tty(struct mouse *, int); 62 63 /* Prototypes for event.c */ 64 void mouse_motion_event(struct mouse *, struct wscons_event *); 65 void mouse_button_event(struct mouse *, struct wscons_event *); 66 void screen_event(struct mouse *, struct wscons_event *); 67 68 /* Prototypes for selection.c */ 69 void mouse_sel_init(void); 70 void mouse_sel_start(struct mouse *); 71 void mouse_sel_end(struct mouse *); 72 void mouse_sel_calculate(struct mouse *); 73 void mouse_sel_hide(struct mouse *); 74 void mouse_sel_show(struct mouse *); 75 void mouse_sel_paste(struct mouse *); 76 77 #endif /* _WSMOUSED_WSMOUSED_H */ 78