📄 xhplib.h
字号:
#ifndef XHPLIB_H#define XHPLIB_H/* $Header: /host/kaukau/disk2/X11R5/R5-hp300/mit/server/ddx/hpbsd/input/X11/RCS/XHPlib.h,v 1.1 1992/09/30 03:15:29 root Exp $ *//* Definitions used by Xlib and the client */#include "XHPproto.h"#ifndef _NO_PROTO#if !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)#define _NO_PROTO#endif /* __STDC__ */#endif /* _NO_PROTO */#ifndef _XLIB_H_#include <X11/Xlib.h>#endif#ifndef _XUTIL_H_#include <X11/Xutil.h>#endif#ifdef __cplusplusextern "C" {#endif#define GENERAL_PROMPT 0#define PROMPT_1 1#define PROMPT_2 2#define PROMPT_3 3#define PROMPT_4 4#define PROMPT_5 5#define PROMPT_6 6#define PROMPT_7 7#define GENERAL_ACKNOWLEDGE 0#define ACKNOWLEDGE_1 1#define ACKNOWLEDGE_2 2#define ACKNOWLEDGE_3 3#define ACKNOWLEDGE_4 4#define ACKNOWLEDGE_5 5#define ACKNOWLEDGE_6 6#define ACKNOWLEDGE_7 7#define HPDeviceKeyPressreq 1#define HPDeviceKeyReleasereq 2#define HPDeviceButtonPressreq 3#define HPDeviceButtonReleasereq 4#define HPDeviceMotionNotifyreq 5#define HPDeviceFocusInreq 6#define HPDeviceFocusOutreq 7#define HPProximityInreq 8#define HPProximityOutreq 9#define HPDeviceKeymapNotifyreq 10#define HPDeviceMappingNotifyreq 11extern int HPDeviceKeyPress;extern int HPDeviceKeyRelease;extern int HPDeviceButtonPress;extern int HPDeviceButtonRelease;extern int HPDeviceMotionNotify;extern int HPDeviceFocusIn;extern int HPDeviceFocusOut;extern int HPProximityIn;extern int HPProximityOut;extern int HPDeviceKeymapNotify;extern int HPDeviceMappingNotify;typedef int (*PtrFuncInt) ();typedef unsigned long XHPFilterId;/* structure used to split events queue between drivers and client */typedef struct _XHProutines *_XHPrtnptr;typedef struct _XHProutines { Display *display; XHPFilterId id; Window window; Mask std_filtermask; Mask std_clientmask; Mask ext_filtermask[MAX_LOGICAL_DEVS]; Mask ext_clientmask[MAX_LOGICAL_DEVS]; int (*callback) (); int state_info; _XHPrtnptr next; } XHProutines;typedef struct { XKeyEvent ev; XID deviceid; } XHPDeviceKeyEvent;/*************************************************************** * * The location of the X pointer is reported in the coordinate * fields of the ev member. The location of the device * is determined from the previous DeviceMotionNotify event. * */typedef struct { XButtonEvent ev; XID deviceid; } XHPDeviceButtonEvent;/*************************************************************** * * The ax_num and ax_val fields contain the data reported by the * device. The values may be absolute or relative. Any axis * whose value changes will be reported. * */typedef struct { int ax_num; int ax_val; } XHPAxis_data;/**************************************************************************** * * Bug fix for alignment problem on s700/ s800. * * XHPDeviceMotionEvent embeds an XMotionEvent struct. The XMotionEvent * struct contains a char followed by an int. 68k CPUs add one byte of * padding to align the int on a 16-bit boundary. PA-RISC CPUs add three * bytes of padding to align the int on a 32-bit boudary. The result is * that XMotionEvent structs are 58 bytes on 68k CPUs and 60 bytes on * PA-RISC CPUs. * * The size is critical because the XHPScreen_events routine assumes that all * HP input extension events contain a device id in bytes 60 - 63. * * The right way to fix this would be to define a 60-byte * array and make it a union with the ev field, but this would break existing * clients that reference this field. * * Instead we will ifdef the struct to make the padding come out right. * A side effect of this is that on machines with 32-bit alignment, there's * only room for 3 elements in the data array field, since the total XEvent * size is 96 bytes. This is probably ok, since no HP input devices report more * than 3 axes of motion. We will leave the s300 definition at 4 elements, * since it was originally defined that way. We will also put in code to * cause a compiler error for undefined machines. * * Mea culpa, ---gms */typedef struct {#if defined(__hp9000s300) || defined(__apollo) || defined(hp300) /* 68k aligns to 16 bits */ XMotionEvent ev; char pad; unsigned char axes_count; XID deviceid; XHPAxis_data data[4];#else #if defined(__hp9000s800) || defined(__hp9000s700) /* 32-bit alignment */ XMotionEvent ev; XID deviceid; XHPAxis_data data[3]; unsigned char axes_count;#else#if defined(__hp_osf) && defined(__mc68000) XMotionEvent ev; char pad; unsigned char axes_count; XID deviceid; XHPAxis_data data[4];#else #if defined(__hp_osf) && defined(__pa_risc) XMotionEvent ev; XID deviceid; XHPAxis_data data[3]; unsigned char axes_count;#else This is a bogus line to force a compiler error on undefined machines - gms.#endif#endif#endif#endif } XHPDeviceMotionEvent;typedef struct { XFocusChangeEvent ev; char pad[32]; XID deviceid; char pad1[2]; } XHPDeviceFocusChangeEvent;typedef struct { XMappingEvent ev; char pad[28]; XID deviceid; char pad1[2]; } XHPDeviceMappingEvent;typedef struct { int type; /* ProximityIn or ProximityOut */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* window of event */ Window root; /* root window that the event occured on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ Bool same_screen; /* same screen flag */ char pad[4]; XID deviceid; char pad1[2]; } XHPProximityNotifyEvent;typedef XHPProximityNotifyEvent XHPProximityInEvent;typedef XHPProximityNotifyEvent XHPProximityOutEvent;/* generated on EnterWindow and FocusIn when KeyMapState selected */typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; char key_vector[32]; char pad[8]; XID deviceid;} XHPDeviceKeymapEvent; typedef struct { char pad[60]; XID deviceid; } XHP_AnyEvent;typedef struct { unsigned int resolution; unsigned short min_val; unsigned short max_val; } XHPaxis_info;typedef struct { XID x_id; char *name; XHPaxis_info *axes; unsigned short type; unsigned short min_keycode; unsigned short max_keycode; unsigned char hil_id; unsigned char mode; unsigned char num_axes; unsigned char num_buttons; unsigned char num_keys; unsigned char io_byte; unsigned short detailed_id; unsigned char pad[6]; } XHPDeviceList;typedef struct { int key_click_percent; int bell_percent; int bell_pitch; int bell_duration; int led; int led_mode; int key; int auto_repeat_mode; /* On, Off, Default */ int accelNumerator; int accelDenominator; int threshold;} XHPDeviceControl;/* Data structure for XHPGetDeviceControl */typedef struct { int key_click_percent; int bell_percent; unsigned int bell_pitch, bell_duration; unsigned long led_mask; int global_auto_repeat; int accelNumerator; int accelDenominator; int threshold; char auto_repeats[32];} XHPDeviceState;typedef struct { Time time; unsigned short *data;} XHPTimeCoord;/* This structure is used to pass Nlio ioctl style commands * to the Nlio server */#define XNHPNlioctl "HPNlioctl"typedef struct { int cmd; XPointer arg; int ret;} XhpNlioCmd;/* These are the structures used for the XHPNlioctl call */typedef struct { int flags; KeySym invoke_nlio; KeySym terminate_nlio; KeySym set_alternate; KeySym unset_alternate;} K16_state;/* These are the commands for the XHPNlioctl call */#include <sys/ioctl.h>#define K16_FOCUS_IN _IO('X', 100)#define K16_FOCUS_OUT _IO('X', 101)#define K16_EXEC_PROC 1#define K16_KILL_PROC 2#define K16_GET_STATEKEYS 3#define K16_SET_STATEKEYS 4#define K16_ALT_ON 5#define K16_NLIO_ON 6#define K16_IS_PROC 7#define K16_GET_ENCODING 8#define K16_SET_ENCODING 9#define K16_NLIOSTATE 1#define K16_ALTSTATE 2/* The following block of defines are required for XHPSetKeyboardMapping */#define DEF_FILENAME "XHPKeymaps"#ifndef DEF_DIRECTORY#define DEF_DIRECTORY "/usr/lib/X11/"#endif#define VERIFY_MAGIC "HPKeyMap Rev 1.0"#define MAGIC_SIZE 20struct XHP_keymap_header { int kbd; int offset; int size;};#define HPK_KEYDEVICE_NAME_TABLE_ID 19998#define HPK_MODMAP_TABLE_ID 19999#define HPK_FIRST_RESERVED_ID 20000typedef struct{ int keydevice_id, min_keycode, max_keycode, columns; char *name, *modmap_name;} HPKKeyDeviceInfo;#define MODMAP_SIZE 256 /* aka MAP_LENGTH in server/include/input.h */typedef struct{ char *modmap_name; CARD8 modmap[MODMAP_SIZE];} HPKModMap;/* Error values returned by XHPSetKeyboardMapping */#define XHPKB_NOKEYFILE 1#define XHPKB_BADMAGIC 2#define XHPKB_BADKBID 3#define XHPKB_NONHPINPUTDEV 4#define XHPKB_NOMEM 5/* In the following list, several of the constants have duplicate names. The duplicate names were added to provide a consistent name for the tokens (i.e. each name represents a language). The original version mixed country names and language names. */#define KB_US_English 0 /* For use with HP46021A */#define KB_Latin_Spanish 1 /* For use with HP46021AM */#define KB_Katakana 2 /* For use with HP46021AJ */#define KB_Danish 3 /* For use with HP46021AY */#define KB_French 4 /* For use with HP46021AF */#define KB_Norwegian 5 /* For use with HP46021AN */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -