source: rtems/cpukit/libmisc/mouse/mouse_parser.h @ 3d6c1bb

4.11
Last change on this file since 3d6c1bb was 3d6c1bb, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 14, 2011 at 2:56:08 PM

2011-03-14 Joel Sherrill <joel.sherrill@…>

PR 1762/cpukit

  • Makefile.am, preinstall.am, libmisc/Makefile.am, wrapup/Makefile.am: Add generic serial mouse driver and mouse parser. The parser code was in the pc386 BSP but was generic so cleaned up and placed here. Serial mouse driver itself is new.
  • libmisc/mouse/README, libmisc/mouse/mouse_parser.c, libmisc/mouse/mouse_parser.h, libmisc/mouse/serial_mouse.c, libmisc/mouse/serial_mouse.h: New files.
  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 * This file is the header file for the Mouse Parser Engine which
3 * is derived from a UNIX Serial Port Mouse Driver with the following
4 * notice:
5 *
6 * ==================================================================
7 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
8 * Portions Copyright (c) 1991 David I. Bell
9 * Permission is granted to use, distribute, or modify this source,
10 * provided that this copyright notice remains intact.
11 *
12 * UNIX Serial Port Mouse Driver
13 *
14 * This driver opens a serial port directly, and interprets serial data.
15 * Microsoft, PC, Logitech and PS/2 mice are supported.  The PS/2 mouse
16 * is only supported if the OS runs the mouse byte codes through the
17 * serial port.
18 *
19 * Mouse Types Supported: pc  ms, logi, ps2
20 * ==================================================================
21 *
22 * It has been modified to support the concept of being just a parser
23 * fed data from an arbitrary source.  It is independent of either
24 * a PS/2 driver or a serial port.
25 *
26 * It was moved to cpukit/libmisc/mouse by Joel Sherrill.
27 *
28 * $Id$
29 */
30
31#ifndef __MOUSE_PARSER_h__
32#define __MOUSE_PARSER_h__
33
34#include <rtems/mw_uid.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/**
41 *  This is the mask for the right button.
42 *
43 *  @note Use the same definitions as the user interface.
44 */
45#define RBUTTON      MV_BUTTON_RIGHT
46
47/**
48 * This is the mask for the center button.
49 *
50 *  @note Use the same definitions as the user interface.
51 */
52#define MBUTTON      MV_BUTTON_CENTER
53
54/**
55 *  This is the mask for the left button.
56 *
57 *  @note Use the same definitions as the user interface.
58 */
59#define LBUTTON      MV_BUTTON_LEFT
60
61/**
62 *  This type is the device coordinates.
63 */
64typedef int           COORD;
65
66/**
67 *  This type is the mouse button mask.
68 */
69typedef unsigned int  BUTTON;
70
71/**
72 *  This type defines a pointer to the enqueue method.  It is
73 *  available since some device drivers keep pointers to the method
74 *  to know when to enqueue or not.
75 */
76typedef void (*mouse_parser_enqueue_handler)(unsigned char *, size_t);
77
78/**
79 *  @brief Initialize the Mouse Parser Engine
80 *
81 *  This method initializes the Mouse Parser Engine for the mouse
82 *  of @a type. The @a type should be one of the following strings:
83 *  pc  ms, logi, ps2.
84 *
85 *  @a param[in] type indicates the type of mouse.
86 *
87 *  @return This method returns 0 on success and -1 on error.
88 */
89int mouse_parser_initialize(const char *type);
90
91/**
92 *  @brief Enqueue Input to the Mouse Parser Engine
93 *
94 *  This method is used to pass mouse input to the Mouse Parser Engine.
95 *
96 *  @a param[in] buffer is the data to enqueue
97 *  @a param[in] size is the amount of data to enqueue
98 */
99void mouse_parser_enqueue(
100  unsigned char *buffer,
101  size_t         size
102);
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif
Note: See TracBrowser for help on using the repository browser.