aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2018-02-26 06:17:08 +0100
committerMihai Moldovan <ionic@ionic.de>2018-02-26 06:17:08 +0100
commit711fd244700fb5fe436a8809f31b79290ed2626a (patch)
tree11b6aef0dda91b34286db96d916c9595ede82006
parent3d8f8d7ab27ee116a28aa7fc07adfb6f314571a6 (diff)
parentf1f2a360fc2e2b57c7e090ef5536438d66c2e334 (diff)
downloadnx-libs-711fd244700fb5fe436a8809f31b79290ed2626a.tar.gz
nx-libs-711fd244700fb5fe436a8809f31b79290ed2626a.tar.bz2
nx-libs-711fd244700fb5fe436a8809f31b79290ed2626a.zip
Merge branch 'uli42-pr/update_dbe' into 3.6.x
Attribiutes GH PR #647: https://github.com/ArcticaProject/nx-libs/pull/647
-rw-r--r--nx-X11/programs/Xserver/dbe/Imakefile8
-rw-r--r--nx-X11/programs/Xserver/dbe/dbe.c144
-rw-r--r--nx-X11/programs/Xserver/dbe/dbestruct.h6
-rw-r--r--nx-X11/programs/Xserver/dbe/midbe.c54
-rw-r--r--nx-X11/programs/Xserver/dbe/midbe.h1
5 files changed, 72 insertions, 141 deletions
diff --git a/nx-X11/programs/Xserver/dbe/Imakefile b/nx-X11/programs/Xserver/dbe/Imakefile
index 54ce471c5..3c4f40174 100644
--- a/nx-X11/programs/Xserver/dbe/Imakefile
+++ b/nx-X11/programs/Xserver/dbe/Imakefile
@@ -6,6 +6,14 @@
INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) `pkg-config --cflags-only-I pixman-1`
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
+#if defined(NXAgentServer) && NXAgentServer
+ NX_DEFINES = -DNXAGENT_SERVER
+#endif
+
+ DEFINES = \
+ $(NX_DEFINES) \
+ $(NULL)
+
NormalLibraryObjectRule()
NormalLibraryTarget(dbe,$(OBJS))
diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c
index 85a22219f..588dd0582 100644
--- a/nx-X11/programs/Xserver/dbe/dbe.c
+++ b/nx-X11/programs/Xserver/dbe/dbe.c
@@ -80,39 +80,6 @@ static Bool firstRegistrationPass = TRUE;
/******************************************************************************
*
- * DBE DIX Procedure: DbeValidateBuffer
- *
- * Description:
- *
- * This function is called from VALIDATE_DRAWABLE_AND_GC and from
- * various places in dispatch.c if the server has been compiled with
- * the flags -DNEED_DBE_BUF_BITS and -DNEED_DBE_BUF_VALIDATE.
- * When pWin->dstBuffer changes, this function will be called with pWin
- * as the first argument, the drawable ID that was specified as the
- * second argument (could be a back buffer id), and True for the third
- * argument.
- * When pWin->srcBuffer changes, the third argument will be False, and
- * the first two arguments are as described for dstBuffer.
- *
- * This function should prepare the hardware to access the specified
- * buffer for reads (if dstbuf is False) or writes (if dstbuf is True).
- *
- *****************************************************************************/
-
-void
-DbeValidateBuffer(pWin, drawID, dstbuf)
- WindowPtr pWin;
- XID drawID;
- Bool dstbuf;
-{
- DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
- if (pDbeScreenPriv->ValidateBuffer)
- (*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf);
-}
-
-
-/******************************************************************************
- *
* DBE DIX Procedure: DbeRegisterFunction
*
* Description:
@@ -122,9 +89,7 @@ DbeValidateBuffer(pWin, drawID, dstbuf)
*****************************************************************************/
void
-DbeRegisterFunction(pScreen, funct)
- ScreenPtr pScreen;
- Bool (*funct)();
+DbeRegisterFunction(ScreenPtr pScreen, Bool (*funct) (/* ??? */))
{
int i;
@@ -158,8 +123,7 @@ DbeRegisterFunction(pScreen, funct)
*
*****************************************************************************/
static DbeWindowPrivPtr
-DbeAllocWinPriv(pScreen)
- ScreenPtr pScreen;
+DbeAllocWinPriv(ScreenPtr pScreen)
{
DbeWindowPrivPtr pDbeWindowPriv;
DbeScreenPrivPtr pDbeScreenPriv;
@@ -228,7 +192,7 @@ DbeFallbackAllocWinPriv(pScreen)
*****************************************************************************/
static int
-DbeAllocWinPrivPrivIndex()
+DbeAllocWinPrivPrivIndex(void)
{
return winPrivPrivCount++;
@@ -248,10 +212,7 @@ DbeAllocWinPrivPrivIndex()
*****************************************************************************/
static Bool
-DbeAllocWinPrivPriv(pScreen, index, amount)
- register ScreenPtr pScreen;
- int index;
- unsigned int amount;
+DbeAllocWinPrivPriv(register ScreenPtr pScreen, int index, unsigned int amount)
{
DbeScreenPrivPtr pDbeScreenPriv;
unsigned int oldamount;
@@ -302,9 +263,7 @@ DbeAllocWinPrivPriv(pScreen, index, amount)
*****************************************************************************/
static void
-DbeStubScreen(pDbeScreenPriv, nStubbedScreens)
- DbeScreenPrivPtr pDbeScreenPriv;
- int *nStubbedScreens;
+DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens)
{
/* Stub DIX. */
pDbeScreenPriv->SetupBackgroundPainter = NULL;
@@ -326,7 +285,6 @@ DbeStubScreen(pDbeScreenPriv, nStubbedScreens)
pDbeScreenPriv->EndIdiom = NULL;
pDbeScreenPriv->WinPrivDelete = NULL;
pDbeScreenPriv->ResetProc = NULL;
- pDbeScreenPriv->ValidateBuffer = NULL;
(*nStubbedScreens)++;
@@ -351,8 +309,7 @@ DbeStubScreen(pDbeScreenPriv, nStubbedScreens)
*****************************************************************************/
static int
-ProcDbeGetVersion(client)
- ClientPtr client;
+ProcDbeGetVersion(ClientPtr client)
{
/* REQUEST(xDbeGetVersionReq); */
xDbeGetVersionReply rep;
@@ -401,8 +358,7 @@ ProcDbeGetVersion(client)
*****************************************************************************/
static int
-ProcDbeAllocateBackBufferName(client)
- ClientPtr client;
+ProcDbeAllocateBackBufferName(ClientPtr client)
{
REQUEST(xDbeAllocateBackBufferNameReq);
WindowPtr pWin;
@@ -419,11 +375,17 @@ ProcDbeAllocateBackBufferName(client)
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
/* The window must be valid. */
+#ifndef NXAGENT_SERVER
+ status = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
+ if (status != Success)
+ return status;
+#else
if (!(pWin = SecurityLookupWindow(stuff->window, client,
DixWriteAccess)))
{
return(BadWindow);
}
+#endif
/* The window must be InputOutput. */
if (pWin->drawable.class != InputOutput)
@@ -636,8 +598,7 @@ ProcDbeAllocateBackBufferName(client)
*****************************************************************************/
static int
-ProcDbeDeallocateBackBufferName(client)
- ClientPtr client;
+ProcDbeDeallocateBackBufferName(ClientPtr client)
{
REQUEST(xDbeDeallocateBackBufferNameReq);
DbeWindowPrivPtr pDbeWindowPriv;
@@ -708,8 +669,7 @@ ProcDbeDeallocateBackBufferName(client)
*****************************************************************************/
static int
-ProcDbeSwapBuffers(client)
- ClientPtr client;
+ProcDbeSwapBuffers(ClientPtr client)
{
REQUEST(xDbeSwapBuffersReq);
WindowPtr pWin;
@@ -750,12 +710,21 @@ ProcDbeSwapBuffers(client)
/* Check all windows to swap. */
/* Each window must be a valid window - BadWindow. */
+#ifndef NXAGENT_SERVER
+ error = dixLookupWindow(&pWin, dbeSwapInfo[i].window, client,
+ DixWriteAccess);
+ if (error != Success) {
+ free(swapInfo);
+ return error;
+ }
+#else
if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
DixWriteAccess)))
{
free(swapInfo);
return(BadWindow);
}
+#endif
/* Each window must be double-buffered - BadMatch. */
if (DBE_WINDOW_PRIV(pWin) == NULL)
@@ -839,8 +808,7 @@ ProcDbeSwapBuffers(client)
*****************************************************************************/
static int
-ProcDbeBeginIdiom(client)
- ClientPtr client;
+ProcDbeBeginIdiom(ClientPtr client)
{
/* REQUEST(xDbeBeginIdiomReq); */
DbeScreenPrivPtr pDbeScreenPriv;
@@ -883,8 +851,7 @@ ProcDbeBeginIdiom(client)
*****************************************************************************/
static int
-ProcDbeGetVisualInfo(client)
- ClientPtr client;
+ProcDbeGetVisualInfo(ClientPtr client)
{
REQUEST(xDbeGetVisualInfoReq);
DbeScreenPrivPtr pDbeScreenPriv;
@@ -915,12 +882,21 @@ ProcDbeGetVisualInfo(client)
for (i = 0; i < stuff->n; i++)
{
+#ifndef NXAGENT_SERVER
+ register int rc = dixLookupDrawable(pDrawables+i, drawables[i], client, 0,
+ DixReadAccess);
+ if (rc != Success) {
+ free(pDrawables);
+ return rc;
+ }
+#else
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
drawables[i], client, DixReadAccess)))
{
free(pDrawables);
return(BadDrawable);
}
+#endif
}
}
@@ -1062,8 +1038,7 @@ ProcDbeGetVisualInfo(client)
*****************************************************************************/
static int
-ProcDbeGetBackBufferAttributes(client)
- ClientPtr client;
+ProcDbeGetBackBufferAttributes(ClientPtr client)
{
REQUEST(xDbeGetBackBufferAttributesReq);
xDbeGetBackBufferAttributesReply rep;
@@ -1110,8 +1085,7 @@ ProcDbeGetBackBufferAttributes(client)
*****************************************************************************/
static int
-ProcDbeDispatch(client)
- ClientPtr client;
+ProcDbeDispatch(ClientPtr client)
{
REQUEST(xReq);
@@ -1166,8 +1140,7 @@ ProcDbeDispatch(client)
*****************************************************************************/
static int
-SProcDbeGetVersion(client)
- ClientPtr client;
+SProcDbeGetVersion(ClientPtr client)
{
REQUEST(xDbeGetVersionReq);
@@ -1201,8 +1174,7 @@ SProcDbeGetVersion(client)
*****************************************************************************/
static int
-SProcDbeAllocateBackBufferName(client)
- ClientPtr client;
+SProcDbeAllocateBackBufferName(ClientPtr client)
{
REQUEST(xDbeAllocateBackBufferNameReq);
@@ -1236,8 +1208,7 @@ SProcDbeAllocateBackBufferName(client)
*****************************************************************************/
static int
-SProcDbeDeallocateBackBufferName(client)
- ClientPtr client;
+SProcDbeDeallocateBackBufferName(ClientPtr client)
{
REQUEST (xDbeDeallocateBackBufferNameReq);
@@ -1273,8 +1244,7 @@ SProcDbeDeallocateBackBufferName(client)
*****************************************************************************/
static int
-SProcDbeSwapBuffers(client)
- ClientPtr client;
+SProcDbeSwapBuffers(ClientPtr client)
{
REQUEST(xDbeSwapBuffersReq);
unsigned int i;
@@ -1325,8 +1295,7 @@ SProcDbeSwapBuffers(client)
*****************************************************************************/
static int
-SProcDbeBeginIdiom(client)
- ClientPtr client;
+SProcDbeBeginIdiom(ClientPtr client)
{
REQUEST(xDbeBeginIdiomReq);
@@ -1354,8 +1323,7 @@ SProcDbeBeginIdiom(client)
*****************************************************************************/
static int
-SProcDbeGetVisualInfo(client)
- ClientPtr client;
+SProcDbeGetVisualInfo(ClientPtr client)
{
REQUEST(xDbeGetVisualInfoReq);
@@ -1387,8 +1355,7 @@ SProcDbeGetVisualInfo(client)
*****************************************************************************/
static int
-SProcDbeGetBackBufferAttributes(client)
- ClientPtr client;
+SProcDbeGetBackBufferAttributes(ClientPtr client)
{
REQUEST (xDbeGetBackBufferAttributesReq);
@@ -1413,8 +1380,7 @@ SProcDbeGetBackBufferAttributes(client)
*****************************************************************************/
static int
-SProcDbeDispatch(client)
- ClientPtr client;
+SProcDbeDispatch(ClientPtr client)
{
REQUEST(xReq);
@@ -1468,9 +1434,7 @@ SProcDbeDispatch(client)
*****************************************************************************/
static Bool
-DbeSetupBackgroundPainter(pWin, pGC)
- WindowPtr pWin;
- GCPtr pGC;
+DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
{
void *gcvalues[4];
int ts_x_origin, ts_y_origin;
@@ -1543,9 +1507,7 @@ DbeSetupBackgroundPainter(pWin, pGC)
*
*****************************************************************************/
static int
-DbeDrawableDelete(pDrawable, id)
- void *pDrawable;
- XID id;
+DbeDrawableDelete(void * pDrawable, XID id)
{
return(Success);
@@ -1564,9 +1526,7 @@ DbeDrawableDelete(pDrawable, id)
*
*****************************************************************************/
static int
-DbeWindowPrivDelete(pDbeWinPriv, id)
- void *pDbeWinPriv;
- XID id;
+DbeWindowPrivDelete(void * pDbeWinPriv, XID id)
{
DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv = (DbeWindowPrivPtr)pDbeWinPriv;
@@ -1673,8 +1633,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id)
*
*****************************************************************************/
static void
-DbeResetProc(extEntry)
- ExtensionEntry *extEntry;
+DbeResetProc(ExtensionEntry *extEntry)
{
int i;
ScreenPtr pScreen;
@@ -1729,8 +1688,7 @@ DbeResetProc(extEntry)
*****************************************************************************/
static Bool
-DbeDestroyWindow(pWin)
- WindowPtr pWin;
+DbeDestroyWindow(WindowPtr pWin)
{
DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv;
@@ -1812,7 +1770,7 @@ DbeDestroyWindow(pWin)
*****************************************************************************/
void
-DbeExtensionInit()
+DbeExtensionInit(void)
{
ExtensionEntry *extEntry;
register int i, j;
diff --git a/nx-X11/programs/Xserver/dbe/dbestruct.h b/nx-X11/programs/Xserver/dbe/dbestruct.h
index 17690d5a3..3e5945bdb 100644
--- a/nx-X11/programs/Xserver/dbe/dbestruct.h
+++ b/nx-X11/programs/Xserver/dbe/dbestruct.h
@@ -36,7 +36,6 @@
/* INCLUDES */
-#define NEED_DBE_PROTOCOL
#include <nx-X11/extensions/Xdbeproto.h>
#include "windowstr.h"
@@ -220,11 +219,6 @@ typedef struct _DbeScreenPrivRec
void (*ResetProc)(
ScreenPtr /*pScreen*/
);
- void (*ValidateBuffer)(
- WindowPtr /*pWin*/,
- XID /*bufId*/,
- Bool /*dstbuffer*/
-);
/* Device-specific private information.
*/
diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c
index e241e5f28..0cc838d80 100644
--- a/nx-X11/programs/Xserver/dbe/midbe.c
+++ b/nx-X11/programs/Xserver/dbe/midbe.c
@@ -53,24 +53,16 @@
#include "regionstr.h"
#include "gcstruct.h"
#include "inputstr.h"
+#include "midbe.h"
#include <stdio.h>
-/* DEFINES */
-
-
-/* TYPEDEFS */
-
-
-/* GLOBALS */
-
static int miDbePrivPrivGeneration = 0;
static int miDbeWindowPrivPrivIndex = -1;
-RESTYPE dbeDrawableResType;
-RESTYPE dbeWindowPrivResType;
-int dbeScreenPrivIndex = -1;
-int dbeWindowPrivIndex = -1;
-
+static RESTYPE dbeDrawableResType;
+static RESTYPE dbeWindowPrivResType;
+static int dbeScreenPrivIndex = -1;
+static int dbeWindowPrivIndex = -1;
/******************************************************************************
@@ -90,9 +82,7 @@ int dbeWindowPrivIndex = -1;
*****************************************************************************/
static Bool
-miDbeGetVisualInfo(pScreen, pScrVisInfo)
- ScreenPtr pScreen;
- XdbeScreenVisualInfo *pScrVisInfo;
+miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo)
{
register int i, j, k;
register int count;
@@ -154,10 +144,7 @@ miDbeGetVisualInfo(pScreen, pScrVisInfo)
*****************************************************************************/
static int
-miDbeAllocBackBufferName(pWin, bufId, swapAction)
- WindowPtr pWin;
- XID bufId;
- int swapAction;
+miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
{
ScreenPtr pScreen;
DbeWindowPrivPtr pDbeWindowPriv;
@@ -268,8 +255,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction)
*****************************************************************************/
static void
-miDbeAliasBuffers(pDbeWindowPriv)
- DbeWindowPrivPtr pDbeWindowPriv;
+miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv)
{
int i;
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv =
@@ -295,10 +281,7 @@ miDbeAliasBuffers(pDbeWindowPriv)
*****************************************************************************/
static int
-miDbeSwapBuffers(client, pNumWindows, swapInfo)
- ClientPtr client;
- int *pNumWindows;
- DbeSwapInfoPtr swapInfo;
+miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
{
DbeScreenPrivPtr pDbeScreenPriv;
GCPtr pGC;
@@ -477,9 +460,7 @@ miDbeSwapBuffers(client, pNumWindows, swapInfo)
*****************************************************************************/
static void
-miDbeWinPrivDelete(pDbeWindowPriv, bufId)
- DbeWindowPrivPtr pDbeWindowPriv;
- XID bufId;
+miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
{
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
@@ -526,10 +507,7 @@ miDbeWinPrivDelete(pDbeWindowPriv, bufId)
*****************************************************************************/
static Bool
-miDbePositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x;
- int y;
+miDbePositionWindow(WindowPtr pWin, int x, int y)
{
ScreenPtr pScreen;
DbeScreenPrivPtr pDbeScreenPriv;
@@ -767,8 +745,7 @@ miDbePositionWindow(pWin, x, y)
*****************************************************************************/
static void
-miDbeResetProc(pScreen)
- ScreenPtr pScreen;
+miDbeResetProc(ScreenPtr pScreen)
{
DbeScreenPrivPtr pDbeScreenPriv;
@@ -792,9 +769,7 @@ miDbeResetProc(pScreen)
*****************************************************************************/
Bool
-miDbeInit(pScreen, pDbeScreenPriv)
- ScreenPtr pScreen;
- DbeScreenPrivPtr pDbeScreenPriv;
+miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
/* Copy resource types created by DIX */
dbeDrawableResType = pDbeScreenPriv->dbeDrawableResType;
@@ -839,9 +814,6 @@ miDbeInit(pScreen, pDbeScreenPriv)
pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
- /* The mi implementation doesn't need buffer validation. */
- pDbeScreenPriv->ValidateBuffer = (void (*)())NoopDDA;
-
return(TRUE);
} /* miDbeInit() */
diff --git a/nx-X11/programs/Xserver/dbe/midbe.h b/nx-X11/programs/Xserver/dbe/midbe.h
index a21af12bb..007f2e37b 100644
--- a/nx-X11/programs/Xserver/dbe/midbe.h
+++ b/nx-X11/programs/Xserver/dbe/midbe.h
@@ -1,5 +1,4 @@
/******************************************************************************
- *
* Copyright (c) 1994, 1995 Hewlett-Packard Company
*
* Permission is hereby granted, free of charge, to any person obtaining