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