From 1f876171067c04fc21fccd5a3051f982fd85c0f0 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 21 Oct 2009 19:07:36 +0000 Subject: Updated to xorg-server-1.7.99.1 --- xorg-server/hw/dmx/doc/html/dmxcursor_8c.html | 1693 +++++++++++++++++++------ 1 file changed, 1340 insertions(+), 353 deletions(-) (limited to 'xorg-server/hw/dmx/doc/html/dmxcursor_8c.html') diff --git a/xorg-server/hw/dmx/doc/html/dmxcursor_8c.html b/xorg-server/hw/dmx/doc/html/dmxcursor_8c.html index 744bc3547..f6abb7f83 100644 --- a/xorg-server/hw/dmx/doc/html/dmxcursor_8c.html +++ b/xorg-server/hw/dmx/doc/html/dmxcursor_8c.html @@ -6,457 +6,1444 @@ - -
Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals
-

dmxcursor.c File Reference

#include "dmx.h"
-#include "dmxsync.h"
-#include "dmxcursor.h"
-#include "dmxlog.h"
-#include "dmxprop.h"
-#include "dmxinput.h"
-#include "mipointer.h"
-#include "windowstr.h"
-#include "globals.h"
-#include "cursorstr.h"
-#include "dixevents.h"
- - - - + + +
+

dmxcursor.c File Reference

#include "dmx.h"
+#include "dmxsync.h"
+#include "dmxcursor.h"
+#include "dmxlog.h"
+#include "dmxprop.h"
+#include "dmxinput.h"
+#include "mipointer.h"
+#include "windowstr.h"
+#include "globals.h"
+#include "cursorstr.h"
+#include "dixevents.h"
+#include "inputstr.h"
+

Functions

void dmxCursorNoMulti (void)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Defines

#define DMX_CURSOR_DEBUG   0
#define DMXDBG0(f)
#define DMXDBG1(f, a)
#define DMXDBG2(f, a, b)
#define DMXDBG3(f, a, b, c)
#define DMXDBG4(f, a, b, c, d)
#define DMXDBG5(f, a, b, c, d, e)
#define DMXDBG6(f, a, b, c, d, e, g)
#define DMXDBG7(f, a, b, c, d, e, g, h)

Functions

void dmxCursorNoMulti (void)
static Bool dmxCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
static void dmxCrossScreen (ScreenPtr pScreen, Bool entering)
static void dmxWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
static int * dmxSLCreate (void)
static void dmxSLFree (int *list)
static int dmxSLFindNext (int *list)
static int dmxTryComputeScreenOrigins (int *screensLeft)
static void dmxComputeScreenOrigins (void)
void dmxReInitOrigins (void)
void dmxInitOrigins (void)
int dmxOnScreen (int x, int y, DMXScreenInfo *dmxScreen)
static int dmxDoesOverlap (DMXScreenInfo *a, DMXScreenInfo *b)
static void * dmxPrintOverlap (DMXScreenInfo *dmxScreen, void *closure)
static void * dmxIterateOverlap (DMXScreenInfo *start, void *(*f)(DMXScreenInfo *dmxScreen, void *), void *closure)
static void * dmxTestSameDisplay (DMXScreenInfo *a, void *closure)
void dmxInitOverlap (void)
void dmxBECreateCursor (ScreenPtr pScreen, CursorPtr pCursor)
static Bool _dmxRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
Bool dmxBEFreeCursor (ScreenPtr pScreen, CursorPtr pCursor)
static Bool _dmxUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
static void _dmxMoveCursor (ScreenPtr pScreen, int x, int y)
static void _dmxSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
static Bool dmxRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
static Bool dmxUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
static CursorPtr dmxFindCursor (DMXScreenInfo *start)
void dmxMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
static void dmxSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
void dmxHideCursor (DMXScreenInfo *dmxScreen)
void dmxCheckCursor (void)
static Bool dmxDeviceCursorInitialize (DeviceIntPtr pDev, ScreenPtr pScr)
static void dmxDeviceCursorCleanup (DeviceIntPtr pDev, ScreenPtr pScr)

Variables

static int dmxCursorDoMultiCursors = 1
miPointerScreenFuncRec dmxPointerCursorFuncs
miPointerSpriteFuncRec dmxPointerSpriteFuncs
+

Detailed Description

+

This file contains code than supports cursor movement, including the code that initializes and reinitializes the screen positions and computes screen overlap.

