1 /* 2 * Copyright 2005-2008 Stephan Aßmus <superstippi@gmx.de>. All rights reserved. 3 * Distributed under the terms of the MIT license. 4 */ 5 #include "PointingDeviceFactory.h" 6 7 #include "DeviceReader.h" 8 #include "TabletDevice.h" 9 10 11 static const uint16 kVendorWacom = 0x056a; 12 13 14 /*static*/ PointingDevice* DeviceFor(MasterServerDevice * parent,const char * path)15PointingDeviceFactory::DeviceFor(MasterServerDevice* parent, const char* path) 16 { 17 PointingDevice* device = NULL; 18 DeviceReader* reader = new DeviceReader(); 19 if (reader->SetTo(path) >= B_OK) { 20 switch (reader->VendorID()) { 21 case kVendorWacom: 22 device = new TabletDevice(parent, reader); 23 break; 24 default: 25 delete reader; 26 break; 27 } 28 } else { 29 delete reader; 30 } 31 return device; 32 } 33 34 // forbidden: PointingDeviceFactory()35PointingDeviceFactory::PointingDeviceFactory() {} ~PointingDeviceFactory()36PointingDeviceFactory::~PointingDeviceFactory() {} 37 38 39