1 /****************************************************************************** 2 / 3 / File: InputServerDevice.h 4 / 5 / Description: Add-on class for input_server devices. 6 / 7 / Copyright 1998, Be Incorporated, All Rights Reserved. 8 / 9 ******************************************************************************/ 10 11 #ifndef _INPUTSERVERDEVICE_H 12 #define _INPUTSERVERDEVICE_H 13 14 #include <BeBuild.h> 15 #include <Input.h> 16 #include <SupportDefs.h> 17 18 19 struct input_device_ref { 20 char *name; 21 input_device_type type; 22 void *cookie; 23 }; 24 25 26 enum { 27 // B_KEYBOARD_DEVICE notifications 28 B_KEY_MAP_CHANGED = 1, 29 B_KEY_LOCKS_CHANGED, 30 B_KEY_REPEAT_DELAY_CHANGED, 31 B_KEY_REPEAT_RATE_CHANGED, 32 33 // B_POINTING_DEVICE notifications 34 B_MOUSE_TYPE_CHANGED, 35 B_MOUSE_MAP_CHANGED, 36 B_MOUSE_SPEED_CHANGED, 37 B_CLICK_SPEED_CHANGED, 38 B_MOUSE_ACCELERATION_CHANGED 39 }; 40 41 42 class _BDeviceAddOn_; 43 44 45 class BInputServerDevice { 46 public: 47 BInputServerDevice(); 48 virtual ~BInputServerDevice(); 49 50 virtual status_t InitCheck(); 51 virtual status_t SystemShuttingDown(); 52 53 virtual status_t Start(const char *device, void *cookie); 54 virtual status_t Stop(const char *device, void *cookie); 55 virtual status_t Control(const char *device, 56 void *cookie, 57 uint32 code, 58 BMessage *message); 59 60 status_t RegisterDevices(input_device_ref **devices); 61 status_t UnregisterDevices(input_device_ref **devices); 62 63 status_t EnqueueMessage(BMessage *message); 64 65 status_t StartMonitoringDevice(const char *device); 66 status_t StopMonitoringDevice(const char *device); 67 68 private: 69 _BDeviceAddOn_* fOwner; 70 71 virtual void _ReservedInputServerDevice1(); 72 virtual void _ReservedInputServerDevice2(); 73 virtual void _ReservedInputServerDevice3(); 74 virtual void _ReservedInputServerDevice4(); 75 uint32 _reserved[4]; 76 }; 77 78 79 #endif 80