2008-10-19 19:48:34 +04:00
|
|
|
/*
|
2009-08-27 16:35:43 +04:00
|
|
|
* Copyright 2008, Haiku, Inc. All rights reserved.
|
2008-10-19 19:48:34 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _INPUTSERVERDEVICE_H
|
|
|
|
#define _INPUTSERVERDEVICE_H
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <Input.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
// Register your actual devices using this one - you can subclass
|
|
|
|
// this to suit your needs
|
2002-07-09 16:24:59 +04:00
|
|
|
struct input_device_ref {
|
2008-10-19 19:48:34 +04:00
|
|
|
char* name;
|
|
|
|
input_device_type type; // see Input.h
|
|
|
|
void* cookie;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
// BInputServerDevice::Control() codes
|
2002-07-09 16:24:59 +04:00
|
|
|
enum {
|
|
|
|
// B_KEYBOARD_DEVICE notifications
|
2008-10-19 19:48:34 +04:00
|
|
|
B_KEY_MAP_CHANGED = 1,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_KEY_LOCKS_CHANGED,
|
2008-10-19 19:48:34 +04:00
|
|
|
B_KEY_REPEAT_DELAY_CHANGED,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_KEY_REPEAT_RATE_CHANGED,
|
|
|
|
|
|
|
|
// B_POINTING_DEVICE notifications
|
2008-10-19 19:48:34 +04:00
|
|
|
B_MOUSE_TYPE_CHANGED,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_MOUSE_MAP_CHANGED,
|
|
|
|
B_MOUSE_SPEED_CHANGED,
|
|
|
|
B_CLICK_SPEED_CHANGED,
|
2008-10-19 19:48:34 +04:00
|
|
|
B_MOUSE_ACCELERATION_CHANGED,
|
2022-07-15 20:24:29 +03:00
|
|
|
B_SET_TOUCHPAD_SETTINGS,
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
class DeviceAddOn;
|
|
|
|
}
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
class BInputServerDevice {
|
|
|
|
public:
|
|
|
|
BInputServerDevice();
|
|
|
|
virtual ~BInputServerDevice();
|
|
|
|
|
|
|
|
virtual status_t InitCheck();
|
|
|
|
virtual status_t SystemShuttingDown();
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
virtual status_t Start(const char* device, void* cookie);
|
|
|
|
virtual status_t Stop(const char* device, void* cookie);
|
|
|
|
virtual status_t Control(const char* device, void* cookie, uint32 code,
|
|
|
|
BMessage* message);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
status_t RegisterDevices(input_device_ref** devices);
|
|
|
|
status_t UnregisterDevices(input_device_ref** devices);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
status_t EnqueueMessage(BMessage* message);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
status_t StartMonitoringDevice(const char* device);
|
|
|
|
status_t StopMonitoringDevice(const char* device);
|
|
|
|
status_t AddDevices(const char* path);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void _ReservedInputServerDevice1();
|
|
|
|
virtual void _ReservedInputServerDevice2();
|
|
|
|
virtual void _ReservedInputServerDevice3();
|
|
|
|
virtual void _ReservedInputServerDevice4();
|
2008-10-19 19:48:34 +04:00
|
|
|
|
|
|
|
BPrivate::DeviceAddOn* fOwner;
|
2002-07-09 16:24:59 +04:00
|
|
|
uint32 _reserved[4];
|
|
|
|
};
|
|
|
|
|
2008-10-19 19:48:34 +04:00
|
|
|
#endif // _INPUTSERVERDEVICE_H
|