Commit 969d9af2 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXproperty.c: GetWindowProperty(): add more comments, restruct prototype

parent 3cabdfa2
...@@ -446,25 +446,20 @@ ProcGetProperty(ClientPtr client) ...@@ -446,25 +446,20 @@ ProcGetProperty(ClientPtr client)
return(client->noClientException); return(client->noClientException);
} }
#ifdef NXAGENT_CLIPBOARD /*
/* GetWindowProperty clipboard use only */ * GetWindowProperty is the internal implementation of the
/* FIXME: that's wrong, it is also called in Window.c and Events.c */ * XGetWindowProperty() Xlib call. It is called from
/* FIXME: should be moved to a different file, is not derived from * Clipboard.c, Window.c and Events.c
dix */ *
* FIXME: should be moved to a different file, is not derived from
* dix
*/
int int
GetWindowProperty(pWin, property, longOffset, longLength, delete, GetWindowProperty(WindowPtr pWin, Atom property, long longOffset,
type, actualType, format, nItems, bytesAfter, propData ) long longLength, Bool delete, Atom type,
WindowPtr pWin; Atom *actualType, int *format, unsigned
Atom property; long *nItems, unsigned long *bytesAfter,
long longOffset; unsigned char **propData)
long longLength;
Bool delete;
Atom type;
Atom *actualType;
int *format;
unsigned long *nItems;
unsigned long *bytesAfter;
unsigned char **propData;
{ {
if (!pWin) if (!pWin)
{ {
...@@ -527,7 +522,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -527,7 +522,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
* Return type, format, value to client * Return type, format, value to client
*/ */
unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
unsigned long ind = longOffset << 2; unsigned long ind = longOffset << 2; /* byte offset */
/* If longOffset is invalid such that it causes "len" to /* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */ be negative, it's a value error. */
...@@ -540,6 +535,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -540,6 +535,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return BadValue; return BadValue;
} }
/* minimum of prop size and requested size */
unsigned long len = min(n - ind, 4 * longLength); unsigned long len = min(n - ind, 4 * longLength);
*bytesAfter = n - (ind + len); *bytesAfter = n - (ind + len);
...@@ -577,7 +573,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -577,7 +573,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
} }
return Success; return Success;
} }
#endif
int int
ProcDeleteProperty(register ClientPtr client) ProcDeleteProperty(register ClientPtr client)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment