1 /* 2 * Copyright 2008, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Fredrik Modeen 7 */ 8 9 #include "joystick_driver.h" 10 11 #include <List.h> 12 #include <Entry.h> 13 14 #define DEVICEPATH "/dev/joystick/" 15 #define JOYSTICKPATH "/boot/home/config/settings/joysticks/" 16 17 class BJoystick; 18 19 struct _joystick_info; 20 21 class _BJoystickTweaker { 22 23 public: 24 _BJoystickTweaker(); 25 _BJoystickTweaker(BJoystick &stick); 26 virtual ~_BJoystickTweaker(); 27 status_t SendIOCT(uint32 op); 28 status_t GetInfo(_joystick_info* info, const char * ref); 29 30 // BeOS R5's joystick pref need these 31 status_t save_config(const entry_ref * ref = NULL); 32 void scan_including_disabled(); 33 status_t get_info(); 34 35 private: 36 void _BuildFromJoystickDesc(char *string, _joystick_info* info); 37 status_t _ScanIncludingDisabled(const char* rootPath, BList *list, 38 BEntry *rootEntry = NULL); 39 40 void _EmpyList(BList *list); 41 BJoystick* fJoystick; 42 #if DEBUG 43 public: 44 static FILE *sLogFile; 45 #endif 46 }; 47