+

"This code is based very closely on the XFree86 equivalent + (xfree86/common/xf86Cursor.c)." --David Dawes.

+

"This code was then extensively re-written, as explained here." --Rik Faith

+

The code in xf86Cursor.c used edge lists to implement the CursorOffScreen function. The edge list computation was complex (especially in the face of arbitrarily overlapping screens) compared with the speed savings in the CursorOffScreen function. The new implementation has erred on the side of correctness, readability, and maintainability over efficiency. For the common (non-edge) case, the dmxCursorOffScreen function does avoid a loop over all the screens. When the cursor has left the screen, all the screens are searched, and the first screen (in dmxScreens order) containing the cursor will be returned. If run-time profiling shows that this routing is a performance bottle-neck, then an edge list may have to be reimplemented. An edge list algorithm is O(edges) whereas the new algorithm is O(dmxNumScreens). Since edges is usually 1-3 and dmxNumScreens may be 30-60 for large backend walls, this trade off may be compelling.

+

The xf86InitOrigins routine uses bit masks during the computation and is therefore limited to the length of a word (e.g., 32 or 64 bits) screens. Because Xdmx is expected to be used with a large number of backend displays, this limitation was removed. The new implementation has erred on the side of readability over efficiency, using the dmxSL* routines to manage a screen list instead of a bitmap, and a function call to decrease the length of the main routine. Both algorithms are of the same order, and both are called only at server generation time, so trading clarity and long-term maintainability for efficiency does not seem justified in this case.

+

Define Documentation

+ +
+
+ + + + +
#define DMX_CURSOR_DEBUG   0
+
+
-void dmxReInitOrigins (void) +
+
+ +
+
+ + + + + + + + + +
#define DMXDBG0( ) 
+
+ +
+ +
+
+ + + + + + + + + + + + + + +
#define DMXDBG1(f,
 ) 
+
+
-void dmxInitOverlap (void) +

Referenced by dmxBackendLateReInit().

-void dmxBECreateCursor (ScreenPtr pScreen, CursorPtr pCursor) +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define DMXDBG2(f,
a,
 ) 
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define DMXDBG3(f,
a,
b,
 ) 
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define DMXDBG4(f,
a,
b,
c,
 ) 
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define DMXDBG5(f,
a,
b,
c,
d,
 ) 
+
+
- -

Detailed Description

-This file contains code than supports cursor movement, including the code that initializes and reinitializes the screen positions and computes screen overlap.

-"This code is based very closely on the XFree86 equivalent (xfree86/common/xf86Cursor.c)." --David Dawes.

-"This code was then extensively re-written, as explained here." --Rik Faith

-The code in xf86Cursor.c used edge lists to implement the CursorOffScreen function. The edge list computation was complex (especially in the face of arbitrarily overlapping screens) compared with the speed savings in the CursorOffScreen function. The new implementation has erred on the side of correctness, readability, and maintainability over efficiency. For the common (non-edge) case, the dmxCursorOffScreen function does avoid a loop over all the screens. When the cursor has left the screen, all the screens are searched, and the first screen (in dmxScreens order) containing the cursor will be returned. If run-time profiling shows that this routing is a performance bottle-neck, then an edge list may have to be reimplemented. An edge list algorithm is O(edges) whereas the new algorithm is O(dmxNumScreens). Since edges is usually 1-3 and dmxNumScreens may be 30-60 for large backend walls, this trade off may be compelling.

-The xf86InitOrigins routine uses bit masks during the computation and is therefore limited to the length of a word (e.g., 32 or 64 bits) screens. Because Xdmx is expected to be used with a large number of backend displays, this limitation was removed. The new implementation has erred on the side of readability over efficiency, using the dmxSL* routines to manage a screen list instead of a bitmap, and a function call to decrease the length of the main routine. Both algorithms are of the same order, and both are called only at server generation time, so trading clarity and long-term maintainability for efficiency does not seem justified in this case.


Function Documentation

-

- - - - -
- +

Referenced by _dmxMoveCursor(), dmxBackendCollectEvents(), dmxBackendUpdatePosition(), dmxConsoleCollectEvents(), dmxCoreMotion(), and dmxSetCursor().

+ + + + +
+
+
+ + + + + + + + + + + + + + + - - - - + + + + + + + + - - + + + + + + - - +
#define DMXDBG6(f,
a,
b,
void dmxBECreateCursor ScreenPtr  pScreen, c,
d,
CursorPtr  pCursore,
 ) 
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define DMXDBG7(f,
a,
b,
c,
d,
e,
g,
 ) 
