aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2016-06-25 01:35:40 +0200
committerMihai Moldovan <ionic@ionic.de>2016-06-25 01:35:40 +0200
commit975511c875674f097bbd2be33fa947a48d8c77c6 (patch)
tree207bba2c48054f551f19ed5aa89b9dd9616b8c60 /nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
parent9df153668423af868d0df739188a772fbc3356c6 (diff)
parenta5befd4e20813910022ed771cb599f15bbf4664d (diff)
downloadnx-libs-975511c875674f097bbd2be33fa947a48d8c77c6.tar.gz
nx-libs-975511c875674f097bbd2be33fa947a48d8c77c6.tar.bz2
nx-libs-975511c875674f097bbd2be33fa947a48d8c77c6.zip
Merge branch 'sunweaver-pr/hw-nxagent-drop-duplicate-Xserver-code_disable-Xserver-code-and-include-in-nxagent' into arctica-3.6.x
Attributes GH PR #120: https://github.com/ArcticaProject/nx-libs/pull/120
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXproperty.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXproperty.c351
1 files changed, 1 insertions, 350 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
index d6c5aa4dd..2458c12d0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -64,42 +64,13 @@ SOFTWARE.
******************************************************************/
/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <nx-X11/X.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <nx-X11/Xproto.h>
-#include "windowstr.h"
-#include "propertyst.h"
-#include "dixstruct.h"
-#include "../../dix/dispatch.h"
-#include "swaprep.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include <nx-X11/extensions/security.h>
-#endif
-#ifdef LBX
-#include "lbxserve.h"
-#include "lbxtags.h"
-#endif
+#include "../../dix/property.c"
#include "Options.h"
#include "Rootless.h"
#include "Client.h"
#include "Windows.h"
-#if defined(LBX) || defined(LBX_COMPAT)
-#if 0 /* no header in X11 environment, not used in X11 environment */
-int fWriteToClient(ClientPtr client, int len, char *buf)
-{
- return WriteToClient(client, len, buf);
-}
-#endif
-#endif
-
extern Atom clientCutProperty;
#ifdef NXAGENT_SERVER
@@ -111,129 +82,6 @@ typedef struct
nxagentWMStateRec;
#endif
-/*****************************************************************
- * Property Stuff
- *
- * ChangeProperty, DeleteProperty, GetProperties,
- * ListProperties
- *
- * Properties below to windows. A allocate slots each time
- * a property is added. No fancy searching done.
- *
- *****************************************************************/
-
-#ifdef notdef
-static void
-PrintPropertys(WindowPtr pWin)
-{
- PropertyPtr pProp;
- register int j;
-
- pProp = pWin->userProps;
- while (pProp)
- {
- ErrorF( "%x %x\n", pProp->propertyName, pProp->type);
- ErrorF("property format: %d\n", pProp->format);
- ErrorF("property data: \n");
- for (j=0; j<(pProp->format/8)*pProp->size; j++)
- ErrorF("%c\n", pProp->data[j]);
- pProp = pProp->next;
- }
-}
-#endif
-
-int
-ProcRotateProperties(ClientPtr client)
-{
- int i, j, delta;
- REQUEST(xRotatePropertiesReq);
- WindowPtr pWin;
- register Atom * atoms;
- PropertyPtr * props; /* array of pointer */
- PropertyPtr pProp;
- xEvent event;
-
- REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2);
- UpdateCurrentTime();
- pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (!stuff->nAtoms)
- return(Success);
- atoms = (Atom *) & stuff[1];
- props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr));
- if (!props)
- return(BadAlloc);
- for (i = 0; i < stuff->nAtoms; i++)
- {
-#ifdef XCSECURITY
- char action = SecurityCheckPropertyAccess(client, pWin, atoms[i],
- SecurityReadAccess|SecurityWriteAccess);
-#endif
- if (!ValidAtom(atoms[i])
-#ifdef XCSECURITY
- || (SecurityErrorOperation == action)
-#endif
- )
- {
- DEALLOCATE_LOCAL(props);
- client->errorValue = atoms[i];
- return BadAtom;
- }
-#ifdef XCSECURITY
- if (SecurityIgnoreOperation == action)
- {
- DEALLOCATE_LOCAL(props);
- return Success;
- }
-#endif
- for (j = i + 1; j < stuff->nAtoms; j++)
- if (atoms[j] == atoms[i])
- {
- DEALLOCATE_LOCAL(props);
- return BadMatch;
- }
- pProp = wUserProps (pWin);
- while (pProp)
- {
- if (pProp->propertyName == atoms[i])
- goto found;
- pProp = pProp->next;
- }
- DEALLOCATE_LOCAL(props);
- return BadMatch;
-found:
- props[i] = pProp;
- }
- delta = stuff->nPositions;
-
- /* If the rotation is a complete 360 degrees, then moving the properties
- around and generating PropertyNotify events should be skipped. */
-
- if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 )
- {
- while (delta < 0) /* faster if abs value is small */
- delta += stuff->nAtoms;
- for (i = 0; i < stuff->nAtoms; i++)
- {
- /* Generate a PropertyNotify event for each property whose value
- is changed in the order in which they appear in the request. */
-
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyNewValue;
- event.u.property.atom = props[i]->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
-
- props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms];
- }
- }
- DEALLOCATE_LOCAL(props);
- return Success;
-}
-
int
ProcChangeProperty(ClientPtr client)
{
@@ -315,13 +163,8 @@ ProcChangeProperty(ClientPtr client)
}
#endif
-#ifdef LBX
- err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type,
- (int)format, (int)mode, len, TRUE, (void *)&stuff[1], TRUE, NULL);
-#else
err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
(int)mode, len, (void *)&stuff[1], TRUE);
-#endif
if (err != Success)
return err;
else
@@ -349,11 +192,6 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
int mode, unsigned long len, void * value,
Bool sendevent)
{
-#ifdef LBX
- return LbxChangeWindowProperty(NULL, pWin, property, type,
- format, mode, len, TRUE, value,
- sendevent, NULL);
-#else
PropertyPtr pProp;
xEvent event;
int sizeInBytes;
@@ -473,92 +311,6 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
}
return(Success);
-#endif
-}
-
-int
-DeleteProperty(WindowPtr pWin, Atom propName)
-{
- PropertyPtr pProp, prevProp;
- xEvent event;
-
- if (!(pProp = wUserProps (pWin)))
- return(Success);
- prevProp = (PropertyPtr)NULL;
- while (pProp)
- {
- if (pProp->propertyName == propName)
- break;
- prevProp = pProp;
- pProp = pProp->next;
- }
- if (pProp)
- {
- if (prevProp == (PropertyPtr)NULL) /* takes care of head */
- {
- if (!(pWin->optional->userProps = pProp->next))
- CheckWindowOptionalNeed (pWin);
- }
- else
- {
- prevProp->next = pProp->next;
- }
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- xfree(pProp->data);
- xfree(pProp);
- }
- return(Success);
-}
-
-void
-DeleteAllWindowProperties(WindowPtr pWin)
-{
- PropertyPtr pProp, pNextProp;
- xEvent event;
-
- pProp = wUserProps (pWin);
- while (pProp)
- {
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- pNextProp = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
- pProp = pNextProp;
- }
-}
-
-static int
-NullPropertyReply(
- ClientPtr client,
- ATOM propertyType,
- int format,
- xGetPropertyReply *reply)
-{
- reply->nItems = 0;
- reply->length = 0;
- reply->bytesAfter = 0;
- reply->propertyType = propertyType;
- reply->format = format;
- WriteReplyToClient(client, sizeof(xGenericReply), reply);
- return(client->noClientException);
}
/*****************
@@ -712,13 +464,6 @@ ProcGetProperty(ClientPtr client)
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
return(Success);
}
-#ifdef LBX
- /* make sure we have the current value */
- if (pProp->tag_id && pProp->owner_pid) {
- LbxStallPropRequest(client, pProp);
- return client->noClientException;
- }
-#endif
/*
* Return type, format, value to client
@@ -769,10 +514,6 @@ ProcGetProperty(ClientPtr client)
if (stuff->delete && (reply.bytesAfter == 0))
{ /* delete the Property */
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
if (prevProp == (PropertyPtr)NULL) /* takes care of head */
{
if (!(pWin->optional->userProps = pProp->next))
@@ -888,10 +629,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (delete && (*bytesAfter == 0))
{ /* delete the Property */
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
if (prevProp == (PropertyPtr)NULL) /* takes care of head */
{
if (!(pWin->optional->userProps = pProp->next))
@@ -905,89 +642,3 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success);
}
#endif
-
-int
-ProcListProperties(ClientPtr client)
-{
- Atom *pAtoms = NULL, *temppAtoms;
- xListPropertiesReply xlpr;
- int numProps = 0;
- WindowPtr pWin;
- PropertyPtr pProp;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
-
- pProp = wUserProps (pWin);
- while (pProp)
- {
- pProp = pProp->next;
- numProps++;
- }
- if (numProps)
- if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom))))
- return(BadAlloc);
-
- xlpr.type = X_Reply;
- xlpr.nProperties = numProps;
- xlpr.length = (numProps * sizeof(Atom)) >> 2;
- xlpr.sequenceNumber = client->sequence;
- pProp = wUserProps (pWin);
- temppAtoms = pAtoms;
- while (pProp)
- {
- *temppAtoms++ = pProp->propertyName;
- pProp = pProp->next;
- }
- WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
- if (numProps)
- {
- client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
- WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- DEALLOCATE_LOCAL(pAtoms);
- }
- return(client->noClientException);
-}
-
-int
-ProcDeleteProperty(register ClientPtr client)
-{
- WindowPtr pWin;
- REQUEST(xDeletePropertyReq);
- int result;
-
- REQUEST_SIZE_MATCH(xDeletePropertyReq);
- UpdateCurrentTime();
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return (BadAtom);
- }
-
-#ifdef XCSECURITY
- switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
- SecurityDestroyAccess))
- {
- case SecurityErrorOperation:
- client->errorValue = stuff->property;
- return BadAtom;;
- case SecurityIgnoreOperation:
- return Success;
- }
-#endif
-
- result = DeleteProperty(pWin, stuff->property);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-