1*1c1f322eSMichael Lotz /* 2*1c1f322eSMichael Lotz * Copyright 2004-2011, Haiku. 3*1c1f322eSMichael Lotz * Distributed under the terms of the MIT License. 4*1c1f322eSMichael Lotz * 5*1c1f322eSMichael Lotz * Authors: 6*1c1f322eSMichael Lotz * Stefano Ceccherini 7*1c1f322eSMichael Lotz * Michael Lotz, mmlr@mlotz.ch 8*1c1f322eSMichael Lotz */ 9*1c1f322eSMichael Lotz #ifndef TABLET_INPUT_DEVICE_H 10*1c1f322eSMichael Lotz #define TABLET_INPUT_DEVICE_H 11*1c1f322eSMichael Lotz 122ee0e237SJérôme Duval 132ee0e237SJérôme Duval #include <InputServerDevice.h> 142ee0e237SJérôme Duval #include <InterfaceDefs.h> 15*1c1f322eSMichael Lotz #include <Locker.h> 162ee0e237SJérôme Duval 17*1c1f322eSMichael Lotz #include <ObjectList.h> 18*1c1f322eSMichael Lotz 19*1c1f322eSMichael Lotz 20*1c1f322eSMichael Lotz class TabletDevice; 212ee0e237SJérôme Duval 222ee0e237SJérôme Duval class TabletInputDevice : public BInputServerDevice { 232ee0e237SJérôme Duval public: 242ee0e237SJérôme Duval TabletInputDevice(); 25*1c1f322eSMichael Lotz virtual ~TabletInputDevice(); 262ee0e237SJérôme Duval 272ee0e237SJérôme Duval virtual status_t InitCheck(); 282ee0e237SJérôme Duval 292ee0e237SJérôme Duval virtual status_t Start(const char* name, void* cookie); 302ee0e237SJérôme Duval virtual status_t Stop(const char* name, void* cookie); 312ee0e237SJérôme Duval 322ee0e237SJérôme Duval virtual status_t Control(const char* name, void* cookie, 332ee0e237SJérôme Duval uint32 command, BMessage* message); 34*1c1f322eSMichael Lotz 352ee0e237SJérôme Duval private: 36*1c1f322eSMichael Lotz friend class TabletDevice; 37*1c1f322eSMichael Lotz // TODO: needed by the control thread to remove a dead device 38*1c1f322eSMichael Lotz // find a better way... 392ee0e237SJérôme Duval 40*1c1f322eSMichael Lotz status_t _HandleMonitor(BMessage* message); 41*1c1f322eSMichael Lotz void _RecursiveScan(const char* directory); 422ee0e237SJérôme Duval 43*1c1f322eSMichael Lotz TabletDevice* _FindDevice(const char* path) const; 44*1c1f322eSMichael Lotz status_t _AddDevice(const char* path); 45*1c1f322eSMichael Lotz status_t _RemoveDevice(const char* path); 462ee0e237SJérôme Duval 47*1c1f322eSMichael Lotz private: 48*1c1f322eSMichael Lotz BObjectList<TabletDevice> fDevices; 49*1c1f322eSMichael Lotz BLocker fDeviceListLock; 502ee0e237SJérôme Duval }; 512ee0e237SJérôme Duval 522ee0e237SJérôme Duval extern "C" BInputServerDevice* instantiate_input_device(); 532ee0e237SJérôme Duval 54*1c1f322eSMichael Lotz #endif // TABLET_INPUT_DEVICE_H 55