include: move private defs to dixstruct_priv.h

Public server module API shouldn't be clobbered with private definitions,
thus move them out to dixstruct_priv.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-02-09 15:11:30 +01:00 committed by Marge Bot
parent f17bc7e24d
commit bae6cbc8ca
24 changed files with 169 additions and 143 deletions

View File

@ -48,7 +48,7 @@ in this Software without prior written authorization from The Open Group.
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
#include "resource.h"
#include "scrnintstr.h"
#include "windowstr.h"

View File

@ -31,6 +31,7 @@
#include "damagestr.h"
#include "protocol-versions.h"
#include "extinit.h"
#include "dixstruct_priv.h"
#ifdef PANORAMIX
#include "panoramiX.h"

View File

@ -48,12 +48,18 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <math.h>
#include <pixman.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h>
#include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h"
#include "dix/ptrveloc_priv.h"
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "resource.h"
@ -63,23 +69,15 @@ SOFTWARE.
#include "cursorstr.h"
#include "dixstruct.h"
#include "ptrveloc.h"
#include "xkbsrv.h"
#include "privates.h"
#include "xace.h"
#include "mi.h"
#include "dispatch.h"
#include "swaprep.h"
#include "dixevents.h"
#include "mipointer.h"
#include "eventstr.h"
#include "dixgrabs.h"
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h>
#include <X11/extensions/XIproto.h>
#include <math.h>
#include <pixman.h>
#include "exglobals.h"
#include "exevents.h"
#include "xiquerydevice.h" /* for SizeDeviceClasses */

View File

@ -132,6 +132,7 @@ Equipment Corporation.
#include "xkbsrv.h"
#include "client.h"
#include "xfixesint.h"
#include "dixstruct_priv.h"
// temporary workaround for win32/mingw32 name clash
#undef CreateWindow

92
dix/dixstruct_priv.h Normal file
View File

@ -0,0 +1,92 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DIXSTRUCT_PRIV_H
#define _XSERVER_DIXSTRUCT_PRIV_H
#include "client.h"
#include "dix.h"
#include "resource.h"
#include "cursor.h"
#include "gc.h"
#include "pixmap.h"
#include "privates.h"
#include "dixstruct.h"
#include <X11/Xmd.h>
static inline void
SetReqFds(ClientPtr client, int req_fds) {
if (client->req_fds != 0 && req_fds != client->req_fds)
LogMessage(X_ERROR, "Mismatching number of request fds %d != %d\n", req_fds, client->req_fds);
client->req_fds = req_fds;
}
/*
* Scheduling interface
*/
extern long SmartScheduleTime;
extern long SmartScheduleInterval;
extern long SmartScheduleSlice;
extern long SmartScheduleMaxSlice;
#ifdef HAVE_SETITIMER
extern Bool SmartScheduleSignalEnable;
#else
#define SmartScheduleSignalEnable FALSE
#endif
void SmartScheduleStartTimer(void);
void SmartScheduleStopTimer(void);
/* Client has requests queued or data on the network */
void mark_client_ready(ClientPtr client);
/*
* Client has requests queued or data on the network, but awaits a
* server grab release
*/
void mark_client_saved_ready(ClientPtr client);
/* Client has no requests queued and no data on network */
void mark_client_not_ready(ClientPtr client);
static inline Bool client_is_ready(ClientPtr client)
{
return !xorg_list_is_empty(&client->ready);
}
Bool
clients_are_ready(void);
extern struct xorg_list output_pending_clients;
static inline void
output_pending_mark(ClientPtr client)
{
if (!client->clientGone && xorg_list_is_empty(&client->output_pending))
xorg_list_append(&client->output_pending, &output_pending_clients);
}
static inline void
output_pending_clear(ClientPtr client)
{
xorg_list_del(&client->output_pending);
}
static inline Bool any_output_pending(void) {
return !xorg_list_is_empty(&output_pending_clients);
}
#define SMART_MAX_PRIORITY (20)
#define SMART_MIN_PRIORITY (-20)
void SmartScheduleInit(void);
/* This prototype is used pervasively in Xext, dix */
#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
/* proc vectors */
extern int (*InitialVector[3]) (ClientPtr /*client */ );
#endif /* _XSERVER_DIXSTRUCT_PRIV_H */

