- don't build java viewer (problems due new gcj)
- use xorg codebase from xorg-x11-server-source package again
- vnc-selection.patch - new xserver selection API/ABI
- vnc-xkb.patch - disable XKEYBOARD extension
- vnc-paint.patch - PaintWindow{Background,Border} hooks have been removed
- vnc-privates.patch - update devPrivates handling
- vnc-mieq.patch - use event queue to handle input events
132 lines
5.2 KiB
Diff
132 lines
5.2 KiB
Diff
--- a/bin/xorg/hw/vnc/vncHooks.cc Mon Jan 21 17:29:11 2008 +0100
|
|
+++ b/bin/xorg/hw/vnc/vncHooks.cc Thu Jan 24 09:50:48 2008 +0100
|
|
@@ -86,9 +86,15 @@ typedef struct {
|
|
GCOps *wrappedOps;
|
|
} vncHooksGCRec, *vncHooksGCPtr;
|
|
|
|
-static int vncHooksScreenIndex;
|
|
-static int vncHooksGCIndex;
|
|
+static DevPrivateKey vncHooksScrPrivateKey = &vncHooksScrPrivateKey;
|
|
+static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
|
|
|
|
+#define vncHooksScreenPrivate(scrn) \
|
|
+ (vncHooksScreenPtr) dixLookupPrivate (&(scrn)->devPrivates, \
|
|
+ vncHooksScrPrivateKey)
|
|
+#define vncHooksGCPrivate(pGC) \
|
|
+ (vncHooksGCPtr) dixLookupPrivate (&(pGC)->devPrivates, \
|
|
+ vncHooksGCPrivateKey)
|
|
|
|
// screen functions
|
|
|
|
@@ -209,26 +215,11 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
|
|
if (vncHooksGeneration != serverGeneration) {
|
|
vncHooksGeneration = serverGeneration;
|
|
|
|
- vncHooksScreenIndex = AllocateScreenPrivateIndex();
|
|
- if (vncHooksScreenIndex < 0) {
|
|
- ErrorF("vncHooksInit: AllocateScreenPrivateIndex failed\n");
|
|
- return FALSE;
|
|
- }
|
|
-
|
|
- vncHooksGCIndex = AllocateGCPrivateIndex();
|
|
- if (vncHooksGCIndex < 0) {
|
|
- ErrorF("vncHooksInit: AllocateGCPrivateIndex failed\n");
|
|
- return FALSE;
|
|
- }
|
|
- }
|
|
-
|
|
- if (!AllocateGCPrivate(pScreen, vncHooksGCIndex, sizeof(vncHooksGCRec))) {
|
|
- ErrorF("vncHooksInit: AllocateGCPrivate failed\n");
|
|
- return FALSE;
|
|
+ if (!dixRequestPrivate (vncHooksGCPrivateKey, sizeof (vncHooksGCRec)))
|
|
+ return FALSE;
|
|
}
|
|
|
|
vncHooksScreen = (vncHooksScreenPtr)xnfalloc(sizeof(vncHooksScreenRec));
|
|
- pScreen->devPrivates[vncHooksScreenIndex].ptr = (pointer)vncHooksScreen;
|
|
|
|
vncHooksScreen->desktop = desktop;
|
|
|
|
@@ -266,6 +257,8 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
|
|
pScreen->DisplayCursor = vncHooksDisplayCursor;
|
|
pScreen->BlockHandler = vncHooksBlockHandler;
|
|
|
|
+ dixSetPrivate (&pScreen->devPrivates, vncHooksScrPrivateKey, vncHooksScreen);
|
|
+
|
|
return TRUE;
|
|
}
|
|
|
|
@@ -281,11 +274,10 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
|
|
// distinct type, so it would have to use templates, and it's not worth that
|
|
// much pain.
|
|
|
|
-#define SCREEN_UNWRAP(scrn,field) \
|
|
- ScreenPtr pScreen = scrn; \
|
|
- vncHooksScreenPtr vncHooksScreen \
|
|
- = ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); \
|
|
- pScreen->field = vncHooksScreen->field; \
|
|
+#define SCREEN_UNWRAP(scrn,field) \
|
|
+ ScreenPtr pScreen = scrn; \
|
|
+ vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate (scrn); \
|
|
+ pScreen->field = vncHooksScreen->field; \
|
|
DBGPRINT((stderr,"vncHooks" #field " called\n"));
|
|
|
|
#define SCREEN_REWRAP(field) pScreen->field = vncHooks##field;
|
|
@@ -322,8 +314,7 @@ static Bool vncHooksCreateGC(GCPtr pGC)
|
|
{
|
|
SCREEN_UNWRAP(pGC->pScreen, CreateGC);
|
|
|
|
- vncHooksGCPtr vncHooksGC
|
|
- = (vncHooksGCPtr)pGC->devPrivates[vncHooksGCIndex].ptr;
|
|
+ vncHooksGCPtr vncHooksGC = vncHooksGCPrivate (pGC);
|
|
|
|
Bool ret = (*pScreen->CreateGC) (pGC);
|
|
|
|
@@ -507,7 +498,7 @@ class GCFuncUnwrapper {
|
|
class GCFuncUnwrapper {
|
|
public:
|
|
GCFuncUnwrapper(GCPtr pGC_) : pGC(pGC_) {
|
|
- vncHooksGC = (vncHooksGCPtr)pGC->devPrivates[vncHooksGCIndex].ptr;
|
|
+ vncHooksGC = vncHooksGCPrivate (pGC);
|
|
pGC->funcs = vncHooksGC->wrappedFuncs;
|
|
if (vncHooksGC->wrappedOps)
|
|
pGC->ops = vncHooksGC->wrappedOps;
|
|
@@ -592,7 +583,7 @@ public:
|
|
GCOpUnwrapper(DrawablePtr pDrawable, GCPtr pGC_)
|
|
: pGC(pGC_), pScreen(pDrawable->pScreen)
|
|
{
|
|
- vncHooksGC = (vncHooksGCPtr)pGC->devPrivates[vncHooksGCIndex].ptr;
|
|
+ vncHooksGC = vncHooksGCPrivate (pGC);
|
|
oldFuncs = pGC->funcs;
|
|
pGC->funcs = vncHooksGC->wrappedFuncs;
|
|
pGC->ops = vncHooksGC->wrappedOps;
|
|
@@ -611,8 +602,7 @@ public:
|
|
#define GC_OP_UNWRAPPER(pDrawable, pGC, name) \
|
|
GCOpUnwrapper u(pDrawable, pGC); \
|
|
ScreenPtr pScreen = (pDrawable)->pScreen; \
|
|
- vncHooksScreenPtr vncHooksScreen \
|
|
- = ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); \
|
|
+ vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate (pScreen); \
|
|
DBGPRINT((stderr,"vncHooks" #name " called\n"));
|
|
|
|
|
|
@@ -1511,8 +1501,7 @@ static void vncHooksComposite(CARD8 op,
|
|
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
|
|
{
|
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
|
- vncHooksScreenPtr vncHooksScreen = \
|
|
- ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
|
|
+ vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate (pScreen);
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
BoxRec box;
|
|
|
|
@@ -1534,8 +1523,7 @@ static void vncHooksGlyphs(CARD8 op, Pic
|
|
GlyphListPtr list, GlyphPtr *glyphs)
|
|
{
|
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
|
- vncHooksScreenPtr vncHooksScreen = \
|
|
- ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
|
|
+ vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate (pScreen);
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
int x, y;
|
|
int n;
|