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
void dmxBECreateCursor
(
ScreenPtr
pScreen,
CursorPtr
pCursor
)
Create pCursor on the back-end associated with pScreen.
Bool dmxBEFreeCursor
(
ScreenPtr
pScreen,
CursorPtr
pCursor
)
Free pCursor on the back-end associated with pScreen.
void dmxCheckCursor
(
void
)
This routine is called during reconfiguration to make sure the cursor is visible.
void dmxCursorNoMulti
(
void
)
Turn off support for displaying multiple cursors on overlapped back-end displays. See #dmxCursorDoMultiCursors.
Initialize screen origins (and relative position). This is called for each server generation. For dynamic reconfiguration, use dmxReInitOrigins() instead.
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 .
void dmxMoveCursor
(
ScreenPtr
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.
Generated June 29, 2004 for Distributed Multihead X by
doxygen
1.3.4.
@
1.1
log
@Initial revision
@
text
@@
1.1.1.1
log
@Import of XFree86 4.5.0.
@
text
@@
1.1.1.1.2.1
log
@file dmxcursor_8c.html was added on branch netbsd-3 on 2005-04-06 20:00:29 +0000
@
text
@d1 471
@
1.1.1.1.2.2
log
@Apply patch (requested by jmc in ticket #114):
Update XFree86 to version 4.5.0.
@
text
@a0 471
File Index
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
void dmxBECreateCursor
(
ScreenPtr
pScreen,
CursorPtr
pCursor
)
Create pCursor on the back-end associated with pScreen.
Bool dmxBEFreeCursor
(
ScreenPtr
pScreen,
CursorPtr
pCursor
)
Free pCursor on the back-end associated with pScreen.
void dmxCheckCursor
(
void
)
This routine is called during reconfiguration to make sure the cursor is visible.
void dmxCursorNoMulti
(
void
)
Turn off support for displaying multiple cursors on overlapped back-end displays. See #dmxCursorDoMultiCursors.
Initialize screen origins (and relative position). This is called for each server generation. For dynamic reconfiguration, use dmxReInitOrigins() instead.
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 .
void dmxMoveCursor
(
ScreenPtr
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.