summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2008-02-29 18:00:27 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2008-02-29 18:01:37 -0500
commitef60632e200853680282016e32a7a9fb01882852 (patch)
treec80d11f651765a3c8996f7d3497cb7eafdaaa6fc /hw
parentcc76ea6e3ac6a405f0c198c4e62be40aa8d2b546 (diff)
dix: Modify callers of property and selection API to use new interfaces.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86Init.c11
-rw-r--r--hw/xprint/pcl/PclMisc.c17
-rw-r--r--hw/xprint/pcl/PclWindow.c6
-rw-r--r--hw/xprint/ps/PsMisc.c17
-rw-r--r--hw/xprint/ps/PsWindow.c6
-rw-r--r--hw/xquartz/applewm.c14
-rw-r--r--hw/xquartz/quartzPasteboard.c48
-rw-r--r--hw/xquartz/xpr/xprFrame.c4
-rwxr-xr-xhw/xwin/winwin32rootless.c4
9 files changed, 54 insertions, 73 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index d1603c081..6d5eaadc3 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -172,12 +172,11 @@ xf86CreateRootWindow(WindowPtr pWin)
Atom prop;
prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE);
- err = ChangeWindowProperty(pWin,
- prop, pProp->type,
- pProp->format, PropModeReplace,
- pProp->size, pProp->data,
- FALSE
- );
+ err = dixChangeWindowProperty(serverClient, pWin,
+ prop, pProp->type,
+ pProp->format, PropModeReplace,
+ pProp->size, pProp->data,
+ FALSE);
}
/* Look at err */
diff --git a/hw/xprint/pcl/PclMisc.c b/hw/xprint/pcl/PclMisc.c
index e0b7dced9..0b37836e9 100644
--- a/hw/xprint/pcl/PclMisc.c
+++ b/hw/xprint/pcl/PclMisc.c
@@ -115,7 +115,7 @@ GetPropString(
if(atom != BAD_RESOURCE)
{
WindowPtr pPropWin;
- int n;
+ int rc, n;
/*
* The atom has been defined, but it might only exist as a
@@ -124,15 +124,12 @@ GetPropString(
for(pPropWin = pWin; pPropWin != (WindowPtr)NULL;
pPropWin = pPropWin->parent)
{
- for(pProp = (PropertyPtr)(wUserProps(pPropWin));
- pProp != (PropertyPtr)NULL;
- pProp = pProp->next)
- {
- if (pProp->propertyName == atom)
- break;
- }
- if(pProp != (PropertyPtr)NULL)
- break;
+ rc = dixLookupProperty(&pProp, pPropWin, atom,
+ serverClient, DixReadAccess);
+ if (rc == Success)
+ break;
+ else
+ pProp = NULL;
}
if(pProp == (PropertyPtr)NULL)
return (char *)NULL;
diff --git a/hw/xprint/pcl/PclWindow.c b/hw/xprint/pcl/PclWindow.c
index a87dc0e7a..950933e49 100644
--- a/hw/xprint/pcl/PclWindow.c
+++ b/hw/xprint/pcl/PclWindow.c
@@ -128,9 +128,9 @@ PclCreateWindow(
{
propName = MakeAtom(propStrings[i], strlen(propStrings[i]),
TRUE);
- ChangeWindowProperty(pWin, propName, XA_STRING, 8,
- PropModeReplace, strlen(propVal),
- (pointer)propVal, FALSE);
+ dixChangeWindowProperty(serverClient, pWin, propName, XA_STRING,
+ 8, PropModeReplace, strlen(propVal),
+ (pointer)propVal, FALSE);
xfree(propVal);
}
}
diff --git a/hw/xprint/ps/PsMisc.c b/hw/xprint/ps/PsMisc.c
index 0df039e0b..8d5005f91 100644
--- a/hw/xprint/ps/PsMisc.c
+++ b/hw/xprint/ps/PsMisc.c
@@ -175,7 +175,7 @@ GetPropString(
if(atom != BAD_RESOURCE)
{
WindowPtr pPropWin;
- int n;
+ int rc, n;
*/
/*
@@ -186,15 +186,12 @@ GetPropString(
for(pPropWin = pWin; pPropWin != (WindowPtr)NULL;
pPropWin = pPropWin->parent)
{
- for(pProp = (PropertyPtr)(wUserProps(pPropWin));
- pProp != (PropertyPtr)NULL;
- pProp = pProp->next)
- {
- if (pProp->propertyName == atom)
- break;
- }
- if(pProp != (PropertyPtr)NULL)
- break;
+ rc = dixLookupProperty(&pProp, pPropWin, atom,
+ serverClient, DixReadAccess);
+ if (rc == Success)
+ break;
+ else
+ pProp = NULL;
}
if(pProp == (PropertyPtr)NULL)
return (char *)NULL;
diff --git a/hw/xprint/ps/PsWindow.c b/hw/xprint/ps/PsWindow.c
index d17cf8ce0..8bfde4b0d 100644
--- a/hw/xprint/ps/PsWindow.c
+++ b/hw/xprint/ps/PsWindow.c
@@ -154,9 +154,9 @@ PsCreateWindow(WindowPtr pWin)
{
propName = MakeAtom(propStrings[i], strlen(propStrings[i]),
TRUE);
- ChangeWindowProperty(pWin, propName, XA_STRING, 8,
- PropModeReplace, strlen(propVal),
- (pointer)propVal, FALSE);
+ dixChangeWindowProperty(serverClient, pWin, propName, XA_STRING,
+ 8, PropModeReplace, strlen(propVal),
+ (pointer)propVal, FALSE);
xfree(propVal);
}
}
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index c460ec6ae..072e57ff4 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -154,8 +154,8 @@ AppleWMSetScreenOrigin(
data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
+ darwinMainScreenY);
- ChangeWindowProperty(pWin, xa_native_screen_origin(), XA_INTEGER,
- 32, PropModeReplace, 2, data, TRUE);
+ dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
+ XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
}
/* Window managers can set the _APPLE_NO_ORDER_IN property on windows
@@ -169,15 +169,11 @@ AppleWMDoReorderWindow(
{
Atom atom;
PropertyPtr prop;
+ int rc;
atom = xa_apple_no_order_in();
- for (prop = wUserProps(pWin); prop != NULL; prop = prop->next)
- {
- if (prop->propertyName == atom && prop->type == atom)
- return FALSE;
- }
-
- return TRUE;
+ rc = dixLookupProperty(&prop, pWin, atom, serverClient, DixReadAccess);
+ return (rc == Success) && (prop->type == atom);
}
diff --git a/hw/xquartz/quartzPasteboard.c b/hw/xquartz/quartzPasteboard.c
index 0cecff54a..0bf84f5d5 100644
--- a/hw/xquartz/quartzPasteboard.c
+++ b/hw/xquartz/quartzPasteboard.c
@@ -43,9 +43,6 @@
#include "selection.h"
#include "globals.h"
-extern Selection *CurrentSelections;
-extern int NumCurrentSelections;
-
// Helper function to read the X11 cut buffer
// FIXME: What about multiple screens? Currently, this reads the first
@@ -54,18 +51,16 @@ extern int NumCurrentSelections;
// Returns NULL if there is no cut text or there is not enough memory.
static char * QuartzReadCutBuffer(void)
{
- int i;
+ int rc, i;
char *text = NULL;
for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i];
PropertyPtr pProp;
- pProp = wUserProps (WindowTable[pScreen->myNum]);
- while (pProp && pProp->propertyName != XA_CUT_BUFFER0) {
- pProp = pProp->next;
- }
- if (! pProp) continue;
+ rc = dixLookupProperty(&pProp, WindowTable[pScreen->myNum],
+ XA_CUT_BUFFER0, serverClient, DixReadAccess);
+ if (rc != Success) continue;
if (pProp->type != XA_STRING) continue;
if (pProp->format != 8) continue;
@@ -108,43 +103,40 @@ void QuartzReadPasteboard(void)
if ((text && oldText && !strequal(text, oldText)) ||
(text && !oldText)) {
- int scrn, sel;
+ int scrn, rc;
+ Selection *pSel;
for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
ScreenPtr pScreen = screenInfo.screens[scrn];
// Set the cut buffers on each screen
// fixme really on each screen?
- ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0,
- XA_STRING, 8, PropModeReplace,
- strlen(text), (pointer)text, TRUE);
+ dixChangeWindowProperty(serverClient, WindowTable[pScreen->myNum],
+ XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
+ strlen(text), (pointer)text, TRUE);
}
// Undo any current X selection (similar to code in dispatch.c)
// FIXME: what about secondary selection?
// FIXME: only touch first XA_PRIMARY selection?
- sel = 0;
- while ((sel < NumCurrentSelections) &&
- CurrentSelections[sel].selection != XA_PRIMARY)
- sel++;
- if (sel < NumCurrentSelections) {
+ rc = dixLookupSelection(&pSel, XA_PRIMARY, serverClient,
+ DixSetAttrAccess);
+ if (rc == Success) {
// Notify client if necessary
- if (CurrentSelections[sel].client) {
+ if (pSel->client) {
xEvent event;
event.u.u.type = SelectionClear;
event.u.selectionClear.time = GetTimeInMillis();
- event.u.selectionClear.window = CurrentSelections[sel].window;
- event.u.selectionClear.atom = CurrentSelections[sel].selection;
- TryClientEvents(CurrentSelections[sel].client, &event, 1,
- NoEventMask, NoEventMask /*CantBeFiltered*/,
- NullGrab);
+ event.u.selectionClear.window = pSel->window;
+ event.u.selectionClear.atom = pSel->selection;
+ TryClientEvents(pSel->client, &event, 1, NoEventMask,
+ NoEventMask /*CantBeFiltered*/, NullGrab);
}
// Erase it
- // FIXME: need to erase .selection too? dispatch.c doesn't
- CurrentSelections[sel].pWin = NullWindow;
- CurrentSelections[sel].window = None;
- CurrentSelections[sel].client = NullClient;
+ pSel->pWin = NullWindow;
+ pSel->window = None;
+ pSel->client = NullClient;
}
}
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index b9a33de90..864ef0d40 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -90,8 +90,8 @@ xprSetNativeProperty(RootlessWindowPtr pFrame)
/* FIXME: move this to AppleWM extension */
data = native_id;
- ChangeWindowProperty(pFrame->win, xa_native_window_id(),
- XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE);
+ dixChangeWindowProperty(serverClient, pFrame->win, xa_native_window_id(),
+ XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE);
}
}
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 4b4cd3ded..6f4e2c97e 100755
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -1087,6 +1087,6 @@ winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame)
/* FIXME: move this to WindowsWM extension */
lData = (long) pRLWinPriv->hWnd;
- ChangeWindowProperty (pFrame->win, AtmWindowsWmNativeHwnd (),
- XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
+ dixChangeWindowProperty(serverClient, pFrame->win, AtmWindowsWmNativeHwnd(),
+ XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
}