1 /* 2 * Copyright 2002-2005, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "InputServer.h" 8 9 #include <InputServerDevice.h> 10 11 12 BInputServerDevice::BInputServerDevice() 13 { 14 fOwner = new _BDeviceAddOn_(this); 15 } 16 17 18 BInputServerDevice::~BInputServerDevice() 19 { 20 CALLED(); 21 22 gInputServer->UnregisterDevices(*this); 23 delete fOwner; 24 } 25 26 27 status_t 28 BInputServerDevice::InitCheck() 29 { 30 return B_OK; 31 } 32 33 34 status_t 35 BInputServerDevice::SystemShuttingDown() 36 { 37 return B_OK; 38 } 39 40 41 status_t 42 BInputServerDevice::Start(const char* device, void* cookie) 43 { 44 return B_OK; 45 } 46 47 48 status_t 49 BInputServerDevice::Stop(const char* device, void* cookie) 50 { 51 return B_OK; 52 } 53 54 55 status_t 56 BInputServerDevice::Control(const char* device, void* cookie, 57 uint32 code, BMessage* message) 58 { 59 return B_OK; 60 } 61 62 63 status_t 64 BInputServerDevice::RegisterDevices(input_device_ref** devices) 65 { 66 CALLED(); 67 return gInputServer->RegisterDevices(*this, devices); 68 } 69 70 71 status_t 72 BInputServerDevice::UnregisterDevices(input_device_ref** devices) 73 { 74 CALLED(); 75 // TODO: is this function supposed to remove devices that do not belong to this object? 76 // (at least that's what the previous implementation allowed for) 77 return gInputServer->UnregisterDevices(*this, devices); 78 } 79 80 81 status_t 82 BInputServerDevice::EnqueueMessage(BMessage* message) 83 { 84 return gInputServer->EnqueueDeviceMessage(message); 85 } 86 87 88 status_t 89 BInputServerDevice::StartMonitoringDevice(const char* device) 90 { 91 CALLED(); 92 PRINT(("StartMonitoringDevice %s\n", device)); 93 94 return InputServer::gDeviceManager.StartMonitoringDevice(fOwner, device); 95 } 96 97 98 status_t 99 BInputServerDevice::StopMonitoringDevice(const char* device) 100 { 101 CALLED(); 102 return InputServer::gDeviceManager.StopMonitoringDevice(fOwner, device); 103 } 104 105 106 void BInputServerDevice::_ReservedInputServerDevice1() {} 107 void BInputServerDevice::_ReservedInputServerDevice2() {} 108 void BInputServerDevice::_ReservedInputServerDevice3() {} 109 void BInputServerDevice::_ReservedInputServerDevice4() {} 110 111