128515619Smrg#include <xorg-server.h>
228515619Smrg#include <xf86Xinput.h>
328515619Smrg
428515619Smrgextern int xf86ReadSerial(int fd, void *buf, int count);
528515619Smrgextern int xf86WriteSerial(int fd, const void *buf, int count);
628515619Smrgextern int xf86CloseSerial(int fd);
728515619Smrgextern int xf86WaitForInput(int fd, int timeout);
828515619Smrgextern int xf86OpenSerial(XF86OptionPtr options);
928515619Smrgextern int xf86SetSerialSpeed(int fd, int speed);
1028515619Smrg
1128515619Smrgextern XF86OptionPtr xf86ReplaceIntOption(XF86OptionPtr optlist, const char *name,
1228515619Smrg                                    const int val);
1328515619Smrgextern XF86OptionPtr xf86AddNewOption(XF86OptionPtr head, const char *name,
1428515619Smrg                                const char *val);
1528515619Smrgextern char *xf86OptionName(XF86OptionPtr opt);
1628515619Smrgextern const char *xf86FindOptionValue(XF86OptionPtr options, const char *name);
1728515619Smrgextern int xf86NameCmp(const char *s1, const char *s2);
1828515619Smrg
1928515619Smrgextern char *xf86SetStrOption(XF86OptionPtr optlist, const char *name,
2028515619Smrg                              const char *deflt);
2128515619Smrgextern int xf86SetBoolOption(XF86OptionPtr optlist, const char *name, int deflt);
2228515619Smrgextern XF86OptionPtr xf86AddNewOption(XF86OptionPtr head, const char *name,
2328515619Smrg                                const char *val);
2428515619Smrgextern const char *xf86FindOptionValue(XF86OptionPtr options, const char *name);
2528515619Smrgextern char *xf86OptionName(XF86OptionPtr opt);
2628515619Smrgextern char *xf86OptionValue(XF86OptionPtr opt);
2728515619Smrgextern int xf86NameCmp(const char *s1, const char *s2);
2828515619Smrgextern void xf86AddEnabledDevice(InputInfoPtr pInfo);
2928515619Smrgextern void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
3028515619Smrgextern Atom XIGetKnownProperty(char *name);
3128515619Smrgextern void xf86AddInputDriver(InputDriverPtr driver, pointer module,
3228515619Smrg                               int flags);
3328515619Smrgextern int
3428515619Smrg xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
3528515619Smrg
3628515619Smrgextern void DeleteInputDeviceRequest(DeviceIntPtr pDev);
3728515619Smrgextern void FreeInputAttributes(InputAttributes * attrs);
3828515619Smrgextern void
3928515619Smrg
4028515619Smrgxf86PostButtonEvent(DeviceIntPtr device,
4128515619Smrg                    int is_absolute,
4228515619Smrg                    int button,
4328515619Smrg                    int is_down, int first_valuator, int num_valuators, ...);
4428515619Smrgextern int Xasprintf(char **ret, const char *format, ...);
4528515619Smrgextern int
4628515619Smrg XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable);
4728515619Smrg
4828515619Smrgextern InputInfoPtr xf86FirstLocalDevice(void);
4928515619Smrgextern void xf86DeleteInput(InputInfoPtr pInp, int flags);
5028515619Smrgextern XF86OptionPtr xf86OptionListDuplicate(XF86OptionPtr options);
5128515619Smrgextern Bool
5228515619Smrg
5328515619SmrgInitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels,
5428515619Smrg                            CARD8 *map);
5528515619Smrgextern void
5628515619Smrg
5728515619SmrgInitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
5828515619Smrg                       int maxval, int resolution, int min_res, int max_res,
5928515619Smrg                       int mode);
6028515619Smrgextern void
6128515619Smrg xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down);
6228515619Smrgextern int
6328515619Smrg xf86SetIntOption(XF86OptionPtr optlist, const char *name, int deflt);
6428515619Smrgextern void
6528515619Smrg
6628515619Smrgxf86PostButtonEventP(DeviceIntPtr device,
6728515619Smrg                     int is_absolute,
6828515619Smrg                     int button,
6928515619Smrg                     int is_down, int first_valuator, int num_valuators,
7028515619Smrg                     const int *valuators);
7128515619Smrgextern Bool
7228515619Smrg InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc);
7328515619Smrg
7428515619Smrgextern int
7528515619Smrg
7628515619SmrgXIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
7728515619Smrg                       int format, int mode, unsigned long len,
7828515619Smrg                       XF86OptionPtr value, Bool sendevent);
7928515619Smrgextern CARD32 GetTimeInMillis(void);
8028515619Smrg
8128515619Smrgextern int
8228515619Smrg NewInputDeviceRequest(InputOption *options,
8328515619Smrg                       InputAttributes * attrs,
8428515619Smrg                       DeviceIntPtr *pdev);
8528515619Smrg
8628515619Smrgextern Bool
8728515619Smrg InitLedFeedbackClassDeviceStruct(DeviceIntPtr dev, LedCtrlProcPtr controlProc);
8828515619Smrg
8928515619Smrgextern InputAttributes *DuplicateInputAttributes(InputAttributes * attrs);
9028515619Smrgextern int ValidAtom(Atom atom);
9128515619Smrgextern Bool
9228515619Smrg
9328515619SmrgInitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo,
9428515619Smrg                         BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func);
9528515619Smrgextern long
9628515619Smrg
9728515619SmrgXIRegisterPropertyHandler(DeviceIntPtr dev,
9828515619Smrg                          int (*SetProperty) (DeviceIntPtr dev,
9928515619Smrg                                              Atom property,
10028515619Smrg                                              XIPropertyValuePtr prop,
10128515619Smrg                                              BOOL checkonly),
10228515619Smrg                          int (*GetProperty) (DeviceIntPtr dev,
10328515619Smrg                                              Atom property),
10428515619Smrg                          int (*DeleteProperty) (DeviceIntPtr dev,
10528515619Smrg                                                 Atom property));
10628515619Smrgextern int InitProximityClassDeviceStruct(DeviceIntPtr dev);
10728515619Smrgextern void xf86Msg(MessageType type, const char *format, ...);
10828515619Smrgextern void xf86MsgVerb(MessageType type, int verb, const char *format, ...);
10928515619Smrgextern void xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format,
11028515619Smrg                        ...);
11128515619Smrg
11228515619Smrgextern void
11328515619Smrgxf86PostMotionEventP(DeviceIntPtr device,
11428515619Smrg                     int is_absolute, int first_valuator, int num_valuators,
11528515619Smrg                     const int *valuators);
11628515619Smrg
11728515619Smrgextern Bool
11828515619Smrg
11928515619SmrgInitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
12028515619Smrg                              int numMotionEvents, int mode);
12128515619Smrg
12228515619Smrgextern XF86OptionPtr
12328515619Smrgxf86ReplaceStrOption(XF86OptionPtr optlist, const char *name, const char *val);
12428515619Smrg
12528515619Smrgextern XF86OptionPtr xf86NextOption(XF86OptionPtr list);
12628515619Smrg
12728515619Smrgextern int
12828515619Smrg
12928515619SmrgXIGetDeviceProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value);
13028515619Smrg
13128515619Smrgextern Atom MakeAtom(const char *string, unsigned len, Bool makeit);
13228515619Smrg
13328515619Smrgextern int GetMotionHistorySize(void);
13428515619Smrg
13528515619Smrgextern void
13628515619Smrgxf86PostProximityEventP(DeviceIntPtr device,
13728515619Smrg                        int is_in, int first_valuator, int num_valuators,
13828515619Smrg                        const int *valuators);
13928515619Smrg
14028515619Smrgextern Bool InitFocusClassDeviceStruct(DeviceIntPtr dev);
14128515619Smrg
14228515619Smrgextern void
14328515619Smrg xf86ProcessCommonOptions(InputInfoPtr pInfo, XF86OptionPtr list);
14428515619Smrg
14528515619Smrgextern void
14628515619Smrgxf86CollectInputOptions(InputInfoPtr pInfo,
14728515619Smrg                        const char **defaultOpts);
14828515619Smrg
14928515619Smrgextern InputInfoPtr xf86AllocateInput(void);
15028515619Smrg
15128515619Smrgextern ClientPtr serverClient;
15228515619Smrg
15328515619Smrgextern Bool
15428515619SmrgQueueWorkProc(Bool (*function)
15528515619Smrg              (ClientPtr /* pClient */ , pointer /* closure */ ),
15628515619Smrg              ClientPtr client, pointer closure);
157