Mouse driver and AxWin
[tpg/acess2.git] / Kernel / include / tpl_drv_joystick.h
index d521207..3ba441a 100644 (file)
@@ -28,7 +28,7 @@
  */\r
 enum eTplJoystick_IOCtl {\r
        /**\r
-        * ioctl(..., struct{int Ident;tKeybardCallback *Callback})\r
+        * ioctl(..., tJoystickCallback *Callback)\r
         * \brief Sets the callback\r
         * \note Can be called from kernel mode only\r
         *\r
@@ -39,22 +39,56 @@ enum eTplJoystick_IOCtl {
        JOY_IOCTL_SETCALLBACK = 4,\r
 \r
        /**\r
-        * ioctl(..., struct{int AxisNum;int Value})\r
+        * ioctl(..., int *Argument)\r
+        * \brief Set the argument passed as the first parameter to the callback\r
+        * \note Kernel mode only\r
+        */\r
+       JOY_IOCTL_SETCALLBACKARG,\r
+\r
+       /**\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set maximum value for sJoystick_Axis.CurState\r
+        * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
+        */\r
+       JOY_IOCTL_GETSETAXISLIMIT,\r
+\r
+       /**\r
+        * ioctl(..., tJoystickNumValue *)\r
+        * \brief Set the value of sJoystick_Axis.CurState\r
+        * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
-       JOY_IOCTL_SETAXISLIMIT,\r
+       JOY_IOCTL_GETSETAXISPOSITION,\r
        \r
        /**\r
-        * ioctl(..., struct{int AxisNum;int Value})\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set axis flags\r
+        * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
-       JOY_IOCTL_SETAXISFLAGS,\r
+       JOY_IOCTL_GETSETAXISFLAGS,\r
 \r
        /**\r
-        * ioctl(..., struct{int ButtonNum;int Value})\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set Button Flags\r
+        * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
-       JOY_IOCTL_SETBUTTONFLAGS,\r
+       JOY_IOCTL_GETSETBUTTONFLAGS,\r
+};\r
+\r
+#define        DRV_JOY_IOCTLNAMES      "set_callback", "set_callback_arg", "getset_axis_limit", "getset_axis_position", \\r
+       "getset_axis_flags", "getset_button_flags"\r
+\r
+// === TYPES ===\r
+typedef struct sJoystick_NumValue      tJoystick_NumValue;\r
+typedef struct sJoystick_FileHeader    tJoystick_FileHeader;\r
+typedef struct sJoystick_Axis  tJoystick_Axis;\r
+\r
+/**\r
+ * \brief Number/Value pair for joystick IOCtls\r
+ */\r
+struct sJoystick_NumValue\r
+{\r
+        int    Num;    //!< Axis/Button number\r
+        int    Value;  //!< Value (see IOCtl defs for meaning)\r
 };\r
 \r
 /**\r
@@ -62,23 +96,31 @@ enum eTplJoystick_IOCtl {
  * \param Ident        Ident value passed to JOY_IOCTL_SETCALLBACK\r
  * \r
  */\r
-typedef void (*tJoystickCallback)(int Ident, int bIsAxis, int Num, int Delta);\r
+typedef void (*tJoystick_Callback)(int Ident, int bIsAxis, int Num, int Delta);\r
 \r
 /**\r
  * \struct sJoystick_FileHeader\r
  */\r
 struct sJoystick_FileHeader\r
 {\r
-       Uint16  NAxies;\r
-       Uint16  NButtons;\r
+       Uint16  NAxies; //!< Number of Axies\r
+       Uint16  NButtons;       //!< Number of buttons\r
 };\r
 \r
+/**\r
+ * \brief Axis Definition in file data\r
+ *\r
+ * Describes the current state of an axis on the joystick.\r
+ * \a MinValue and \a MaxValue describe the valid range for \a CurValue\r
+ * While \a CurState is between zero and the current limit set by the\r
+ * JOY_IOCTL_GETSETAXISLIMIT IOCtl.\r
+ */\r
 struct sJoystick_Axis\r
 {\r
-       Sint16  MinValue;\r
-       Sint16  MaxValue;\r
-       Sint16  CurValue;\r
-       Uint16  CurState;\r
+       Sint16  MinValue;       //!< Minumum value for \a CurValue\r
+       Sint16  MaxValue;       //!< Maximum value for \a CurValue\r
+       Sint16  CurValue;       //!< Current value (joystick position)\r
+       Uint16  CurState;       //!< Current state (cursor position)\r
 };\r
 \r
 #endif\r

UCC git Repository :: git.ucc.asn.au