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>usb-common.c File Reference</h1><code>#include "<a class="el" href="usb-private_8h-source.html">usb-private.h</a>"</code><br>
12
<code>#include "<a class="el" href="usb-mouse_8h-source.html">usb-mouse.h</a>"</code><br>
13
<table border=0 cellpadding=0 cellspacing=0>
15
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
16
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="usb-common_8c.html#a21">usbRead</a> (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, int minButton, BLOCK block)</td></tr>
18
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="usb-common_8c.html#a23">usbInit</a> (DevicePtr pDev, usbType type)</td></tr>
20
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="usb-common_8c.html#a24">usbOff</a> (DevicePtr pDev)</td></tr>
22
<tr><td class="memItemLeft" nowrap align=right valign=top>pointer </td><td class="memItemRight" valign=bottom><a class="el" href="usb-common_8c.html#a25">usbCreatePrivate</a> (DeviceIntPtr pDevice)</td></tr>
24
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="usb-common_8c.html#a26">usbDestroyPrivate</a> (pointer priv)</td></tr>
27
<hr><a name="_details"></a><h2>Detailed Description</h2>
28
Routines that are common between #usb-keyboard.c, #usb-mouse.c, and #usb-other.c<hr><h2>Function Documentation</h2>
29
<a class="anchor" name="a25" doxytag="usb-common.c::usbCreatePrivate" ></a><p>
30
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
33
<table cellpadding="0" cellspacing="0" border="0">
35
<td class="md" nowrap valign="top"> pointer usbCreatePrivate </td>
36
<td class="md" valign="top">( </td>
37
<td class="md" nowrap valign="top">DeviceIntPtr </td>
38
<td class="mdname1" valign="top" nowrap> <em>pDevice</em> </td>
39
<td class="md" valign="top"> ) </td>
40
<td class="md" nowrap></td>
47
<table cellspacing=5 cellpadding=0 border=0>
55
Create a private structure for use within this file. </td>
58
<a class="anchor" name="a26" doxytag="usb-common.c::usbDestroyPrivate" ></a><p>
59
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
62
<table cellpadding="0" cellspacing="0" border="0">
64
<td class="md" nowrap valign="top"> void usbDestroyPrivate </td>
65
<td class="md" valign="top">( </td>
66
<td class="md" nowrap valign="top">pointer </td>
67
<td class="mdname1" valign="top" nowrap> <em>priv</em> </td>
68
<td class="md" valign="top"> ) </td>
69
<td class="md" nowrap></td>
76
<table cellspacing=5 cellpadding=0 border=0>
84
Destroy a private structure. </td>
87
<a class="anchor" name="a23" doxytag="usb-common.c::usbInit" ></a><p>
88
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
91
<table cellpadding="0" cellspacing="0" border="0">
93
<td class="md" nowrap valign="top"> void usbInit </td>
94
<td class="md" valign="top">( </td>
95
<td class="md" nowrap valign="top">DevicePtr </td>
96
<td class="mdname" nowrap> <em>pDev</em>, </td>
101
<td class="md" nowrap>usbType </td>
102
<td class="mdname" nowrap> <em>type</em></td>
106
<td class="md">) </td>
107
<td class="md" colspan="2"></td>
114
<table cellspacing=5 cellpadding=0 border=0>
122
Initialized <em>pDev</em> as a <em>usbMouse</em>, <em>usbKeyboard</em>, or <em>usbOther</em> device. </td>
125
<a class="anchor" name="a24" doxytag="usb-common.c::usbOff" ></a><p>
126
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
129
<table cellpadding="0" cellspacing="0" border="0">
131
<td class="md" nowrap valign="top"> void usbOff </td>
132
<td class="md" valign="top">( </td>
133
<td class="md" nowrap valign="top">DevicePtr </td>
134
<td class="mdname1" valign="top" nowrap> <em>pDev</em> </td>
135
<td class="md" valign="top"> ) </td>
136
<td class="md" nowrap></td>
143
<table cellspacing=5 cellpadding=0 border=0>
151
Turn <em>pDev</em> off (i.e., stop taking input from <em>pDev</em>). </td>
154
<a class="anchor" name="a21" doxytag="usb-common.c::usbRead" ></a><p>
155
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
158
<table cellpadding="0" cellspacing="0" border="0">
160
<td class="md" nowrap valign="top"> void usbRead </td>
161
<td class="md" valign="top">( </td>
162
<td class="md" nowrap valign="top">DevicePtr </td>
163
<td class="mdname" nowrap> <em>pDev</em>, </td>
168
<td class="md" nowrap>MOTIONPROC </td>
169
<td class="mdname" nowrap> <em>motion</em>, </td>
174
<td class="md" nowrap>ENQUEUEPROC </td>
175
<td class="mdname" nowrap> <em>enqueue</em>, </td>
180
<td class="md" nowrap>int </td>
181
<td class="mdname" nowrap> <em>minButton</em>, </td>
186
<td class="md" nowrap>BLOCK </td>
187
<td class="mdname" nowrap> <em>block</em></td>
191
<td class="md">) </td>
192
<td class="md" colspan="2"></td>
199
<table cellspacing=5 cellpadding=0 border=0>
207
Read an event from the <em>pDev</em> device. If the event is a motion event, enqueue it with the <em>motion</em> function. Otherwise, enqueue the event with the <em>enqueue</em> function. The <em>block</em> type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.<p>
208
Since USB devices return EV_KEY events for buttons and keys, <em>minButton</em> is used to decide if a Button or Key event should be queued. </td>
214
Generated June 29, 2004 for <a
215
href="http://dmx.sourceforge.net">Distributed Multihead X</a> by
216
<a href="http://www.doxygen.org/index.html">doxygen</a>