Home | History | Annotate | Line # | Download | only in wsmoused
wsmoused.h revision 1.2
      1 /* $NetBSD: wsmoused.h,v 1.2 2002/12/25 19:13:53 jmmv 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 	/* Button configuration */
     57 	int but_select;
     58 	int but_paste;
     59 };
     60 
     61 /* Prototypes for wsmoused.c */
     62 void char_invert(struct mouse *, size_t, size_t);
     63 void mouse_cursor_show(struct mouse *);
     64 void mouse_cursor_hide(struct mouse *);
     65 void mouse_open_tty(struct mouse *, int);
     66 
     67 /* Prototypes for event.c */
     68 void mouse_motion_event(struct mouse *, struct wscons_event *);
     69 void mouse_button_event(struct mouse *, struct wscons_event *);
     70 void screen_event(struct mouse *, struct wscons_event *);
     71 
     72 /* Prototypes for selection.c */
     73 void mouse_sel_init(void);
     74 void mouse_sel_start(struct mouse *);
     75 void mouse_sel_end(struct mouse *);
     76 void mouse_sel_calculate(struct mouse *);
     77 void mouse_sel_hide(struct mouse *);
     78 void mouse_sel_show(struct mouse *);
     79 void mouse_sel_paste(struct mouse *);
     80 
     81 #endif /* _WSMOUSED_WSMOUSED_H */
     82