-
- - - - - -
-   - - -

-Create pCursor on the back-end associated with pScreen.

-

- - - - -
- + +
+ +

Referenced by dmxBackendCollectEvents().

+ +
+ +

Function Documentation

+ +
+
+
- - - - + + + + + + + + + + - - + + - - + + +
Bool dmxBEFreeCursor ScreenPtr  pScreen, static void _dmxMoveCursor (ScreenPtr  pScreen,
int  x,
CursorPtr  pCursorint  y 
) [static]
+ + + + +
+
+ + + + + + + + + + + + + + + + + +
static Bool _dmxRealizeCursor (ScreenPtr  pScreen,
CursorPtr  pCursor 
) [static]
-
- - - - - -
-   - - -

-Free pCursor on the back-end associated with pScreen.

-

- - - - -
- + + + + +
+
+
+ + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + +
static void _dmxSetCursor (ScreenPtr  pScreen,
CursorPtr  pCursor,
int  x,
void dmxCheckCursor void   ) int  y 
) [static]
+ + + + +
+
+ + + + + + + + + + + + + + + + + +
static Bool _dmxUnrealizeCursor (ScreenPtr  pScreen,
CursorPtr  pCursor 
) [static]
-
- - - - - -
-   - - -

-This routine is called during reconfiguration to make sure the cursor is visible.

-

- - - - -
- + + + + +
+
+
- - - - - - + + + + + + + + + + + + + + + +
void dmxCursorNoMulti void   ) void dmxBECreateCursor (ScreenPtr  pScreen,
CursorPtr  pCursor 
)
+ + + + +
+
+ + + + + + + + + + + + + + + + + +
Bool dmxBEFreeCursor (ScreenPtr  pScreen,
CursorPtr  pCursor 
)
-
- - - - - -
-   - - -

-Turn off support for displaying multiple cursors on overlapped back-end displays. See #dmxCursorDoMultiCursors.

-

- - - - -
- + +
+

Free pCursor on the back-end associated with pScreen.

+ +

References _DMXScreenInfo::beDisplay, _dmxCursorPriv::cursor, DMX_GET_CURSOR_PRIV, and dmxScreens.

+ +

Referenced by _dmxUnrealizeCursor(), and dmxBEDestroyResources().

+ +
+ + +
+
+
- - - - - - + + + + + + +
void dmxHideCursor DMXScreenInfo dmxScreen  ) void dmxCheckCursor (void  ) 
+ + + + +
+
+ + + + + + + + +
static void dmxComputeScreenOrigins (void  )  [static]
-
- - - - - -
-   - - -

-This routine is used by the backend input routines to hide the cursor on a screen that is being used for relative input.

See also:
dmxbackend.c
-
-

- - - - -
- + + + + +
+
+
+ + + + + + - - - - - - + + + + + + + + + +
static void dmxCrossScreen (ScreenPtr  pScreen,
void dmxInitOrigins void   ) Bool  entering 
) [static]
+ +
+
+ + +
+
+ + + + + + + + +
void dmxCursorNoMulti (void  ) 
-
- - - - - -
-   - - -

-Initialize screen origins (and relative position). This is called for each server generation. For dynamic reconfiguration, use dmxReInitOrigins() instead.

-

- - - - -
- + +
+

Turn off support for displaying multiple cursors on overlapped back-end displays. See dmxCursorDoMultiCursors.

+ +

References dmxCursorDoMultiCursors.

+ +

Referenced by ddxProcessArgument().

+ +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + - - - - - - + + + +
static Bool dmxCursorOffScreen (ScreenPtr *  ppScreen,
int *  x,
int *  y 
void dmxInitOverlap void   ) ) [static]
+ + + + +
+
+ + + + + + + + + + + + + + + + + +
static void dmxDeviceCursorCleanup (DeviceIntPtr  pDev,
ScreenPtr  pScr 
) [static]
-
- - - - - -
-   - - -

-Detects overlapping dmxScreens and creates circular lists. This uses an O(dmxNumScreens^2) algorithm, but dmxNumScreens is < 100 and the computation only needs to be performed for every server generation or dynamic reconfiguration .

-

