diff options
Diffstat (limited to 'hw/xnest')
-rw-r--r-- | hw/xnest/Args.c | 5 | ||||
-rw-r--r-- | hw/xnest/Cursor.c | 73 | ||||
-rw-r--r-- | hw/xnest/Events.c | 10 | ||||
-rw-r--r-- | hw/xnest/GCOps.c | 13 | ||||
-rw-r--r-- | hw/xnest/Keyboard.c | 3 | ||||
-rw-r--r-- | hw/xnest/Screen.c | 65 | ||||
-rw-r--r-- | hw/xnest/XNCursor.h | 9 |
7 files changed, 75 insertions, 103 deletions
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c index 0da0d5006..cc9a2707f 100644 --- a/hw/xnest/Args.c +++ b/hw/xnest/Args.c @@ -47,6 +47,11 @@ int xnestNumScreens = 0; Bool xnestDoDirectColormaps = False; Window xnestParentWindow = 0; +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument (int argc, char *argv[], int i) { diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index 146e7ebd0..aaab62c23 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -33,59 +33,6 @@ is" without express or implied warranty. #include "Keyboard.h" #include "Args.h" -void -xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox) -{ -#ifdef _XSERVER64 - Window64 wroot; -#else - Window wroot; -#endif - - int wx, wy; - unsigned int wwidth, wheight; - unsigned int wborderwidth; - unsigned int wdepth; - - XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot, - &wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth); - - if (pBox->x1 <= 0 && pBox->y1 <= 0 && - pBox->x2 >= wwidth && pBox->y2 >= wheight) - XUngrabPointer(xnestDisplay, CurrentTime); - else { - XReparentWindow(xnestDisplay, xnestConfineWindow, - xnestDefaultWindows[pScreen->myNum], - pBox->x1, pBox->y1); - XResizeWindow(xnestDisplay, xnestConfineWindow, - pBox->x2 - pBox->x1, pBox->y2 - pBox->y1); - - XGrabPointer(xnestDisplay, - xnestDefaultWindows[pScreen->myNum], - True, - xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask), - GrabModeAsync, GrabModeAsync, - xnestConfineWindow, - None, CurrentTime); - } -} - -void -xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, - BoxPtr pTopLeftBox) -{ - *pTopLeftBox = *pHotBox; -} - -Bool -xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) -{ - XDefineCursor(xnestDisplay, - xnestDefaultWindows[pScreen->myNum], - xnestCursor(pCursor, pScreen)); - return True; -} - Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { @@ -192,15 +139,17 @@ xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed) &fg_color, &bg_color); } -Bool -xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent) +void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { - int i; + if (pCursor) + { + XDefineCursor(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + xnestCursor(pCursor, pScreen)); + } +} - for (i = 0; i < xnestNumScreens; i++) - XWarpPointer(xnestDisplay, xnestDefaultWindows[i], - xnestDefaultWindows[pScreen->myNum], - 0, 0, 0, 0, x, y); - - return True; +void +xnestMoveCursor (ScreenPtr pScreen, int x, int y) +{ } diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index a36e0d8e8..69a3c208f 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -34,6 +34,7 @@ is" without express or implied warranty. #include "Screen.h" #include "XNWindow.h" #include "Events.h" +#include "mipointer.h" CARD32 lastEventTime = 0; @@ -41,6 +42,7 @@ void ProcessInputEvents() { mieqProcessInputEvents(); + miPointerUpdate(); } int @@ -131,11 +133,15 @@ xnestCollectEvents() break; case MotionNotify: +#if 0 x.u.u.type = MotionNotify; x.u.keyButtonPointer.rootX = X.xmotion.x; x.u.keyButtonPointer.rootY = X.xmotion.y; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); mieqEnqueue(&x); +#endif + miPointerAbsoluteCursor (X.xmotion.x, X.xmotion.y, + lastEventTime = GetTimeInMillis()); break; case FocusIn: @@ -162,11 +168,15 @@ xnestCollectEvents() pScreen = xnestScreen(X.xcrossing.window); if (pScreen) { NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y); +#if 0 x.u.u.type = MotionNotify; x.u.keyButtonPointer.rootX = X.xcrossing.x; x.u.keyButtonPointer.rootY = X.xcrossing.y; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); mieqEnqueue(&x); +#endif + miPointerAbsoluteCursor (X.xcrossing.x, X.xcrossing.y, + lastEventTime = GetTimeInMillis()); xnestDirectInstallColormaps(pScreen); } } diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 042a29f6e..4ccc0b916 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -310,5 +310,16 @@ void xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, int width, int height, int x, int y) { - ErrorF("xnest warning: function xnestPushPixels not implemented\n"); + /* only works for solid bitmaps */ + if (pGC->fillStyle == FillSolid) + { + XSetStipple (xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap)); + XSetTSOrigin (xnestDisplay, xnestGC(pGC), x, y); + XSetFillStyle (xnestDisplay, xnestGC(pGC), FillStippled); + XFillRectangle (xnestDisplay, xnestDrawable(pDst), + xnestGC(pGC), x, y, width, height); + XSetFillStyle (xnestDisplay, xnestGC(pGC), FillSolid); + } + else + ErrorF("xnest warning: function xnestPushPixels not implemented\n"); } diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 2a4c7d1bb..b7cae839f 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -1,5 +1,5 @@ /* $Xorg: Keyboard.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */ -/* $XdotOrg$ */ +/* $XdotOrg: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.2 2004/04/23 19:54:21 eich Exp $ */ /* Copyright 1993 by Davor Matic @@ -14,6 +14,7 @@ is" without express or implied warranty. */ /* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.9 2003/09/13 21:33:09 dawes Exp $ */ + #define NEED_EVENTS #include "X.h" #include "Xproto.h" diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 3412edfb8..8490a7995 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -124,6 +124,14 @@ static miPointerScreenFuncRec xnestPointerCursorFuncs = miPointerWarpCursor }; +static miPointerSpriteFuncRec xnestPointerSpriteFuncs = +{ + xnestRealizeCursor, + xnestUnrealizeCursor, + xnestSetCursor, + xnestMoveCursor, +}; + Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) { @@ -241,27 +249,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) xnestHeight = gattributes.height; } - /* myNum */ - /* id */ - miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth, - rootDepth, - numDepths, depths, - defaultVisual, /* root visual */ - numVisuals, visuals); - - miInitializeBackingStore(pScreen); - - miDCInitialize(pScreen, &xnestPointerCursorFuncs); - - pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay, - DefaultScreen(xnestDisplay)) / - DisplayWidth(xnestDisplay, - DefaultScreen(xnestDisplay)); - pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay, - DefaultScreen(xnestDisplay)) / - DisplayHeight(xnestDisplay, - DefaultScreen(xnestDisplay)); - pScreen->defColormap = (Colormap) FakeClientID(0); pScreen->minInstalledCmaps = MINCMAPS; pScreen->maxInstalledCmaps = MAXCMAPS; @@ -282,7 +269,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) /* Random screen procedures */ - pScreen->CloseScreen = xnestCloseScreen; pScreen->QueryBestSize = xnestQueryBestSize; pScreen->SaveScreen = xnestSaveScreen; pScreen->GetImage = xnestGetImage; @@ -324,16 +310,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->RealizeFont = xnestRealizeFont; pScreen->UnrealizeFont = xnestUnrealizeFont; - /* Cursor Procedures */ - - pScreen->ConstrainCursor = xnestConstrainCursor; - pScreen->CursorLimits = xnestCursorLimits; - pScreen->DisplayCursor = xnestDisplayCursor; - pScreen->RealizeCursor = xnestRealizeCursor; - pScreen->UnrealizeCursor = xnestUnrealizeCursor; - pScreen->RecolorCursor = xnestRecolorCursor; - pScreen->SetCursorPosition = xnestSetCursorPosition; - /* GC procedures */ pScreen->CreateGC = xnestCreateGC; @@ -356,6 +332,31 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA; pScreen->blockData = NULL; pScreen->wakeupData = NULL; + /* myNum */ + /* id */ + miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth, + rootDepth, + numDepths, depths, + defaultVisual, /* root visual */ + numVisuals, visuals); + +/* miInitializeBackingStore(pScreen); */ + + miPointerInitialize (pScreen, &xnestPointerSpriteFuncs, + &xnestPointerCursorFuncs, True); + + pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay, + DefaultScreen(xnestDisplay)) / + DisplayWidth(xnestDisplay, + DefaultScreen(xnestDisplay)); + pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay, + DefaultScreen(xnestDisplay)) / + DisplayHeight(xnestDisplay, + DefaultScreen(xnestDisplay)); + + /* overwrite miCloseScreen with our own */ + pScreen->CloseScreen = xnestCloseScreen; + if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL)) return FALSE; diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h index b396c80b5..8684a5e7f 100644 --- a/hw/xnest/XNCursor.h +++ b/hw/xnest/XNCursor.h @@ -27,14 +27,9 @@ typedef struct { #define xnestCursor(pCursor, pScreen) \ (xnestCursorPriv(pCursor, pScreen)->cursor) -void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox); -void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, - BoxPtr pTopLeftBox); -Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor); Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); -void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed); -Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, - Bool generateEvent); +void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y); +void xnestMoveCursor (ScreenPtr pScreen, int x, int y); #endif /* XNESTCURSOR_H */ |