View File

@ -107,9 +107,16 @@ Equipment Corporation.
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/ge.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h>
#include <X11/extensions/XKBproto.h>
#include <X11/extensions/XIproto.h>
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/eventconvert.h"
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "resource.h"
@ -118,35 +125,23 @@ Equipment Corporation.
#include "inpututils.h"
#include "scrnintstr.h"
#include "cursorstr.h"
#include "dixstruct.h"
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#include "globals.h"
#include <X11/extensions/XKBproto.h>
#include "xkbsrv.h"
#include "xace.h"
#include "probes.h"
#include <X11/extensions/XIproto.h>
#include <X11/extensions/XI2proto.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h>
#include "exglobals.h"
#include "exevents.h"
#include "extnsionst.h"
#include "dixevents.h"
#include "dixgrabs.h"
#include "dispatch.h"
#include <X11/extensions/ge.h>
#include "geext.h"
#include "geint.h"
#include "dixstruct_priv.h"
#include "eventstr.h"
#include "enterleave.h"
#include "mi.h"

View File

@ -32,6 +32,7 @@
#include <protocol-versions.h>
#include <drm_fourcc.h>
#include "randrstr_priv.h"
#include "dixstruct_priv.h"
static Bool
dri3_screen_can_one_point_four(ScreenPtr screen)

View File