- - - - -
- + +
+ +
+ + +
+
+
- - - - + + + + + + + + + - - + + + +
void dmxMoveCursor ScreenPtr  pScreen, static Bool dmxDeviceCursorInitialize (DeviceIntPtr  pDev,
ScreenPtr  pScr 
int  x, ) [static]
+ +
+ +
+ + +
+
+ + + + + + + + + + + - - + + +
static int dmxDoesOverlap (DMXScreenInfo a,
DMXScreenInfo b 
int  y) [static]
+
+ +
+ +
+
+ + + + + + + + +
static CursorPtr dmxFindCursor (DMXScreenInfo start )  [static]
+
+
+ +

References _DMXScreenInfo::cursor, and _DMXScreenInfo::over.

+ +

Referenced by dmxCheckCursor(), and dmxMoveCursor().

+ +
+
+ +
+
+ + + + + + + - - +
void dmxHideCursor (DMXScreenInfo dmxScreen ) 
+
+
+

This routine is used by the backend input routines to hide the cursor on a screen that is being used for relative input.

+
See also:
dmxbackend.c
+

References _dmxSetCursor(), dmxGetGlobalPosition(), and _DMXScreenInfo::index.

+ +

Referenced by dmxBackendUpdatePosition().

+ +
+
+ +
+
+ + + + + + + + +
void dmxInitOrigins (void  ) 
-
- - - - - -
-   - - -

-Move the cursor to coordinates (x, y)on pScreen. This function is usually called via dmxPointerSpriteFuncs, except during reconfiguration when the cursor is repositioned to force an update on newley overlapping screens and on screens that no longer overlap.

-

- - - - -
- + + + + +
+
+
- - - - + + + + + + + +
int dmxOnScreen int  x, void dmxInitOverlap (void  ) 
+ +
+

Detects overlapping dmxScreens and creates circular lists. This uses an O(dmxNumScreens^2) algorithm, but dmxNumScreens is < 100 and the computation only needs to be performed for every server generation or dynamic reconfiguration .

+ +

References _DMXScreenInfo::cursorNotShared, DMXDBG6, dmxDoesOverlap(), dmxInfo, dmxIterateOverlap(), dmxLog(), dmxLogOutput(), dmxLogOutputCont(), dmxNumScreens, dmxPrintOverlap(), dmxPropertyIterate(), dmxScreens, dmxTestSameDisplay(), _DMXScreenInfo::index, _DMXScreenInfo::name, and _DMXScreenInfo::over.

+ +

Referenced by dmxAdjustCursorBoundaries(), and InitOutput().

+ +
+ + +
+
+ + + + + + + + + + + + - - + + + + + +
static void* dmxIterateOverlap (DMXScreenInfo start,
void *(*)(DMXScreenInfo *dmxScreen, void *)  f,
int  y, void *  closure 
) [static]
+
+
+

Iterate over the screens which overlap with the start screen, calling f with the closure for each argument. Often used with dmxPrintOverlap.

+ +

References _DMXScreenInfo::over.

+ +

Referenced by dmxInitOverlap().

+ +
+
+ +
+
+ + + + + + + + + - - + + + - - + + + + + + + + + + + + + +
void dmxMoveCursor (DeviceIntPtr  pDev,
DMXScreenInfo dmxScreenScreenPtr  pScreen,
int  x,
int  y 
)
+
+
+

Move the cursor to coordinates (x, y)on pScreen. This function is usually called via dmxPointerSpriteFuncs, except during reconfiguration when the cursor is repositioned to force an update on newley overlapping screens and on screens that no longer overlap.

+

The coords (x,y) are in global coord space. We'll loop over the back-end screens and see if they contain the global coord. If so, call _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.

+

References _dmxMoveCursor(), _dmxRealizeCursor(), _dmxSetCursor(), _DMXScreenInfo::cursor, _DMXScreenInfo::cursorNotShared, _DMXScreenInfo::cursorVisible, dmxCursorDoMultiCursors, DMXDBG3, dmxFindCursor(), dmxOnScreen(), dmxScreens, _DMXScreenInfo::index, _DMXScreenInfo::over, _DMXScreenInfo::rootXOrigin, and _DMXScreenInfo::rootYOrigin.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
int dmxOnScreen (int  x,
int  y,
DMXScreenInfo dmxScreen 
)
-
- - - - - -
-   - - -

-Returns non-zero if the global x, y coordinate is on the screen window of the dmxScreen.

-

