1 /* 2 * Copyright 2004-2008, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stefano Ceccherini 7 */ 8 #ifndef MOUSE_INPUT_DEVICE_H 9 #define MOUSE_INPUT_DEVICE_H 10 11 12 #include <InputServerDevice.h> 13 #include <InterfaceDefs.h> 14 #include <Locker.h> 15 16 #include <ObjectList.h> 17 18 19 class MouseDevice; 20 21 class MouseInputDevice : public BInputServerDevice { 22 public: 23 MouseInputDevice(); 24 virtual ~MouseInputDevice(); 25 26 virtual status_t InitCheck(); 27 28 virtual status_t Start(const char* name, void* cookie); 29 virtual status_t Stop(const char* name, void* cookie); 30 31 virtual status_t Control(const char* name, void* cookie, 32 uint32 command, BMessage* message); 33 34 private: 35 friend class MouseDevice; 36 // TODO: needed by the control thread to remove a dead device 37 // find a better way... 38 39 status_t _HandleMonitor(BMessage* message); 40 void _RecursiveScan(const char* directory); 41 42 MouseDevice* _FindDevice(const char* path) const; 43 status_t _AddDevice(const char* path); 44 status_t _RemoveDevice(const char* path); 45 46 private: 47 BObjectList<MouseDevice> fDevices; 48 BLocker fDeviceListLock; 49 }; 50 51 extern "C" BInputServerDevice* instantiate_input_device(); 52 53 #endif // MOUSE_INPUT_DEVICE_H 54