1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
4 <meta http-equiv=
"Content-Type" content=
"text/html;charset=iso-8859-1">
5 <title>File Index
</title>
6 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css">
9 <!-- Generated by Doxygen 1.3.4 -->
10 <div class=
"qindex"><a class=
"qindex" href=
"main.html">Main
Page
</a> |
<a class=
"qindex" href=
"classes.html">Alphabetical
List
</a> |
<a class=
"qindex" href=
"annotated.html">Data
Structures
</a> |
<a class=
"qindex" href=
"files.html">File
List
</a> |
<a class=
"qindex" href=
"functions.html">Data
Fields
</a> |
<a class=
"qindex" href=
"globals.html">Globals
</a></div>
11 <h1>dmxcursor.c File Reference
</h1><code>#include
"<a class="el
" href="dmx_8h-source.html
">dmx.h</a>"</code><br>
12 <code>#include
"<a class="el
" href="dmxsync_8h-source.html
">dmxsync.h</a>"</code><br>
13 <code>#include
"<a class="el
" href="dmxcursor_8h-source.html
">dmxcursor.h</a>"</code><br>
14 <code>#include
"<a class="el
" href="dmxlog_8h-source.html
">dmxlog.h</a>"</code><br>
15 <code>#include
"<a class="el
" href="dmxprop_8h-source.html
">dmxprop.h</a>"</code><br>
16 <code>#include
"<a class="el
" href="dmxinput_8h-source.html
">dmxinput.h</a>"</code><br>
17 <code>#include
"mipointer.h"</code><br>
18 <code>#include
"windowstr.h"</code><br>
19 <code>#include
"globals.h"</code><br>
20 <code>#include
"cursorstr.h"</code><br>
21 <code>#include
"dixevents.h"</code><br>
22 <table border=
0 cellpadding=
0 cellspacing=
0>
24 <tr><td colspan=
2><br><h2>Functions
</h2></td></tr>
25 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a12">dmxCursorNoMulti
</a> (void)
</td></tr>
27 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a21">dmxReInitOrigins
</a> (void)
</td></tr>
29 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a22">dmxInitOrigins
</a> (void)
</td></tr>
31 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>int
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a23">dmxOnScreen
</a> (int x, int y,
<a class=
"el" href=
"struct__DMXScreenInfo.html">DMXScreenInfo
</a> *dmxScreen)
</td></tr>
33 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a28">dmxInitOverlap
</a> (void)
</td></tr>
35 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a29">dmxBECreateCursor
</a> (ScreenPtr pScreen, CursorPtr pCursor)
</td></tr>
37 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>Bool
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a31">dmxBEFreeCursor
</a> (ScreenPtr pScreen, CursorPtr pCursor)
</td></tr>
39 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a38">dmxMoveCursor
</a> (ScreenPtr pScreen, int x, int y)
</td></tr>
41 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a40">dmxHideCursor
</a> (
<a class=
"el" href=
"struct__DMXScreenInfo.html">DMXScreenInfo
</a> *dmxScreen)
</td></tr>
43 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>void
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a41">dmxCheckCursor
</a> (void)
</td></tr>
45 <tr><td colspan=
2><br><h2>Variables
</h2></td></tr>
46 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>miPointerScreenFuncRec
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a10">dmxPointerCursorFuncs
</a></td></tr>
48 <tr><td class=
"memItemLeft" nowrap align=right valign=top
>miPointerSpriteFuncRec
</td><td class=
"memItemRight" valign=bottom
><a class=
"el" href=
"dmxcursor_8c.html#a11">dmxPointerSpriteFuncs
</a></td></tr>
51 <hr><a name=
"_details"></a><h2>Detailed Description
</h2>
52 This file contains code than supports cursor movement, including the code that initializes and reinitializes the screen positions and computes screen overlap.
<p>
53 "This code is based very closely on the XFree86 equivalent (xfree86/common/xf86Cursor.c)." --David Dawes.
<p>
54 "This code was then extensively re-written, as explained here." --Rik Faith
<p>
55 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.
<p>
56 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.
<hr><h2>Function Documentation
</h2>
57 <a class=
"anchor" name=
"a29" doxytag=
"dmxcursor.c::dmxBECreateCursor" ></a><p>
58 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
61 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
63 <td class=
"md" nowrap
valign=
"top"> void dmxBECreateCursor
</td>
64 <td class=
"md" valign=
"top">(
</td>
65 <td class=
"md" nowrap
valign=
"top">ScreenPtr
</td>
66 <td class=
"mdname" nowrap
> <em>pScreen
</em>,
</td>
71 <td class=
"md" nowrap
>CursorPtr
</td>
72 <td class=
"mdname" nowrap
> <em>pCursor
</em></td>
76 <td class=
"md">)
</td>
77 <td class=
"md" colspan=
"2"></td>
84 <table cellspacing=
5 cellpadding=
0 border=
0>
92 Create
<em>pCursor
</em> on the back-end associated with
<em>pScreen
</em>.
</td>
95 <a class=
"anchor" name=
"a31" doxytag=
"dmxcursor.c::dmxBEFreeCursor" ></a><p>
96 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
99 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
101 <td class=
"md" nowrap
valign=
"top"> Bool dmxBEFreeCursor
</td>
102 <td class=
"md" valign=
"top">(
</td>
103 <td class=
"md" nowrap
valign=
"top">ScreenPtr
</td>
104 <td class=
"mdname" nowrap
> <em>pScreen
</em>,
</td>
109 <td class=
"md" nowrap
>CursorPtr
</td>
110 <td class=
"mdname" nowrap
> <em>pCursor
</em></td>
114 <td class=
"md">)
</td>
115 <td class=
"md" colspan=
"2"></td>
122 <table cellspacing=
5 cellpadding=
0 border=
0>
130 Free
<em>pCursor
</em> on the back-end associated with
<em>pScreen
</em>.
</td>
133 <a class=
"anchor" name=
"a41" doxytag=
"dmxcursor.c::dmxCheckCursor" ></a><p>
134 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
137 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
139 <td class=
"md" nowrap
valign=
"top"> void dmxCheckCursor
</td>
140 <td class=
"md" valign=
"top">(
</td>
141 <td class=
"md" nowrap
valign=
"top">void
</td>
142 <td class=
"mdname1" valign=
"top" nowrap
> </td>
143 <td class=
"md" valign=
"top"> )
</td>
144 <td class=
"md" nowrap
></td>
151 <table cellspacing=
5 cellpadding=
0 border=
0>
159 This routine is called during reconfiguration to make sure the cursor is visible.
</td>
162 <a class=
"anchor" name=
"a12" doxytag=
"dmxcursor.c::dmxCursorNoMulti" ></a><p>
163 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
166 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
168 <td class=
"md" nowrap
valign=
"top"> void dmxCursorNoMulti
</td>
169 <td class=
"md" valign=
"top">(
</td>
170 <td class=
"md" nowrap
valign=
"top">void
</td>
171 <td class=
"mdname1" valign=
"top" nowrap
> </td>
172 <td class=
"md" valign=
"top"> )
</td>
173 <td class=
"md" nowrap
></td>
180 <table cellspacing=
5 cellpadding=
0 border=
0>
188 Turn off support for displaying multiple cursors on overlapped back-end displays. See #dmxCursorDoMultiCursors.
</td>
191 <a class=
"anchor" name=
"a40" doxytag=
"dmxcursor.c::dmxHideCursor" ></a><p>
192 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
195 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
197 <td class=
"md" nowrap
valign=
"top"> void dmxHideCursor
</td>
198 <td class=
"md" valign=
"top">(
</td>
199 <td class=
"md" nowrap
valign=
"top"><a class=
"el" href=
"struct__DMXScreenInfo.html">DMXScreenInfo
</a> *
</td>
200 <td class=
"mdname1" valign=
"top" nowrap
> <em>dmxScreen
</em> </td>
201 <td class=
"md" valign=
"top"> )
</td>
202 <td class=
"md" nowrap
></td>
209 <table cellspacing=
5 cellpadding=
0 border=
0>
217 This routine is used by the backend input routines to hide the cursor on a screen that is being used for relative input.
<dl compact
><dt><b>See also:
</b></dt><dd><a class=
"el" href=
"dmxbackend_8c.html">dmxbackend.c
</a> </dd></dl>
221 <a class=
"anchor" name=
"a22" doxytag=
"dmxcursor.c::dmxInitOrigins" ></a><p>
222 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
225 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
227 <td class=
"md" nowrap
valign=
"top"> void dmxInitOrigins
</td>
228 <td class=
"md" valign=
"top">(
</td>
229 <td class=
"md" nowrap
valign=
"top">void
</td>
230 <td class=
"mdname1" valign=
"top" nowrap
> </td>
231 <td class=
"md" valign=
"top"> )
</td>
232 <td class=
"md" nowrap
></td>
239 <table cellspacing=
5 cellpadding=
0 border=
0>
247 Initialize screen origins (and relative position). This is called for each server generation. For dynamic reconfiguration, use
<a class=
"el" href=
"dmxcursor_8c.html#a21">dmxReInitOrigins()
</a> instead.
</td>
250 <a class=
"anchor" name=
"a28" doxytag=
"dmxcursor.c::dmxInitOverlap" ></a><p>
251 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
254 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
256 <td class=
"md" nowrap
valign=
"top"> void dmxInitOverlap
</td>
257 <td class=
"md" valign=
"top">(
</td>
258 <td class=
"md" nowrap
valign=
"top">void
</td>
259 <td class=
"mdname1" valign=
"top" nowrap
> </td>
260 <td class=
"md" valign=
"top"> )
</td>
261 <td class=
"md" nowrap
></td>
268 <table cellspacing=
5 cellpadding=
0 border=
0>
276 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 .
</td>
279 <a class=
"anchor" name=
"a38" doxytag=
"dmxcursor.c::dmxMoveCursor" ></a><p>
280 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
283 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
285 <td class=
"md" nowrap
valign=
"top"> void dmxMoveCursor
</td>
286 <td class=
"md" valign=
"top">(
</td>
287 <td class=
"md" nowrap
valign=
"top">ScreenPtr
</td>
288 <td class=
"mdname" nowrap
> <em>pScreen
</em>,
</td>
293 <td class=
"md" nowrap
>int
</td>
294 <td class=
"mdname" nowrap
> <em>x
</em>,
</td>
299 <td class=
"md" nowrap
>int
</td>
300 <td class=
"mdname" nowrap
> <em>y
</em></td>
304 <td class=
"md">)
</td>
305 <td class=
"md" colspan=
"2"></td>
312 <table cellspacing=
5 cellpadding=
0 border=
0>
320 Move the cursor to coordinates (
<em>x
</em>,
<em>y
</em>)on
<em>pScreen
</em>. This function is usually called via
<a class=
"el" href=
"dmxcursor_8h.html#a4">dmxPointerSpriteFuncs
</a>, except during reconfiguration when the cursor is repositioned to force an update on newley overlapping screens and on screens that no longer overlap.
</td>
323 <a class=
"anchor" name=
"a23" doxytag=
"dmxcursor.c::dmxOnScreen" ></a><p>
324 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
327 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
329 <td class=
"md" nowrap
valign=
"top"> int dmxOnScreen
</td>
330 <td class=
"md" valign=
"top">(
</td>
331 <td class=
"md" nowrap
valign=
"top">int
</td>
332 <td class=
"mdname" nowrap
> <em>x
</em>,
</td>
337 <td class=
"md" nowrap
>int
</td>
338 <td class=
"mdname" nowrap
> <em>y
</em>,
</td>
343 <td class=
"md" nowrap
><a class=
"el" href=
"struct__DMXScreenInfo.html">DMXScreenInfo
</a> *
</td>
344 <td class=
"mdname" nowrap
> <em>dmxScreen
</em></td>
348 <td class=
"md">)
</td>
349 <td class=
"md" colspan=
"2"></td>
356 <table cellspacing=
5 cellpadding=
0 border=
0>
364 Returns non-zero if the global
<em>x
</em>,
<em>y
</em> coordinate is on the screen window of the
<em>dmxScreen
</em>.
</td>
367 <a class=
"anchor" name=
"a21" doxytag=
"dmxcursor.c::dmxReInitOrigins" ></a><p>
368 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
371 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
373 <td class=
"md" nowrap
valign=
"top"> void dmxReInitOrigins
</td>
374 <td class=
"md" valign=
"top">(
</td>
375 <td class=
"md" nowrap
valign=
"top">void
</td>
376 <td class=
"mdname1" valign=
"top" nowrap
> </td>
377 <td class=
"md" valign=
"top"> )
</td>
378 <td class=
"md" nowrap
></td>
385 <table cellspacing=
5 cellpadding=
0 border=
0>
393 Recompute origin information in the
<a class=
"el" href=
"dmxinit_8c.html#a2">dmxScreens
</a> list. This is either called from
<a class=
"el" href=
"dmxcursor_8c.html#a22">dmxInitOrigins()
</a> or from #dmxReconfig().
</td>
396 <hr><h2>Variable Documentation
</h2>
397 <a class=
"anchor" name=
"a10" doxytag=
"dmxcursor.c::dmxPointerCursorFuncs" ></a><p>
398 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
401 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
403 <td class=
"md" nowrap
valign=
"top"> miPointerScreenFuncRec
<a class=
"el" href=
"dmxcursor_8h.html#a3">dmxPointerCursorFuncs
</a>
408 <table cellspacing=
5 cellpadding=
0 border=
0>
416 <b>Initial value:
</b><div class=
"fragment"><pre>
421 <a class=
"code" href=
"dmxeq_8c.html#a13">dmxeqEnqueue
</a>,
422 <a class=
"code" href=
"dmxeq_8c.html#a14">dmxeqSwitchScreen
</a>
424 </pre></div>Cursor functions for mi layer.
<dl compact
><dt><b>See also:
</b></dt><dd><a class=
"el" href=
"dmxcursor_8c.html">dmxcursor.c
</a> <p>
425 <a class=
"el" href=
"dmxscrinit_8c.html">dmxscrinit.c
</a> </dd></dl>
429 <a class=
"anchor" name=
"a11" doxytag=
"dmxcursor.c::dmxPointerSpriteFuncs" ></a><p>
430 <table class=
"mdTable" width=
"100%" cellpadding=
"2" cellspacing=
"0">
433 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
435 <td class=
"md" nowrap
valign=
"top"> miPointerSpriteFuncRec
<a class=
"el" href=
"dmxcursor_8h.html#a4">dmxPointerSpriteFuncs
</a>
440 <table cellspacing=
5 cellpadding=
0 border=
0>
448 <b>Initial value:
</b><div class=
"fragment"><pre>
453 <a class=
"code" href=
"dmxcursor_8c.html#a38">dmxMoveCursor
</a>,
455 </pre></div>Sprite functions for mi layer.
<dl compact
><dt><b>See also:
</b></dt><dd><a class=
"el" href=
"dmxcursor_8c.html">dmxcursor.c
</a> <p>
456 <a class=
"el" href=
"dmxscrinit_8c.html">dmxscrinit.c
</a> </dd></dl>
463 Generated June
29,
2004 for
<a
464 href=
"http://dmx.sourceforge.net">Distributed Multihead X
</a> by
465 <a href=
"http://www.doxygen.org/index.html">doxygen
</a>