2008-08-03 22:29:21 +04:00
|
|
|
/*
|
2008-08-11 20:45:26 +04:00
|
|
|
* Copyright 2008, Haiku, Inc.
|
2008-08-03 22:29:21 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
2008-08-11 20:45:26 +04:00
|
|
|
* Fredrik Modeen
|
2008-08-03 22:29:21 +04:00
|
|
|
*/
|
2008-08-11 20:45:26 +04:00
|
|
|
|
2008-08-03 22:29:21 +04:00
|
|
|
#include "joystick_driver.h"
|
2008-08-11 20:45:26 +04:00
|
|
|
|
2008-08-03 22:29:21 +04:00
|
|
|
#include <List.h>
|
|
|
|
#include <Entry.h>
|
|
|
|
|
|
|
|
#define DEVICEPATH "/dev/joystick/"
|
|
|
|
#define JOYSTICKPATH "/boot/home/config/settings/joysticks/"
|
|
|
|
|
|
|
|
class BJoystick;
|
|
|
|
|
|
|
|
struct _joystick_info;
|
|
|
|
|
|
|
|
class _BJoystickTweaker {
|
|
|
|
|
|
|
|
public:
|
|
|
|
_BJoystickTweaker();
|
|
|
|
_BJoystickTweaker(BJoystick &stick);
|
2008-08-23 15:16:14 +04:00
|
|
|
virtual ~_BJoystickTweaker();
|
2008-08-03 22:29:21 +04:00
|
|
|
status_t SendIOCT(uint32 op);
|
2008-08-23 15:16:14 +04:00
|
|
|
status_t GetInfo(_joystick_info* info, const char * ref);
|
|
|
|
|
|
|
|
// BeOS R5's joystick pref need these
|
2008-08-03 22:29:21 +04:00
|
|
|
status_t save_config(const entry_ref * ref = NULL);
|
2008-08-23 15:16:14 +04:00
|
|
|
void scan_including_disabled();
|
2008-08-03 22:29:21 +04:00
|
|
|
status_t get_info();
|
2008-08-23 15:16:14 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _BuildFromJoystickDesc(char *string, _joystick_info* info);
|
|
|
|
status_t _ScanIncludingDisabled(const char* rootPath, BList *list,
|
|
|
|
BEntry *rootEntry = NULL);
|
|
|
|
|
|
|
|
void _EmpyList(BList *list);
|
|
|
|
BJoystick* fJoystick;
|
2008-08-11 20:45:26 +04:00
|
|
|
#if DEBUG
|
2008-08-03 22:29:21 +04:00
|
|
|
public:
|
|
|
|
static FILE *sLogFile;
|
2008-08-11 20:45:26 +04:00
|
|
|
#endif
|
2008-08-03 22:29:21 +04:00
|
|
|
};
|