@ -30,7 +30,7 @@
#include <xwin-config.h>
#endif
#include "win.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
#include "inputstr.h"
/*

View File

@ -35,7 +35,7 @@
#endif
#include "win.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
/*
* Local function prototypes

View File

@ -113,75 +113,6 @@ typedef struct _Client {
int req_fds;
} ClientRec;
static inline void
SetReqFds(ClientPtr client, int req_fds) {
if (client->req_fds != 0 && req_fds != client->req_fds)
LogMessage(X_ERROR, "Mismatching number of request fds %d != %d\n", req_fds, client->req_fds);
client->req_fds = req_fds;
}
/*
* Scheduling interface
*/
extern long SmartScheduleTime;
extern long SmartScheduleInterval;
extern long SmartScheduleSlice;
extern long SmartScheduleMaxSlice;
#ifdef HAVE_SETITIMER
extern Bool SmartScheduleSignalEnable;
#else
#define SmartScheduleSignalEnable FALSE
#endif
extern void SmartScheduleStartTimer(void);
extern void SmartScheduleStopTimer(void);
/* Client has requests queued or data on the network */
void mark_client_ready(ClientPtr client);
/*
* Client has requests queued or data on the network, but awaits a
* server grab release
*/
void mark_client_saved_ready(ClientPtr client);
/* Client has no requests queued and no data on network */
void mark_client_not_ready(ClientPtr client);
static inline Bool client_is_ready(ClientPtr client)
{
return !xorg_list_is_empty(&client->ready);
}
Bool
clients_are_ready(void);
extern struct xorg_list output_pending_clients;
static inline void
output_pending_mark(ClientPtr client)
{
if (!client->clientGone && xorg_list_is_empty(&client->output_pending))
xorg_list_append(&client->output_pending, &output_pending_clients);
}
static inline void
output_pending_clear(ClientPtr client)
{
xorg_list_del(&client->output_pending);
}
static inline Bool any_output_pending(void) {
return !xorg_list_is_empty(&output_pending_clients);
}
#define SMART_MAX_PRIORITY (20)
#define SMART_MIN_PRIORITY (-20)
extern void SmartScheduleInit(void);
/* This prototype is used pervasively in Xext, dix */
#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
typedef struct _WorkQueue {
struct _WorkQueue *next;
Bool (*function) (ClientPtr /* pClient */ ,
@ -216,12 +147,11 @@ typedef struct _CallbackList {
/* proc vectors */
extern int (*InitialVector[3]) (ClientPtr /*client */ );
extern _X_EXPORT int (*ProcVector[256]) (ClientPtr /*client */ );
extern _X_EXPORT int (*SwappedProcVector[256]) (ClientPtr /*client */ );
/* fixme: still needed by (public) dix.h */
extern ReplySwapPtr ReplySwapVector[256];
extern _X_EXPORT int

View File

@ -284,8 +284,6 @@ extern _X_EXPORT DevPrivateKeyRec xkbDevicePrivateKeyRec;
#define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr)dixLookupPrivate(&(dev)->devPrivates, xkbDevicePrivateKey))
extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, void *);
/***====================================================================***/
/***====================================================================***/
@ -492,8 +490,6 @@ extern _X_EXPORT void XkbUpdateIndicators(DeviceIntPtr /* keybd */ ,
XkbEventCausePtr /* cause */
);
extern void XkbForceUpdateDeviceLEDs(DeviceIntPtr /* keybd */);
extern _X_EXPORT void XkbUpdateAllDeviceIndicators(XkbChangesPtr /* changes */,
XkbEventCausePtr /* cause */
);
@ -640,10 +636,6 @@ extern _X_EXPORT void XkbHandleActions(DeviceIntPtr /* dev */ ,
DeviceEvent * /* event */
);
extern void XkbPushLockedStateToSlaves(DeviceIntPtr /* master */,
int /* evtype */,
int /* key */);
extern _X_EXPORT Bool XkbEnableDisableControls(XkbSrvInfoPtr /* xkbi */ ,
unsigned long /* change */ ,
unsigned long /* newValues */ ,
@ -820,29 +812,12 @@ extern _X_EXPORT void XkbSendNewKeyboardNotify(DeviceIntPtr /* kbd */ ,
xkbNewKeyboardNotify * /* pNKN */
);
extern Bool XkbCopyKeymap(XkbDescPtr /* dst */ ,
XkbDescPtr /* src */ );
extern _X_EXPORT Bool XkbCopyDeviceKeymap(DeviceIntPtr /* dst */,
DeviceIntPtr /* src */);
extern _X_EXPORT Bool XkbDeviceApplyKeymap(DeviceIntPtr /* dst */ ,
XkbDescPtr /* src */ );
extern void XkbFilterEvents(ClientPtr /* pClient */ ,
int /* nEvents */ ,
xEvent * /* xE */ );
extern int XkbGetEffectiveGroup(XkbSrvInfoPtr /* xkbi */ ,
XkbStatePtr /* xkbstate */ ,
CARD8 /* keycode */ );
extern void XkbMergeLockedPtrBtns(DeviceIntPtr /* master */ );
extern void XkbFakeDeviceButton(DeviceIntPtr /* dev */ ,
int /* press */ ,
int /* button */ );
extern _X_EXPORT void XkbCopyControls(XkbDescPtr /* dst */ ,
XkbDescPtr /* src */ );

View File

@ -69,7 +69,7 @@ SOFTWARE.
#include "misc.h"
#include "osdep.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
#include "opaque.h"
#ifdef DPMSExtension
#include "dpmsproc.h"

View File

@ -103,7 +103,7 @@ SOFTWARE.
#include "misc.h" /* for typedef of pointer */
#include "opaque.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
#include "xace.h"
#ifdef HAVE_GETPEERUCRED

View File

@ -57,6 +57,8 @@ SOFTWARE.
#undef DEBUG_COMMUNICATION
#include "dixstruct_priv.h"
#ifdef WIN32
#include <X11/Xwinsock.h>
#endif

View File

@ -64,11 +64,11 @@ SOFTWARE.
#include "os/osdep.h"
#include "misc.h"
#include "os.h"
#include "opaque.h"
#include "misc.h"
#include "dixstruct.h"
#include "dixstruct_priv.h"
#if !defined(SYSV) && !defined(WIN32)
#include <sys/resource.h>

View File

@ -116,6 +116,7 @@ __stdcall unsigned long GetTickCount(void);
#include "picture.h"
#include "miinitext.h"
#include "present.h"
#include "dixstruct_priv.h"
Bool noTestExtensions;

View File

@ -28,20 +28,22 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <dix-config.h>
#endif
#if !defined(WIN32)
#include <sys/time.h>
#endif
#include <stdio.h>
#include <math.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include "exglobals.h"
#include <X11/extensions/XIproto.h>
#include "xkb/xkbsrv_priv.h"
#include "exglobals.h"
#include "inputstr.h"
#include "eventstr.h"
#include "inpututils.h"
#include <xkbsrv.h>
#if !defined(WIN32)
#include <sys/time.h>
#endif
int XkbDfltRepeatDelay = 660;
int XkbDfltRepeatInterval = 40;

View File

@ -36,12 +36,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/keysym.h>
#include "dix/dix_priv.h"
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "inputstr.h"
#include "exevents.h"
#include "eventstr.h"
#include <xkbsrv.h>
#include "mi.h"
#include "mipointer.h"
#include "inpututils.h"

View File

@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "exevents.h"
#include "exglobals.h"
#include "windowstr.h"
#include <xkbsrv.h>
#include "xkbsrv_priv.h"
/***====================================================================***/

View File

@ -39,17 +39,17 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>
#include <X11/extensions/XKMformat.h>
#include "os/cmdline.h"
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "inputstr.h"
#include "opaque.h"
#include "property.h"
#include "scrnintstr.h"
#include <xkbsrv.h>
#include "xkbgeom.h"
#include <X11/extensions/XKMformat.h>
#include "xkbfile.h"
#define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1)

View File

@ -33,14 +33,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <math.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/XI.h>
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "inputstr.h"
#include <X11/extensions/XI.h>
#include <xkbsrv.h>
/***====================================================================***/
/*
* unsigned
* XkbIndicatorsToUpdate(dev,changed,check_devs_rtrn)

View File

@ -28,21 +28,21 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <dix-config.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <math.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include "xkb/xkbsrv_priv.h"
#include "misc.h"
#include "inputstr.h"
#include "exevents.h"
#include "eventstr.h"
#include <xkbsrv.h>
#include <ctype.h>
#include "events.h"
/***====================================================================***/
void
XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd)
{

View File

@ -52,7 +52,6 @@ DEALINGS IN THE SOFTWARE.
#include <dix-config.h>
#endif
#include "os.h"
#include <stdio.h>
#include <ctype.h>
#include <math.h>
@ -60,10 +59,13 @@ DEALINGS IN THE SOFTWARE.
#include <X11/Xproto.h>
#define XK_CYRILLIC
#include <X11/keysym.h>
#include "xkb/xkbsrv_priv.h"
#include "os.h"
#include "misc.h"
#include "inputstr.h"
#include "eventstr.h"
#include <xkbsrv.h>
#include "xkbgeom.h"
/***====================================================================***/

27
xkb/xkbsrv_priv.h Normal file
View File

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 1993 Silicon Graphics Computer Systems, Inc.
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_XKBSRV_PRIV_H_
#define _XSERVER_XKBSRV_PRIV_H_
#include "xkbsrv.h"
void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, void *);
void XkbForceUpdateDeviceLEDs(DeviceIntPtr keybd);
void XkbPushLockedStateToSlaves(DeviceIntPtr master, int evtype, int key);
Bool XkbCopyKeymap(XkbDescPtr dst, XkbDescPtr src);
void XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE);
int XkbGetEffectiveGroup(XkbSrvInfoPtr xkbi, XkbStatePtr xkbstate, CARD8 keycode);
void XkbMergeLockedPtrBtns(DeviceIntPtr master);
void XkbFakeDeviceButton(DeviceIntPtr dev, int press, int button);
#endif /* _XSERVER_XKBSRV_PRIV_H_ */