- - - - -
- + + + + +
+
+
+ + + + + + + + + + + + - - - - - - + + + +
static void* dmxPrintOverlap (DMXScreenInfo dmxScreen,
void *  closure 
void dmxReInitOrigins void   ) ) [static]
+ +
+

Used with dmxInterateOverlap to print out a list of screens which overlap each other.

+

References _DMXScreenInfo::cursorNotShared, dmxLogOutputCont(), _DMXScreenInfo::index, and _DMXScreenInfo::name.

+ +

Referenced by dmxInitOverlap().

+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
static Bool dmxRealizeCursor (DeviceIntPtr  pDev,
ScreenPtr  pScreen,
CursorPtr  pCursor 
) [static]
-
- - - - - -
-   - - -

-Recompute origin information in the dmxScreens list. This is either called from dmxInitOrigins() or from #dmxReconfig().

-


Variable Documentation

-

- - - - -
- + + + + +
+
+
- + + + + + +
miPointerScreenFuncRec dmxPointerCursorFuncs + void dmxReInitOrigins (void  ) 
-
- - - - - -
-   - - -

-Initial value:

+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void dmxSetCursor (DeviceIntPtr  pDev,
ScreenPtr  pScreen,
CursorPtr  pCursor,
int  x,
int  y 
) [static]
+
+ +
+ +
+
+ + + + + + + + + +
static int* dmxSLCreate (void  )  [static]
+
+
+

Create a list of screens that we'll manipulate.

+ +

References dmxNumScreens.

+ +

Referenced by dmxComputeScreenOrigins().

+ +
+
+ +
+
+ + + + + + + + + +
static int dmxSLFindNext (int *  list )  [static]
+
+
+

Find next uninitialized entry in list.

+ +

References dmxNumScreens.

+ +

Referenced by dmxComputeScreenOrigins().

+ +
+
+ +
+
+ + + + + + + + + +
static void dmxSLFree (int *  list )  [static]
+
+
+

Free list.

+ +

Referenced by dmxComputeScreenOrigins().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
static void* dmxTestSameDisplay (DMXScreenInfo a,
void *  closure 
) [static]
+
+
+

Used with dmxPropertyIterate to determine if screen a is the same as the screen closure.

+ +

Referenced by dmxInitOverlap().

+ +
+
+ +
+
+ + + + + + + + + +
static int dmxTryComputeScreenOrigins (int *  screensLeft )  [static]
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
static Bool dmxUnrealizeCursor (DeviceIntPtr  pDev,
ScreenPtr  pScreen,
CursorPtr  pCursor 
) [static]
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void dmxWarpCursor (DeviceIntPtr  pDev,
ScreenPtr  pScreen,
int  x,
int  y 
) [static]
+
+
+ +

References DMXDBG3.

+ +
+
+

Variable Documentation

+ + + +
+
+ + + + +
miPointerScreenFuncRec dmxPointerCursorFuncs
+
+
+Initial value:
 {
-    dmxCursorOffScreen,
-    dmxCrossScreen,
-    dmxWarpCursor,
-    dmxeqEnqueue,
-    dmxeqSwitchScreen
+    dmxCursorOffScreen,
+    dmxCrossScreen,
+    dmxWarpCursor,
+    NULL,
+    NULL,
 }
-
Cursor functions for mi layer.
See also:
dmxcursor.c

+

Cursor functions for mi layer.

+
See also:
dmxcursor.c
+
dmxscrinit.c
-
-

- - - - -
- + +

Referenced by dmxScreenInit().

+ + + + +
+
+
- +
miPointerSpriteFuncRec dmxPointerSpriteFuncs + miPointerSpriteFuncRec dmxPointerSpriteFuncs
-
- - - - - -
-   - - -

-Initial value:

+
+
+Initial value:
 {
-    dmxRealizeCursor,
-    dmxUnrealizeCursor,
-    dmxSetCursor,
-    dmxMoveCursor,
+    dmxRealizeCursor,
+    dmxUnrealizeCursor,
+    dmxSetCursor,
+    dmxMoveCursor,
+    dmxDeviceCursorInitialize,
+    dmxDeviceCursorCleanup
 }
-
Sprite functions for mi layer.
See also:
dmxcursor.c

+

Sprite functions for mi layer.

+
See also:
dmxcursor.c
+
dmxscrinit.c
-
+ +

Referenced by dmxScreenInit().

+ +
+
+
-- cgit v1.2.3