+\r
+/* -- JOYSTICK-SPECIFIC STRUCTURES AND TYPES ------------------------------- */\r
+/*\r
+ * Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c"\r
+ * interspersed\r
+ */\r
+\r
+#if TARGET_HOST_MACINTOSH\r
+# include <InputSprocket.h>\r
+#endif\r
+\r
+#if TARGET_HOST_MAC_OSX\r
+# include <mach/mach.h>\r
+# include <IOKit/IOkitLib.h>\r
+# include <IOKit/hid/IOHIDLib.h>\r
+#endif\r
+\r
+/* XXX It might be better to poll the operating system for the numbers of buttons and\r
+ * XXX axes and then dynamically allocate the arrays.\r
+ */\r
+#define _JS_MAX_BUTTONS 32\r
+\r
+#if TARGET_HOST_MACINTOSH\r
+# define _JS_MAX_AXES 9\r
+typedef struct tagSFG_PlatformJoystick SFG_PlatformJoystick;\r
+struct tagSFG_PlatformJoystick\r
+{\r
+#define ISP_NUM_AXIS 9\r
+#define ISP_NUM_NEEDS 41\r
+ ISpElementReference isp_elem [ ISP_NUM_NEEDS ];\r
+ ISpNeed isp_needs [ ISP_NUM_NEEDS ];\r
+};\r
+#endif\r
+\r
+#if TARGET_HOST_MAC_OSX\r
+# define _JS_MAX_AXES 16\r
+typedef struct tagSFG_PlatformJoystick SFG_PlatformJoystick;\r
+struct tagSFG_PlatformJoystick\r
+{\r
+ IOHIDDeviceInterface ** hidDev;\r
+ IOHIDElementCookie buttonCookies[41];\r
+ IOHIDElementCookie axisCookies[_JS_MAX_AXES];\r
+/* The next two variables are not used anywhere */\r
+/* long minReport[_JS_MAX_AXES],\r
+ * maxReport[_JS_MAX_AXES];\r
+ */\r
+};\r
+#endif\r
+\r
+\r
+/*\r
+ * Definition of "SFG_Joystick" structure -- based on JS's "jsJoystick" object class.\r
+ * See "js.h" lines 80-178.\r
+ */\r
+typedef struct tagSFG_Joystick SFG_Joystick;\r
+struct tagSFG_Joystick\r
+{\r
+ SFG_PlatformJoystick pJoystick;\r
+\r
+ int id;\r
+ GLboolean error;\r
+ char name [ 128 ];\r
+ int num_axes;\r
+ int num_buttons;\r
+\r
+ float dead_band[ _JS_MAX_AXES ];\r
+ float saturate [ _JS_MAX_AXES ];\r
+ float center [ _JS_MAX_AXES ];\r
+ float max [ _JS_MAX_AXES ];\r
+ float min [ _JS_MAX_AXES ];\r
+};\r
+\r
+\r
+\r