|
|
1.1.1.2 ! root 1: /* $Id: serial-ms.h,v 1.3 2006/09/30 12:35:01 fredette Exp $ */ 1.1 root 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> 1.1.1.2 ! root 41: _TME_RCSID("$Id: serial-ms.h,v 1.3 2006/09/30 12:35:01 fredette Exp $"); 1.1 root 42: 43: /* includes: */ 44: #include <tme/generic/mouse.h> 45: #include <tme/generic/serial.h> 46: #include <tme/element.h> 1.1.1.2 ! root 47: #include <tme/threads.h> 1.1 root 48: 49: /* macros: */ 50: 51: /* the callout flags: */ 52: #define TME_SERIAL_MS_CALLOUT_CHECK (0) 53: #define TME_SERIAL_MS_CALLOUT_RUNNING TME_BIT(0) 54: #define TME_SERIAL_MS_CALLOUTS_MASK (-2) 55: #define TME_SERIAL_MS_CALLOUT_SERIAL_CTRL TME_BIT(1) 56: #define TME_SERIAL_MS_CALLOUT_SERIAL_CONFIG TME_BIT(2) 57: #define TME_SERIAL_MS_CALLOUT_SERIAL_READ TME_BIT(3) 58: #define TME_SERIAL_MS_CALLOUT_MOUSE_CTRL TME_BIT(4) 59: #define TME_SERIAL_MS_CALLOUT_MOUSE_READ TME_BIT(5) 60: 61: /* types: */ 62: 63: /* a serial mouse: */ 64: struct tme_serial_ms { 65: 66: /* backpointer to our element: */ 67: struct tme_element *tme_serial_ms_element; 68: 69: /* our mutex: */ 70: tme_mutex_t tme_serial_ms_mutex; 71: 72: /* our type: */ 73: _tme_const char *tme_serial_ms_type; 74: 75: /* our type-specific state: */ 76: void *tme_serial_ms_type_state; 77: 78: /* our type-specific event function: */ 79: int (*tme_serial_ms_type_events) _TME_P((struct tme_serial_ms *, 80: _tme_const struct tme_mouse_event *, 81: unsigned int)); 82: 83: /* our type-specific serial control function: */ 84: int (*tme_serial_ms_type_serial_ctrl) _TME_P((struct tme_serial_ms *, 85: unsigned int)); 86: 87: /* our type-specific serial input function: */ 88: int (*tme_serial_ms_type_serial_input) _TME_P((struct tme_serial_ms *, 89: tme_uint8_t *, 90: unsigned int, 91: tme_serial_data_flags_t)); 92: 93: /* our type-specific serial configuration: */ 94: struct tme_serial_config tme_serial_ms_type_config; 95: 96: /* the serial configuration from our serial connection: */ 97: struct tme_serial_config tme_serial_ms_peer_config; 98: 99: /* our mouse connection: */ 100: struct tme_mouse_connection *tme_serial_ms_connection_ms; 101: 102: /* our serial connection: */ 103: struct tme_serial_connection *tme_serial_ms_connection_serial; 104: 105: /* the callout flags: */ 106: int tme_serial_ms_callout_flags; 107: 108: /* our serial output buffer: */ 109: struct tme_serial_buffer tme_serial_ms_serial_buffer; 110: 111: /* our current mouse control outputs: */ 112: unsigned int tme_serial_ms_mouse_ctrl; 113: 114: /* our current serial control outputs: */ 115: unsigned int tme_serial_ms_serial_ctrl; 116: }; 117: 118: /* prototypes: */ 119: int _tme_serial_ms_mssystems5_init _TME_P((struct tme_serial_ms *)); 120: 121: #endif /* !_SERIAL_SERIAL_MS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.