|
|
1.1 ! root 1: /* $Id: serial-ms.h,v 1.2 2003/08/05 03:37:39 fredette Exp $ */ ! 2: ! 3: /* serial/serial-ms.h - implementation header file for serial mouse ! 4: emulation: */ ! 5: ! 6: /* ! 7: * Copyright (c) 2003 Matt Fredette ! 8: * All rights reserved. ! 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. Redistributions in binary form must reproduce the above copyright ! 16: * notice, this list of conditions and the following disclaimer in the ! 17: * documentation and/or other materials provided with the distribution. ! 18: * 3. All advertising materials mentioning features or use of this software ! 19: * must display the following acknowledgement: ! 20: * This product includes software developed by Matt Fredette. ! 21: * 4. The name of the author may not be used to endorse or promote products ! 22: * derived from this software without specific prior written permission. ! 23: * ! 24: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ! 25: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ! 26: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! 27: * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, ! 28: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ! 29: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ! 30: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! 31: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ! 32: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ! 33: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! 34: * POSSIBILITY OF SUCH DAMAGE. ! 35: */ ! 36: ! 37: #ifndef _SERIAL_SERIAL_MS_H ! 38: #define _SERIAL_SERIAL_MS_H ! 39: ! 40: #include <tme/common.h> ! 41: _TME_RCSID("$Id: serial-ms.h,v 1.2 2003/08/05 03:37:39 fredette Exp $"); ! 42: ! 43: /* includes: */ ! 44: #include <tme/generic/mouse.h> ! 45: #include <tme/generic/serial.h> ! 46: #include <tme/element.h> ! 47: ! 48: /* macros: */ ! 49: ! 50: /* the callout flags: */ ! 51: #define TME_SERIAL_MS_CALLOUT_CHECK (0) ! 52: #define TME_SERIAL_MS_CALLOUT_RUNNING TME_BIT(0) ! 53: #define TME_SERIAL_MS_CALLOUTS_MASK (-2) ! 54: #define TME_SERIAL_MS_CALLOUT_SERIAL_CTRL TME_BIT(1) ! 55: #define TME_SERIAL_MS_CALLOUT_SERIAL_CONFIG TME_BIT(2) ! 56: #define TME_SERIAL_MS_CALLOUT_SERIAL_READ TME_BIT(3) ! 57: #define TME_SERIAL_MS_CALLOUT_MOUSE_CTRL TME_BIT(4) ! 58: #define TME_SERIAL_MS_CALLOUT_MOUSE_READ TME_BIT(5) ! 59: ! 60: /* types: */ ! 61: ! 62: /* a serial mouse: */ ! 63: struct tme_serial_ms { ! 64: ! 65: /* backpointer to our element: */ ! 66: struct tme_element *tme_serial_ms_element; ! 67: ! 68: /* our mutex: */ ! 69: tme_mutex_t tme_serial_ms_mutex; ! 70: ! 71: /* our type: */ ! 72: _tme_const char *tme_serial_ms_type; ! 73: ! 74: /* our type-specific state: */ ! 75: void *tme_serial_ms_type_state; ! 76: ! 77: /* our type-specific event function: */ ! 78: int (*tme_serial_ms_type_events) _TME_P((struct tme_serial_ms *, ! 79: _tme_const struct tme_mouse_event *, ! 80: unsigned int)); ! 81: ! 82: /* our type-specific serial control function: */ ! 83: int (*tme_serial_ms_type_serial_ctrl) _TME_P((struct tme_serial_ms *, ! 84: unsigned int)); ! 85: ! 86: /* our type-specific serial input function: */ ! 87: int (*tme_serial_ms_type_serial_input) _TME_P((struct tme_serial_ms *, ! 88: tme_uint8_t *, ! 89: unsigned int, ! 90: tme_serial_data_flags_t)); ! 91: ! 92: /* our type-specific serial configuration: */ ! 93: struct tme_serial_config tme_serial_ms_type_config; ! 94: ! 95: /* the serial configuration from our serial connection: */ ! 96: struct tme_serial_config tme_serial_ms_peer_config; ! 97: ! 98: /* our mouse connection: */ ! 99: struct tme_mouse_connection *tme_serial_ms_connection_ms; ! 100: ! 101: /* our serial connection: */ ! 102: struct tme_serial_connection *tme_serial_ms_connection_serial; ! 103: ! 104: /* the callout flags: */ ! 105: int tme_serial_ms_callout_flags; ! 106: ! 107: /* our serial output buffer: */ ! 108: struct tme_serial_buffer tme_serial_ms_serial_buffer; ! 109: ! 110: /* our current mouse control outputs: */ ! 111: unsigned int tme_serial_ms_mouse_ctrl; ! 112: ! 113: /* our current serial control outputs: */ ! 114: unsigned int tme_serial_ms_serial_ctrl; ! 115: }; ! 116: ! 117: /* prototypes: */ ! 118: int _tme_serial_ms_mssystems5_init _TME_P((struct tme_serial_ms *)); ! 119: ! 120: #endif /* !_SERIAL_SERIAL_MS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.