summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/mouse/mouse_parser.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-03-14 14:56:08 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-03-14 14:56:08 +0000
commit3d6c1bb6b428b9735d6dd84a847abe94e9274bd2 (patch)
tree55548176f095055dd1d68ae8b29953b884b4c00b /cpukit/libmisc/mouse/mouse_parser.h
parent2011-03-14 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-3d6c1bb6b428b9735d6dd84a847abe94e9274bd2.tar.bz2
2011-03-14 Joel Sherrill <joel.sherrill@oarcorp.com>
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.
Diffstat (limited to 'cpukit/libmisc/mouse/mouse_parser.h')
-rw-r--r--cpukit/libmisc/mouse/mouse_parser.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/cpukit/libmisc/mouse/mouse_parser.h b/cpukit/libmisc/mouse/mouse_parser.h
new file mode 100644
index 0000000000..59b6abb2f3
--- /dev/null
+++ b/cpukit/libmisc/mouse/mouse_parser.h
@@ -0,0 +1,108 @@
+/*
+ * This file is the header file for the Mouse Parser Engine which
+ * is derived from a UNIX Serial Port Mouse Driver with the following
+ * notice:
+ *
+ * ==================================================================
+ * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
+ * Portions Copyright (c) 1991 David I. Bell
+ * Permission is granted to use, distribute, or modify this source,
+ * provided that this copyright notice remains intact.
+ *
+ * UNIX Serial Port Mouse Driver
+ *
+ * This driver opens a serial port directly, and interprets serial data.
+ * Microsoft, PC, Logitech and PS/2 mice are supported. The PS/2 mouse
+ * is only supported if the OS runs the mouse byte codes through the
+ * serial port.
+ *
+ * Mouse Types Supported: pc ms, logi, ps2
+ * ==================================================================
+ *
+ * It has been modified to support the concept of being just a parser
+ * fed data from an arbitrary source. It is independent of either
+ * a PS/2 driver or a serial port.
+ *
+ * It was moved to cpukit/libmisc/mouse by Joel Sherrill.
+ *
+ * $Id$
+ */
+
+#ifndef __MOUSE_PARSER_h__
+#define __MOUSE_PARSER_h__
+
+#include <rtems/mw_uid.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * This is the mask for the right button.
+ *
+ * @note Use the same definitions as the user interface.
+ */
+#define RBUTTON MV_BUTTON_RIGHT
+
+/**
+ * This is the mask for the center button.
+ *
+ * @note Use the same definitions as the user interface.
+ */
+#define MBUTTON MV_BUTTON_CENTER
+
+/**
+ * This is the mask for the left button.
+ *
+ * @note Use the same definitions as the user interface.
+ */
+#define LBUTTON MV_BUTTON_LEFT
+
+/**
+ * This type is the device coordinates.
+ */
+typedef int COORD;
+
+/**
+ * This type is the mouse button mask.
+ */
+typedef unsigned int BUTTON;
+
+/**
+ * This type defines a pointer to the enqueue method. It is
+ * available since some device drivers keep pointers to the method
+ * to know when to enqueue or not.
+ */
+typedef void (*mouse_parser_enqueue_handler)(unsigned char *, size_t);
+
+/**
+ * @brief Initialize the Mouse Parser Engine
+ *
+ * This method initializes the Mouse Parser Engine for the mouse
+ * of @a type. The @a type should be one of the following strings:
+ * pc ms, logi, ps2.
+ *
+ * @a param[in] type indicates the type of mouse.
+ *
+ * @return This method returns 0 on success and -1 on error.
+ */
+int mouse_parser_initialize(const char *type);
+
+/**
+ * @brief Enqueue Input to the Mouse Parser Engine
+ *
+ * This method is used to pass mouse input to the Mouse Parser Engine.
+ *
+ * @a param[in] buffer is the data to enqueue
+ * @a param[in] size is the amount of data to enqueue
+ */
+void mouse_parser_enqueue(
+ unsigned char *buffer,
+ size_t size
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif