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 <malloc.h>
6#include <string.h>
7
8#include "DeviceReader.h"
9
10#include "PointingDevice.h"
11
12// constructor
13PointingDevice::PointingDevice(MasterServerDevice* parent,
14							   DeviceReader* reader)
15	: fParent(parent),
16	  fReader(reader),
17	  fActive(false)
18{
19}
20
21// destructor
22PointingDevice::~PointingDevice()
23{
24	delete fReader;
25}
26
27// InitCheck
28status_t
29PointingDevice::InitCheck()
30{
31	return fParent && fReader ? fReader->InitCheck() : B_NO_INIT;
32}
33
34// SetActive
35void
36PointingDevice::SetActive(bool active)
37{
38	fActive = active;
39}
40
41// IsActive
42bool
43PointingDevice::IsActive() const
44{
45	return fActive;
46}
47
48// DevicePath
49const char*
50PointingDevice::DevicePath() const
51{
52	if (fReader) {
53		return fReader->DevicePath();
54	}
55	return NULL;
56}
57
58// DisablePS2
59bool
60PointingDevice::DisablePS2() const
61{
62	return false;
63}
64
65// VendorID
66uint16
67PointingDevice::VendorID() const
68{
69	if (fReader)
70		return fReader->VendorID();
71	return 0;
72}
73
74// ProductID
75uint16
76PointingDevice::ProductID() const
77{
78	if (fReader)
79		return fReader->ProductID();
80	return 0;
81}
82
83
84
85
86
87
88