summaryrefslogtreecommitdiff
path: root/hw/dmx/doc/html/dmxcursor_8c.html
blob: 744bc35473f7d5006e33ecb7f5c342ade675f4c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>File Index</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>dmxcursor.c File Reference</h1><code>#include "<a class="el" href="dmx_8h-source.html">dmx.h</a>"</code><br>
<code>#include "<a class="el" href="dmxsync_8h-source.html">dmxsync.h</a>"</code><br>
<code>#include "<a class="el" href="dmxcursor_8h-source.html">dmxcursor.h</a>"</code><br>
<code>#include "<a class="el" href="dmxlog_8h-source.html">dmxlog.h</a>"</code><br>
<code>#include "<a class="el" href="dmxprop_8h-source.html">dmxprop.h</a>"</code><br>
<code>#include "<a class="el" href="dmxinput_8h-source.html">dmxinput.h</a>"</code><br>
<code>#include "mipointer.h"</code><br>
<code>#include "windowstr.h"</code><br>
<code>#include "globals.h"</code><br>
<code>#include "cursorstr.h"</code><br>
<code>#include "dixevents.h"</code><br>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a12">dmxCursorNoMulti</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a21">dmxReInitOrigins</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a22">dmxInitOrigins</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</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>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a28">dmxInitOverlap</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a29">dmxBECreateCursor</a> (ScreenPtr pScreen, CursorPtr pCursor)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>Bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a31">dmxBEFreeCursor</a> (ScreenPtr pScreen, CursorPtr pCursor)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a38">dmxMoveCursor</a> (ScreenPtr pScreen, int x, int y)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</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>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a41">dmxCheckCursor</a> (void)</td></tr>

<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>miPointerScreenFuncRec&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a10">dmxPointerCursorFuncs</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>miPointerSpriteFuncRec&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxcursor_8c.html#a11">dmxPointerSpriteFuncs</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This file contains code than supports cursor movement, including the code that initializes and reinitializes the screen positions and computes screen overlap.<p>
"This code is based very closely on the XFree86 equivalent (xfree86/common/xf86Cursor.c)." --David Dawes.<p>
"This code was then extensively re-written, as explained here." --Rik Faith<p>
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>
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>
<a class="anchor" name="a29" doxytag="dmxcursor.c::dmxBECreateCursor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxBECreateCursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ScreenPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>pScreen</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>CursorPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>pCursor</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create <em>pCursor</em> on the back-end associated with <em>pScreen</em>.     </td>
  </tr>
</table>
<a class="anchor" name="a31" doxytag="dmxcursor.c::dmxBEFreeCursor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Bool dmxBEFreeCursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ScreenPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>pScreen</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>CursorPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>pCursor</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Free <em>pCursor</em> on the back-end associated with <em>pScreen</em>.     </td>
  </tr>
</table>
<a class="anchor" name="a41" doxytag="dmxcursor.c::dmxCheckCursor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxCheckCursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This routine is called during reconfiguration to make sure the cursor is visible.     </td>
  </tr>
</table>
<a class="anchor" name="a12" doxytag="dmxcursor.c::dmxCursorNoMulti" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxCursorNoMulti </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Turn off support for displaying multiple cursors on overlapped back-end displays. See #dmxCursorDoMultiCursors.     </td>
  </tr>
</table>
<a class="anchor" name="a40" doxytag="dmxcursor.c::dmxHideCursor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxHideCursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="struct__DMXScreenInfo.html">DMXScreenInfo</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>dmxScreen</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
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>
    </td>
  </tr>
</table>
<a class="anchor" name="a22" doxytag="dmxcursor.c::dmxInitOrigins" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxInitOrigins </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
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>
  </tr>
</table>
<a class="anchor" name="a28" doxytag="dmxcursor.c::dmxInitOverlap" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxInitOverlap </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Detects overlapping dmxScreens and creates circular lists. This uses an O(dmxNumScreens^2) algorithm, but dmxNumScreens is &lt; 100 and the computation only needs to be performed for every server generation or dynamic reconfiguration .     </td>
  </tr>
</table>
<a class="anchor" name="a38" doxytag="dmxcursor.c::dmxMoveCursor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxMoveCursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">ScreenPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>pScreen</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>x</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>y</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
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>
  </tr>
</table>
<a class="anchor" name="a23" doxytag="dmxcursor.c::dmxOnScreen" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int dmxOnScreen </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname" nowrap> <em>x</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>y</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="struct__DMXScreenInfo.html">DMXScreenInfo</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>dmxScreen</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns non-zero if the global <em>x</em>, <em>y</em> coordinate is on the screen window of the <em>dmxScreen</em>.     </td>
  </tr>
</table>
<a class="anchor" name="a21" doxytag="dmxcursor.c::dmxReInitOrigins" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void dmxReInitOrigins </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
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>
  </tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="a10" doxytag="dmxcursor.c::dmxPointerCursorFuncs" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> miPointerScreenFuncRec <a class="el" href="dmxcursor_8h.html#a3">dmxPointerCursorFuncs</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Initial value:</b><div class="fragment"><pre>
{
    dmxCursorOffScreen,
    dmxCrossScreen,
    dmxWarpCursor,
    <a class="code" href="dmxeq_8c.html#a13">dmxeqEnqueue</a>,
    <a class="code" href="dmxeq_8c.html#a14">dmxeqSwitchScreen</a>
}
</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>
<a class="el" href="dmxscrinit_8c.html">dmxscrinit.c</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a11" doxytag="dmxcursor.c::dmxPointerSpriteFuncs" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> miPointerSpriteFuncRec <a class="el" href="dmxcursor_8h.html#a4">dmxPointerSpriteFuncs</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Initial value:</b><div class="fragment"><pre>
{
    dmxRealizeCursor,
    dmxUnrealizeCursor,
    dmxSetCursor,
    <a class="code" href="dmxcursor_8c.html#a38">dmxMoveCursor</a>,
}
</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>
<a class="el" href="dmxscrinit_8c.html">dmxscrinit.c</a> </dd></dl>
    </td>
  </tr>
</table>
    <hr>
    <address>
      <small>
        Generated June 29, 2004 for <a
        href="http://dmx.sourceforge.net">Distributed Multihead X</a> by
        <a href="http://www.doxygen.org/index.html">doxygen</a>
        1.3.4.
      </small>
    </addres>
    </hr>
  </body>
</html>