* Copyright 2005-2008 Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#include <malloc.h>
#include <string.h>
#include "DeviceReader.h"
#include "PointingDevice.h"
PointingDevice::PointingDevice(MasterServerDevice* parent,
DeviceReader* reader)
: fParent(parent),
fReader(reader),
fActive(false)
{
}
PointingDevice::~PointingDevice()
{
delete fReader;
}
status_t
PointingDevice::InitCheck()
{
return fParent && fReader ? fReader->InitCheck() : B_NO_INIT;
}
void
PointingDevice::SetActive(bool active)
{
fActive = active;
}
bool
PointingDevice::IsActive() const
{
return fActive;
}
const char*
PointingDevice::DevicePath() const
{
if (fReader) {
return fReader->DevicePath();
}
return NULL;
}
bool
PointingDevice::DisablePS2() const
{
return false;
}
uint16
PointingDevice::VendorID() const
{
if (fReader)
return fReader->VendorID();
return 0;
}
uint16
PointingDevice::ProductID() const
{
if (fReader)
return fReader->ProductID();
return 0;
}