sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -0,0 +1,144 @@
/*
Copyright 1992, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#ifndef _XTEST_H_
#define _XTEST_H_
#include <X11/Xfuncproto.h>
#include <X11/extensions/xtestconst.h>
#include <X11/extensions/XInput.h>
_XFUNCPROTOBEGIN
Bool XTestQueryExtension(
Display* /* dpy */,
int* /* event_basep */,
int* /* error_basep */,
int* /* majorp */,
int* /* minorp */
);
Bool XTestCompareCursorWithWindow(
Display* /* dpy */,
Window /* window */,
Cursor /* cursor */
);
Bool XTestCompareCurrentCursorWithWindow(
Display* /* dpy */,
Window /* window */
);
extern int XTestFakeKeyEvent(
Display* /* dpy */,
unsigned int /* keycode */,
Bool /* is_press */,
unsigned long /* delay */
);
extern int XTestFakeButtonEvent(
Display* /* dpy */,
unsigned int /* button */,
Bool /* is_press */,
unsigned long /* delay */
);
extern int XTestFakeMotionEvent(
Display* /* dpy */,
int /* screen */,
int /* x */,
int /* y */,
unsigned long /* delay */
);
extern int XTestFakeRelativeMotionEvent(
Display* /* dpy */,
int /* x */,
int /* y */,
unsigned long /* delay */
);
extern int XTestFakeDeviceKeyEvent(
Display* /* dpy */,
XDevice* /* dev */,
unsigned int /* keycode */,
Bool /* is_press */,
int* /* axes */,
int /* n_axes */,
unsigned long /* delay */
);
extern int XTestFakeDeviceButtonEvent(
Display* /* dpy */,
XDevice* /* dev */,
unsigned int /* button */,
Bool /* is_press */,
int* /* axes */,
int /* n_axes */,
unsigned long /* delay */
);
extern int XTestFakeProximityEvent(
Display* /* dpy */,
XDevice* /* dev */,
Bool /* in_prox */,
int* /* axes */,
int /* n_axes */,
unsigned long /* delay */
);
extern int XTestFakeDeviceMotionEvent(
Display* /* dpy */,
XDevice* /* dev */,
Bool /* is_relative */,
int /* first_axis */,
int* /* axes */,
int /* n_axes */,
unsigned long /* delay */
);
extern int XTestGrabControl(
Display* /* dpy */,
Bool /* impervious */
);
void XTestSetGContextOfGC(
GC /* gc */,
GContext /* gid */
);
void XTestSetVisualIDOfVisual(
Visual* /* visual */,
VisualID /* visualid */
);
Status XTestDiscard(
Display* /* dpy */
);
_XFUNCPROTOEND
#endif

View file

@ -0,0 +1,183 @@
/***************************************************************************
* Copyright 1995 Network Computing Devices
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Network Computing Devices
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission.
*
* NETWORK COMPUTING DEVICES DISCLAIMs ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**************************************************************************/
#ifndef _RECORD_H_
#define _RECORD_H_
#include <X11/extensions/recordconst.h>
typedef unsigned long XRecordClientSpec;
typedef unsigned long XRecordContext;
typedef struct
{
unsigned char first;
unsigned char last;
} XRecordRange8;
typedef struct
{
unsigned short first;
unsigned short last;
} XRecordRange16;
typedef struct
{
XRecordRange8 ext_major;
XRecordRange16 ext_minor;
} XRecordExtRange;
typedef struct
{
XRecordRange8 core_requests; /* core X requests */
XRecordRange8 core_replies; /* core X replies */
XRecordExtRange ext_requests; /* extension requests */
XRecordExtRange ext_replies; /* extension replies */
XRecordRange8 delivered_events; /* delivered core and ext events */
XRecordRange8 device_events; /* all core and ext device events */
XRecordRange8 errors; /* core X and ext errors */
Bool client_started; /* connection setup reply */
Bool client_died; /* notice of client disconnect */
} XRecordRange;
typedef struct
{
XRecordClientSpec client;
unsigned long nranges;
XRecordRange **ranges;
} XRecordClientInfo;
typedef struct
{
Bool enabled;
int datum_flags;
unsigned long nclients;
XRecordClientInfo **client_info;
} XRecordState;
typedef struct
{
XID id_base;
Time server_time;
unsigned long client_seq;
int category;
Bool client_swapped;
unsigned char *data;
unsigned long data_len; /* in 4-byte units */
} XRecordInterceptData;
_XFUNCPROTOBEGIN
/*********************************************************
*
* Prototypes
*
*/
XID XRecordIdBaseMask(
Display *dpy
);
extern Status XRecordQueryVersion(
Display* /* dpy */,
int* /* cmajor_return */,
int* /* cminor_return */
);
extern XRecordContext XRecordCreateContext(
Display* /* dpy */,
int /* datum_flags */,
XRecordClientSpec* /* clients */,
int /* nclients */,
XRecordRange** /* ranges */,
int /* nranges */
);
extern XRecordRange *XRecordAllocRange(
void
);
extern Status XRecordRegisterClients(
Display* /* dpy */,
XRecordContext /* context */,
int /* datum_flags */,
XRecordClientSpec* /* clients */,
int /* nclients */,
XRecordRange** /* ranges */,
int /* nranges */
);
extern Status XRecordUnregisterClients(
Display* /* dpy */,
XRecordContext /* context */,
XRecordClientSpec* /* clients */,
int /* nclients */
);
extern Status XRecordGetContext(
Display* /* dpy */,
XRecordContext /* context */,
XRecordState** /* state_return */
);
extern void XRecordFreeState(
XRecordState* /* state */
);
typedef void (*XRecordInterceptProc) (
XPointer /* closure */,
XRecordInterceptData* /* recorded_data */
);
extern Status XRecordEnableContext(
Display* /* dpy */,
XRecordContext /* context */,
XRecordInterceptProc /* callback */,
XPointer /* closure */
);
extern Status XRecordEnableContextAsync(
Display* /* dpy */,
XRecordContext /* context */,
XRecordInterceptProc /* callback */,
XPointer /* closure */
);
extern void XRecordProcessReplies(
Display* /* dpy */
);
extern void XRecordFreeData(
XRecordInterceptData* /* data */
);
extern Status XRecordDisableContext(
Display* /* dpy */,
XRecordContext /* context */
);
extern Status XRecordFreeContext(
Display* /* dpy */,
XRecordContext /* context */
);
_XFUNCPROTOEND
#endif