summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-04-09 18:32:00 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-04-09 18:32:00 +0930
commit00b1d52f4103a07568dcebcdaa860b9b51f19b4d (patch)
tree9412017e217a12653c600d09945be4ee8e0f11f6
parentaa77ffb510abe004802ab9acc6996e4c6fe3ebb2 (diff)
Adding some comments to devices.c.
-rw-r--r--dix/devices.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 30c267094..a08053516 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -85,6 +85,9 @@ static int CoreDevicePrivatesGeneration = -1;
/* The client that is allowed to change pointer-keyboard pairings. */
static ClientPtr pairingClient = NULL;
+/**
+ * Alloc memory for new sprite, reset to default values
+ */
DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
{
@@ -163,6 +166,12 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
return dev;
}
+/**
+ * Enable the device through the driver, initialize the DIX sprite or pair the
+ * device, add the device to the device list.
+ *
+ * After calling EnableDevice(), a device can and will send events.
+ */
Bool
EnableDevice(DeviceIntPtr dev)
{
@@ -194,6 +203,9 @@ EnableDevice(DeviceIntPtr dev)
return TRUE;
}
+/**
+ * Shut device down through drivers, remove from device list.
+ */
Bool
DisableDevice(DeviceIntPtr dev)
{
@@ -341,6 +353,14 @@ CorePointerProc(DeviceIntPtr pDev, int what)
return Success;
}
+/**
+ * Initialize a virtual core keyboard and a virtual core pointer.
+ *
+ * Both devices are not tied to physical devices, but guarantee that there is
+ * always a keyboard and a pointer present and keep the protocol semantics.
+ * Both core devices are NOT part of the device list and act only as a
+ * fallback if no physical device is available.
+ */
void
InitCoreDevices()
{
@@ -422,6 +442,13 @@ InitCoreDevices()
}
}
+/**
+ * Activate and enable all devices.
+ *
+ * After InitAndStartDevices() all devices are finished with their setup
+ * routines and start emitting events.
+ * Each physical keyboard is paired with the first available unpaired pointer.
+ */
int
InitAndStartDevices()
{
@@ -459,6 +486,9 @@ InitAndStartDevices()
return Success;
}
+/**
+ * Shut down device and free memory.
+ */
static void
CloseDevice(DeviceIntPtr dev)
{