diff options
author | marha <marha@users.sourceforge.net> | 2010-11-14 21:29:32 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-14 21:29:32 +0000 |
commit | 3425b16d521b8846b95df2b7d32a548d93341f3b (patch) | |
tree | fa430e95285d90f990b2d5574dad1e409ba5980c /xorg-server | |
parent | 41c64098a90b4e974d5005a1619472f2e8a64ea1 (diff) | |
download | vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.gz vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.bz2 vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.zip |
xserver pixman libX11 libXext 14/11/2010
Diffstat (limited to 'xorg-server')
130 files changed, 7454 insertions, 6844 deletions
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c index f1edfaca6..859057e2b 100644 --- a/xorg-server/Xext/xtest.c +++ b/xorg-server/Xext/xtest.c @@ -52,6 +52,7 @@ #include "mipointer.h"
#include "xserver-properties.h"
#include "exevents.h"
+#include "inpututils.h"
#include "modinit.h"
@@ -153,6 +154,7 @@ ProcXTestFakeInput(ClientPtr client) WindowPtr root;
Bool extension = FALSE;
deviceValuator *dv = NULL;
+ ValuatorMask mask;
int valuators[MAX_VALUATORS] = {0};
int numValuators = 0;
int firstValuator = 0;
@@ -413,14 +415,14 @@ ProcXTestFakeInput(ClientPtr client) switch(type) {
case MotionNotify:
- nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags,
- firstValuator, numValuators, valuators);
+ valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
+ nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, &mask);
break;
case ButtonPress:
case ButtonRelease:
+ valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
nevents = GetPointerEvents(xtest_evlist, dev, type, ev->u.u.detail,
- flags, firstValuator,
- numValuators, valuators);
+ flags, &mask);
break;
case KeyPress:
case KeyRelease:
diff --git a/xorg-server/Xi/closedev.c b/xorg-server/Xi/closedev.c index fcd0ed832..60f5aebe5 100644 --- a/xorg-server/Xi/closedev.c +++ b/xorg-server/Xi/closedev.c @@ -162,6 +162,5 @@ ProcXCloseDevice(ClientPtr client) DeleteEventsFromChildren(d, p1, client);
}
- CloseInputDevice(d, client);
return Success;
}
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index fcb7e584b..6cb9c0dac 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -111,13 +111,6 @@ XIShouldNotify(ClientPtr client, DeviceIntPtr dev) return 0;
}
-void
-RegisterOtherDevice(DeviceIntPtr device)
-{
- device->public.processInputProc = ProcessOtherEvent;
- device->public.realInputProc = ProcessOtherEvent;
-}
-
Bool
IsPointerEvent(InternalEvent* event)
{
@@ -563,7 +556,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) v->axisVal = (double*)(v->axes + from->valuator->numAxes);
v->sourceid = from->id;
- v->mode = from->valuator->mode;
} else if (to->valuator && !from->valuator)
{
ClassesPtr classes;
@@ -898,9 +890,9 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) mask = PointerMotionMask | b->state | b->motionMask;
SetMaskForEvent(device->id, mask, MotionNotify);
} else if (event->type == ET_ProximityIn)
- device->valuator->mode &= ~OutOfProximity;
+ device->proximity->in_proximity = TRUE;
else if (event->type == ET_ProximityOut)
- device->valuator->mode |= OutOfProximity;
+ device->proximity->in_proximity = FALSE;
return DEFAULT;
}
@@ -1119,6 +1111,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) if (!proxc)
return FALSE;
proxc->sourceid = dev->id;
+ proxc->in_proximity = TRUE;
dev->proximity = proxc;
return TRUE;
}
@@ -1134,7 +1127,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) */
void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
- int resolution, int min_res, int max_res)
+ int resolution, int min_res, int max_res, int mode)
{
AxisInfoPtr ax;
@@ -1151,6 +1144,10 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int ax->min_resolution = min_res;
ax->max_resolution = max_res;
ax->label = label;
+ ax->mode = mode;
+
+ if (mode & OutOfProximity)
+ dev->proximity->in_proximity = FALSE;
}
static void
@@ -1179,7 +1176,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, int nval = v->numAxes - first;
ev->classes_reported |= (1 << ValuatorClass);
- ev->classes_reported |= (dev->valuator->mode << ModeBitsShift);
+ ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift;
ev->num_valuators = nval < 3 ? nval : 3;
switch (ev->num_valuators) {
case 3:
diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c index dd72ee2b0..a6408fbb3 100644 --- a/xorg-server/Xi/extinit.c +++ b/xorg-server/Xi/extinit.c @@ -1120,8 +1120,6 @@ RestoreExtensionEvents(void) static void
IResetProc(ExtensionEntry * unused)
{
- XIResetProperties();
-
ReplySwapVector[IReqCode] = ReplyNotSwappd;
EventSwapVector[DeviceValuator] = NotImplemented;
EventSwapVector[DeviceKeyPress] = NotImplemented;
@@ -1301,6 +1299,8 @@ XInputExtensionInit(void) inputInfo.all_devices = &xi_all_devices;
inputInfo.all_master_devices = &xi_all_master_devices;
+
+ XIResetProperties();
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}
diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c index d84dcd8d9..da7529f1e 100644 --- a/xorg-server/Xi/listdev.c +++ b/xorg-server/Xi/listdev.c @@ -230,10 +230,11 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) */
static int
-CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
+CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
{
int i, j, axes, t_axes;
char n;
+ ValuatorClassPtr v = dev->valuator;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
@@ -247,7 +248,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) v2->class = ValuatorClass;
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
v2->num_axes = t_axes;
- v2->mode = v->mode & DeviceMode;
+ v2->mode = valuator_get_mode(dev, 0);
v2->motion_buffer_size = v->numMotionEvents;
if (client && client->swapped) {
swapl(&v2->motion_buffer_size, n);
@@ -286,7 +287,7 @@ CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes, }
if (dev->valuator != NULL) {
(*num_classes) +=
- CopySwapValuatorClass(client, dev->valuator, classbuf);
+ CopySwapValuatorClass(client, dev, classbuf);
}
}
@@ -356,9 +357,6 @@ ProcXListInputDevices(ClientPtr client) rep.length = 0;
rep.sequenceNumber = client->sequence;
-
- AddOtherInputDevices();
-
/* allocate space for saving skip value */
skip = calloc(sizeof(Bool), inputInfo.numDevices);
if (!skip)
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c index 092b464ee..273cb2404 100644 --- a/xorg-server/Xi/opendev.c +++ b/xorg-server/Xi/opendev.c @@ -115,7 +115,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev))
return BadDevice;
- OpenInputDevice(dev, client, &status);
if (status != Success)
return status;
diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c index 15d44592e..4810ed7f1 100644 --- a/xorg-server/Xi/queryst.c +++ b/xorg-server/Xi/queryst.c @@ -151,7 +151,8 @@ ProcXQueryDeviceState(ClientPtr client) tv->class = ValuatorClass;
tv->length = sizeof(xValuatorState) + v->numAxes * 4;
tv->num_valuators = v->numAxes;
- tv->mode = v->mode;
+ tv->mode = valuator_get_mode(dev, 0);
+ tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0;
buf += sizeof(xValuatorState);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
if (rc != BadAccess)
diff --git a/xorg-server/Xi/setmode.c b/xorg-server/Xi/setmode.c index ce2ad47c7..9f88eacf6 100644 --- a/xorg-server/Xi/setmode.c +++ b/xorg-server/Xi/setmode.c @@ -1,146 +1,146 @@ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Hewlett-Packard not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/*********************************************************************** - * - * Request to change the mode of an extension input device. - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "inputstr.h" /* DeviceIntPtr */ -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> -#include "XIstubs.h" -#include "exglobals.h" - -#include "setmode.h" - -/*********************************************************************** - * - * Handle a request from a client with a different byte order. - * - */ - -int -SProcXSetDeviceMode(ClientPtr client) -{ - char n; - - REQUEST(xSetDeviceModeReq); - swaps(&stuff->length, n); - return (ProcXSetDeviceMode(client)); -} - -/*********************************************************************** - * - * This procedure sets the mode of a device. - * - */ - -int -ProcXSetDeviceMode(ClientPtr client) -{ - DeviceIntPtr dev; - xSetDeviceModeReply rep; - int rc; - - REQUEST(xSetDeviceModeReq); - REQUEST_SIZE_MATCH(xSetDeviceModeReq); - - rep.repType = X_Reply; - rep.RepType = X_SetDeviceMode; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); - if (rc != Success) - return rc; - if (dev->valuator == NULL) - return BadMatch; - if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) - rep.status = AlreadyGrabbed; - else - rep.status = SetDeviceMode(client, dev, stuff->mode); - - if (rep.status == Success) - dev->valuator->mode = stuff->mode; - else if (rep.status != AlreadyGrabbed) - { - switch(rep.status) { - case BadMatch: - case BadImplementation: - case BadAlloc: - break; - default: - rep.status = BadMode; - } - return rep.status; - } - - WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep); - return Success; -} - -/*********************************************************************** - * - * This procedure writes the reply for the XSetDeviceMode function, - * if the client and server have a different byte ordering. - * - */ - -void -SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) -{ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - WriteToClient(client, size, (char *)rep); -} +/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to change the mode of an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "exglobals.h"
+
+#include "setmode.h"
+
+/***********************************************************************
+ *
+ * Handle a request from a client with a different byte order.
+ *
+ */
+
+int
+SProcXSetDeviceMode(ClientPtr client)
+{
+ char n;
+
+ REQUEST(xSetDeviceModeReq);
+ swaps(&stuff->length, n);
+ return (ProcXSetDeviceMode(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure sets the mode of a device.
+ *
+ */
+
+int
+ProcXSetDeviceMode(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ xSetDeviceModeReply rep;
+ int rc;
+
+ REQUEST(xSetDeviceModeReq);
+ REQUEST_SIZE_MATCH(xSetDeviceModeReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_SetDeviceMode;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (dev->valuator == NULL)
+ return BadMatch;
+ if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
+ rep.status = AlreadyGrabbed;
+ else
+ rep.status = SetDeviceMode(client, dev, stuff->mode);
+
+ if (rep.status == Success)
+ valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode);
+ else if (rep.status != AlreadyGrabbed)
+ {
+ switch(rep.status) {
+ case BadMatch:
+ case BadImplementation:
+ case BadAlloc:
+ break;
+ default:
+ rep.status = BadMode;
+ }
+ return rep.status;
+ }
+
+ WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XSetDeviceMode function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
+{
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/stubs.c b/xorg-server/Xi/stubs.c index 4921b36f9..f69b34b2e 100644 --- a/xorg-server/Xi/stubs.c +++ b/xorg-server/Xi/stubs.c @@ -66,96 +66,6 @@ SOFTWARE. #include "XIstubs.h"
#include "xace.h"
-/***********************************************************************
- *
- * Caller: ProcXCloseDevice
- *
- * Take care of implementation-dependent details of closing a device.
- * Some implementations may actually close the device, others may just
- * remove this clients interest in that device.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- *
- */
-
-void
-CloseInputDevice(DeviceIntPtr d, ClientPtr client)
-{
-}
-
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices(void)
-{
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
-
-}
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
-{
- *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess);
-}
-
/****************************************************************************
*
* Caller: ProcXSetDeviceMode
diff --git a/xorg-server/Xi/xichangehierarchy.c b/xorg-server/Xi/xichangehierarchy.c index 5deb52eac..6b0288c88 100644 --- a/xorg-server/Xi/xichangehierarchy.c +++ b/xorg-server/Xi/xichangehierarchy.c @@ -136,12 +136,286 @@ int SProcXIChangeHierarchy(ClientPtr client) return (ProcXIChangeHierarchy(client));
}
+static int
+add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES])
+{
+ DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
+ char* name;
+ int rc;
+
+ name = calloc(c->name_len + 1, sizeof(char));
+ strncpy(name, (char*)&c[1], c->name_len);
+
+ rc = AllocDevicePair(client, name, &ptr, &keybd,
+ CorePointerProc, CoreKeyboardProc, TRUE);
+ if (rc != Success)
+ goto unwind;
+
+ if (!c->send_core)
+ ptr->coreEvents = keybd->coreEvents = FALSE;
+
+ /* Allocate virtual slave devices for xtest events */
+ rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd);
+ if (rc != Success)
+ {
+ DeleteInputDeviceRequest(ptr);
+ DeleteInputDeviceRequest(keybd);
+ goto unwind;
+ }
+
+ ActivateDevice(ptr, FALSE);
+ ActivateDevice(keybd, FALSE);
+ flags[ptr->id] |= XIMasterAdded;
+ flags[keybd->id] |= XIMasterAdded;
+
+ ActivateDevice(XTestptr, FALSE);
+ ActivateDevice(XTestkeybd, FALSE);
+ flags[XTestptr->id] |= XISlaveAdded;
+ flags[XTestkeybd->id] |= XISlaveAdded;
+
+ if (c->enable)
+ {
+ EnableDevice(ptr, FALSE);
+ EnableDevice(keybd, FALSE);
+ flags[ptr->id] |= XIDeviceEnabled;
+ flags[keybd->id] |= XIDeviceEnabled;
+
+ EnableDevice(XTestptr, FALSE);
+ EnableDevice(XTestkeybd, FALSE);
+ flags[XTestptr->id] |= XIDeviceEnabled;
+ flags[XTestkeybd->id] |= XIDeviceEnabled;
+ }
+
+ /* Attach the XTest virtual devices to the newly
+ created master device */
+ AttachDevice(NULL, XTestptr, ptr);
+ AttachDevice(NULL, XTestkeybd, keybd);
+ flags[XTestptr->id] |= XISlaveAttached;
+ flags[XTestkeybd->id] |= XISlaveAttached;
+
+unwind:
+ free(name);
+ return rc;
+}
+
+static int
+remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
+ int flags[MAXDEVICES])
+{
+ DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
+ int rc = Success;
+
+ if (r->return_mode != XIAttachToMaster &&
+ r->return_mode != XIFloating)
+ return BadValue;
+
+ rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(ptr))
+ {
+ client->errorValue = r->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* XXX: For now, don't allow removal of VCP, VCK */
+ if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard)
+ {
+ rc = BadDevice;
+ goto unwind;
+ }
+
+
+ ptr = GetMaster(ptr, MASTER_POINTER);
+ rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+ keybd = GetMaster(ptr, MASTER_KEYBOARD);
+ rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ XTestptr = GetXTestDevice(ptr);
+ rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ XTestkeybd = GetXTestDevice(keybd);
+ rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client,
+ DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ /* Disabling sends the devices floating, reattach them if
+ * desired. */
+ if (r->return_mode == XIAttachToMaster)
+ {
+ DeviceIntPtr attached,
+ newptr,
+ newkeybd;
+
+ rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(newptr))
+ {
+ client->errorValue = r->return_pointer;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ rc = dixLookupDevice(&newkeybd, r->return_keyboard,
+ client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(newkeybd))
+ {
+ client->errorValue = r->return_keyboard;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ for (attached = inputInfo.devices; attached; attached = attached->next)
+ {
+ if (!IsMaster(attached)) {
+ if (attached->u.master == ptr)
+ {
+ AttachDevice(client, attached, newptr);
+ flags[attached->id] |= XISlaveAttached;
+ }
+ if (attached->u.master == keybd)
+ {
+ AttachDevice(client, attached, newkeybd);
+ flags[attached->id] |= XISlaveAttached;
+ }
+ }
+ }
+ }
+
+ /* can't disable until we removed pairing */
+ keybd->spriteInfo->paired = NULL;
+ ptr->spriteInfo->paired = NULL;
+ XTestptr->spriteInfo->paired = NULL;
+ XTestkeybd->spriteInfo->paired = NULL;
+
+ /* disable the remove the devices, XTest devices must be done first
+ else the sprites they rely on will be destroyed */
+ DisableDevice(XTestptr, FALSE);
+ DisableDevice(XTestkeybd, FALSE);
+ DisableDevice(keybd, FALSE);
+ DisableDevice(ptr, FALSE);
+ flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached;
+ flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
+ flags[keybd->id] |= XIDeviceDisabled;
+ flags[ptr->id] |= XIDeviceDisabled;
+
+ RemoveDevice(XTestptr, FALSE);
+ RemoveDevice(XTestkeybd, FALSE);
+ RemoveDevice(keybd, FALSE);
+ RemoveDevice(ptr, FALSE);
+ flags[XTestptr->id] |= XISlaveRemoved;
+ flags[XTestkeybd->id] |= XISlaveRemoved;
+ flags[keybd->id] |= XIMasterRemoved;
+ flags[ptr->id] |= XIMasterRemoved;
+
+unwind:
+ return rc;
+}
+
+static int
+detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES])
+{
+ DeviceIntPtr dev;
+ int rc;
+
+ rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (IsMaster(dev))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* Don't allow changes to XTest Devices, these are fixed */
+ if (IsXTestDevice(dev, NULL))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ AttachDevice(client, dev, NULL);
+ flags[dev->id] |= XISlaveDetached;
+
+unwind:
+ return rc;
+}
+
+static int
+attach_slave(ClientPtr client, xXIAttachSlaveInfo *c,
+ int flags[MAXDEVICES])
+{
+ DeviceIntPtr dev;
+ DeviceIntPtr newmaster;
+ int rc;
+
+ rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (IsMaster(dev))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* Don't allow changes to XTest Devices, these are fixed */
+ if (IsXTestDevice(dev, NULL))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+ if (!IsMaster(newmaster))
+ {
+ client->errorValue = c->new_master;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) ||
+ (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev))))
+ {
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ AttachDevice(client, dev, newmaster);
+ flags[dev->id] |= XISlaveAttached;
+
+unwind:
+ return rc;
+}
+
+
+
#define SWAPIF(cmd) if (client->swapped) { cmd; }
int
ProcXIChangeHierarchy(ClientPtr client)
{
- DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
char n;
@@ -169,276 +443,38 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
- char* name;
-
SWAPIF(swaps(&c->name_len, n));
- name = calloc(c->name_len + 1, sizeof(char));
- strncpy(name, (char*)&c[1], c->name_len);
-
-
- rc = AllocDevicePair(client, name, &ptr, &keybd,
- CorePointerProc, CoreKeyboardProc,
- TRUE);
- if (rc != Success)
- {
- free(name);
- goto unwind;
- }
-
- if (!c->send_core)
- ptr->coreEvents = keybd->coreEvents = FALSE;
- /* Allocate virtual slave devices for xtest events */
- rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd,
- ptr, keybd);
+ rc = add_master(client, c, flags);
if (rc != Success)
- {
-
- free(name);
goto unwind;
- }
-
- ActivateDevice(ptr, FALSE);
- ActivateDevice(keybd, FALSE);
- flags[ptr->id] |= XIMasterAdded;
- flags[keybd->id] |= XIMasterAdded;
-
- ActivateDevice(XTestptr, FALSE);
- ActivateDevice(XTestkeybd, FALSE);
- flags[XTestptr->id] |= XISlaveAdded;
- flags[XTestkeybd->id] |= XISlaveAdded;
-
- if (c->enable)
- {
- EnableDevice(ptr, FALSE);
- EnableDevice(keybd, FALSE);
- flags[ptr->id] |= XIDeviceEnabled;
- flags[keybd->id] |= XIDeviceEnabled;
-
- EnableDevice(XTestptr, FALSE);
- EnableDevice(XTestkeybd, FALSE);
- flags[XTestptr->id] |= XIDeviceEnabled;
- flags[XTestkeybd->id] |= XIDeviceEnabled;
- }
-
- /* Attach the XTest virtual devices to the newly
- created master device */
- AttachDevice(NULL, XTestptr, ptr);
- AttachDevice(NULL, XTestkeybd, keybd);
- flags[XTestptr->id] |= XISlaveAttached;
- flags[XTestkeybd->id] |= XISlaveAttached;
-
- free(name);
}
break;
case XIRemoveMaster:
{
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
- if (r->return_mode != XIAttachToMaster &&
- r->return_mode != XIFloating)
- return BadValue;
-
- rc = dixLookupDevice(&ptr, r->deviceid, client,
- DixDestroyAccess);
+ rc = remove_master(client, r, flags);
if (rc != Success)
goto unwind;
-
- if (!IsMaster(ptr))
- {
- client->errorValue = r->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* XXX: For now, don't allow removal of VCP, VCK */
- if (ptr == inputInfo.pointer ||
- ptr == inputInfo.keyboard)
- {
- rc = BadDevice;
- goto unwind;
- }
-
-
- ptr = GetMaster(ptr, MASTER_POINTER);
- rc = dixLookupDevice(&ptr,
- ptr->id,
- client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
- keybd = GetMaster(ptr, MASTER_KEYBOARD);
- rc = dixLookupDevice(&keybd,
- keybd->id,
- client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- XTestptr = GetXTestDevice(ptr);
- rc = dixLookupDevice(&XTestptr, XTestptr->id, client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- XTestkeybd = GetXTestDevice(keybd);
- rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- /* Disabling sends the devices floating, reattach them if
- * desired. */
- if (r->return_mode == XIAttachToMaster)
- {
- DeviceIntPtr attached,
- newptr,
- newkeybd;
-
- rc = dixLookupDevice(&newptr, r->return_pointer,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
-
- if (!IsMaster(newptr))
- {
- client->errorValue = r->return_pointer;
- rc = BadDevice;
- goto unwind;
- }
-
- rc = dixLookupDevice(&newkeybd, r->return_keyboard,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
-
- if (!IsMaster(newkeybd))
- {
- client->errorValue = r->return_keyboard;
- rc = BadDevice;
- goto unwind;
- }
-
- for (attached = inputInfo.devices;
- attached;
- attached = attached->next)
- {
- if (!IsMaster(attached)) {
- if (attached->u.master == ptr)
- {
- AttachDevice(client, attached, newptr);
- flags[attached->id] |= XISlaveAttached;
- }
- if (attached->u.master == keybd)
- {
- AttachDevice(client, attached, newkeybd);
- flags[attached->id] |= XISlaveAttached;
- }
- }
- }
- }
-
- /* can't disable until we removed pairing */
- keybd->spriteInfo->paired = NULL;
- ptr->spriteInfo->paired = NULL;
- XTestptr->spriteInfo->paired = NULL;
- XTestkeybd->spriteInfo->paired = NULL;
-
- /* disable the remove the devices, XTest devices must be done first
- else the sprites they rely on will be destroyed */
- DisableDevice(XTestptr, FALSE);
- DisableDevice(XTestkeybd, FALSE);
- DisableDevice(keybd, FALSE);
- DisableDevice(ptr, FALSE);
- flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached;
- flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
- flags[keybd->id] |= XIDeviceDisabled;
- flags[ptr->id] |= XIDeviceDisabled;
-
- RemoveDevice(XTestptr, FALSE);
- RemoveDevice(XTestkeybd, FALSE);
- RemoveDevice(keybd, FALSE);
- RemoveDevice(ptr, FALSE);
- flags[XTestptr->id] |= XISlaveRemoved;
- flags[XTestkeybd->id] |= XISlaveRemoved;
- flags[keybd->id] |= XIMasterRemoved;
- flags[ptr->id] |= XIMasterRemoved;
}
break;
case XIDetachSlave:
{
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
- rc = dixLookupDevice(&ptr, c->deviceid, client,
- DixManageAccess);
+ rc = detach_slave(client, c, flags);
if (rc != Success)
goto unwind;
-
- if (IsMaster(ptr))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* Don't allow changes to XTest Devices, these are fixed */
- if (IsXTestDevice(ptr, NULL))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- AttachDevice(client, ptr, NULL);
- flags[ptr->id] |= XISlaveDetached;
}
break;
case XIAttachSlave:
{
xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any;
- DeviceIntPtr newmaster;
- rc = dixLookupDevice(&ptr, c->deviceid, client,
- DixManageAccess);
+ rc = attach_slave(client, c, flags);
if (rc != Success)
goto unwind;
-
- if (IsMaster(ptr))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* Don't allow changes to XTest Devices, these are fixed */
- if (IsXTestDevice(ptr, NULL))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- rc = dixLookupDevice(&newmaster, c->new_master,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
- if (!IsMaster(newmaster))
- {
- client->errorValue = c->new_master;
- rc = BadDevice;
- goto unwind;
- }
-
- if (!((IsPointerDevice(newmaster) &&
- IsPointerDevice(ptr)) ||
- (IsKeyboardDevice(newmaster) &&
- IsKeyboardDevice(ptr))))
- {
- rc = BadDevice;
- goto unwind;
- }
- AttachDevice(client, ptr, newmaster);
- flags[ptr->id] |= XISlaveAttached;
}
break;
}
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c index c24f8a894..4e1cae406 100644 --- a/xorg-server/Xi/xiquerydevice.c +++ b/xorg-server/Xi/xiquerydevice.c @@ -349,7 +349,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber, info->value.frac = (int)(v->axisVal[axisnumber] * (1 << 16) * (1 << 16));
info->resolution = v->axes[axisnumber].resolution;
info->number = axisnumber;
- info->mode = v->mode; /* Server doesn't have per-axis mode yet */
+ info->mode = valuator_get_mode(dev, axisnumber);
info->sourceid = v->sourceid;
if (!reportState)
diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c index 95f390286..293a9fe14 100644 --- a/xorg-server/composite/compalloc.c +++ b/xorg-server/composite/compalloc.c @@ -238,7 +238,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
pWin->redirectDraw = RedirectDrawAutomatic;
- DamageRegionAppend(&pWin->drawable, &pWin->borderSize);
+ DamageDamageRegion(&pWin->drawable, &pWin->borderSize);
}
if (wasMapped && !pWin->mapped)
{
diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c index e897c13f9..b0afc3f9a 100644 --- a/xorg-server/composite/compwindow.c +++ b/xorg-server/composite/compwindow.c @@ -519,7 +519,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionTranslate(prgnSrc,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
- DamageRegionAppend(&pWin->drawable, prgnSrc);
+ DamageDamageRegion(&pWin->drawable, prgnSrc);
}
cs->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = compCopyWindow;
@@ -598,7 +598,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) /*
* Report that as damaged so it will be redrawn
*/
- DamageRegionAppend(&pWin->drawable, &damage);
+ DamageDamageRegion(&pWin->drawable, &damage);
RegionUninit(&damage);
/*
* Save the new border clip region
diff --git a/xorg-server/config/hal.c b/xorg-server/config/hal.c index 5ce7d7d48..dab35ddf7 100644 --- a/xorg-server/config/hal.c +++ b/xorg-server/config/hal.c @@ -376,6 +376,7 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(&options, "xkb_model", xkb_opts.model);
if (xkb_opts.options)
add_option(&options, "xkb_options", xkb_opts.options);
+ add_option(&options, "config_info", config_info);
/* this isn't an error, but how else do you output something that the user can see? */
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
@@ -385,11 +386,6 @@ device_added(LibHalContext *hal_ctx, const char *udi) goto unwind;
}
- for (; dev; dev = dev->next){
- free(dev->config_info);
- dev->config_info = strdup(config_info);
- }
-
unwind:
if (set)
libhal_free_property_set(set);
diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c index 32f414137..88222bb01 100644 --- a/xorg-server/config/udev.c +++ b/xorg-server/config/udev.c @@ -181,17 +181,14 @@ device_added(struct udev_device *udev_device) }
}
+ add_option(&options, "config_info", config_info);
+
LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
name, path);
rc = NewInputDeviceRequest(options, &attrs, &dev);
if (rc != Success)
goto unwind;
- for (; dev; dev = dev->next) {
- free(dev->config_info);
- dev->config_info = strdup(config_info);
- }
-
unwind:
free(config_info);
while (!dev && (tmpo = options)) {
diff --git a/xorg-server/config/x11-input.fdi b/xorg-server/config/x11-input.fdi index 9e629cbd0..42489821d 100644 --- a/xorg-server/config/x11-input.fdi +++ b/xorg-server/config/x11-input.fdi @@ -1,98 +1,93 @@ -<?xml version="1.0" encoding="UTF-8"?> -<deviceinfo version="0.2"> - <device> - - <!-- The way this works: - - Match against some input device (see the HAL specification for more - information), and then merge in keys, which you can use to specify - the configuration similar to the way you would in xorg.conf. You will - need to restart HAL after making changes. If you are having issues, - starting X with the -logverbose 7 flag may yield useful information. - - Keys Supported: - - Key "input.x11_driver" (string) - This specifies the driver to use. You MUST specify this option, - or a driver will not be loaded and the rest will be ignored by - Xorg - - Key "input.x11_options.<option name>" (string) - This allows you to specify arbitrary options to pass to the driver. - Anything you would normally specify in xorg.conf goes here. So, for - option "Mode" in xorg.conf, you would specify the key name of - "input.x11_options.Mode". - - Do not specify "input.x11_options.Device" since "input.device" - will be used automatically. - - You MUST specify all options as strings, otherwise the server will - ignore them. - - Legacy Keys - "input.xkb.rules" - "input.xkb.model" - "input.xkb.layout" - "input.xkb.variant" - "input.xkb.options" - - These keys are deprecated. Use these instead: - "input.x11_options.XkbRules" - "input.x11_options.XkbModel" - "input.x11_options.XkbLayout" - "input.x11_options.XkbVariant" - "input.x11_options.XkbOptions" - - See the evdev documentation for more information. - - You will probably want to add the following option to the ServerFlags of - your xorg.conf: - - Option "AllowEmptyInput" "True" - - FIXME: Support tablets too. - TODO: I think its fixed, can't test - - --> - - <match key="info.capabilities" contains="input.mouse"> - <merge key="input.x11_driver" type="string">mouse</merge> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="Linux"> - <merge key="input.x11_driver" type="string">evdev</merge> - </match> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="SunOS"> - <match key="input.device" contains="usb"> - <merge key="input.x11_options.StreamsModule" type="string">usbms</merge> - <merge key="input.x11_options.Protocol" type="string">VUID</merge> - </match> - </match> - </match> - - <match key="info.capabilities" contains="input.keys"> - <merge key="input.x11_options.XkbRules" type="string">base</merge> - - <!-- If we're using Linux, we use evdev by default (falling back to - kbd otherwise). --> - <merge key="input.x11_driver" type="string">kbd</merge> - <merge key="input.x11_options.XkbModel" type="string">pc105</merge> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="Linux"> - <merge key="input.x11_driver" type="string">evdev</merge> - <merge key="input.x11_options.XkbModel" type="string">evdev</merge> - </match> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="SunOS"> - <match key="input.device" contains="usb"> - <merge key="input.x11_options.StreamsModule" type="string">usbkbm</merge> - <merge key="input.x11_options.Protocol" type="string">VUID</merge> - </match> - </match> - - <merge key="input.x11_options.XkbLayout" type="string">us</merge> - - <merge key="input.x11_options.XkbVariant" type="string" /> - </match> - </device> -</deviceinfo> +<?xml version="1.0" encoding="UTF-8"?>
+<deviceinfo version="0.2">
+ <device>
+
+ <!-- The way this works:
+
+ Match against some input device (see the HAL specification for more
+ information), and then merge in keys, which you can use to specify
+ the configuration similar to the way you would in xorg.conf. You will
+ need to restart HAL after making changes. If you are having issues,
+ starting X with the -logverbose 7 flag may yield useful information.
+
+ Keys Supported:
+
+ Key "input.x11_driver" (string)
+ This specifies the driver to use. You MUST specify this option,
+ or a driver will not be loaded and the rest will be ignored by
+ Xorg
+
+ Key "input.x11_options.<option name>" (string)
+ This allows you to specify arbitrary options to pass to the driver.
+ Anything you would normally specify in xorg.conf goes here. So, for
+ option "Mode" in xorg.conf, you would specify the key name of
+ "input.x11_options.Mode".
+
+ Do not specify "input.x11_options.Device" since "input.device"
+ will be used automatically.
+
+ You MUST specify all options as strings, otherwise the server will
+ ignore them.
+
+ Legacy Keys
+ "input.xkb.rules"
+ "input.xkb.model"
+ "input.xkb.layout"
+ "input.xkb.variant"
+ "input.xkb.options"
+
+ These keys are deprecated. Use these instead:
+ "input.x11_options.XkbRules"
+ "input.x11_options.XkbModel"
+ "input.x11_options.XkbLayout"
+ "input.x11_options.XkbVariant"
+ "input.x11_options.XkbOptions"
+
+ See the evdev documentation for more information.
+
+ FIXME: Support tablets too.
+ TODO: I think its fixed, can't test
+
+ -->
+
+ <match key="info.capabilities" contains="input.mouse">
+ <merge key="input.x11_driver" type="string">mouse</merge>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="Linux">
+ <merge key="input.x11_driver" type="string">evdev</merge>
+ </match>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="SunOS">
+ <match key="input.device" contains="usb">
+ <merge key="input.x11_options.StreamsModule" type="string">usbms</merge>
+ <merge key="input.x11_options.Protocol" type="string">VUID</merge>
+ </match>
+ </match>
+ </match>
+
+ <match key="info.capabilities" contains="input.keys">
+ <merge key="input.x11_options.XkbRules" type="string">base</merge>
+
+ <!-- If we're using Linux, we use evdev by default (falling back to
+ kbd otherwise). -->
+ <merge key="input.x11_driver" type="string">kbd</merge>
+ <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="Linux">
+ <merge key="input.x11_driver" type="string">evdev</merge>
+ <merge key="input.x11_options.XkbModel" type="string">evdev</merge>
+ </match>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="SunOS">
+ <match key="input.device" contains="usb">
+ <merge key="input.x11_options.StreamsModule" type="string">usbkbm</merge>
+ <merge key="input.x11_options.Protocol" type="string">VUID</merge>
+ </match>
+ </match>
+
+ <merge key="input.x11_options.XkbLayout" type="string">us</merge>
+
+ <merge key="input.x11_options.XkbVariant" type="string" />
+ </match>
+ </device>
+</deviceinfo>
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index b53b3aaa8..8ab086211 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -714,6 +714,7 @@ fi dnl Handle building documentation
AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes)
+XORG_ENABLE_DOCS
XORG_ENABLE_DEVEL_DOCS
XORG_WITH_XMLTO(0.0.20)
XORG_WITH_FOP
diff --git a/xorg-server/damageext/damageext.c b/xorg-server/damageext/damageext.c index fb60e7f72..2b1514872 100644 --- a/xorg-server/damageext/damageext.c +++ b/xorg-server/damageext/damageext.c @@ -217,12 +217,13 @@ ProcDamageCreate (ClientPtr client) if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt))
return BadAlloc;
+ DamageSetReportAfterOp (pDamageExt->pDamage, TRUE);
DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage);
if (pDrawable->type == DRAWABLE_WINDOW)
{
pRegion = &((WindowPtr) pDrawable)->borderClip;
- DamageRegionAppend(pDrawable, pRegion);
+ DamageDamageRegion(pDrawable, pRegion);
}
return Success;
@@ -292,7 +293,7 @@ ProcDamageAdd (ClientPtr client) * screen coordinates like damage expects.
*/
RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
- DamageRegionAppend(pDrawable, pRegion);
+ DamageDamageRegion(pDrawable, pRegion);
RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);
return Success;
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index f10f7a08d..c1b04a8e6 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -261,8 +261,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) if (!dev)
return (DeviceIntPtr)NULL;
dev->id = devid;
- dev->public.processInputProc = (ProcessInputProc)NoopDDA;
- dev->public.realInputProc = (ProcessInputProc)NoopDDA;
+ dev->public.processInputProc = ProcessOtherEvent;
+ dev->public.realInputProc = ProcessOtherEvent;
dev->public.enqueueInputProc = EnqueueEvent;
dev->deviceProc = deviceProc;
dev->startup = autoStart;
@@ -272,6 +272,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
+ XkbSetExtension(dev, ProcessKeyboardEvent);
+
dev->coreEvents = TRUE;
/* sprite defaults */
@@ -1106,18 +1108,6 @@ NumMotionEvents(void) return inputInfo.pointer->valuator->numMotionEvents;
}
-void
-RegisterPointerDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
-void
-RegisterKeyboardDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
int
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
{
@@ -1261,16 +1251,19 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
valc->numAxes = numAxes;
- valc->mode = mode;
valc->axes = (AxisInfoPtr)(valc + 1);
valc->axisVal = (double *)(valc->axes + numAxes);
+
+ if (mode & OutOfProximity)
+ InitProximityClassDeviceStruct(dev);
+
dev->valuator = valc;
AllocateMotionHistory(dev);
for (i=0; i<numAxes; i++) {
InitValuatorAxisStruct(dev, i, labels[i], NO_AXIS_LIMITS, NO_AXIS_LIMITS,
- 0, 0, 0);
+ 0, 0, 0, mode);
valc->axisVal[i]=0;
}
@@ -2367,8 +2360,7 @@ RecalculateMasterButtons(DeviceIntPtr slave) event.valuators[i].min = master->valuator->axes[i].min_value;
event.valuators[i].max = master->valuator->axes[i].max_value;
event.valuators[i].resolution = master->valuator->axes[i].resolution;
- /* This should, eventually, be a per-axis mode */
- event.valuators[i].mode = master->valuator->mode;
+ event.valuators[i].mode = master->valuator->axes[i].mode;
event.valuators[i].name = master->valuator->axes[i].label;
}
}
@@ -2581,3 +2573,25 @@ AllocDevicePair (ClientPtr client, char* name, return Success;
}
+/**
+ * Return Relative or Absolute for the device.
+ */
+int valuator_get_mode(DeviceIntPtr dev, int axis)
+{
+ return (dev->valuator->axes[axis].mode & DeviceMode);
+}
+
+/**
+ * Set the given mode for the axis. If axis is VALUATOR_MODE_ALL_AXES, then
+ * set the mode for all axes.
+ */
+void valuator_set_mode(DeviceIntPtr dev, int axis, int mode)
+{
+ if (axis != VALUATOR_MODE_ALL_AXES)
+ dev->valuator->axes[axis].mode = mode;
+ else {
+ int i;
+ for (i = 0; i < dev->valuator->numAxes; i++)
+ dev->valuator->axes[i].mode = mode;
+ }
+}
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c index e891f0698..e45878a90 100644 --- a/xorg-server/dix/eventconvert.c +++ b/xorg-server/dix/eventconvert.c @@ -261,6 +261,12 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count) }
num_events = (countValuators(ev, &first) + 5)/6; /* valuator ev */
+ if (num_events <= 0)
+ {
+ *count = 0;
+ return BadMatch;
+ }
+
num_events++; /* the actual event event */
*xi = calloc(num_events, sizeof(xEvent));
@@ -318,6 +324,12 @@ countValuators(DeviceEvent *ev, int *first) for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
{
+ /* Assume mode of 0th valuator matches XI1 device mode. Stop when the
+ * event mode changes since XI1 can't handle mixed mode devices.
+ */
+ if (ev->valuators.mode[i] != ev->valuators.mode[0])
+ break;
+
if (BitIsOn(ev->valuators.mask, i))
{
if (first_valuator == -1)
@@ -440,7 +452,7 @@ appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo *info, int axisnumbe info->value.frac = 0;
info->resolution = dce->valuators[axisnumber].resolution;
info->number = axisnumber;
- info->mode = dce->valuators[axisnumber].mode; /* Server doesn't have per-axis mode yet */
+ info->mode = dce->valuators[axisnumber].mode;
info->sourceid = dce->sourceid;
return info->length * 4;
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index 0933ac3da..d5d6a78b1 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -46,6 +46,7 @@ #include "mipointer.h"
#include "eventstr.h"
#include "eventconvert.h"
+#include "inpututils.h"
#include <X11/extensions/XKBproto.h>
#include "xkbsrv.h"
@@ -184,34 +185,38 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail) }
static void
-set_raw_valuators(RawDeviceEvent *event, int first, int num, int *valuators, int32_t* data)
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, int32_t* data)
{
int i;
- for (i = first; i < first + num; i++)
- SetBit(event->valuators.mask, i);
- memcpy(&data[first], valuators, num * sizeof(uint32_t));
+ for (i = 0; i < valuator_mask_size(mask); i++)
+ {
+ if (valuator_mask_isset(mask, i))
+ {
+ SetBit(event->valuators.mask, i);
+ data[i] = valuator_mask_get(mask, i);
+ }
+ }
}
static void
-set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
- int num_valuators, int *valuators)
+set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
{
int i;
- for (i = first_valuator; i < first_valuator + num_valuators; i++)
+ for (i = 0; i < valuator_mask_size(mask); i++)
{
- SetBit(event->valuators.mask, i);
- if (dev->valuator->mode == Absolute)
- SetBit(event->valuators.mode, i);
- event->valuators.data_frac[i] =
- dev->last.remainder[i] * (1 << 16) * (1 << 16);
+ if (valuator_mask_isset(mask, i))
+ {
+ SetBit(event->valuators.mask, i);
+ if (dev->valuator->axes[i].mode == Absolute)
+ SetBit(event->valuators.mode, i);
+ event->valuators.data[i] = valuator_mask_get(mask, i);
+ event->valuators.data_frac[i] =
+ dev->last.remainder[i] * (1 << 16) * (1 << 16);
+ }
}
-
- memcpy(&event->valuators.data[first_valuator],
- valuators, num_valuators * sizeof(int32_t));
-
}
void
@@ -250,8 +255,7 @@ CreateClassesChangedEvent(EventList* event, dce->valuators[i].min = slave->valuator->axes[i].min_value;
dce->valuators[i].max = slave->valuator->axes[i].max_value;
dce->valuators[i].resolution = slave->valuator->axes[i].resolution;
- /* This should, eventually, be a per-axis mode */
- dce->valuators[i].mode = slave->valuator->mode;
+ dce->valuators[i].mode = slave->valuator->axes[i].mode;
dce->valuators[i].name = slave->valuator->axes[i].label;
}
}
@@ -369,8 +373,15 @@ AllocateMotionHistory(DeviceIntPtr pDev) */
if (IsMaster(pDev))
size = sizeof(INT32) * 3 * MAX_VALUATORS;
- else
- size = sizeof(INT32) * pDev->valuator->numAxes;
+ else {
+ ValuatorClassPtr v = pDev->valuator;
+ int numAxes;
+ /* XI1 doesn't understand mixed mode devices */
+ for (numAxes = 0; numAxes < v->numAxes; numAxes++)
+ if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0))
+ break;
+ size = sizeof(INT32) * numAxes;
+ }
size += sizeof(Time);
@@ -524,12 +535,12 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, * for SDs: [time] [val0] [val1] ... [valn]
* for MDs: [time] [min_val0] [max_val0] [val0] [min_val1] ... [valn]
*
- * For events that have some valuators unset (first_valuator > 0):
+ * For events that have some valuators unset:
* min_val == max_val == val == 0.
*/
static void
-updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
- int num_valuators, int *valuators)
+updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
+ int *valuators)
{
char *buff = (char *) pDev->valuator->motion;
ValuatorClassPtr v;
@@ -548,17 +559,22 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time);
memset(buff, 0, sizeof(INT32) * 3 * MAX_VALUATORS);
- buff += 3 * sizeof(INT32) * first_valuator;
- for (i = first_valuator; i < first_valuator + num_valuators; i++)
+ for (i = 0; i < v->numAxes; i++)
{
- if (i >= v->numAxes)
+ /* XI1 doesn't support mixed mode devices */
+ if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0))
break;
+ if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
+ {
+ buff += 3 * sizeof(INT32);
+ continue;
+ }
memcpy(buff, &v->axes[i].min_value, sizeof(INT32));
buff += sizeof(INT32);
memcpy(buff, &v->axes[i].max_value, sizeof(INT32));
buff += sizeof(INT32);
- memcpy(buff, &valuators[i - first_valuator], sizeof(INT32));
+ memcpy(buff, &valuators[i], sizeof(INT32));
buff += sizeof(INT32);
}
} else
@@ -571,9 +587,17 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time);
memset(buff, 0, sizeof(INT32) * pDev->valuator->numAxes);
- buff += sizeof(INT32) * first_valuator;
- memcpy(buff, valuators, sizeof(INT32) * num_valuators);
+ for (i = 0; i < MAX_VALUATORS; i++)
+ {
+ if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
+ {
+ buff += sizeof(INT32);
+ continue;
+ }
+ memcpy(buff, &valuators[i], sizeof(INT32));
+ buff += sizeof(INT32);
+ }
}
pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) %
@@ -631,13 +655,17 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val) * Clip every axis in the list of valuators to its bounds.
*/
static void
-clipValuators(DeviceIntPtr pDev, int first_valuator, int num_valuators,
- int *valuators)
+clipValuators(DeviceIntPtr pDev, ValuatorMask *mask)
{
int i;
- for (i = 0; i < num_valuators; i++)
- clipAxis(pDev, i + first_valuator, &(valuators[i]));
+ for (i = 0; i < valuator_mask_size(mask); i++)
+ if (valuator_mask_isset(mask, i))
+ {
+ int val = valuator_mask_get(mask, i);
+ clipAxis(pDev, i, &val);
+ valuator_mask_set(mask, i, val);
+ }
}
/**
@@ -680,36 +708,35 @@ UpdateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_event * @param dev The device which's pointer is to be moved.
* @param x Returns the x position of the pointer after the move.
* @param y Returns the y position of the pointer after the move.
- * @param first The first valuator in @valuators
- * @param num Total number of valuators in @valuators.
+ * @param mask Bit mask of valid valuators.
* @param valuators Valuator data for each axis between @first and
* @first+@num.
*/
static void
-moveAbsolute(DeviceIntPtr dev, int *x, int *y,
- int first, int num, int *valuators)
+moveAbsolute(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
{
int i;
-
- if (num >= 1 && first == 0)
- *x = *(valuators + 0);
+ if (valuator_mask_isset(mask, 0))
+ *x = valuator_mask_get(mask, 0);
else
*x = dev->last.valuators[0];
- if (first <= 1 && num >= (2 - first))
- *y = *(valuators + 1 - first);
+ if (valuator_mask_isset(mask, 1))
+ *y = valuator_mask_get(mask, 1);
else
*y = dev->last.valuators[1];
clipAxis(dev, 0, x);
clipAxis(dev, 1, y);
- i = (first > 2) ? 0 : 2;
- for (; i < num; i++)
+ for (i = 2; i < valuator_mask_size(mask); i++)
{
- dev->last.valuators[i + first] = valuators[i];
- clipAxis(dev, i, &dev->last.valuators[i + first]);
+ if (valuator_mask_isset(mask, i))
+ {
+ dev->last.valuators[i] = valuator_mask_get(mask, i);
+ clipAxis(dev, i, &dev->last.valuators[i]);
+ }
}
}
@@ -719,42 +746,44 @@ moveAbsolute(DeviceIntPtr dev, int *x, int *y, * @param dev The device which's pointer is to be moved.
* @param x Returns the x position of the pointer after the move.
* @param y Returns the y position of the pointer after the move.
- * @param first The first valuator in @valuators
- * @param num Total number of valuators in @valuators.
+ * @param mask Bit mask of valid valuators.
* @param valuators Valuator data for each axis between @first and
* @first+@num.
*/
static void
-moveRelative(DeviceIntPtr dev, int *x, int *y,
- int first, int num, int *valuators)
+moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
{
int i;
*x = dev->last.valuators[0];
*y = dev->last.valuators[1];
- if (num >= 1 && first == 0)
- *x += *(valuators +0);
+ if (valuator_mask_isset(mask, 0))
+ *x += valuator_mask_get(mask, 0);
- if (first <= 1 && num >= (2 - first))
- *y += *(valuators + 1 - first);
+ if (valuator_mask_isset(mask, 1))
+ *y += valuator_mask_get(mask, 1);
/* if attached, clip both x and y to the defined limits (usually
* co-ord space limit). If it is attached, we need x/y to go over the
* limits to be able to change screens. */
- if(dev->u.master && dev->valuator->mode == Absolute) {
- clipAxis(dev, 0, x);
- clipAxis(dev, 1, y);
+ if(dev->u.master) {
+ if (valuator_get_mode(dev, 0) == Absolute)
+ clipAxis(dev, 0, x);
+ if (valuator_get_mode(dev, 1) == Absolute)
+ clipAxis(dev, 1, y);
}
/* calc other axes, clip, drop back into valuators */
- i = (first > 2) ? 0 : 2;
- for (; i < num; i++)
+ for (i = 2; i < valuator_mask_size(mask); i++)
{
- dev->last.valuators[i + first] += valuators[i];
- if (dev->valuator->mode == Absolute)
- clipAxis(dev, i, &dev->last.valuators[i + first]);
- valuators[i] = dev->last.valuators[i + first];
+ if (valuator_mask_isset(mask, i))
+ {
+ dev->last.valuators[i] += valuator_mask_get(mask, i);
+ if (valuator_get_mode(dev, i) == Absolute)
+ clipAxis(dev, i, &dev->last.valuators[i]);
+ valuator_mask_set(mask, i, dev->last.valuators[i]);
+ }
}
}
@@ -868,18 +897,18 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, * Update the motion history for the device and (if appropriate) for its
* master device.
* @param dev Slave device to update.
- * @param first First valuator to append to history.
+ * @param mask Bit mask of valid valuators to append to history.
* @param num Total number of valuators to append to history.
* @param ms Current time
*/
static void
-updateHistory(DeviceIntPtr dev, int first, int num, CARD32 ms)
+updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms)
{
- updateMotionHistory(dev, ms, first, num, &dev->last.valuators[first]);
+ updateMotionHistory(dev, ms, mask, dev->last.valuators);
if (dev->u.master)
{
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
- updateMotionHistory(master, ms, first, num, &dev->last.valuators[first]);
+ updateMotionHistory(master, ms, mask, dev->last.valuators);
}
}
@@ -889,7 +918,10 @@ updateHistory(DeviceIntPtr dev, int first, int num, CARD32 ms) */
int
GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) {
- return GetKeyboardValuatorEvents(events, pDev, type, key_code, 0, 0, NULL);
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ return GetKeyboardValuatorEvents(events, pDev, type, key_code, &mask);
}
@@ -903,20 +935,18 @@ GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) */
int
GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
- int key_code, int first_valuator,
- int num_valuators, int *valuators_in) {
+ int key_code, const ValuatorMask *mask_in) {
int num_events = 0;
CARD32 ms = 0;
DeviceEvent *event;
RawDeviceEvent *raw;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev->enabled)
return 0;
if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed ||
- num_valuators > MAX_VALUATORS ||
(type != KeyPress && type != KeyRelease) ||
(key_code < 8 || key_code > 255))
return 0;
@@ -941,17 +971,14 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, events++;
num_events++;
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
+ valuator_mask_copy(&mask, mask_in);
init_raw(pDev, raw, ms, type, key_code);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, raw->valuators.data_raw);
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data);
+ set_raw_valuators(raw, &mask, raw->valuators.data);
event = (DeviceEvent*) events->event;
init_event(pDev, event, ms);
@@ -966,10 +993,9 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, set_key_up(pDev, key_code, KEY_POSTED);
}
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
@@ -1026,19 +1052,19 @@ FreeEventList(EventListPtr list, int num_events) }
static void
-transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS])
+transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
{
struct pixman_f_vector p;
/* p' = M * p in homogeneous coordinates */
- p.v[0] = v[0];
- p.v[1] = v[1];
+ p.v[0] = valuator_mask_get(mask, 0);
+ p.v[1] = valuator_mask_get(mask, 1);
p.v[2] = 1.0;
pixman_f_transform_point(&dev->transform, &p);
- v[0] = lround(p.v[0]);
- v[1] = lround(p.v[1]);
+ valuator_mask_set(mask, 0, lround(p.v[0]));
+ valuator_mask_set(mask, 1, lround(p.v[1]));
}
/**
@@ -1059,8 +1085,7 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS]) */
int
GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
- int flags, int first_valuator, int num_valuators,
- int *valuators_in) {
+ int flags, const ValuatorMask *mask_in) {
int num_events = 1;
CARD32 ms;
DeviceEvent *event;
@@ -1069,7 +1094,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, cx, cy; /* only screen coordinates */
float x_frac = 0.0, y_frac = 0.0, cx_frac, cy_frac;
ScreenPtr scr = miPointerGetScreen(pDev);
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev->enabled)
@@ -1077,13 +1102,14 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, ms = GetTimeInMillis(); /* before pointer update to help precision */
- if (!scr || !pDev->valuator || first_valuator < 0 ||
- num_valuators > MAX_VALUATORS ||
- ((num_valuators + first_valuator) > pDev->valuator->numAxes) ||
+ if (!scr || !pDev->valuator ||
(type != MotionNotify && type != ButtonPress && type != ButtonRelease) ||
(type != MotionNotify && !pDev->button) ||
- ((type == ButtonPress || type == ButtonRelease) && !buttons) ||
- (type == MotionNotify && num_valuators <= 0))
+ ((type == ButtonPress || type == ButtonRelease) && !buttons))
+ return 0;
+
+ if (type == MotionNotify &&
+ (!mask_in || valuator_mask_num_valuators(mask_in) <= 0))
return 0;
events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
@@ -1092,54 +1118,68 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, events++;
num_events++;
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
+ valuator_mask_copy(&mask, mask_in);
init_raw(pDev, raw, ms, type, buttons);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, raw->valuators.data_raw);
if (flags & POINTER_ABSOLUTE)
{
if (flags & POINTER_SCREEN) /* valuators are in screen coords */
{
+ int scaled;
- if (num_valuators >= 1 && first_valuator == 0)
- valuators[0] = rescaleValuatorAxis(valuators[0], 0.0, &x_frac, NULL,
- pDev->valuator->axes + 0,
- scr->width);
- if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
- valuators[1 - first_valuator] = rescaleValuatorAxis(valuators[1 - first_valuator], 0.0, &y_frac, NULL,
- pDev->valuator->axes + 1,
- scr->height);
+ if (valuator_mask_isset(&mask, 0))
+ {
+ scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
+ 0.0, &x_frac, NULL,
+ pDev->valuator->axes + 0,
+ scr->width);
+ valuator_mask_set(&mask, 0, scaled);
+ }
+ if (valuator_mask_isset(&mask, 1))
+ {
+ scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
+ 0.0, &y_frac, NULL,
+ pDev->valuator->axes + 1,
+ scr->height);
+ valuator_mask_set(&mask, 1, scaled);
+ }
}
- transformAbsolute(pDev, valuators);
- moveAbsolute(pDev, &x, &y, first_valuator, num_valuators, valuators);
+ transformAbsolute(pDev, &mask);
+ moveAbsolute(pDev, &x, &y, &mask);
} else {
if (flags & POINTER_ACCELERATE) {
- accelPointer(pDev, first_valuator, num_valuators, valuators, ms);
+ /* FIXME: Pointer acceleration only requires X and Y values. This
+ * should be converted to masked valuators. */
+ int vals[2];
+ vals[0] = valuator_mask_isset(&mask, 0) ?
+ valuator_mask_get(&mask, 0) : pDev->last.valuators[0];
+ vals[1] = valuator_mask_isset(&mask, 1) ?
+ valuator_mask_get(&mask, 1) : pDev->last.valuators[1];
+ accelPointer(pDev, 0, 2, vals, ms);
+
/* The pointer acceleration code modifies the fractional part
* in-place, so we need to extract this information first */
x_frac = pDev->last.remainder[0];
y_frac = pDev->last.remainder[1];
}
- moveRelative(pDev, &x, &y, first_valuator, num_valuators, valuators);
+ moveRelative(pDev, &x, &y, &mask);
}
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data);
+ set_raw_valuators(raw, &mask, raw->valuators.data);
positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
- updateHistory(pDev, first_valuator, num_valuators, ms);
+ updateHistory(pDev, &mask, ms);
/* Update the valuators with the true value sent to the client*/
- if (num_valuators >= 1 && first_valuator == 0)
- valuators[0] = x;
- if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
- valuators[1 - first_valuator] = y;
+ if (valuator_mask_isset(&mask, 0))
+ valuator_mask_set(&mask, 0, x);
+ if (valuator_mask_isset(&mask, 1))
+ valuator_mask_set(&mask, 0, y);
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
event = (DeviceEvent*) events->event;
init_event(pDev, event, ms);
@@ -1165,7 +1205,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, event->root_x_frac = cx_frac;
event->root_y_frac = cy_frac;
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
@@ -1180,30 +1220,31 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, * place via GetMaximumEventsNum(), and for freeing it.
*/
int
-GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
- int first_valuator, int num_valuators, int *valuators_in)
+GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask_in)
{
- int num_events = 1;
+ int num_events = 1, i;
DeviceEvent *event;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev->enabled)
return 0;
/* Sanity checks. */
- if (type != ProximityIn && type != ProximityOut)
+ if ((type != ProximityIn && type != ProximityOut) || !mask_in)
return 0;
if (!pDev->valuator)
return 0;
- /* Do we need to send a DeviceValuator event? */
- if ((pDev->valuator->mode & 1) == Relative)
- num_valuators = 0;
- /* You fail. */
- if (first_valuator < 0 || num_valuators > MAX_VALUATORS ||
- (num_valuators + first_valuator) > pDev->valuator->numAxes)
- return 0;
+ valuator_mask_copy(&mask, mask_in);
+
+ /* ignore relative axes for proximity. */
+ for (i = 0; i < valuator_mask_num_valuators(&mask); i++)
+ {
+ if (valuator_mask_isset(&mask, i) &&
+ valuator_get_mode(pDev, i) == Relative)
+ valuator_mask_unset(&mask, i);
+ }
events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
@@ -1211,12 +1252,9 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, init_event(pDev, event, GetTimeInMillis());
event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut;
- if (num_valuators) {
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
- clipValuators(pDev, first_valuator, num_valuators, valuators);
- }
+ clipValuators(pDev, &mask);
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
diff --git a/xorg-server/dix/globals.c b/xorg-server/dix/globals.c index 622e50f81..d7e919e50 100644 --- a/xorg-server/dix/globals.c +++ b/xorg-server/dix/globals.c @@ -106,10 +106,6 @@ CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL;
int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING;
int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES;
-#ifndef NOLOGOHACK
-int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
-#endif
-
#ifdef SCREENSAVER
Bool screenSaverSuspended = FALSE;
#endif
diff --git a/xorg-server/dix/grabs.c b/xorg-server/dix/grabs.c index c588afc7c..a14181108 100644 --- a/xorg-server/dix/grabs.c +++ b/xorg-server/dix/grabs.c @@ -117,11 +117,8 @@ CreateGrab( static void
FreeGrab(GrabPtr pGrab)
{
- if (pGrab->modifiersDetail.pMask != NULL)
- free(pGrab->modifiersDetail.pMask);
-
- if (pGrab->detail.pMask != NULL)
- free(pGrab->detail.pMask);
+ free(pGrab->modifiersDetail.pMask);
+ free(pGrab->detail.pMask);
if (pGrab->cursor)
FreeCursor(pGrab->cursor, (Cursor)0);
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c index 39e65064a..80275bd40 100644 --- a/xorg-server/dix/inpututils.c +++ b/xorg-server/dix/inpututils.c @@ -35,6 +35,7 @@ #include "xace.h"
#include "xkbsrv.h"
#include "xkbstr.h"
+#include "inpututils.h"
/* Check if a button map change is okay with the device.
* Returns -1 for BadValue, as it collides with MappingBusy. */
@@ -418,3 +419,132 @@ FreeInputAttributes(InputAttributes *attrs) free(attrs);
}
+/**
+ * Alloc a valuator mask large enough for num_valuators.
+ */
+ValuatorMask*
+valuator_mask_new(int num_valuators)
+{
+ /* alloc a fixed size mask for now and ignore num_valuators. in the
+ * flying-car future, when we can dynamically alloc the masks and are
+ * not constrained by signals, we can start using num_valuators */
+ ValuatorMask *mask = calloc(1, sizeof(ValuatorMask));
+ mask->last_bit = -1;
+ return mask;
+}
+
+/**
+ * Sets a range of valuators between first_valuator and num_valuators with
+ * the data in the valuators array. All other values are set to 0.
+ */
+void
+valuator_mask_set_range(ValuatorMask *mask, int first_valuator, int num_valuators,
+ const int* valuators)
+{
+ int i;
+
+ valuator_mask_zero(mask);
+
+ for (i = first_valuator; i < min(first_valuator + num_valuators, MAX_VALUATORS); i++)
+ valuator_mask_set(mask, i, valuators[i - first_valuator]);
+}
+
+/**
+ * Reset mask to zero.
+ */
+void
+valuator_mask_zero(ValuatorMask *mask)
+{
+ memset(mask, 0, sizeof(*mask));
+ mask->last_bit = -1;
+}
+
+/**
+ * Returns the current size of the mask (i.e. the highest number of
+ * valuators currently set + 1).
+ */
+int
+valuator_mask_size(const ValuatorMask *mask)
+{
+ return mask->last_bit + 1;
+}
+
+/**
+ * Returns the number of valuators set in the given mask.
+ */
+int
+valuator_mask_num_valuators(const ValuatorMask *mask)
+{
+ return CountBits(mask->mask, min(mask->last_bit + 1, MAX_VALUATORS));
+}
+
+/**
+ * Return true if the valuator is set in the mask, or false otherwise.
+ */
+int
+valuator_mask_isset(const ValuatorMask *mask, int valuator)
+{
+ return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator);
+}
+
+/**
+ * Set the valuator to the given data.
+ */
+void
+valuator_mask_set(ValuatorMask *mask, int valuator, int data)
+{
+ mask->last_bit = max(valuator, mask->last_bit);
+ SetBit(mask->mask, valuator);
+ mask->valuators[valuator] = data;
+}
+
+/**
+ * Return the requested valuator value. If the mask bit is not set for the
+ * given valuator, the returned value is undefined.
+ */
+int
+valuator_mask_get(const ValuatorMask *mask, int valuator)
+{
+ return mask->valuators[valuator];
+}
+
+/**
+ * Remove the valuator from the mask.
+ */
+void
+valuator_mask_unset(ValuatorMask *mask, int valuator)
+{
+ if (mask->last_bit >= valuator) {
+ int i, lastbit = -1;
+
+ ClearBit(mask->mask, valuator);
+ mask->valuators[valuator] = 0;
+
+ for (i = 0; i <= mask->last_bit; i++)
+ if (valuator_mask_isset(mask, i))
+ lastbit = max(lastbit, i);
+ mask->last_bit = lastbit;
+ }
+}
+
+void
+valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src)
+{
+ if (src)
+ memcpy(dest, src, sizeof(*dest));
+ else
+ valuator_mask_zero(dest);
+}
+
+int
+CountBits(const uint8_t *mask, int len)
+{
+ int i;
+ int ret = 0;
+
+ for (i = 0; i < len; i++)
+ if (BitIsOn(mask, i))
+ ret++;
+
+ return ret;
+}
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c index eeedb83dd..9a8737cf4 100644 --- a/xorg-server/dix/ptrveloc.c +++ b/xorg-server/dix/ptrveloc.c @@ -952,11 +952,9 @@ SetAccelerationProfile( if(profile == NULL && profile_num != PROFILE_UNINITIALIZE)
return FALSE;
- if(vel->profile_private != NULL){
- /* Here one could free old profile-private data */
- free(vel->profile_private);
- vel->profile_private = NULL;
- }
+ /* Here one could free old profile-private data */
+ free(vel->profile_private);
+ vel->profile_private = NULL;
/* Here one could init profile-private data */
vel->Profile = profile;
vel->statistics.profile_number = profile_num;
diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 485c3caea..399e08635 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -137,6 +137,8 @@ Equipment Corporation. * ChangeWindowDeviceCursor
******/
+Bool bgNoneRoot = FALSE;
+
static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
@@ -463,6 +465,10 @@ InitRootWindow(WindowPtr pWin) if (party_like_its_1989) {
MakeRootTile(pWin);
backFlag |= CWBackPixmap;
+ } else if (pScreen->canDoBGNoneRoot && bgNoneRoot) {
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
+ backFlag |= CWBackPixmap;
} else {
if (whiteRoot)
pWin->background.pixel = pScreen->whitePixel;
@@ -950,6 +956,26 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client) return Success;
}
+static void
+SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2)
+{
+ /* following the protocol: "Changing the background of a root window to
+ * None or ParentRelative restores the default background pixmap" */
+ if (bgNoneRoot) {
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
+ }
+ else if (party_like_its_1989)
+ MakeRootTile(pWin);
+ else {
+ if (whiteRoot)
+ pWin->background.pixel = pScreen->whitePixel;
+ else
+ pWin->background.pixel = pScreen->blackPixel;
+ *index2 = CWBackPixel;
+ }
+}
+
/*****
* ChangeWindowAttributes
*
@@ -999,7 +1025,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
if (!pWin->parent)
- MakeRootTile(pWin);
+ SetRootWindowBackground(pWin, pScreen, &index2);
else {
pWin->backgroundState = XaceBackgroundNoneState(pWin);
pWin->background.pixel = pScreen->whitePixel;
@@ -1016,7 +1042,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
if (!pWin->parent)
- MakeRootTile(pWin);
+ SetRootWindowBackground(pWin, pScreen, &index2);
else
pWin->backgroundState = ParentRelative;
borderRelative = TRUE;
@@ -3087,13 +3113,6 @@ SendVisibilityNotify(WindowPtr pWin) }
#define RANDOM_WIDTH 32
-
-#ifndef NOLOGOHACK
-static void DrawLogo(
- WindowPtr pWin
-);
-#endif
-
int
dixSaveScreens(ClientPtr client, int on, int mode)
{
@@ -3155,18 +3174,10 @@ dixSaveScreens(ClientPtr client, int on, int mode) * for the root window, so miPaintWindow works
*/
screenIsSaved = SCREEN_SAVER_OFF;
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE);
-#endif
(*pWin->drawable.pScreen->MoveWindow)(pWin,
(short)(-(rand() % RANDOM_WIDTH)),
(short)(-(rand() % RANDOM_WIDTH)),
pWin->nextSib, VTMove);
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- DrawLogo(pWin);
-#endif
screenIsSaved = SCREEN_SAVER_ON;
}
/*
@@ -3324,10 +3335,6 @@ TileScreenSaver(ScreenPtr pScreen, int kind) (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap);
}
MapWindow(pWin, serverClient);
-#ifndef NOLOGOHACK
- if (kind == SCREEN_IS_TILED && logoScreenSaver)
- DrawLogo(pWin);
-#endif
return TRUE;
}
@@ -3673,184 +3680,3 @@ WindowParentHasDeviceCursor(WindowPtr pWin, }
return FALSE;
}
-
-#ifndef NOLOGOHACK
-static void
-DrawLogo(WindowPtr pWin)
-{
- DrawablePtr pDraw;
- ScreenPtr pScreen;
- int x, y;
- unsigned int width, height, size;
- GC *pGC;
- int rc, thin, gap, d31;
- DDXPointRec poly[4];
- ChangeGCVal fore[2], back[2];
- xrgb rgb[2];
- BITS32 fmask, bmask;
- ColormapPtr cmap;
-
- pDraw = (DrawablePtr)pWin;
- pScreen = pDraw->pScreen;
- x = -pWin->origin.x;
- y = -pWin->origin.y;
- width = pScreen->width;
- height = pScreen->height;
- pGC = GetScratchGC(pScreen->rootDepth, pScreen);
- if (!pGC)
- return;
-
- if ((rand() % 100) <= 17) /* make the probability for white fairly low */
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- if (pWin->backgroundState == BackgroundPixel) {
- rc = dixLookupResourceByType((pointer *)&cmap, wColormap(pWin),
- RT_COLORMAP, serverClient, DixReadAccess);
- if (rc == Success) {
- Pixel querypixels[2];
-
- querypixels[0] = fore[0].val;
- querypixels[1] = pWin->background.pixel;
- QueryColors(cmap, 2, querypixels, rgb, serverClient);
- if ((rgb[0].red == rgb[1].red) &&
- (rgb[0].green == rgb[1].green) &&
- (rgb[0].blue == rgb[1].blue)) {
- if (fore[0].val == pScreen->blackPixel)
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- }
- }
- }
- fore[1].val = FillSolid;
- fmask = GCForeground|GCFillStyle;
- if (pWin->backgroundState == BackgroundPixel) {
- back[0].val = pWin->background.pixel;
- back[1].val = FillSolid;
- bmask = GCForeground|GCFillStyle;
- } else {
- back[0].val = 0;
- back[1].val = 0;
- ChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back);
- back[0].val = FillTiled;
- back[1].ptr = pWin->background.pixmap;
- bmask = GCFillStyle|GCTile;
- }
-
- /* should be the same as the reference function XmuDrawLogo() */
-
- size = width;
- if (height < width)
- size = height;
- size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH);
- size &= ~1;
- x += rand() % (width - size);
- y += rand() % (height - size);
-
-/*
- * Draw what will be the thin strokes.
- *
- * -----
- * / /
- * / /
- * / /
- * / /
- * /____/
- * d
- *
- * Point d is 9/44 (~1/5) of the way across.
- */
-
- thin = (size / 11);
- if (thin < 1) thin = 1;
- gap = (thin+3) / 4;
- d31 = thin + thin + gap;
- poly[0].x = x + size; poly[0].y = y;
- poly[1].x = x + size-d31; poly[1].y = y;
- poly[2].x = x + 0; poly[2].y = y + size;
- poly[3].x = x + d31; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, fmask, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for lower thin stroke.
- *
- * ------
- * / /
- * / __ /
- * / / /
- * / / /
- * /__/__/
- */
-
- poly[0].x = x + d31/2; poly[0].y = y + size;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + d31; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, bmask, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for upper thin stroke.
- *
- * ------
- * / / /
- * /--/ /
- * / /
- * / /
- * /_____/
- */
-
- poly[0].x = x + size - d31/2; poly[0].y = y;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + size - d31; poly[3].y = y;
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Draw thick stroke.
- * Point b is 1/4 of the way across.
- *
- * b
- * -----
- * \ \
- * \ \
- * \ \
- * \ \
- * \____\
- */
-
- poly[0].x = x; poly[0].y = y;
- poly[1].x = x + size/4; poly[1].y = y;
- poly[2].x = x + size; poly[2].y = y + size;
- poly[3].x = x + size - size/4; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, fmask, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase to create gap.
- *
- * /
- * /
- * /
- * /
- * /
- */
-
- poly[0].x = x + size- thin; poly[0].y = y;
- poly[1].x = x + size-( thin+gap); poly[1].y = y;
- poly[2].x = x + thin; poly[2].y = y + size;
- poly[3].x = x + thin + gap; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, bmask, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
- FreeScratchGC(pGC);
-}
-
-#endif
diff --git a/xorg-server/doc/Xserver.man.pre b/xorg-server/doc/Xserver.man.pre index 4926960c2..2fc5541fc 100644 --- a/xorg-server/doc/Xserver.man.pre +++ b/xorg-server/doc/Xserver.man.pre @@ -285,14 +285,6 @@ sets the stack space limit of the server to the specified number of kilobytes. A value of zero makes the stack size as large as possible. The default value
of \-1 leaves the stack space limit unchanged.
.TP 8
-.B \-logo
-turns on the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
-.B nologo
-turns off the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
.B \-render
.BR default | mono | gray | color
sets the color allocation policy that will be used by the render extension.
diff --git a/xorg-server/doc/xml/Xserver-spec.xml b/xorg-server/doc/xml/Xserver-spec.xml index 3bea5e968..1b216ce8d 100644 --- a/xorg-server/doc/xml/Xserver-spec.xml +++ b/xorg-server/doc/xml/Xserver-spec.xml @@ -1710,8 +1710,6 @@ Input initialization is a bit complicated. It all starts with InitInput(), a routine that you write to call
AddInputDevice() twice
(once for pointing device and once for keyboard.)
-You also want to call RegisterKeyboardDevice() and RegisterPointerDevice()
-on them.
</para>
<para>
When you Add the devices, a routine you supply for each device
@@ -1731,8 +1729,6 @@ the pointer is the pointer. InitInput is a DDX routine you must write to initialize the
input subsystem in DDX.
It must call AddInputDevice() for each device that might generate events.
-In addition, you must register the main keyboard and pointing devices by
-calling RegisterPointerDevice() and RegisterKeyboardDevice().
</para>
<para>
<blockquote><programlisting>
@@ -1755,25 +1751,6 @@ Note also that except for the main keyboard and pointing device, an extension is needed to provide for a client interface to a device.
</para>
<para>
-<blockquote><programlisting>
-
- void RegisterPointerDevice(device)
- DevicePtr device;
-</programlisting></blockquote>
-RegisterPointerDevice is a DIX routine that your DDX code calls that
-makes that device the main pointing device.
-This routine is called once upon initialization and cannot be called again.
-</para>
-<para>
-<blockquote><programlisting>
-
- void RegisterKeyboardDevice(device)
- DevicePtr device;
-</programlisting></blockquote>
-RegisterKeyboardDevice makes the given device the main keyboard.
-This routine is called once upon initialization and cannot be called again.
-</para>
-<para>
The following DIX
procedures return the specified DevicePtr. They may or may not be useful
to DDX implementors.
@@ -5163,8 +5140,6 @@ mi and fb implementations.</para> </row>
</thead>
<tbody>
-<row><entry><function>RegisterKeyboardDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
-<row><entry><function>RegisterPointerDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
<row><entry><function>RemoveEnabledDevice</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>ResetCurrentRequest</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>SaveScreen</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
diff --git a/xorg-server/doc/xml/dtrace/Makefile.am b/xorg-server/doc/xml/dtrace/Makefile.am index 946fba7d8..dc6127416 100644 --- a/xorg-server/doc/xml/dtrace/Makefile.am +++ b/xorg-server/doc/xml/dtrace/Makefile.am @@ -25,11 +25,13 @@ XML_FILES = Xserver-DTrace.xml include ../xmlrules.in
+if ENABLE_DOCS
if XSERVER_DTRACE
doc_DATA = $(BUILT_DOC_FILES)
else
noinst_DATA = $(BUILT_DOC_FILES)
endif
+endif
CLEANFILES = $(CLEAN_DOC_FILES)
diff --git a/xorg-server/exa/exa.c b/xorg-server/exa/exa.c index eda9ad7a7..9dbcf4d10 100644 --- a/xorg-server/exa/exa.c +++ b/xorg-server/exa/exa.c @@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) return;
RegionInit(®ion, &box, 1);
- DamageRegionAppend(&pPix->drawable, ®ion);
- DamageRegionProcessPending(&pPix->drawable);
+ DamageDamageRegion(&pPix->drawable, ®ion);
RegionUninit(®ion);
}
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c index 9e2c35c4b..c27fb4e20 100644 --- a/xorg-server/fb/fbpict.c +++ b/xorg-server/fb/fbpict.c @@ -35,112 +35,6 @@ #include "mipict.h"
#include "fbpict.h"
-#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-void
-fbWalkCompositeRegion (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height,
- Bool srcRepeat,
- Bool maskRepeat,
- CompositeFunc compositeRect)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- int w, h, w_this, h_this;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- if (pSrc->pDrawable)
- {
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
- }
- if (pMask && pMask->pDrawable)
- {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
- }
-
- if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height))
- return;
-
- n = RegionNumRects (®ion);
- pbox = RegionRects (®ion);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height);
- if (h_this > pMask->pDrawable->height - y_msk)
- h_this = pMask->pDrawable->height - y_msk;
- y_msk += pMask->pDrawable->y;
- }
- if (srcRepeat)
- {
- y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height);
- if (h_this > pSrc->pDrawable->height - y_src)
- h_this = pSrc->pDrawable->height - y_src;
- y_src += pSrc->pDrawable->y;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width);
- if (w_this > pMask->pDrawable->width - x_msk)
- w_this = pMask->pDrawable->width - x_msk;
- x_msk += pMask->pDrawable->x;
- }
- if (srcRepeat)
- {
- x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width);
- if (w_this > pSrc->pDrawable->width - x_src)
- w_this = pSrc->pDrawable->width - x_src;
- x_src += pSrc->pDrawable->x;
- }
- (*compositeRect) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- RegionUninit(®ion);
-}
-
void
fbComposite (CARD8 op,
PicturePtr pSrc,
@@ -182,25 +76,6 @@ fbComposite (CARD8 op, free_pixman_pict (pDst, dest);
}
-void
-fbCompositeGeneral (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- fbComposite (op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
-}
-
static pixman_image_t *
create_solid_fill_image (PicturePtr pict)
{
diff --git a/xorg-server/fb/fbpict.h b/xorg-server/fb/fbpict.h index b89f90ff1..e7daaa245 100644 --- a/xorg-server/fb/fbpict.h +++ b/xorg-server/fb/fbpict.h @@ -1,484 +1,68 @@ -/* - * - * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#ifndef _FBPICT_H_ -#define _FBPICT_H_ - -#include "renderedge.h" - - -#if defined(__GNUC__) -#define INLINE __inline__ -#else -#define INLINE -#endif - -#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) ) -#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b)) - -#define FbGet8(v,i) ((CARD16) (CARD8) ((v) >> i)) - -/* - * There are two ways of handling alpha -- either as a single unified value or - * a separate value for each component, hence each macro must have two - * versions. The unified alpha version has a 'U' at the end of the name, - * the component version has a 'C'. Similarly, functions which deal with - * this difference will have two versions using the same convention. - */ - -#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i)) - -#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i)) - -#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \ - FbIntMult(FbGet8(x,i),ax,(v))),\ - (CARD32) ((CARD8) ((t) | \ - (0 - ((t) >> 8)))) << (i)) - -#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - - -#define Alpha(x) ((x) >> 24) -#define Red(x) (((x) >> 16) & 0xff) -#define Green(x) (((x) >> 8) & 0xff) -#define Blue(x) ((x) & 0xff) - -/** - * Returns TRUE if the fbComposeGetSolid can be used to get a single solid - * color representing every source sampling location of the picture. - */ -static INLINE Bool -fbCanGetSolid(PicturePtr pict) -{ - if (pict->pDrawable == NULL || - pict->pDrawable->width != 1 || - pict->pDrawable->height != 1) - { - return FALSE; - } - if (pict->repeat != RepeatNormal) - return FALSE; - - switch (pict->format) { - case PICT_a8r8g8b8: - case PICT_x8r8g8b8: - case PICT_a8b8g8r8: - case PICT_x8b8g8r8: - case PICT_b8g8r8a8: - case PICT_b8g8r8x8: - case PICT_r8g8b8: - case PICT_b8g8r8: - case PICT_r5g6b5: - case PICT_b5g6r5: - return TRUE; - default: - return FALSE; - } -} - -#define fbComposeGetSolid(pict, bits, fmt) { \ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - switch (__bpp__) { \ - case 32: \ - (bits) = READ((CARD32 *) __bits__); \ - break; \ - case 24: \ - (bits) = Fetch24 ((CARD8 *) __bits__); \ - break; \ - case 16: \ - (bits) = READ((CARD16 *) __bits__); \ - (bits) = cvt0565to0888(bits); \ - break; \ - case 8: \ - (bits) = READ((CARD8 *) __bits__); \ - (bits) = (bits) << 24; \ - break; \ - case 1: \ - (bits) = READ((CARD32 *) __bits__); \ - (bits) = FbLeftStipBits((bits),1) ? 0xff000000 : 0x00000000;\ - break; \ - default: \ - return; \ - } \ - /* If necessary, convert RGB <--> BGR. */ \ - if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \ - { \ - (bits) = (((bits) & 0xff000000) | \ - (((bits) & 0x00ff0000) >> 16) | \ - (((bits) & 0x0000ff00) >> 0) | \ - (((bits) & 0x000000ff) << 16)); \ - } \ - /* manage missing src alpha */ \ - if ((pict)->pFormat->direct.alphaMask == 0) \ - (bits) |= 0xff000000; \ - fbFinishAccess ((pict)->pDrawable); \ -} - -#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul) * ((x) + __xoff__); \ -} -#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ - (((s) >> 5) & 0x07e0) | \ - (((s) >> 8) & 0xf800)) -#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ - ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \ - ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \ - ((READ((CARD16 *) (a)) << 8) | READ((a)+2))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) ((v) >> 16)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \ - (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \ - WRITE((a)+2, (CARD8) (v)))) -#else -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \ - (READ((CARD16 *) (a)) | (READ((a)+2) << 16))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) (v)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \ - (WRITE((CARD16 *) (a), (CARD16) (v)),\ - WRITE((a)+2, (CARD8) ((v) >> 16)))) -#endif - -/* - The methods below use some tricks to be able to do two color - components at the same time. -*/ - -/* - x_c = (x_c * a) / 255 -*/ -#define FbByteMul(x, a) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)); \ - x &= 0xff00ff00; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAdd(x, a, y) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += y & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)) >> 8; \ - x &= 0xff00ff; \ - x += (y >> 8) & 0xff00ff; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x <<= 8; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a + y_c * b) / 255 -*/ -#define FbByteAddMul(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * a + (y >> 24) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - t = (x & 0xff00) * a + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ -} while (0) - -/* - x_c = (x_c * a + y_c *b) / 256 -*/ -#define FbByteAddMul_256(x, a, y, b) do { \ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \ - t >>= 8; \ - t &= 0xff00ff; \ - \ - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \ - x &= 0xff00ff00; \ - x += t; \ -} while (0) -/* - x_c = (x_c * a_c) / 255 -*/ -#define FbByteMulC(x, a) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = t + ((t >> 8) & 0xff00ff); \ - x = r | (t & 0xff00ff00); \ - \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAddC(x, a, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - r += y & 0xff00ff; \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += (y >> 8) & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - x = r | (t << 8); \ - } while (0) - -/* - x_c = (x_c * a_c + y_c * b) / 255 -*/ -#define FbByteAddMulC(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * (a >> 24) + (y >> 24) * b; \ - r += (r >> 8) + 0x80; \ - r >>= 8; \ - \ - t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ - } while (0) - -/* - x_c = min(x_c + y_c, 255) -*/ -#define FbByteAdd(x, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff00ff) + (y & 0xff00ff); \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - r |= (t & 0xff00ff) << 8; \ - x = r; \ - } while (0) - -#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8) - -#if defined(__i386__) && defined(__GNUC__) -#define FASTCALL __attribute__((regparm(3))) -#else -#define FASTCALL -#endif - -typedef struct _FbComposeData { - CARD8 op; - PicturePtr src; - PicturePtr mask; - PicturePtr dest; - INT16 xSrc; - INT16 ySrc; - INT16 xMask; - INT16 yMask; - INT16 xDest; - INT16 yDest; - CARD16 width; - CARD16 height; -} FbComposeData; - -extern _X_EXPORT void -fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer); - -typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width); -typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width); -typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width); - -typedef struct _FbComposeFunctions { - CombineFuncU *combineU; - CombineFuncC *combineC; - CombineMaskU combineMaskU; -} FbComposeFunctions; - -/* fbcompose.c */ - -extern _X_EXPORT void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -/* fbpict.c */ -extern _X_EXPORT void -fbComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*CompositeFunc) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -extern _X_EXPORT void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect); - -/* fbtrap.c */ - -extern _X_EXPORT void -fbAddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps); - -extern _X_EXPORT void -fbRasterizeTrapezoid (PicturePtr alpha, - xTrapezoid *trap, - int x_off, - int y_off); - -extern _X_EXPORT void -fbAddTriangles (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntri, - xTriangle *tris); - -#endif /* _FBPICT_H_ */ +/*
+ *
+ * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _FBPICT_H_
+#define _FBPICT_H_
+
+/* fbpict.c */
+extern _X_EXPORT void
+fbComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+/* fbtrap.c */
+
+extern _X_EXPORT void
+fbAddTraps (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff,
+ int ntrap,
+ xTrap *traps);
+
+extern _X_EXPORT void
+fbRasterizeTrapezoid (PicturePtr alpha,
+ xTrapezoid *trap,
+ int x_off,
+ int y_off);
+
+extern _X_EXPORT void
+fbAddTriangles (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff,
+ int ntri,
+ xTriangle *tris);
+
+#endif /* _FBPICT_H_ */
diff --git a/xorg-server/fb/fbtrap.c b/xorg-server/fb/fbtrap.c index 9f5c39f65..e52f84cd7 100644 --- a/xorg-server/fb/fbtrap.c +++ b/xorg-server/fb/fbtrap.c @@ -1,160 +1,159 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "fb.h" - -#include "picturestr.h" -#include "mipict.h" -#include "renderedge.h" -#include "fbpict.h" - -void -fbAddTraps (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntrap, - xTrap *traps) -{ - int image_xoff, image_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff); - - if (!image) - return; - - pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps); - - free_pixman_pict (pPicture, image); -} - -void -fbRasterizeTrapezoid (PicturePtr pPicture, - xTrapezoid *trap, - int x_off, - int y_off) -{ - int mask_xoff, mask_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff); - - if (!image) - return; - - pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off); - - free_pixman_pict (pPicture, image); -} - -static int -_GreaterY (xPointFixed *a, xPointFixed *b) -{ - if (a->y == b->y) - return a->x > b->x; - return a->y > b->y; -} - -/* - * Note that the definition of this function is a bit odd because - * of the X coordinate space (y increasing downwards). - */ -static int -_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b) -{ - xPointFixed ad, bd; - - ad.x = a->x - ref->x; - ad.y = a->y - ref->y; - bd.x = b->x - ref->x; - bd.y = b->y - ref->y; - - return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0; -} - -/* FIXME -- this could be made more efficient */ -void -fbAddTriangles (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntri, - xTriangle *tris) -{ - xPointFixed *top, *left, *right, *tmp; - xTrapezoid trap; - - for (; ntri; ntri--, tris++) - { - top = &tris->p1; - left = &tris->p2; - right = &tris->p3; - if (_GreaterY (top, left)) { - tmp = left; left = top; top = tmp; - } - if (_GreaterY (top, right)) { - tmp = right; right = top; top = tmp; - } - if (_Clockwise (top, right, left)) { - tmp = right; right = left; left = tmp; - } - - /* - * Two cases: - * - * + + - * / \ / \ - * / \ / \ - * / + + \ - * / -- -- \ - * / -- -- \ - * / --- --- \ - * +-- --+ - */ - - trap.top = top->y; - trap.left.p1 = *top; - trap.left.p2 = *left; - trap.right.p1 = *top; - trap.right.p2 = *right; - if (right->y < left->y) - trap.bottom = right->y; - else - trap.bottom = left->y; - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - if (right->y < left->y) - { - trap.top = right->y; - trap.bottom = left->y; - trap.right.p1 = *right; - trap.right.p2 = *left; - } - else - { - trap.top = left->y; - trap.bottom = right->y; - trap.left.p1 = *left; - trap.left.p2 = *right; - } - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - } -} - +/*
+ * Copyright © 2004 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "fb.h"
+
+#include "picturestr.h"
+#include "mipict.h"
+#include "fbpict.h"
+
+void
+fbAddTraps (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntrap,
+ xTrap *traps)
+{
+ int image_xoff, image_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+
+ if (!image)
+ return;
+
+ pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
+
+ free_pixman_pict (pPicture, image);
+}
+
+void
+fbRasterizeTrapezoid (PicturePtr pPicture,
+ xTrapezoid *trap,
+ int x_off,
+ int y_off)
+{
+ int mask_xoff, mask_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+
+ if (!image)
+ return;
+
+ pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
+
+ free_pixman_pict (pPicture, image);
+}
+
+static int
+_GreaterY (xPointFixed *a, xPointFixed *b)
+{
+ if (a->y == b->y)
+ return a->x > b->x;
+ return a->y > b->y;
+}
+
+/*
+ * Note that the definition of this function is a bit odd because
+ * of the X coordinate space (y increasing downwards).
+ */
+static int
+_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b)
+{
+ xPointFixed ad, bd;
+
+ ad.x = a->x - ref->x;
+ ad.y = a->y - ref->y;
+ bd.x = b->x - ref->x;
+ bd.y = b->y - ref->y;
+
+ return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0;
+}
+
+/* FIXME -- this could be made more efficient */
+void
+fbAddTriangles (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntri,
+ xTriangle *tris)
+{
+ xPointFixed *top, *left, *right, *tmp;
+ xTrapezoid trap;
+
+ for (; ntri; ntri--, tris++)
+ {
+ top = &tris->p1;
+ left = &tris->p2;
+ right = &tris->p3;
+ if (_GreaterY (top, left)) {
+ tmp = left; left = top; top = tmp;
+ }
+ if (_GreaterY (top, right)) {
+ tmp = right; right = top; top = tmp;
+ }
+ if (_Clockwise (top, right, left)) {
+ tmp = right; right = left; left = tmp;
+ }
+
+ /*
+ * Two cases:
+ *
+ * + +
+ * / \ / \
+ * / \ / \
+ * / + + \
+ * / -- -- \
+ * / -- -- \
+ * / --- --- \
+ * +-- --+
+ */
+
+ trap.top = top->y;
+ trap.left.p1 = *top;
+ trap.left.p2 = *left;
+ trap.right.p1 = *top;
+ trap.right.p2 = *right;
+ if (right->y < left->y)
+ trap.bottom = right->y;
+ else
+ trap.bottom = left->y;
+ fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
+ if (right->y < left->y)
+ {
+ trap.top = right->y;
+ trap.bottom = left->y;
+ trap.right.p1 = *right;
+ trap.right.p2 = *left;
+ }
+ else
+ {
+ trap.top = left->y;
+ trap.bottom = right->y;
+ trap.left.p1 = *left;
+ trap.left.p2 = *right;
+ }
+ fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
+ }
+}
+
diff --git a/xorg-server/fb/wfbrename.h b/xorg-server/fb/wfbrename.h index 0d59811e1..d9aba7fb6 100644 --- a/xorg-server/fb/wfbrename.h +++ b/xorg-server/fb/wfbrename.h @@ -39,20 +39,6 @@ #define fbClearVisualTypes wfbClearVisualTypes
#define fbCloseScreen wfbCloseScreen
#define fbComposite wfbComposite
-#define fbCompositeGeneral wfbCompositeGeneral
-#define fbCompositeSolidMask_nx1xn wfbCompositeSolidMask_nx1xn
-#define fbCompositeSolidMask_nx8888x0565C wfbCompositeSolidMask_nx8888x0565C
-#define fbCompositeSolidMask_nx8888x8888C wfbCompositeSolidMask_nx8888x8888C
-#define fbCompositeSolidMask_nx8x0565 wfbCompositeSolidMask_nx8x0565
-#define fbCompositeSolidMask_nx8x0888 wfbCompositeSolidMask_nx8x0888
-#define fbCompositeSolidMask_nx8x8888 wfbCompositeSolidMask_nx8x8888
-#define fbCompositeSrc_0565x0565 wfbCompositeSrc_0565x0565
-#define fbCompositeSrc_8888x0565 wfbCompositeSrc_8888x0565
-#define fbCompositeSrc_8888x0888 wfbCompositeSrc_8888x0888
-#define fbCompositeSrc_8888x8888 wfbCompositeSrc_8888x8888
-#define fbCompositeSrcAdd_1000x1000 wfbCompositeSrcAdd_1000x1000
-#define fbCompositeSrcAdd_8000x8000 wfbCompositeSrcAdd_8000x8000
-#define fbCompositeSrcAdd_8888x8888 wfbCompositeSrcAdd_8888x8888
#define fbCopy1toN wfbCopy1toN
#define fbCopyArea wfbCopyArea
#define fbCopyNto1 wfbCopyNto1
@@ -149,7 +135,6 @@ #define fbPutXYImage wfbPutXYImage
#define fbPutZImage wfbPutZImage
#define fbQueryBestSize wfbQueryBestSize
-#define fbRasterizeEdges wfbRasterizeEdges
#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
#define fbRealizeFont wfbRealizeFont
#define fbReduceRasterOp wfbReduceRasterOp
@@ -179,10 +164,8 @@ #define fbUnmapWindow wfbUnmapWindow
#define fbUnrealizeFont wfbUnrealizeFont
#define fbValidateGC wfbValidateGC
-#define fbWalkCompositeRegion wfbWalkCompositeRegion
#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
#define fbZeroLine wfbZeroLine
#define fbZeroSegment wfbZeroSegment
#define free_pixman_pict wfb_free_pixman_pict
#define image_from_pict wfb_image_from_pict
-#define composeFunctions wfbComposeFunctions
diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c index aef60a75a..e41b42401 100644 --- a/xorg-server/glx/glxdri.c +++ b/xorg-server/glx/glxdri.c @@ -834,9 +834,7 @@ static void __glXReportDamage(__DRIdrawable *driDraw, RegionInit(®ion, (BoxPtr) rects, num_rects);
RegionTranslate(®ion, pDraw->x, pDraw->y);
- DamageRegionAppend(pDraw, ®ion);
- /* This is wrong, this needs a seperate function. */
- DamageRegionProcessPending(pDraw);
+ DamageDamageRegion(pDraw, ®ion);
RegionUninit(®ion);
__glXleaveServer(GL_FALSE);
@@ -1160,9 +1158,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
- if (screen->base.GLXextensions != NULL) {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c index 45a1903e4..23a29cc55 100644 --- a/xorg-server/glx/glxdri2.c +++ b/xorg-server/glx/glxdri2.c @@ -792,9 +792,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
- if (screen->base.GLXextensions != NULL) {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,
diff --git a/xorg-server/glx/single2.c b/xorg-server/glx/single2.c index ee6e64f07..beaebcd29 100644 --- a/xorg-server/glx/single2.c +++ b/xorg-server/glx/single2.c @@ -346,9 +346,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
- if (buf1 != NULL) {
- free(buf1);
- }
+ free(buf1);
string = buf;
}
else if ( name == GL_VERSION ) {
@@ -377,8 +375,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
- if (buf != NULL)
- free(buf);
+ free(buf);
return Success;
}
diff --git a/xorg-server/hw/dmx/doc/dmx.xml b/xorg-server/hw/dmx/doc/dmx.xml index c7eaf1333..c998485bc 100644 --- a/xorg-server/hw/dmx/doc/dmx.xml +++ b/xorg-server/hw/dmx/doc/dmx.xml @@ -817,22 +817,10 @@ is called once for each input device. </para>
<para>Once input handles for core keyboard and core pointer devices have
-been obtained from AddInputDevice(), they are registered as core devices
-by calling RegisterPointerDevice() and RegisterKeyboardDevice(). Each
-of these should be called once. If both core devices are not
+been obtained from AddInputDevice(). If both core devices are not
registered, then the X server will exit with a fatal error when it
attempts to start the input devices in InitAndStartDevices(), which is
called directly after InitInput() (see below).
-
-<variablelist>
-<varlistentry>
-<term>Register{Pointer,Keyboard}Device()</term>
-<listitem><para>These DIX functions take a
-handle returned from AddInputDevice() and initialize the core input
-device fields in inputInfo, and initialize the input processing and grab
-functions for each core input device.
-</para></listitem></varlistentry>
-</variablelist>
</para>
<para>The core pointer device is then registered with the miPointer code
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c index f1893656f..26ffad825 100644 --- a/xorg-server/hw/dmx/glxProxy/glxcmds.c +++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c @@ -2565,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
- if (cl->GLClientextensions) free(cl->GLClientextensions);
+ free(cl->GLClientextensions);
buf = (const char *)(req+1);
cl->GLClientextensions = strdup(buf);
diff --git a/xorg-server/hw/dmx/glxProxy/glxext.c b/xorg-server/hw/dmx/glxProxy/glxext.c index 01cbd6e08..a90c14906 100644 --- a/xorg-server/hw/dmx/glxProxy/glxext.c +++ b/xorg-server/hw/dmx/glxProxy/glxext.c @@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex) Display **keep_be_displays;
int i;
- if (cl->returnBuf) free(cl->returnBuf);
- if (cl->currentContexts) free(cl->currentContexts);
- if (cl->currentDrawables) free(cl->currentDrawables);
- if (cl->largeCmdBuf) free(cl->largeCmdBuf);
+ free(cl->returnBuf);
+ free(cl->currentContexts);
+ free(cl->currentDrawables);
+ free(cl->largeCmdBuf);
for (i=0; i< screenInfo.numScreens; i++) {
if (cl->be_displays[i])
@@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex) */
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
- if (cl->GLClientextensions) free(cl->GLClientextensions);
+ free(cl->GLClientextensions);
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
}
@@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx) {
if (cx->idExists || cx->isCurrent) return GL_FALSE;
- if (cx->feedbackBuf) free(cx->feedbackBuf);
- if (cx->selectBuf) free(cx->selectBuf);
- if (cx->real_ids) free(cx->real_ids);
- if (cx->real_vids) free(cx->real_vids);
+ free(cx->feedbackBuf);
+ free(cx->selectBuf);
+ free(cx->real_ids);
+ free(cx->real_vids);
if (cx->pGlxPixmap) {
/*
diff --git a/xorg-server/hw/dmx/input/dmxevents.c b/xorg-server/hw/dmx/input/dmxevents.c index dfa6bdad5..efcd07da3 100644 --- a/xorg-server/hw/dmx/input/dmxevents.c +++ b/xorg-server/hw/dmx/input/dmxevents.c @@ -1,795 +1,800 @@ -/* - * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith <faith@redhat.com> - * - */ - -/** \file - * Provide support and helper functions for enqueing events received by - * the low-level input drivers. */ - -#ifdef HAVE_DMX_CONFIG_H -#include <dmx-config.h> -#endif - -#define DMX_EVENTS_DEBUG 0 - -#include "dmxinputinit.h" -#include "dmxevents.h" -#include "dmxcb.h" -#include "dmxcommon.h" -#include "dmxcursor.h" -#include "dmxmotion.h" -#include "dmxsigio.h" -#include "dmxmap.h" - -#include <X11/keysym.h> -#include "opaque.h" -#include "inputstr.h" -#include "mipointer.h" -#include "mi.h" -#include "exglobals.h" - -#include "xkbsrv.h" -#include "XIstubs.h" - -static int dmxGlobalX, dmxGlobalY; /* Global cursor position */ -static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion - * should move the mouse anyway. */ - -#if DMX_EVENTS_DEBUG -#define DMXDBG0(f) dmxLog(dmxDebug,f) -#define DMXDBG1(f,a) dmxLog(dmxDebug,f,a) -#define DMXDBG2(f,a,b) dmxLog(dmxDebug,f,a,b) -#define DMXDBG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c) -#define DMXDBG4(f,a,b,c,d) dmxLog(dmxDebug,f,a,b,c,d) -#define DMXDBG5(f,a,b,c,d,e) dmxLog(dmxDebug,f,a,b,c,d,e) -#define DMXDBG6(f,a,b,c,d,e,g) dmxLog(dmxDebug,f,a,b,c,d,e,g) -#define DMXDBG7(f,a,b,c,d,e,g,h) dmxLog(dmxDebug,f,a,b,c,d,e,g,h) -#else -#define DMXDBG0(f) -#define DMXDBG1(f,a) -#define DMXDBG2(f,a,b) -#define DMXDBG3(f,a,b,c) -#define DMXDBG4(f,a,b,c,d) -#define DMXDBG5(f,a,b,c,d,e) -#define DMXDBG6(f,a,b,c,d,e,g) -#define DMXDBG7(f,a,b,c,d,e,g,h) -#endif - -static int dmxApplyFunctions(DMXInputInfo *dmxInput, DMXFunctionType f) -{ - int i; - int rc = 0; - - for (i = 0; i < dmxInput->numDevs; i+= dmxInput->devs[i]->binding) - if (dmxInput->devs[i]->functions) - rc += dmxInput->devs[i]->functions(dmxInput->devs[i]->private, f); - return rc; -} - -static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal, - int type, - KeySym keySym) -{ - DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; - -#if 1 /* hack to detect ctrl-alt-q, etc */ - static int ctrl = 0, alt = 0; - /* keep track of ctrl/alt key status */ - if (type == KeyPress && keySym == 0xffe3) { - ctrl = 1; - } - else if (type == KeyRelease && keySym == 0xffe3) { - ctrl = 0; - } - else if (type == KeyPress && keySym == 0xffe9) { - alt = 1; - } - else if (type == KeyRelease && keySym == 0xffe9) { - alt = 0; - } - if (!ctrl || !alt) - return 0; -#else - unsigned short state = 0; - - if (dmxLocal->sendsCore) - state = dmxLocalCoreKeyboard->pDevice->key->state; - else if (dmxLocal->pDevice->key) - state = dmxLocal->pDevice->key->state; - - DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n", - keySym, type == KeyPress ? "press" : "release", state); - - if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) - return 0; -#endif - - switch (keySym) { - case XK_g: - if (type == KeyPress) - dmxApplyFunctions(dmxInput, DMX_FUNCTION_GRAB); - return 1; - case XK_f: - if (type == KeyPress) - dmxApplyFunctions(dmxInput, DMX_FUNCTION_FINE); - return 1; - case XK_q: - if (type == KeyPress && dmxLocal->sendsCore) - if (dmxApplyFunctions(dmxInput, DMX_FUNCTION_TERMINATE)) { - dmxLog(dmxInfo, "User request for termination\n"); - dispatchException |= DE_TERMINATE; - } - return 1; - } - - return 0; -} - - -DMXScreenInfo *dmxFindFirstScreen(int x, int y) -{ - int i; - - for (i = 0; i < dmxNumScreens; i++) { - DMXScreenInfo *dmxScreen = &dmxScreens[i]; - if (dmxOnScreen(x, y, dmxScreen)) - return dmxScreen; - } - return NULL; -} - - -/** - * Enqueue a motion event. - */ -static void enqueueMotion(DevicePtr pDev, int x, int y) -{ - GETDMXLOCALFROMPDEV; - DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; - int detail = 0; /* XXX should this be mask of pressed buttons? */ - valuators[0] = x; - valuators[1] = y; - - GetEventList(&events); - nevents = GetPointerEvents(events, p, MotionNotify, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; -} - - -void -dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block) -{ - DMXScreenInfo *dmxScreen; - DMXInputInfo *dmxInput; - ScreenPtr pScreen; - int localX; - int localY; - int i; - - if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) - return; - - DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n", - x, y, delta, dmxGlobalX, dmxGlobalY); - - dmxGlobalInvalid = 0; - dmxGlobalX = x; - dmxGlobalY = y; - - if (dmxGlobalX < 0) - dmxGlobalX = 0; - if (dmxGlobalY < 0) - dmxGlobalY = 0; - if (dmxGlobalX >= dmxGlobalWidth) - dmxGlobalX = dmxGlobalWidth + delta -1; - if (dmxGlobalY >= dmxGlobalHeight) - dmxGlobalY = dmxGlobalHeight + delta -1; - - if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) { - localX = dmxGlobalX - dmxScreen->rootXOrigin; - localY = dmxGlobalY - dmxScreen->rootYOrigin; - if ((pScreen = miPointerGetScreen(inputInfo.pointer)) - && pScreen->myNum == dmxScreen->index) { - /* Screen is old screen */ - if (block) - dmxSigioBlock(); - if (pDev) - enqueueMotion(pDev, localX, localY); - if (block) - dmxSigioUnblock(); - } else { - /* Screen is new */ - DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n", - pScreen->myNum, dmxScreen->index, localX, localY); - if (block) - dmxSigioBlock(); - mieqProcessInputEvents(); - miPointerSetScreen(inputInfo.pointer, dmxScreen->index, - localX, localY); - if (pDev) - enqueueMotion(pDev, localX, localY); - if (block) - dmxSigioUnblock(); - } -#if 00 - miPointerGetPosition(inputInfo.pointer, &localX, &localY); - - if ((pScreen = miPointerGetScreen(inputInfo.pointer))) { - dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin; - dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin; - ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY, - localX, localY); - DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d" - " on screen index=%d/%d localX=%d localY=%d\n", - dmxGlobalX, dmxGlobalY, - dmxScreen ? dmxScreen->index : -1, pScreen->myNum, - localX, localY); - } -#endif - } - /* Send updates down to all core input - * drivers */ - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) { - int j; - for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding) - if (!dmxInput->detached - && dmxInput->devs[j]->sendsCore - && dmxInput->devs[j]->update_position) - dmxInput->devs[j]->update_position(dmxInput->devs[j]->private, - dmxGlobalX, dmxGlobalY); - } - if (!dmxScreen) ProcessInputEvents(); -} - - - -#define DMX_MAX_AXES 32 /* Max axes reported by this routine */ -static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, - int *v, int firstAxis, int axesCount, - DMXMotionType type, DMXBlockType block) -{ - DeviceIntPtr pDevice = dmxLocal->pDevice; - xEvent xE[2 * DMX_MAX_AXES/6]; - deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *)xE; - deviceValuator *xv = (deviceValuator *)xev+1; - int thisX = 0; - int thisY = 0; - int i; - int count; - EventListPtr events; - int nevents; - - memset(xE, 0, sizeof(xE)); - - if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES; - - if (!pDevice->valuator->mode && axesCount == 2) { - /* The dmx console is a relative mode - * device that sometimes reports - * absolute motion. It only has two - * axes. */ - if (type == DMX_RELATIVE) { - thisX = -v[0]; - thisY = -v[1]; - dmxLocal->lastX += thisX; - dmxLocal->lastY += thisY; - if (dmxLocal->update_position) - dmxLocal->update_position(dmxLocal->private, - dmxLocal->lastX, dmxLocal->lastY); - } else { /* Convert to relative */ - if (dmxLocal->lastX || dmxLocal->lastY) { - thisX = v[0] - dmxLocal->lastX; - thisY = v[1] - dmxLocal->lastY; - } - dmxLocal->lastX = v[0]; - dmxLocal->lastY = v[1]; - } - v[0] = thisX; - v[1] = thisY; - } - - if (axesCount <= 6) { - /* Optimize for the common case when - * only 1 or 2 axes change. */ - xev->time = GetTimeInMillis(); - xev->type = DeviceMotionNotify; - xev->detail = 0; - xev->deviceid = pDevice->id | MORE_EVENTS; - - xv->type = DeviceValuator; - xv->deviceid = pDevice->id; - xv->num_valuators = axesCount; - xv->first_valuator = firstAxis; - switch (xv->num_valuators) { - case 6: xv->valuator5 = v[5]; - case 5: xv->valuator4 = v[4]; - case 4: xv->valuator3 = v[3]; - case 3: xv->valuator2 = v[2]; - case 2: xv->valuator1 = v[1]; - case 1: xv->valuator0 = v[0]; - } - count = 2; - } else { - for (i = 0, count = 0; i < axesCount; i += 6) { - xev->time = GetTimeInMillis(); - xev->type = DeviceMotionNotify; - xev->detail = 0; - xev->deviceid = pDevice->id | MORE_EVENTS; - xev += 2; - - xv->type = DeviceValuator; - xv->deviceid = pDevice->id; - xv->num_valuators = (i+6 >= axesCount ? axesCount - i : 6); - xv->first_valuator = firstAxis + i; - switch (xv->num_valuators) { - case 6: xv->valuator5 = v[i+5]; - case 5: xv->valuator4 = v[i+4]; - case 4: xv->valuator3 = v[i+3]; - case 3: xv->valuator2 = v[i+2]; - case 2: xv->valuator1 = v[i+1]; - case 1: xv->valuator0 = v[i+0]; - } - xv += 2; - count += 2; - } - } - - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, MotionNotify, 0, POINTER_ABSOLUTE, - firstAxis, axesCount, v); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); -} - -static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, - XEvent *e, DMXBlockType block) -{ - int type; - int event = -1; - XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e; - XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; - DeviceIntPtr pDevice = dmxLocal->pDevice; - int valuators[6]; - EventListPtr events; - int nevents, i; - - if (!e) - return -1; /* No extended event passed, cannot handle */ - - if ((XID)dmxLocal->deviceId != ke->deviceid) { - /* Search for the correct dmxLocal, - * since backend and console events are - * picked up for the first device on - * that X server. */ - int i; - DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; - for (i = 0; i < dmxInput->numDevs; i++) { - dmxLocal = dmxInput->devs[i]; - if ((XID)dmxLocal->deviceId == ke->deviceid) - break; - } - } - - if ((XID)dmxLocal->deviceId != ke->deviceid - || (type = dmxMapLookup(dmxLocal, e->type)) < 0) - return -1; /* No mapping, so this event is unhandled */ - - switch (type) { - case XI_DeviceValuator: event = DeviceValuator; break; - case XI_DeviceKeyPress: event = KeyPress; break; - case XI_DeviceKeyRelease: event = KeyRelease; break; - case XI_DeviceButtonPress: event = ButtonPress; break; - case XI_DeviceButtonRelease: event = ButtonRelease; break; - case XI_DeviceMotionNotify: event = MotionNotify; break; - case XI_DeviceFocusIn: event = DeviceFocusIn; break; - case XI_DeviceFocusOut: event = DeviceFocusOut; break; - case XI_ProximityIn: event = ProximityIn; break; - case XI_ProximityOut: event = ProximityOut; break; - case XI_DeviceStateNotify: event = DeviceStateNotify; break; - case XI_DeviceMappingNotify: event = DeviceMappingNotify; break; - case XI_ChangeDeviceNotify: event = ChangeDeviceNotify; break; - case XI_DeviceKeystateNotify: event = DeviceStateNotify; break; - case XI_DeviceButtonstateNotify: event = DeviceStateNotify; break; - } - -#define EXTRACT_VALUATORS(ke, valuators) \ - valuators[0] = ke->axis_data[0]; \ - valuators[1] = ke->axis_data[1]; \ - valuators[2] = ke->axis_data[2]; \ - valuators[3] = ke->axis_data[3]; \ - valuators[4] = ke->axis_data[4]; \ - valuators[5] = ke->axis_data[5]; \ - - switch (type) { - case XI_DeviceKeyPress: - case XI_DeviceKeyRelease: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetKeyboardValuatorEvents(events, pDevice, event, - ke->keycode, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - case XI_DeviceButtonPress: - case XI_DeviceButtonRelease: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, event, ke->keycode, - POINTER_ABSOLUTE, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - case XI_ProximityIn: - case XI_ProximityOut: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetProximityEvents(events, pDevice, event, - ke->first_axis, ke->axes_count, - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - - break; - - case XI_DeviceMotionNotify: - dmxExtMotion(dmxLocal, me->axis_data, me->first_axis, me->axes_count, - DMX_ABSOLUTE, block); - break; - case XI_DeviceFocusIn: - case XI_DeviceFocusOut: - case XI_DeviceStateNotify: - case XI_DeviceMappingNotify: - case XI_ChangeDeviceNotify: - case XI_DeviceKeystateNotify: - case XI_DeviceButtonstateNotify: - /* These are ignored, since DMX will - * generate its own events of these - * types, as necessary. - - * Perhaps ChangeDeviceNotify should - * generate an error, because it is - * unexpected? */ - break; - case XI_DeviceValuator: - default: - dmxLog(dmxWarning, - "XInput extension event (remote=%d -> zero-based=%d)" - " not supported yet\n", e->type, type); - return -1; - } - return 0; -} - -static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button) -{ - ButtonClassPtr b = dmxLocal->pDevice->button; - - if (button > b->numButtons) { /* This shouldn't happen. */ - dmxLog(dmxWarning, "Button %d pressed, but only %d buttons?!?\n", - button, b->numButtons); - return button; - } - return b->map[button]; -} - -/** Return DMX's notion of the pointer position in the global coordinate - * space. */ -void dmxGetGlobalPosition(int *x, int *y) -{ - *x = dmxGlobalX; - *y = dmxGlobalY; -} - -/** Invalidate the global position for #dmxCoreMotion. */ -void dmxInvalidateGlobalPosition(void) -{ - dmxGlobalInvalid = 1; -} - -/** Enqueue a motion event for \a pDev. The \a v vector has length \a - * axesCount, and contains values for each of the axes, starting at \a - * firstAxes. - * - * The \a type of the motion may be \a DMX_RELATIVE, \a DMX_ABSOLUTE, or - * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be - * allowed to move outside the global boundaires). - * - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be - * blocked around calls to \a enqueueMotion(). */ -void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount, - DMXMotionType type, DMXBlockType block) -{ - GETDMXLOCALFROMPDEV; - - if (!dmxLocal->sendsCore) { - dmxExtMotion(dmxLocal, v, firstAxes, axesCount, type, block); - return; - } - if (axesCount == 2) { - switch (type) { - case DMX_RELATIVE: - dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block); - break; - case DMX_ABSOLUTE: - dmxCoreMotion(pDev, v[0], v[1], 0, block); - break; - case DMX_ABSOLUTE_CONFINED: - dmxCoreMotion(pDev, v[0], v[1], -1, block); - break; - } - } -} - -static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal, - KeyCode keyCode) -{ - KeySym keysym = NoSymbol; - int effectiveGroup; - XkbSrvInfoPtr xkbi; - - if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key) - goto out; - - xkbi = dmxLocal->pDevice->key->xkbInfo; - effectiveGroup = XkbGetEffectiveGroup(xkbi, &xkbi->state, keyCode); - - if (effectiveGroup == -1) - goto out; - - keysym = XkbKeySym(xkbi->desc, keyCode, effectiveGroup); - DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n", - keyCode, keysym); - -out: - return keysym; -} - -static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym, - int tryFirst) -{ - /* FIXME: this is quite ineffective, converting to a core map first and - * then extracting the info from there. It'd be better to run the actual - * xkb map */ - XkbSrvInfoPtr xkbi = dmxLocal->pDevice->key->xkbInfo; - KeySymsPtr pKeySyms = XkbGetCoreMap(dmxLocal->pDevice); - int i; - - /* Optimize for similar maps */ - if (XkbKeycodeInRange(xkbi->desc, tryFirst) - && pKeySyms->map[(tryFirst - xkbi->desc->min_key_code) - * pKeySyms->mapWidth] == keySym) - return tryFirst; - - for (i = pKeySyms->minKeyCode; i <= pKeySyms->maxKeyCode; i++) { - if (pKeySyms->map[(i - pKeySyms->minKeyCode) - * pKeySyms->mapWidth] == keySym) { - DMXDBG3("dmxKeySymToKeyCode: Translated keySym=0x%04x to" - " keyCode=%d (reverses to core keySym=0x%04x)\n", - keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard,i)); - return i; - } - } - return 0; -} - -static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym) -{ - GETDMXLOCALFROMPDEV; - int keyCode; - - if (!dmxLocal->pDevice->key) { - dmxLog(dmxWarning, "dmxFixup: not a keyboard device (%s)\n", - dmxLocal->pDevice->name); - return NoSymbol; - } - if (!keySym) - keySym = dmxKeyCodeToKeySym(dmxLocal, detail); - if (keySym == NoSymbol) - return detail; - keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail); - - return keyCode ? keyCode : detail; -} - -/** Enqueue an event from the \a pDev device with the - * specified \a type and \a detail. If the event is a KeyPress or - * KeyRelease event, then the \a keySym is also specified. - * - * FIXME: make the code do what the comment says, or remove this comment. - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be - * blocked around calls to dmxeqEnqueue(). */ - -void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, - XEvent *e, DMXBlockType block) -{ - GETDMXINPUTFROMPDEV; - xEvent xE; - DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; - - DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); - - switch (type) { - case KeyPress: - case KeyRelease: - if (!keySym) - keySym = dmxKeyCodeToKeySym(dmxLocal, detail); - if (dmxCheckFunctionKeys(dmxLocal, type, keySym)) - return; - if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) - xE.u.u.detail = dmxFixup(pDev, detail, keySym); - - GetEventList(&events); - /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ - nevents = GetKeyboardEvents(events, p, type, detail); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case ButtonPress: - case ButtonRelease: - detail = dmxGetButtonMapping(dmxLocal, detail); - GetEventList(&events); - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, - 0, /* first_valuator = 0 */ - 0, /* num_valuators = 0 */ - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case MotionNotify: - GetEventList(&events); - valuators[0] = e->xmotion.x; - valuators[1] = e->xmotion.y; - valuators[2] = e->xmotion.state; /* FIXME: WTF?? */ - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 3, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case EnterNotify: - case LeaveNotify: - case KeymapNotify: - case MappingNotify: /* This is sent because we change the - * modifier map on the backend/console - * input device so that we have complete - * control of the input device LEDs. */ - return; - default: - if (type == ProximityIn || type == ProximityOut) { - if (dmxLocal->sendsCore) - return; /* Not a core event */ - break; - } - if (type >= LASTEvent) { - if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block)) - dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type); - } else { - dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n", - type, dmxEventName(type)); - } - return; - } - -} - -/** A pointer to this routine is passed to low-level input drivers so - * that all special keychecking is unified to this file. This function - * returns 0 if no special keys have been pressed. If the user has - * requested termination of the DMX server, -1 is returned. If the user - * has requested a switch to a VT, then the (1-based) number of that VT - * is returned. */ -int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym) -{ - GETDMXINPUTFROMPDEV; - int vt = 0; - unsigned short state = 0; - - if (dmxLocal->sendsCore) - state = XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->state); - else if (dmxLocal->pDevice->key) - state = XkbStateFieldFromRec(&dmxLocal->pDevice->key->xkbInfo->state); - - if (!dmxLocal->sendsCore) return 0; /* Only for core devices */ - - DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym,state); - - if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0; - - switch (keySym) { - case XK_F1: - case XK_F2: - case XK_F3: - case XK_F4: - case XK_F5: - case XK_F6: - case XK_F7: - case XK_F8: - case XK_F9: - case XK_F10: - vt = keySym - XK_F1 + 1; - break; - - case XK_F11: - case XK_F12: - vt = keySym - XK_F11 + 11; - break; - - case XK_q: /* To avoid confusion */ - case XK_BackSpace: - case XK_Delete: - case XK_KP_Delete: - dmxLog(dmxInfo, "User request for termination\n"); - dispatchException |= DE_TERMINATE; - return -1; /* Terminate */ - } - - if (vt) { - dmxLog(dmxInfo, "Request to switch to VT %d\n", vt); - dmxInput->vt_switch_pending = vt; - return vt; - } - - return 0; /* Do nothing */ -} +/*
+ * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * Provide support and helper functions for enqueing events received by
+ * the low-level input drivers. */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#define DMX_EVENTS_DEBUG 0
+
+#include "dmxinputinit.h"
+#include "dmxevents.h"
+#include "dmxcb.h"
+#include "dmxcommon.h"
+#include "dmxcursor.h"
+#include "dmxmotion.h"
+#include "dmxsigio.h"
+#include "dmxmap.h"
+
+#include <X11/keysym.h>
+#include "opaque.h"
+#include "inputstr.h"
+#include "inpututils.h"
+#include "mipointer.h"
+#include "mi.h"
+#include "exglobals.h"
+
+#include "xkbsrv.h"
+#include "XIstubs.h"
+
+static int dmxGlobalX, dmxGlobalY; /* Global cursor position */
+static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
+ * should move the mouse anyway. */
+
+#if DMX_EVENTS_DEBUG
+#define DMXDBG0(f) dmxLog(dmxDebug,f)
+#define DMXDBG1(f,a) dmxLog(dmxDebug,f,a)
+#define DMXDBG2(f,a,b) dmxLog(dmxDebug,f,a,b)
+#define DMXDBG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
+#define DMXDBG4(f,a,b,c,d) dmxLog(dmxDebug,f,a,b,c,d)
+#define DMXDBG5(f,a,b,c,d,e) dmxLog(dmxDebug,f,a,b,c,d,e)
+#define DMXDBG6(f,a,b,c,d,e,g) dmxLog(dmxDebug,f,a,b,c,d,e,g)
+#define DMXDBG7(f,a,b,c,d,e,g,h) dmxLog(dmxDebug,f,a,b,c,d,e,g,h)
+#else
+#define DMXDBG0(f)
+#define DMXDBG1(f,a)
+#define DMXDBG2(f,a,b)
+#define DMXDBG3(f,a,b,c)
+#define DMXDBG4(f,a,b,c,d)
+#define DMXDBG5(f,a,b,c,d,e)
+#define DMXDBG6(f,a,b,c,d,e,g)
+#define DMXDBG7(f,a,b,c,d,e,g,h)
+#endif
+
+static int dmxApplyFunctions(DMXInputInfo *dmxInput, DMXFunctionType f)
+{
+ int i;
+ int rc = 0;
+
+ for (i = 0; i < dmxInput->numDevs; i+= dmxInput->devs[i]->binding)
+ if (dmxInput->devs[i]->functions)
+ rc += dmxInput->devs[i]->functions(dmxInput->devs[i]->private, f);
+ return rc;
+}
+
+static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
+ int type,
+ KeySym keySym)
+{
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+
+#if 1 /* hack to detect ctrl-alt-q, etc */
+ static int ctrl = 0, alt = 0;
+ /* keep track of ctrl/alt key status */
+ if (type == KeyPress && keySym == 0xffe3) {
+ ctrl = 1;
+ }
+ else if (type == KeyRelease && keySym == 0xffe3) {
+ ctrl = 0;
+ }
+ else if (type == KeyPress && keySym == 0xffe9) {
+ alt = 1;
+ }
+ else if (type == KeyRelease && keySym == 0xffe9) {
+ alt = 0;
+ }
+ if (!ctrl || !alt)
+ return 0;
+#else
+ unsigned short state = 0;
+
+ if (dmxLocal->sendsCore)
+ state = dmxLocalCoreKeyboard->pDevice->key->state;
+ else if (dmxLocal->pDevice->key)
+ state = dmxLocal->pDevice->key->state;
+
+ DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
+ keySym, type == KeyPress ? "press" : "release", state);
+
+ if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask))
+ return 0;
+#endif
+
+ switch (keySym) {
+ case XK_g:
+ if (type == KeyPress)
+ dmxApplyFunctions(dmxInput, DMX_FUNCTION_GRAB);
+ return 1;
+ case XK_f:
+ if (type == KeyPress)
+ dmxApplyFunctions(dmxInput, DMX_FUNCTION_FINE);
+ return 1;
+ case XK_q:
+ if (type == KeyPress && dmxLocal->sendsCore)
+ if (dmxApplyFunctions(dmxInput, DMX_FUNCTION_TERMINATE)) {
+ dmxLog(dmxInfo, "User request for termination\n");
+ dispatchException |= DE_TERMINATE;
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+
+DMXScreenInfo *dmxFindFirstScreen(int x, int y)
+{
+ int i;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ if (dmxOnScreen(x, y, dmxScreen))
+ return dmxScreen;
+ }
+ return NULL;
+}
+
+
+/**
+ * Enqueue a motion event.
+ */
+static void enqueueMotion(DevicePtr pDev, int x, int y)
+{
+ GETDMXLOCALFROMPDEV;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ EventListPtr events;
+ int detail = 0; /* XXX should this be mask of pressed buttons? */
+ ValuatorMask mask;
+ valuators[0] = x;
+ valuators[1] = y;
+
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, p, MotionNotify, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+}
+
+
+void
+dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
+{
+ DMXScreenInfo *dmxScreen;
+ DMXInputInfo *dmxInput;
+ ScreenPtr pScreen;
+ int localX;
+ int localY;
+ int i;
+
+ if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y)
+ return;
+
+ DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
+ x, y, delta, dmxGlobalX, dmxGlobalY);
+
+ dmxGlobalInvalid = 0;
+ dmxGlobalX = x;
+ dmxGlobalY = y;
+
+ if (dmxGlobalX < 0)
+ dmxGlobalX = 0;
+ if (dmxGlobalY < 0)
+ dmxGlobalY = 0;
+ if (dmxGlobalX >= dmxGlobalWidth)
+ dmxGlobalX = dmxGlobalWidth + delta -1;
+ if (dmxGlobalY >= dmxGlobalHeight)
+ dmxGlobalY = dmxGlobalHeight + delta -1;
+
+ if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
+ localX = dmxGlobalX - dmxScreen->rootXOrigin;
+ localY = dmxGlobalY - dmxScreen->rootYOrigin;
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+ && pScreen->myNum == dmxScreen->index) {
+ /* Screen is old screen */
+ if (block)
+ dmxSigioBlock();
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+ if (block)
+ dmxSigioUnblock();
+ } else {
+ /* Screen is new */
+ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
+ pScreen->myNum, dmxScreen->index, localX, localY);
+ if (block)
+ dmxSigioBlock();
+ mieqProcessInputEvents();
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+ if (block)
+ dmxSigioUnblock();
+ }
+#if 00
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+ dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
+ dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY,
+ localX, localY);
+ DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
+ " on screen index=%d/%d localX=%d localY=%d\n",
+ dmxGlobalX, dmxGlobalY,
+ dmxScreen ? dmxScreen->index : -1, pScreen->myNum,
+ localX, localY);
+ }
+#endif
+ }
+ /* Send updates down to all core input
+ * drivers */
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
+ int j;
+ for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
+ if (!dmxInput->detached
+ && dmxInput->devs[j]->sendsCore
+ && dmxInput->devs[j]->update_position)
+ dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
+ dmxGlobalX, dmxGlobalY);
+ }
+ if (!dmxScreen) ProcessInputEvents();
+}
+
+
+
+#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
+static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
+ int *v, int firstAxis, int axesCount,
+ DMXMotionType type, DMXBlockType block)
+{
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ xEvent xE[2 * DMX_MAX_AXES/6];
+ deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *)xE;
+ deviceValuator *xv = (deviceValuator *)xev+1;
+ int thisX = 0;
+ int thisY = 0;
+ int i;
+ int count;
+ EventListPtr events;
+ int nevents;
+ ValuatorMask mask;
+
+ memset(xE, 0, sizeof(xE));
+
+ if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES;
+
+ if ((valuator_get_mode(pDevice,0) == Relative) && axesCount == 2) {
+ /* The dmx console is a relative mode
+ * device that sometimes reports
+ * absolute motion. It only has two
+ * axes. */
+ if (type == DMX_RELATIVE) {
+ thisX = -v[0];
+ thisY = -v[1];
+ dmxLocal->lastX += thisX;
+ dmxLocal->lastY += thisY;
+ if (dmxLocal->update_position)
+ dmxLocal->update_position(dmxLocal->private,
+ dmxLocal->lastX, dmxLocal->lastY);
+ } else { /* Convert to relative */
+ if (dmxLocal->lastX || dmxLocal->lastY) {
+ thisX = v[0] - dmxLocal->lastX;
+ thisY = v[1] - dmxLocal->lastY;
+ }
+ dmxLocal->lastX = v[0];
+ dmxLocal->lastY = v[1];
+ }
+ v[0] = thisX;
+ v[1] = thisY;
+ }
+
+ if (axesCount <= 6) {
+ /* Optimize for the common case when
+ * only 1 or 2 axes change. */
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = axesCount;
+ xv->first_valuator = firstAxis;
+ switch (xv->num_valuators) {
+ case 6: xv->valuator5 = v[5];
+ case 5: xv->valuator4 = v[4];
+ case 4: xv->valuator3 = v[3];
+ case 3: xv->valuator2 = v[2];
+ case 2: xv->valuator1 = v[1];
+ case 1: xv->valuator0 = v[0];
+ }
+ count = 2;
+ } else {
+ for (i = 0, count = 0; i < axesCount; i += 6) {
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+ xev += 2;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = (i+6 >= axesCount ? axesCount - i : 6);
+ xv->first_valuator = firstAxis + i;
+ switch (xv->num_valuators) {
+ case 6: xv->valuator5 = v[i+5];
+ case 5: xv->valuator4 = v[i+4];
+ case 4: xv->valuator3 = v[i+3];
+ case 3: xv->valuator2 = v[i+2];
+ case 2: xv->valuator1 = v[i+1];
+ case 1: xv->valuator0 = v[i+0];
+ }
+ xv += 2;
+ count += 2;
+ }
+ }
+
+ if (block)
+ dmxSigioBlock();
+ valuator_mask_set_range(&mask, firstAxis, axesCount, v);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, pDevice, MotionNotify, 0,
+ POINTER_ABSOLUTE, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+}
+
+static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
+ XEvent *e, DMXBlockType block)
+{
+ int type;
+ int event = -1;
+ XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
+ XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ int valuators[MAX_VALUATORS];
+ EventListPtr events;
+ int nevents, i;
+ ValuatorMask mask;
+
+ if (!e)
+ return -1; /* No extended event passed, cannot handle */
+
+ if ((XID)dmxLocal->deviceId != ke->deviceid) {
+ /* Search for the correct dmxLocal,
+ * since backend and console events are
+ * picked up for the first device on
+ * that X server. */
+ int i;
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+ for (i = 0; i < dmxInput->numDevs; i++) {
+ dmxLocal = dmxInput->devs[i];
+ if ((XID)dmxLocal->deviceId == ke->deviceid)
+ break;
+ }
+ }
+
+ if ((XID)dmxLocal->deviceId != ke->deviceid
+ || (type = dmxMapLookup(dmxLocal, e->type)) < 0)
+ return -1; /* No mapping, so this event is unhandled */
+
+ switch (type) {
+ case XI_DeviceValuator: event = DeviceValuator; break;
+ case XI_DeviceKeyPress: event = KeyPress; break;
+ case XI_DeviceKeyRelease: event = KeyRelease; break;
+ case XI_DeviceButtonPress: event = ButtonPress; break;
+ case XI_DeviceButtonRelease: event = ButtonRelease; break;
+ case XI_DeviceMotionNotify: event = MotionNotify; break;
+ case XI_DeviceFocusIn: event = DeviceFocusIn; break;
+ case XI_DeviceFocusOut: event = DeviceFocusOut; break;
+ case XI_ProximityIn: event = ProximityIn; break;
+ case XI_ProximityOut: event = ProximityOut; break;
+ case XI_DeviceStateNotify: event = DeviceStateNotify; break;
+ case XI_DeviceMappingNotify: event = DeviceMappingNotify; break;
+ case XI_ChangeDeviceNotify: event = ChangeDeviceNotify; break;
+ case XI_DeviceKeystateNotify: event = DeviceStateNotify; break;
+ case XI_DeviceButtonstateNotify: event = DeviceStateNotify; break;
+ }
+
+#define EXTRACT_VALUATORS(ke, valuators) \
+ valuators[0] = ke->axis_data[0]; \
+ valuators[1] = ke->axis_data[1]; \
+ valuators[2] = ke->axis_data[2]; \
+ valuators[3] = ke->axis_data[3]; \
+ valuators[4] = ke->axis_data[4]; \
+ valuators[5] = ke->axis_data[5]; \
+
+ switch (type) {
+ case XI_DeviceKeyPress:
+ case XI_DeviceKeyRelease:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetKeyboardValuatorEvents(events, pDevice, event,
+ ke->keycode, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+ case XI_DeviceButtonPress:
+ case XI_DeviceButtonRelease:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, pDevice, event, ke->keycode,
+ POINTER_ABSOLUTE, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+ case XI_ProximityIn:
+ case XI_ProximityOut:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetProximityEvents(events, pDevice, event, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+
+ break;
+
+ case XI_DeviceMotionNotify:
+ dmxExtMotion(dmxLocal, me->axis_data, me->first_axis, me->axes_count,
+ DMX_ABSOLUTE, block);
+ break;
+ case XI_DeviceFocusIn:
+ case XI_DeviceFocusOut:
+ case XI_DeviceStateNotify:
+ case XI_DeviceMappingNotify:
+ case XI_ChangeDeviceNotify:
+ case XI_DeviceKeystateNotify:
+ case XI_DeviceButtonstateNotify:
+ /* These are ignored, since DMX will
+ * generate its own events of these
+ * types, as necessary.
+
+ * Perhaps ChangeDeviceNotify should
+ * generate an error, because it is
+ * unexpected? */
+ break;
+ case XI_DeviceValuator:
+ default:
+ dmxLog(dmxWarning,
+ "XInput extension event (remote=%d -> zero-based=%d)"
+ " not supported yet\n", e->type, type);
+ return -1;
+ }
+ return 0;
+}
+
+static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
+{
+ ButtonClassPtr b = dmxLocal->pDevice->button;
+
+ if (button > b->numButtons) { /* This shouldn't happen. */
+ dmxLog(dmxWarning, "Button %d pressed, but only %d buttons?!?\n",
+ button, b->numButtons);
+ return button;
+ }
+ return b->map[button];
+}
+
+/** Return DMX's notion of the pointer position in the global coordinate
+ * space. */
+void dmxGetGlobalPosition(int *x, int *y)
+{
+ *x = dmxGlobalX;
+ *y = dmxGlobalY;
+}
+
+/** Invalidate the global position for #dmxCoreMotion. */
+void dmxInvalidateGlobalPosition(void)
+{
+ dmxGlobalInvalid = 1;
+}
+
+/** Enqueue a motion event for \a pDev. The \a v vector has length \a
+ * axesCount, and contains values for each of the axes, starting at \a
+ * firstAxes.
+ *
+ * The \a type of the motion may be \a DMX_RELATIVE, \a DMX_ABSOLUTE, or
+ * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be
+ * allowed to move outside the global boundaires).
+ *
+ * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
+ * blocked around calls to \a enqueueMotion(). */
+void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
+ DMXMotionType type, DMXBlockType block)
+{
+ GETDMXLOCALFROMPDEV;
+
+ if (!dmxLocal->sendsCore) {
+ dmxExtMotion(dmxLocal, v, firstAxes, axesCount, type, block);
+ return;
+ }
+ if (axesCount == 2) {
+ switch (type) {
+ case DMX_RELATIVE:
+ dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE:
+ dmxCoreMotion(pDev, v[0], v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE_CONFINED:
+ dmxCoreMotion(pDev, v[0], v[1], -1, block);
+ break;
+ }
+ }
+}
+
+static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
+ KeyCode keyCode)
+{
+ KeySym keysym = NoSymbol;
+ int effectiveGroup;
+ XkbSrvInfoPtr xkbi;
+
+ if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key)
+ goto out;
+
+ xkbi = dmxLocal->pDevice->key->xkbInfo;
+ effectiveGroup = XkbGetEffectiveGroup(xkbi, &xkbi->state, keyCode);
+
+ if (effectiveGroup == -1)
+ goto out;
+
+ keysym = XkbKeySym(xkbi->desc, keyCode, effectiveGroup);
+ DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
+ keyCode, keysym);
+
+out:
+ return keysym;
+}
+
+static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym,
+ int tryFirst)
+{
+ /* FIXME: this is quite ineffective, converting to a core map first and
+ * then extracting the info from there. It'd be better to run the actual
+ * xkb map */
+ XkbSrvInfoPtr xkbi = dmxLocal->pDevice->key->xkbInfo;
+ KeySymsPtr pKeySyms = XkbGetCoreMap(dmxLocal->pDevice);
+ int i;
+
+ /* Optimize for similar maps */
+ if (XkbKeycodeInRange(xkbi->desc, tryFirst)
+ && pKeySyms->map[(tryFirst - xkbi->desc->min_key_code)
+ * pKeySyms->mapWidth] == keySym)
+ return tryFirst;
+
+ for (i = pKeySyms->minKeyCode; i <= pKeySyms->maxKeyCode; i++) {
+ if (pKeySyms->map[(i - pKeySyms->minKeyCode)
+ * pKeySyms->mapWidth] == keySym) {
+ DMXDBG3("dmxKeySymToKeyCode: Translated keySym=0x%04x to"
+ " keyCode=%d (reverses to core keySym=0x%04x)\n",
+ keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard,i));
+ return i;
+ }
+ }
+ return 0;
+}
+
+static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
+{
+ GETDMXLOCALFROMPDEV;
+ int keyCode;
+
+ if (!dmxLocal->pDevice->key) {
+ dmxLog(dmxWarning, "dmxFixup: not a keyboard device (%s)\n",
+ dmxLocal->pDevice->name);
+ return NoSymbol;
+ }
+ if (!keySym)
+ keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
+ if (keySym == NoSymbol)
+ return detail;
+ keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail);
+
+ return keyCode ? keyCode : detail;
+}
+
+/** Enqueue an event from the \a pDev device with the
+ * specified \a type and \a detail. If the event is a KeyPress or
+ * KeyRelease event, then the \a keySym is also specified.
+ *
+ * FIXME: make the code do what the comment says, or remove this comment.
+ * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
+ * blocked around calls to dmxeqEnqueue(). */
+
+void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
+ XEvent *e, DMXBlockType block)
+{
+ GETDMXINPUTFROMPDEV;
+ xEvent xE;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ EventListPtr events;
+ ValuatorMask mask;
+
+ DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
+
+ switch (type) {
+ case KeyPress:
+ case KeyRelease:
+ if (!keySym)
+ keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
+ if (dmxCheckFunctionKeys(dmxLocal, type, keySym))
+ return;
+ if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
+ xE.u.u.detail = dmxFixup(pDev, detail, keySym);
+
+ GetEventList(&events);
+ /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
+ nevents = GetKeyboardEvents(events, p, type, detail);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case ButtonPress:
+ case ButtonRelease:
+ detail = dmxGetButtonMapping(dmxLocal, detail);
+ valuator_mask_zero(&mask);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, p, type, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case MotionNotify:
+ GetEventList(&events);
+ valuators[0] = e->xmotion.x;
+ valuators[1] = e->xmotion.y;
+ valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
+ valuator_mask_set_range(&mask, 0, 3, valuators);
+ nevents = GetPointerEvents(events, p, type, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case EnterNotify:
+ case LeaveNotify:
+ case KeymapNotify:
+ case MappingNotify: /* This is sent because we change the
+ * modifier map on the backend/console
+ * input device so that we have complete
+ * control of the input device LEDs. */
+ return;
+ default:
+ if (type == ProximityIn || type == ProximityOut) {
+ if (dmxLocal->sendsCore)
+ return; /* Not a core event */
+ break;
+ }
+ if (type >= LASTEvent) {
+ if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block))
+ dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type);
+ } else {
+ dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n",
+ type, dmxEventName(type));
+ }
+ return;
+ }
+
+}
+
+/** A pointer to this routine is passed to low-level input drivers so
+ * that all special keychecking is unified to this file. This function
+ * returns 0 if no special keys have been pressed. If the user has
+ * requested termination of the DMX server, -1 is returned. If the user
+ * has requested a switch to a VT, then the (1-based) number of that VT
+ * is returned. */
+int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym)
+{
+ GETDMXINPUTFROMPDEV;
+ int vt = 0;
+ unsigned short state = 0;
+
+ if (dmxLocal->sendsCore)
+ state = XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->state);
+ else if (dmxLocal->pDevice->key)
+ state = XkbStateFieldFromRec(&dmxLocal->pDevice->key->xkbInfo->state);
+
+ if (!dmxLocal->sendsCore) return 0; /* Only for core devices */
+
+ DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym,state);
+
+ if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0;
+
+ switch (keySym) {
+ case XK_F1:
+ case XK_F2:
+ case XK_F3:
+ case XK_F4:
+ case XK_F5:
+ case XK_F6:
+ case XK_F7:
+ case XK_F8:
+ case XK_F9:
+ case XK_F10:
+ vt = keySym - XK_F1 + 1;
+ break;
+
+ case XK_F11:
+ case XK_F12:
+ vt = keySym - XK_F11 + 11;
+ break;
+
+ case XK_q: /* To avoid confusion */
+ case XK_BackSpace:
+ case XK_Delete:
+ case XK_KP_Delete:
+ dmxLog(dmxInfo, "User request for termination\n");
+ dispatchException |= DE_TERMINATE;
+ return -1; /* Terminate */
+ }
+
+ if (vt) {
+ dmxLog(dmxInfo, "Request to switch to VT %d\n", vt);
+ dmxInput->vt_switch_pending = vt;
+ return vt;
+ }
+
+ return 0; /* Do nothing */
+}
diff --git a/xorg-server/hw/dmx/input/dmxinputinit.c b/xorg-server/hw/dmx/input/dmxinputinit.c index 0ea3e0953..4b10ecb17 100644 --- a/xorg-server/hw/dmx/input/dmxinputinit.c +++ b/xorg-server/hw/dmx/input/dmxinputinit.c @@ -476,7 +476,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i],
- info.minres[i], info.maxres[i]);
+ info.minres[i], info.maxres[i],
+ Relative);
} else if (info.numRelAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
axis_labels,
@@ -486,7 +487,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[i],
info.maxval[i], info.res[i],
- info.minres[i], info.maxres[i]);
+ info.minres[i], info.maxres[i],
+ Relative);
} else if (info.numAbsAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes,
axis_labels,
@@ -497,7 +499,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i], info.minres[i],
- info.maxres[i]);
+ info.maxres[i], Absolute);
}
}
if (info.focusClass) InitFocusClassDeviceStruct(pDevice);
@@ -693,7 +695,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) DeviceIntPtr pDevice;
Atom atom;
const char *name = NULL;
- void (*registerProcPtr)(DeviceIntPtr) = NULL;
char *devname;
DMXInputInfo *dmxInput;
@@ -706,22 +707,19 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) dmxLocal->isCore = 1;
dmxLocalCoreKeyboard = dmxLocal;
name = "keyboard";
- registerProcPtr = RegisterKeyboardDevice;
}
if (dmxLocal->type == DMX_LOCAL_MOUSE && !dmxLocalCorePointer) {
dmxLocal->isCore = 1;
dmxLocalCorePointer = dmxLocal;
name = "pointer";
- registerProcPtr = RegisterPointerDevice;
}
}
if (!name) {
name = "extension";
- registerProcPtr = RegisterOtherDevice;
}
- if (!name || !registerProcPtr)
+ if (!name)
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
@@ -738,8 +736,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) pDevice->type = atom;
pDevice->name = devname;
- registerProcPtr(pDevice);
-
if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
#if 00 /*BP*/
miRegisterPointerDevice(screenInfo.screens[0], pDevice);
diff --git a/xorg-server/hw/dmx/input/dmxmotion.c b/xorg-server/hw/dmx/input/dmxmotion.c index d1c79f126..7a4b8a0dc 100644 --- a/xorg-server/hw/dmx/input/dmxmotion.c +++ b/xorg-server/hw/dmx/input/dmxmotion.c @@ -125,12 +125,11 @@ void dmxPointerPutMotionEvent(DeviceIntPtr pDevice, /* Initialize the data from the known
* values (if Absolute) or to zero (if
* Relative) */
- if (pDevice->valuator->mode == Absolute) {
- for (i = 0; i < numAxes; i++)
+ for (i = 0; i < numAxes; i++) {
+ if (pDevice->valuator->axes[i].mode == Absolute)
dmxLocal->history[OFFSET(dmxLocal->tail,i+1)]
= dmxLocal->valuators[i];
- } else {
- for (i = 0; i < numAxes; i++)
+ else
dmxLocal->history[OFFSET(dmxLocal->tail,i+1)] = 0;
}
diff --git a/xorg-server/hw/dmx/input/dmxxinput.c b/xorg-server/hw/dmx/input/dmxxinput.c index 3d5f32775..b28a80d4d 100644 --- a/xorg-server/hw/dmx/input/dmxxinput.c +++ b/xorg-server/hw/dmx/input/dmxxinput.c @@ -51,23 +51,6 @@ #include "dmxinputinit.h"
#include "exevents.h"
-/** Close the input device. This is not required by the XINPUT model
- * that DMX uses. */
-void CloseInputDevice (DeviceIntPtr d, ClientPtr client)
-{
-}
-
-/** This is not required by the XINPUT model that DMX uses. */
-void AddOtherInputDevices(void)
-{
-}
-
-/** Open an input device. This is not required by the XINPUT model that
- * DMX uses. */
-void OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status)
-{
-}
-
/** Set device mode to \a mode. This is not implemented. */
int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
diff --git a/xorg-server/hw/kdrive/fake/fake.c b/xorg-server/hw/kdrive/fake/fake.c index 626b2d25a..21360b16d 100644 --- a/xorg-server/hw/kdrive/fake/fake.c +++ b/xorg-server/hw/kdrive/fake/fake.c @@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen) {
FakePriv *priv = screen->card->driver;
KdShadowFbFree (screen);
- if (priv->base)
- {
- free (priv->base);
- priv->base = 0;
- }
+ free(priv->base);
+ priv->base = NULL;
return TRUE;
}
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c index 0cadbd981..0485dc413 100644 --- a/xorg-server/hw/kdrive/src/kinput.c +++ b/xorg-server/hw/kdrive/src/kinput.c @@ -48,6 +48,7 @@ #include "exglobals.h"
#include "eventstr.h"
#include "xserver-properties.h"
+#include "inpututils.h"
#define AtomFromName(x) MakeAtom(x, strlen(x), 1)
@@ -943,10 +944,6 @@ KdAddKeyboard (KdKeyboardInfo *ki) return !Success;
}
- ki->dixdev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
- ki->dixdev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
- RegisterOtherDevice(ki->dixdev);
-
#ifdef DEBUG
ErrorF("added keyboard %s with dix id %d\n", ki->name, ki->dixdev->id);
#endif
@@ -1014,10 +1011,6 @@ KdAddPointer (KdPointerInfo *pi) return BadDevice;
}
- pi->dixdev->deviceGrab.ActivateGrab = ActivatePointerGrab;
- pi->dixdev->deviceGrab.DeactivateGrab = DeactivatePointerGrab;
- RegisterOtherDevice(pi->dixdev);
-
for (prev = &kdPointers; *prev; prev = &(*prev)->next);
*prev = pi;
@@ -1975,14 +1968,16 @@ _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, {
int nEvents = 0, i = 0;
int valuators[3] = { x, y, z };
+ ValuatorMask mask;
/* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */
if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel))
return;
+ valuator_mask_set_range(&mask, 0, 3, valuators);
+
GetEventList(&kdEvents);
- nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel,
- 0, 3, valuators);
+ nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask);
for (i = 0; i < nEvents; i++)
KdQueueEvent(pi->dixdev, (InternalEvent *)((kdEvents + i)->event));
}
@@ -2184,30 +2179,6 @@ ProcessInputEvents (void) KdCheckLock ();
}
-/* FIXME use XSECURITY to work out whether the client should be allowed to
- * open and close. */
-void
-OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status)
-{
- if (!pDev)
- *status = BadDevice;
- else
- *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr pDev, ClientPtr client)
-{
- return;
-}
-
-/* We initialise all input devices at startup. */
-void
-AddOtherInputDevices(void)
-{
- return;
-}
-
/* At the moment, absolute/relative is up to the client. */
int
SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode)
diff --git a/xorg-server/hw/vfb/InitInput.c b/xorg-server/hw/vfb/InitInput.c index 64040c865..aba1a95fb 100644 --- a/xorg-server/hw/vfb/InitInput.c +++ b/xorg-server/hw/vfb/InitInput.c @@ -138,10 +138,8 @@ InitInput(int argc, char *argv[]) Atom xiclass;
p = AddInputDevice(serverClient, vfbMouseProc, TRUE);
k = AddInputDevice(serverClient, vfbKeybdProc, TRUE);
- RegisterPointerDevice(p);
xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE);
AssignTypeAndName(p, xiclass, "Xvfb mouse");
- RegisterKeyboardDevice(k);
xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE);
AssignTypeAndName(k, xiclass, "Xvfb keyboard");
(void)mieqInit();
diff --git a/xorg-server/hw/xfree86/common/Makefile.am b/xorg-server/hw/xfree86/common/Makefile.am index 821a2b500..c4067aa62 100644 --- a/xorg-server/hw/xfree86/common/Makefile.am +++ b/xorg-server/hw/xfree86/common/Makefile.am @@ -1,95 +1,93 @@ -noinst_LTLIBRARIES = libcommon.la - -if XORG_BUS_SPARC -SBUS_SOURCES = xf86sbusBus.c -endif - -if XV -XVSOURCES = xf86xv.c xf86xvmc.c -XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h -endif - -if XF86VIDMODE -XF86VMODE_SDK = vidmodeproc.h -endif - -if DGA -DGASOURCES = xf86DGA.c -endif - -XISOURCES = xf86Xinput.c xisb.c -XISDKINCS = xf86Xinput.h xisb.h -RANDRSOURCES = xf86RandR.c - -BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) - -MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes - -xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) - cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ - echo >> $@ - -BUILT_SOURCES = xf86DefModeSet.c - -AM_LDFLAGS = -r -libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ - xf86Cursor.c $(DGASOURCES) xf86DPMS.c \ - xf86Events.c xf86Globals.c xf86AutoConfig.c \ - xf86Option.c xf86Init.c xf86VGAarbiter.c \ - xf86VidMode.c xf86fbman.c xf86cmap.c \ - xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ - xf86Mode.c xorgHelper.c \ - $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) -nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h -libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la - -INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ - -I$(srcdir)/../loader -I$(srcdir)/../parser \ - -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ - -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ - -I$(srcdir)/../modes -I$(srcdir)/../ramdac - -sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ - xf86PciInfo.h xf86Priv.h xf86Privstr.h \ - xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ - $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h - -DISTCLEANFILES = xf86Build.h -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = \ - compiler.h \ - fourcc.h \ - scoasm.h \ - vidmodeproc.h \ - xf86.h \ - xf86Bus.h \ - xf86Config.h \ - xf86InPriv.h \ - xf86Module.h \ - xf86Opt.h \ - xf86PciInfo.h \ - xf86Priv.h \ - xf86Privstr.h \ - xf86Xinput.h \ - xf86cmap.h \ - xf86fbman.h \ - xf86pciBus.h \ - xf86str.h \ - xf86xv.h \ - xf86xvmc.h \ - xf86xvpriv.h \ - xisb.h \ - xorgVersion.h \ - $(MODEDEFSOURCES) \ - modeline2c.awk \ - xf86VGAarbiter.h \ - xf86VGAarbiterPriv.h \ - $(DISTKBDSOURCES) - -if LNXACPI -XORG_CFLAGS += -DHAVE_ACPI -endif - -AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) +noinst_LTLIBRARIES = libcommon.la
+
+if XORG_BUS_SPARC
+SBUS_SOURCES = xf86sbusBus.c
+endif
+
+if XV
+XVSOURCES = xf86xv.c xf86xvmc.c
+XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h
+endif
+
+if XF86VIDMODE
+XF86VMODE_SDK = vidmodeproc.h
+endif
+
+if DGA
+DGASOURCES = xf86DGA.c
+endif
+
+RANDRSOURCES = xf86RandR.c
+
+BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
+
+MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
+
+xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
+ cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@
+ echo >> $@
+
+BUILT_SOURCES = xf86DefModeSet.c
+
+AM_LDFLAGS = -r
+libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
+ xf86Cursor.c $(DGASOURCES) xf86DPMS.c \
+ xf86Events.c xf86Globals.c xf86AutoConfig.c \
+ xf86Option.c xf86Init.c xf86VGAarbiter.c \
+ xf86VidMode.c xf86fbman.c xf86cmap.c \
+ xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
+ xf86Mode.c xorgHelper.c \
+ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
+nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
+libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la
+
+INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
+ -I$(srcdir)/../loader -I$(srcdir)/../parser \
+ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \
+ -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \
+ -I$(srcdir)/../modes -I$(srcdir)/../ramdac
+
+sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
+ xf86PciInfo.h xf86Priv.h xf86Privstr.h \
+ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \
+ $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \
+ xf86sbusBus.h xf86VGAarbiter.h
+
+DISTCLEANFILES = xf86Build.h
+CLEANFILES = $(BUILT_SOURCES)
+
+EXTRA_DIST = \
+ compiler.h \
+ fourcc.h \
+ scoasm.h \
+ vidmodeproc.h \
+ xf86.h \
+ xf86Bus.h \
+ xf86Config.h \
+ xf86InPriv.h \
+ xf86Module.h \
+ xf86Opt.h \
+ xf86PciInfo.h \
+ xf86Priv.h \
+ xf86Privstr.h \
+ xf86Xinput.h \
+ xf86cmap.h \
+ xf86fbman.h \
+ xf86pciBus.h \
+ xf86str.h \
+ xf86xv.h \
+ xf86xvmc.h \
+ xf86xvpriv.h \
+ xisb.h \
+ xorgVersion.h \
+ $(MODEDEFSOURCES) \
+ modeline2c.awk \
+ xf86VGAarbiter.h \
+ xf86VGAarbiterPriv.h \
+ $(DISTKBDSOURCES)
+
+if LNXACPI
+XORG_CFLAGS += -DHAVE_ACPI
+endif
+
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h index b21bcdf47..68653395b 100644 --- a/xorg-server/hw/xfree86/common/xf86.h +++ b/xorg-server/hw/xfree86/common/xf86.h @@ -203,6 +203,7 @@ extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, po extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler);
extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler);
extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler);
+extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, pointer data);
extern _X_EXPORT void xf86InterceptSignals(int *signo);
extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler)(void));
extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c index faeda92ee..7d930f0fe 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.c +++ b/xorg-server/hw/xfree86/common/xf86Config.c @@ -63,7 +63,6 @@ #include "xf86pciBus.h"
#include "xf86Xinput.h"
-extern DeviceAssocRec mouse_assoc;
#include "xkbsrv.h"
@@ -136,7 +135,7 @@ static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor);
static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device,
Bool active);
-static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
+static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input,
MessageType from);
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp);
@@ -445,8 +444,8 @@ xf86InputDriverlistFromConfig(void) {
int count = 0;
char **modulearray;
- IDevPtr* idp;
-
+ InputInfoPtr *idp;
+
/*
* make sure the config file has been parsed and that we have a
* ModulePath set; if no ModulePath was given, use the default
@@ -504,7 +503,6 @@ fixup_video_driver_list(char **drivers) static const char *fallback[4] = { "vesa", "fbdev", "wsfb", NULL };
char **end, **drv;
char *x;
- char **ati, **atimisc;
int i;
/* walk to the end of the list */
@@ -743,8 +741,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE },
{ FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN,
- {0}, FALSE },
{ FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
@@ -955,13 +951,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) }
#endif
- /* AllowEmptyInput is automatically true if we're hotplugging */
- xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
- xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
+ /* if we're not hotplugging, force some input devices to exist */
+ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
- /* AEI on? Then we're not using kbd, so use the evdev rules set. */
+ /* when forcing input devices, we use kbd. otherwise evdev, so use the
+ * evdev rules set. */
#if defined(linux)
- if (xf86Info.allowEmptyInput)
+ if (!xf86Info.forceInputDevices)
set.rules = "evdev";
#endif
XkbSetRulesDflts(&set);
@@ -1093,12 +1089,12 @@ Bool xf86DRI2Enabled(void) static Bool
checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
{
- IDevPtr corePointer = NULL, coreKeyboard = NULL;
+ InputInfoPtr corePointer = NULL, coreKeyboard = NULL;
Bool foundPointer = FALSE, foundKeyboard = FALSE;
const char *pointerMsg = NULL, *keyboardMsg = NULL;
- IDevPtr *devs, /* iterator */
+ InputInfoPtr *devs, /* iterator */
indp;
- IDevRec Pointer, Keyboard;
+ InputInfoRec Pointer, Keyboard;
XF86ConfInputPtr confInput;
XF86ConfInputRec defPtr, defKbd;
int count = 0;
@@ -1113,49 +1109,27 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * remove the core attribute from the later ones.
*/
for (devs = servlayoutp->inputs; devs && *devs; devs++) {
- pointer opt1 = NULL, opt2 = NULL;
indp = *devs;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
+ if (indp->options &&
+ xf86CheckBoolOption(indp->options, "CorePointer", FALSE)) {
if (!corePointer) {
corePointer = indp;
} else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CorePointer", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CorePointer", FALSE);
+ xf86ReplaceBoolOption(indp->options, "CorePointer", FALSE);
xf86Msg(X_WARNING, "Duplicate core pointer devices. "
"Removing core pointer attribute from \"%s\"\n",
- indp->identifier);
+ indp->name);
}
}
- opt1 = opt2 = NULL;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
+ if (indp->options &&
+ xf86CheckBoolOption(indp->options, "CoreKeyboard", FALSE)) {
if (!coreKeyboard) {
coreKeyboard = indp;
} else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE);
+ xf86ReplaceBoolOption(indp->options, "CoreKeyboard", FALSE);
xf86Msg(X_WARNING, "Duplicate core keyboard devices. "
"Removing core keyboard attribute from \"%s\"\n",
- indp->identifier);
+ indp->name);
}
}
count++;
@@ -1182,7 +1156,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == corePointer)
{
free(*devs);
- *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/
+ *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop*/
break;
}
for (; devs && *devs; devs++)
@@ -1200,7 +1174,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 3. First core pointer device. */
- if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ if (!foundPointer && (xf86Info.forceInputDevices || implicitLayout)) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1216,7 +1190,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 4. First pointer with an allowed mouse driver. */
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
const char **driver = mousedrivers;
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
@@ -1233,7 +1207,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 5. Built-in default. */
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
defPtr.inp_driver = strdup("mouse");
@@ -1249,17 +1223,17 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Pointer;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
}
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
return FALSE;
@@ -1283,7 +1257,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) driver++;
}
}
- if (!found && !xf86Info.allowEmptyInput) {
+ if (!found && xf86Info.forceInputDevices) {
xf86Msg(X_INFO, "No default mouse found, adding one\n");
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
@@ -1293,10 +1267,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Pointer;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
@@ -1324,7 +1298,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == coreKeyboard)
{
free(*devs);
- *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */
+ *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop */
break;
}
for (; devs && *devs; devs++)
@@ -1342,7 +1316,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 3. First core keyboard device. */
- if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ if (!foundKeyboard && (xf86Info.forceInputDevices || implicitLayout)) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1358,7 +1332,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput) {
@@ -1373,7 +1347,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 5. Built-in default. */
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
memset(&defKbd, 0, sizeof(defKbd));
defKbd.inp_identifier = strdup("<default keyboard>");
defKbd.inp_driver = strdup("kbd");
@@ -1389,17 +1363,17 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundKeyboard) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Keyboard;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
}
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
return FALSE;
@@ -1425,7 +1399,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "\tUsing the %s.\n", keyboardMsg);
}
- if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) {
+ if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
const char *config_backend;
#if defined(CONFIG_HAL)
@@ -1438,8 +1412,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "reconfigure %s or disable AutoAddDevices.\n",
config_backend, config_backend);
#else
- xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n"
- "\tTry disabling AllowEmptyInput.\n");
+ xf86Msg(X_WARNING, "Hotplugging requested but the server was "
+ "compiled without a config backend. "
+ "No input devices were configured, the server "
+ "will start without any input devices.\n");
#endif
}
@@ -1464,7 +1440,7 @@ static Bool configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
{
XF86ConfInputrefPtr irp;
- IDevPtr *indp;
+ InputInfoPtr *indp;
int count = 0;
/*
@@ -1477,19 +1453,19 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) }
DebugF("Found %d input devices in the layout section %s\n",
count, layout->lay_identifier);
- indp = xnfcalloc((count + 1), sizeof(IDevPtr));
+ indp = xnfcalloc((count + 1), sizeof(InputInfoPtr));
indp[count] = NULL;
irp = layout->lay_input_lst;
count = 0;
while (irp) {
- indp[count] = xnfalloc(sizeof(IDevRec));
+ indp[count] = xnfalloc(sizeof(InputInfoRec));
if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
while(count--)
free(indp[count]);
free(indp);
return FALSE;
}
- indp[count]->extraOptions = irp->iref_option_lst;
+ indp[count]->options = irp->iref_option_lst;
count++;
irp = (XF86ConfInputrefPtr)irp->list.next;
}
@@ -1712,7 +1688,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, MessageType from;
XF86ConfScreenPtr s;
screenLayoutPtr slp;
- IDevPtr *indp;
+ InputInfoPtr *indp;
XF86ConfLayoutRec layout;
if (!servlayoutp)
@@ -1758,7 +1734,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, from = X_DEFAULT;
} else {
/* Set up an empty input device list, then look for some core devices. */
- indp = xnfalloc(sizeof(IDevPtr));
+ indp = xnfalloc(sizeof(InputInfoPtr));
*indp = NULL;
servlayoutp->inputs = indp;
}
@@ -2211,7 +2187,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) static void
configDRI(XF86ConfDRIPtr drip)
{
- int i;
struct group *grp;
xf86ConfigDRI.group = -1;
@@ -2283,13 +2258,12 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) }
static Bool
-configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
+configInput(InputInfoPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
{
xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
- inputp->identifier = conf_input->inp_identifier;
+ inputp->name = conf_input->inp_identifier;
inputp->driver = conf_input->inp_driver;
- inputp->commonOptions = conf_input->inp_option_lst;
- inputp->extraOptions = NULL;
+ inputp->options = conf_input->inp_option_lst;
inputp->attrs = NULL;
return TRUE;
@@ -2338,12 +2312,13 @@ static void checkInput(serverLayoutPtr layout, Bool implicit_layout) {
checkCoreInputDevices(layout, implicit_layout);
- /* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually
- * exclusive. Trawl the list for mouse/kbd devices and disable them.
+ /* Unless we're forcing input devices, disable mouse/kbd devices in the
+ * config. Otherwise the same physical device is added multiple times,
+ * leading to duplicate events.
*/
- if (xf86Info.allowEmptyInput && layout->inputs)
+ if (!xf86Info.forceInputDevices && layout->inputs)
{
- IDevPtr *dev = layout->inputs;
+ InputInfoPtr *dev = layout->inputs;
BOOL warned = FALSE;
while(*dev)
@@ -2352,15 +2327,15 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { strcmp((*dev)->driver, "mouse") == 0 ||
strcmp((*dev)->driver, "vmmouse") == 0)
{
- IDevPtr *current;
+ InputInfoPtr *current;
if (!warned)
{
- xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
+ xf86Msg(X_WARNING, "Hotplugging is on, devices using "
"drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n");
warned = TRUE;
}
- xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier);
+ xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->name);
current = dev;
free(*dev);
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c index 87555f31f..004807483 100644 --- a/xorg-server/hw/xfree86/common/xf86Events.c +++ b/xorg-server/hw/xfree86/common/xf86Events.c @@ -600,6 +600,26 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) return ih;
}
+/**
+ * Set the handler for the console's fd. Replaces (and returns) the previous
+ * handler or NULL, whichever appropriate.
+ * proc may be NULL if the server should not handle events on the console.
+ */
+InputHandlerProc
+xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
+{
+ static InputHandlerProc handler = NULL;
+ InputHandlerProc old_handler = handler;
+
+ if (old_handler)
+ xf86RemoveGeneralHandler(old_handler);
+
+ xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
+ handler = proc;
+
+ return old_handler;
+}
+
static void
removeInputHandler(IHPtr ih)
{
diff --git a/xorg-server/hw/xfree86/common/xf86Globals.c b/xorg-server/hw/xfree86/common/xf86Globals.c index c8534132a..0b0931408 100644 --- a/xorg-server/hw/xfree86/common/xf86Globals.c +++ b/xorg-server/hw/xfree86/common/xf86Globals.c @@ -125,15 +125,14 @@ xf86InfoRec xf86Info = { #endif
.pmFlag = TRUE,
.log = LogNone,
- .kbdCustomKeycodes = FALSE,
.disableRandR = FALSE,
.randRFrom = X_DEFAULT,
#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
- .allowEmptyInput = TRUE,
+ .forceInputDevices = FALSE,
.autoAddDevices = TRUE,
.autoEnableDevices = TRUE
#else
- .allowEmptyInput = FALSE,
+ .forceInputDevices = TRUE,
.autoAddDevices = FALSE,
.autoEnableDevices = FALSE
#endif
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index e4d07ec12..abb198690 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -273,72 +273,6 @@ xf86AllocateScrnInfoPrivateIndex(void) return idx;
}
-/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
-InputInfoPtr
-xf86AllocateInput(InputDriverPtr drv, int flags)
-{
- InputInfoPtr new, *prev = NULL;
-
- if (!(new = calloc(sizeof(InputInfoRec), 1)))
- return NULL;
-
- new->drv = drv;
- new->module = DuplicateModule(drv->module, NULL);
-
- for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
- ;
-
- *prev = new;
- new->next = NULL;
-
- return new;
-}
-
-
-/*
- * Remove an entry from xf86InputDevs. Ideally it should free all allocated
- * data. To do this properly may require a driver hook.
- */
-
-void
-xf86DeleteInput(InputInfoPtr pInp, int flags)
-{
- InputInfoPtr p;
-
- /* First check if the inputdev is valid. */
- if (pInp == NULL)
- return;
-
-#if 0
- /* If a free function is defined, call it here. */
- if (pInp->free)
- pInp->free(pInp, 0);
-#endif
-
- if (pInp->module)
- UnloadModule(pInp->module);
-
- /* This should *really* be handled in drv->UnInit(dev) call instead, but
- * if the driver forgets about it make sure we free it or at least crash
- * with flying colors */
- free(pInp->private);
-
- FreeInputAttributes(pInp->attrs);
-
- /* Remove the entry from the list. */
- if (pInp == xf86InputDevs)
- xf86InputDevs = pInp->next;
- else {
- p = xf86InputDevs;
- while (p && p->next != pInp)
- p = p->next;
- if (p)
- p->next = pInp->next;
- /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
- }
- free(pInp);
-}
-
Bool
xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
{
@@ -1247,6 +1181,43 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) va_end(ap);
}
+/* Print input driver messages in the standard format of
+ <driver>: <device name>: <message> */
+void
+xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
+ va_list args)
+{
+ char *msg;
+
+ msg = Xprintf("%s: %s: %s", dev->drv->driverName, dev->name, format);
+ LogVMessageVerb(type, verb, "%s", msg);
+ free(msg);
+}
+
+/* Print input driver message, with verbose level specified directly */
+void
+xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
+ ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VIDrvMsgVerb(dev, type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Print input driver messages, with verbose level of 1 (default) */
+void
+xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VIDrvMsgVerb(dev, type, 1, format, ap);
+ va_end(ap);
+}
+
+
/* Print non-driver messages with verbose level specified directly */
void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
@@ -2070,7 +2041,7 @@ xf86IsUnblank(int mode) }
void
-xf86MotionHistoryAllocate(LocalDevicePtr local)
+xf86MotionHistoryAllocate(InputInfoPtr pInfo)
{
- AllocateMotionHistory(local->dev);
+ AllocateMotionHistory(pInfo->dev);
}
diff --git a/xorg-server/hw/xfree86/common/xf86InPriv.h b/xorg-server/hw/xfree86/common/xf86InPriv.h index 3838d6940..15fef4320 100644 --- a/xorg-server/hw/xfree86/common/xf86InPriv.h +++ b/xorg-server/hw/xfree86/common/xf86InPriv.h @@ -1,46 +1,43 @@ - -/* - * Copyright (c) 1999 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#ifndef _xf86InPriv_h -#define _xf86InPriv_h - -/* xf86Globals.c */ -extern InputDriverPtr *xf86InputDriverList; -extern int xf86NumInputDrivers; - -/* xf86Xinput.c */ -int xf86ActivateDevice(InputInfoPtr pInfo); - -/* xf86Helper.c */ -InputDriverPtr xf86LookupInputDriver(const char *name); - -#endif /* _xf86InPriv_h */ +
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef _xf86InPriv_h
+#define _xf86InPriv_h
+
+/* xf86Globals.c */
+extern InputDriverPtr *xf86InputDriverList;
+extern int xf86NumInputDrivers;
+
+/* xf86Helper.c */
+InputDriverPtr xf86LookupInputDriver(const char *name);
+
+#endif /* _xf86InPriv_h */
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index ab5b5a34d..aee1e8e33 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -814,7 +814,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void
InitInput(int argc, char **argv)
{
- IDevPtr* pDev;
+ InputInfoPtr* pDev;
DeviceIntPtr dev;
xf86Info.vtRequestsPending = FALSE;
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index 266a4dafe..9335e116f 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -83,7 +83,7 @@ typedef enum { */
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/xorg-server/hw/xfree86/common/xf86Opt.h b/xorg-server/hw/xfree86/common/xf86Opt.h index 3af4b4069..5ce320891 100644 --- a/xorg-server/hw/xfree86/common/xf86Opt.h +++ b/xorg-server/hw/xfree86/common/xf86Opt.h @@ -84,6 +84,7 @@ extern _X_EXPORT pointer xf86NewOption(char *name, char *value ); extern _X_EXPORT pointer xf86NextOption(pointer list );
extern _X_EXPORT pointer xf86OptionListCreate(const char **options, int count, int used);
extern _X_EXPORT pointer xf86OptionListMerge(pointer head, pointer tail);
+extern _X_EXPORT pointer xf86OptionListDuplicate(pointer list);
extern _X_EXPORT void xf86OptionListFree(pointer opt);
extern _X_EXPORT char *xf86OptionName(pointer opt);
extern _X_EXPORT char *xf86OptionValue(pointer opt);
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c index 8dce3ad0f..97deb1436 100644 --- a/xorg-server/hw/xfree86/common/xf86Option.c +++ b/xorg-server/hw/xfree86/common/xf86Option.c @@ -118,58 +118,43 @@ xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts) }
/*
- * xf86CollectInputOptions collects the options for an InputDevice.
- * This function requires that the following has been initialised:
- *
- * pInfo->conf_idev
- *
- * The extraOpts parameter may optionally contain a list of additional options
- * to include.
- *
- * The order of precedence for options is:
- *
- * extraOpts, pInfo->conf_idev->extraOptions,
- * pInfo->conf_idev->commonOptions, defaultOpts
+ * xf86CollectInputOptions collects extra options for an InputDevice (other
+ * than those added by the config backend).
+ * The options are merged into the existing ones and thus take precedence
+ * over the others.
*/
void
-xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts)
+xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts)
{
- XF86OptionPtr tmp;
- XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
-
- pInfo->options = NULL;
if (defaultOpts) {
- pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
- }
- if (pInfo->conf_idev && pInfo->conf_idev->commonOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (pInfo->conf_idev && pInfo->conf_idev->extraOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (extras) {
- tmp = xf86optionListDup(extras);
+ XF86OptionPtr tmp =xf86optionListCreate(defaultOpts, -1, 0);
if (pInfo->options)
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
else
pInfo->options = tmp;
}
+}
- if (pInfo->conf_idev && pInfo->conf_idev->attrs) {
- pInfo->attrs = pInfo->conf_idev->attrs;
+/**
+ * Duplicate the option list passed in. The returned pointer will be a newly
+ * allocated option list and must be freed by the caller.
+ */
+pointer
+xf86OptionListDuplicate(pointer options)
+{
+ pointer o = NULL;
+
+ while (options)
+ {
+ o = xf86AddNewOption(o, xf86OptionName(options), xf86OptionValue(options));
+ options = xf86nextOption(options);
}
+
+ return o;
}
+
/* Created for new XInput stuff -- essentially extensions to the parser */
static int
diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h index 6138b6bec..66a73d32b 100644 --- a/xorg-server/hw/xfree86/common/xf86Privstr.h +++ b/xorg-server/hw/xfree86/common/xf86Privstr.h @@ -96,7 +96,6 @@ typedef struct { #endif
Bool pmFlag;
Log log;
- Bool kbdCustomKeycodes;
Bool disableRandR;
MessageType randRFrom;
Bool aiglx;
@@ -108,8 +107,7 @@ typedef struct { MessageType useDefaultFontPathFrom;
Bool ignoreABI;
- Bool allowEmptyInput; /* Allow the server to start with no input
- * devices. */
+ Bool forceInputDevices; /* force xorg.conf or built-in input devices */
Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
Bool autoEnableDevices; /* Whether to enable, or let the client
* control. */
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c index 3542abd4a..e90268a06 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.c +++ b/xorg-server/hw/xfree86/common/xf86Xinput.c @@ -59,23 +59,15 @@ #include "xf86Priv.h"
#include "xf86Config.h"
#include "xf86Xinput.h"
-#include "XIstubs.h"
#include "xf86Optrec.h"
-#include "xf86Parser.h"
#include "mipointer.h"
-#include "xf86InPriv.h"
-#include "compiler.h"
#include "extinit.h"
#include "loaderProcs.h"
-#ifdef DPMSExtension
-#include <X11/extensions/dpmsconst.h>
-#include "dpmsproc.h"
-#endif
-
#include "exevents.h" /* AddInputDevice */
#include "exglobals.h"
#include "eventstr.h"
+#include "inpututils.h"
#include <string.h> /* InputClassMatches */
#ifdef HAVE_FNMATCH_H
@@ -85,15 +77,9 @@ #include <sys/utsname.h>
#endif
-#include "extnsionst.h"
-
-#include "windowstr.h" /* screenIsSaved */
-
#include <stdarg.h>
#include <stdint.h> /* for int64_t */
-#include <X11/Xpoll.h>
-
#include "mi.h"
#include <ptrveloc.h> /* dix pointer acceleration */
@@ -105,10 +91,19 @@ #include "xkbsrv.h"
-#include "os.h"
+/* Valuator verification macro */
+#define XI_VERIFY_VALUATORS(num_valuators) \
+ if (num_valuators > MAX_VALUATORS) { \
+ xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
+ " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
+ return; \
+ }
EventListPtr xf86Events = NULL;
+static int
+xf86InputDevicePostInit(DeviceIntPtr dev);
+
/**
* Eval config and modify DeviceVelocityRec accordingly
*/
@@ -203,11 +198,11 @@ static void ApplyAccelerationSettings(DeviceIntPtr dev){
int scheme, i;
DeviceVelocityPtr pVel;
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
char* schemeStr;
if (dev->valuator && dev->ptrfeed) {
- schemeStr = xf86SetStrOption(local->options, "AccelerationScheme", "");
+ schemeStr = xf86SetStrOption(pInfo->options, "AccelerationScheme", "");
scheme = dev->valuator->accelScheme.number;
@@ -228,15 +223,15 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ if (InitPointerAccelerationScheme(dev, scheme)) {
xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n",
- local->name, schemeStr, scheme);
+ pInfo->name, schemeStr, scheme);
} else {
xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n",
- local->name, schemeStr);
+ pInfo->name, schemeStr);
scheme = dev->valuator->accelScheme.number;
}
} else {
xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n",
- local->name, scheme);
+ pInfo->name, scheme);
}
free(schemeStr);
@@ -245,45 +240,34 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ switch (scheme) {
case PtrAccelPredictable:
pVel = GetDevicePredictableAccelData(dev);
- ProcessVelocityConfiguration (dev, local->name, local->options,
+ ProcessVelocityConfiguration (dev, pInfo->name, pInfo->options,
pVel);
break;
}
- i = xf86SetIntOption(local->options, "AccelerationNumerator",
+ i = xf86SetIntOption(pInfo->options, "AccelerationNumerator",
dev->ptrfeed->ctrl.num);
if (i >= 0)
dev->ptrfeed->ctrl.num = i;
- i = xf86SetIntOption(local->options, "AccelerationDenominator",
+ i = xf86SetIntOption(pInfo->options, "AccelerationDenominator",
dev->ptrfeed->ctrl.den);
if (i > 0)
dev->ptrfeed->ctrl.den = i;
- i = xf86SetIntOption(local->options, "AccelerationThreshold",
+ i = xf86SetIntOption(pInfo->options, "AccelerationThreshold",
dev->ptrfeed->ctrl.threshold);
if (i >= 0)
dev->ptrfeed->ctrl.threshold = i;
xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n",
- local->name, ((float)dev->ptrfeed->ctrl.num)/
+ pInfo->name, ((float)dev->ptrfeed->ctrl.num)/
((float)dev->ptrfeed->ctrl.den));
xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n",
- local->name, dev->ptrfeed->ctrl.threshold);
+ pInfo->name, dev->ptrfeed->ctrl.threshold);
}
}
-static Bool
-xf86SendDragEvents(DeviceIntPtr device)
-{
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
-
- if (device->button && device->button->buttonsDown > 0)
- return local->flags & XI86_SEND_DRAG_EVENTS;
- else
- return TRUE;
-}
-
/***********************************************************************
*
* xf86ProcessCommonOptions --
@@ -293,27 +277,18 @@ xf86SendDragEvents(DeviceIntPtr device) ***********************************************************************
*/
void
-xf86ProcessCommonOptions(LocalDevicePtr local,
+xf86ProcessCommonOptions(InputInfoPtr pInfo,
pointer list)
{
if (!xf86SetBoolOption(list, "AlwaysCore", 1) ||
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
!xf86SetBoolOption(list, "CorePointer", 1) ||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
- xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
- } else {
- local->flags |= XI86_ALWAYS_CORE;
- xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
- }
-
- if (xf86SetBoolOption(list, "SendDragEvents", 1)) {
- local->flags |= XI86_SEND_DRAG_EVENTS;
+ xf86Msg(X_CONFIG, "%s: doesn't report core events\n", pInfo->name);
} else {
- xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
+ pInfo->flags |= XI86_ALWAYS_CORE;
+ xf86Msg(X_CONFIG, "%s: always reports core events\n", pInfo->name);
}
-
- /* Backwards compatibility. */
- local->history_size = GetMotionHistorySize();
}
/***********************************************************************
@@ -325,86 +300,38 @@ xf86ProcessCommonOptions(LocalDevicePtr local, * Returns TRUE on success, or FALSE otherwise.
***********************************************************************
*/
-int
-xf86ActivateDevice(LocalDevicePtr local)
+static DeviceIntPtr
+xf86ActivateDevice(InputInfoPtr pInfo)
{
DeviceIntPtr dev;
+ Atom atom;
- if (local->flags & XI86_CONFIGURED) {
- dev = AddInputDevice(serverClient, local->device_control, TRUE);
+ dev = AddInputDevice(serverClient, pInfo->device_control, TRUE);
- if (dev == NULL)
- {
- xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
- local->name);
- local->dev = NULL;
- return FALSE;
- }
-
- local->atom = MakeAtom(local->type_name,
- strlen(local->type_name),
- TRUE);
- AssignTypeAndName(dev, local->atom, local->name);
- dev->public.devicePrivate = (pointer) local;
- local->dev = dev;
-
- dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
- dev->type = SLAVE;
- dev->spriteInfo->spriteOwner = FALSE;
-
- dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
- dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
-
- RegisterOtherDevice(dev);
- XkbSetExtension(dev, ProcessKeyboardEvent);
-
- if (serverGeneration == 1)
- xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
- local->name, local->type_name);
+ if (dev == NULL)
+ {
+ xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
+ pInfo->name);
+ pInfo->dev = NULL;
+ return NULL;
}
- return TRUE;
-}
+ atom = MakeAtom(pInfo->type_name, strlen(pInfo->type_name), TRUE);
+ AssignTypeAndName(dev, atom, pInfo->name);
+ dev->public.devicePrivate = pInfo;
+ pInfo->dev = dev;
+ dev->coreEvents = pInfo->flags & XI86_ALWAYS_CORE;
+ dev->type = SLAVE;
+ dev->spriteInfo->spriteOwner = FALSE;
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- ***********************************************************************
- */
+ dev->config_info = xf86SetStrOption(pInfo->options, "config_info", NULL);
-void
-OpenInputDevice(DeviceIntPtr dev,
- ClientPtr client,
- int *status)
-{
- if (!dev->inited)
- ActivateDevice(dev, TRUE);
+ if (serverGeneration == 1)
+ xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
+ pInfo->name, pInfo->type_name);
- *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr dev,
- ClientPtr client)
-{
+ return dev;
}
/****************************************************************************
@@ -423,10 +350,10 @@ CloseInputDevice(DeviceIntPtr dev, int
SetDeviceMode (ClientPtr client, DeviceIntPtr dev, int mode)
{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
- if (local->switch_mode) {
- return (*local->switch_mode)(client, dev, mode);
+ if (pInfo->switch_mode) {
+ return (*pInfo->switch_mode)(client, dev, mode);
}
else
return BadMatch;
@@ -450,10 +377,10 @@ int SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators,
int first_valuator, int num_valuators)
{
- LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate;
- if (local->set_device_valuators)
- return (*local->set_device_valuators)(local, valuators, first_valuator,
+ if (pInfo->set_device_valuators)
+ return (*pInfo->set_device_valuators)(pInfo, valuators, first_valuator,
num_valuators);
return BadMatch;
@@ -472,9 +399,9 @@ SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators, int
ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control)
{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
- if (!local->control_proc) {
+ if (!pInfo->control_proc) {
switch (control->control) {
case DEVICE_CORE:
return BadMatch;
@@ -488,15 +415,10 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) }
}
else {
- return (*local->control_proc)(local, control);
+ return (*pInfo->control_proc)(pInfo, control);
}
}
-void
-AddOtherInputDevices(void)
-{
-}
-
/*
* Get the operating system name from uname and store it statically to avoid
* repeating the system call each time MatchOS is checked.
@@ -592,7 +514,7 @@ MatchAttrToken(const char *attr, struct list *patterns, * statements must match.
*/
static Bool
-InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev,
+InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
const InputAttributes *attrs)
{
/* MatchProduct substring */
@@ -672,7 +594,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev, * well as any previous InputClass sections.
*/
static int
-MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs)
+MergeInputClasses(const InputInfoPtr idev, const InputAttributes *attrs)
{
XF86ConfInputClassPtr cl;
XF86OptionPtr classopts;
@@ -697,9 +619,8 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) /* Apply options to device with InputClass settings preferred. */
xf86Msg(X_CONFIG, "%s: Applying InputClass \"%s\"\n",
- idev->identifier, cl->identifier);
- idev->commonOptions = xf86optionListMerge(idev->commonOptions,
- classopts);
+ idev->name, cl->identifier);
+ idev->options = xf86optionListMerge(idev->options, classopts);
}
return Success;
@@ -710,7 +631,7 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) * value of the last matching class and holler when returning TRUE.
*/
static Bool
-IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs)
+IgnoreInputClass(const InputInfoPtr idev, const InputAttributes *attrs)
{
XF86ConfInputClassPtr cl;
Bool ignore = FALSE;
@@ -727,10 +648,95 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) if (ignore)
xf86Msg(X_CONFIG, "%s: Ignoring device from InputClass \"%s\"\n",
- idev->identifier, ignore_class);
+ idev->name, ignore_class);
return ignore;
}
+static InputInfoPtr
+xf86AllocateInput(void)
+{
+ InputInfoPtr pInfo;
+
+ pInfo = calloc(sizeof(*pInfo), 1);
+ if (!pInfo)
+ return NULL;
+
+ pInfo->fd = -1;
+ pInfo->type_name = "UNKNOWN";
+
+ return pInfo;
+}
+
+/* Append InputInfoRec to the tail of xf86InputDevs. */
+static void
+xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo)
+{
+ InputInfoPtr *prev = NULL;
+
+ pInfo->drv = drv;
+ pInfo->module = DuplicateModule(drv->module, NULL);
+
+ for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
+ ;
+
+ *prev = pInfo;
+ pInfo->next = NULL;
+
+ xf86CollectInputOptions(pInfo, (const char**)drv->default_options);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+}
+
+/*
+ * Remove an entry from xf86InputDevs and free all the device's information.
+ */
+void
+xf86DeleteInput(InputInfoPtr pInp, int flags)
+{
+ /* First check if the inputdev is valid. */
+ if (pInp == NULL)
+ return;
+
+ if (pInp->module)
+ UnloadModule(pInp->module);
+
+ /* This should *really* be handled in drv->UnInit(dev) call instead, but
+ * if the driver forgets about it make sure we free it or at least crash
+ * with flying colors */
+ free(pInp->private);
+
+ FreeInputAttributes(pInp->attrs);
+
+ /* Remove the entry from the list. */
+ if (pInp == xf86InputDevs)
+ xf86InputDevs = pInp->next;
+ else {
+ InputInfoPtr p = xf86InputDevs;
+ while (p && p->next != pInp)
+ p = p->next;
+ if (p)
+ p->next = pInp->next;
+ /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
+ }
+
+ free(pInp->driver);
+ free(pInp->name);
+ xf86optionListFree(pInp->options);
+ free(pInp);
+}
+
+/*
+ * Apply backend-specific initialization. Invoked after ActiveteDevice(),
+ * i.e. after the driver successfully completed DEVICE_INIT and the device
+ * is advertised.
+ * @param dev the device
+ * @return Success or an error code
+ */
+static int
+xf86InputDevicePostInit(DeviceIntPtr dev) {
+ ApplyAccelerationSettings(dev);
+ return Success;
+}
+
/**
* Create a new input device, activate and enable it.
*
@@ -749,21 +755,20 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) * @return Success or an error code
*/
_X_INTERNAL int
-xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
+xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
{
InputDriverPtr drv = NULL;
- InputInfoPtr pInfo = NULL;
DeviceIntPtr dev = NULL;
int rval;
/* Memory leak for every attached device if we don't
* test if the module is already loaded first */
- drv = xf86LookupInputDriver(idev->driver);
+ drv = xf86LookupInputDriver(pInfo->driver);
if (!drv)
- if (xf86LoadOneModule(idev->driver, NULL))
- drv = xf86LookupInputDriver(idev->driver);
+ if (xf86LoadOneModule(pInfo->driver, NULL))
+ drv = xf86LookupInputDriver(pInfo->driver);
if (!drv) {
- xf86Msg(X_ERROR, "No input driver matching `%s'\n", idev->driver);
+ xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver);
rval = BadName;
goto unwind;
}
@@ -776,42 +781,44 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind;
}
- pInfo = drv->PreInit(drv, idev, 0);
+ xf86AddInput(drv, pInfo);
- if (!pInfo) {
- xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
- rval = BadMatch;
- goto unwind;
- }
- else if (!(pInfo->flags & XI86_CONFIGURED)) {
- xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
- idev->identifier);
- rval = BadMatch;
+ rval = drv->PreInit(drv, pInfo, 0);
+
+ if (rval != Success) {
+ xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name);
goto unwind;
}
- if (!xf86ActivateDevice(pInfo))
+ if (!(dev = xf86ActivateDevice(pInfo)))
{
rval = BadAlloc;
goto unwind;
}
- dev = pInfo->dev;
rval = ActivateDevice(dev, TRUE);
if (rval != Success)
{
- xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier);
+ xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
goto unwind;
}
+ rval = xf86InputDevicePostInit(dev);
+ if (rval != Success)
+ {
+ xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", pInfo->name);
+ RemoveDevice(dev, TRUE);
+ goto unwind;
+ }
+
/* Enable it if it's properly initialised and we're currently in the VT */
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
{
EnableDevice(dev, TRUE);
if (!dev->enabled)
{
- xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier);
+ xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
rval = BadMatch;
goto unwind;
}
@@ -824,7 +831,7 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) unwind:
if(pInfo) {
- if(drv->UnInit)
+ if(drv && drv->UnInit)
drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
@@ -836,23 +843,23 @@ int NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
DeviceIntPtr *pdev)
{
- IDevRec *idev = NULL;
+ InputInfoPtr pInfo = NULL;
InputOption *option = NULL;
int rval = Success;
int is_auto = 0;
- idev = calloc(sizeof(*idev), 1);
- if (!idev)
+ pInfo = xf86AllocateInput();
+ if (!pInfo)
return BadAlloc;
for (option = options; option; option = option->next) {
if (strcasecmp(option->key, "driver") == 0) {
- if (idev->driver) {
+ if (pInfo->driver) {
rval = BadRequest;
goto unwind;
}
- idev->driver = xstrdup(option->value);
- if (!idev->driver) {
+ pInfo->driver = xstrdup(option->value);
+ if (!pInfo->driver) {
rval = BadAlloc;
goto unwind;
}
@@ -860,12 +867,12 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, if (strcasecmp(option->key, "name") == 0 ||
strcasecmp(option->key, "identifier") == 0) {
- if (idev->identifier) {
+ if (pInfo->name) {
rval = BadRequest;
goto unwind;
}
- idev->identifier = xstrdup(option->value);
- if (!idev->identifier) {
+ pInfo->name = xstrdup(option->value);
+ if (!pInfo->name) {
rval = BadAlloc;
goto unwind;
}
@@ -885,7 +892,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, for (option = options; option; option = option->next) {
/* Steal option key/value strings from the provided list.
* We need those strings, the InputOption list doesn't. */
- idev->commonOptions = xf86addNewOption(idev->commonOptions,
+ pInfo->options = xf86addNewOption(pInfo->options,
option->key, option->value);
option->key = NULL;
option->value = NULL;
@@ -893,58 +900,51 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, /* Apply InputClass settings */
if (attrs) {
- if (IgnoreInputClass(idev, attrs)) {
+ if (IgnoreInputClass(pInfo, attrs)) {
rval = BadIDChoice;
goto unwind;
}
- rval = MergeInputClasses(idev, attrs);
+ rval = MergeInputClasses(pInfo, attrs);
if (rval != Success)
goto unwind;
- idev->attrs = DuplicateInputAttributes(attrs);
+ pInfo->attrs = DuplicateInputAttributes(attrs);
}
- if (!idev->driver || !idev->identifier) {
+ if (!pInfo->driver || !pInfo->name) {
xf86Msg(X_INFO, "No input driver/identifier specified (ignoring)\n");
rval = BadRequest;
goto unwind;
}
- if (!idev->identifier) {
+ if (!pInfo->name) {
xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n");
- return BadMatch;
+ rval = BadMatch;
+ goto unwind;
}
- rval = xf86NewInputDevice(idev, pdev,
+ rval = xf86NewInputDevice(pInfo, pdev,
(!is_auto || (is_auto && xf86Info.autoEnableDevices)));
- if (rval == Success)
- return Success;
+
+ return rval;
unwind:
if (is_auto && !xf86Info.autoAddDevices)
xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n");
- free(idev->driver);
- free(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- free(idev);
+ xf86DeleteInput(pInfo, 0);
return rval;
}
void
DeleteInputDeviceRequest(DeviceIntPtr pDev)
{
- LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate;
InputDriverPtr drv = NULL;
- IDevRec *idev = NULL;
- IDevPtr *it;
Bool isMaster = IsMaster(pDev);
if (pInfo) /* need to get these before RemoveDevice */
- {
drv = pInfo->drv;
- idev = pInfo->conf_idev;
- }
OsBlockSignals();
RemoveDevice(pDev, TRUE);
@@ -955,19 +955,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
-
- /* devices added through HAL aren't in the config layout */
- it = xf86ConfigLayout.inputs;
- while(*it && *it != idev)
- it++;
-
- if (!(*it)) /* end of list, not in the layout */
- {
- free(idev->driver);
- free(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- free(idev);
- }
}
OsReleaseSignals();
}
@@ -985,16 +972,17 @@ xf86PostMotionEvent(DeviceIntPtr device, {
va_list var;
int i = 0;
- static int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators);
+ xf86PostMotionEventM(device, is_absolute, &mask);
}
void
@@ -1002,10 +990,22 @@ xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
+{
+ ValuatorMask mask;
+
+ XI_VERIFY_VALUATORS(num_valuators);
+
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostMotionEventM(device, is_absolute, &mask);
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+ int is_absolute,
+ const ValuatorMask *mask)
{
int i = 0, nevents = 0;
- Bool drag = xf86SendDragEvents(device);
DeviceEvent *event;
int flags = 0;
@@ -1014,8 +1014,6 @@ xf86PostMotionEventP(DeviceIntPtr device, int dx = 0, dy = 0;
#endif
- XI_VERIFY_VALUATORS(num_valuators);
-
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
@@ -1023,19 +1021,20 @@ xf86PostMotionEventP(DeviceIntPtr device, #if XFreeXDGA
/* The evdev driver may not always send all axes across. */
- if (num_valuators >= 1 && first_valuator <= 1) {
+ if (valuator_mask_isset(mask, 0) ||
+ valuator_mask_isset(mask, 1))
if (miPointerGetScreen(device)) {
index = miPointerGetScreen(device)->myNum;
- if (first_valuator == 0)
+ if (valuator_mask_isset(mask, 0))
{
- dx = valuators[0];
+ dx = valuator_mask_get(mask, 0);
if (is_absolute)
dx -= device->last.valuators[0];
}
- if (first_valuator == 1 || num_valuators >= 2)
+ if (valuator_mask_isset(mask, 1))
{
- dy = valuators[1 - first_valuator];
+ dy = valuator_mask_get(mask, 1);
if (is_absolute)
dy -= device->last.valuators[1];
}
@@ -1043,21 +1042,13 @@ xf86PostMotionEventP(DeviceIntPtr device, if (DGAStealMotionEvent(device, index, dx, dy))
return;
}
- }
#endif
- nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0,
- flags, first_valuator, num_valuators,
- valuators);
+ nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0, flags, mask);
for (i = 0; i < nevents; i++) {
event = (DeviceEvent*)((xf86Events + i)->event);
- /* Don't post core motion events for devices not registered to send
- * drag events. */
- if (event->header == ET_Internal &&
- (event->type != ET_Motion || drag)) {
- mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
- }
+ mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
}
}
@@ -1070,18 +1061,17 @@ xf86PostProximityEvent(DeviceIntPtr device, {
va_list var;
int i;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostProximityEventP(device, is_in, first_valuator, num_valuators,
- valuators);
-
+ xf86PostProximityEventM(device, is_in, &mask);
}
void
@@ -1089,15 +1079,25 @@ xf86PostProximityEventP(DeviceIntPtr device, int is_in,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
- int i, nevents;
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostProximityEventM(device, is_in, &mask);
+}
+
+void
+xf86PostProximityEventM(DeviceIntPtr device,
+ int is_in,
+ const ValuatorMask *mask)
+{
+ int i, nevents;
+
nevents = GetProximityEvents(xf86Events, device,
- is_in ? ProximityIn : ProximityOut,
- first_valuator, num_valuators, valuators);
+ is_in ? ProximityIn : ProximityOut, mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
@@ -1113,19 +1113,19 @@ xf86PostButtonEvent(DeviceIntPtr device, ...)
{
va_list var;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
int i = 0;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
+
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostButtonEventP(device, is_absolute, button, is_down, first_valuator,
- num_valuators, valuators);
-
+ xf86PostButtonEventM(device, is_absolute, button, is_down, &mask);
}
void
@@ -1135,7 +1135,22 @@ xf86PostButtonEventP(DeviceIntPtr device, int is_down,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
+{
+ ValuatorMask mask;
+
+ XI_VERIFY_VALUATORS(num_valuators);
+
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostButtonEventM(device, is_absolute, button, is_down, &mask);
+}
+
+void
+xf86PostButtonEventM(DeviceIntPtr device,
+ int is_absolute,
+ int button,
+ int is_down,
+ const ValuatorMask *mask)
{
int i = 0, nevents = 0;
int flags = 0;
@@ -1144,8 +1159,6 @@ xf86PostButtonEventP(DeviceIntPtr device, int index;
#endif
- XI_VERIFY_VALUATORS(num_valuators);
-
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
@@ -1161,7 +1174,7 @@ xf86PostButtonEventP(DeviceIntPtr device, nevents = GetPointerEvents(xf86Events, device,
is_down ? ButtonPress : ButtonRelease, button,
- flags, first_valuator, num_valuators, valuators);
+ flags, mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
@@ -1179,18 +1192,18 @@ xf86PostKeyEvent(DeviceIntPtr device, {
va_list var;
int i = 0;
- static int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
+
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostKeyEventP(device, key_code, is_down, is_absolute, first_valuator,
- num_valuators, valuators);
-
+ xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
}
void
@@ -1200,17 +1213,29 @@ xf86PostKeyEventP(DeviceIntPtr device, int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
- int i = 0, nevents = 0;
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
+}
+
+void
+xf86PostKeyEventM(DeviceIntPtr device,
+ unsigned int key_code,
+ int is_down,
+ int is_absolute,
+ const ValuatorMask *mask)
+{
+ int i = 0, nevents = 0;
+
if (is_absolute) {
nevents = GetKeyboardValuatorEvents(xf86Events, device,
is_down ? KeyPress : KeyRelease,
- key_code, first_valuator,
- num_valuators, valuators);
+ key_code, mask);
}
else {
nevents = GetKeyboardEvents(xf86Events, device,
@@ -1227,10 +1252,13 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down)
{
- xf86PostKeyEventP(device, key_code, is_down, 0, 0, 0, NULL);
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ xf86PostKeyEventM(device, key_code, is_down, 0, &mask);
}
-LocalDevicePtr
+InputInfoPtr
xf86FirstLocalDevice(void)
{
return xf86InputDevs;
@@ -1286,27 +1314,27 @@ xf86ScaleAxis(int Cx, * specific like a touch screen.
*/
void
-xf86XInputSetScreen(LocalDevicePtr local,
+xf86XInputSetScreen(InputInfoPtr pInfo,
int screen_number,
int x,
int y)
{
- if (miPointerGetScreen(local->dev) !=
+ if (miPointerGetScreen(pInfo->dev) !=
screenInfo.screens[screen_number]) {
- miPointerSetScreen(local->dev, screen_number, x, y);
+ miPointerSetScreen(pInfo->dev, screen_number, x, y);
}
}
void
xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
- int resolution, int min_res, int max_res)
+ int resolution, int min_res, int max_res, int mode)
{
if (!dev || !dev->valuator)
return;
InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res,
- max_res);
+ max_res, mode);
}
/*
@@ -1324,9 +1352,6 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
dev->last.valuators[1] = dev->valuator->axisVal[1];
}
-
- if(axnum == 0) /* to prevent double invocation */
- ApplyAccelerationSettings(dev);
}
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h index 727f26107..15ab82421 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.h +++ b/xorg-server/hw/xfree86/common/xf86Xinput.h @@ -59,161 +59,123 @@ #include "XIstubs.h"
/* Input device flags */
-#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
/* the device sends Xinput and core pointer events */
#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
-/* if the device is the core pointer or is sending core events, and
- * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
- * (mouse drag action) are sent. This is mainly to allow a touch screen to be
- * used with netscape and other browsers which do strange things if the mouse
- * moves between button down and button up. With a touch screen, this motion
- * is common due to the user's finger moving slightly.
- */
-#define XI86_SEND_DRAG_EVENTS 0x08
-#define XI86_CORE_POINTER 0x10 /* device is the core pointer */
-#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
-#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
-#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
-
-#define XI_PRIVATE(dev) \
- (((LocalDevicePtr)((dev)->public.devicePrivate))->private)
-
-/* Valuator verification macro */
-#define XI_VERIFY_VALUATORS(num_valuators) \
- if (num_valuators > MAX_VALUATORS) { \
- xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
- " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
- return; \
- }
-
-/* Stupid API backwards-compatibility. */
-#define TS_Raw 60
-#define TS_Scaled 61
/* This holds the input driver entry and module information. */
typedef struct _InputDriverRec {
int driverVersion;
char * driverName;
void (*Identify)(int flags);
- struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
- IDevPtr dev, int flags);
+ int (*PreInit)(struct _InputDriverRec *drv,
+ struct _InputInfoRec* pInfo, int flags);
void (*UnInit)(struct _InputDriverRec *drv,
- struct _LocalDeviceRec *pInfo,
+ struct _InputInfoRec *pInfo,
int flags);
pointer module;
+ char ** default_options;
} InputDriverRec, *InputDriverPtr;
/* This is to input devices what the ScrnInfoRec is to screens. */
-typedef struct _LocalDeviceRec {
- struct _LocalDeviceRec *next;
+typedef struct _InputInfoRec {
+ struct _InputInfoRec *next;
char * name;
+ char * driver;
+
int flags;
Bool (*device_control)(DeviceIntPtr device, int what);
- void (*read_input)(struct _LocalDeviceRec *local);
- int (*control_proc)(struct _LocalDeviceRec *local,
+ void (*read_input)(struct _InputInfoRec *local);
+ int (*control_proc)(struct _InputInfoRec *local,
xDeviceCtl *control);
- void (*close_proc)(struct _LocalDeviceRec *local);
int (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
int mode);
- Bool (*conversion_proc)(struct _LocalDeviceRec *local,
- int first, int num, int v0,
- int v1, int v2, int v3, int v4,
- int v5, int *x, int *y);
- Bool (*reverse_conversion_proc)(
- struct _LocalDeviceRec *local,
- int x, int y, int *valuators);
int (*set_device_valuators)
- (struct _LocalDeviceRec *local,
+ (struct _InputInfoRec *local,
int *valuators, int first_valuator,
int num_valuators);
int fd;
- Atom atom;
DeviceIntPtr dev;
pointer private;
- int private_flags;
- unsigned int first;
- unsigned int last;
- int old_x;
- int old_y;
char * type_name;
- IntegerFeedbackPtr always_core_feedback;
- IDevPtr conf_idev;
InputDriverPtr drv;
pointer module;
pointer options;
- unsigned int history_size;
InputAttributes *attrs;
-} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
-
-typedef struct _DeviceAssocRec
-{
- char * config_section_name;
- LocalDevicePtr (*device_allocate)(void);
-} DeviceAssocRec, *DeviceAssocPtr;
+} *InputInfoPtr;
/* xf86Globals.c */
-extern _X_EXPORT InputInfoPtr xf86InputDevs;
+extern InputInfoPtr xf86InputDevs;
/* xf86Xinput.c */
extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, int *valuators);
+ int first_valuator, int num_valuators, const int *valuators);
+extern _X_EXPORT void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute,
+ const ValuatorMask *mask);
extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
- int num_valuators, int *valuators);
+ int num_valuators, const int *valuators);
+extern _X_EXPORT void xf86PostProximityEventM(DeviceIntPtr device, int is_in,
+ const ValuatorMask *mask);
extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
...);
extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
+extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute, int button,
+ int is_down, const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
...);
+extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down,
+ int is_absolute, const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down);
-extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
-extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void);
+extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void);
extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
-extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
+extern _X_EXPORT void xf86XInputSetScreen(InputInfoPtr pInfo, int screen_number, int x, int y);
extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
int maxval, int resolution, int min_res,
- int max_res);
+ int max_res, int mode);
extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo);
extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
/* not exported */
-int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto);
+int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
/* xf86Helper.c */
extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex);
-extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name);
extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name);
extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags);
-extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local);
+extern _X_EXPORT void xf86MotionHistoryAllocate(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86IDrvMsgVerb(InputInfoPtr dev,
+ MessageType type, int verb,
+ const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5);
+extern _X_EXPORT void xf86IDrvMsg(InputInfoPtr dev,
+ MessageType type,
+ const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4);
+extern _X_EXPORT void xf86VIDrvMsgVerb(InputInfoPtr dev,
+ MessageType type,
+ int verb,
+ const char *format,
+ va_list args);
/* xf86Option.c */
-extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts);
-
-
-/* Legacy hatred */
-#define SendCoreEvents 59
-#define DontSendCoreEvents 60
+extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts);
#endif /* _xf86Xinput_h */
diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h index 9d52661a7..0b7685012 100644 --- a/xorg-server/hw/xfree86/common/xf86str.h +++ b/xorg-server/hw/xfree86/common/xf86str.h @@ -402,14 +402,6 @@ typedef struct { } GDevRec, *GDevPtr;
typedef struct {
- char * identifier;
- char * driver;
- pointer commonOptions;
- pointer extraOptions;
- InputAttributes *attrs;
-} IDevRec, *IDevPtr;
-
-typedef struct {
int frameX0;
int frameY0;
int virtualX;
@@ -478,11 +470,13 @@ typedef struct _screenlayoutrec { confScreenPtr refscreen;
} screenLayoutRec, *screenLayoutPtr;
+typedef struct _InputInfoRec InputInfoRec;
+
typedef struct _serverlayoutrec {
char * id;
screenLayoutPtr screens;
GDevPtr inactives;
- IDevPtr* inputs; /* NULL terminated */
+ InputInfoRec** inputs; /* NULL terminated */
pointer options;
} serverLayoutRec, *serverLayoutPtr;
diff --git a/xorg-server/hw/xfree86/doc/devel/Registry b/xorg-server/hw/xfree86/doc/devel/Registry index 1fec230e8..613b50c7b 100644 --- a/xorg-server/hw/xfree86/doc/devel/Registry +++ b/xorg-server/hw/xfree86/doc/devel/Registry @@ -1,409 +1,408 @@ -This is the XFree86 driver/module registry. To avoid name space clashes and -to maintain some consistency between drivers the important name spaces are -maintained here. - -1. Module Names. - -Each module is required to have a unique name. Registered names are: - -GLcore -acecad -afb -apm -ark -ati -atimisc -bitmap -bt8xx -calcomp -cfb -cfb16 -cfb24 -cfb32 -chips -cirrus -citron -cyrix -dbe -ddc -digitaledge -dmc -dri -drm -dynapro -elo2300 -elographics -extmod -fb -fbdev -fbdevhw -fi12x6 -freetype -glide -glint -glx -hyperpen -i128 -i2c -i740 -i810 -imstt -int10 -joystick -keyboard -layer -magellan -magictouch -mfb -mga -microtouch -mouse -msp34xx -mutouch -neomagic -newport -nv -pcidata -penmount -pex5 -r128 -radeon -rac -ramdac -record -rendition -s3 -s3virge -savage -shadow -shadowfb -siliconmotion -sis -spaceorb -speedo -summa -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tga -trident -tseng -type1 -v4l -vbe -vesa -vga -vgahw -vmware -void -wacom -xaa -xf1bpp -xf24_32bpp -xf4bpp -xf8_16bpp -xf8_32bpp -xf8_32wid -xie -xtrap -xtt - -2. External Module Object Symbols. - -Each module is required to use a unique prefix or prefixes for all of -its externally visible symbols. They should be unique without regard to -case. Registered prefixes are: - -ati -bt8xx -cfb -chips -fi12x6 -glide -glint -mfb -mga -msp34xx -neo -permedia -tseng -vga -vgahw -vmware -xaa -xf1bpp -xf4bpp - -3. Chipset Names. - -Each video driver is required to use a unique set of chipset names. Case, -white space and underscore characters are ignored when comparing chipset -names. All names listed here are in lower case with all white space and -underscores removed. Registered chipset names are: - -ati -ativga -ct64200 -ct64300 -ct65520 -ct65525 -ct65530 -ct65535 -ct65540 -ct65545 -ct65546 -ct65548 -ct65550 -ct65554 -ct65555 -ct68554 -ct69000 -et4000 -et4000w32 -et4000w32i -et4000w32p -et6000 -et6100 -generic -ibmvga -ibm8514 -mach32 -mach64 -mach8 -mga2064w -mga1064sg -mga2164w -mga2164wagp -neo2070 -neo2090 -neo2093 -neo2097 -neo2160 -neo2200 -tipm2 -vgawonder -voodoo - -4. Option Names. - -Option names and their usage should be consistent between drivers. -Case, white space and underscore characters are ignored when comparing -option names. The prefix "no" may be added or removed from boolean -option names. All names listed here are in their preferred user-visible -form. Some registered option names are: - -Types are: B = boolean, O = set/unset (no value), I = integer, S = string, - A = optional string, F = floating point number Q = frequency - -Scopes are: F = global flags, V = video driver, C = common (per screen), - I = input drivers, X = XAA, Xv = Xv extension, M = misc. - -Names currently in use: - -Name Type Scope Description ----------------------------------------------------------------------------- -AllowMouseOpenFail B F ignore mouse dev open failure -AllowNonLocalModInDev B F allow non-local mod of input devs -AllowNonLocalXvidtune B F allow non-local VidMode connections -BlankTime I F Screen saver timeout (min) -DisableModInDev B F disallow changing input devs -DisableVidModeExtension B F disable VidMode extension -DontVTSwitch B F disable Ctrl-Alt-Fn -DontZap B F disable Ctrl-Alt-BS sequence -DontZoom B F disable Ctrl-Alt-+/- -NoTrapSignals B F don't trap signals -OffTime I F Time before DPMS off mode active (min) -PciProbe1 O F use PCI probe algorithm 1 -PciProbe2 O F use PCI probe algorithm 2 -PciForceConfig1 O F force PCI config type 1 -PciForceConfig2 O F force PCI config type 2 -Pixmap I F depth 24 pixmap size (24 or 32) -StandbyTime I F Time before DPMS standby active (min) -SuspendTime I F Time before DPMS suspend mode active (min) - -BackingStore B C Enable backing store -DDC B C Enable/disable DDC -DDC1 B C Enable/disable DDC1 -DDC2 B C Enable/disable DDC2 -DPMS O C Enable DPMS -MTRR B C Enable/disable setting MTRRs - -BaudRate I I Serial port baud rate -ButtonNumber I I Button number (for touch screen?) -ButtonThreshold I I ?? -ClearDTR O I Clear serial port DTR -ClearRTS O I Clear serial port RTS -DataBits I I Serial port data bits -DemandLoad O I ?? -Device S I Device file name -DeviceName S I Input device name -FlowControl S I Serial flow control ("xon", "none") -HistorySize I I ?? -MaxX I I Maximum X coordinate -MaxY I I Maximum Y coordinate -MinX I I Minimum X coordinate -MinY I I Minimum Y coordinate -Parity S I Serial port parity ("odd", "even", "none") -ReportDelay I I ?? -ReportingMode S I may be "raw" or "scaled" -ScreenNumber I I Screen number (for touch screen) -SendCoreEvents B I Send core events -SendDragEvents B I Send drag events -StopBits I I Serial port stop bits -SwapXY B I Swap the X and Y axes -UntouchDelay I I ?? -Vmin I I Tty VMIN -Vtime I I Tty VTIME - - -18BitBus B V ?? -8Plus16 B V Enable depth 8 + depth 16 with overlay -8Plus24 B V Enable depth 8 + depth 24 with overlay -BlockWrite B V Enable/disable block write -ColorKey I V Set the color key for overlay modes -CompositeSync B V Composite sync -CRTDisplay B V Force display on CRT, not LCD -CRTScreen B V Display on CRT, not LCD (Obsolete) -EarlyRasPrecharge O V Early RAS pre-charge -FastDRAM O V Fast DRAM -FifoAggressive O V Aggressive FIFO setting -FifoConservative O V Conservative FIFO setting -FifoModerate O V Moderate FIFO setting -FireGL3000 B V Card is Diamond FireGL3000 -FixPanelSize B V ?? -FPClock8 Q V Flat panel clock for 8bpp fb (MHz) -FPClock16 Q V Flat panel clock for 16bpp fb (MHz) -FPClock24 Q V Flat panel clock for 24bpp fb (MHz) -FPClock32 Q V Flat panel clock for 32bpp fb (MHz) -FPMVRAM O V Fast page mode VRAM -FramebufferWC B V Enable/disable WC for the framebuffer -GlideDevice I V Selects which Voodoo board to use -HiBitHigh O V High clock bit default to set -HiBitLow O V High clock bit default to cleared -HWClocks B V Enable/disable HW clocks -HWCursor B V Enable/disable HW cursor -LateRasPrecharge O V Late RAS pre-charge -Legend O V Card is Legend ET4000 -LCDCenter B V Enable/disable centering for LCD displays -Linear B V Enable/disable linear framebuffer -MCLK Q V Specify the current MCLK value (MHz) -MedDRAM B V Medium speed DRAM -MemCfg1 I V ?? -MemCfg2 I V ?? -MGASDRAM B V Mga card has SDRAM -MMIO B V Enable/disable memory mapped I/O -MMIOCache B V Enable/Disable MMIO cache -MuxThreshold I V Multiplexing threshold (kHz) -NoAccel B V Disable/enable acceleration -NoClockChip B V ?? -NoStretch B V Disable/enable stretching for LCD displays -OnAtExit B V Leave video signal on when exiting server -OverclockMem B V Enable memory overclocking -Overlay A V Enable multi-depth/overlay. An optional - string "M,N" may be specified, where - M, N are the depths. -PanelDisplay B V Force display on LCD -PciBurst B V Enable/disable PCI burst mode -PciRetry B V Enable/disable PCI retries -ProbeClocks B V Force probe for non-programmable clocks -ReferenceClock Q V Clock generator reference frequency -RGBbits I V Number of significant bits per rgb -Rotate S V Rotate the virtual display (CW or CCW) -SetLCDClk Q V Set LCD clock (MHz) -SetMclk Q V Set Memory Clock (MHz) -ShadowFB B V Enable shadow framebuffer layer -ShowCache B V Enable viewing of offscreen memory -ShowOverscan O V Set the overscan area to a visible colour -SlowDRAM O V Slow DRAM -SlowEDODRAM O V Slow EDO DRAM -STN B V STN screen type (??) -SWCursor B V Enable/disable SW cursor -SuspendHack B V ?? -SyncOnGreen B V Enable/disable sync on green -TurboQueue B V Enable/disable turbo queue -UseFBDev B V Use the fbdev driver interface -UseModeLine B V Use Modeline (??) -W32Interleave B V ?? - -Buffers I Xv Number of buffers -Device S Xv Device file name -Expose B Xv Disable occlusion clipping (see DESIGN) -FramesPerSec I Xv Max. refresh frequency - -XAA options. All are of type "O" and scope "X", and are self-explanatory - -XaaNoColor8x8PatternFillRect -XaaNoColor8x8PatternFillTrap -XaaNoCPUToScreenColorExpandFill -XaaNoDashedBresenhamLine -XaaNoDashedTwoPointLine -XaaNoScreenToScreenCopy -XaaNoImageReadRect -XaaNoImageWriteRect -XaaNoMono8x8PatternFillRect -XaaNoMono8x8PatternFillTrap -XaaNoOffscreenPixmaps -XaaNoPixmapCache -XaaNoScanlineCPUToScreenColorExpandFill -XaaNoScanlineImageWriteRect -XaaNoScreenToScreenColorExpandFill -XaaNoSolidBresenhamLine -XaaNoSolidFillRect -XaaNoSolidFillTrap -XaaNoSolidHorVertLine -XaaNoSolidTwoPointLine - - -Names used in previous versions: - -16Clocks -8Clocks -ClkDiv2 -EDO VRAM -ExternDisp -ExtFramBuf -FastVRAM -FavorBitBlt -InternDisp -NoBitBlt -NoFontCache -NoImageBlt -NoMemAccess -NoPciDisconnect -NoPixmapCache -NoProgramClocks -NoSplitXfer -OverrideBIOS -OverrideValidateMode -ProgLcdModeRegs -ProgLcdModeStretch -SlowDRAMrefresh -SlowVRAM -SwapHiBit - - -5. Ramdac Names. - -Ramdac names should be consistent between drivers. Case, white space -and underscore characters are ignored when comparing ramdac names. All -names listed here are in lower case with all white space and underscores -removed. - - -6. Clock Chip Names. - -Clock chip names should be consistent between drivers. Case, white -space and underscore characters are ignored when comparing clock chip -names. All names listed here are in lower case with all white space -and underscores removed. - - - - - -$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $ +This is the XFree86 driver/module registry. To avoid name space clashes and
+to maintain some consistency between drivers the important name spaces are
+maintained here.
+
+1. Module Names.
+
+Each module is required to have a unique name. Registered names are:
+
+GLcore
+acecad
+afb
+apm
+ark
+ati
+atimisc
+bitmap
+bt8xx
+calcomp
+cfb
+cfb16
+cfb24
+cfb32
+chips
+cirrus
+citron
+cyrix
+dbe
+ddc
+digitaledge
+dmc
+dri
+drm
+dynapro
+elo2300
+elographics
+extmod
+fb
+fbdev
+fbdevhw
+fi12x6
+freetype
+glide
+glint
+glx
+hyperpen
+i128
+i2c
+i740
+i810
+imstt
+int10
+joystick
+keyboard
+layer
+magellan
+magictouch
+mfb
+mga
+microtouch
+mouse
+msp34xx
+mutouch
+neomagic
+newport
+nv
+pcidata
+penmount
+pex5
+r128
+radeon
+rac
+ramdac
+record
+rendition
+s3
+s3virge
+savage
+shadow
+shadowfb
+siliconmotion
+sis
+spaceorb
+speedo
+summa
+sunbw2
+suncg14
+suncg3
+suncg6
+sunffb
+sunleo
+suntcx
+tdfx
+tga
+trident
+tseng
+type1
+v4l
+vbe
+vesa
+vga
+vgahw
+vmware
+void
+wacom
+xaa
+xf1bpp
+xf24_32bpp
+xf4bpp
+xf8_16bpp
+xf8_32bpp
+xf8_32wid
+xie
+xtrap
+xtt
+
+2. External Module Object Symbols.
+
+Each module is required to use a unique prefix or prefixes for all of
+its externally visible symbols. They should be unique without regard to
+case. Registered prefixes are:
+
+ati
+bt8xx
+cfb
+chips
+fi12x6
+glide
+glint
+mfb
+mga
+msp34xx
+neo
+permedia
+tseng
+vga
+vgahw
+vmware
+xaa
+xf1bpp
+xf4bpp
+
+3. Chipset Names.
+
+Each video driver is required to use a unique set of chipset names. Case,
+white space and underscore characters are ignored when comparing chipset
+names. All names listed here are in lower case with all white space and
+underscores removed. Registered chipset names are:
+
+ati
+ativga
+ct64200
+ct64300
+ct65520
+ct65525
+ct65530
+ct65535
+ct65540
+ct65545
+ct65546
+ct65548
+ct65550
+ct65554
+ct65555
+ct68554
+ct69000
+et4000
+et4000w32
+et4000w32i
+et4000w32p
+et6000
+et6100
+generic
+ibmvga
+ibm8514
+mach32
+mach64
+mach8
+mga2064w
+mga1064sg
+mga2164w
+mga2164wagp
+neo2070
+neo2090
+neo2093
+neo2097
+neo2160
+neo2200
+tipm2
+vgawonder
+voodoo
+
+4. Option Names.
+
+Option names and their usage should be consistent between drivers.
+Case, white space and underscore characters are ignored when comparing
+option names. The prefix "no" may be added or removed from boolean
+option names. All names listed here are in their preferred user-visible
+form. Some registered option names are:
+
+Types are: B = boolean, O = set/unset (no value), I = integer, S = string,
+ A = optional string, F = floating point number Q = frequency
+
+Scopes are: F = global flags, V = video driver, C = common (per screen),
+ I = input drivers, X = XAA, Xv = Xv extension, M = misc.
+
+Names currently in use:
+
+Name Type Scope Description
+----------------------------------------------------------------------------
+AllowMouseOpenFail B F ignore mouse dev open failure
+AllowNonLocalModInDev B F allow non-local mod of input devs
+AllowNonLocalXvidtune B F allow non-local VidMode connections
+BlankTime I F Screen saver timeout (min)
+DisableModInDev B F disallow changing input devs
+DisableVidModeExtension B F disable VidMode extension
+DontVTSwitch B F disable Ctrl-Alt-Fn
+DontZap B F disable Ctrl-Alt-BS sequence
+DontZoom B F disable Ctrl-Alt-+/-
+NoTrapSignals B F don't trap signals
+OffTime I F Time before DPMS off mode active (min)
+PciProbe1 O F use PCI probe algorithm 1
+PciProbe2 O F use PCI probe algorithm 2
+PciForceConfig1 O F force PCI config type 1
+PciForceConfig2 O F force PCI config type 2
+Pixmap I F depth 24 pixmap size (24 or 32)
+StandbyTime I F Time before DPMS standby active (min)
+SuspendTime I F Time before DPMS suspend mode active (min)
+
+BackingStore B C Enable backing store
+DDC B C Enable/disable DDC
+DDC1 B C Enable/disable DDC1
+DDC2 B C Enable/disable DDC2
+DPMS O C Enable DPMS
+MTRR B C Enable/disable setting MTRRs
+
+BaudRate I I Serial port baud rate
+ButtonNumber I I Button number (for touch screen?)
+ButtonThreshold I I ??
+ClearDTR O I Clear serial port DTR
+ClearRTS O I Clear serial port RTS
+DataBits I I Serial port data bits
+DemandLoad O I ??
+Device S I Device file name
+DeviceName S I Input device name
+FlowControl S I Serial flow control ("xon", "none")
+HistorySize I I ??
+MaxX I I Maximum X coordinate
+MaxY I I Maximum Y coordinate
+MinX I I Minimum X coordinate
+MinY I I Minimum Y coordinate
+Parity S I Serial port parity ("odd", "even", "none")
+ReportDelay I I ??
+ReportingMode S I may be "raw" or "scaled"
+ScreenNumber I I Screen number (for touch screen)
+SendCoreEvents B I Send core events
+StopBits I I Serial port stop bits
+SwapXY B I Swap the X and Y axes
+UntouchDelay I I ??
+Vmin I I Tty VMIN
+Vtime I I Tty VTIME
+
+
+18BitBus B V ??
+8Plus16 B V Enable depth 8 + depth 16 with overlay
+8Plus24 B V Enable depth 8 + depth 24 with overlay
+BlockWrite B V Enable/disable block write
+ColorKey I V Set the color key for overlay modes
+CompositeSync B V Composite sync
+CRTDisplay B V Force display on CRT, not LCD
+CRTScreen B V Display on CRT, not LCD (Obsolete)
+EarlyRasPrecharge O V Early RAS pre-charge
+FastDRAM O V Fast DRAM
+FifoAggressive O V Aggressive FIFO setting
+FifoConservative O V Conservative FIFO setting
+FifoModerate O V Moderate FIFO setting
+FireGL3000 B V Card is Diamond FireGL3000
+FixPanelSize B V ??
+FPClock8 Q V Flat panel clock for 8bpp fb (MHz)
+FPClock16 Q V Flat panel clock for 16bpp fb (MHz)
+FPClock24 Q V Flat panel clock for 24bpp fb (MHz)
+FPClock32 Q V Flat panel clock for 32bpp fb (MHz)
+FPMVRAM O V Fast page mode VRAM
+FramebufferWC B V Enable/disable WC for the framebuffer
+GlideDevice I V Selects which Voodoo board to use
+HiBitHigh O V High clock bit default to set
+HiBitLow O V High clock bit default to cleared
+HWClocks B V Enable/disable HW clocks
+HWCursor B V Enable/disable HW cursor
+LateRasPrecharge O V Late RAS pre-charge
+Legend O V Card is Legend ET4000
+LCDCenter B V Enable/disable centering for LCD displays
+Linear B V Enable/disable linear framebuffer
+MCLK Q V Specify the current MCLK value (MHz)
+MedDRAM B V Medium speed DRAM
+MemCfg1 I V ??
+MemCfg2 I V ??
+MGASDRAM B V Mga card has SDRAM
+MMIO B V Enable/disable memory mapped I/O
+MMIOCache B V Enable/Disable MMIO cache
+MuxThreshold I V Multiplexing threshold (kHz)
+NoAccel B V Disable/enable acceleration
+NoClockChip B V ??
+NoStretch B V Disable/enable stretching for LCD displays
+OnAtExit B V Leave video signal on when exiting server
+OverclockMem B V Enable memory overclocking
+Overlay A V Enable multi-depth/overlay. An optional
+ string "M,N" may be specified, where
+ M, N are the depths.
+PanelDisplay B V Force display on LCD
+PciBurst B V Enable/disable PCI burst mode
+PciRetry B V Enable/disable PCI retries
+ProbeClocks B V Force probe for non-programmable clocks
+ReferenceClock Q V Clock generator reference frequency
+RGBbits I V Number of significant bits per rgb
+Rotate S V Rotate the virtual display (CW or CCW)
+SetLCDClk Q V Set LCD clock (MHz)
+SetMclk Q V Set Memory Clock (MHz)
+ShadowFB B V Enable shadow framebuffer layer
+ShowCache B V Enable viewing of offscreen memory
+ShowOverscan O V Set the overscan area to a visible colour
+SlowDRAM O V Slow DRAM
+SlowEDODRAM O V Slow EDO DRAM
+STN B V STN screen type (??)
+SWCursor B V Enable/disable SW cursor
+SuspendHack B V ??
+SyncOnGreen B V Enable/disable sync on green
+TurboQueue B V Enable/disable turbo queue
+UseFBDev B V Use the fbdev driver interface
+UseModeLine B V Use Modeline (??)
+W32Interleave B V ??
+
+Buffers I Xv Number of buffers
+Device S Xv Device file name
+Expose B Xv Disable occlusion clipping (see DESIGN)
+FramesPerSec I Xv Max. refresh frequency
+
+XAA options. All are of type "O" and scope "X", and are self-explanatory
+
+XaaNoColor8x8PatternFillRect
+XaaNoColor8x8PatternFillTrap
+XaaNoCPUToScreenColorExpandFill
+XaaNoDashedBresenhamLine
+XaaNoDashedTwoPointLine
+XaaNoScreenToScreenCopy
+XaaNoImageReadRect
+XaaNoImageWriteRect
+XaaNoMono8x8PatternFillRect
+XaaNoMono8x8PatternFillTrap
+XaaNoOffscreenPixmaps
+XaaNoPixmapCache
+XaaNoScanlineCPUToScreenColorExpandFill
+XaaNoScanlineImageWriteRect
+XaaNoScreenToScreenColorExpandFill
+XaaNoSolidBresenhamLine
+XaaNoSolidFillRect
+XaaNoSolidFillTrap
+XaaNoSolidHorVertLine
+XaaNoSolidTwoPointLine
+
+
+Names used in previous versions:
+
+16Clocks
+8Clocks
+ClkDiv2
+EDO VRAM
+ExternDisp
+ExtFramBuf
+FastVRAM
+FavorBitBlt
+InternDisp
+NoBitBlt
+NoFontCache
+NoImageBlt
+NoMemAccess
+NoPciDisconnect
+NoPixmapCache
+NoProgramClocks
+NoSplitXfer
+OverrideBIOS
+OverrideValidateMode
+ProgLcdModeRegs
+ProgLcdModeStretch
+SlowDRAMrefresh
+SlowVRAM
+SwapHiBit
+
+
+5. Ramdac Names.
+
+Ramdac names should be consistent between drivers. Case, white space
+and underscore characters are ignored when comparing ramdac names. All
+names listed here are in lower case with all white space and underscores
+removed.
+
+
+6. Clock Chip Names.
+
+Clock chip names should be consistent between drivers. Case, white
+space and underscore characters are ignored when comparing clock chip
+names. All names listed here are in lower case with all white space
+and underscores removed.
+
+
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $
diff --git a/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre b/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre index 8d09862b3..6547d38aa 100644 --- a/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre @@ -558,9 +558,6 @@ Default: off. This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__)
drivers to not report failure if the mouse device can't be opened/initialised.
It has no effect on the evdev(__drivermansuffix__) or other drivers.
-The previous functionality of allowing the server to start up even if
-the mouse device can't be opened/initialised is now handled by the
-AllowEmptyInput option.
Default: false.
.TP 7
.BI "Option \*qVTSysReq\*q \*q" boolean \*q
@@ -677,12 +674,6 @@ default. Allow modules built for a different, potentially incompatible version of
the X server to load. Disabled by default.
.TP 7
-.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
-If enabled, don't add the standard keyboard and mouse drivers, if there are no
-input devices in the config file. Enabled by default if AutoAddDevices and
-AutoEnableDevices is enabled, otherwise disabled.
-If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored.
-.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.
Enabled by default.
@@ -938,9 +929,6 @@ default. Devices with disabled will be \*qfloating\*q and only accessible by clients employing the
X Input extension. This option controls the startup behavior only, a device
may be reattached or set floating at runtime.
-.TP 7
-.BI "Option \*qSendDragEvents\*q \*q" boolean \*q
-Send core events while dragging. Enabled by default.
.PP
For pointing devices, the following options control how the pointer
is accelerated or decelerated with respect to physical device motion. Most of
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 9bf838e6c..578773a5a 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, * is moved to a crtc with a lower refresh rate, or a crtc that just
* got enabled.
*/
- if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
- pPriv->last_swap_target = 0;
+ if (ds->GetMSC) {
+ if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
+ pPriv->last_swap_target = 0;
- if (current_msc < pPriv->last_swap_target)
- pPriv->last_swap_target = current_msc;
+ if (current_msc < pPriv->last_swap_target)
+ pPriv->last_swap_target = current_msc;
+
+ }
/*
* Swap target for this swap is last swap target + swap interval since
diff --git a/xorg-server/hw/xfree86/loader/sdksyms.sh b/xorg-server/hw/xfree86/loader/sdksyms.sh index ca1474371..6c45ec45e 100644 --- a/xorg-server/hw/xfree86/loader/sdksyms.sh +++ b/xorg-server/hw/xfree86/loader/sdksyms.sh @@ -19,7 +19,6 @@ cat > sdksyms.c << EOF #include "mipict.h"
#include "glyphstr.h"
#include "picturestr.h"
-#include "renderedge.h"
/* fb/Makefile.am -- module */
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index beb9be66e..d421a942f 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -2964,8 +2964,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) int size;
#endif
- if (output->MonInfo != NULL)
- free(output->MonInfo);
+ free(output->MonInfo);
output->MonInfo = edid_mon;
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index f846d60ea..655857597 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
RegionInit(&damage_region, &damage_box, 1);
- DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
&damage_region);
RegionUninit(&damage_region);
crtc->shadowClear = TRUE;
diff --git a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c index 029d3a989..a0a3b2758 100644 --- a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c +++ b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c @@ -124,8 +124,17 @@ xf86EnableIO() FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
return FALSE;
}
+#if 0
+ /*
+ * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
+ * ports, and the int10 wrapper is not emulating them. (Note that it's
+ * effectively what happens in the Linux variant too, as iopl() is used
+ * there, making the ioperm() meaningless.)
+ *
+ * Reenable this when int10 gets fixed. */
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
+#endif
return TRUE;
}
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c index 687483113..7be65dcf9 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c @@ -277,9 +277,7 @@ xf86OpenConsole(void) tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
/* need to keep the buffer clean, else the kernel gets angry */
- if (xf86Info.allowEmptyInput)
- console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
- drain_console, NULL);
+ xf86SetConsoleHandler(drain_console, NULL);
/* we really should have a InitOSInputDevices() function instead
* of Init?$#*&Device(). So I just place it here */
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c index 8aa2506a9..0311bdf15 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c @@ -530,6 +530,8 @@ xf86EnableIO(void) return FALSE;
}
# if !defined(__alpha__)
+ /* XXX: this is actually not trapping anything because of iopl(3)
+ * above */
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
# endif
diff --git a/xorg-server/hw/xfree86/x86emu/ops.c b/xorg-server/hw/xfree86/x86emu/ops.c index 740a3a58d..c0cfbd8c1 100644 --- a/xorg-server/hw/xfree86/x86emu/ops.c +++ b/xorg-server/hw/xfree86/x86emu/ops.c @@ -9691,15 +9691,23 @@ Handles opcode 0xe9 ****************************************************************************/
static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
{
- int ip;
+ u32 ip;
START_OF_INSTR();
DECODE_PRINTF("JMP\t");
- ip = (s16)fetch_word_imm();
- ip += (s16)M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", (u16)ip);
- TRACE_AND_STEP();
- M.x86.R_IP = (u16)ip;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ ip = (u32)fetch_long_imm();
+ ip += (u32)M.x86.R_EIP;
+ DECODE_PRINTF2("%08x\n", (u32)ip);
+ TRACE_AND_STEP();
+ M.x86.R_EIP = (u32)ip;
+ } else {
+ ip = (s16)fetch_word_imm();
+ ip += (s16)M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", (u16)ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16)ip;
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
diff --git a/xorg-server/hw/xnest/Events.c b/xorg-server/hw/xnest/Events.c index 88970bbe0..6b8edf143 100644 --- a/xorg-server/hw/xnest/Events.c +++ b/xorg-server/hw/xnest/Events.c @@ -25,6 +25,7 @@ is" without express or implied warranty. #include "windowstr.h"
#include "servermd.h"
#include "inputstr.h"
+#include "inpututils.h"
#include "mi.h"
@@ -117,6 +118,7 @@ xnestCollectEvents(void) {
XEvent X;
int i, n, valuators[2];
+ ValuatorMask mask;
ScreenPtr pScreen;
GetEventList(&xnestEvents);
@@ -133,19 +135,21 @@ xnestCollectEvents(void) break;
case ButtonPress:
+ valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonPress,
- X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
+ X.xbutton.button, POINTER_RELATIVE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
case ButtonRelease:
+ valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease,
- X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
+ X.xbutton.button, POINTER_RELATIVE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
@@ -153,9 +157,10 @@ xnestCollectEvents(void) case MotionNotify:
valuators[0] = X.xmotion.x;
valuators[1] = X.xmotion.y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
- 0, POINTER_ABSOLUTE, 0, 2, valuators);
+ 0, POINTER_ABSOLUTE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
@@ -186,9 +191,10 @@ xnestCollectEvents(void) NewCurrentScreen(inputInfo.pointer, pScreen, X.xcrossing.x, X.xcrossing.y);
valuators[0] = X.xcrossing.x;
valuators[1] = X.xcrossing.y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
- 0, POINTER_ABSOLUTE, 0, 2, valuators);
+ 0, POINTER_ABSOLUTE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
xnestDirectInstallColormaps(pScreen);
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index 7814967b8..f217f4c33 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -314,10 +314,9 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), NAXES,
axes_labels);
- pPointer->valuator->mode = Absolute; // Relative
InitAbsoluteClassDeviceStruct(pPointer);
-// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
-// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
break;
case DEVICE_ON:
pPointer->public.on = TRUE;
@@ -362,15 +361,14 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), NAXES,
axes_labels);
- pPointer->valuator->mode = Absolute; // Relative
InitProximityClassDeviceStruct(pPointer);
InitAbsoluteClassDeviceStruct(pPointer);
- InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
// pPointer->use = IsXExtensionDevice;
break;
case DEVICE_ON:
@@ -468,7 +466,6 @@ void InitInput( int argc, char **argv ) XkbSetRulesDflts(&rmlvo);
darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
- RegisterKeyboardDevice( darwinKeyboard );
darwinKeyboard->name = strdup("keyboard");
/* here's the snippet from the current gdk sources:
@@ -486,19 +483,15 @@ void InitInput( int argc, char **argv ) */
darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
- RegisterPointerDevice( darwinPointer );
darwinPointer->name = strdup("pointer");
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletStylus );
darwinTabletStylus->name = strdup("pen");
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletCursor );
darwinTabletCursor->name = strdup("cursor");
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletEraser );
darwinTabletEraser->name = strdup("eraser");
darwinTabletCurrent = darwinTabletStylus;
diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c index a00c89ecd..ec320b3a5 100644 --- a/xorg-server/hw/xquartz/darwinEvents.c +++ b/xorg-server/hw/xquartz/darwinEvents.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. #include "windowstr.h"
#include "pixmapstr.h"
#include "inputstr.h"
+#include "inpututils.h"
#include "eventstr.h"
#include "mi.h"
#include "scrnintstr.h"
@@ -464,8 +465,10 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, pressure, tilt_x, tilt_y);
darwinEvents_lock(); {
+ ValuatorMask mask;
+ valuator_mask_set_range(&mask, 0, (pDev == darwinTabletCurrent) ? 5 : 2, valuators);
num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button,
- POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators);
+ POINTER_ABSOLUTE, &mask);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
@@ -507,8 +510,9 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) { DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, 0.0f, 0.0f, 0.0f);
darwinEvents_lock(); {
- num_events = GetProximityEvents(darwinEvents, pDev, ev_type,
- 0, 5, valuators);
+ ValuatorMask mask;
+ valuator_mask_set_range(&mask, 0, 5, valuators);
+ num_events = GetProximityEvents(darwinEvents, pDev, ev_type, &mask);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c index 958c7cdd4..85ce9d608 100644 --- a/xorg-server/hw/xquartz/darwinXinput.c +++ b/xorg-server/hw/xquartz/darwinXinput.c @@ -82,78 +82,6 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client) DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client);
}
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices(void)
-{
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
- DEBUG_LOG("AddOtherInputDevices\n");
-}
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
-{
- DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status);
-}
-
/****************************************************************************
*
* Caller: ProcXSetDeviceMode
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c index c09610c62..5f51fc457 100644 --- a/xorg-server/hw/xwin/InitInput.c +++ b/xorg-server/hw/xwin/InitInput.c @@ -122,10 +122,6 @@ InitInput (int argc, char *argv[]) g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE);
g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE);
-
- RegisterPointerDevice (g_pwinPointer);
- RegisterKeyboardDevice (g_pwinKeyboard);
-
g_pwinPointer->name = strdup("Windows mouse");
g_pwinKeyboard->name = strdup("Windows keyboard");
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 8b265c70b..a7234a6cd 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -682,10 +682,7 @@ glxWinScreenProbe(ScreenPtr pScreen) unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0)
{
- if (screen->base.GLXextensions != NULL)
- {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
__glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions);
diff --git a/xorg-server/hw/xwin/wincmap.c b/xorg-server/hw/xwin/wincmap.c index 9da03888d..6cb037243 100644 --- a/xorg-server/hw/xwin/wincmap.c +++ b/xorg-server/hw/xwin/wincmap.c @@ -1,674 +1,671 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * Local prototypes - */ - -static int -winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps); - -static void -winStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); - -static void -winInstallColormap (ColormapPtr pmap); - -static void -winUninstallColormap (ColormapPtr pmap); - -static void -winResolveColor (unsigned short *pred, - unsigned short *pgreen, - unsigned short *pblue, - VisualPtr pVisual); - -static Bool -winCreateColormap (ColormapPtr pmap); - -static void -winDestroyColormap (ColormapPtr pmap); - -static Bool -winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap); - -static Bool -winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap); - - -/* - * Set screen functions for colormaps - */ - -void -winSetColormapFunctions (ScreenPtr pScreen) -{ - pScreen->CreateColormap = winCreateColormap; - pScreen->DestroyColormap = winDestroyColormap; - pScreen->InstallColormap = winInstallColormap; - pScreen->UninstallColormap = winUninstallColormap; - pScreen->ListInstalledColormaps = winListInstalledColormaps; - pScreen->StoreColors = winStoreColors; - pScreen->ResolveColor = winResolveColor; -} - - -/* See Porting Layer Definition - p. 30 */ -/* - * Walk the list of installed colormaps, filling the pmaps list - * with the resource ids of the installed maps, and return - * a count of the total number of installed maps. - */ -static int -winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps) -{ - winScreenPriv(pScreen); - - /* - * There will only be one installed colormap, so we only need - * to return one id, and the count of installed maps will always - * be one. - */ - *pmaps = pScreenPriv->pcmapInstalled->mid; - return 1; -} - - -/* See Porting Layer Definition - p. 30 */ -/* See Programming Windows - p. 663 */ -static void -winInstallColormap (ColormapPtr pColormap) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - ColormapPtr oldpmap = pScreenPriv->pcmapInstalled; - -#if CYGDEBUG - winDebug ("winInstallColormap\n"); -#endif - - /* Did the colormap actually change? */ - if (pColormap != oldpmap) - { -#if CYGDEBUG - winDebug ("winInstallColormap - Colormap has changed, attempt " - "to install.\n"); -#endif - - /* Was there a previous colormap? */ - if (oldpmap != (ColormapPtr) None) - { - /* There was a previous colormap; tell clients it is gone */ - WalkTree (pColormap->pScreen, TellLostMap, (char *)&oldpmap->mid); - } - - /* Install new colormap */ - pScreenPriv->pcmapInstalled = pColormap; - WalkTree (pColormap->pScreen, TellGainedMap, (char *)&pColormap->mid); - - /* Call the engine specific colormap install procedure */ - if (!((*pScreenPriv->pwinInstallColormap) (pColormap))) - { - winErrorFVerb (2, "winInstallColormap - Screen specific colormap install " - "procedure failed. Continuing, but colors may be " - "messed up from now on.\n"); - } - } - - /* Save a pointer to the newly installed colormap */ - pScreenPriv->pcmapInstalled = pColormap; -} - - -/* See Porting Layer Definition - p. 30 */ -static void -winUninstallColormap (ColormapPtr pmap) -{ - winScreenPriv(pmap->pScreen); - ColormapPtr curpmap = pScreenPriv->pcmapInstalled; - -#if CYGDEBUG - winDebug ("winUninstallColormap\n"); -#endif - - /* Is the colormap currently installed? */ - if (pmap != curpmap) - { - /* Colormap not installed, nothing to do */ - return; - } - - /* Clear the installed colormap flag */ - pScreenPriv->pcmapInstalled = NULL; - - /* - * NOTE: The default colormap does not get "uninstalled" before - * it is destroyed. - */ - - /* Install the default cmap in place of the cmap to be uninstalled */ - if (pmap->mid != pmap->pScreen->defColormap) - { - dixLookupResourceByType((pointer) &curpmap, pmap->pScreen->defColormap, - RT_COLORMAP, NullClient, DixUnknownAccess); - (*pmap->pScreen->InstallColormap) (curpmap); - } -} - - -/* See Porting Layer Definition - p. 30 */ -static void -winStoreColors (ColormapPtr pmap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pmap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pmap); - int i; - unsigned short nRed, nGreen, nBlue; - -#if CYGDEBUG - if (ndef != 1) - winDebug ("winStoreColors - ndef: %d\n", - ndef); -#endif - - /* Save the new colors in the colormap privates */ - for (i = 0; i < ndef; ++i) - { - /* Adjust the colors from the X color spec to the Windows color spec */ - nRed = pdefs[i].red >> 8; - nGreen = pdefs[i].green >> 8; - nBlue = pdefs[i].blue >> 8; - - /* Copy the colors to a palette entry table */ - pCmapPriv->peColors[pdefs[0].pixel + i].peRed = nRed; - pCmapPriv->peColors[pdefs[0].pixel + i].peGreen = nGreen; - pCmapPriv->peColors[pdefs[0].pixel + i].peBlue = nBlue; - - /* Copy the colors to a RGBQUAD table */ - pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbRed = nRed; - pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbGreen = nGreen; - pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbBlue = nBlue; - -#if CYGDEBUG - winDebug ("winStoreColors - nRed %d nGreen %d nBlue %d\n", - nRed, nGreen, nBlue); -#endif - } - - /* Call the engine specific store colors procedure */ - if (!((pScreenPriv->pwinStoreColors) (pmap, ndef, pdefs))) - { - winErrorFVerb (2, "winStoreColors - Engine cpecific color storage procedure " - "failed. Continuing, but colors may be messed up from now " - "on.\n"); - } -} - - -/* See Porting Layer Definition - p. 30 */ -static void -winResolveColor (unsigned short *pred, - unsigned short *pgreen, - unsigned short *pblue, - VisualPtr pVisual) -{ -#if CYGDEBUG - winDebug ("winResolveColor ()\n"); -#endif - - miResolveColor (pred, pgreen, pblue, pVisual); -} - - -/* See Porting Layer Definition - p. 29 */ -static Bool -winCreateColormap (ColormapPtr pmap) -{ - winPrivCmapPtr pCmapPriv = NULL; - ScreenPtr pScreen = pmap->pScreen; - winScreenPriv(pScreen); - -#if CYGDEBUG - winDebug ("winCreateColormap\n"); -#endif - - /* Allocate colormap privates */ - if (!winAllocateCmapPrivates (pmap)) - { - ErrorF ("winCreateColorma - Couldn't allocate cmap privates\n"); - return FALSE; - } - - /* Get a pointer to the newly allocated privates */ - pCmapPriv = winGetCmapPriv (pmap); - - /* - * FIXME: This is some evil hackery to help in handling some X clients - * that expect the top pixel to be white. This "help" only lasts until - * some client overwrites the top colormap entry. - * - * We don't want to actually allocate the top entry, as that causes - * problems with X clients that need 7 planes (128 colors) in the default - * colormap, such as Magic 7.1. - */ - pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbRed = 255; - pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbGreen = 255; - pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbBlue = 255; - pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peRed = 255; - pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peGreen = 255; - pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peBlue = 255; - - /* Call the engine specific colormap initialization procedure */ - if (!((*pScreenPriv->pwinCreateColormap) (pmap))) - { - ErrorF ("winCreateColormap - Engine specific colormap creation " - "procedure failed. Aborting.\n"); - return FALSE; - } - - return TRUE; -} - - -/* See Porting Layer Definition - p. 29, 30 */ -static void -winDestroyColormap (ColormapPtr pColormap) -{ - winScreenPriv(pColormap->pScreen); - winCmapPriv(pColormap); - - /* Call the engine specific colormap destruction procedure */ - if (!((*pScreenPriv->pwinDestroyColormap) (pColormap))) - { - winErrorFVerb (2, "winDestroyColormap - Engine specific colormap destruction " - "procedure failed. Continuing, but it is possible that memory " - "was leaked, or that colors will be messed up from now on.\n"); - } - - /* Free the colormap privates */ - free (pCmapPriv); - winSetCmapPriv (pColormap, NULL); - -#if CYGDEBUG - winDebug ("winDestroyColormap - Returning\n"); -#endif -} - - -/* - * Internal function to load the palette used by the Shadow DIB - */ - -static Bool -winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap) -{ - winScreenPriv(pScreen); - int i; - Pixel pixel; /* Pixel == CARD32 */ - CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */ - UINT uiColorsRetrieved = 0; - RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES]; - - /* Get the color table for the screen */ - uiColorsRetrieved = GetDIBColorTable (pScreenPriv->hdcScreen, - 0, - WIN_NUM_PALETTE_ENTRIES, - rgbColors); - if (uiColorsRetrieved == 0) - { - ErrorF ("winGetPaletteDIB - Could not retrieve screen color table\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winGetPaletteDIB - Retrieved %d colors from DIB\n", - uiColorsRetrieved); -#endif - - /* Set the DIB color table to the default screen palette */ - if (SetDIBColorTable (pScreenPriv->hdcShadow, - 0, - uiColorsRetrieved, - rgbColors) == 0) - { - ErrorF ("winGetPaletteDIB - SetDIBColorTable () failed\n"); - return FALSE; - } - - /* Alloc each color in the DIB color table */ - for (i = 0; i < uiColorsRetrieved; ++i) - { - pixel = i; - - /* Extract the color values for current palette entry */ - nRed = rgbColors[i].rgbRed << 8; - nGreen = rgbColors[i].rgbGreen << 8; - nBlue = rgbColors[i].rgbBlue << 8; - -#if CYGDEBUG - winDebug ("winGetPaletteDIB - Allocating a color: %d; " - "%d %d %d\n", - pixel, nRed, nGreen, nBlue); -#endif - - /* Allocate a entry in the X colormap */ - if (AllocColor (pcmap, - &nRed, - &nGreen, - &nBlue, - &pixel, - 0) != Success) - { - ErrorF ("winGetPaletteDIB - AllocColor () failed, pixel %d\n", - i); - return FALSE; - } - - if (i != pixel - || nRed != rgbColors[i].rgbRed - || nGreen != rgbColors[i].rgbGreen - || nBlue != rgbColors[i].rgbBlue) - { - winDebug ("winGetPaletteDIB - Got: %d; " - "%d %d %d\n", - (int) pixel, nRed, nGreen, nBlue); - } - - /* FIXME: Not sure that this bit is needed at all */ - pcmap->red[i].co.local.red = nRed; - pcmap->red[i].co.local.green = nGreen; - pcmap->red[i].co.local.blue = nBlue; - } - - /* System is using a colormap */ - /* Set the black and white pixel indices */ - pScreen->whitePixel = uiColorsRetrieved - 1; - pScreen->blackPixel = 0; - - return TRUE; -} - - -/* - * Internal function to load the standard system palette being used by DD - */ - -static Bool -winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) -{ - int i; - Pixel pixel; /* Pixel == CARD32 */ - CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */ - UINT uiSystemPaletteEntries; - LPPALETTEENTRY ppeColors = NULL; - HDC hdc = NULL; - - /* Get a DC to obtain the default palette */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winGetPaletteDD - Couldn't get a DC\n"); - return FALSE; - } - - /* Get the number of entries in the system palette */ - uiSystemPaletteEntries = GetSystemPaletteEntries (hdc, - 0, 0, NULL); - if (uiSystemPaletteEntries == 0) - { - ErrorF ("winGetPaletteDD - Unable to determine number of " - "system palette entries\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winGetPaletteDD - uiSystemPaletteEntries %d\n", - uiSystemPaletteEntries); -#endif - - /* Allocate palette entries structure */ - ppeColors = malloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY)); - if (ppeColors == NULL) - { - ErrorF ("winGetPaletteDD - malloc () for colormap failed\n"); - return FALSE; - } - - /* Get system palette entries */ - GetSystemPaletteEntries (hdc, - 0, uiSystemPaletteEntries, ppeColors); - - /* Allocate an X colormap entry for every system palette entry */ - for (i = 0; i < uiSystemPaletteEntries; ++i) - { - pixel = i; - - /* Extract the color values for current palette entry */ - nRed = ppeColors[i].peRed << 8; - nGreen = ppeColors[i].peGreen << 8; - nBlue = ppeColors[i].peBlue << 8; -#if CYGDEBUG - winDebug ("winGetPaletteDD - Allocating a color: %d; " - "%d %d %d\n", - pixel, nRed, nGreen, nBlue); -#endif - if (AllocColor (pcmap, - &nRed, - &nGreen, - &nBlue, - &pixel, - 0) != Success) - { - ErrorF ("winGetPaletteDD - AllocColor () failed, pixel %d\n", - i); - free (ppeColors); - ppeColors = NULL; - return FALSE; - } - - pcmap->red[i].co.local.red = nRed; - pcmap->red[i].co.local.green = nGreen; - pcmap->red[i].co.local.blue = nBlue; - } - - /* System is using a colormap */ - /* Set the black and white pixel indices */ - pScreen->whitePixel = uiSystemPaletteEntries - 1; - pScreen->blackPixel = 0; - - /* Free colormap */ - if (ppeColors != NULL) - { - free (ppeColors); - ppeColors = NULL; - } - - /* Free the DC */ - if (hdc != NULL) - { - ReleaseDC (NULL, hdc); - hdc = NULL; - } - - return TRUE; -} - - -/* - * Install the standard fb colormap, or the GDI colormap, - * depending on the current screen depth. - */ - -Bool -winCreateDefColormap (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - unsigned short zero = 0, ones = 0xFFFF; - VisualPtr pVisual = pScreenPriv->pRootVisual; - ColormapPtr pcmap = NULL; - Pixel wp, bp; - -#if CYGDEBUG - winDebug ("winCreateDefColormap\n"); -#endif - - /* Use standard fb colormaps for non palettized color modes */ - if (pScreenInfo->dwBPP > 8) - { - winDebug ("winCreateDefColormap - Deferring to " \ - "fbCreateDefColormap ()\n"); - return fbCreateDefColormap (pScreen); - } - - /* - * AllocAll for non-Dynamic visual classes, - * AllocNone for Dynamic visual classes. - */ - - /* - * Dynamic visual classes allow the colors of the color map - * to be changed by clients. - */ - -#if CYGDEBUG - winDebug ("winCreateDefColormap - defColormap: %d\n", - pScreen->defColormap); -#endif - - /* Allocate an X colormap, owned by client 0 */ - if (CreateColormap (pScreen->defColormap, - pScreen, - pVisual, - &pcmap, - (pVisual->class & DynamicClass) ? AllocNone : AllocAll, - 0) != Success) - { - ErrorF ("winCreateDefColormap - CreateColormap failed\n"); - return FALSE; - } - if (pcmap == NULL) - { - ErrorF ("winCreateDefColormap - Colormap could not be created\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winCreateDefColormap - Created a colormap\n"); -#endif - - /* Branch on the visual class */ - if (!(pVisual->class & DynamicClass)) - { - /* Branch on engine type */ - if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI) - { - /* Load the colors being used by the Shadow DIB */ - if (!winGetPaletteDIB (pScreen, pcmap)) - { - ErrorF ("winCreateDefColormap - Couldn't get DIB colors\n"); - return FALSE; - } - } - else - { - /* Load the colors from the default system palette */ - if (!winGetPaletteDD (pScreen, pcmap)) - { - ErrorF ("winCreateDefColormap - Couldn't get colors " - "for DD\n"); - return FALSE; - } - } - } - else - { - wp = pScreen->whitePixel; - bp = pScreen->blackPixel; - - /* Allocate a black and white pixel */ - if ((AllocColor (pcmap, &ones, &ones, &ones, &wp, 0) != - Success) - || - (AllocColor (pcmap, &zero, &zero, &zero, &bp, 0) != - Success)) - { - ErrorF ("winCreateDefColormap - Couldn't allocate bp or wp\n"); - return FALSE; - } - - pScreen->whitePixel = wp; - pScreen->blackPixel = bp; - -#if 0 - /* Have to reserve first 10 and last ten pixels in DirectDraw windowed */ - if (pScreenInfo->dwEngine != WIN_SERVER_SHADOW_GDI) - { - int k; - Pixel p; - - for (k = 1; k < 10; ++k) - { - p = k; - if (AllocColor (pcmap, &ones, &ones, &ones, &p, 0) != Success) - FatalError ("Foo!\n"); - } - - for (k = 245; k < 255; ++k) - { - p = k; - if (AllocColor (pcmap, &zero, &zero, &zero, &p, 0) != Success) - FatalError ("Baz!\n"); - } - } -#endif - } - - /* Install the created colormap */ - (*pScreen->InstallColormap)(pcmap); - -#if CYGDEBUG - winDebug ("winCreateDefColormap - Returning\n"); -#endif - - return TRUE; -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * Local prototypes
+ */
+
+static int
+winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps);
+
+static void
+winStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
+
+static void
+winInstallColormap (ColormapPtr pmap);
+
+static void
+winUninstallColormap (ColormapPtr pmap);
+
+static void
+winResolveColor (unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue,
+ VisualPtr pVisual);
+
+static Bool
+winCreateColormap (ColormapPtr pmap);
+
+static void
+winDestroyColormap (ColormapPtr pmap);
+
+static Bool
+winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap);
+
+static Bool
+winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap);
+
+
+/*
+ * Set screen functions for colormaps
+ */
+
+void
+winSetColormapFunctions (ScreenPtr pScreen)
+{
+ pScreen->CreateColormap = winCreateColormap;
+ pScreen->DestroyColormap = winDestroyColormap;
+ pScreen->InstallColormap = winInstallColormap;
+ pScreen->UninstallColormap = winUninstallColormap;
+ pScreen->ListInstalledColormaps = winListInstalledColormaps;
+ pScreen->StoreColors = winStoreColors;
+ pScreen->ResolveColor = winResolveColor;
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+/*
+ * Walk the list of installed colormaps, filling the pmaps list
+ * with the resource ids of the installed maps, and return
+ * a count of the total number of installed maps.
+ */
+static int
+winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * There will only be one installed colormap, so we only need
+ * to return one id, and the count of installed maps will always
+ * be one.
+ */
+ *pmaps = pScreenPriv->pcmapInstalled->mid;
+ return 1;
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+/* See Programming Windows - p. 663 */
+static void
+winInstallColormap (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ ColormapPtr oldpmap = pScreenPriv->pcmapInstalled;
+
+#if CYGDEBUG
+ winDebug ("winInstallColormap\n");
+#endif
+
+ /* Did the colormap actually change? */
+ if (pColormap != oldpmap)
+ {
+#if CYGDEBUG
+ winDebug ("winInstallColormap - Colormap has changed, attempt "
+ "to install.\n");
+#endif
+
+ /* Was there a previous colormap? */
+ if (oldpmap != (ColormapPtr) None)
+ {
+ /* There was a previous colormap; tell clients it is gone */
+ WalkTree (pColormap->pScreen, TellLostMap, (char *)&oldpmap->mid);
+ }
+
+ /* Install new colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+ WalkTree (pColormap->pScreen, TellGainedMap, (char *)&pColormap->mid);
+
+ /* Call the engine specific colormap install procedure */
+ if (!((*pScreenPriv->pwinInstallColormap) (pColormap)))
+ {
+ winErrorFVerb (2, "winInstallColormap - Screen specific colormap install "
+ "procedure failed. Continuing, but colors may be "
+ "messed up from now on.\n");
+ }
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+static void
+winUninstallColormap (ColormapPtr pmap)
+{
+ winScreenPriv(pmap->pScreen);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+
+#if CYGDEBUG
+ winDebug ("winUninstallColormap\n");
+#endif
+
+ /* Is the colormap currently installed? */
+ if (pmap != curpmap)
+ {
+ /* Colormap not installed, nothing to do */
+ return;
+ }
+
+ /* Clear the installed colormap flag */
+ pScreenPriv->pcmapInstalled = NULL;
+
+ /*
+ * NOTE: The default colormap does not get "uninstalled" before
+ * it is destroyed.
+ */
+
+ /* Install the default cmap in place of the cmap to be uninstalled */
+ if (pmap->mid != pmap->pScreen->defColormap)
+ {
+ dixLookupResourceByType((pointer) &curpmap, pmap->pScreen->defColormap,
+ RT_COLORMAP, NullClient, DixUnknownAccess);
+ (*pmap->pScreen->InstallColormap) (curpmap);
+ }
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+static void
+winStoreColors (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pmap);
+ int i;
+ unsigned short nRed, nGreen, nBlue;
+
+#if CYGDEBUG
+ if (ndef != 1)
+ winDebug ("winStoreColors - ndef: %d\n",
+ ndef);
+#endif
+
+ /* Save the new colors in the colormap privates */
+ for (i = 0; i < ndef; ++i)
+ {
+ /* Adjust the colors from the X color spec to the Windows color spec */
+ nRed = pdefs[i].red >> 8;
+ nGreen = pdefs[i].green >> 8;
+ nBlue = pdefs[i].blue >> 8;
+
+ /* Copy the colors to a palette entry table */
+ pCmapPriv->peColors[pdefs[0].pixel + i].peRed = nRed;
+ pCmapPriv->peColors[pdefs[0].pixel + i].peGreen = nGreen;
+ pCmapPriv->peColors[pdefs[0].pixel + i].peBlue = nBlue;
+
+ /* Copy the colors to a RGBQUAD table */
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbRed = nRed;
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbGreen = nGreen;
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbBlue = nBlue;
+
+#if CYGDEBUG
+ winDebug ("winStoreColors - nRed %d nGreen %d nBlue %d\n",
+ nRed, nGreen, nBlue);
+#endif
+ }
+
+ /* Call the engine specific store colors procedure */
+ if (!((pScreenPriv->pwinStoreColors) (pmap, ndef, pdefs)))
+ {
+ winErrorFVerb (2, "winStoreColors - Engine cpecific color storage procedure "
+ "failed. Continuing, but colors may be messed up from now "
+ "on.\n");
+ }
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+static void
+winResolveColor (unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue,
+ VisualPtr pVisual)
+{
+#if CYGDEBUG
+ winDebug ("winResolveColor ()\n");
+#endif
+
+ miResolveColor (pred, pgreen, pblue, pVisual);
+}
+
+
+/* See Porting Layer Definition - p. 29 */
+static Bool
+winCreateColormap (ColormapPtr pmap)
+{
+ winPrivCmapPtr pCmapPriv = NULL;
+ ScreenPtr pScreen = pmap->pScreen;
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winDebug ("winCreateColormap\n");
+#endif
+
+ /* Allocate colormap privates */
+ if (!winAllocateCmapPrivates (pmap))
+ {
+ ErrorF ("winCreateColorma - Couldn't allocate cmap privates\n");
+ return FALSE;
+ }
+
+ /* Get a pointer to the newly allocated privates */
+ pCmapPriv = winGetCmapPriv (pmap);
+
+ /*
+ * FIXME: This is some evil hackery to help in handling some X clients
+ * that expect the top pixel to be white. This "help" only lasts until
+ * some client overwrites the top colormap entry.
+ *
+ * We don't want to actually allocate the top entry, as that causes
+ * problems with X clients that need 7 planes (128 colors) in the default
+ * colormap, such as Magic 7.1.
+ */
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbRed = 255;
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbGreen = 255;
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbBlue = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peRed = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peGreen = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peBlue = 255;
+
+ /* Call the engine specific colormap initialization procedure */
+ if (!((*pScreenPriv->pwinCreateColormap) (pmap)))
+ {
+ ErrorF ("winCreateColormap - Engine specific colormap creation "
+ "procedure failed. Aborting.\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 29, 30 */
+static void
+winDestroyColormap (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+
+ /* Call the engine specific colormap destruction procedure */
+ if (!((*pScreenPriv->pwinDestroyColormap) (pColormap)))
+ {
+ winErrorFVerb (2, "winDestroyColormap - Engine specific colormap destruction "
+ "procedure failed. Continuing, but it is possible that memory "
+ "was leaked, or that colors will be messed up from now on.\n");
+ }
+
+ /* Free the colormap privates */
+ free (pCmapPriv);
+ winSetCmapPriv (pColormap, NULL);
+
+#if CYGDEBUG
+ winDebug ("winDestroyColormap - Returning\n");
+#endif
+}
+
+
+/*
+ * Internal function to load the palette used by the Shadow DIB
+ */
+
+static Bool
+winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap)
+{
+ winScreenPriv(pScreen);
+ int i;
+ Pixel pixel; /* Pixel == CARD32 */
+ CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
+ UINT uiColorsRetrieved = 0;
+ RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
+
+ /* Get the color table for the screen */
+ uiColorsRetrieved = GetDIBColorTable (pScreenPriv->hdcScreen,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ rgbColors);
+ if (uiColorsRetrieved == 0)
+ {
+ ErrorF ("winGetPaletteDIB - Could not retrieve screen color table\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ winDebug ("winGetPaletteDIB - Retrieved %d colors from DIB\n",
+ uiColorsRetrieved);
+#endif
+
+ /* Set the DIB color table to the default screen palette */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ uiColorsRetrieved,
+ rgbColors) == 0)
+ {
+ ErrorF ("winGetPaletteDIB - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Alloc each color in the DIB color table */
+ for (i = 0; i < uiColorsRetrieved; ++i)
+ {
+ pixel = i;
+
+ /* Extract the color values for current palette entry */
+ nRed = rgbColors[i].rgbRed << 8;
+ nGreen = rgbColors[i].rgbGreen << 8;
+ nBlue = rgbColors[i].rgbBlue << 8;
+
+#if CYGDEBUG
+ winDebug ("winGetPaletteDIB - Allocating a color: %d; "
+ "%d %d %d\n",
+ pixel, nRed, nGreen, nBlue);
+#endif
+
+ /* Allocate a entry in the X colormap */
+ if (AllocColor (pcmap,
+ &nRed,
+ &nGreen,
+ &nBlue,
+ &pixel,
+ 0) != Success)
+ {
+ ErrorF ("winGetPaletteDIB - AllocColor () failed, pixel %d\n",
+ i);
+ return FALSE;
+ }
+
+ if (i != pixel
+ || nRed != rgbColors[i].rgbRed
+ || nGreen != rgbColors[i].rgbGreen
+ || nBlue != rgbColors[i].rgbBlue)
+ {
+ winDebug ("winGetPaletteDIB - Got: %d; "
+ "%d %d %d\n",
+ (int) pixel, nRed, nGreen, nBlue);
+ }
+
+ /* FIXME: Not sure that this bit is needed at all */
+ pcmap->red[i].co.local.red = nRed;
+ pcmap->red[i].co.local.green = nGreen;
+ pcmap->red[i].co.local.blue = nBlue;
+ }
+
+ /* System is using a colormap */
+ /* Set the black and white pixel indices */
+ pScreen->whitePixel = uiColorsRetrieved - 1;
+ pScreen->blackPixel = 0;
+
+ return TRUE;
+}
+
+
+/*
+ * Internal function to load the standard system palette being used by DD
+ */
+
+static Bool
+winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap)
+{
+ int i;
+ Pixel pixel; /* Pixel == CARD32 */
+ CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
+ UINT uiSystemPaletteEntries;
+ LPPALETTEENTRY ppeColors = NULL;
+ HDC hdc = NULL;
+
+ /* Get a DC to obtain the default palette */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winGetPaletteDD - Couldn't get a DC\n");
+ return FALSE;
+ }
+
+ /* Get the number of entries in the system palette */
+ uiSystemPaletteEntries = GetSystemPaletteEntries (hdc,
+ 0, 0, NULL);
+ if (uiSystemPaletteEntries == 0)
+ {
+ ErrorF ("winGetPaletteDD - Unable to determine number of "
+ "system palette entries\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ winDebug ("winGetPaletteDD - uiSystemPaletteEntries %d\n",
+ uiSystemPaletteEntries);
+#endif
+
+ /* Allocate palette entries structure */
+ ppeColors = malloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY));
+ if (ppeColors == NULL)
+ {
+ ErrorF ("winGetPaletteDD - malloc () for colormap failed\n");
+ return FALSE;
+ }
+
+ /* Get system palette entries */
+ GetSystemPaletteEntries (hdc,
+ 0, uiSystemPaletteEntries, ppeColors);
+
+ /* Allocate an X colormap entry for every system palette entry */
+ for (i = 0; i < uiSystemPaletteEntries; ++i)
+ {
+ pixel = i;
+
+ /* Extract the color values for current palette entry */
+ nRed = ppeColors[i].peRed << 8;
+ nGreen = ppeColors[i].peGreen << 8;
+ nBlue = ppeColors[i].peBlue << 8;
+#if CYGDEBUG
+ winDebug ("winGetPaletteDD - Allocating a color: %d; "
+ "%d %d %d\n",
+ pixel, nRed, nGreen, nBlue);
+#endif
+ if (AllocColor (pcmap,
+ &nRed,
+ &nGreen,
+ &nBlue,
+ &pixel,
+ 0) != Success)
+ {
+ ErrorF ("winGetPaletteDD - AllocColor () failed, pixel %d\n",
+ i);
+ free (ppeColors);
+ ppeColors = NULL;
+ return FALSE;
+ }
+
+ pcmap->red[i].co.local.red = nRed;
+ pcmap->red[i].co.local.green = nGreen;
+ pcmap->red[i].co.local.blue = nBlue;
+ }
+
+ /* System is using a colormap */
+ /* Set the black and white pixel indices */
+ pScreen->whitePixel = uiSystemPaletteEntries - 1;
+ pScreen->blackPixel = 0;
+
+ /* Free colormap */
+ free(ppeColors);
+ ppeColors = NULL;
+
+ /* Free the DC */
+ if (hdc != NULL)
+ {
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Install the standard fb colormap, or the GDI colormap,
+ * depending on the current screen depth.
+ */
+
+Bool
+winCreateDefColormap (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ unsigned short zero = 0, ones = 0xFFFF;
+ VisualPtr pVisual = pScreenPriv->pRootVisual;
+ ColormapPtr pcmap = NULL;
+ Pixel wp, bp;
+
+#if CYGDEBUG
+ winDebug ("winCreateDefColormap\n");
+#endif
+
+ /* Use standard fb colormaps for non palettized color modes */
+ if (pScreenInfo->dwBPP > 8)
+ {
+ winDebug ("winCreateDefColormap - Deferring to " \
+ "fbCreateDefColormap ()\n");
+ return fbCreateDefColormap (pScreen);
+ }
+
+ /*
+ * AllocAll for non-Dynamic visual classes,
+ * AllocNone for Dynamic visual classes.
+ */
+
+ /*
+ * Dynamic visual classes allow the colors of the color map
+ * to be changed by clients.
+ */
+
+#if CYGDEBUG
+ winDebug ("winCreateDefColormap - defColormap: %d\n",
+ pScreen->defColormap);
+#endif
+
+ /* Allocate an X colormap, owned by client 0 */
+ if (CreateColormap (pScreen->defColormap,
+ pScreen,
+ pVisual,
+ &pcmap,
+ (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
+ 0) != Success)
+ {
+ ErrorF ("winCreateDefColormap - CreateColormap failed\n");
+ return FALSE;
+ }
+ if (pcmap == NULL)
+ {
+ ErrorF ("winCreateDefColormap - Colormap could not be created\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ winDebug ("winCreateDefColormap - Created a colormap\n");
+#endif
+
+ /* Branch on the visual class */
+ if (!(pVisual->class & DynamicClass))
+ {
+ /* Branch on engine type */
+ if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI)
+ {
+ /* Load the colors being used by the Shadow DIB */
+ if (!winGetPaletteDIB (pScreen, pcmap))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't get DIB colors\n");
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* Load the colors from the default system palette */
+ if (!winGetPaletteDD (pScreen, pcmap))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't get colors "
+ "for DD\n");
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ wp = pScreen->whitePixel;
+ bp = pScreen->blackPixel;
+
+ /* Allocate a black and white pixel */
+ if ((AllocColor (pcmap, &ones, &ones, &ones, &wp, 0) !=
+ Success)
+ ||
+ (AllocColor (pcmap, &zero, &zero, &zero, &bp, 0) !=
+ Success))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't allocate bp or wp\n");
+ return FALSE;
+ }
+
+ pScreen->whitePixel = wp;
+ pScreen->blackPixel = bp;
+
+#if 0
+ /* Have to reserve first 10 and last ten pixels in DirectDraw windowed */
+ if (pScreenInfo->dwEngine != WIN_SERVER_SHADOW_GDI)
+ {
+ int k;
+ Pixel p;
+
+ for (k = 1; k < 10; ++k)
+ {
+ p = k;
+ if (AllocColor (pcmap, &ones, &ones, &ones, &p, 0) != Success)
+ FatalError ("Foo!\n");
+ }
+
+ for (k = 245; k < 255; ++k)
+ {
+ p = k;
+ if (AllocColor (pcmap, &zero, &zero, &zero, &p, 0) != Success)
+ FatalError ("Baz!\n");
+ }
+ }
+#endif
+ }
+
+ /* Install the created colormap */
+ (*pScreen->InstallColormap)(pcmap);
+
+#if CYGDEBUG
+ winDebug ("winCreateDefColormap - Returning\n");
+#endif
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c index d6cb109ea..e0c07809c 100644 --- a/xorg-server/hw/xwin/winmouse.c +++ b/xorg-server/hw/xwin/winmouse.c @@ -235,13 +235,15 @@ winMouseButtonsSendEvent (int iEventType, int iButton) {
EventListPtr events;
int i, nevents;
+ ValuatorMask mask;
if (g_winMouseButtonMap)
iButton = g_winMouseButtonMap[iButton];
+ valuator_mask_zero(&mask);
GetEventList(&events);
nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton,
- POINTER_RELATIVE, 0, 0, NULL);
+ POINTER_RELATIVE, &mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
@@ -366,15 +368,17 @@ void winEnqueueMotion(int x, int y) {
int i, nevents;
int valuators[2];
+ ValuatorMask mask;
EventListPtr events;
miPointerSetPosition(g_pwinPointer, &x, &y);
valuators[0] = x;
valuators[1] = y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
GetEventList(&events);
nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
- POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
diff --git a/xorg-server/hw/xwin/winpixmap.c b/xorg-server/hw/xwin/winpixmap.c index 050c71a7f..82b6bbb5c 100644 --- a/xorg-server/hw/xwin/winpixmap.c +++ b/xorg-server/hw/xwin/winpixmap.c @@ -1,235 +1,232 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: drewry, september 1986 - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * Local prototypes - */ - -#if 0 -static void -winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw); - -static void -winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh); - -static void -winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix, - int xrot, int yrot); -#endif - - -/* See Porting Layer Definition - p. 34 */ -/* See mfb/mfbpixmap.c - mfbCreatePixmap() */ -PixmapPtr -winCreatePixmapNativeGDI (ScreenPtr pScreen, - int iWidth, int iHeight, - int iDepth, unsigned usage_hint) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - PixmapPtr pPixmap = NULL; - - /* Allocate pixmap memory */ - pPixmap = AllocatePixmap (pScreen, 0); - if (!pPixmap) - { - ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n"); - return NullPixmap; - } - -#if CYGDEBUG - winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n", - iWidth, iHeight, iDepth, usage_hint, - PixmapBytePad (iWidth, iDepth)); -#endif - - /* Setup pixmap values */ - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = iDepth; - pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth); - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = iWidth; - pPixmap->drawable.height = iHeight; - pPixmap->devKind = 0; - pPixmap->refcnt = 1; - pPixmap->devPrivate.ptr = NULL; - pPixmap->usage_hint = usage_hint; - - /* Pixmap privates are allocated by AllocatePixmap */ - pPixmapPriv = winGetPixmapPriv (pPixmap); - - /* Initialize pixmap privates */ - pPixmapPriv->hBitmap = NULL; - pPixmapPriv->hdcSelected = NULL; - pPixmapPriv->pbBits = NULL; - pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth); - - /* Check for zero width or height pixmaps */ - if (iWidth == 0 || iHeight == 0) - { - /* Don't allocate a real pixmap, just set fields and return */ - return pPixmap; - } - - /* Create a DIB for the pixmap */ - pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth, - &pPixmapPriv->pbBits, - (BITMAPINFO **) &pPixmapPriv->pbmih); - -#if CYGDEBUG - winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \ - "screen: %08x\n", - pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen); -#endif - - return pPixmap; -} - - -/* - * See Porting Layer Definition - p. 35 - * - * See mfb/mfbpixmap.c - mfbDestroyPixmap() - */ - -Bool -winDestroyPixmapNativeGDI (PixmapPtr pPixmap) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - -#if CYGDEBUG - winDebug ("winDestroyPixmapNativeGDI ()\n"); -#endif - - /* Bail early if there is not a pixmap to destroy */ - if (pPixmap == NULL) - { - ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n"); - return TRUE; - } - - /* Get a handle to the pixmap privates */ - pPixmapPriv = winGetPixmapPriv (pPixmap); - -#if CYGDEBUG - winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n", - pPixmapPriv->hBitmap); -#endif - - /* Decrement reference count, return if nonzero */ - --pPixmap->refcnt; - if (pPixmap->refcnt != 0) - return TRUE; - - /* Free GDI bitmap */ - if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap); - - /* Free the bitmap info header memory */ - if (pPixmapPriv->pbmih != NULL) - { - free (pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - } - - /* Free the pixmap memory */ - free (pPixmap); - pPixmap = NULL; - - return TRUE; -} - - -/* - * Not used yet - */ - -Bool -winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, - int iWidth, int iHeight, - int iDepth, - int iBitsPerPixel, - int devKind, - pointer pPixData) -{ - FatalError ("winModifyPixmapHeaderNativeGDI ()\n"); - return TRUE; -} - - -#if 0 -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ - -static void -winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw) -{ - ErrorF ("winXRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} - - -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ -static void -winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh) -{ - ErrorF ("winYRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} - - -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ - -static void -winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix, - int xrot, int yrot) -{ - ErrorF ("winCopyRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} -#endif +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: drewry, september 1986
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * Local prototypes
+ */
+
+#if 0
+static void
+winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw);
+
+static void
+winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh);
+
+static void
+winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
+ int xrot, int yrot);
+#endif
+
+
+/* See Porting Layer Definition - p. 34 */
+/* See mfb/mfbpixmap.c - mfbCreatePixmap() */
+PixmapPtr
+winCreatePixmapNativeGDI (ScreenPtr pScreen,
+ int iWidth, int iHeight,
+ int iDepth, unsigned usage_hint)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ PixmapPtr pPixmap = NULL;
+
+ /* Allocate pixmap memory */
+ pPixmap = AllocatePixmap (pScreen, 0);
+ if (!pPixmap)
+ {
+ ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n");
+ return NullPixmap;
+ }
+
+#if CYGDEBUG
+ winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
+ iWidth, iHeight, iDepth, usage_hint,
+ PixmapBytePad (iWidth, iDepth));
+#endif
+
+ /* Setup pixmap values */
+ pPixmap->drawable.type = DRAWABLE_PIXMAP;
+ pPixmap->drawable.class = 0;
+ pPixmap->drawable.pScreen = pScreen;
+ pPixmap->drawable.depth = iDepth;
+ pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
+ pPixmap->drawable.id = 0;
+ pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pPixmap->drawable.x = 0;
+ pPixmap->drawable.y = 0;
+ pPixmap->drawable.width = iWidth;
+ pPixmap->drawable.height = iHeight;
+ pPixmap->devKind = 0;
+ pPixmap->refcnt = 1;
+ pPixmap->devPrivate.ptr = NULL;
+ pPixmap->usage_hint = usage_hint;
+
+ /* Pixmap privates are allocated by AllocatePixmap */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Initialize pixmap privates */
+ pPixmapPriv->hBitmap = NULL;
+ pPixmapPriv->hdcSelected = NULL;
+ pPixmapPriv->pbBits = NULL;
+ pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth);
+
+ /* Check for zero width or height pixmaps */
+ if (iWidth == 0 || iHeight == 0)
+ {
+ /* Don't allocate a real pixmap, just set fields and return */
+ return pPixmap;
+ }
+
+ /* Create a DIB for the pixmap */
+ pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth,
+ &pPixmapPriv->pbBits,
+ (BITMAPINFO **) &pPixmapPriv->pbmih);
+
+#if CYGDEBUG
+ winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
+ "screen: %08x\n",
+ pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
+#endif
+
+ return pPixmap;
+}
+
+
+/*
+ * See Porting Layer Definition - p. 35
+ *
+ * See mfb/mfbpixmap.c - mfbDestroyPixmap()
+ */
+
+Bool
+winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+
+#if CYGDEBUG
+ winDebug ("winDestroyPixmapNativeGDI ()\n");
+#endif
+
+ /* Bail early if there is not a pixmap to destroy */
+ if (pPixmap == NULL)
+ {
+ ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n");
+ return TRUE;
+ }
+
+ /* Get a handle to the pixmap privates */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+#if CYGDEBUG
+ winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
+ pPixmapPriv->hBitmap);
+#endif
+
+ /* Decrement reference count, return if nonzero */
+ --pPixmap->refcnt;
+ if (pPixmap->refcnt != 0)
+ return TRUE;
+
+ /* Free GDI bitmap */
+ if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
+
+ /* Free the bitmap info header memory */
+ free(pPixmapPriv->pbmih);
+ pPixmapPriv->pbmih = NULL;
+
+ /* Free the pixmap memory */
+ free (pPixmap);
+ pPixmap = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Not used yet
+ */
+
+Bool
+winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
+ int iWidth, int iHeight,
+ int iDepth,
+ int iBitsPerPixel,
+ int devKind,
+ pointer pPixData)
+{
+ FatalError ("winModifyPixmapHeaderNativeGDI ()\n");
+ return TRUE;
+}
+
+
+#if 0
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+
+static void
+winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw)
+{
+ ErrorF ("winXRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
+
+
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+static void
+winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh)
+{
+ ErrorF ("winYRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
+
+
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+
+static void
+winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
+ int xrot, int yrot)
+{
+ ErrorF ("winCopyRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
+#endif
diff --git a/xorg-server/include/Makefile.am b/xorg-server/include/Makefile.am index e76de05c3..21f9358d5 100644 --- a/xorg-server/include/Makefile.am +++ b/xorg-server/include/Makefile.am @@ -1,72 +1,72 @@ -if XORG -sdk_HEADERS = \ - XIstubs.h \ - bstore.h \ - bstorestr.h \ - callback.h \ - closestr.h \ - closure.h \ - colormap.h \ - colormapst.h \ - hotplug.h \ - cursor.h \ - cursorstr.h \ - dix.h \ - dixaccess.h \ - dixevents.h \ - dixfont.h \ - dixfontstr.h \ - dixgrabs.h \ - dixstruct.h \ - events.h \ - exevents.h \ - extension.h \ - extinit.h \ - extnsionst.h \ - gc.h \ - gcstruct.h \ - globals.h \ - input.h \ - inputstr.h \ - list.h \ - misc.h \ - miscstruct.h \ - opaque.h \ - os.h \ - pixmap.h \ - pixmapstr.h \ - privates.h \ - property.h \ - propertyst.h \ - ptrveloc.h \ - region.h \ - regionstr.h \ - registry.h \ - resource.h \ - rgb.h \ - screenint.h \ - scrnintstr.h \ - selection.h \ - servermd.h \ - site.h \ - swaprep.h \ - swapreq.h \ - validate.h \ - window.h \ - windowstr.h \ - xkbfile.h \ - xkbsrv.h \ - xkbstr.h \ - xkbrules.h \ - xserver-properties.h - -nodist_sdk_HEADERS = xorg-server.h -endif - -AM_CFLAGS = $(DIX_CFLAGS) - -EXTRA_DIST = \ - dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h \ - protocol-versions.h \ - xsha1.h +if XORG
+sdk_HEADERS = \
+ XIstubs.h \
+ bstore.h \
+ bstorestr.h \
+ callback.h \
+ closestr.h \
+ closure.h \
+ colormap.h \
+ colormapst.h \
+ hotplug.h \
+ cursor.h \
+ cursorstr.h \
+ dix.h \
+ dixaccess.h \
+ dixevents.h \
+ dixfont.h \
+ dixfontstr.h \
+ dixgrabs.h \
+ dixstruct.h \
+ events.h \
+ exevents.h \
+ extension.h \
+ extinit.h \
+ extnsionst.h \
+ gc.h \
+ gcstruct.h \
+ globals.h \
+ input.h \
+ inputstr.h \
+ list.h \
+ misc.h \
+ miscstruct.h \
+ opaque.h \
+ os.h \
+ pixmap.h \
+ pixmapstr.h \
+ privates.h \
+ property.h \
+ propertyst.h \
+ ptrveloc.h \
+ region.h \
+ regionstr.h \
+ registry.h \
+ resource.h \
+ rgb.h \
+ screenint.h \
+ scrnintstr.h \
+ selection.h \
+ servermd.h \
+ site.h \
+ swaprep.h \
+ swapreq.h \
+ validate.h \
+ window.h \
+ windowstr.h \
+ xkbfile.h \
+ xkbsrv.h \
+ xkbstr.h \
+ xkbrules.h \
+ xserver-properties.h
+
+nodist_sdk_HEADERS = xorg-server.h
+endif
+
+AM_CFLAGS = $(DIX_CFLAGS)
+
+EXTRA_DIST = \
+ dix-config-apple-verbatim.h \
+ eventconvert.h eventstr.h inpututils.h \
+ protocol-versions.h \
+ xsha1.h
diff --git a/xorg-server/include/XIstubs.h b/xorg-server/include/XIstubs.h index ba2f861cd..380f8d8f2 100644 --- a/xorg-server/include/XIstubs.h +++ b/xorg-server/include/XIstubs.h @@ -1,63 +1,49 @@ -/************************************************************ - -Copyright 1996 by Thomas E. Dickey <dickey@clark.net> - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -#ifndef XI_STUBS_H -#define XI_STUBS_H 1 - -extern _X_EXPORT void -CloseInputDevice ( - DeviceIntPtr /* d */, - ClientPtr /* client */); - -extern _X_EXPORT void -AddOtherInputDevices (void); - -extern _X_EXPORT void -OpenInputDevice ( - DeviceIntPtr /* dev */, - ClientPtr /* client */, - int * /* status */); - -extern _X_EXPORT int -SetDeviceMode ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* mode */); - -extern _X_EXPORT int -SetDeviceValuators ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int * /* valuators */, - int /* first_valuator */, - int /* num_valuators */); - -extern _X_EXPORT int -ChangeDeviceControl ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - xDeviceCtl * /* control */); - -#endif /* XI_STUBS_H */ +/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of the above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef XI_STUBS_H
+#define XI_STUBS_H 1
+
+extern _X_EXPORT int
+SetDeviceMode (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* mode */);
+
+extern _X_EXPORT int
+SetDeviceValuators (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int * /* valuators */,
+ int /* first_valuator */,
+ int /* num_valuators */);
+
+extern _X_EXPORT int
+ChangeDeviceControl (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ xDeviceCtl * /* control */);
+
+#endif /* XI_STUBS_H */
diff --git a/xorg-server/include/exevents.h b/xorg-server/include/exevents.h index 39e1c70fe..b972cbedf 100644 --- a/xorg-server/include/exevents.h +++ b/xorg-server/include/exevents.h @@ -1,315 +1,312 @@ -/************************************************************ - -Copyright 1996 by Thomas E. Dickey <dickey@clark.net> - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/******************************************************************** - * Interface of 'exevents.c' - */ - -#ifndef EXEVENTS_H -#define EXEVENTS_H - -#include <X11/extensions/XIproto.h> -#include "inputstr.h" - -/*************************************************************** - * Interface available to drivers * - ***************************************************************/ - -extern _X_EXPORT int InitProximityClassDeviceStruct( - DeviceIntPtr /* dev */); - -extern _X_EXPORT void InitValuatorAxisStruct( - DeviceIntPtr /* dev */, - int /* axnum */, - Atom /* label */, - int /* minval */, - int /* maxval */, - int /* resolution */, - int /* min_res */, - int /* max_res */); - -/* Input device properties */ -extern _X_EXPORT void XIDeleteAllDeviceProperties( - DeviceIntPtr /* device */ -); - -extern _X_EXPORT int XIDeleteDeviceProperty( - DeviceIntPtr /* device */, - Atom /* property */, - Bool /* fromClient */ -); - -extern _X_EXPORT int XIChangeDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - Atom /* type */, - int /* format*/, - int /* mode*/, - unsigned long /* len*/, - pointer /* value*/, - Bool /* sendevent*/ - ); - -extern _X_EXPORT int XIGetDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - XIPropertyValuePtr* /* value */ -); - -extern _X_EXPORT int XISetDevicePropertyDeletable( - DeviceIntPtr /* dev */, - Atom /* property */, - Bool /* deletable */ -); - -extern _X_EXPORT long XIRegisterPropertyHandler( - DeviceIntPtr dev, - int (*SetProperty) (DeviceIntPtr dev, - Atom property, - XIPropertyValuePtr prop, - BOOL checkonly), - int (*GetProperty) (DeviceIntPtr dev, - Atom property), - int (*DeleteProperty) (DeviceIntPtr dev, - Atom property) -); - -extern _X_EXPORT void XIUnregisterPropertyHandler( - DeviceIntPtr dev, - long id -); - -extern _X_EXPORT Atom XIGetKnownProperty( - char* name -); - -extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev); - -extern _X_EXPORT int XIPropToInt( - XIPropertyValuePtr val, - int *nelem_return, - int **buf_return -); - -extern _X_EXPORT int XIPropToFloat( - XIPropertyValuePtr val, - int *nelem_return, - float **buf_return -); - -/**************************************************************************** - * End of driver interface * - ****************************************************************************/ - - -/** - * Attached to the devPrivates of each client. Specifies the version number as - * supported by the client. - */ -typedef struct _XIClientRec { - int major_version; - int minor_version; -} XIClientRec, *XIClientPtr; - - -typedef struct _GrabParameters { - int grabtype; /* GRABTYPE_CORE, etc. */ - unsigned int ownerEvents; - unsigned int this_device_mode; - unsigned int other_devices_mode; - Window grabWindow; - Window confineTo; - Cursor cursor; - unsigned int modifiers; -} GrabParameters; - - -extern void -RegisterOtherDevice ( - DeviceIntPtr /* device */); - -extern int -UpdateDeviceState ( - DeviceIntPtr /* device */, - DeviceEvent* /* xE */); - -extern void -ProcessOtherEvent ( - InternalEvent* /* ev */, - DeviceIntPtr /* other */); - -extern void -DeviceFocusEvent( - DeviceIntPtr /* dev */, - int /* type */, - int /* mode */, - int /* detail */, - WindowPtr /* pWin */); - -extern int -CheckGrabValues( - ClientPtr /* client */, - GrabParameters* /* param */); - -extern int -GrabButton( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - DeviceIntPtr /* modifier_device */, - int /* button */, - GrabParameters* /* param */, - GrabType /* grabtype */, - GrabMask* /* eventMask */); - -extern int -GrabKey( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - DeviceIntPtr /* modifier_device */, - int /* key */, - GrabParameters* /* param */, - GrabType /* grabtype */, - GrabMask* /* eventMask */); - -extern int -GrabWindow( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* type */, - GrabParameters* /* param */, - GrabMask* /* eventMask */); - -extern int -SelectForWindow( - DeviceIntPtr /* dev */, - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - Mask /* exclusivemasks */); - -extern int -AddExtensionClient ( - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - int /* mskidx */); - -extern void -RecalculateDeviceDeliverableEvents( - WindowPtr /* pWin */); - -extern int -InputClientGone( - WindowPtr /* pWin */, - XID /* id */); - -extern int -SendEvent ( - ClientPtr /* client */, - DeviceIntPtr /* d */, - Window /* dest */, - Bool /* propagate */, - xEvent * /* ev */, - Mask /* mask */, - int /* count */); - -extern int -SetButtonMapping ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* nElts */, - BYTE * /* map */); - -extern int -ChangeKeyMapping( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - unsigned /* len */, - int /* type */, - KeyCode /* firstKeyCode */, - CARD8 /* keyCodes */, - CARD8 /* keySymsPerKeyCode */, - KeySym * /* map */); - -extern void -DeleteWindowFromAnyExtEvents( - WindowPtr /* pWin */, - Bool /* freeResources */); - -extern int -MaybeSendDeviceMotionNotifyHint ( - deviceKeyButtonPointer * /* pEvents */, - Mask /* mask */); - -extern void -CheckDeviceGrabAndHintWindow ( - WindowPtr /* pWin */, - int /* type */, - deviceKeyButtonPointer * /* xE */, - GrabPtr /* grab */, - ClientPtr /* client */, - Mask /* deliveryMask */); - -extern void -MaybeStopDeviceHint( - DeviceIntPtr /* dev */, - ClientPtr /* client */); - -extern int -DeviceEventSuppressForWindow( - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - int /* maskndx */); - -extern void -SendEventToAllWindows( - DeviceIntPtr /* dev */, - Mask /* mask */, - xEvent * /* ev */, - int /* count */); - -extern _X_HIDDEN void XI2EventSwap( - xGenericEvent * /* from */, - xGenericEvent * /* to */); - -/* For an event such as MappingNotify which affects client interpretation - * of input events sent by device dev, should we notify the client, or - * would it merely be irrelevant and confusing? */ -extern int -XIShouldNotify(ClientPtr client, DeviceIntPtr dev); - -extern void -XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, - DeviceChangedEvent *dce); - -extern int -XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, - unsigned int len, unsigned char* mask); - -extern int -XICheckInvalidMaskBits(unsigned char *mask, int len); - -#endif /* EXEVENTS_H */ +/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of the above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+/********************************************************************
+ * Interface of 'exevents.c'
+ */
+
+#ifndef EXEVENTS_H
+#define EXEVENTS_H
+
+#include <X11/extensions/XIproto.h>
+#include "inputstr.h"
+
+/***************************************************************
+ * Interface available to drivers *
+ ***************************************************************/
+
+extern _X_EXPORT int InitProximityClassDeviceStruct(
+ DeviceIntPtr /* dev */);
+
+extern _X_EXPORT void InitValuatorAxisStruct(
+ DeviceIntPtr /* dev */,
+ int /* axnum */,
+ Atom /* label */,
+ int /* minval */,
+ int /* maxval */,
+ int /* resolution */,
+ int /* min_res */,
+ int /* max_res */,
+ int /* mode */);
+
+/* Input device properties */
+extern _X_EXPORT void XIDeleteAllDeviceProperties(
+ DeviceIntPtr /* device */
+);
+
+extern _X_EXPORT int XIDeleteDeviceProperty(
+ DeviceIntPtr /* device */,
+ Atom /* property */,
+ Bool /* fromClient */
+);
+
+extern _X_EXPORT int XIChangeDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Atom /* type */,
+ int /* format*/,
+ int /* mode*/,
+ unsigned long /* len*/,
+ pointer /* value*/,
+ Bool /* sendevent*/
+ );
+
+extern _X_EXPORT int XIGetDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ XIPropertyValuePtr* /* value */
+);
+
+extern _X_EXPORT int XISetDevicePropertyDeletable(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Bool /* deletable */
+);
+
+extern _X_EXPORT long XIRegisterPropertyHandler(
+ DeviceIntPtr dev,
+ int (*SetProperty) (DeviceIntPtr dev,
+ Atom property,
+ XIPropertyValuePtr prop,
+ BOOL checkonly),
+ int (*GetProperty) (DeviceIntPtr dev,
+ Atom property),
+ int (*DeleteProperty) (DeviceIntPtr dev,
+ Atom property)
+);
+
+extern _X_EXPORT void XIUnregisterPropertyHandler(
+ DeviceIntPtr dev,
+ long id
+);
+
+extern _X_EXPORT Atom XIGetKnownProperty(
+ char* name
+);
+
+extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
+
+extern _X_EXPORT int XIPropToInt(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ int **buf_return
+);
+
+extern _X_EXPORT int XIPropToFloat(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ float **buf_return
+);
+
+/****************************************************************************
+ * End of driver interface *
+ ****************************************************************************/
+
+
+/**
+ * Attached to the devPrivates of each client. Specifies the version number as
+ * supported by the client.
+ */
+typedef struct _XIClientRec {
+ int major_version;
+ int minor_version;
+} XIClientRec, *XIClientPtr;
+
+
+typedef struct _GrabParameters {
+ int grabtype; /* GRABTYPE_CORE, etc. */
+ unsigned int ownerEvents;
+ unsigned int this_device_mode;
+ unsigned int other_devices_mode;
+ Window grabWindow;
+ Window confineTo;
+ Cursor cursor;
+ unsigned int modifiers;
+} GrabParameters;
+
+
+extern int
+UpdateDeviceState (
+ DeviceIntPtr /* device */,
+ DeviceEvent* /* xE */);
+
+extern void
+ProcessOtherEvent (
+ InternalEvent* /* ev */,
+ DeviceIntPtr /* other */);
+
+extern void
+DeviceFocusEvent(
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ int /* mode */,
+ int /* detail */,
+ WindowPtr /* pWin */);
+
+extern int
+CheckGrabValues(
+ ClientPtr /* client */,
+ GrabParameters* /* param */);
+
+extern int
+GrabButton(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* button */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabKey(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* key */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabWindow(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ GrabParameters* /* param */,
+ GrabMask* /* eventMask */);
+
+extern int
+SelectForWindow(
+ DeviceIntPtr /* dev */,
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ Mask /* exclusivemasks */);
+
+extern int
+AddExtensionClient (
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* mskidx */);
+
+extern void
+RecalculateDeviceDeliverableEvents(
+ WindowPtr /* pWin */);
+
+extern int
+InputClientGone(
+ WindowPtr /* pWin */,
+ XID /* id */);
+
+extern int
+SendEvent (
+ ClientPtr /* client */,
+ DeviceIntPtr /* d */,
+ Window /* dest */,
+ Bool /* propagate */,
+ xEvent * /* ev */,
+ Mask /* mask */,
+ int /* count */);
+
+extern int
+SetButtonMapping (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* nElts */,
+ BYTE * /* map */);
+
+extern int
+ChangeKeyMapping(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ unsigned /* len */,
+ int /* type */,
+ KeyCode /* firstKeyCode */,
+ CARD8 /* keyCodes */,
+ CARD8 /* keySymsPerKeyCode */,
+ KeySym * /* map */);
+
+extern void
+DeleteWindowFromAnyExtEvents(
+ WindowPtr /* pWin */,
+ Bool /* freeResources */);
+
+extern int
+MaybeSendDeviceMotionNotifyHint (
+ deviceKeyButtonPointer * /* pEvents */,
+ Mask /* mask */);
+
+extern void
+CheckDeviceGrabAndHintWindow (
+ WindowPtr /* pWin */,
+ int /* type */,
+ deviceKeyButtonPointer * /* xE */,
+ GrabPtr /* grab */,
+ ClientPtr /* client */,
+ Mask /* deliveryMask */);
+
+extern void
+MaybeStopDeviceHint(
+ DeviceIntPtr /* dev */,
+ ClientPtr /* client */);
+
+extern int
+DeviceEventSuppressForWindow(
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* maskndx */);
+
+extern void
+SendEventToAllWindows(
+ DeviceIntPtr /* dev */,
+ Mask /* mask */,
+ xEvent * /* ev */,
+ int /* count */);
+
+extern _X_HIDDEN void XI2EventSwap(
+ xGenericEvent * /* from */,
+ xGenericEvent * /* to */);
+
+/* For an event such as MappingNotify which affects client interpretation
+ * of input events sent by device dev, should we notify the client, or
+ * would it merely be irrelevant and confusing? */
+extern int
+XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
+
+extern void
+XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
+ DeviceChangedEvent *dce);
+
+extern int
+XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
+ unsigned int len, unsigned char* mask);
+
+extern int
+XICheckInvalidMaskBits(unsigned char *mask, int len);
+
+#endif /* EXEVENTS_H */
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h index 1930a308b..a7fdc6671 100644 --- a/xorg-server/include/input.h +++ b/xorg-server/include/input.h @@ -157,6 +157,8 @@ typedef struct _DeviceRec { Bool on; /* used by DDX to keep state */
} DeviceRec, *DevicePtr;
+typedef struct _ValuatorMask ValuatorMask;
+
typedef struct {
int click, bell, bell_pitch, bell_duration;
Bool autoRepeat;
@@ -274,12 +276,6 @@ extern _X_EXPORT int RemoveDevice( extern _X_EXPORT int NumMotionEvents(void);
-extern void RegisterPointerDevice(
- DeviceIntPtr /*device*/);
-
-extern void RegisterKeyboardDevice(
- DeviceIntPtr /*device*/);
-
extern _X_EXPORT int dixLookupDevice(
DeviceIntPtr * /* dev */,
int /* id */,
@@ -451,9 +447,7 @@ extern _X_EXPORT int GetPointerEvents( int type,
int buttons,
int flags,
- int first_valuator,
- int num_valuators,
- int *valuators);
+ const ValuatorMask *mask);
extern _X_EXPORT int GetKeyboardEvents(
EventListPtr events,
@@ -466,17 +460,13 @@ extern int GetKeyboardValuatorEvents( DeviceIntPtr pDev,
int type,
int key_code,
- int first_valuator,
- int num_valuator,
- int *valuators);
+ const ValuatorMask *mask);
extern int GetProximityEvents(
EventListPtr events,
DeviceIntPtr pDev,
int type,
- int first_valuator,
- int num_valuators,
- int *valuators);
+ const ValuatorMask *mask);
extern void PostSyntheticMotion(
DeviceIntPtr pDev,
@@ -556,8 +546,22 @@ extern _X_EXPORT void DDXRingBell( int pitch,
int duration);
+#define VALUATOR_MODE_ALL_AXES -1
+extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
+extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
+
/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
+/* For server-internal functions, see inpututil.h */
+extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
+extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
+ int first_valuator, int num_valuators,
+ const int* valuators);
+extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
+ int valuator,
+ int data);
+extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
+
#endif /* INPUT_H */
diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h index c37f30073..edb7988c3 100644 --- a/xorg-server/include/inputstr.h +++ b/xorg-server/include/inputstr.h @@ -60,6 +60,7 @@ SOFTWARE. #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
+extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
#define SameClient(obj,client) \
(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
@@ -217,6 +218,7 @@ typedef struct _AxisInfo { int min_value;
int max_value;
Atom label;
+ CARD8 mode;
} AxisInfo, *AxisInfoPtr;
typedef struct _ValuatorAccelerationRec {
@@ -238,7 +240,6 @@ typedef struct _ValuatorClassRec { AxisInfoPtr axes;
unsigned short numAxes;
double *axisVal; /* always absolute, but device-coord system */
- CARD8 mode;
ValuatorAccelerationRec accelScheme;
} ValuatorClassRec, *ValuatorClassPtr;
@@ -271,7 +272,7 @@ typedef struct _FocusClassRec { typedef struct _ProximityClassRec {
int sourceid;
- char pad;
+ char in_proximity;
} ProximityClassRec, *ProximityClassPtr;
typedef struct _AbsoluteClassRec {
diff --git a/xorg-server/include/inpututils.h b/xorg-server/include/inpututils.h new file mode 100644 index 000000000..e59bf2860 --- /dev/null +++ b/xorg-server/include/inpututils.h @@ -0,0 +1,48 @@ +/*
+ * Copyright © 2010 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include "dix-config.h"
+#endif
+
+#ifndef INPUTUTILS_H
+#define INPUTUTILS_H
+
+#include "input.h"
+
+struct _ValuatorMask {
+ int8_t last_bit; /* highest bit set in mask */
+ uint8_t mask[(MAX_VALUATORS + 7)/8];
+ int valuators[MAX_VALUATORS]; /* valuator data */
+};
+
+/* server-internal */
+extern _X_HIDDEN int valuator_mask_size(const ValuatorMask *mask);
+extern _X_HIDDEN int valuator_mask_isset(const ValuatorMask *mask, int bit);
+extern _X_HIDDEN void valuator_mask_unset(ValuatorMask *mask, int bit);
+extern _X_HIDDEN int valuator_mask_num_valuators(const ValuatorMask *mask);
+extern _X_HIDDEN void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src);
+extern _X_HIDDEN int valuator_mask_get(const ValuatorMask *mask, int valnum);
+
+#endif
diff --git a/xorg-server/include/opaque.h b/xorg-server/include/opaque.h index 877eef68b..5c2e9166c 100644 --- a/xorg-server/include/opaque.h +++ b/xorg-server/include/opaque.h @@ -56,9 +56,6 @@ extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore;
extern _X_EXPORT Bool PartialNetwork;
extern _X_EXPORT Bool RunFromSigStopParent;
-#ifndef NOLOGOHACK
-extern _X_EXPORT int logoScreenSaver;
-#endif
#ifdef RLIMIT_DATA
extern _X_EXPORT int limitDataSpace;
#endif
@@ -72,6 +69,7 @@ extern _X_EXPORT Bool defeatAccessControl; extern _X_EXPORT long maxBigRequestSize;
extern _X_EXPORT Bool party_like_its_1989;
extern _X_EXPORT Bool whiteRoot;
+extern _X_EXPORT Bool bgNoneRoot;
extern _X_EXPORT Bool CoreDump;
diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index 4c7dcb712..a213058e2 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -601,6 +601,12 @@ typedef struct _Screen { /* Device cursor procedures */
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ /* set it in driver side if X server can copy the framebuffer content.
+ * Meant to be used together with '-background none' option, avoiding
+ * malicious users to steal framebuffer's content if that would be the
+ * default */
+ Bool canDoBGNoneRoot;
} ScreenRec;
static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) {
diff --git a/xorg-server/include/site.h b/xorg-server/include/site.h index b13421231..07d7db543 100644 --- a/xorg-server/include/site.h +++ b/xorg-server/include/site.h @@ -1,130 +1,127 @@ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -#ifndef SITE_H -#define SITE_H -/* - * The vendor string identifies the vendor responsible for the - * server executable. - */ -#ifndef VENDOR_STRING -#define VENDOR_STRING "The X.Org Foundation" -#endif - -/* - * The vendor release number identifies, for the purpose of submitting - * traceable bug reports, the release number of software produced - * by the vendor. - */ -#ifndef VENDOR_RELEASE -#define VENDOR_RELEASE 6600 -#endif - -/* - * The following constants are provided solely as a last line of defense. The - * normal build ALWAYS overrides them using a special rule given in - * server/dix/Imakefile. If you want to change either of these constants, - * you should set the DefaultFontPath or DefaultRGBDatabase configuration - * parameters. - * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! - */ -#ifndef COMPILEDDEFAULTFONTPATH -#define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/" -#endif - -/* - * The following constants contain default values for all of the variables - * that can be initialized on the server command line or in the environment. - */ -#define COMPILEDDEFAULTFONT "fixed" -#define COMPILEDCURSORFONT "cursor" -#ifndef COMPILEDDISPLAYCLASS -#define COMPILEDDISPLAYCLASS "MIT-unspecified" -#endif -#define DEFAULT_TIMEOUT 60 /* seconds */ -#define DEFAULT_KEYBOARD_CLICK 0 -#define DEFAULT_BELL 50 -#define DEFAULT_BELL_PITCH 400 -#define DEFAULT_BELL_DURATION 100 -#define DEFAULT_AUTOREPEAT TRUE -#define DEFAULT_AUTOREPEATS {\ - 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - -#define DEFAULT_LEDS 0x0 /* all off */ -#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */ -#define DEFAULT_INT_RESOLUTION 1000 -#define DEFAULT_INT_MIN_VALUE 0 -#define DEFAULT_INT_MAX_VALUE 100 -#define DEFAULT_INT_DISPLAYED 0 - -#define DEFAULT_PTR_NUMERATOR 2 -#define DEFAULT_PTR_DENOMINATOR 1 -#define DEFAULT_PTR_THRESHOLD 4 - -#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000)) -#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000)) -#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking -#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures -#ifndef NOLOGOHACK -#define DEFAULT_LOGO_SCREEN_SAVER 1 -#endif -#ifndef DEFAULT_ACCESS_CONTROL -#define DEFAULT_ACCESS_CONTROL TRUE -#endif - -/* Default logging parameters. */ -#ifndef DEFAULT_LOG_VERBOSITY -#define DEFAULT_LOG_VERBOSITY 0 -#endif -#ifndef DEFAULT_LOG_FILE_VERBOSITY -#define DEFAULT_LOG_FILE_VERBOSITY 3 -#endif - -#endif /* SITE_H */ +/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+#ifndef SITE_H
+#define SITE_H
+/*
+ * The vendor string identifies the vendor responsible for the
+ * server executable.
+ */
+#ifndef VENDOR_STRING
+#define VENDOR_STRING "The X.Org Foundation"
+#endif
+
+/*
+ * The vendor release number identifies, for the purpose of submitting
+ * traceable bug reports, the release number of software produced
+ * by the vendor.
+ */
+#ifndef VENDOR_RELEASE
+#define VENDOR_RELEASE 6600
+#endif
+
+/*
+ * The following constants are provided solely as a last line of defense. The
+ * normal build ALWAYS overrides them using a special rule given in
+ * server/dix/Imakefile. If you want to change either of these constants,
+ * you should set the DefaultFontPath or DefaultRGBDatabase configuration
+ * parameters.
+ * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE!
+ */
+#ifndef COMPILEDDEFAULTFONTPATH
+#define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/"
+#endif
+
+/*
+ * The following constants contain default values for all of the variables
+ * that can be initialized on the server command line or in the environment.
+ */
+#define COMPILEDDEFAULTFONT "fixed"
+#define COMPILEDCURSORFONT "cursor"
+#ifndef COMPILEDDISPLAYCLASS
+#define COMPILEDDISPLAYCLASS "MIT-unspecified"
+#endif
+#define DEFAULT_TIMEOUT 60 /* seconds */
+#define DEFAULT_KEYBOARD_CLICK 0
+#define DEFAULT_BELL 50
+#define DEFAULT_BELL_PITCH 400
+#define DEFAULT_BELL_DURATION 100
+#define DEFAULT_AUTOREPEAT TRUE
+#define DEFAULT_AUTOREPEATS {\
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+
+#define DEFAULT_LEDS 0x0 /* all off */
+#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
+#define DEFAULT_INT_RESOLUTION 1000
+#define DEFAULT_INT_MIN_VALUE 0
+#define DEFAULT_INT_MAX_VALUE 100
+#define DEFAULT_INT_DISPLAYED 0
+
+#define DEFAULT_PTR_NUMERATOR 2
+#define DEFAULT_PTR_DENOMINATOR 1
+#define DEFAULT_PTR_THRESHOLD 4
+
+#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000))
+#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000))
+#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking
+#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures
+#ifndef DEFAULT_ACCESS_CONTROL
+#define DEFAULT_ACCESS_CONTROL TRUE
+#endif
+
+/* Default logging parameters. */
+#ifndef DEFAULT_LOG_VERBOSITY
+#define DEFAULT_LOG_VERBOSITY 0
+#endif
+#ifndef DEFAULT_LOG_FILE_VERBOSITY
+#define DEFAULT_LOG_FILE_VERBOSITY 3
+#endif
+
+#endif /* SITE_H */
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index 1f84e5309..f9ca9a70b 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -39,6 +39,7 @@ in this Software without prior written authorization from The Open Group. # include "cursorstr.h"
# include "dixstruct.h"
# include "inputstr.h"
+# include "inpututils.h"
DevPrivateKeyRec miPointerScreenKeyRec;
@@ -553,6 +554,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) {
int i, nevents;
int valuators[2];
+ ValuatorMask mask;
miPointerMoveNoEvent(pDev, pScreen, x, y);
@@ -571,7 +573,9 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) }
}
- nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE, 0, 2, valuators);
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ nevents = GetPointerEvents(events, pDev, MotionNotify, 0,
+ POINTER_SCREEN | POINTER_ABSOLUTE, &mask);
OsBlockSignals();
#ifdef XQUARTZ
diff --git a/xorg-server/mi/mispans.c b/xorg-server/mi/mispans.c index ccf2a723e..4202c9bb9 100644 --- a/xorg-server/mi/mispans.c +++ b/xorg-server/mi/mispans.c @@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) void miFreeSpanGroup(SpanGroup *spanGroup)
{
- if (spanGroup->group != NULL) free(spanGroup->group);
+ free(spanGroup->group);
}
static void QuickSortSpansX(
diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c index d74cd1d43..3158e10cb 100644 --- a/xorg-server/mi/miwideline.c +++ b/xorg-server/mi/miwideline.c @@ -403,7 +403,7 @@ miPolyBuildPoly ( i = top;
j = StepAround (top, -1, count);
- if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx)
+ if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx)
{
clockwise = -1;
slopeoff = -1;
diff --git a/xorg-server/miext/rootless/rootlessScreen.c b/xorg-server/miext/rootless/rootlessScreen.c index fd396e464..364a75ac8 100644 --- a/xorg-server/miext/rootless/rootlessScreen.c +++ b/xorg-server/miext/rootless/rootlessScreen.c @@ -92,8 +92,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
if (s->pixmap_data_size < rowbytes) {
- if (s->pixmap_data != NULL)
- free(s->pixmap_data);
+ free(s->pixmap_data);
s->pixmap_data_size = rowbytes;
s->pixmap_data = malloc(s->pixmap_data_size);
diff --git a/xorg-server/miext/rootless/rootlessWindow.c b/xorg-server/miext/rootless/rootlessWindow.c index a86020cc5..20fdaba8d 100644 --- a/xorg-server/miext/rootless/rootlessWindow.c +++ b/xorg-server/miext/rootless/rootlessWindow.c @@ -1140,10 +1140,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, }
}
- if (gResizeDeathBits != NULL) {
- free(gResizeDeathBits);
- gResizeDeathBits = NULL;
- }
+ free(gResizeDeathBits);
+ gResizeDeathBits = NULL;
if (gravity) {
pScreen->CopyWindow = gResizeOldCopyWindowProc;
diff --git a/xorg-server/miext/shadow/shpacked.c b/xorg-server/miext/shadow/shpacked.c index 9bc869a8d..e5ebbff64 100644 --- a/xorg-server/miext/shadow/shpacked.c +++ b/xorg-server/miext/shadow/shpacked.c @@ -102,8 +102,8 @@ shadowUpdatePacked (ScreenPtr pScreen, width -= i;
scr += i;
#define PickBit(a,i) (((a) >> (i)) & 1)
- while (i--)
- *win++ = *sha++;
+ memcpy(win, sha, i * sizeof(FbBits));
+ sha += i;
}
shaLine += shaStride;
y++;
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c index dc83d3a34..a26b394b9 100644 --- a/xorg-server/os/io.c +++ b/xorg-server/os/io.c @@ -410,16 +410,29 @@ ReadRequestFromClient(ClientPtr client) else
needed = sizeof(xReq);
}
- oci->lenLastReq = needed;
/* If there are bytes to ignore, ignore them now. */
if (oci->ignoreBytes > 0) {
assert(needed == oci->ignoreBytes || needed == oci->size);
- oci->ignoreBytes -= gotnow;
- needed = gotnow = 0;
+ /*
+ * The _XSERVTransRead call above may return more or fewer bytes than we
+ * want to ignore. Ignore the smaller of the two sizes.
+ */
+ if (gotnow < needed) {
+ oci->ignoreBytes -= gotnow;
+ oci->bufptr += gotnow;
+ gotnow = 0;
+ } else {
+ oci->ignoreBytes -= needed;
+ oci->bufptr += needed;
+ gotnow -= needed;
+ }
+ needed = 0;
}
+ oci->lenLastReq = needed;
+
/*
* Check to see if client has at least one whole request in the
* buffer beyond the request we're returning to the caller.
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index ee4b45fa4..d95dd329c 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -1,617 +1,607 @@ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE. - -*/ - -/* - * Copyright (c) 1997-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/Xos.h> -#include <stdio.h> -#include <time.h> -#include <sys/stat.h> -#include <stdarg.h> -#include <stdlib.h> /* for malloc() */ -#include <errno.h> - -#include "input.h" -#include "site.h" -#include "opaque.h" - -#ifdef WIN32 -#include <process.h> -#define getpid(x) _getpid(x) -#endif - -#ifdef XF86BIGFONT -#include "xf86bigfontsrv.h" -#endif - -#ifdef DDXOSVERRORF -void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL; -#endif - -static FILE *logFile = NULL; -static Bool logFlush = FALSE; -static Bool logSync = FALSE; -static int logVerbosity = DEFAULT_LOG_VERBOSITY; -static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; - -/* Buffer to information logged before the log file is opened. */ -static char *saveBuffer = NULL; -static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; -static Bool needBuffer = TRUE; - -#ifdef __APPLE__ -#include <AvailabilityMacros.h> - -static char __crashreporter_info_buff__[4096] = {0}; -static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -// This is actually a toolchain requirement, but I'm not sure the correct check, -// but it should be fine to just only include it for Leopard and later. This line -// just tells the linker to never strip this symbol (such as for space optimization) -asm (".desc ___crashreporter_info__, 0x10"); -#endif -#endif - -/* Prefix strings for log messages. */ -#ifndef X_UNKNOWN_STRING -#define X_UNKNOWN_STRING "(\?\?)" -#endif -#ifndef X_PROBE_STRING -#define X_PROBE_STRING "(--)" -#endif -#ifndef X_CONFIG_STRING -#define X_CONFIG_STRING "(**)" -#endif -#ifndef X_DEFAULT_STRING -#define X_DEFAULT_STRING "(==)" -#endif -#ifndef X_CMDLINE_STRING -#define X_CMDLINE_STRING "(++)" -#endif -#ifndef X_NOTICE_STRING -#define X_NOTICE_STRING "(!!)" -#endif -#ifndef X_ERROR_STRING -#define X_ERROR_STRING "(EE)" -#endif -#ifndef X_WARNING_STRING -#define X_WARNING_STRING "(WW)" -#endif -#ifndef X_INFO_STRING -#define X_INFO_STRING "(II)" -#endif -#ifndef X_NOT_IMPLEMENTED_STRING -#define X_NOT_IMPLEMENTED_STRING "(NI)" -#endif - -/* - * LogInit is called to start logging to a file. It is also called (with - * NULL arguments) when logging to a file is not wanted. It must always be - * called, otherwise log messages will continue to accumulate in a buffer. - * - * %s, if present in the fname or backup strings, is expanded to the display - * string. - */ - -const char * -LogInit(const char *fname, const char *backup) -{ - char *logFileName = NULL; - - if (fname && *fname) { - /* malloc() can't be used yet. */ - logFileName = malloc(strlen(fname) + strlen(display) + 1); - if (!logFileName) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(logFileName, fname, display); - - if (backup && *backup) { - struct stat buf; - - if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) { - char *suffix; - char *oldLog; - - oldLog = malloc(strlen(logFileName) + strlen(backup) + - strlen(display) + 1); - suffix = malloc(strlen(backup) + strlen(display) + 1); - if (!oldLog || !suffix) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(suffix, backup, display); - sprintf(oldLog, "%s%s", logFileName, suffix); - free(suffix); - if (rename(logFileName, oldLog) == -1) { - FatalError("Cannot move old log file \"%s\" to \"%s\"\n", - logFileName, oldLog); - } - free(oldLog); - } - } - if ((logFile = fopen(logFileName, "w")) == NULL) - FatalError("Cannot open log file \"%s\"\n", logFileName); - setvbuf(logFile, NULL, _IONBF, 0); - - /* Flush saved log information. */ - if (saveBuffer && bufferSize > 0) { - fwrite(saveBuffer, bufferPos, 1, logFile); - fflush(logFile); -#ifndef WIN32 - fsync(fileno(logFile)); -#endif - } - } - - /* - * Unconditionally free the buffer, and flag that the buffer is no longer - * needed. - */ - if (saveBuffer && bufferSize > 0) { - free(saveBuffer); /* Must be free(), not free() */ - saveBuffer = NULL; - bufferSize = 0; - } - needBuffer = FALSE; - - return logFileName; -} - -void -LogClose(void) -{ - if (logFile) { - fclose(logFile); - logFile = NULL; - } -} - -Bool -LogSetParameter(LogParameter param, int value) -{ - switch (param) { - case XLOG_FLUSH: - logFlush = value ? TRUE : FALSE; - return TRUE; - case XLOG_SYNC: - logSync = value ? TRUE : FALSE; - return TRUE; - case XLOG_VERBOSITY: - logVerbosity = value; - return TRUE; - case XLOG_FILE_VERBOSITY: - logFileVerbosity = value; - return TRUE; - default: - return FALSE; - } -} - -/* This function does the actual log message writes. */ - -void -LogVWrite(int verb, const char *f, va_list args) -{ - static char tmpBuffer[1024]; - int len = 0; - static Bool newline = TRUE; - - if (newline) { - sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0); - len = strlen(tmpBuffer); - if (logFile) - fwrite(tmpBuffer, len, 1, logFile); - } - - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output - * stream(s). - */ - if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) { - vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args); - len = strlen(tmpBuffer); - } - newline = (tmpBuffer[len-1] == '\n'); - if ((verb < 0 || logVerbosity >= verb) && len > 0) - fwrite(tmpBuffer, len, 1, stderr); - if ((verb < 0 || logFileVerbosity >= verb) && len > 0) { - if (logFile) { - fwrite(tmpBuffer, len, 1, logFile); - if (logFlush) { - fflush(logFile); -#ifndef WIN32 - if (logSync) - fsync(fileno(logFile)); -#endif - } - } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * malloc() and friends can't be used. - */ - if (len > bufferUnused) { - bufferSize += 1024; - bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); - if (!saveBuffer) - FatalError("realloc() failed while saving log messages\n"); - } - bufferUnused -= len; - memcpy(saveBuffer + bufferPos, tmpBuffer, len); - bufferPos += len; - } - } -} - -void -LogWrite(int verb, const char *f, ...) -{ - va_list args; - - va_start(args, f); - LogVWrite(verb, f, args); - va_end(args); -} - -void -LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) -{ - const char *s = X_UNKNOWN_STRING; - char tmpBuf[1024]; - - /* Ignore verbosity for X_ERROR */ - if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) { - switch (type) { - case X_PROBED: - s = X_PROBE_STRING; - break; - case X_CONFIG: - s = X_CONFIG_STRING; - break; - case X_DEFAULT: - s = X_DEFAULT_STRING; - break; - case X_CMDLINE: - s = X_CMDLINE_STRING; - break; - case X_NOTICE: - s = X_NOTICE_STRING; - break; - case X_ERROR: - s = X_ERROR_STRING; - if (verb > 0) - verb = 0; - break; - case X_WARNING: - s = X_WARNING_STRING; - break; - case X_INFO: - s = X_INFO_STRING; - break; - case X_NOT_IMPLEMENTED: - s = X_NOT_IMPLEMENTED_STRING; - break; - case X_UNKNOWN: - s = X_UNKNOWN_STRING; - break; - case X_NONE: - s = NULL; - break; - } - - /* if s is not NULL we need a space before format */ - snprintf(tmpBuf, sizeof(tmpBuf), "%s%s%s", s ? s : "", - s ? " " : "", - format); - LogVWrite(verb, tmpBuf, args); - } -} - -/* Log message with verbosity level specified. */ -void -LogMessageVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} - -/* Log a message with the standard verbosity level of 1. */ -void -LogMessage(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - -void -AbortServer(void) _X_NORETURN; - -void -AbortServer(void) -{ -#ifdef XF86BIGFONT - XF86BigfontCleanup(); -#endif - CloseWellKnownConnections(); - OsCleanup(TRUE); - CloseDownDevices(); - AbortDDX(); - fflush(stderr); - if (CoreDump) - OsAbort(); - exit (1); -} - -#define AUDIT_PREFIX "AUDIT: %s: %ld: " -#ifndef AUDIT_TIMEOUT -#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ -#endif - -static int nrepeat = 0; -static int oldlen = -1; -static OsTimerPtr auditTimer = NULL; - -void -FreeAuditTimer(void) -{ - if (auditTimer != NULL) { - /* Force output of pending messages */ - TimerForce(auditTimer); - TimerFree(auditTimer); - auditTimer = NULL; - } -} - -static char * -AuditPrefix(void) -{ - time_t tm; - char *autime, *s; - char *tmpBuf; - int len; - - time(&tm); - autime = ctime(&tm); - if ((s = strchr(autime, '\n'))) - *s = '\0'; - len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1; - tmpBuf = malloc(len); - if (!tmpBuf) - return NULL; - snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid()); - return tmpBuf; -} - -void -AuditF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - - VAuditF(f, args); - va_end(args); -} - -static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) -{ - char *prefix; - - if (nrepeat > 0) { - prefix = AuditPrefix(); - ErrorF("%slast message repeated %d times\n", - prefix != NULL ? prefix : "", nrepeat); - nrepeat = 0; - if (prefix != NULL) - free(prefix); - return AUDIT_TIMEOUT; - } else { - /* if the timer expires without anything to print, flush the message */ - oldlen = -1; - return 0; - } -} - -void -VAuditF(const char *f, va_list args) -{ - char *prefix; - char buf[1024]; - int len; - static char oldbuf[1024]; - - prefix = AuditPrefix(); - len = vsnprintf(buf, sizeof(buf), f, args); - - if (len == oldlen && strcmp(buf, oldbuf) == 0) { - /* Message already seen */ - nrepeat++; - } else { - /* new message */ - if (auditTimer != NULL) - TimerForce(auditTimer); - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - strlcpy(oldbuf, buf, sizeof(oldbuf)); - oldlen = len; - nrepeat = 0; - auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); - } - if (prefix != NULL) - free(prefix); -} - -void -FatalError(const char *f, ...) -{ - va_list args; - static Bool beenhere = FALSE; - - if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); - else - ErrorF("\nFatal server error:\n"); - - va_start(args, f); -#ifdef __APPLE__ - (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args); -#endif - VErrorF(f, args); - va_end(args); - ErrorF("\n"); - if (!beenhere) - OsVendorFatalError(); - if (!beenhere) { - beenhere = TRUE; - AbortServer(); - } else - OsAbort(); - /*NOTREACHED*/ -} - -void -VErrorF(const char *f, va_list args) -{ -#ifdef DDXOSVERRORF - if (OsVendorVErrorFProc) - OsVendorVErrorFProc(f, args); - else - LogVWrite(-1, f, args); -#else - LogVWrite(-1, f, args); -#endif -} - -void -ErrorF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - VErrorF(f, args); - va_end(args); -} - -/* A perror() workalike. */ - -void -Error(char *str) -{ - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); - LogWrite(-1, "%s", err); - free(err); - } else - LogWrite(-1, "%s", strerror(saveErrno)); -} - -void -LogPrintMarkers(void) -{ - /* Show what the message marker symbols mean. */ - LogWrite(0, "Markers: "); - LogMessageVerb(X_PROBED, 0, "probed, "); - LogMessageVerb(X_CONFIG, 0, "from config file, "); - LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t"); - LogMessageVerb(X_CMDLINE, 0, "from command line, "); - LogMessageVerb(X_NOTICE, 0, "notice, "); - LogMessageVerb(X_INFO, 0, "informational,\n\t"); - LogMessageVerb(X_WARNING, 0, "warning, "); - LogMessageVerb(X_ERROR, 0, "error, "); - LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, "); - LogMessageVerb(X_UNKNOWN, 0, "unknown.\n"); -} - +/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+Copyright 1994 Quarterdeck Office Systems.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital and
+Quarterdeck not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT
+OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
+OR PERFORMANCE OF THIS SOFTWARE.
+
+*/
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+#include <stdlib.h> /* for malloc() */
+#include <errno.h>
+
+#include "input.h"
+#include "site.h"
+#include "opaque.h"
+
+#ifdef WIN32
+#include <process.h>
+#define getpid(x) _getpid(x)
+#endif
+
+#ifdef XF86BIGFONT
+#include "xf86bigfontsrv.h"
+#endif
+
+#ifdef DDXOSVERRORF
+void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL;
+#endif
+
+static FILE *logFile = NULL;
+static Bool logFlush = FALSE;
+static Bool logSync = FALSE;
+static int logVerbosity = DEFAULT_LOG_VERBOSITY;
+static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
+
+/* Buffer to information logged before the log file is opened. */
+static char *saveBuffer = NULL;
+static int bufferSize = 0, bufferUnused = 0, bufferPos = 0;
+static Bool needBuffer = TRUE;
+
+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+
+static char __crashreporter_info_buff__[4096] = {0};
+static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+// This is actually a toolchain requirement, but I'm not sure the correct check,
+// but it should be fine to just only include it for Leopard and later. This line
+// just tells the linker to never strip this symbol (such as for space optimization)
+asm (".desc ___crashreporter_info__, 0x10");
+#endif
+#endif
+
+/* Prefix strings for log messages. */
+#ifndef X_UNKNOWN_STRING
+#define X_UNKNOWN_STRING "(\?\?)"
+#endif
+#ifndef X_PROBE_STRING
+#define X_PROBE_STRING "(--)"
+#endif
+#ifndef X_CONFIG_STRING
+#define X_CONFIG_STRING "(**)"
+#endif
+#ifndef X_DEFAULT_STRING
+#define X_DEFAULT_STRING "(==)"
+#endif
+#ifndef X_CMDLINE_STRING
+#define X_CMDLINE_STRING "(++)"
+#endif
+#ifndef X_NOTICE_STRING
+#define X_NOTICE_STRING "(!!)"
+#endif
+#ifndef X_ERROR_STRING
+#define X_ERROR_STRING "(EE)"
+#endif
+#ifndef X_WARNING_STRING
+#define X_WARNING_STRING "(WW)"
+#endif
+#ifndef X_INFO_STRING
+#define X_INFO_STRING "(II)"
+#endif
+#ifndef X_NOT_IMPLEMENTED_STRING
+#define X_NOT_IMPLEMENTED_STRING "(NI)"
+#endif
+
+/*
+ * LogInit is called to start logging to a file. It is also called (with
+ * NULL arguments) when logging to a file is not wanted. It must always be
+ * called, otherwise log messages will continue to accumulate in a buffer.
+ *
+ * %s, if present in the fname or backup strings, is expanded to the display
+ * string.
+ */
+
+const char *
+LogInit(const char *fname, const char *backup)
+{
+ char *logFileName = NULL;
+
+ if (fname && *fname) {
+ logFileName = malloc(strlen(fname) + strlen(display) + 1);
+ if (!logFileName)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(logFileName, fname, display);
+
+ if (backup && *backup) {
+ struct stat buf;
+
+ if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
+ char *suffix;
+ char *oldLog;
+
+ oldLog = malloc(strlen(logFileName) + strlen(backup) +
+ strlen(display) + 1);
+ suffix = malloc(strlen(backup) + strlen(display) + 1);
+ if (!oldLog || !suffix)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(suffix, backup, display);
+ sprintf(oldLog, "%s%s", logFileName, suffix);
+ free(suffix);
+ if (rename(logFileName, oldLog) == -1) {
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
+ logFileName, oldLog);
+ }
+ free(oldLog);
+ }
+ }
+ if ((logFile = fopen(logFileName, "w")) == NULL)
+ FatalError("Cannot open log file \"%s\"\n", logFileName);
+ setvbuf(logFile, NULL, _IONBF, 0);
+
+ /* Flush saved log information. */
+ if (saveBuffer && bufferSize > 0) {
+ fwrite(saveBuffer, bufferPos, 1, logFile);
+ fflush(logFile);
+#ifndef WIN32
+ fsync(fileno(logFile));
+#endif
+ }
+ }
+
+ /*
+ * Unconditionally free the buffer, and flag that the buffer is no longer
+ * needed.
+ */
+ if (saveBuffer && bufferSize > 0) {
+ free(saveBuffer); /* Must be free(), not free() */
+ saveBuffer = NULL;
+ bufferSize = 0;
+ }
+ needBuffer = FALSE;
+
+ return logFileName;
+}
+
+void
+LogClose(void)
+{
+ if (logFile) {
+ fclose(logFile);
+ logFile = NULL;
+ }
+}
+
+Bool
+LogSetParameter(LogParameter param, int value)
+{
+ switch (param) {
+ case XLOG_FLUSH:
+ logFlush = value ? TRUE : FALSE;
+ return TRUE;
+ case XLOG_SYNC:
+ logSync = value ? TRUE : FALSE;
+ return TRUE;
+ case XLOG_VERBOSITY:
+ logVerbosity = value;
+ return TRUE;
+ case XLOG_FILE_VERBOSITY:
+ logFileVerbosity = value;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+/* This function does the actual log message writes. */
+
+void
+LogVWrite(int verb, const char *f, va_list args)
+{
+ static char tmpBuffer[1024];
+ int len = 0;
+ static Bool newline = TRUE;
+
+ if (newline) {
+ sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+ }
+
+ /*
+ * Since a va_list can only be processed once, write the string to a
+ * buffer, and then write the buffer out to the appropriate output
+ * stream(s).
+ */
+ if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) {
+ vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args);
+ len = strlen(tmpBuffer);
+ }
+ newline = (tmpBuffer[len-1] == '\n');
+ if ((verb < 0 || logVerbosity >= verb) && len > 0)
+ fwrite(tmpBuffer, len, 1, stderr);
+ if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
+ if (logFile) {
+ fwrite(tmpBuffer, len, 1, logFile);
+ if (logFlush) {
+ fflush(logFile);
+#ifndef WIN32
+ if (logSync)
+ fsync(fileno(logFile));
+#endif
+ }
+ } else if (needBuffer) {
+ if (len > bufferUnused) {
+ bufferSize += 1024;
+ bufferUnused += 1024;
+ saveBuffer = realloc(saveBuffer, bufferSize);
+ if (!saveBuffer)
+ FatalError("realloc() failed while saving log messages\n");
+ }
+ bufferUnused -= len;
+ memcpy(saveBuffer + bufferPos, tmpBuffer, len);
+ bufferPos += len;
+ }
+ }
+}
+
+void
+LogWrite(int verb, const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ LogVWrite(verb, f, args);
+ va_end(args);
+}
+
+void
+LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
+{
+ const char *s = X_UNKNOWN_STRING;
+ char tmpBuf[1024];
+
+ /* Ignore verbosity for X_ERROR */
+ if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) {
+ switch (type) {
+ case X_PROBED:
+ s = X_PROBE_STRING;
+ break;
+ case X_CONFIG:
+ s = X_CONFIG_STRING;
+ break;
+ case X_DEFAULT:
+ s = X_DEFAULT_STRING;
+ break;
+ case X_CMDLINE:
+ s = X_CMDLINE_STRING;
+ break;
+ case X_NOTICE:
+ s = X_NOTICE_STRING;
+ break;
+ case X_ERROR:
+ s = X_ERROR_STRING;
+ if (verb > 0)
+ verb = 0;
+ break;
+ case X_WARNING:
+ s = X_WARNING_STRING;
+ break;
+ case X_INFO:
+ s = X_INFO_STRING;
+ break;
+ case X_NOT_IMPLEMENTED:
+ s = X_NOT_IMPLEMENTED_STRING;
+ break;
+ case X_UNKNOWN:
+ s = X_UNKNOWN_STRING;
+ break;
+ case X_NONE:
+ s = NULL;
+ break;
+ }
+
+ /* if s is not NULL we need a space before format */
+ snprintf(tmpBuf, sizeof(tmpBuf), "%s%s%s", s ? s : "",
+ s ? " " : "",
+ format);
+ LogVWrite(verb, tmpBuf, args);
+ }
+}
+
+/* Log message with verbosity level specified. */
+void
+LogMessageVerb(MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ LogVMessageVerb(type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Log a message with the standard verbosity level of 1. */
+void
+LogMessage(MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ LogVMessageVerb(type, 1, format, ap);
+ va_end(ap);
+}
+
+void
+AbortServer(void) _X_NORETURN;
+
+void
+AbortServer(void)
+{
+#ifdef XF86BIGFONT
+ XF86BigfontCleanup();
+#endif
+ CloseWellKnownConnections();
+ OsCleanup(TRUE);
+ CloseDownDevices();
+ AbortDDX();
+ fflush(stderr);
+ if (CoreDump)
+ OsAbort();
+ exit (1);
+}
+
+#define AUDIT_PREFIX "AUDIT: %s: %ld: "
+#ifndef AUDIT_TIMEOUT
+#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
+#endif
+
+static int nrepeat = 0;
+static int oldlen = -1;
+static OsTimerPtr auditTimer = NULL;
+
+void
+FreeAuditTimer(void)
+{
+ if (auditTimer != NULL) {
+ /* Force output of pending messages */
+ TimerForce(auditTimer);
+ TimerFree(auditTimer);
+ auditTimer = NULL;
+ }
+}
+
+static char *
+AuditPrefix(void)
+{
+ time_t tm;
+ char *autime, *s;
+ char *tmpBuf;
+ int len;
+
+ time(&tm);
+ autime = ctime(&tm);
+ if ((s = strchr(autime, '\n')))
+ *s = '\0';
+ len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1;
+ tmpBuf = malloc(len);
+ if (!tmpBuf)
+ return NULL;
+ snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid());
+ return tmpBuf;
+}
+
+void
+AuditF(const char * f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+
+ VAuditF(f, args);
+ va_end(args);
+}
+
+static CARD32
+AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
+{
+ char *prefix;
+
+ if (nrepeat > 0) {
+ prefix = AuditPrefix();
+ ErrorF("%slast message repeated %d times\n",
+ prefix != NULL ? prefix : "", nrepeat);
+ nrepeat = 0;
+ free(prefix);
+ return AUDIT_TIMEOUT;
+ } else {
+ /* if the timer expires without anything to print, flush the message */
+ oldlen = -1;
+ return 0;
+ }
+}
+
+void
+VAuditF(const char *f, va_list args)
+{
+ char *prefix;
+ char buf[1024];
+ int len;
+ static char oldbuf[1024];
+
+ prefix = AuditPrefix();
+ len = vsnprintf(buf, sizeof(buf), f, args);
+
+ if (len == oldlen && strcmp(buf, oldbuf) == 0) {
+ /* Message already seen */
+ nrepeat++;
+ } else {
+ /* new message */
+ if (auditTimer != NULL)
+ TimerForce(auditTimer);
+ ErrorF("%s%s", prefix != NULL ? prefix : "", buf);
+ strlcpy(oldbuf, buf, sizeof(oldbuf));
+ oldlen = len;
+ nrepeat = 0;
+ auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
+ }
+ free(prefix);
+}
+
+void
+FatalError(const char *f, ...)
+{
+ va_list args;
+ static Bool beenhere = FALSE;
+
+ if (beenhere)
+ ErrorF("\nFatalError re-entered, aborting\n");
+ else
+ ErrorF("\nFatal server error:\n");
+
+ va_start(args, f);
+#ifdef __APPLE__
+ (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args);
+#endif
+ VErrorF(f, args);
+ va_end(args);
+ ErrorF("\n");
+ if (!beenhere)
+ OsVendorFatalError();
+ if (!beenhere) {
+ beenhere = TRUE;
+ AbortServer();
+ } else
+ OsAbort();
+ /*NOTREACHED*/
+}
+
+void
+VErrorF(const char *f, va_list args)
+{
+#ifdef DDXOSVERRORF
+ if (OsVendorVErrorFProc)
+ OsVendorVErrorFProc(f, args);
+ else
+ LogVWrite(-1, f, args);
+#else
+ LogVWrite(-1, f, args);
+#endif
+}
+
+void
+ErrorF(const char * f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ VErrorF(f, args);
+ va_end(args);
+}
+
+/* A perror() workalike. */
+
+void
+Error(char *str)
+{
+ char *err = NULL;
+ int saveErrno = errno;
+
+ if (str) {
+ err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1);
+ if (!err)
+ return;
+ sprintf(err, "%s: ", str);
+ strcat(err, strerror(saveErrno));
+ LogWrite(-1, "%s", err);
+ free(err);
+ } else
+ LogWrite(-1, "%s", strerror(saveErrno));
+}
+
+void
+LogPrintMarkers(void)
+{
+ /* Show what the message marker symbols mean. */
+ LogWrite(0, "Markers: ");
+ LogMessageVerb(X_PROBED, 0, "probed, ");
+ LogMessageVerb(X_CONFIG, 0, "from config file, ");
+ LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t");
+ LogMessageVerb(X_CMDLINE, 0, "from command line, ");
+ LogMessageVerb(X_NOTICE, 0, "notice, ");
+ LogMessageVerb(X_INFO, 0, "informational,\n\t");
+ LogMessageVerb(X_WARNING, 0, "warning, ");
+ LogMessageVerb(X_ERROR, 0, "error, ");
+ LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, ");
+ LogMessageVerb(X_UNKNOWN, 0, "unknown.\n");
+}
+
diff --git a/xorg-server/os/strlcat.c b/xorg-server/os/strlcat.c index 91ceabb1c..e374e2908 100644 --- a/xorg-server/os/strlcat.c +++ b/xorg-server/os/strlcat.c @@ -1,59 +1,59 @@ -/* - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE - * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <sys/types.h> -#include <string.h> -#include "os.h" - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz <= strlen(dst)). - * Returns strlen(src) + MIN(siz, strlen(initial dst)). - * If retval >= siz, truncation occurred. - */ -size_t -strlcat(char *dst, const char *src, size_t siz) -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} +/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <sys/types.h>
+#include <string.h>
+#include "os.h"
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char *dst, const char *src, size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
diff --git a/xorg-server/os/strlcpy.c b/xorg-server/os/strlcpy.c index 647adb5e9..006cd7dc2 100644 --- a/xorg-server/os/strlcpy.c +++ b/xorg-server/os/strlcpy.c @@ -14,8 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
#endif
#include <sys/types.h>
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 179a4b089..260c3a99c 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -496,12 +496,9 @@ void UseMsg(void) ErrorF("-ls int limit stack space to N Kb\n");
#endif
ErrorF("-nolock disable the locking mechanism\n");
-#ifndef NOLOGOHACK
- ErrorF("-logo enable logo in screen saver\n");
- ErrorF("nologo disable logo in screen saver\n");
-#endif
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
+ ErrorF("-background [none] create root window with no background\n");
ErrorF("-reset reset after last client exists\n");
ErrorF("-p # screen-saver pattern duration (minutes)\n");
ErrorF("-pn accept failure to listen on all ports\n");
@@ -755,16 +752,6 @@ ProcessCommandLine(int argc, char *argv[]) #endif
nolock = TRUE;
}
-#ifndef NOLOGOHACK
- else if ( strcmp( argv[i], "-logo") == 0)
- {
- logoScreenSaver = 1;
- }
- else if ( strcmp( argv[i], "nologo") == 0)
- {
- logoScreenSaver = 0;
- }
-#endif
else if ( strcmp( argv[i], "-nolisten") == 0)
{
if(++i < argc) {
@@ -842,6 +829,14 @@ ProcessCommandLine(int argc, char *argv[]) defaultBackingStore = WhenMapped;
else if ( strcmp( argv[i], "-wr") == 0)
whiteRoot = TRUE;
+ else if ( strcmp( argv[i], "-background") == 0) {
+ if(++i < argc) {
+ if (!strcmp ( argv[i], "none"))
+ bgNoneRoot = TRUE;
+ else
+ UseMsg();
+ }
+ }
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
if(++i < argc) {
long reqSizeArg = atol(argv[i]);
diff --git a/xorg-server/render/Makefile.am b/xorg-server/render/Makefile.am index 216c6134e..b060c07eb 100644 --- a/xorg-server/render/Makefile.am +++ b/xorg-server/render/Makefile.am @@ -1,21 +1,20 @@ -noinst_LTLIBRARIES = librender.la - -AM_CFLAGS = $(DIX_CFLAGS) - -librender_la_SOURCES = \ - animcur.c \ - filter.c \ - glyph.c \ - matrix.c \ - miindex.c \ - mipict.c \ - mirect.c \ - mitrap.c \ - mitri.c \ - picture.c \ - render.c \ - renderedge.c - -if XORG -sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h renderedge.h -endif +noinst_LTLIBRARIES = librender.la
+
+AM_CFLAGS = $(DIX_CFLAGS)
+
+librender_la_SOURCES = \
+ animcur.c \
+ filter.c \
+ glyph.c \
+ matrix.c \
+ miindex.c \
+ mipict.c \
+ mirect.c \
+ mitrap.c \
+ mitri.c \
+ picture.c \
+ render.c
+
+if XORG
+sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h
+endif
diff --git a/xorg-server/render/miindex.c b/xorg-server/render/miindex.c index 75f941477..23c871ba1 100644 --- a/xorg-server/render/miindex.c +++ b/xorg-server/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen,
PictFormatPtr pFormat)
{
- if (pFormat->index.devPrivate)
- {
- free(pFormat->index.devPrivate);
- pFormat->index.devPrivate = 0;
- }
- if (pFormat->index.pValues)
- {
- free(pFormat->index.pValues);
- pFormat->index.pValues = 0;
- }
+ free(pFormat->index.devPrivate);
+ pFormat->index.devPrivate = NULL;
+ free(pFormat->index.pValues);
+ pFormat->index.pValues = NULL;
}
void
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index 17b1a2714..b2418ef36 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -1391,11 +1391,8 @@ SetPictureTransform (PicturePtr pPicture, }
else
{
- if (pPicture->transform)
- {
- free(pPicture->transform);
- pPicture->transform = 0;
- }
+ free(pPicture->transform);
+ pPicture->transform = NULL;
}
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
diff --git a/xorg-server/render/renderedge.c b/xorg-server/render/renderedge.c deleted file mode 100644 index 8771fe164..000000000 --- a/xorg-server/render/renderedge.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - return pixman_sample_ceil_y (y, n); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - return pixman_sample_floor_y (y, n); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - pixman_edge_step (e, n); -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off); -} - diff --git a/xorg-server/render/renderedge.h b/xorg-server/render/renderedge.h deleted file mode 100644 index 6585aeb90..000000000 --- a/xorg-server/render/renderedge.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _RENDEREDGE_H_ -#define _RENDEREDGE_H_ - -#include "picturestr.h" - -#define MAX_ALPHA(n) ((1 << (n)) - 1) -#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1) -#define N_X_FRAC(n) ((1 << ((n)/2)) + 1) - -#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n)) -#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2) -#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n)) -#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2) -#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n)) - -/* - * An edge structure. This represents a single polygon edge - * and can be quickly stepped across small or large gaps in the - * sample grid - */ -typedef pixman_edge_t RenderEdge; - -/* - * Step across a small sample grid gap - */ -#define RenderEdgeStepSmall(edge) { \ - edge->x += edge->stepx_small; \ - edge->e += edge->dx_small; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -/* - * Step across a large sample grid gap - */ -#define RenderEdgeStepBig(edge) { \ - edge->x += edge->stepx_big; \ - edge->e += edge->dx_big; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -extern _X_EXPORT xFixed -RenderSampleCeilY (xFixed y, int bpp); - -extern _X_EXPORT xFixed -RenderSampleFloorY (xFixed y, int bpp); - -extern _X_EXPORT void -RenderEdgeStep (RenderEdge *e, int n); - -extern _X_EXPORT void -RenderEdgeInit (RenderEdge *e, - int bpp, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot); - -extern _X_EXPORT void -RenderLineFixedEdgeInit (RenderEdge *e, - int bpp, - xFixed y, - xLineFixed *line, - int x_off, - int y_off); - -#endif /* _RENDEREDGE_H_ */ diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c index 240c2905b..abcc8926b 100644 --- a/xorg-server/test/input.c +++ b/xorg-server/test/input.c @@ -38,6 +38,7 @@ #include "exevents.h"
#include "dixgrabs.h"
#include "eventstr.h"
+#include "inpututils.h"
#include <glib.h>
/**
@@ -65,7 +66,6 @@ static void dix_init_valuators(void) g_assert(val);
g_assert(val->numAxes == num_axes);
g_assert(val->numMotionEvents == 0);
- g_assert(val->mode == Absolute);
g_assert(val->axisVal);
for (i = 0; i < num_axes; i++)
@@ -73,6 +73,7 @@ static void dix_init_valuators(void) g_assert(val->axisVal[i] == 0);
g_assert(val->axes->min_value == NO_AXIS_LIMITS);
g_assert(val->axes->max_value == NO_AXIS_LIMITS);
+ g_assert(val->axes->mode == Absolute);
}
g_assert(dev.last.numValuators == num_axes);
@@ -903,18 +904,127 @@ static void dix_input_attributes(void) FreeInputAttributes(new);
}
+static void dix_input_valuator_masks(void)
+{
+ ValuatorMask *mask = NULL, *copy;
+ int nvaluators = MAX_VALUATORS;
+ int valuators[nvaluators];
+ int i;
+ int first_val, num_vals;
+
+ for (i = 0; i < nvaluators; i++)
+ valuators[i] = i;
+
+ mask = valuator_mask_new(nvaluators);
+ g_assert(mask != NULL);
+ g_assert(valuator_mask_size(mask) == 0);
+ g_assert(valuator_mask_num_valuators(mask) == 0);
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(!valuator_mask_isset(mask, i));
+ valuator_mask_set(mask, i, valuators[i]);
+ g_assert(valuator_mask_isset(mask, i));
+ g_assert(valuator_mask_get(mask, i) == valuators[i]);
+ g_assert(valuator_mask_size(mask) == i + 1);
+ g_assert(valuator_mask_num_valuators(mask) == i + 1);
+ }
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(valuator_mask_isset(mask, i));
+ valuator_mask_unset(mask, i);
+ /* we're removing valuators from the front, so size should stay the
+ * same until the last bit is removed */
+ if (i < nvaluators - 1)
+ g_assert(valuator_mask_size(mask) == nvaluators);
+ g_assert(!valuator_mask_isset(mask, i));
+ }
+
+ g_assert(valuator_mask_size(mask) == 0);
+ valuator_mask_zero(mask);
+ g_assert(valuator_mask_size(mask) == 0);
+ g_assert(valuator_mask_num_valuators(mask) == 0);
+ for (i = 0; i < nvaluators; i++)
+ g_assert(!valuator_mask_isset(mask, i));
+
+ first_val = 5;
+ num_vals = 6;
+
+ valuator_mask_set_range(mask, first_val, num_vals, valuators);
+ g_assert(valuator_mask_size(mask) == first_val + num_vals);
+ g_assert(valuator_mask_num_valuators(mask) == num_vals);
+ for (i = 0; i < nvaluators; i++)
+ {
+ if (i < first_val || i >= first_val + num_vals)
+ g_assert(!valuator_mask_isset(mask, i));
+ else
+ {
+ g_assert(valuator_mask_isset(mask, i));
+ g_assert(valuator_mask_get(mask, i) == valuators[i - first_val]);
+ }
+ }
+
+ copy = valuator_mask_new(nvaluators);
+ valuator_mask_copy(copy, mask);
+ g_assert(mask != copy);
+ g_assert(valuator_mask_size(mask) == valuator_mask_size(copy));
+ g_assert(valuator_mask_num_valuators(mask) == valuator_mask_num_valuators(copy));
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i));
+ g_assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i));
+ }
+
+ free(mask);
+}
+
+static void dix_valuator_mode(void)
+{
+ DeviceIntRec dev;
+ const int num_axes = MAX_VALUATORS;
+ int i;
+ Atom atoms[MAX_VALUATORS] = { 0 };
+
+ memset(&dev, 0, sizeof(DeviceIntRec));
+ dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
+
+ g_assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE);
+ g_assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute));
+
+ for (i = 0; i < num_axes; i++)
+ {
+ g_assert(valuator_get_mode(&dev, i) == Absolute);
+ valuator_set_mode(&dev, i, Relative);
+ g_assert(dev.valuator->axes[i].mode == Relative);
+ g_assert(valuator_get_mode(&dev, i) == Relative);
+ }
+
+ valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Absolute);
+ for (i = 0; i < num_axes; i++)
+ g_assert(valuator_get_mode(&dev, i) == Absolute);
+
+ valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Relative);
+ for (i = 0; i < num_axes; i++)
+ g_assert(valuator_get_mode(&dev, i) == Relative);
+}
+
+
int main(int argc, char** argv)
{
g_test_init(&argc, &argv,NULL);
g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+ g_test_add_func("/dix/input/valuator-masks", dix_input_valuator_masks);
g_test_add_func("/dix/input/attributes", dix_input_attributes);
g_test_add_func("/dix/input/init-valuators", dix_init_valuators);
g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion);
g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values);
g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
+ g_test_add_func("/dix/input/valuator_mode", dix_valuator_mode);
g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers);
diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c index d396a233d..86a7201b8 100644 --- a/xorg-server/test/xi2/protocol-common.c +++ b/xorg-server/test/xi2/protocol-common.c @@ -28,6 +28,7 @@ #include <stdint.h>
#include "extinit.h" /* for XInputExtensionInit */
#include "exglobals.h"
+#include "xkbsrv.h" /* for XkbInitPrivates */
#include <glib.h>
#include "protocol-common.h"
diff --git a/xorg-server/xkb/XKBAlloc.c b/xorg-server/xkb/XKBAlloc.c index 9dab41c5e..8c439ba0b 100644 --- a/xorg-server/xkb/XKBAlloc.c +++ b/xorg-server/xkb/XKBAlloc.c @@ -212,10 +212,8 @@ XkbNamesPtr names; register XkbKeyTypePtr type;
type= map->types;
for (i=0;i<map->num_types;i++,type++) {
- if (type->level_names!=NULL) {
- free(type->level_names);
- type->level_names= NULL;
- }
+ free(type->level_names);
+ type->level_names = NULL;
}
}
}
diff --git a/xorg-server/xkb/XKBGAlloc.c b/xorg-server/xkb/XKBGAlloc.c index a6d10c4b0..d5e49349e 100644 --- a/xorg-server/xkb/XKBGAlloc.c +++ b/xorg-server/xkb/XKBGAlloc.c @@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll, {
if ((freeAll)||(*elems==NULL)) {
*num_inout= *sz_inout= 0;
- if (*elems!=NULL) {
- free(*elems);
- *elems= NULL;
- }
+ free(*elems);
+ *elems = NULL;
return;
}
@@ -373,22 +371,16 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; switch (doodad->any.type) {
case XkbTextDoodad:
{
- if (doodad->text.text!=NULL) {
- free(doodad->text.text);
- doodad->text.text= NULL;
- }
- if (doodad->text.font!=NULL) {
- free(doodad->text.font);
- doodad->text.font= NULL;
- }
+ free(doodad->text.text);
+ doodad->text.text = NULL;
+ free(doodad->text.font);
+ doodad->text.font = NULL;
}
break;
case XkbLogoDoodad:
{
- if (doodad->logo.logo_name!=NULL) {
- free(doodad->logo.logo_name);
- doodad->logo.logo_name= NULL;
- }
+ free(doodad->logo.logo_name);
+ doodad->logo.logo_name = NULL;
}
break;
}
@@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL))
XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE);
if (freeMap) {
- if (geom->label_font!=NULL) {
- free(geom->label_font);
- geom->label_font= NULL;
- }
+ free(geom->label_font);
+ geom->label_font = NULL;
free(geom);
}
return;
diff --git a/xorg-server/xkb/XKBMAlloc.c b/xorg-server/xkb/XKBMAlloc.c index 28995de81..ad13b940c 100644 --- a/xorg-server/xkb/XKBMAlloc.c +++ b/xorg-server/xkb/XKBMAlloc.c @@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; }
type= &xkb->map->types[type_ndx];
if (map_count==0) {
- if (type->map!=NULL)
- free(type->map);
+ free(type->map);
type->map= NULL;
- if (type->preserve!=NULL)
- free(type->preserve);
+ free(type->preserve);
type->preserve= NULL;
type->map_count= 0;
}
@@ -321,9 +319,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; return BadAlloc;
}
}
- else if (type->preserve!=NULL) {
+ else {
free(type->preserve);
- type->preserve= NULL;
+ type->preserve = NULL;
}
type->map_count= map_count;
}
@@ -807,19 +805,13 @@ XkbClientMapPtr map; register int i;
XkbKeyTypePtr type;
for (i=0,type=map->types;i<map->num_types;i++,type++) {
- if (type->map!=NULL) {
- free(type->map);
- type->map= NULL;
- }
- if (type->preserve!=NULL) {
- free(type->preserve);
- type->preserve= NULL;
- }
+ free(type->map);
+ type->map = NULL;
+ free(type->preserve);
+ type->preserve = NULL;
type->map_count= 0;
- if (type->level_names!=NULL) {
- free(type->level_names);
- type->level_names= NULL;
- }
+ free(type->level_names);
+ type->level_names = NULL;
}
}
free(map->types);
@@ -828,10 +820,8 @@ XkbClientMapPtr map; }
}
if (what&XkbKeySymsMask) {
- if (map->key_sym_map!=NULL) {
- free(map->key_sym_map);
- map->key_sym_map= NULL;
- }
+ free(map->key_sym_map);
+ map->key_sym_map = NULL;
if (map->syms!=NULL) {
free(map->syms);
map->size_syms= map->num_syms= 0;
@@ -864,10 +854,8 @@ XkbServerMapPtr map; map->explicit= NULL;
}
if (what&XkbKeyActionsMask) {
- if (map->key_acts!=NULL) {
- free(map->key_acts);
- map->key_acts= NULL;
- }
+ free(map->key_acts);
+ map->key_acts = NULL;
if (map->acts!=NULL) {
free(map->acts);
map->num_acts= map->size_acts= 0;
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index 6742537e7..03de218ab 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -267,8 +267,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0';
}
- if (buf != NULL)
- free(buf);
+ free(buf);
return TRUE;
}
else
@@ -287,8 +286,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, }
if (nameRtrn)
nameRtrn[0]= '\0';
- if (buf != NULL)
- free(buf);
+ free(buf);
return FALSE;
}
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index 11c52c3c2..b3f91cd9e 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -42,6 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <ctype.h>
#include "mi.h"
#include "mipointer.h"
+#include "inpututils.h"
#define EXTENSION_EVENT_BASE 64
DevPrivateKeyRec xkbDevicePrivateKeyRec;
@@ -1354,7 +1355,7 @@ xkbStateNotify sn; * First one on drinking island wins!
*/
static void
-InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int num_valuators, int *valuators)
+InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, ValuatorMask *mask)
{
ScreenPtr pScreen;
EventListPtr events;
@@ -1376,8 +1377,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu OsBlockSignals();
pScreen = miPointerGetScreen(ptr);
saveWait = miPointerSetWaitForUpdate(pScreen, FALSE);
- nevents = GetPointerEvents(events, ptr, type, button, flags, 0,
- num_valuators, valuators);
+ nevents = GetPointerEvents(events, ptr, type, button, flags, mask);
if (IsMaster(dev) && (lastSlave && lastSlave != ptr))
UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents);
miPointerSetWaitForUpdate(pScreen, saveWait);
@@ -1393,6 +1393,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu static void
XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y)
{
+ ValuatorMask mask;
int gpe_flags = 0;
/* ignore attached SDs */
@@ -1404,7 +1405,9 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y) else
gpe_flags = POINTER_RELATIVE;
- InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, 2, (int[]){x, y});
+ valuator_mask_set_range(&mask, 0, 2, (int[]){x, y});
+
+ InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, &mask);
}
void
@@ -1434,5 +1437,5 @@ XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) return;
InjectPointerKeyEvents(dev, press ? ButtonPress : ButtonRelease,
- button, 0, 0, NULL);
+ button, 0, NULL);
}
diff --git a/xorg-server/xkeyboard-config/geometry/Makefile.am b/xorg-server/xkeyboard-config/geometry/Makefile.am index 84619fb96..7c9e395fa 100644 --- a/xorg-server/xkeyboard-config/geometry/Makefile.am +++ b/xorg-server/xkeyboard-config/geometry/Makefile.am @@ -1,15 +1,15 @@ -SUBDIRS = digital_vndr sgi_vndr - -geomdir = $(xkb_base)/geometry - -dist_geom_DATA = \ -amiga ataritt chicony \ -dell everex fujitsu \ -hhk hp keytronic kinesis \ -macintosh microsoft nec nokia \ -northgate pc sony thinkpad \ -sun typematrix winbook README - -dir_data = $(dist_geom_DATA) - -include $(top_srcdir)/xkbrules.am +SUBDIRS = digital_vndr sgi_vndr
+
+geomdir = $(xkb_base)/geometry
+
+dist_geom_DATA = \
+amiga ataritt chicony \
+dell everex fujitsu \
+hhk hp keytronic kinesis \
+macintosh microsoft nec nokia \
+northgate pc sanwa sony thinkpad \
+sun typematrix winbook README
+
+dir_data = $(dist_geom_DATA)
+
+include $(top_srcdir)/xkbrules.am
diff --git a/xorg-server/xkeyboard-config/geometry/sanwa b/xorg-server/xkeyboard-config/geometry/sanwa new file mode 100644 index 000000000..5434bdf43 --- /dev/null +++ b/xorg-server/xkeyboard-config/geometry/sanwa @@ -0,0 +1,151 @@ +// $Xorg: $
+//
+//Copyright 1996, 1998 The Open Group
+//
+//Permission to use, copy, modify, distribute, and sell this software and its
+//documentation for any purpose is hereby granted without fee, provided that
+//the above copyright notice appear in all copies and that both that
+//copyright notice and this permission notice appear in supporting
+//documentation.
+//
+//The above copyright notice and this permission notice shall be
+//included in all copies or substantial portions of the Software.
+//
+//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+//EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+//MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+//IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+//OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+//ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+//OTHER DEALINGS IN THE SOFTWARE.
+//
+//Except as contained in this notice, the name of The Open Group shall
+//not be used in advertising or otherwise to promote the sale, use or
+//other dealings in this Software without prior written authorization
+//from The Open Group.
+//
+default xkb_geometry "sanwaskbkg3" {
+
+ description= "Sanwa Supply SKB-KG3";
+ // SKB-KG3BK (black)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3BK
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3BK/
+ // SKB-KG3W (white)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3W
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3SW/
+ // SKB-KG3SV (silver)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3SV
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3SV/
+
+ width= 304;
+ height= 127;
+
+ shape.cornerRadius= 1;
+ shape "TOP" { { [15.25,13] }, { [2,2], [13.25,11] } };
+ shape "NORM" { { [17,16] }, { [2,2], [15,14] } };
+ shape "TBBK" { { [24.5,16] }, { [2,2], [22.5,14] } };
+ shape "RTRN" { { [0,0], [36,0], [36,34], [8.5,34], [8.5,16], [0,16] },
+ { [2,2], [34,2], [34,32], [10.5,32], [10.5,14], [2,14] } };
+ shape "CAPS" { { [33,16] }, { [28,16] }, { [2,2], [26,14] } };
+ shape "LFSH" { { [41,16] }, { [2,2], [39,14] } };
+ shape "CTSH" { { [19.5,16] }, { [2,2], [17.5,14] } };
+ shape "SPCE" { { [57.5,16] }, { [2,2], [55.5,14] } };
+
+ shape "LED" { cornerRadius= 0, { [5,1] } };
+
+ indicator.onColor= "green";
+ indicator.offColor= "green30";
+ indicator.top= 3;
+ indicator.shape= "LED";
+ indicator "Num Lock" { left= 247; };
+ indicator "Caps Lock" { left= 266; };
+ indicator "Scroll Lock" { left= 285; };
+ text.color= "black";
+ text.top= 1;
+ text "Vendor1" { left= 10; text="SANWA"; };
+ text.top= 4.5;
+ text "Vendor2" { left= 10; text="SUPPLY"; };
+ text "NumLockLabel" { left= 241; text="Num Lock"; };
+ text "CapsLockLabel" { left= 260; text="Caps Lock"; };
+ text "ScrollLockLabel" { left= 279; text="Scroll Lock"; };
+
+ section.left= 3;
+ row.left= 1;
+ key.shape= "NORM";
+ key.gap= 2;
+ section "Function" {
+ key.shape= "TOP";
+ top= 10;
+ row {
+ top= 1;
+ keys { <ESC>, <FK01>, <FK02>, <FK03>, <FK04>, <FK05>, <FK06>,
+ <FK07>, <FK08>, <FK09>, <FK10>, <FK11>, <FK12>, <PRSC>,
+ {<NMLK>, color="grey20"}, <PAUS>, {<DELE>, color="grey20"}
+ };
+ };
+ overlay "SCLK" {
+ <NMLK>=<SCLK>
+ };
+ overlay "FN" {
+ <DELE>=<INS>
+ };
+ }; // End of "Function" section
+
+ section "Alpha" {
+ top= 24;
+ row {
+ top= 2;
+ keys { <HZTG>, <AE01>, <AE02>, <AE03>, <AE04>, <AE05>, <AE06>,
+ {<AE07>, color="grey20"}, {<AE08>, color="grey20"},
+ {<AE09>, color="grey20"}, {<AE10>, color="grey20"},
+ <AE11>, <AE12>, <AE13>, { <BKSP>, "TBBK" }
+ };
+ };
+ row {
+ top= 20;
+ keys { { <TAB>, "TBBK" }, <AD01>, <AD02>, <AD03>, <AD04>, <AD05>,
+ <AD06>, {<AD07>, color="grey20"}, {<AD08>, color="grey20"},
+ {<AD09>, color="grey20"}, {<AD10>, color="grey20"}, <AD11>,
+ <AD12>, { <RTRN>, "RTRN" }
+ };
+ };
+ row {
+ top= 38;
+ keys { { <CAPS>, "CAPS" }, <AC01>, <AC02>, <AC03>, <AC04>, <AC05>,
+ <AC06>, {<AC07>, color="grey20"}, {<AC08>, color="grey20"},
+ {<AC09>, color="grey20"}, {<AC10>, color="grey20"}, <AC11>,
+ <AC12>
+ };
+ };
+ row {
+ top= 56;
+ keys { { <LFSH>, "LFSH" }, <AB01>, <AB02>, <AB03>, <AB04>, <AB05>,
+ <AB06>, {<AB07>, color="grey20"}, <AB08>,
+ {<AB09>, color="grey20"}, {<AB10>, color="grey20"}, <AB11>,
+ {<UP>, color="grey20"}, {<RTSH>, key.shape= "CTSH" }
+ };
+ };
+ row {
+ top= 74;
+ keys { { <LCTL>, key.shape= "CTSH" }, {<FN>, color="grey20"},
+ <LWIN>, <LALT>, <NFER>, {<SPCE>, "SPCE" }, <XFER>, <HKTG>,
+ <RALT>, <MENU>, {<LEFT>, color="grey20"},
+ {<DOWN>, color="grey20"},
+ {<RGHT>, key.shape= "CTSH", color="grey20"}
+ };
+ };
+ overlay "SCLK" {
+ <AE07>=<KO7>, <AE08>=<KO8>, <AE09>=<KO9>, <AE10>=<KOMU>,
+ <AD07>=<KO4>, <AD08>=<KO5>, <AD09>=<KO6>, <AD10>=<KOSU>,
+ <AC07>=<KO1>, <AC08>=<KO2>, <AC09>=<KO3>, <AC10>=<KOAD>,
+ <AB07>=<KO0>, <AB09>=<KODL>, <AB10>=<KODV>
+ };
+ overlay "FN" {
+ <UP>=<PGUP>, <LEFT>=<HOME>, <DOWN>=<PGDN>, <RGHT>=<END>
+ };
+ }; // End of "Alpha" section
+
+ alias <AC00> = <CAPS>;
+ alias <AA00> = <LCTL>;
+
+}; // End of "default" geometry
diff --git a/xorg-server/xkeyboard-config/rules/base.lists.part b/xorg-server/xkeyboard-config/rules/base.lists.part index a18585680..a0fecdff1 100644 --- a/xorg-server/xkeyboard-config/rules/base.lists.part +++ b/xorg-server/xkeyboard-config/rules/base.lists.part @@ -50,7 +50,7 @@ genius geniuscomfy2 \
gyration honeywell_euroboard \
hp250x hp5xx hp500fa hpdv5 \
- hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx \
+ hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx htcdream \
ibm_spacesaver ipaq inspiron intel \
logiaccess logicda logicink \
logiex110 logiclx300 \
@@ -104,3 +104,4 @@ lt lv nl no pl pt ro ru \
se sk tr tw ua
+! $htcdreamlayouts = us it de
diff --git a/xorg-server/xkeyboard-config/rules/base.m_g.part b/xorg-server/xkeyboard-config/rules/base.m_g.part index eab19eb9d..978aac0c7 100644 --- a/xorg-server/xkeyboard-config/rules/base.m_g.part +++ b/xorg-server/xkeyboard-config/rules/base.m_g.part @@ -8,6 +8,7 @@ hpmini110 = hp(mini110)
hpdv5 = hp(dv5)
omnikey101 = northgate(omnikey101)
+ sanwaskbkg3 = sanwa(sanwaskbkg3)
$pcmodels = pc(%m)
$pcgeometries = pc(%m)
everex = everex(STEPnote)
diff --git a/xorg-server/xkeyboard-config/rules/base.ml_s.part b/xorg-server/xkeyboard-config/rules/base.ml_s.part index d59c54f26..22bf49a92 100644 --- a/xorg-server/xkeyboard-config/rules/base.ml_s.part +++ b/xorg-server/xkeyboard-config/rules/base.ml_s.part @@ -36,5 +36,7 @@ olpc $olpclayouts = olpc+%l%(m)
olpc * = olpc+%l%(v)
$thinkpads br = pc+br(thinkpad)
+ htcdream $htcdreamlayouts = %l(htcdream)
* $nonlatin = pc+us+%l%(v):2
* * = pc+%l%(v)
+ htcdream us de it = %l(htcdream)
diff --git a/xorg-server/xkeyboard-config/rules/base.o_s.part b/xorg-server/xkeyboard-config/rules/base.o_s.part index 95e81ddb3..2b400e634 100644 --- a/xorg-server/xkeyboard-config/rules/base.o_s.part +++ b/xorg-server/xkeyboard-config/rules/base.o_s.part @@ -111,6 +111,7 @@ esperanto:qwerty = +epo(qwerty)
esperanto:dvorak = +epo(dvorak)
terminate:ctrl_alt_bksp = +terminate(ctrl_alt_bksp)
+ keypad:pointerkeys = +keypad(pointerkeys)
apple:alupckeys = +macintosh_vndr/apple(alupckeys)
shift:both_capslock = +shift(both_capslock)
shift:lshift_both_capslock = +shift(lshift_both_capslock)
diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 8c9b23d82..27cf6e6ff 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -449,6 +449,13 @@ </model>
<model>
<configItem>
+ <name>htcdream</name>
+ <_description>HTC Dream</_description>
+ <vendor>HTC</vendor>
+ </configItem>
+ </model>
+ <model>
+ <configItem>
<name>kinesis</name>
<_description>Kinesis</_description>
<vendor>Kinesis</vendor>
@@ -897,6 +904,13 @@ </model>
<model>
<configItem>
+ <name>sanwaskbkg3</name>
+ <description>Sanwa Supply SKB-KG3</description>
+ <vendor>Sanwa Supply Inc.</vendor>
+ </configItem>
+ </model>
+ <model>
+ <configItem>
<name>sk1300</name>
<_description>SK-1300</_description>
<vendor>NEC</vendor>
@@ -1210,6 +1224,13 @@ <vendor>Creative</vendor>
</configItem>
</model>
+ <model>
+ <configItem>
+ <name>htcdream</name>
+ <_description>Htc Dream phone</_description>
+ <vendor>htc</vendor>
+ </configItem>
+ </model>
</modelList>
<layoutList>
<layout>
@@ -2954,6 +2975,12 @@ </variant>
<variant>
<configItem>
+ <name>kana86</name>
+ <_description>Kana 86</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
<name>OADG109A</name>
<_description>OADG 109A</_description>
</configItem>
@@ -4518,6 +4545,130 @@ <languageList><iso639Id>tsn</iso639Id></languageList>
</configItem>
</layout>
+ <layout>
+ <configItem>
+ <name>ph</name>
+ <_shortDescription>Phi</_shortDescription>
+ <_description>Philippines</_description>
+ <languageList><iso639Id>eng</iso639Id>
+ <iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ <variantList>
+ <variant>
+ <configItem>
+ <name>qwerty-bay</name>
+ <_description>QWERTY (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-dvorak</name>
+ <_description>Capewell-Dvorak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-dvorak-bay</name>
+ <_description>Capewell-Dvorak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-qwerf2k6</name>
+ <_description>Capewell-QWERF 2006 (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-qwerf2k6-bay</name>
+ <_description>Capewell-QWERF 2006 (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>colemak</name>
+ <_description>Colemak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>colemak-bay</name>
+ <_description>Colemak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>dvorak</name>
+ <_description>Dvorak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>dvorak-bay</name>
+ <_description>Dvorak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ </variantList>
+ </layout>
</layoutList>
<optionList>
<group allowMultipleSelection="true">
@@ -5304,6 +5455,12 @@ <description>Both Shift-Keys together toggle ShiftLock</description>
</configItem>
</option>
+ <option>
+ <configItem>
+ <name>keypad:pointerkeys</name>
+ <_description>Toggle PointerKeys with Shift + NumLock.</_description>
+ </configItem>
+ </option>
</group>
<group allowMultipleSelection="true">
<!-- Special shortcuts for the Euro character -->
diff --git a/xorg-server/xkeyboard-config/symbols/Makefile.am b/xorg-server/xkeyboard-config/symbols/Makefile.am index 138578941..79e9ad162 100644 --- a/xorg-server/xkeyboard-config/symbols/Makefile.am +++ b/xorg-server/xkeyboard-config/symbols/Makefile.am @@ -24,7 +24,7 @@ ma mao me \ mk ml mm \
mn mt mv \
ng nl no np \
-pc pk pl pt \
+pc ph pk pl pt \
ro rs ru \
se si sk sn \
sy th \
diff --git a/xorg-server/xkeyboard-config/symbols/de b/xorg-server/xkeyboard-config/symbols/de index b8d482129..241b9c826 100644 --- a/xorg-server/xkeyboard-config/symbols/de +++ b/xorg-server/xkeyboard-config/symbols/de @@ -553,3 +553,48 @@ key.type[group1]="FOUR_LEVEL_ALPHABETIC"; include "level3(ralt_switch)"
};
+
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+
+ name[Group1]= "Germany - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, EuroSign, EuroSign ] };
+ key <AD04> { [ r, R, underscore, underscore ] };
+ key <AD05> { [ t, T, sterling, sterling] };
+ key <AD06> { [ z, Z, division, division ] };
+ key <AD07> { [ u, U, udiaeresis, udiaeresis ] };
+ key <AD08> { [ i, I, minus, minus ] };
+ key <AD09> { [ o, O, odiaeresis, odiaeresis ] };
+ key <AD10> { [ p, P, equal, equal ] };
+
+ //third row
+ key <AC01> { [ a, A, adiaeresis, adiaeresis ] };
+ key <AC02> { [ s, S, ssharp, ssharp] };
+ key <AC03> { [ d ,D, backslash, backslash ] };
+ key <AC04> { [ f, F, braceleft, braceleft ] };
+ key <AC05> { [ g, G, braceright, braceright ] };
+ key <AC06> { [ h, H, multiply, multiply ] };
+ key <AC07> { [ j, J, colon, colon ] };
+ key <AC08> { [ k, K, plus, plus ] };
+ key <AC09> { [ l, L, apostrophe, apostrophe ] };
+
+ //forth row
+ key <AB01> { [ y, Y, bar, bar ] };
+ key <AB02> { [ x, X, bracketleft, bracketleft ] };
+ key <AB03> { [ c, C, bracketright, bracketright ] };
+ key <AB04> { [ v, V, less, less ] };
+ key <AB05> { [ b, B, greater, greater ] };
+ key <AB06> { [ n, N, semicolon, semicolon ] };
+ key <AB07> { [ m, M, quotedbl, quotedbl ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, asciitilde, asciitilde ] };
+
+ include "level3(alt_switch)"
+};
diff --git a/xorg-server/xkeyboard-config/symbols/extras/ru b/xorg-server/xkeyboard-config/symbols/extras/ru index 7e2404250..65ea58653 100644 --- a/xorg-server/xkeyboard-config/symbols/extras/ru +++ b/xorg-server/xkeyboard-config/symbols/extras/ru @@ -13,7 +13,7 @@ xkb_symbols "chu" key <AE02> { [ U0454, U0404, U0465, U0464] }; // є Є ѥ Ѥ
key <AE03> { [ U046F, U046E, U0469, U0468] }; // ѯ Ѯ ѩ Ѩ
key <AE04> { [ U0471, U0470, U046D, U046C] }; // ѱ Ѱ ѭ Ѭ
- key <AE05> { [ U0473, U0472, Cyrillic_ya, Cyrillic_YA] }; // ѳ Ѳ я Я (WHERE Я IS I+A, NOT SMALL YUS)
+ key <AE05> { [ U0473, U0472, UA657, UA656] }; // ѳ Ѳ iotified A
key <AE06> { [ U0475, U0474, U0477, U0476] }; // ѵ Ѵ ѷ Ѷ
key <AE07> { [ U047B, U047A, UA64D, UA64C] }; // ѻ Ѻ ꙍ Ꙍ
key <AE08> { [ U047F, U047E, U046B, U046A] }; // ѿ Ѿ ѫ Ѫ
diff --git a/xorg-server/xkeyboard-config/symbols/inet b/xorg-server/xkeyboard-config/symbols/inet index b3b155bca..478a15371 100644 --- a/xorg-server/xkeyboard-config/symbols/inet +++ b/xorg-server/xkeyboard-config/symbols/inet @@ -120,7 +120,9 @@ xkb_symbols "evdev" { key <HNGL> { [ Hangul ] };
key <HJCV> { [ Hangul_Hanja ] };
- key <FK22> { [ XF86TouchpadToggle ] };
+ key <FK21> { [ XF86TouchpadToggle ] };
+ key <FK22> { [ XF86TouchpadOn ] };
+ key <FK23> { [ XF86TouchpadOff ] };
// key <I120> { [ ] }; // KEY_MACRO
key <I126> { [ plusminus ] };
@@ -1825,3 +1827,31 @@ partial alphanumeric_keys xkb_symbols "pc105" {
include "inet(media_nav_acpi_common)"
};
+
+// HTC Dream
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ key <BKSP> { [ BackSpace ] };
+ key <RTRN> { [ Return ] };
+
+ //first row
+ key <AE01> { [ 1, 1, exclam, exclam ] };
+ key <AE02> { [ 2, 2, at, at ] };
+ key <AE03> { [ 3, 3, numbersign, numbersign ] };
+ key <AE04> { [ 4, 4, dollar, dollar ] };
+ key <AE05> { [ 5, 5, percent, percent ] };
+ key <AE06> { [ 6, 6, dead_circumflex, dead_circumflex ] };
+ key <AE07> { [ 7, 7, ampersand, ampersand ] };
+ key <AE08> { [ 8, 8, asterisk, asterisk ] };
+ key <AE09> { [ 9, 9, parenleft, parenleft ] };
+ key <AE10> { [ 0, 0, parenright, parenright ] };
+
+ //fifth row
+ key <LFSH> { [ Shift_L ] };
+ key <SPCE> { [ space ] };
+ key <AB09> { [ period, period, slash, slash ] };
+ key <RTSH> { [ Shift_R ] };
+
+ //modifiers
+ modifier_map Shift { <LFSH>, <RTSH> };
+};
diff --git a/xorg-server/xkeyboard-config/symbols/it b/xorg-server/xkeyboard-config/symbols/it index 7f703d16f..9222a1ca4 100644 --- a/xorg-server/xkeyboard-config/symbols/it +++ b/xorg-server/xkeyboard-config/symbols/it @@ -1,218 +1,262 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/it' file -// 17 May 2003 Modified by Sebastiano Vigna (vigna@dsi.unimi.it) -// -// $XFree86: xc/programs/xkbcomp/symbols/it,v 1.4 2003/04/19 12:22:12 pascal Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin(type4)" - - name[Group1]="Italy"; - - key <TLDE> { [ backslash, bar, notsign, brokenbar ] }; - - key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] }; - key <AE03> { [ 3, sterling,threesuperior, dead_tilde ] }; - key <AE04> { [ 4, dollar, onequarter, oneeighth ] }; - - key <AE10> { [ 0, equal, braceright, dead_ogonek ] }; - key <AE11> { [apostrophe, question, grave, questiondown ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] }; - - key <AD11> { [ egrave, eacute, bracketleft, braceleft ] }; - key <AD12> { [ plus, asterisk, bracketright, braceright ] }; - - key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, dead_abovering ] }; - - key <AB06> { [ n, N, ntilde, Ntilde ] }; - key <AB08> { [ comma, semicolon, dead_acute, multiply ] }; - key <AB09> { [ period, colon,periodcentered, dead_diaeresis ] }; - key <AB10> { [ minus, underscore, dead_macron, division ] }; - - key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] }; - - key <LSGT> { [ less, greater,guillemotleft,guillemotright] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic italian layout to eliminate all dead keys - - include "it(basic)" - - name[Group1]="Italy - Eliminate dead keys"; - - key <AE02> { [ 2, quotedbl, twosuperior, doubleacute ] }; - key <AE03> { [ 3, sterling,threesuperior, asciitilde ] }; - - key <AE10> { [ 0, equal, braceright, ogonek ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, asciicircum ] }; - - key <AC10> { [ ograve, ccedilla, at, cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, degree ] }; - - key <AB08> { [ comma, semicolon, acute, multiply ] }; - key <AB09> { [ period, colon,periodcentered, diaeresis ] }; - key <AB10> { [ minus, underscore, macron, division ] }; - - key <BKSL> { [ ugrave, section, grave, breve ] }; -}; - -// Copied from macintosh_vndr/it -partial alphanumeric_keys -xkb_symbols "mac" { - - name[Group1]= "Italy - Macintosh"; - - // Alphanumeric section - key <LSGT> { [ less, greater ] }; - key <TLDE> { [ at, numbersign, periodcentered ] }; - key <AE01> { [ ampersand, 1, guillemotleft,guillemotright ] }; - key <AE02> { [ quotedbl, 2 ] }; - key <AE03> { [ apostrophe, 3 ] }; - key <AE04> { [ parenleft, 4, braceleft, bracketleft ] }; - key <AE05> { [ ccedilla, 5, Ccedilla, Iacute ] }; - key <AE06> { [ egrave, 6, paragraph, periodcentered] }; - key <AE07> { [ parenright, 7, braceright, bracketright ] }; - key <AE08> { [ sterling, 8, infinity ] }; - key <AE09> { [ agrave, 9, acute, Ocircumflex ] }; - key <AE10> { [ eacute, 0, grave, Oacute ] }; - key <AE11> { [ minus, underscore ] }; - key <AE12> { [ equal, plus, notequal, plusminus ] }; - - key <AD01> { [ q, Q ] }; - key <AD02> { [ z, Z ] }; - key <AD03> { [ e, E, EuroSign ] }; - key <AD04> { [ r, R, registered ] }; - key <AD05> { [ t, T ] }; - key <AD06> { [ y, Y, Uacute, ydiaeresis ] }; - key <AD07> { [ u, U ] }; - key <AD08> { [ i, I, icircumflex, idiaeresis ] }; - key <AD09> { [ o, O ] }; - key <AD10> { [ p, P ] }; - key <AD11> { [ igrave, asciicircum ] }; - key <AD12> { [ dollar, asterisk ] }; - key <BKSL> { [ section, degree, at, numbersign ] }; - - key <AC01> { [ a, A, aring, Aring ] }; - key <AC02> { [ s, S, ssharp ] }; - key <AC03> { [ d, D ] }; - key <AC04> { [ f, F ] }; - key <AC05> { [ g, G ] }; - key <AC06> { [ h, H, Igrave, Icircumflex ] }; - key <AC07> { [ j, J, Idiaeresis, Iacute ] }; - key <AC08> { [ k, K, Egrave, Ediaeresis ] }; - key <AC09> { [ l, L, ssharp, bar ] }; - key <AC10> { [ m, M, mu, Oacute ] }; - key <AC11> { [ ugrave, percent, ae, AE ] }; - - key <AB01> { [ w, W ] }; - key <AB02> { [ x, X ] }; - key <AB03> { [ c, C, copyright, copyright ] }; - key <AB04> { [ v, V ] }; - key <AB05> { [ b, B ] }; - key <AB06> { [ n, N, dead_tilde ] }; - key <AB07> { [ comma, question, questiondown ] }; - key <AB08> { [ semicolon, period ] }; - key <AB09> { [ colon, slash, bar, backslash ] }; - key <AB10> { [ ograve, exclam, exclamdown ] }; - - // End alphanumeric section - - include "kpdl(dot)" - include "level3(ralt_switch)" -}; - -// Used by Georgian people in Italy, -// contributed by Vladimer Sichinava -partial alphanumeric_keys -xkb_symbols "geo" { - include "it" - include "ge(basic)" - - name[Group1]= "Italy - Georgian"; - key <TLDE> { [ backslash, bar, notsign, brokenbar ] }; - key <AE01> { [ 1, exclam, onesuperior ] }; - key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] }; - key <AE03> { [ 3, sterling, threesuperior, dead_tilde ] }; - key <AE04> { [ 4, dollar, onequarter, oneeighth ] }; - key <AE05> { [ 5, percent, onehalf ] }; - key <AE06> { [ 6, ampersand ] }; - key <AE07> { [ 7, slash, braceleft ] }; - key <AE08> { [ 8, parenleft, bracketleft ] }; - key <AE09> { [ 9, parenright ] }; - key <AE10> { [ 0, equal, braceright, dead_ogonek ] }; - key <AE11> { [apostrophe, question, grave, questiondown ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] }; - - key <AD03> { [0x010010d4, E, EuroSign ] }; - key <AD11> { [ egrave, eacute, bracketleft, braceleft ] }; - key <AD12> { [ plus, asterisk, bracketright, braceright ] }; - - key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, degree ] }; - key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] }; - key <LSGT> { [ less, greater ] }; - - key <AB08> { [ comma, semicolon ] }; - key <AB09> { [ period, colon ] }; - key <AB10> { [ minus, underscore ] }; -}; - -// OLPC Section -xkb_symbols "olpc" { - - include "it(basic)" - - key <AE12> { [ igrave, asciicircum, asciitilde, dead_tilde ] }; - key <BKSL> { [ ugrave, section, Egrave, dead_breve ] }; - key <I219> { [ less, greater, guillemotleft, guillemotright ] }; -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "us" { - - name[Group1]= "Italy - US keyboard with Italian letters"; - - include "us(euro)" - - // Alphanumeric section - - key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key <AE01> { [ 1, exclam, onesuperior ] }; - key <AE02> { [ 2, at, twosuperior ] }; - key <AE03> { [ 3, numbersign, threesuperior ] }; - key <AE06> { [ 6,asciicircum,dead_circumflex ] }; - key <AE10> { [ 0, parenright, degree ] }; - key <AE11> { [ minus, underscore, dead_macron ] }; - - key <AD03> { [ e, E, egrave, Egrave ] }; - key <AD04> { [ r, R, registered ] }; - key <AD07> { [ u, U, ugrave, Ugrave ] }; - key <AD08> { [ i, I, igrave, Igrave ] }; - key <AD09> { [ o, O, ograve, Ograve ] }; - - key <AC01> { [ a, A, agrave, Agrave ] }; - key <AC03> { [ d, D, eacute, Eacute ] }; - key <AC07> { [ j, J, uacute, Uacute ] }; - key <AC08> { [ k, K, iacute, Iacute ] }; - key <AC09> { [ l, L, oacute, Oacute ] }; - key <AC10> { [ semicolon, colon,dead_diaeresis, dead_diaeresis ] }; - key <AC11> { [apostrophe, quotedbl, dead_acute ] }; - - key <AB01> { [ z, Z, aacute, Aacute ] }; - key <AB03> { [ c, C, copyright ] }; - key <AB06> { [ n, N, ntilde, Ntilde ] }; - key <AB08> { [ comma, less, guillemotleft ] }; - key <AB09> { [ period, greater, guillemotright ] }; - - include "level3(ralt_switch)" -}; - +// $XKeyboardConfig$
+
+// based on a keyboard map from an 'xkb/symbols/it' file
+// 17 May 2003 Modified by Sebastiano Vigna (vigna@dsi.unimi.it)
+//
+// $XFree86: xc/programs/xkbcomp/symbols/it,v 1.4 2003/04/19 12:22:12 pascal Exp $
+
+partial default alphanumeric_keys
+xkb_symbols "basic" {
+
+ include "latin(type4)"
+
+ name[Group1]="Italy";
+
+ key <TLDE> { [ backslash, bar, notsign, brokenbar ] };
+
+ key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] };
+ key <AE03> { [ 3, sterling,threesuperior, dead_tilde ] };
+ key <AE04> { [ 4, dollar, onequarter, oneeighth ] };
+
+ key <AE10> { [ 0, equal, braceright, dead_ogonek ] };
+ key <AE11> { [apostrophe, question, grave, questiondown ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] };
+
+ key <AD11> { [ egrave, eacute, bracketleft, braceleft ] };
+ key <AD12> { [ plus, asterisk, bracketright, braceright ] };
+
+ key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, dead_abovering ] };
+
+ key <AB06> { [ n, N, ntilde, Ntilde ] };
+ key <AB08> { [ comma, semicolon, dead_acute, multiply ] };
+ key <AB09> { [ period, colon,periodcentered, dead_diaeresis ] };
+ key <AB10> { [ minus, underscore, dead_macron, division ] };
+
+ key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] };
+
+ key <LSGT> { [ less, greater,guillemotleft,guillemotright] };
+
+ include "level3(ralt_switch)"
+};
+
+partial alphanumeric_keys
+xkb_symbols "nodeadkeys" {
+
+ // Modifies the basic italian layout to eliminate all dead keys
+
+ include "it(basic)"
+
+ name[Group1]="Italy - Eliminate dead keys";
+
+ key <AE02> { [ 2, quotedbl, twosuperior, doubleacute ] };
+ key <AE03> { [ 3, sterling,threesuperior, asciitilde ] };
+
+ key <AE10> { [ 0, equal, braceright, ogonek ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, asciicircum ] };
+
+ key <AC10> { [ ograve, ccedilla, at, cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, degree ] };
+
+ key <AB08> { [ comma, semicolon, acute, multiply ] };
+ key <AB09> { [ period, colon,periodcentered, diaeresis ] };
+ key <AB10> { [ minus, underscore, macron, division ] };
+
+ key <BKSL> { [ ugrave, section, grave, breve ] };
+};
+
+// Copied from macintosh_vndr/it
+partial alphanumeric_keys
+xkb_symbols "mac" {
+
+ name[Group1]= "Italy - Macintosh";
+
+ // Alphanumeric section
+ key <LSGT> { [ less, greater ] };
+ key <TLDE> { [ at, numbersign, periodcentered ] };
+ key <AE01> { [ ampersand, 1, guillemotleft,guillemotright ] };
+ key <AE02> { [ quotedbl, 2 ] };
+ key <AE03> { [ apostrophe, 3 ] };
+ key <AE04> { [ parenleft, 4, braceleft, bracketleft ] };
+ key <AE05> { [ ccedilla, 5, Ccedilla, Iacute ] };
+ key <AE06> { [ egrave, 6, paragraph, periodcentered] };
+ key <AE07> { [ parenright, 7, braceright, bracketright ] };
+ key <AE08> { [ sterling, 8, infinity ] };
+ key <AE09> { [ agrave, 9, acute, Ocircumflex ] };
+ key <AE10> { [ eacute, 0, grave, Oacute ] };
+ key <AE11> { [ minus, underscore ] };
+ key <AE12> { [ equal, plus, notequal, plusminus ] };
+
+ key <AD01> { [ q, Q ] };
+ key <AD02> { [ z, Z ] };
+ key <AD03> { [ e, E, EuroSign ] };
+ key <AD04> { [ r, R, registered ] };
+ key <AD05> { [ t, T ] };
+ key <AD06> { [ y, Y, Uacute, ydiaeresis ] };
+ key <AD07> { [ u, U ] };
+ key <AD08> { [ i, I, icircumflex, idiaeresis ] };
+ key <AD09> { [ o, O ] };
+ key <AD10> { [ p, P ] };
+ key <AD11> { [ igrave, asciicircum ] };
+ key <AD12> { [ dollar, asterisk ] };
+ key <BKSL> { [ section, degree, at, numbersign ] };
+
+ key <AC01> { [ a, A, aring, Aring ] };
+ key <AC02> { [ s, S, ssharp ] };
+ key <AC03> { [ d, D ] };
+ key <AC04> { [ f, F ] };
+ key <AC05> { [ g, G ] };
+ key <AC06> { [ h, H, Igrave, Icircumflex ] };
+ key <AC07> { [ j, J, Idiaeresis, Iacute ] };
+ key <AC08> { [ k, K, Egrave, Ediaeresis ] };
+ key <AC09> { [ l, L, ssharp, bar ] };
+ key <AC10> { [ m, M, mu, Oacute ] };
+ key <AC11> { [ ugrave, percent, ae, AE ] };
+
+ key <AB01> { [ w, W ] };
+ key <AB02> { [ x, X ] };
+ key <AB03> { [ c, C, copyright, copyright ] };
+ key <AB04> { [ v, V ] };
+ key <AB05> { [ b, B ] };
+ key <AB06> { [ n, N, dead_tilde ] };
+ key <AB07> { [ comma, question, questiondown ] };
+ key <AB08> { [ semicolon, period ] };
+ key <AB09> { [ colon, slash, bar, backslash ] };
+ key <AB10> { [ ograve, exclam, exclamdown ] };
+
+ // End alphanumeric section
+
+ include "kpdl(dot)"
+ include "level3(ralt_switch)"
+};
+
+// Used by Georgian people in Italy,
+// contributed by Vladimer Sichinava
+partial alphanumeric_keys
+xkb_symbols "geo" {
+ include "it"
+ include "ge(basic)"
+
+ name[Group1]= "Italy - Georgian";
+ key <TLDE> { [ backslash, bar, notsign, brokenbar ] };
+ key <AE01> { [ 1, exclam, onesuperior ] };
+ key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] };
+ key <AE03> { [ 3, sterling, threesuperior, dead_tilde ] };
+ key <AE04> { [ 4, dollar, onequarter, oneeighth ] };
+ key <AE05> { [ 5, percent, onehalf ] };
+ key <AE06> { [ 6, ampersand ] };
+ key <AE07> { [ 7, slash, braceleft ] };
+ key <AE08> { [ 8, parenleft, bracketleft ] };
+ key <AE09> { [ 9, parenright ] };
+ key <AE10> { [ 0, equal, braceright, dead_ogonek ] };
+ key <AE11> { [apostrophe, question, grave, questiondown ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] };
+
+ key <AD03> { [0x010010d4, E, EuroSign ] };
+ key <AD11> { [ egrave, eacute, bracketleft, braceleft ] };
+ key <AD12> { [ plus, asterisk, bracketright, braceright ] };
+
+ key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, degree ] };
+ key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] };
+ key <LSGT> { [ less, greater ] };
+
+ key <AB08> { [ comma, semicolon ] };
+ key <AB09> { [ period, colon ] };
+ key <AB10> { [ minus, underscore ] };
+};
+
+// OLPC Section
+xkb_symbols "olpc" {
+
+ include "it(basic)"
+
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_tilde ] };
+ key <BKSL> { [ ugrave, section, Egrave, dead_breve ] };
+ key <I219> { [ less, greater, guillemotleft, guillemotright ] };
+};
+
+partial alphanumeric_keys modifier_keys
+xkb_symbols "us" {
+
+ name[Group1]= "Italy - US keyboard with Italian letters";
+
+ include "us(euro)"
+
+ // Alphanumeric section
+
+ key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] };
+ key <AE01> { [ 1, exclam, onesuperior ] };
+ key <AE02> { [ 2, at, twosuperior ] };
+ key <AE03> { [ 3, numbersign, threesuperior ] };
+ key <AE06> { [ 6,asciicircum,dead_circumflex ] };
+ key <AE10> { [ 0, parenright, degree ] };
+ key <AE11> { [ minus, underscore, dead_macron ] };
+
+ key <AD03> { [ e, E, egrave, Egrave ] };
+ key <AD04> { [ r, R, registered ] };
+ key <AD07> { [ u, U, ugrave, Ugrave ] };
+ key <AD08> { [ i, I, igrave, Igrave ] };
+ key <AD09> { [ o, O, ograve, Ograve ] };
+
+ key <AC01> { [ a, A, agrave, Agrave ] };
+ key <AC03> { [ d, D, eacute, Eacute ] };
+ key <AC07> { [ j, J, uacute, Uacute ] };
+ key <AC08> { [ k, K, iacute, Iacute ] };
+ key <AC09> { [ l, L, oacute, Oacute ] };
+ key <AC10> { [ semicolon, colon,dead_diaeresis, dead_diaeresis ] };
+ key <AC11> { [apostrophe, quotedbl, dead_acute ] };
+
+ key <AB01> { [ z, Z, aacute, Aacute ] };
+ key <AB03> { [ c, C, copyright ] };
+ key <AB06> { [ n, N, ntilde, Ntilde ] };
+ key <AB08> { [ comma, less, guillemotleft ] };
+ key <AB09> { [ period, greater, guillemotright ] };
+
+ include "level3(ralt_switch)"
+};
+
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+ name[Group1]= "Italy - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, egrave, egrave] };
+ key <AD04> { [ r, R, eacute, eacute ] };
+ key <AD05> { [ t, T, quotedbl, quotedbl ] };
+ key <AD06> { [ y, Y, apostrophe, apostrophe ] };
+ key <AD07> { [ u, U, ugrave, ugrave ] };
+ key <AD08> { [ i, I, igrave, igrave ] };
+ key <AD09> { [ o, O, ograve, ograve ] };
+ key <AD10> { [ p, P, NoSymbol, NoSymbol ] };
+
+ //third row
+ key <AC01> { [ a, A, agrave, agrave ] };
+ key <AC02> { [ s, S, bar, bar ] };
+ key <AC03> { [ d ,D, EuroSign, EuroSign ] };
+ key <AC04> { [ f, F, sterling, sterling ] };
+ key <AC05> { [ g, G, division, division ] };
+ key <AC06> { [ h, H, multiply, multiply ] };
+ key <AC07> { [ j, J, minus, minus ] };
+ key <AC08> { [ k, K, plus, plus ] };
+ key <AC09> { [ l, L, equal, equal ] };
+
+ //forth row
+ key <AB01> { [ z, Z, underscore, underscore ] };
+ key <AB02> { [ x, X, asciitilde, asciitilde ] };
+ key <AB03> { [ c, C, less, less ] };
+ key <AB04> { [ v, V, greater, greater ] };
+ key <AB05> { [ b, B, backslash, backslash ] };
+ key <AB06> { [ n, N, colon, colon ] };
+ key <AB07> { [ m, M, semicolon, semicolon ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, NoSymbol, NoSymbol ] };
+
+ include "level3(alt_switch)"
+};
+
diff --git a/xorg-server/xkeyboard-config/symbols/jp b/xorg-server/xkeyboard-config/symbols/jp index 7a4016fc5..5e4ba14b7 100644 --- a/xorg-server/xkeyboard-config/symbols/jp +++ b/xorg-server/xkeyboard-config/symbols/jp @@ -116,6 +116,34 @@ xkb_symbols "OADG109A" { key <AE13> { [ yen, bar ] };
};
+// 86 keys with kana map
+partial alphanumeric_keys
+xkb_symbols "kana86" {
+
+ include "pc(function)"
+ include "pc(editing)"
+ include "keypad(numoperdecsep)"
+ include "altwin(menu)"
+ include "jp(kana)"
+ include "jp(OADG109A)"
+ name[Group1]= "Japan - Kana 86";
+
+ key <ESC> { [ Escape ] };
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+ key <BKSP> { [ BackSpace ] };
+ key <TAB> { [ Tab, ISO_Left_Tab ] };
+ key <RTRN> { [ Return ] };
+ key <LFSH> { [ Shift_L ] };
+ key <RTSH> { [ Shift_R ] };
+ key <LWIN> { [ Super_L ] };
+ key <LALT> { [ Alt_L ] };
+ key <SPCE> { [ space ] };
+ key <RALT> { [ Alt_R ] };
+// for compatability with other keyboards connected at the same time
+ key <RWIN> { [ Super_R ] };
+ key <RCTL> { [ Control_R ] };
+};
+
partial alphanumeric_keys
xkb_symbols "kana" {
diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index fe0c2fd36..4dfa1a7e2 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -579,3 +579,58 @@ xkb_symbols "atm" { key <KP2> { [ NoSymbol, KP_8 ] };
key <KP3> { [ NoSymbol, KP_9 ] };
};
+
+
+partial default modifier_keys
+xkb_symbols "pointerkeys" {
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+};
+
+// Only numbers, operators and decimal separator,
+// as seen on keypad overlay on Japanese keyboard.
+// ┌─┬─┬─┬─┐
+// │7│8│9│*│
+// ├─┼─┼─┼─┤
+// │4│5│6│-│
+// ├─┼─┼─┼─┤
+// │1│2│3│+│
+// ├─┼─┼─┼─┤
+// │0│ │·│/│
+// └─┴─┴─┴─┘
+partial keypad_keys
+xkb_symbols "numoperdecsep" {
+ key <KO7> { [ KP_7 ] };
+ key <KO8> { [ KP_8 ] };
+ key <KO9> { [ KP_9 ] };
+// ClsGrb kills whichever client has a grab in effect
+ key <KOMU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ]
+ };
+
+ key <KO4> { [ KP_4 ] };
+ key <KO5> { [ KP_5 ] };
+ key <KO6> { [ KP_6 ] };
+// -VMode switches to the previous video mode
+ key <KOSU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ]
+ };
+
+ key <KO1> { [ KP_1 ] };
+ key <KO2> { [ KP_2 ] };
+ key <KO3> { [ KP_3 ] };
+// +VMode switches to the next video mode
+ key <KOAD> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Add, XF86_Next_VMode ]
+ };
+
+ key <KO0> { [ KP_0 ] };
+ key <KODL> { [ KP_Decimal ] };
+// Ungrab cancels server/keyboard/pointer grabs
+ key <KODV> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Divide, XF86_Ungrab ]
+ };
+};
diff --git a/xorg-server/xkeyboard-config/symbols/pc b/xorg-server/xkeyboard-config/symbols/pc index a359b8023..a6b2063d5 100644 --- a/xorg-server/xkeyboard-config/symbols/pc +++ b/xorg-server/xkeyboard-config/symbols/pc @@ -1,148 +1,148 @@ -// $XKeyboardConfig$ - -// -// $XFree86: xc/programs/xkbcomp/symbols/pc,v 1.9 2003/06/09 19:59:46 dawes Exp $ - -default partial alphanumeric_keys modifier_keys -xkb_symbols "pc105" { - - key <ESC> { [ Escape ] }; - - // the extra key on most European keyboards - key <LSGT> { [ less, greater, bar, brokenbar ] }; - - // these keys are common to all layouts - key <BKSL> { [ backslash, bar ] }; - key <SPCE> { [ space ] }; - - include "pc(function)" - include "pc(editing)" - include "keypad(x11)" - - key <BKSP> { [ BackSpace ] }; - - key <TAB> { [ Tab, ISO_Left_Tab ] }; - key <RTRN> { [ Return ] }; - - key <CAPS> { [ Caps_Lock ] }; - - key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] }; - - key <LFSH> { [ Shift_L ] }; - key <LCTL> { [ Control_L ] }; - - key <LWIN> { [ Super_L ] }; - - key <RTSH> { [ Shift_R ] }; - key <RCTL> { [ Control_R ] }; - - key <RWIN> { [ Super_R ] }; - - key <MENU> { [ Menu ] }; - - // begin modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock, ISO_Lock }; - modifier_map Control{ Control_L, Control_R }; - modifier_map Mod2 { Num_Lock }; - modifier_map Mod4 { Super_L, Super_R }; - - // Fake keys for virtual<->real modifiers mapping - key <LVL3> { [ ISO_Level3_Shift ] }; - key <MDSW> { [ Mode_switch ] }; - modifier_map Mod5 { <LVL3>, <MDSW> }; - - key <ALT> { [ NoSymbol, Alt_L ] }; - include "altwin(meta_alt)" - - key <META> { [ NoSymbol, Meta_L ] }; - modifier_map Mod1 { <META> }; - - key <SUPR> { [ NoSymbol, Super_L ] }; - modifier_map Mod4 { <SUPR> }; - - key <HYPR> { [ NoSymbol, Hyper_L ] }; - modifier_map Mod4 { <HYPR> }; - - key <OUTP> { [ XF86Display ] }; - key <KITG> { [ XF86KbdLightOnOff ] }; - key <KIDN> { [ XF86KbdBrightnessDown ] }; - key <KIUP> { [ XF86KbdBrightnessUp ] }; -}; - -partial hidden alphanumeric_keys -xkb_symbols "function" { - key <FK01> { - type="CTRL+ALT", - symbols[Group1]= [ F1, XF86_Switch_VT_1 ] - }; - key <FK02> { - type="CTRL+ALT", - symbols[Group1]= [ F2, XF86_Switch_VT_2 ] - }; - key <FK03> { - type="CTRL+ALT", - symbols[Group1]= [ F3, XF86_Switch_VT_3 ] - }; - key <FK04> { - type="CTRL+ALT", - symbols[Group1]= [ F4, XF86_Switch_VT_4 ] - }; - key <FK05> { - type="CTRL+ALT", - symbols[Group1]= [ F5, XF86_Switch_VT_5 ] - }; - key <FK06> { - type="CTRL+ALT", - symbols[Group1]= [ F6, XF86_Switch_VT_6 ] - }; - key <FK07> { - type="CTRL+ALT", - symbols[Group1]= [ F7, XF86_Switch_VT_7 ] - }; - key <FK08> { - type="CTRL+ALT", - symbols[Group1]= [ F8, XF86_Switch_VT_8 ] - }; - key <FK09> { - type="CTRL+ALT", - symbols[Group1]= [ F9, XF86_Switch_VT_9 ] - }; - key <FK10> { - type="CTRL+ALT", - symbols[Group1]= [ F10, XF86_Switch_VT_10 ] - }; - key <FK11> { - type="CTRL+ALT", - symbols[Group1]= [ F11, XF86_Switch_VT_11 ] - }; - key <FK12> { - type="CTRL+ALT", - symbols[Group1]= [ F12, XF86_Switch_VT_12 ] - }; -}; - -partial hidden alphanumeric_keys -xkb_symbols "editing" { - key <PRSC> { - type= "PC_ALT_LEVEL2", - symbols[Group1]= [ Print, Sys_Req ] - }; - key <SCLK> { [ Scroll_Lock ] }; - key <PAUS> { - type= "PC_CONTROL_LEVEL2", - symbols[Group1]= [ Pause, Break ] - }; - key <INS> { [ Insert ] }; - key <HOME> { [ Home ] }; - key <PGUP> { [ Prior ] }; - key <DELE> { [ Delete ] }; - key <END> { [ End ] }; - key <PGDN> { [ Next ] }; - - key <UP> { [ Up ] }; - key <LEFT> { [ Left ] }; - key <DOWN> { [ Down ] }; - key <RGHT> { [ Right ] }; -}; - +// $XKeyboardConfig$
+
+//
+// $XFree86: xc/programs/xkbcomp/symbols/pc,v 1.9 2003/06/09 19:59:46 dawes Exp $
+
+default partial alphanumeric_keys modifier_keys
+xkb_symbols "pc105" {
+
+ key <ESC> { [ Escape ] };
+
+ // the extra key on most European keyboards
+ key <LSGT> { [ less, greater, bar, brokenbar ] };
+
+ // these keys are common to all layouts
+ key <BKSL> { [ backslash, bar ] };
+ key <SPCE> { [ space ] };
+
+ include "pc(function)"
+ include "pc(editing)"
+ include "keypad(x11)"
+
+ key <BKSP> { [ BackSpace ] };
+
+ key <TAB> { [ Tab, ISO_Left_Tab ] };
+ key <RTRN> { [ Return ] };
+
+ key <CAPS> { [ Caps_Lock ] };
+
+ key <NMLK> { [ Num_Lock ] };
+
+ key <LFSH> { [ Shift_L ] };
+ key <LCTL> { [ Control_L ] };
+
+ key <LWIN> { [ Super_L ] };
+
+ key <RTSH> { [ Shift_R ] };
+ key <RCTL> { [ Control_R ] };
+
+ key <RWIN> { [ Super_R ] };
+
+ key <MENU> { [ Menu ] };
+
+ // begin modifier mappings
+ modifier_map Shift { Shift_L, Shift_R };
+ modifier_map Lock { Caps_Lock, ISO_Lock };
+ modifier_map Control{ Control_L, Control_R };
+ modifier_map Mod2 { Num_Lock };
+ modifier_map Mod4 { Super_L, Super_R };
+
+ // Fake keys for virtual<->real modifiers mapping
+ key <LVL3> { [ ISO_Level3_Shift ] };
+ key <MDSW> { [ Mode_switch ] };
+ modifier_map Mod5 { <LVL3>, <MDSW> };
+
+ key <ALT> { [ NoSymbol, Alt_L ] };
+ include "altwin(meta_alt)"
+
+ key <META> { [ NoSymbol, Meta_L ] };
+ modifier_map Mod1 { <META> };
+
+ key <SUPR> { [ NoSymbol, Super_L ] };
+ modifier_map Mod4 { <SUPR> };
+
+ key <HYPR> { [ NoSymbol, Hyper_L ] };
+ modifier_map Mod4 { <HYPR> };
+
+ key <OUTP> { [ XF86Display ] };
+ key <KITG> { [ XF86KbdLightOnOff ] };
+ key <KIDN> { [ XF86KbdBrightnessDown ] };
+ key <KIUP> { [ XF86KbdBrightnessUp ] };
+};
+
+partial hidden alphanumeric_keys
+xkb_symbols "function" {
+ key <FK01> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F1, XF86_Switch_VT_1 ]
+ };
+ key <FK02> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F2, XF86_Switch_VT_2 ]
+ };
+ key <FK03> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F3, XF86_Switch_VT_3 ]
+ };
+ key <FK04> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F4, XF86_Switch_VT_4 ]
+ };
+ key <FK05> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F5, XF86_Switch_VT_5 ]
+ };
+ key <FK06> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F6, XF86_Switch_VT_6 ]
+ };
+ key <FK07> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F7, XF86_Switch_VT_7 ]
+ };
+ key <FK08> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F8, XF86_Switch_VT_8 ]
+ };
+ key <FK09> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F9, XF86_Switch_VT_9 ]
+ };
+ key <FK10> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F10, XF86_Switch_VT_10 ]
+ };
+ key <FK11> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F11, XF86_Switch_VT_11 ]
+ };
+ key <FK12> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F12, XF86_Switch_VT_12 ]
+ };
+};
+
+partial hidden alphanumeric_keys
+xkb_symbols "editing" {
+ key <PRSC> {
+ type= "PC_ALT_LEVEL2",
+ symbols[Group1]= [ Print, Sys_Req ]
+ };
+ key <SCLK> { [ Scroll_Lock ] };
+ key <PAUS> {
+ type= "PC_CONTROL_LEVEL2",
+ symbols[Group1]= [ Pause, Break ]
+ };
+ key <INS> { [ Insert ] };
+ key <HOME> { [ Home ] };
+ key <PGUP> { [ Prior ] };
+ key <DELE> { [ Delete ] };
+ key <END> { [ End ] };
+ key <PGDN> { [ Next ] };
+
+ key <UP> { [ Up ] };
+ key <LEFT> { [ Left ] };
+ key <DOWN> { [ Down ] };
+ key <RGHT> { [ Right ] };
+};
+
diff --git a/xorg-server/xkeyboard-config/symbols/ph b/xorg-server/xkeyboard-config/symbols/ph new file mode 100644 index 000000000..9ed2112e8 --- /dev/null +++ b/xorg-server/xkeyboard-config/symbols/ph @@ -0,0 +1,999 @@ +////////////////////////////////////////////////////////////////////////////////
+// Philippines National Keyboard Layout v1.0.0 (2010-10-23) //
+// http://laibcoms.com/sandbox/the-philippines-national-keyboard-layout //
+// //
+// License: GNU/GPLv3 //
+// //
+// Loosely based on ISO/IEC 9995-3:2009 //
+// * glyphs that are not used in Philippine Languages and //
+// Philippine English were not included //
+// * Additions/Changes that are not part of ISO/IEC 9995-3:2009 //
+// were added //
+// //
+// http://en.wikipedia.org/wiki/ISO/IEC_9995 //
+// http://www.fileformat.info/info/unicode/char/20B1/index.htm //
+// //
+// By: Ubuntu Philippines LoCo Team //
+// Site: http://ubuntu-ph.org //
+// //
+// Project Contact: JC John Sese Cuneta / 謝施洗 / ᜑᜓᜏᜈ᜔ ᜃᜓᜈᜒᜆ //
+// XMPP/Jabber: jcjohn.sesecuneta@talkr.im //
+// Email: jcjohn.sesecuneta@laibcoms.com //
+////////////////////////////////////////////////////////////////////////////////
+
+// QWERTY (Latin) version
+// http://en.wikipedia.org/wiki/QWERTY
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & ← │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ E Œ │ R ¶ │ T │ Y │ U │ I İ │ O Ø │ P │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ e œ │ r ® │ t ™ │ y ¥ │ u │ i ı │ o ø │ p ₱ │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ S │ D │ F ª │ G │ H │ J │ K │ L │ : │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ s § │ d │ f │ g │ h │ j │ k │ l │ ; │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ N Ñ │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ n ñ │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial default alphanumeric_keys
+xkb_symbols "basic" {
+
+ name[Group1]= "Philippines";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AD04> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD05> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ // D row; QWERTY row, right side
+ key <AD06> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD07> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AD08> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AD09> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AD10> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC03> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC04> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AC05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AC08> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AC09> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AC10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// QWERTY (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ ᜁ │ │ │ │ ᜂ │ ᜁ │ ᜂ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ ◌ᜒ │ ᜍ │ ᜆ │ ᜌ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ᜉ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜐ │ ᜇ │ │ ᜄ │ ᜑ │ │ ᜃ │ ᜎ │ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜈ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "qwerty-bay" {
+
+ name[Group1]= "Philippines - QWERTY (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD04> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD05> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ // D row; QWERTY row, right side
+ key <AD06> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD07> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD09> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD10> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC03> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC08> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AC09> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AC10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-Dvorak (Latin) version
+// http://www.michaelcapewell.com/projects/keyboard/index.htm#The_Capewell-Dvorak_Layout
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ { │ } ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ [ │ ] ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ " ̋◌ │ < ̨◌ │ > ␣ │ P │ Y │ Q │ F ª │ G │ R ¶ │ K │ ? ¿ │ + ∓ │ | Ə │
+// ┃Tab ↹ ┃ ' ́◌ │ , ̧◌ │ . … │ p ₱ │ y ¥ │ q │ f │ g │ r ® │ k │ / ÷ │ = ± │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ O Ø │ A Æ │ E Œ │ I İ │ U │ D │ H │ T │ N Ñ │ S │ _ ◌͠ ┃ Enter ┃
+// ┃Caps ⇬ ┃ o ø │ a æ │ e œ │ i ı │ u │ d │ h │ t ™ │ n ñ │ s § │ - ¬ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ J │ L │ M º │ W │ B ’ │ : ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ j │ l │ m µ │ w │ b ” │ ; ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-dvorak" {
+
+ name[Group1]= "Philippines - Capewell-Dvorak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AE12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+ key <AD02> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AD03> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ // D row; Upper row, right side
+ key <AD06> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD07> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD08> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ key <AD09> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD10> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AD11> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+ key <AD12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC02> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC04> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC05> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ // C row; Home row, right side
+ key <AC06> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC07> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC08> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC09> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC10> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ // B row; Lower row, right side
+ key <AB06> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AB09> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ key <AB10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-Dvorak (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ │ │
+// ┃Tab ↹ ┃ │ ᜵ │ ᜶ │ ᜉ │ ᜌ │ │ │ ᜄ │ ᜍ │ ᜃ │ │ ◌᜔ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ ᜂ │ │ ᜁ │ ᜁ │ ᜂ │ │ │ │ ᜅ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ◌ᜓ │ ᜀ │ ◌ᜒ │ ◌ᜒ │ ◌ᜓ │ ᜇ │ ᜑ │ ᜆ │ ᜈ │ ᜐ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ │ ᜎ │ ᜋ │ ᜏ │ ᜊ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-dvorak-bay" {
+
+ name[Group1]= "Philippines - Capewell-Dvorak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AD03> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD08> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ key <AD09> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD10> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC02> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC04> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC05> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ // C row; Home row, right side
+ key <AC06> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC07> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC08> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC09> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC10> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // B row; Lower row, right side
+ key <AB06> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AB09> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-QWERF 2006 (Latin) version
+// http://www.michaelcapewell.com/projects/keyboard/index.htm#The_QWERF_Layout
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ E Œ │ R ¶ │ F ª │ J │ Y │ K │ L │ : │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ e œ │ r ® │ f │ j │ y ¥ │ k │ l │ ; │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ S │ D │ T │ G │ H │ U │ I İ │ O Ø │ P │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ s § │ d │ t ™ │ g │ h │ u │ i ı │ o ø │ p ₱ │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ N Ñ │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ n ñ │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-qwerf2k6" {
+
+ name[Group1]= "Philippines - Capewell-QWERF 2006 (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AD04> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD05> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ // D row; Upper row, right side
+ key <AD06> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AD07> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD08> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AD09> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC03> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC04> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AC08> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC09> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC10> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-QWERF 2006 (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ ᜁ │ │ │ │ │ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ ◌ᜒ │ ᜍ │ │ │ ᜌ │ ᜃ │ ᜎ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ ᜂ │ ᜁ │ ᜂ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜐ │ ᜇ │ ᜆ │ ᜄ │ ᜑ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ᜉ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜈ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-qwerf2k6-bay" {
+
+ name[Group1]= "Philippines - Capewell-QWERF 2006 (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD04> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD08> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AD09> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC03> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC04> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC09> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC10> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Colemak (Latin) version
+// http://colemak.com
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ F ª │ P │ G │ J │ L │ U │ Y │ : │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ f │ p ₱ │ g │ j │ l │ u │ y ¥ │ ; │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ R ¶ │ S │ T │ D │ H │ N Ñ │ E Œ │ I İ │ O Ø │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ r ® │ s § │ t ™ │ d │ h │ n ñ │ e œ │ i ı │ o ø │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ K │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ k │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "colemak" {
+
+ name[Group1]= "Philippines - Colemak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // D row; Upper row, right side
+ key <AD06> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AD07> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD08> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AD09> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AC03> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC04> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC05> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC08> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC09> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC10> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Colemak (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ ᜂ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ │ ᜉ │ ᜄ │ │ ᜎ │ ◌ᜓ │ ᜌ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ ᜁ │ ᜁ │ ᜂ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜍ │ ᜐ │ ᜆ │ ᜇ │ ᜑ │ ᜈ │ ◌ᜒ │ ◌ᜒ │ ◌ᜓ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜃ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "colemak-bay" {
+
+ name[Group1]= "Philippines - Colemak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD08> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD09> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AC03> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC04> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC05> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC09> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC10> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Dvorak Simplified (Latin) version
+// http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ { │ } ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ [ │ ] ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ " ̋◌ │ < ̨◌ │ > ␣ │ P │ Y │ F ª │ G │ C ¢ │ R ¶ │ L │ ? ¿ │ + ∓ │ | Ə │
+// ┃Tab ↹ ┃ ' ́◌ │ , ̧◌ │ . … │ p ₱ │ y ¥ │ f │ g │ c © │ r ® │ l │ / ÷ │ = ± │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ O Ø │ E Œ │ U │ I İ │ D │ H │ T │ N Ñ │ S │ _ ◌͠ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ o ø │ e œ │ u │ i ı │ d │ h │ t ™ │ n ñ │ s § │ - ¬ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ : │ Q │ J │ K │ X · │ B ’ │ M º │ W │ V ‘ │ Z » ┃ ┃
+// ┃Shift ⇧┃ │ ; │ q │ j │ k │ x × │ b ” │ m µ │ w │ v “ │ z « ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "dvorak" {
+
+ name[Group1]= "Philippines - Dvorak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AE12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+ key <AD02> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AD03> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ // D row; Upper row, right side
+ key <AD06> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD07> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ key <AD08> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AD09> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD10> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD11> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+ key <AD12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC04> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AC05> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ // C row; Home row, right side
+ key <AC06> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC07> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC08> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC09> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC10> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AB02> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AB03> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AB04> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AB05> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ // B row; Lower row, right side
+ key <AB06> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AB09> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB10> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Dvorak Simplified (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ │ │
+// ┃Tab ↹ ┃ │ ᜵ │ ᜶ │ ᜉ │ ᜌ │ │ ᜄ │ │ ᜍ │ ᜎ │ │ ◌᜔ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ ᜂ │ ᜁ │ ᜂ │ ᜁ │ │ │ │ ᜅ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ◌ᜒ │ ᜇ │ ᜑ │ ᜆ │ ᜈ │ ᜐ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ ᜃ │ │ ᜊ │ ᜋ │ ᜏ │ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "dvorak-bay" {
+
+ name[Group1]= "Philippines - Dvorak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AD03> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ key <AD08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD09> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD10> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC04> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC05> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ // C row; Home row, right side
+ key <AC06> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC07> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC08> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC09> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC10> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AB05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // B row; Lower row, right side
+ key <AB06> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AB09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ │ │ │ │ │ │ │ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ │ │ │ │ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+
+
+
diff --git a/xorg-server/xkeyboard-config/symbols/us b/xorg-server/xkeyboard-config/symbols/us index e2c40a4e5..2d9523922 100644 --- a/xorg-server/xkeyboard-config/symbols/us +++ b/xorg-server/xkeyboard-config/symbols/us @@ -1147,3 +1147,48 @@ xkb_symbols "srp" { include "level3(ralt_switch)"
};
+
+//based on http://upload.wikimedia.org/wikipedia/commons/1/18/T-Mobile_G1_launch_event_2.jpg
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+ name[Group1]= "USA - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, underscore, underscore ] };
+ key <AD04> { [ r, R, sterling, sterling ] };
+ key <AD05> { [ t, T, EuroSign, EuroSign ] };
+ key <AD06> { [ y, Y, division, division ] };
+ key <AD07> { [ u, U, multiply, multiply ] };
+ key <AD08> { [ i, I, minus, minus ] };
+ key <AD09> { [ o, O, plus, plus ] };
+ key <AD10> { [ p, P, equal, equal ] };
+
+ //third row
+ key <AC01> { [ a, A, NoSymbol, NoSymbol ] };
+ key <AC02> { [ s, S, bar, bar ] };
+ key <AC03> { [ d ,D, backslash, backslash ] };
+ key <AC04> { [ f, F, braceleft, braceleft ] };
+ key <AC05> { [ g, G, braceright, braceright ] };
+ key <AC06> { [ h, H, colon, colon ] };
+ key <AC07> { [ j, J, semicolon, semicolon ] };
+ key <AC08> { [ k, K, quotedbl, quotedbl ] };
+ key <AC09> { [ l, L, apostrophe, apostrophe ] };
+
+ //forth row
+ key <AB01> { [ z, Z, NoSymbol, NoSymbol ] };
+ key <AB02> { [ x, X, NoSymbol, NoSymbol ] };
+ key <AB03> { [ c, C, NoSymbol, NoSymbol ] };
+ key <AB04> { [ v, V, bracketleft, bracketleft ] };
+ key <AB05> { [ b, B, bracketright, bracketright ] };
+ key <AB06> { [ n, N, less, less ] };
+ key <AB07> { [ m, M, greater, greater ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, asciitilde, asciitilde ] };
+
+ include "level3(alt_switch)"
+};
\ No newline at end of file |