Merge branch 'master' into xi2
This commit is contained in:
commit
6c3b633299
42
Xext/dpms.c
42
Xext/dpms.c
|
@ -26,13 +26,6 @@ Equipment Corporation.
|
|||
|
||||
******************************************************************/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
*
|
||||
* @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
@ -50,33 +43,6 @@ Equipment Corporation.
|
|||
#include "dpmsproc.h"
|
||||
#include "modinit.h"
|
||||
|
||||
static DISPATCH_PROC(ProcDPMSDispatch);
|
||||
static DISPATCH_PROC(SProcDPMSDispatch);
|
||||
static DISPATCH_PROC(ProcDPMSGetVersion);
|
||||
static DISPATCH_PROC(SProcDPMSGetVersion);
|
||||
static DISPATCH_PROC(ProcDPMSGetTimeouts);
|
||||
static DISPATCH_PROC(SProcDPMSGetTimeouts);
|
||||
static DISPATCH_PROC(ProcDPMSSetTimeouts);
|
||||
static DISPATCH_PROC(SProcDPMSSetTimeouts);
|
||||
static DISPATCH_PROC(ProcDPMSEnable);
|
||||
static DISPATCH_PROC(SProcDPMSEnable);
|
||||
static DISPATCH_PROC(ProcDPMSDisable);
|
||||
static DISPATCH_PROC(SProcDPMSDisable);
|
||||
static DISPATCH_PROC(ProcDPMSForceLevel);
|
||||
static DISPATCH_PROC(SProcDPMSForceLevel);
|
||||
static DISPATCH_PROC(ProcDPMSInfo);
|
||||
static DISPATCH_PROC(SProcDPMSInfo);
|
||||
static DISPATCH_PROC(ProcDPMSCapable);
|
||||
static DISPATCH_PROC(SProcDPMSCapable);
|
||||
|
||||
void
|
||||
DPMSExtensionInit(INITARGS)
|
||||
{
|
||||
AddExtension(DPMSExtensionName, 0, 0,
|
||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||
NULL, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
static int
|
||||
ProcDPMSGetVersion(ClientPtr client)
|
||||
{
|
||||
|
@ -414,3 +380,11 @@ SProcDPMSDispatch (ClientPtr client)
|
|||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DPMSExtensionInit(INITARGS)
|
||||
{
|
||||
AddExtension(DPMSExtensionName, 0, 0,
|
||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||
NULL, StandardMinorOpcode);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/* Prototypes for functions that the DDX must provide */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
|
@ -11,7 +10,6 @@
|
|||
#include "dixstruct.h"
|
||||
|
||||
int DPMSSet(ClientPtr client, int level);
|
||||
int DPMSGet(int *plevel);
|
||||
Bool DPMSSupported(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,11 +39,6 @@ Bool DPMSSupported(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
int DPMSGet(int *plevel)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DPMSSet(ClientPtr client, int level)
|
||||
{
|
||||
return Success;
|
||||
|
|
|
@ -1971,6 +1971,10 @@ SELinuxExtensionInit(INITARGS)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Don't init unless there's something to do */
|
||||
if (!security_get_boolean_active("xserver_object_manager"))
|
||||
return;
|
||||
|
||||
/* Check SELinux mode in configuration file */
|
||||
switch(selinuxEnforcingState) {
|
||||
case SELINUX_MODE_DISABLED:
|
||||
|
|
14
Xext/xtest.c
14
Xext/xtest.c
|
@ -159,6 +159,7 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
int nevents = 0;
|
||||
int i;
|
||||
int base = 0;
|
||||
int flags = 0;
|
||||
|
||||
nev = (stuff->length << 2) - sizeof(xReq);
|
||||
if ((nev % sizeof(xEvent)) || !nev)
|
||||
|
@ -209,8 +210,14 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
client->errorValue = ev->u.u.type;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
if (ev->u.u.detail == xFalse)
|
||||
flags |= POINTER_ABSOLUTE;
|
||||
} else
|
||||
{
|
||||
firstValuator = 0;
|
||||
flags |= POINTER_ABSOLUTE;
|
||||
}
|
||||
|
||||
if (nev > 1 && !dev->valuator)
|
||||
{
|
||||
|
@ -279,6 +286,8 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
valuators[1] = ev->u.keyButtonPointer.rootY;
|
||||
numValuators = 2;
|
||||
firstValuator = 0;
|
||||
if (ev->u.u.detail == xFalse)
|
||||
flags = POINTER_ABSOLUTE | POINTER_SCREEN;
|
||||
break;
|
||||
default:
|
||||
client->errorValue = ev->u.u.type;
|
||||
|
@ -376,14 +385,13 @@ ProcXTestFakeInput(ClientPtr client)
|
|||
GetEventList(&events);
|
||||
switch(type) {
|
||||
case MotionNotify:
|
||||
nevents = GetPointerEvents(events, dev, type, 0,
|
||||
(ev->u.u.detail == xFalse) ? POINTER_ABSOLUTE : 0,
|
||||
nevents = GetPointerEvents(events, dev, type, 0, flags,
|
||||
firstValuator, numValuators, valuators);
|
||||
break;
|
||||
case ButtonPress:
|
||||
case ButtonRelease:
|
||||
nevents = GetPointerEvents(events, dev, type, ev->u.u.detail,
|
||||
POINTER_ABSOLUTE, firstValuator,
|
||||
flags, firstValuator,
|
||||
numValuators, valuators);
|
||||
break;
|
||||
case KeyPress:
|
||||
|
|
|
@ -125,13 +125,13 @@ compCreateOverlayWindow (ScreenPtr pScreen)
|
|||
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||
WindowPtr pRoot = WindowTable[pScreen->myNum];
|
||||
WindowPtr pWin;
|
||||
XID overrideRedirect = TRUE;
|
||||
XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
|
||||
int result;
|
||||
|
||||
pWin = cs->pOverlayWin =
|
||||
CreateWindow (cs->overlayWid, pRoot,
|
||||
0, 0, pScreen->width, pScreen->height, 0,
|
||||
InputOutput, CWOverrideRedirect, &overrideRedirect,
|
||||
InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
|
||||
pRoot->drawable.depth,
|
||||
serverClient, pScreen->rootVisual, &result);
|
||||
if (pWin == NULL)
|
||||
|
|
|
@ -1427,7 +1427,7 @@ ProcSetModifierMapping(ClientPtr client)
|
|||
rc = change_modmap(client, PickKeyboard(client), (KeyCode *)&stuff[1],
|
||||
stuff->numKeyPerModifier);
|
||||
if (rc == MappingFailed || rc == -1)
|
||||
rc = BadValue;
|
||||
return BadValue;
|
||||
if (rc != Success && rc != MappingSuccess && rc != MappingFailed &&
|
||||
rc != MappingBusy)
|
||||
return rc;
|
||||
|
@ -1510,6 +1510,8 @@ ProcChangeKeyboardMapping(ClientPtr client)
|
|||
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
|
||||
if (tmp->isMaster || tmp->u.master != pDev)
|
||||
continue;
|
||||
if (!tmp->key)
|
||||
continue;
|
||||
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
|
||||
if (rc != Success)
|
||||
|
|
|
@ -3459,37 +3459,16 @@ KillAllClients(void)
|
|||
|
||||
void InitClient(ClientPtr client, int i, pointer ospriv)
|
||||
{
|
||||
memset(client, 0, sizeof(*client));
|
||||
client->index = i;
|
||||
client->sequence = 0;
|
||||
client->clientAsMask = ((Mask)i) << CLIENTOFFSET;
|
||||
client->clientGone = FALSE;
|
||||
client->closeDownMode = i ? DestroyAll : RetainPermanent;
|
||||
client->numSaved = 0;
|
||||
client->saveSet = (SaveSetElt *)NULL;
|
||||
client->noClientException = Success;
|
||||
#ifdef DEBUG
|
||||
client->requestLogIndex = 0;
|
||||
#endif
|
||||
client->requestVector = InitialVector;
|
||||
client->osPrivate = ospriv;
|
||||
client->swapped = FALSE;
|
||||
client->big_requests = FALSE;
|
||||
client->priority = 0;
|
||||
client->clientState = ClientStateInitial;
|
||||
client->devPrivates = NULL;
|
||||
client->xkbClientFlags = 0;
|
||||
client->mapNotifyMask = 0;
|
||||
client->newKeyboardNotifyMask = 0;
|
||||
client->vMinor = client->vMajor = 0;
|
||||
QueryMinMaxKeyCodes(&client->minKC,&client->maxKC);
|
||||
client->replyBytesRemaining = 0;
|
||||
client->fontResFunc = NULL;
|
||||
client->smart_priority = 0;
|
||||
client->smart_start_tick = SmartScheduleTime;
|
||||
client->smart_stop_tick = SmartScheduleTime;
|
||||
client->smart_check_tick = SmartScheduleTime;
|
||||
|
||||
client->clientPtr = NULL;
|
||||
}
|
||||
|
||||
/************************
|
||||
|
|
|
@ -1734,7 +1734,7 @@ AllowSome(ClientPtr client,
|
|||
{
|
||||
if (dev == thisDev)
|
||||
continue;
|
||||
devgrabinfo = (core) ? &dev->deviceGrab : &dev->deviceGrab;
|
||||
devgrabinfo = &dev->deviceGrab;
|
||||
if (devgrabinfo->grab
|
||||
&& SameClient(devgrabinfo->grab, client))
|
||||
devgrabinfo->sync.state = THAWED;
|
||||
|
|
|
@ -95,25 +95,8 @@ int ScreenSaverBlanking;
|
|||
int ScreenSaverAllowExposures;
|
||||
|
||||
#ifdef DPMSExtension
|
||||
# ifndef DEFAULT_STANDBY_TIME
|
||||
# define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2
|
||||
# endif
|
||||
# ifndef DEFAULT_SUSPEND_TIME
|
||||
# define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3
|
||||
# endif
|
||||
# ifndef DEFAULT_OFF_TIME
|
||||
# define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4
|
||||
# endif
|
||||
# ifndef DEFAULT_DPMS_ENABLED
|
||||
# define DEFAULT_DPMS_ENABLED TRUE
|
||||
# endif
|
||||
CARD32 defaultDPMSStandbyTime = DEFAULT_STANDBY_TIME;
|
||||
CARD32 defaultDPMSSuspendTime = DEFAULT_SUSPEND_TIME;
|
||||
CARD32 defaultDPMSOffTime = DEFAULT_OFF_TIME;
|
||||
CARD16 DPMSPowerLevel = 0;
|
||||
Bool defaultDPMSEnabled = DEFAULT_DPMS_ENABLED;
|
||||
Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command */
|
||||
Bool DPMSDisabledSwitch = FALSE; /* lind switch states */
|
||||
Bool DPMSDisabledSwitch = FALSE;
|
||||
Bool DPMSCapableFlag = FALSE;
|
||||
CARD32 DPMSStandbyTime;
|
||||
CARD32 DPMSSuspendTime;
|
||||
|
|
|
@ -235,6 +235,9 @@ static int build_modmap_from_modkeymap(CARD8 *modmap, KeyCode *modkeymap,
|
|||
if (!modkeymap[i])
|
||||
continue;
|
||||
|
||||
if (modkeymap[i] >= MAP_LENGTH)
|
||||
return BadValue;
|
||||
|
||||
if (modmap[modkeymap[i]])
|
||||
return BadValue;
|
||||
|
||||
|
|
|
@ -269,10 +269,10 @@ int main(int argc, char *argv[], char *envp[])
|
|||
ScreenSaverBlanking = defaultScreenSaverBlanking;
|
||||
ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
|
||||
#ifdef DPMSExtension
|
||||
DPMSStandbyTime = defaultDPMSStandbyTime;
|
||||
DPMSSuspendTime = defaultDPMSSuspendTime;
|
||||
DPMSOffTime = defaultDPMSOffTime;
|
||||
DPMSEnabled = defaultDPMSEnabled;
|
||||
DPMSStandbyTime = DEFAULT_SCREEN_SAVER_TIME;
|
||||
DPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
|
||||
DPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
|
||||
DPMSEnabled = TRUE;
|
||||
DPMSPowerLevel = 0;
|
||||
#endif
|
||||
InitBlockAndWakeupHandlers();
|
||||
|
|
|
@ -964,9 +964,6 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
|
||||
ButtonReleaseMask | PointerMotionMask)
|
||||
|
||||
/*****
|
||||
* ChangeWindowAttributes
|
||||
*
|
||||
|
|
|
@ -1134,6 +1134,7 @@ static void
|
|||
determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
|
||||
{
|
||||
GLenum target = 0;
|
||||
GLenum format = 0;
|
||||
int i;
|
||||
__GLXdrawable *pGlxDraw;
|
||||
|
||||
|
@ -1150,6 +1151,9 @@ determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
|
||||
format = attribs[2 * i + 1];
|
||||
}
|
||||
|
||||
if (!target) {
|
||||
|
@ -1162,6 +1166,7 @@ determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
|
|||
}
|
||||
|
||||
pGlxDraw->target = target;
|
||||
pGlxDraw->format = format;
|
||||
}
|
||||
|
||||
int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||
|
|
|
@ -72,6 +72,7 @@ struct __GLXdrawable {
|
|||
int refCount;
|
||||
|
||||
GLenum target;
|
||||
GLenum format;
|
||||
|
||||
/*
|
||||
** Event mask
|
||||
|
|
|
@ -251,9 +251,16 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
if (texBuffer == NULL)
|
||||
return Success;
|
||||
|
||||
texBuffer->setTexBuffer(context->driContext,
|
||||
glxPixmap->target,
|
||||
drawable->driDrawable);
|
||||
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
|
||||
(*texBuffer->setTexBuffer2)(context->driContext,
|
||||
glxPixmap->target,
|
||||
glxPixmap->format,
|
||||
drawable->driDrawable);
|
||||
} else {
|
||||
texBuffer->setTexBuffer(context->driContext,
|
||||
glxPixmap->target,
|
||||
drawable->driDrawable);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -1073,7 +1073,7 @@ MouseInit (KdPointerInfo *pi)
|
|||
((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
|
||||
pi->nAxes = 3;
|
||||
pi->nButtons = 32;
|
||||
pi->name = KdSaveString("Xephyr virtual mouse");
|
||||
pi->name = strdup("Xephyr virtual mouse");
|
||||
ephyrMouse = pi;
|
||||
return Success;
|
||||
}
|
||||
|
@ -1127,7 +1127,7 @@ EphyrKeyboardInit (KdKeyboardInfo *ki)
|
|||
ki->keySyms.mapWidth = ephyrKeySyms.mapWidth;
|
||||
xfree(ki->keySyms.map);
|
||||
ki->keySyms.map = ephyrKeySyms.map;
|
||||
ki->name = KdSaveString("Xephyr virtual keyboard");
|
||||
ki->name = strdup("Xephyr virtual keyboard");
|
||||
ephyrKbd = ki;
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ BusInit (KdPointerInfo *pi)
|
|||
close(fd);
|
||||
if (pi->path)
|
||||
xfree(pi->path);
|
||||
pi->path = KdSaveString(BusNames[i]);
|
||||
pi->path = strdup(BusNames[i]);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ EvdevPtrInit (KdPointerInfo *pi)
|
|||
for (i = 0; i < NUM_DEFAULT_EVDEV; i++) {
|
||||
fd = open (kdefaultEvdev[i], 2);
|
||||
if (fd >= 0) {
|
||||
pi->path = KdSaveString (kdefaultEvdev[i]);
|
||||
pi->path = strdup (kdefaultEvdev[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ EvdevPtrInit (KdPointerInfo *pi)
|
|||
|
||||
close(fd);
|
||||
|
||||
pi->name = KdSaveString("Evdev mouse");
|
||||
pi->name = strdup("Evdev mouse");
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ EvdevKbdInit (KdKeyboardInfo *ki)
|
|||
|
||||
close (fd);
|
||||
|
||||
ki->name = KdSaveString("Evdev keyboard");
|
||||
ki->name = strdup("Evdev keyboard");
|
||||
|
||||
readMapping(ki);
|
||||
|
||||
|
|
|
@ -737,10 +737,10 @@ LinuxKeyboardInit (KdKeyboardInfo *ki)
|
|||
|
||||
if (ki->path)
|
||||
xfree(ki->path);
|
||||
ki->path = KdSaveString("console");
|
||||
ki->path = strdup("console");
|
||||
if (ki->name)
|
||||
xfree(ki->name);
|
||||
ki->name = KdSaveString("Linux console keyboard");
|
||||
ki->name = strdup("Linux console keyboard");
|
||||
|
||||
readKernelMapping (ki);
|
||||
|
||||
|
|
|
@ -944,7 +944,7 @@ MouseInit (KdPointerInfo *pi)
|
|||
for (i = 0; i < NUM_DEFAULT_MOUSE; i++) {
|
||||
fd = open (kdefaultMouse[i], 2);
|
||||
if (fd >= 0) {
|
||||
pi->path = KdSaveString (kdefaultMouse[i]);
|
||||
pi->path = strdup (kdefaultMouse[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,9 +100,9 @@ MsInit (KdPointerInfo *pi)
|
|||
return BadImplementation;
|
||||
|
||||
if (!pi->path || strcmp(pi->path, "auto"))
|
||||
pi->path = KdSaveString("/dev/mouse");
|
||||
pi->path = strdup("/dev/mouse");
|
||||
if (!pi->name)
|
||||
pi->name = KdSaveString("Microsoft protocol mouse");
|
||||
pi->name = strdup("Microsoft protocol mouse");
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ Ps2Init (KdPointerInfo *pi)
|
|||
for (i = 0; i < NUM_PS2_NAMES; i++) {
|
||||
ps2Port = open (Ps2Names[i], 0);
|
||||
if (ps2Port >= 0) {
|
||||
pi->path = KdSaveString (Ps2Names[i]);
|
||||
pi->path = strdup (Ps2Names[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ Ps2Init (KdPointerInfo *pi)
|
|||
|
||||
close(ps2Port);
|
||||
if (!pi->name)
|
||||
pi->name = KdSaveString ("PS/2 Mouse");
|
||||
pi->name = strdup ("PS/2 Mouse");
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ TslibEnable (KdPointerInfo *pi)
|
|||
private->raw_event_hook = NULL;
|
||||
private->raw_event_closure = NULL;
|
||||
if (!pi->path) {
|
||||
pi->path = "/dev/input/touchscreen0";
|
||||
pi->path = strdup("/dev/input/touchscreen0");
|
||||
ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path);
|
||||
}
|
||||
private->tsDev = ts_open(pi->path, 0);
|
||||
|
@ -169,7 +169,7 @@ TslibInit (KdPointerInfo *pi)
|
|||
/* hacktastic */
|
||||
private->phys_screen = 0;
|
||||
pi->nAxes = 3;
|
||||
pi->name = KdSaveString("Touchscreen");
|
||||
pi->name = strdup("Touchscreen");
|
||||
pi->inputClass = KD_TOUCHSCREEN;
|
||||
|
||||
return Success;
|
||||
|
|
|
@ -521,17 +521,6 @@ KdParseScreen (KdScreenInfo *screen,
|
|||
* {NMO} Reorder buttons
|
||||
*/
|
||||
|
||||
char *
|
||||
KdSaveString (char *str)
|
||||
{
|
||||
char *n = (char *) xalloc (strlen (str) + 1);
|
||||
|
||||
if (!n)
|
||||
return 0;
|
||||
strcpy (n, str);
|
||||
return n;
|
||||
}
|
||||
|
||||
void
|
||||
KdParseRgba (char *rgba)
|
||||
{
|
||||
|
@ -1382,12 +1371,6 @@ DPMSSet(ClientPtr client, int level)
|
|||
{
|
||||
}
|
||||
|
||||
int
|
||||
DPMSGet (int *level)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
Bool
|
||||
DPMSSupported (void)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define _KDRIVE_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xos.h>
|
||||
|
@ -468,9 +469,6 @@ void
|
|||
KdParseScreen (KdScreenInfo *screen,
|
||||
char *arg);
|
||||
|
||||
char *
|
||||
KdSaveString (char *str);
|
||||
|
||||
KdPointerInfo *
|
||||
KdParsePointer (char *arg);
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ KdNewPointer (void)
|
|||
if (!pi)
|
||||
return NULL;
|
||||
|
||||
pi->name = KdSaveString("Generic Pointer");
|
||||
pi->name = strdup("Generic Pointer");
|
||||
pi->path = NULL;
|
||||
pi->inputClass = KD_MOUSE;
|
||||
pi->driver = NULL;
|
||||
|
|
|
@ -870,9 +870,9 @@ KdNewKeyboard (void)
|
|||
ki->bellDuration = 200;
|
||||
ki->next = NULL;
|
||||
ki->options = NULL;
|
||||
ki->xkbRules = KdSaveString("base");
|
||||
ki->xkbModel = KdSaveString("pc105");
|
||||
ki->xkbLayout = KdSaveString("us");
|
||||
ki->xkbRules = strdup("base");
|
||||
ki->xkbModel = strdup("pc105");
|
||||
ki->xkbLayout = strdup("us");
|
||||
ki->xkbVariant = NULL;
|
||||
ki->xkbOptions = NULL;
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ KdParseKbdOptions (KdKeyboardInfo *ki)
|
|||
else if (strcasecmp(option->key, "XkbOptions") == 0)
|
||||
ki->xkbOptions = option->value;
|
||||
else if (!strcasecmp (option->key, "device"))
|
||||
ki->path = KdSaveString(option->value);
|
||||
ki->path = strdup(option->value);
|
||||
else
|
||||
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
|
||||
option->key, option->value);
|
||||
|
@ -1161,7 +1161,7 @@ KdParsePointerOptions (KdPointerInfo *pi)
|
|||
else if (!strcmp (option->key, "rawcoord"))
|
||||
pi->transformCoordinates = FALSE;
|
||||
else if (!strcasecmp (option->key, "device"))
|
||||
pi->path = KdSaveString(option->value);
|
||||
pi->path = strdup(option->value);
|
||||
else
|
||||
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
|
||||
option->key, option->value);
|
||||
|
@ -2280,9 +2280,9 @@ NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
|
|||
for (option = options; option; option = option->next) {
|
||||
if (strcmp(option->key, "device") == 0) {
|
||||
if (pi && option->value)
|
||||
pi->path = KdSaveString(option->value);
|
||||
pi->path = strdup(option->value);
|
||||
else if (ki && option->value)
|
||||
ki->path = KdSaveString(option->value);
|
||||
ki->path = strdup(option->value);
|
||||
}
|
||||
else if (strcmp(option->key, "driver") == 0) {
|
||||
if (pi) {
|
||||
|
|
|
@ -56,9 +56,6 @@ BEGIN {
|
|||
print "#include <xorg-config.h>"
|
||||
print "#endif"
|
||||
print ""
|
||||
print "#ifdef __UNIXOS2__"
|
||||
print "#define I_NEED_OS2_H"
|
||||
print "#endif"
|
||||
print "#include \"xf86.h\""
|
||||
print "#include \"xf86Config.h\""
|
||||
print "#include \"xf86Priv.h\""
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
|
@ -175,7 +174,6 @@ extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VR
|
|||
extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
|
||||
|
||||
#ifdef DPMSExtension
|
||||
extern _X_EXPORT int DPMSGet(int *level);
|
||||
extern _X_EXPORT int DPMSSet(ClientPtr client, int level);
|
||||
extern _X_EXPORT Bool DPMSSupported(void);
|
||||
#endif
|
||||
|
|
|
@ -172,6 +172,8 @@ videoPtrToDriverList(struct pci_device *dev,
|
|||
case 0x8086:
|
||||
if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) {
|
||||
driverList[0] = "i740";
|
||||
} else if (dev->device_id == 0x8108) {
|
||||
break; /* "hooray" for poulsbo */
|
||||
} else {
|
||||
driverList[0] = "intel";
|
||||
driverList[1] = "i810";
|
||||
|
|
|
@ -986,21 +986,21 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
|||
i = -1;
|
||||
xf86GetOptValInteger(FlagOptions, FLAG_DPMS_STANDBYTIME, &i);
|
||||
if ((i >= 0) && (i < MAX_TIME_IN_MIN))
|
||||
DPMSStandbyTime = defaultDPMSStandbyTime = i * MILLI_PER_MIN;
|
||||
DPMSStandbyTime = i * MILLI_PER_MIN;
|
||||
else if (i != -1)
|
||||
xf86ConfigError("StandbyTime value %d outside legal range of 0 - %d minutes",
|
||||
i, MAX_TIME_IN_MIN);
|
||||
i = -1;
|
||||
xf86GetOptValInteger(FlagOptions, FLAG_DPMS_SUSPENDTIME, &i);
|
||||
if ((i >= 0) && (i < MAX_TIME_IN_MIN))
|
||||
DPMSSuspendTime = defaultDPMSSuspendTime = i * MILLI_PER_MIN;
|
||||
DPMSSuspendTime = i * MILLI_PER_MIN;
|
||||
else if (i != -1)
|
||||
xf86ConfigError("SuspendTime value %d outside legal range of 0 - %d minutes",
|
||||
i, MAX_TIME_IN_MIN);
|
||||
i = -1;
|
||||
xf86GetOptValInteger(FlagOptions, FLAG_DPMS_OFFTIME, &i);
|
||||
if ((i >= 0) && (i < MAX_TIME_IN_MIN))
|
||||
DPMSOffTime = defaultDPMSOffTime = i * MILLI_PER_MIN;
|
||||
DPMSOffTime = i * MILLI_PER_MIN;
|
||||
else if (i != -1)
|
||||
xf86ConfigError("OffTime value %d outside legal range of 0 - %d minutes",
|
||||
i, MAX_TIME_IN_MIN);
|
||||
|
|
|
@ -260,7 +260,7 @@ configureInputSection (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
mouse = xf86confcalloc(1, sizeof(XF86ConfInputRec));
|
||||
mouse = calloc(1, sizeof(XF86ConfInputRec));
|
||||
mouse->inp_identifier = "Mouse0";
|
||||
mouse->inp_driver = "mouse";
|
||||
mouse->inp_option_lst =
|
||||
|
@ -285,18 +285,18 @@ configureScreenSection (int screennum)
|
|||
int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ };
|
||||
parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
|
||||
|
||||
ptr->scrn_identifier = xf86confmalloc(18);
|
||||
ptr->scrn_identifier = malloc(18);
|
||||
sprintf(ptr->scrn_identifier, "Screen%d", screennum);
|
||||
ptr->scrn_monitor_str = xf86confmalloc(19);
|
||||
ptr->scrn_monitor_str = malloc(19);
|
||||
sprintf(ptr->scrn_monitor_str, "Monitor%d", screennum);
|
||||
ptr->scrn_device_str = xf86confmalloc(16);
|
||||
ptr->scrn_device_str = malloc(16);
|
||||
sprintf(ptr->scrn_device_str, "Card%d", screennum);
|
||||
|
||||
for (i=0; i<sizeof(depths)/sizeof(depths[0]); i++)
|
||||
{
|
||||
XF86ConfDisplayPtr display;
|
||||
|
||||
display = xf86confcalloc(1, sizeof(XF86ConfDisplayRec));
|
||||
display = calloc(1, sizeof(XF86ConfDisplayRec));
|
||||
display->disp_depth = depths[i];
|
||||
display->disp_black.red = display->disp_white.red = -1;
|
||||
display->disp_black.green = display->disp_white.green = -1;
|
||||
|
@ -419,7 +419,7 @@ configureLayoutSection (void)
|
|||
{
|
||||
XF86ConfInputrefPtr iptr;
|
||||
|
||||
iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
|
||||
iptr = malloc (sizeof (XF86ConfInputrefRec));
|
||||
iptr->list.next = NULL;
|
||||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Mouse0";
|
||||
|
@ -432,7 +432,7 @@ configureLayoutSection (void)
|
|||
{
|
||||
XF86ConfInputrefPtr iptr;
|
||||
|
||||
iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
|
||||
iptr = malloc (sizeof (XF86ConfInputrefRec));
|
||||
iptr->list.next = NULL;
|
||||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Keyboard0";
|
||||
|
@ -445,7 +445,7 @@ configureLayoutSection (void)
|
|||
for (scrnum = 0; scrnum < nDevToConfig; scrnum++) {
|
||||
XF86ConfAdjacencyPtr aptr;
|
||||
|
||||
aptr = xf86confmalloc (sizeof (XF86ConfAdjacencyRec));
|
||||
aptr = malloc (sizeof (XF86ConfAdjacencyRec));
|
||||
aptr->list.next = NULL;
|
||||
aptr->adj_x = 0;
|
||||
aptr->adj_y = 0;
|
||||
|
@ -494,7 +494,7 @@ configureModuleSection (void)
|
|||
for (el = elist; *el; el++) {
|
||||
XF86LoadPtr module;
|
||||
|
||||
module = xf86confcalloc(1, sizeof(XF86LoadRec));
|
||||
module = calloc(1, sizeof(XF86LoadRec));
|
||||
module->load_name = *el;
|
||||
ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
|
||||
(glp)ptr->mod_load_lst, (glp)module);
|
||||
|
@ -523,7 +523,7 @@ configureMonitorSection (int screennum)
|
|||
{
|
||||
parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
|
||||
|
||||
ptr->mon_identifier = xf86confmalloc(19);
|
||||
ptr->mon_identifier = malloc(19);
|
||||
sprintf(ptr->mon_identifier, "Monitor%d", screennum);
|
||||
ptr->mon_vendor = strdup("Monitor Vendor");
|
||||
ptr->mon_modelname = strdup("Monitor Model");
|
||||
|
@ -542,10 +542,10 @@ configureDDCMonitorSection (int screennum)
|
|||
|
||||
parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
|
||||
|
||||
ptr->mon_identifier = xf86confmalloc(19);
|
||||
ptr->mon_identifier = malloc(19);
|
||||
sprintf(ptr->mon_identifier, "Monitor%d", screennum);
|
||||
ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
|
||||
ptr->mon_modelname = xf86confmalloc(12);
|
||||
ptr->mon_modelname = malloc(12);
|
||||
sprintf(ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
|
||||
|
||||
/* features in centimetres, we want millimetres */
|
||||
|
@ -570,8 +570,7 @@ configureDDCMonitorSection (int screennum)
|
|||
len = 0;
|
||||
}
|
||||
if ((ptr->mon_comment =
|
||||
xf86confrealloc(ptr->mon_comment,
|
||||
len+strlen(displaySize_string)))) {
|
||||
realloc(ptr->mon_comment, len+strlen(displaySize_string)))) {
|
||||
strcpy(ptr->mon_comment + len, displaySize_string);
|
||||
}
|
||||
}
|
||||
|
@ -581,7 +580,7 @@ configureDDCMonitorSection (int screennum)
|
|||
for (i=0;i<4;i++) {
|
||||
switch (ConfiguredMonitor->det_mon[i].type) {
|
||||
case DS_NAME:
|
||||
ptr->mon_modelname = xf86confrealloc(ptr->mon_modelname,
|
||||
ptr->mon_modelname = realloc(ptr->mon_modelname,
|
||||
strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
|
||||
+ 1);
|
||||
strcpy(ptr->mon_modelname,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
|
@ -65,19 +64,17 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
|
|||
|
||||
DPMSKey = &DPMSKeyIndex;
|
||||
|
||||
if (DPMSDisabledSwitch)
|
||||
DPMSEnabled = FALSE;
|
||||
if (!dixSetPrivate(&pScreen->devPrivates, DPMSKey,
|
||||
xcalloc(sizeof(DPMSRec), 1)))
|
||||
return FALSE;
|
||||
|
||||
pDPMS = (DPMSPtr)dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||
pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||
pScrn->DPMSSet = set;
|
||||
pDPMS->Flags = flags;
|
||||
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
|
||||
if (DPMSEnabledSwitch || DPMSDisabledSwitch) {
|
||||
if (DPMSDisabledSwitch) {
|
||||
enabled_from = X_CMDLINE;
|
||||
DPMSEnabled = !DPMSDisabledSwitch && DPMSEnabledSwitch;
|
||||
DPMSEnabled = FALSE;
|
||||
}
|
||||
else if (DPMSOpt) {
|
||||
enabled_from = X_CONFIG;
|
||||
|
@ -86,7 +83,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
|
|||
}
|
||||
else {
|
||||
enabled_from = X_DEFAULT;
|
||||
DPMSEnabled = defaultDPMSEnabled;
|
||||
DPMSEnabled = TRUE;
|
||||
}
|
||||
if (DPMSEnabled)
|
||||
xf86DrvMsg(pScreen->myNum, enabled_from, "DPMS enabled\n");
|
||||
|
@ -112,7 +109,7 @@ DPMSClose(int i, ScreenPtr pScreen)
|
|||
if (DPMSKey == NULL)
|
||||
return FALSE;
|
||||
|
||||
pDPMS = (DPMSPtr)dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||
pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||
|
||||
/* This shouldn't happen */
|
||||
if (!pDPMS)
|
||||
|
@ -130,7 +127,7 @@ DPMSClose(int i, ScreenPtr pScreen)
|
|||
xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
|
||||
}
|
||||
|
||||
xfree((pointer)pDPMS);
|
||||
xfree(pDPMS);
|
||||
dixSetPrivate(&pScreen->devPrivates, DPMSKey, NULL);
|
||||
if (--DPMSCount == 0)
|
||||
DPMSKey = NULL;
|
||||
|
@ -164,8 +161,7 @@ DPMSSet(ClientPtr client, int level)
|
|||
/* For each screen, set the DPMS level */
|
||||
for (i = 0; i < xf86NumScreens; i++) {
|
||||
pScrn = xf86Screens[i];
|
||||
pDPMS = (DPMSPtr)dixLookupPrivate(&screenInfo.screens[i]->devPrivates,
|
||||
DPMSKey);
|
||||
pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey);
|
||||
if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
|
||||
xf86EnableAccess(pScrn);
|
||||
pScrn->DPMSSet(pScrn, level, 0);
|
||||
|
@ -193,33 +189,11 @@ DPMSSupported(void)
|
|||
/* For each screen, check if DPMS is supported */
|
||||
for (i = 0; i < xf86NumScreens; i++) {
|
||||
pScrn = xf86Screens[i];
|
||||
pDPMS = (DPMSPtr)dixLookupPrivate(&screenInfo.screens[i]->devPrivates,
|
||||
DPMSKey);
|
||||
pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey);
|
||||
if (pDPMS && pScrn->DPMSSet)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* DPMSGet --
|
||||
* Device dependent DPMS mode getting hook. This returns the current
|
||||
* DPMS mode, or -1 if DPMS is not supported.
|
||||
*
|
||||
* This should hook in to the appropriate driver-level function, which
|
||||
* will be added to the ScrnInfoRec.
|
||||
*
|
||||
* NOTES:
|
||||
* 1. the calling interface should be changed to specify which
|
||||
* screen to check.
|
||||
* 2. It isn't clear that this function is ever used or what it should
|
||||
* return.
|
||||
*/
|
||||
int
|
||||
DPMSGet(int *level)
|
||||
{
|
||||
return DPMSPowerLevel;
|
||||
}
|
||||
|
||||
#endif /* DPMSExtension */
|
||||
|
|
|
@ -770,23 +770,6 @@ xf86EnableVTSwitch(Bool new)
|
|||
return old;
|
||||
}
|
||||
|
||||
void
|
||||
xf86ReloadInputDevs(int sig)
|
||||
{
|
||||
InputInfoPtr pInfo;
|
||||
|
||||
signal(sig, (void(*)(int))xf86ReloadInputDevs);
|
||||
|
||||
pInfo = xf86InputDevs;
|
||||
while (pInfo) {
|
||||
DisableDevice(pInfo->dev);
|
||||
EnableDevice(pInfo->dev);
|
||||
pInfo = pInfo->next;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
DDXRingBell(int volume, int pitch, int duration) {
|
||||
xf86OSRingBell(volume, pitch, duration);
|
||||
|
|
|
@ -108,9 +108,6 @@ extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable;
|
|||
#define DEFAULT_DPI 96
|
||||
#endif
|
||||
|
||||
#define DEFAULT_UNRESOLVED TRUE
|
||||
#define DEFAULT_BEST_REFRESH FALSE
|
||||
|
||||
/* Function Prototypes */
|
||||
#ifndef _NO_XF86_PROTOTYPES
|
||||
|
||||
|
|
|
@ -868,7 +868,8 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
|
|||
if (!strcmp (m, *cim))
|
||||
{
|
||||
xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);
|
||||
return (ModuleDescPtr) 1;
|
||||
ret = (ModuleDescPtr) 1;
|
||||
goto LoadModule_exit;
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
|
|
|
@ -155,6 +155,11 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
|
|||
DDC->vendor.prod_id == 13600)
|
||||
return TRUE;
|
||||
|
||||
/* Bug #21000: LGPhilipsLCD LP154W01-TLAJ */
|
||||
if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
|
||||
DDC->vendor.prod_id == 47360)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ xf86OSPMOpen(void)
|
|||
}
|
||||
xf86PMGetEventFromOs = bsdPMGetEventFromOS;
|
||||
xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
|
||||
APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
|
||||
APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
|
||||
return bsdCloseAPM;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ bsdCloseAPM(void)
|
|||
int fd;
|
||||
|
||||
if (APMihPtr) {
|
||||
fd = xf86RemoveInputHandler(APMihPtr);
|
||||
fd = xf86RemoveGeneralHandler(APMihPtr);
|
||||
close(fd);
|
||||
APMihPtr = NULL;
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ xf86OSPMOpen(void)
|
|||
|
||||
xf86PMGetEventFromOs = bsdPMGetEventFromOS;
|
||||
xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
|
||||
APMihPtr = xf86AddInputHandler(kq, xf86HandlePMEvents, NULL);
|
||||
APMihPtr = xf86AddGeneralHandler(kq, xf86HandlePMEvents, NULL);
|
||||
return bsdCloseAPM;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ bsdCloseAPM(void)
|
|||
int kq;
|
||||
|
||||
if (APMihPtr) {
|
||||
kq = xf86RemoveInputHandler(APMihPtr);
|
||||
kq = xf86RemoveGeneralHandler(APMihPtr);
|
||||
close(devFd);
|
||||
devFd = -1;
|
||||
close(kq);
|
||||
|
|
|
@ -180,11 +180,10 @@ lnxAPMOpen(void)
|
|||
close(pfd);
|
||||
xf86PMGetEventFromOs = lnxPMGetEventFromOs;
|
||||
xf86PMConfirmEventToOs = lnxPMConfirmEventToOs;
|
||||
APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL);
|
||||
APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
|
||||
xf86MsgVerb(X_INFO,3,"Open APM successful\n");
|
||||
return lnxCloseAPM;
|
||||
}
|
||||
xf86MsgVerb(X_INFO,3,"No APM support in BIOS or kernel\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -197,7 +196,7 @@ lnxCloseAPM(void)
|
|||
ErrorF("APM: Closing device\n");
|
||||
#endif
|
||||
if (APMihPtr) {
|
||||
fd = xf86RemoveInputHandler(APMihPtr);
|
||||
fd = xf86RemoveGeneralHandler(APMihPtr);
|
||||
close(fd);
|
||||
APMihPtr = NULL;
|
||||
}
|
||||
|
|
|
@ -286,7 +286,6 @@ xf86OpenConsole(void)
|
|||
} else { /* ShareVTs */
|
||||
close(xf86Info.consoleFd);
|
||||
}
|
||||
signal(SIGUSR2, xf86ReloadInputDevs);
|
||||
} else { /* serverGeneration != 1 */
|
||||
if (!ShareVTs && VTSwitch)
|
||||
{
|
||||
|
|
|
@ -215,7 +215,7 @@ xf86OSPMOpen(void)
|
|||
}
|
||||
xf86PMGetEventFromOs = sunPMGetEventFromOS;
|
||||
xf86PMConfirmEventToOs = sunPMConfirmEventToOs;
|
||||
APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
|
||||
APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
|
||||
return sunCloseAPM;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ sunCloseAPM(void)
|
|||
int fd;
|
||||
|
||||
if (APMihPtr) {
|
||||
fd = xf86RemoveInputHandler(APMihPtr);
|
||||
fd = xf86RemoveGeneralHandler(APMihPtr);
|
||||
close(fd);
|
||||
APMihPtr = NULL;
|
||||
}
|
||||
|
|
|
@ -212,7 +212,6 @@ extern _X_EXPORT Bool xf86VTSwitchTo(void);
|
|||
extern _X_EXPORT void xf86VTRequest(int sig);
|
||||
extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
|
||||
extern _X_EXPORT void xf86UseMsg(void);
|
||||
extern _X_EXPORT void xf86ReloadInputDevs(int sig);
|
||||
extern _X_EXPORT PMClose xf86OSPMOpen(void);
|
||||
|
||||
#ifdef NEED_OS_RAC_PROTOS
|
||||
|
|
|
@ -92,18 +92,14 @@ LexRec, *LexPtr;
|
|||
|
||||
#include "configProcs.h"
|
||||
#include <stdlib.h>
|
||||
#define xf86confmalloc malloc
|
||||
#define xf86confrealloc realloc
|
||||
#define xf86confcalloc calloc
|
||||
#define xf86conffree free
|
||||
|
||||
#define TestFree(a) if (a) { xf86conffree (a); a = NULL; }
|
||||
#define TestFree(a) if (a) { free (a); a = NULL; }
|
||||
|
||||
#define parsePrologue(typeptr,typerec) typeptr ptr; \
|
||||
if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return NULL; }
|
||||
if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return NULL; }
|
||||
|
||||
#define parsePrologueVoid(typeptr,typerec) int token; typeptr ptr; \
|
||||
if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return; }
|
||||
if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return; }
|
||||
|
||||
#define HANDLE_RETURN(f,func)\
|
||||
if ((ptr->f=func) == NULL)\
|
||||
|
|
|
@ -58,7 +58,7 @@ xf86freeBuffersList (XF86ConfBuffersPtr ptr)
|
|||
TestFree (ptr->buf_comment);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,5 +183,5 @@ xf86freeDRI (XF86ConfDRIPtr ptr)
|
|||
|
||||
xf86freeBuffersList (ptr->dri_buffers_lst);
|
||||
TestFree (ptr->dri_comment);
|
||||
xf86conffree (ptr);
|
||||
free (ptr);
|
||||
}
|
||||
|
|
|
@ -353,7 +353,7 @@ xf86freeDeviceList (XF86ConfDevicePtr ptr)
|
|||
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,14 +369,3 @@ xf86findDevice (const char *ident, XF86ConfDevicePtr p)
|
|||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
char *
|
||||
xf86configStrdup (const char *s)
|
||||
{
|
||||
char *tmp;
|
||||
if (!s) return NULL;
|
||||
tmp = xf86confmalloc (sizeof (char) * (strlen (s) + 1));
|
||||
if (tmp)
|
||||
strcpy (tmp, s);
|
||||
return (tmp);
|
||||
}
|
||||
|
|
|
@ -107,5 +107,5 @@ xf86freeExtensions (XF86ConfExtensionsPtr ptr)
|
|||
|
||||
xf86optionListFree (ptr->ext_option_lst);
|
||||
TestFree (ptr->extensions_comment);
|
||||
xf86conffree (ptr);
|
||||
free (ptr);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ xf86parseFilesSection (void)
|
|||
str = val.str;
|
||||
if (ptr->file_fontpath == NULL)
|
||||
{
|
||||
ptr->file_fontpath = xf86confmalloc (1);
|
||||
ptr->file_fontpath = malloc (1);
|
||||
ptr->file_fontpath[0] = '\0';
|
||||
i = strlen (str) + 1;
|
||||
}
|
||||
|
@ -117,12 +117,12 @@ xf86parseFilesSection (void)
|
|||
}
|
||||
}
|
||||
ptr->file_fontpath =
|
||||
xf86confrealloc (ptr->file_fontpath, i);
|
||||
realloc (ptr->file_fontpath, i);
|
||||
if (j)
|
||||
strcat (ptr->file_fontpath, ",");
|
||||
|
||||
strcat (ptr->file_fontpath, str);
|
||||
xf86conffree (val.str);
|
||||
free (val.str);
|
||||
break;
|
||||
case MODULEPATH:
|
||||
if (xf86getSubToken (&(ptr->file_comment)) != STRING)
|
||||
|
@ -131,7 +131,7 @@ xf86parseFilesSection (void)
|
|||
str = val.str;
|
||||
if (ptr->file_modulepath == NULL)
|
||||
{
|
||||
ptr->file_modulepath = xf86confmalloc (1);
|
||||
ptr->file_modulepath = malloc (1);
|
||||
ptr->file_modulepath[0] = '\0';
|
||||
k = strlen (str) + 1;
|
||||
}
|
||||
|
@ -144,12 +144,12 @@ xf86parseFilesSection (void)
|
|||
l = TRUE;
|
||||
}
|
||||
}
|
||||
ptr->file_modulepath = xf86confrealloc (ptr->file_modulepath, k);
|
||||
ptr->file_modulepath = realloc (ptr->file_modulepath, k);
|
||||
if (l)
|
||||
strcat (ptr->file_modulepath, ",");
|
||||
|
||||
strcat (ptr->file_modulepath, str);
|
||||
xf86conffree (val.str);
|
||||
free (val.str);
|
||||
break;
|
||||
case LOGFILEPATH:
|
||||
if (xf86getSubToken (&(ptr->file_comment)) != STRING)
|
||||
|
@ -241,5 +241,5 @@ xf86freeFiles (XF86ConfFilesPtr p)
|
|||
TestFree (p->file_comment);
|
||||
TestFree (p->file_xkbdir);
|
||||
|
||||
xf86conffree (p);
|
||||
free (p);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 1997 Metro Link Incorporated
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
@ -134,7 +133,7 @@ xf86parseFlagsSection (void)
|
|||
{
|
||||
char *valstr = NULL;
|
||||
/* can't use strdup because it calls malloc */
|
||||
tmp = xf86configStrdup (ServerFlagsTab[i].name);
|
||||
tmp = strdup (ServerFlagsTab[i].name);
|
||||
if (hasvalue)
|
||||
{
|
||||
tokentype = xf86getSubToken(&(ptr->flg_comment));
|
||||
|
@ -145,7 +144,7 @@ xf86parseFlagsSection (void)
|
|||
} else {
|
||||
if (tokentype != NUMBER)
|
||||
Error (NUMBER_MSG, tmp);
|
||||
valstr = xf86confmalloc(16);
|
||||
valstr = malloc(16);
|
||||
if (valstr)
|
||||
sprintf(valstr, "%d", val.num);
|
||||
}
|
||||
|
@ -202,11 +201,11 @@ addNewOption2 (XF86OptionPtr head, char *name, char *val, int used)
|
|||
/* Don't allow duplicates, free old strings */
|
||||
if (head != NULL && (old = xf86findOption(head, name)) != NULL) {
|
||||
new = old;
|
||||
xf86conffree(new->opt_name);
|
||||
xf86conffree(new->opt_val);
|
||||
free(new->opt_name);
|
||||
free(new->opt_val);
|
||||
}
|
||||
else
|
||||
new = xf86confcalloc (1, sizeof (XF86OptionRec));
|
||||
new = calloc (1, sizeof (XF86OptionRec));
|
||||
new->opt_name = name;
|
||||
new->opt_val = val;
|
||||
new->opt_used = used;
|
||||
|
@ -229,7 +228,7 @@ xf86freeFlags (XF86ConfFlagsPtr flags)
|
|||
return;
|
||||
xf86optionListFree (flags->flg_option_lst);
|
||||
TestFree(flags->flg_comment);
|
||||
xf86conffree (flags);
|
||||
free (flags);
|
||||
}
|
||||
|
||||
XF86OptionPtr
|
||||
|
@ -239,11 +238,11 @@ xf86optionListDup (XF86OptionPtr opt)
|
|||
|
||||
while (opt)
|
||||
{
|
||||
newopt = xf86addNewOption(newopt, xf86configStrdup(opt->opt_name),
|
||||
xf86configStrdup(opt->opt_val));
|
||||
newopt = xf86addNewOption(newopt, strdup(opt->opt_name),
|
||||
strdup(opt->opt_val));
|
||||
newopt->opt_used = opt->opt_used;
|
||||
if (opt->opt_comment)
|
||||
newopt->opt_comment = xf86configStrdup(opt->opt_comment);
|
||||
newopt->opt_comment = strdup(opt->opt_comment);
|
||||
opt = opt->list.next;
|
||||
}
|
||||
return newopt;
|
||||
|
@ -261,7 +260,7 @@ xf86optionListFree (XF86OptionPtr opt)
|
|||
TestFree (opt->opt_comment);
|
||||
prev = opt;
|
||||
opt = opt->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,7 +285,7 @@ xf86newOption(char *name, char *value)
|
|||
{
|
||||
XF86OptionPtr opt;
|
||||
|
||||
opt = xf86confcalloc(1, sizeof (XF86OptionRec));
|
||||
opt = calloc(1, sizeof (XF86OptionRec));
|
||||
if (!opt)
|
||||
return NULL;
|
||||
|
||||
|
@ -366,10 +365,10 @@ xf86optionListCreate( const char **options, int count, int used )
|
|||
for (i = 0; i < count; i += 2)
|
||||
{
|
||||
/* can't use strdup because it calls malloc */
|
||||
t1 = xf86confmalloc (sizeof (char) *
|
||||
t1 = malloc (sizeof (char) *
|
||||
(strlen (options[i]) + 1));
|
||||
strcpy (t1, options[i]);
|
||||
t2 = xf86confmalloc (sizeof (char) *
|
||||
t2 = malloc (sizeof (char) *
|
||||
(strlen (options[i + 1]) + 1));
|
||||
strcpy (t2, options[i + 1]);
|
||||
p = addNewOption2 (p, t1, t2, used);
|
||||
|
@ -435,7 +434,7 @@ xf86uLongToString(unsigned long i)
|
|||
int l;
|
||||
|
||||
l = (int)(ceil(log10((double)i) + 2.5));
|
||||
s = xf86confmalloc(l);
|
||||
s = malloc(l);
|
||||
if (!s)
|
||||
return NULL;
|
||||
sprintf(s, "%lu", i);
|
||||
|
@ -452,7 +451,7 @@ xf86parseOption(XF86OptionPtr head)
|
|||
if ((token = xf86getSubToken(&comment)) != STRING) {
|
||||
xf86parseError(BAD_OPTION_MSG, NULL);
|
||||
if (comment)
|
||||
xf86conffree(comment);
|
||||
free(comment);
|
||||
return (head);
|
||||
}
|
||||
|
||||
|
@ -479,10 +478,10 @@ xf86parseOption(XF86OptionPtr head)
|
|||
/* Don't allow duplicates */
|
||||
if (head != NULL && (old = xf86findOption(head, name)) != NULL) {
|
||||
cnew = old;
|
||||
xf86conffree(option->opt_name);
|
||||
free(option->opt_name);
|
||||
TestFree(option->opt_val);
|
||||
TestFree(option->opt_comment);
|
||||
xf86conffree(option);
|
||||
free(option);
|
||||
}
|
||||
else
|
||||
cnew = option;
|
||||
|
|
|
@ -163,7 +163,7 @@ xf86freeInputList (XF86ConfInputPtr ptr)
|
|||
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,10 +116,10 @@ xf86parseLayoutSection (void)
|
|||
{
|
||||
XF86ConfInactivePtr iptr;
|
||||
|
||||
iptr = xf86confcalloc (1, sizeof (XF86ConfInactiveRec));
|
||||
iptr = calloc (1, sizeof (XF86ConfInactiveRec));
|
||||
iptr->list.next = NULL;
|
||||
if (xf86getSubToken (&(ptr->lay_comment)) != STRING) {
|
||||
xf86conffree (iptr);
|
||||
free (iptr);
|
||||
Error (INACTIVE_MSG, NULL);
|
||||
}
|
||||
iptr->inactive_device_str = val.str;
|
||||
|
@ -132,7 +132,7 @@ xf86parseLayoutSection (void)
|
|||
XF86ConfAdjacencyPtr aptr;
|
||||
int absKeyword = 0;
|
||||
|
||||
aptr = xf86confcalloc (1, sizeof (XF86ConfAdjacencyRec));
|
||||
aptr = calloc (1, sizeof (XF86ConfAdjacencyRec));
|
||||
aptr->list.next = NULL;
|
||||
aptr->adj_scrnum = -1;
|
||||
aptr->adj_where = CONF_ADJ_OBSOLETE;
|
||||
|
@ -145,7 +145,7 @@ xf86parseLayoutSection (void)
|
|||
xf86unGetToken (token);
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != STRING) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error (SCREEN_MSG, NULL);
|
||||
}
|
||||
aptr->adj_screen_str = val.str;
|
||||
|
@ -173,7 +173,7 @@ xf86parseLayoutSection (void)
|
|||
absKeyword = 1;
|
||||
break;
|
||||
case EOF_TOKEN:
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error (UNEXPECTED_EOF_MSG, NULL);
|
||||
break;
|
||||
default:
|
||||
|
@ -194,13 +194,13 @@ xf86parseLayoutSection (void)
|
|||
aptr->adj_x = val.num;
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != NUMBER) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error(INVALID_SCR_MSG, NULL);
|
||||
}
|
||||
aptr->adj_y = val.num;
|
||||
} else {
|
||||
if (absKeyword) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error(INVALID_SCR_MSG, NULL);
|
||||
} else
|
||||
xf86unGetToken (token);
|
||||
|
@ -213,7 +213,7 @@ xf86parseLayoutSection (void)
|
|||
case CONF_ADJ_RELATIVE:
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != STRING) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error(INVALID_SCR_MSG, NULL);
|
||||
}
|
||||
aptr->adj_refscreen = val.str;
|
||||
|
@ -221,13 +221,13 @@ xf86parseLayoutSection (void)
|
|||
{
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != NUMBER) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error(INVALID_SCR_MSG, NULL);
|
||||
}
|
||||
aptr->adj_x = val.num;
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != NUMBER) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error(INVALID_SCR_MSG, NULL);
|
||||
}
|
||||
aptr->adj_y = val.num;
|
||||
|
@ -239,21 +239,21 @@ xf86parseLayoutSection (void)
|
|||
|
||||
/* bottom */
|
||||
if (xf86getSubToken (&(ptr->lay_comment)) != STRING) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error (SCREEN_MSG, NULL);
|
||||
}
|
||||
aptr->adj_bottom_str = val.str;
|
||||
|
||||
/* left */
|
||||
if (xf86getSubToken (&(ptr->lay_comment)) != STRING) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error (SCREEN_MSG, NULL);
|
||||
}
|
||||
aptr->adj_left_str = val.str;
|
||||
|
||||
/* right */
|
||||
if (xf86getSubToken (&(ptr->lay_comment)) != STRING) {
|
||||
xf86conffree(aptr);
|
||||
free(aptr);
|
||||
Error (SCREEN_MSG, NULL);
|
||||
}
|
||||
aptr->adj_right_str = val.str;
|
||||
|
@ -267,11 +267,11 @@ xf86parseLayoutSection (void)
|
|||
{
|
||||
XF86ConfInputrefPtr iptr;
|
||||
|
||||
iptr = xf86confcalloc (1, sizeof (XF86ConfInputrefRec));
|
||||
iptr = calloc (1, sizeof (XF86ConfInputrefRec));
|
||||
iptr->list.next = NULL;
|
||||
iptr->iref_option_lst = NULL;
|
||||
if (xf86getSubToken (&(ptr->lay_comment)) != STRING) {
|
||||
xf86conffree(iptr);
|
||||
free(iptr);
|
||||
Error (INPUTDEV_MSG, NULL);
|
||||
}
|
||||
iptr->iref_inputdev_str = val.str;
|
||||
|
@ -397,7 +397,7 @@ xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
|
|||
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ xf86freeInputrefList (XF86ConfInputrefPtr ptr)
|
|||
xf86optionListFree (ptr->iref_option_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ xf86freeLayoutList (XF86ConfLayoutPtr ptr)
|
|||
xf86freeInputrefList (ptr->lay_input_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,11 +108,11 @@ xf86parseModuleSubSection (XF86LoadPtr head, char *name)
|
|||
break;
|
||||
case EOF_TOKEN:
|
||||
xf86parseError (UNEXPECTED_EOF_MSG, NULL);
|
||||
xf86conffree(ptr);
|
||||
free(ptr);
|
||||
return NULL;
|
||||
default:
|
||||
xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
|
||||
xf86conffree(ptr);
|
||||
free(ptr);
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ xf86addNewLoadDirective (XF86LoadPtr head, char *name, int type, XF86OptionPtr o
|
|||
XF86LoadPtr new;
|
||||
int token;
|
||||
|
||||
new = xf86confcalloc (1, sizeof (XF86LoadRec));
|
||||
new = calloc (1, sizeof (XF86LoadRec));
|
||||
new->load_name = name;
|
||||
new->load_type = type;
|
||||
new->load_opt = opts;
|
||||
|
@ -263,7 +263,7 @@ xf86freeModules (XF86ConfModulePtr ptr)
|
|||
TestFree (lptr->load_comment);
|
||||
prev = lptr;
|
||||
lptr = lptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
lptr = ptr->mod_disable_lst;
|
||||
while (lptr)
|
||||
|
@ -272,8 +272,8 @@ xf86freeModules (XF86ConfModulePtr ptr)
|
|||
TestFree (lptr->load_comment);
|
||||
prev = lptr;
|
||||
lptr = lptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
TestFree (ptr->mod_comment);
|
||||
xf86conffree (ptr);
|
||||
free (ptr);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ xf86freeModeLineList (XF86ConfModeLinePtr ptr)
|
|||
TestFree (ptr->ml_comment);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ VertDone:
|
|||
|
||||
/* add to the end of the list of modes sections
|
||||
referenced here */
|
||||
mptr = xf86confcalloc (1, sizeof (XF86ConfModesLinkRec));
|
||||
mptr = calloc (1, sizeof (XF86ConfModesLinkRec));
|
||||
mptr->list.next = NULL;
|
||||
mptr->ml_modes_str = val.str;
|
||||
mptr->ml_modes = NULL;
|
||||
|
@ -822,7 +822,7 @@ xf86freeMonitorList (XF86ConfMonitorPtr ptr)
|
|||
xf86freeModeLineList (ptr->mon_modeline_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -838,7 +838,7 @@ xf86freeModesList (XF86ConfModesPtr ptr)
|
|||
xf86freeModeLineList (ptr->mon_modeline_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -115,19 +115,19 @@ xf86parsePointerSection (void)
|
|||
if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
|
||||
Error (QUOTE_MSG, "Protocol");
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Protocol"),
|
||||
strdup("Protocol"),
|
||||
val.str);
|
||||
break;
|
||||
case PDEVICE:
|
||||
if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
|
||||
Error (QUOTE_MSG, "Device");
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Device"),
|
||||
strdup("Device"),
|
||||
val.str);
|
||||
break;
|
||||
case EMULATE3:
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Emulate3Buttons"),
|
||||
strdup("Emulate3Buttons"),
|
||||
NULL);
|
||||
break;
|
||||
case EM3TIMEOUT:
|
||||
|
@ -135,12 +135,12 @@ xf86parsePointerSection (void)
|
|||
Error (POSITIVE_INT_MSG, "Emulate3Timeout");
|
||||
s = xf86uLongToString(val.num);
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Emulate3Timeout"),
|
||||
strdup("Emulate3Timeout"),
|
||||
s);
|
||||
break;
|
||||
case CHORDMIDDLE:
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("ChordMiddle"),
|
||||
strdup("ChordMiddle"),
|
||||
NULL);
|
||||
break;
|
||||
case PBUTTONS:
|
||||
|
@ -148,36 +148,36 @@ xf86parsePointerSection (void)
|
|||
Error (POSITIVE_INT_MSG, "Buttons");
|
||||
s = xf86uLongToString(val.num);
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Buttons"), s);
|
||||
strdup("Buttons"), s);
|
||||
break;
|
||||
case BAUDRATE:
|
||||
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
|
||||
Error (POSITIVE_INT_MSG, "BaudRate");
|
||||
s = xf86uLongToString(val.num);
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("BaudRate"), s);
|
||||
strdup("BaudRate"), s);
|
||||
break;
|
||||
case SAMPLERATE:
|
||||
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
|
||||
Error (POSITIVE_INT_MSG, "SampleRate");
|
||||
s = xf86uLongToString(val.num);
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("SampleRate"), s);
|
||||
strdup("SampleRate"), s);
|
||||
break;
|
||||
case PRESOLUTION:
|
||||
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
|
||||
Error (POSITIVE_INT_MSG, "Resolution");
|
||||
s = xf86uLongToString(val.num);
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("Resolution"), s);
|
||||
strdup("Resolution"), s);
|
||||
break;
|
||||
case CLEARDTR:
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("ClearDTR"), NULL);
|
||||
strdup("ClearDTR"), NULL);
|
||||
break;
|
||||
case CLEARRTS:
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("ClearRTS"), NULL);
|
||||
strdup("ClearRTS"), NULL);
|
||||
break;
|
||||
case ZAXISMAPPING:
|
||||
switch (xf86getToken(ZMapTab)) {
|
||||
|
@ -186,28 +186,28 @@ xf86parsePointerSection (void)
|
|||
Error (ZAXISMAPPING_MSG, NULL);
|
||||
s1 = xf86uLongToString(val.num);
|
||||
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) {
|
||||
xf86conffree(s1);
|
||||
free(s1);
|
||||
Error (ZAXISMAPPING_MSG, NULL);
|
||||
}
|
||||
s2 = xf86uLongToString(val.num);
|
||||
l = strlen(s1) + 1 + strlen(s2) + 1;
|
||||
s = xf86confmalloc(l);
|
||||
s = malloc(l);
|
||||
sprintf(s, "%s %s", s1, s2);
|
||||
xf86conffree(s1);
|
||||
xf86conffree(s2);
|
||||
free(s1);
|
||||
free(s2);
|
||||
break;
|
||||
case XAXIS:
|
||||
s = xf86configStrdup("x");
|
||||
s = strdup("x");
|
||||
break;
|
||||
case YAXIS:
|
||||
s = xf86configStrdup("y");
|
||||
s = strdup("y");
|
||||
break;
|
||||
default:
|
||||
Error (ZAXISMAPPING_MSG, NULL);
|
||||
break;
|
||||
}
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("ZAxisMapping"),
|
||||
strdup("ZAxisMapping"),
|
||||
s);
|
||||
break;
|
||||
case ALWAYSCORE:
|
||||
|
@ -221,10 +221,10 @@ xf86parsePointerSection (void)
|
|||
}
|
||||
}
|
||||
|
||||
ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_POINTER);
|
||||
ptr->inp_driver = xf86configStrdup("mouse");
|
||||
ptr->inp_identifier = strdup(CONF_IMPLICIT_POINTER);
|
||||
ptr->inp_driver = strdup("mouse");
|
||||
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
|
||||
xf86configStrdup("CorePointer"), NULL);
|
||||
strdup("CorePointer"), NULL);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf ("Pointer section parsed\n");
|
||||
|
|
|
@ -169,7 +169,7 @@ xf86parseDisplaySubSection (void)
|
|||
|
||||
while ((token = xf86getSubTokenWithTab (&(ptr->disp_comment), DisplayTab)) == STRING)
|
||||
{
|
||||
mptr = xf86confcalloc (1, sizeof (XF86ModeRec));
|
||||
mptr = calloc (1, sizeof (XF86ModeRec));
|
||||
mptr->mode_name = val.str;
|
||||
mptr->list.next = NULL;
|
||||
ptr->disp_mode_lst = (XF86ModePtr)
|
||||
|
@ -292,7 +292,7 @@ xf86parseScreenSection (void)
|
|||
|
||||
if (aptr == NULL)
|
||||
{
|
||||
aptr = xf86confcalloc (1, sizeof (XF86ConfAdaptorLinkRec));
|
||||
aptr = calloc (1, sizeof (XF86ConfAdaptorLinkRec));
|
||||
aptr->list.next = NULL;
|
||||
aptr->al_adaptor_str = val.str;
|
||||
ptr->scrn_adaptor_lst = (XF86ConfAdaptorLinkPtr)
|
||||
|
@ -315,7 +315,7 @@ xf86parseScreenSection (void)
|
|||
if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
|
||||
Error (QUOTE_MSG, "SubSection");
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
HANDLE_LIST (scrn_display_lst, xf86parseDisplaySubSection,
|
||||
XF86ConfDisplayPtr);
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ xf86freeScreenList (XF86ConfScreenPtr ptr)
|
|||
xf86freeDisplayList (ptr->scrn_display_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ xf86freeAdaptorLinkList (XF86ConfAdaptorLinkPtr ptr)
|
|||
TestFree (ptr->al_adaptor_str);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -485,7 +485,7 @@ xf86freeDisplayList (XF86ConfDisplayPtr ptr)
|
|||
xf86optionListFree (ptr->disp_option_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -499,7 +499,7 @@ xf86freeModeList (XF86ModePtr ptr)
|
|||
TestFree (ptr->mode_name);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,7 +544,7 @@ xf86validateScreen (XF86ConfigPtr p)
|
|||
return (FALSE);
|
||||
}
|
||||
|
||||
adaptor->al_adaptor->va_fwdref = xf86configStrdup(screen->scrn_identifier);
|
||||
adaptor->al_adaptor->va_fwdref = strdup(screen->scrn_identifier);
|
||||
adaptor = adaptor->list.next;
|
||||
}
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ xf86freeVendorList (XF86ConfVendorPtr p)
|
|||
TestFree (p->vnd_identifier);
|
||||
TestFree (p->vnd_comment);
|
||||
xf86optionListFree (p->vnd_option_lst);
|
||||
xf86conffree (p);
|
||||
free (p);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -239,6 +239,6 @@ xf86freeVendorSubList (XF86ConfVendSubPtr ptr)
|
|||
xf86optionListFree (ptr->vs_option_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
|
|||
xf86optionListFree (ptr->vp_option_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ xf86freeVideoAdaptorList (XF86ConfVideoAdaptorPtr ptr)
|
|||
xf86optionListFree (ptr->va_option_lst);
|
||||
prev = ptr;
|
||||
ptr = ptr->list.next;
|
||||
xf86conffree (prev);
|
||||
free (prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ xf86readConfigFile (void)
|
|||
int token;
|
||||
XF86ConfigPtr ptr = NULL;
|
||||
|
||||
if ((ptr = xf86confcalloc (1, sizeof (XF86ConfigRec))) == NULL)
|
||||
if ((ptr = calloc (1, sizeof (XF86ConfigRec))) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -118,107 +118,107 @@ xf86readConfigFile (void)
|
|||
xf86setSection (val.str);
|
||||
if (xf86nameCompare (val.str, "files") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_RETURN (conf_files, xf86parseFilesSection ());
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "serverflags") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_RETURN (conf_flags, xf86parseFlagsSection ());
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "pointer") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_input_lst, xf86parsePointerSection,
|
||||
XF86ConfInputPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "videoadaptor") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_videoadaptor_lst, xf86parseVideoAdaptorSection,
|
||||
XF86ConfVideoAdaptorPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "device") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_device_lst, xf86parseDeviceSection,
|
||||
XF86ConfDevicePtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "monitor") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_monitor_lst, xf86parseMonitorSection,
|
||||
XF86ConfMonitorPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "modes") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_modes_lst, xf86parseModesSection,
|
||||
XF86ConfModesPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "screen") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_screen_lst, xf86parseScreenSection,
|
||||
XF86ConfScreenPtr);
|
||||
}
|
||||
else if (xf86nameCompare(val.str, "inputdevice") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_input_lst, xf86parseInputSection,
|
||||
XF86ConfInputPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "module") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_RETURN (conf_modules, xf86parseModuleSection ());
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "serverlayout") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_layout_lst, xf86parseLayoutSection,
|
||||
XF86ConfLayoutPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "vendor") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_LIST (conf_vendor_lst, xf86parseVendorSection,
|
||||
XF86ConfVendorPtr);
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "dri") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_RETURN (conf_dri, xf86parseDRISection ());
|
||||
}
|
||||
else if (xf86nameCompare (val.str, "extensions") == 0)
|
||||
{
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
HANDLE_RETURN (conf_extensions, xf86parseExtensionsSection ());
|
||||
}
|
||||
else
|
||||
{
|
||||
Error (INVALID_SECTION_MSG, xf86tokenString ());
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Error (INVALID_KEYWORD_MSG, xf86tokenString ());
|
||||
xf86conffree(val.str);
|
||||
free(val.str);
|
||||
val.str = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -306,5 +306,5 @@ xf86freeConfig (XF86ConfigPtr p)
|
|||
xf86freeExtensions (p->conf_extensions);
|
||||
TestFree(p->conf_comment);
|
||||
|
||||
xf86conffree (p);
|
||||
free (p);
|
||||
}
|
||||
|
|
|
@ -180,8 +180,8 @@ xf86getNextLine(void)
|
|||
|
||||
if (configBufLen != CONFIG_BUF_LEN) {
|
||||
|
||||
tmpConfigBuf = xf86confmalloc(CONFIG_BUF_LEN);
|
||||
tmpConfigRBuf = xf86confmalloc(CONFIG_BUF_LEN);
|
||||
tmpConfigBuf = malloc(CONFIG_BUF_LEN);
|
||||
tmpConfigRBuf = malloc(CONFIG_BUF_LEN);
|
||||
|
||||
if (!tmpConfigBuf || !tmpConfigRBuf) {
|
||||
|
||||
|
@ -190,8 +190,8 @@ xf86getNextLine(void)
|
|||
* and free any partial allocations
|
||||
*/
|
||||
|
||||
xf86conffree(tmpConfigBuf);
|
||||
xf86conffree(tmpConfigRBuf);
|
||||
free(tmpConfigBuf);
|
||||
free(tmpConfigRBuf);
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -202,8 +202,8 @@ xf86getNextLine(void)
|
|||
|
||||
configBufLen = CONFIG_BUF_LEN;
|
||||
|
||||
xf86conffree(configBuf);
|
||||
xf86conffree(configRBuf);
|
||||
free(configBuf);
|
||||
free(configRBuf);
|
||||
|
||||
configBuf = tmpConfigBuf;
|
||||
configRBuf = tmpConfigRBuf;
|
||||
|
@ -237,8 +237,8 @@ xf86getNextLine(void)
|
|||
|
||||
if (!eolFound) {
|
||||
|
||||
tmpConfigBuf = xf86confrealloc(configBuf, configBufLen + CONFIG_BUF_LEN);
|
||||
tmpConfigRBuf = xf86confrealloc(configRBuf, configBufLen + CONFIG_BUF_LEN);
|
||||
tmpConfigBuf = realloc(configBuf, configBufLen + CONFIG_BUF_LEN);
|
||||
tmpConfigRBuf = realloc(configRBuf, configBufLen + CONFIG_BUF_LEN);
|
||||
|
||||
if (!tmpConfigBuf || !tmpConfigRBuf) {
|
||||
|
||||
|
@ -420,7 +420,7 @@ again:
|
|||
}
|
||||
while ((c != '\"') && (c != '\n') && (c != '\r') && (c != '\0'));
|
||||
configRBuf[i] = '\0';
|
||||
val.str = xf86confmalloc (strlen (configRBuf) + 1);
|
||||
val.str = malloc (strlen (configRBuf) + 1);
|
||||
strcpy (val.str, configRBuf); /* private copy ! */
|
||||
return (STRING);
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ xf86pathIsSafe(const char *path)
|
|||
#endif
|
||||
|
||||
#define BAIL_OUT do { \
|
||||
xf86conffree(result); \
|
||||
free(result); \
|
||||
return NULL; \
|
||||
} while (0)
|
||||
|
||||
|
@ -632,7 +632,7 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
|
|||
if (envUsed)
|
||||
*envUsed = 0;
|
||||
|
||||
result = xf86confmalloc(PATH_MAX + 1);
|
||||
result = malloc(PATH_MAX + 1);
|
||||
l = 0;
|
||||
for (i = 0; template[i]; i++) {
|
||||
if (template[i] != '%') {
|
||||
|
@ -669,11 +669,11 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
|
|||
break;
|
||||
case 'H':
|
||||
if (!hostname) {
|
||||
if ((hostname = xf86confmalloc(MAXHOSTNAMELEN + 1))) {
|
||||
if ((hostname = malloc(MAXHOSTNAMELEN + 1))) {
|
||||
if (gethostname(hostname, MAXHOSTNAMELEN) == 0) {
|
||||
hostname[MAXHOSTNAMELEN] = '\0';
|
||||
} else {
|
||||
xf86conffree(hostname);
|
||||
free(hostname);
|
||||
hostname = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -791,7 +791,7 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
|
|||
|
||||
if (!path || !path[0])
|
||||
path = DEFAULT_CONF_PATH;
|
||||
pathcopy = xf86confmalloc(strlen(path) + 1);
|
||||
pathcopy = malloc(strlen(path) + 1);
|
||||
strcpy(pathcopy, path);
|
||||
if (!projroot || !projroot[0])
|
||||
projroot = PROJECTROOT;
|
||||
|
@ -811,7 +811,7 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
|
|||
}
|
||||
}
|
||||
if (configPath && !configFile) {
|
||||
xf86conffree(configPath);
|
||||
free(configPath);
|
||||
configPath = NULL;
|
||||
}
|
||||
template = strtok(NULL, ",");
|
||||
|
@ -834,21 +834,21 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
|
|||
}
|
||||
}
|
||||
if (configPath && !configFile) {
|
||||
xf86conffree(configPath);
|
||||
free(configPath);
|
||||
configPath = NULL;
|
||||
}
|
||||
template = strtok(NULL, ",");
|
||||
}
|
||||
}
|
||||
|
||||
xf86conffree(pathcopy);
|
||||
free(pathcopy);
|
||||
if (!configFile) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
configBuf = xf86confmalloc (CONFIG_BUF_LEN);
|
||||
configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
|
||||
configBuf = malloc (CONFIG_BUF_LEN);
|
||||
configRBuf = malloc (CONFIG_BUF_LEN);
|
||||
configBuf[0] = '\0'; /* sanity ... */
|
||||
|
||||
return configPath;
|
||||
|
@ -857,11 +857,11 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
|
|||
void
|
||||
xf86closeConfigFile (void)
|
||||
{
|
||||
xf86conffree (configPath);
|
||||
free (configPath);
|
||||
configPath = NULL;
|
||||
xf86conffree (configRBuf);
|
||||
free (configRBuf);
|
||||
configRBuf = NULL;
|
||||
xf86conffree (configBuf);
|
||||
free (configBuf);
|
||||
configBuf = NULL;
|
||||
|
||||
if (configFile) {
|
||||
|
@ -877,9 +877,9 @@ void
|
|||
xf86setBuiltinConfig(const char *config[])
|
||||
{
|
||||
builtinConfig = config;
|
||||
configPath = xf86configStrdup("<builtin configuration>");
|
||||
configBuf = xf86confmalloc (CONFIG_BUF_LEN);
|
||||
configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
|
||||
configPath = strdup("<builtin configuration>");
|
||||
configBuf = malloc (CONFIG_BUF_LEN);
|
||||
configRBuf = malloc (CONFIG_BUF_LEN);
|
||||
configBuf[0] = '\0'; /* sanity ... */
|
||||
|
||||
}
|
||||
|
@ -915,8 +915,8 @@ void
|
|||
xf86setSection (char *section)
|
||||
{
|
||||
if (configSection)
|
||||
xf86conffree(configSection);
|
||||
configSection = xf86confmalloc(strlen (section) + 1);
|
||||
free(configSection);
|
||||
configSection = malloc(strlen (section) + 1);
|
||||
strcpy (configSection, section);
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ xf86addComment(char *cur, char *add)
|
|||
endnewline = add[len - 1] == '\n';
|
||||
len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
|
||||
|
||||
if ((str = xf86confrealloc(cur, len + curlen)) == NULL)
|
||||
if ((str = realloc(cur, len + curlen)) == NULL)
|
||||
return (cur);
|
||||
|
||||
cur = str;
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#ifndef _xf86Optrec_h_
|
||||
#define _xf86Optrec_h_
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
|
@ -102,7 +103,6 @@ extern _X_EXPORT XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *na
|
|||
extern _X_EXPORT char *xf86findOptionValue(XF86OptionPtr list, const char *name);
|
||||
extern _X_EXPORT XF86OptionPtr xf86optionListCreate(const char **options, int count, int used);
|
||||
extern _X_EXPORT XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail);
|
||||
extern _X_EXPORT char *xf86configStrdup (const char *s);
|
||||
extern _X_EXPORT int xf86nameCompare (const char *s1, const char *s2);
|
||||
extern _X_EXPORT char *xf86uLongToString(unsigned long i);
|
||||
extern _X_EXPORT XF86OptionPtr xf86parseOption(XF86OptionPtr head);
|
||||
|
|
|
@ -80,6 +80,11 @@ static KeyboardLayoutRef last_key_layout;
|
|||
|
||||
extern int darwinFakeButtons;
|
||||
|
||||
/* Store the mouse location while in the background, and update X11's pointer
|
||||
* location when we become the foreground application
|
||||
*/
|
||||
static NSPoint bgMouseLocation;
|
||||
|
||||
X11Application *X11App;
|
||||
|
||||
CFStringRef app_prefs_domain_cfstr = NULL;
|
||||
|
@ -188,6 +193,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
|||
size_t i;
|
||||
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
|
||||
if (state) {
|
||||
DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
|
||||
DarwinSendDDXEvent(kXquartzActivate, 0);
|
||||
|
||||
if (!_x_active) {
|
||||
|
@ -954,33 +960,39 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
|||
|
||||
- (void) sendX11NSEvent:(NSEvent *)e {
|
||||
NSRect screen;
|
||||
NSPoint location;
|
||||
NSPoint location, tilt;
|
||||
NSWindow *window;
|
||||
int ev_button, ev_type;
|
||||
float pointer_x, pointer_y, pressure, tilt_x, tilt_y;
|
||||
float pressure;
|
||||
DeviceIntPtr pDev;
|
||||
int modifierFlags;
|
||||
|
||||
static NSPoint lastpt;
|
||||
|
||||
/* convert location to be relative to top-left of primary display */
|
||||
location = [e locationInWindow];
|
||||
window = [e window];
|
||||
screen = [[[NSScreen screens] objectAtIndex:0] frame];
|
||||
|
||||
if (window != nil) {
|
||||
NSRect frame = [window frame];
|
||||
pointer_x = location.x + frame.origin.x;
|
||||
pointer_y = (screen.origin.y + screen.size.height)
|
||||
- (location.y + frame.origin.y);
|
||||
location = [e locationInWindow];
|
||||
location.x += frame.origin.x;
|
||||
location.y += frame.origin.y;
|
||||
lastpt = location;
|
||||
} else {
|
||||
pointer_x = location.x;
|
||||
pointer_y = (screen.origin.y + screen.size.height) - location.y;
|
||||
location.x = lastpt.x + [e deltaX];
|
||||
location.y = lastpt.y - [e deltaY];
|
||||
lastpt = [NSEvent mouseLocation];
|
||||
}
|
||||
|
||||
|
||||
/* Convert coordinate system */
|
||||
screen = [[[NSScreen screens] objectAtIndex:0] frame];
|
||||
location.y = (screen.origin.y + screen.size.height) - location.y;
|
||||
|
||||
/* Setup our valuators. These will range from 0 to 1 */
|
||||
pressure = 0;
|
||||
tilt_x = 0;
|
||||
tilt_y = 0;
|
||||
|
||||
tilt.x = 0.0;
|
||||
tilt.y = 0.0;
|
||||
|
||||
modifierFlags = [e modifierFlags];
|
||||
|
||||
#ifdef NX_DEVICELCMDKEYMASK
|
||||
|
@ -1047,47 +1059,49 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
|||
pDev = darwinTabletCurrent;
|
||||
*/
|
||||
|
||||
DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut,
|
||||
pointer_x, pointer_y);
|
||||
DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut,
|
||||
location.x, location.y);
|
||||
}
|
||||
|
||||
if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) {
|
||||
pressure = [e pressure];
|
||||
tilt_x = [e tilt].x;
|
||||
tilt_y = [e tilt].y;
|
||||
tilt = [e tilt];
|
||||
|
||||
pDev = darwinTabletCurrent;
|
||||
}
|
||||
|
||||
if(!quartzServerVisible && noTestExtensions) {
|
||||
#if 0
|
||||
/* Seems this has somehow triggered 100% CPU usage while X11.app is in the
|
||||
* background on some obscure HW configurations.
|
||||
* http://xquartz.macosforge.org/trac/ticket/241
|
||||
*/
|
||||
#if 0
|
||||
//#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
|
||||
/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
|
||||
#ifdef XPLUGIN_VERSION
|
||||
#if XPLUGIN_VERSION > 0
|
||||
if(!quartzServerVisible) {
|
||||
xp_window_id wid;
|
||||
xp_error e;
|
||||
|
||||
/* Sigh. Need to check that we're really over one of
|
||||
* our windows. (We need to receive pointer events while
|
||||
* not in the foreground, but we don't want to receive them
|
||||
* when another window is over us or we might show a tooltip)
|
||||
*/
|
||||
|
||||
|
||||
wid = 0;
|
||||
|
||||
if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success &&
|
||||
wid == 0)
|
||||
return;
|
||||
e = xp_find_window(location.x, location.y, 0, &wid);
|
||||
|
||||
if (e == XP_Success && wid == 0) {
|
||||
bgMouseLocation = location;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
bgMouseLocation = location;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y,
|
||||
pressure, tilt_x, tilt_y);
|
||||
DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, location.y,
|
||||
pressure, tilt.x, tilt.y);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1106,13 +1120,13 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
|||
break;
|
||||
}
|
||||
|
||||
DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut,
|
||||
pointer_x, pointer_y);
|
||||
DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut,
|
||||
location.x, location.y);
|
||||
break;
|
||||
|
||||
case NSScrollWheel:
|
||||
DarwinSendScrollEvents([e deltaX], [e deltaY], pointer_x, pointer_y,
|
||||
pressure, tilt_x, tilt_y);
|
||||
DarwinSendScrollEvents([e deltaX], [e deltaY], location.x, location.y,
|
||||
pressure, tilt.x, tilt.y);
|
||||
break;
|
||||
|
||||
case NSKeyDown: case NSKeyUp:
|
||||
|
|
|
@ -500,11 +500,12 @@ ProcAppleWMSendPSN(register ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSendPSNReq);
|
||||
|
||||
if(appleWMProcs->SendPSN) {
|
||||
err = appleWMProcs->SendPSN(stuff->psn_hi, stuff->psn_lo);
|
||||
if (err != Success) {
|
||||
return err;
|
||||
}
|
||||
if(!appleWMProcs->SendPSN)
|
||||
return BadRequest;
|
||||
|
||||
err = appleWMProcs->SendPSN(stuff->psn_hi, stuff->psn_lo);
|
||||
if (err != Success) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return (client->noClientException);
|
||||
|
|
|
@ -157,8 +157,11 @@ typedef struct _AppleDRINotify {
|
|||
CARD32 pad1 B32;
|
||||
CARD32 arg B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xAppleDRINotifyEvent;
|
||||
#define sz_xAppleDRINotifyEvent 20
|
||||
#define sz_xAppleDRINotifyEvent 32
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -120,7 +120,7 @@ xprSetNativeProperty(RootlessWindowPtr pFrame)
|
|||
/*
|
||||
* Create and display a new frame.
|
||||
*/
|
||||
Bool
|
||||
static Bool
|
||||
xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
|
||||
int newX, int newY, RegionPtr pShape)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
|
|||
/*
|
||||
* Destroy a frame.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprDestroyFrame(RootlessFrameID wid)
|
||||
{
|
||||
TA_SERVER();
|
||||
|
@ -203,7 +203,7 @@ xprDestroyFrame(RootlessFrameID wid)
|
|||
/*
|
||||
* Move a frame on screen.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
|
||||
{
|
||||
TA_SERVER();
|
||||
|
@ -220,7 +220,7 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
|
|||
/*
|
||||
* Resize and move a frame.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
|
||||
int newX, int newY, unsigned int newW, unsigned int newH,
|
||||
unsigned int gravity)
|
||||
|
@ -245,7 +245,7 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
|
|||
/*
|
||||
* Change frame stacking.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
|
||||
{
|
||||
xp_window_changes wc;
|
||||
|
@ -257,12 +257,22 @@ xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
|
|||
|
||||
if (nextWid == NULL)
|
||||
{
|
||||
#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3
|
||||
WindowPtr pWin = xprGetXWindow((xp_window_id)wid);
|
||||
wc.stack_mode = (pWin && pWin->overrideRedirect) ? XP_MAPPED_ABOVE_CURRENT_SPACE : XP_MAPPED_ABOVE;
|
||||
#else
|
||||
wc.stack_mode = XP_MAPPED_ABOVE;
|
||||
#endif
|
||||
wc.sibling = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3
|
||||
WindowPtr pWin = xprGetXWindow((xp_window_id)wid);
|
||||
wc.stack_mode = (pWin && pWin->overrideRedirect) ? XP_MAPPED_BELOW_CURRENT_SPACE : XP_MAPPED_BELOW;
|
||||
#else
|
||||
wc.stack_mode = XP_MAPPED_BELOW;
|
||||
#endif
|
||||
wc.sibling = x_cvt_vptr_to_uint(nextWid);
|
||||
}
|
||||
|
||||
|
@ -273,7 +283,7 @@ xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
|
|||
/*
|
||||
* Change the frame's shape.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
|
||||
{
|
||||
xp_window_changes wc;
|
||||
|
@ -300,7 +310,7 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
|
|||
/*
|
||||
* Unmap a frame.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprUnmapFrame(RootlessFrameID wid)
|
||||
{
|
||||
xp_window_changes wc;
|
||||
|
@ -318,7 +328,7 @@ xprUnmapFrame(RootlessFrameID wid)
|
|||
* Start drawing to a frame.
|
||||
* Prepare for direct access to its backing buffer.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
||||
{
|
||||
void *data[2];
|
||||
|
@ -339,7 +349,7 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
|||
/*
|
||||
* Stop drawing to a frame.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprStopDrawing(RootlessFrameID wid, Bool flush)
|
||||
{
|
||||
TA_SERVER();
|
||||
|
@ -351,7 +361,7 @@ xprStopDrawing(RootlessFrameID wid, Bool flush)
|
|||
/*
|
||||
* Flush drawing updates to the screen.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
|
||||
{
|
||||
TA_SERVER();
|
||||
|
@ -363,7 +373,7 @@ xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
|
|||
/*
|
||||
* Mark damaged rectangles as requiring redisplay to screen.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
|
||||
int shift_x, int shift_y)
|
||||
{
|
||||
|
@ -377,7 +387,7 @@ xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
|
|||
* Called after the window associated with a frame has been switched
|
||||
* to a new top-level parent.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
|
||||
{
|
||||
DeleteProperty(serverClient, oldWin, xa_native_window_id());
|
||||
|
@ -391,7 +401,7 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
|
|||
/*
|
||||
* Called to check if the frame should be reordered when it is restacked.
|
||||
*/
|
||||
Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
|
||||
static Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
|
||||
{
|
||||
WindowPtr pWin = pFrame->win;
|
||||
|
||||
|
@ -405,7 +415,7 @@ Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
|
|||
* Copy area in frame to another part of frame.
|
||||
* Used to accelerate scrolling.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
|
||||
int dx, int dy)
|
||||
{
|
||||
|
@ -473,6 +483,7 @@ xprGetXWindow(xp_window_id wid)
|
|||
return winRec != NULL ? winRec->win : NULL;
|
||||
}
|
||||
|
||||
#ifdef UNUSED_CODE
|
||||
/*
|
||||
* Given the id of a physical window, try to find the top-level (or root)
|
||||
* X window that it represents.
|
||||
|
@ -503,7 +514,7 @@ xprGetXWindowFromAppKit(int windowNumber)
|
|||
|
||||
return winRec != NULL ? winRec->win : NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The windowNumber is an AppKit window number. Returns TRUE if xpr is
|
||||
|
|
|
@ -89,6 +89,7 @@ typedef struct _Window *SaveSetElt;
|
|||
#define SaveSetAssignMap(ss,m)
|
||||
#endif
|
||||
|
||||
/* The unused_ members are ABI spacing. Please reuse them. */
|
||||
typedef struct _Client {
|
||||
int index;
|
||||
Mask clientAsMask;
|
||||
|
@ -104,7 +105,7 @@ typedef struct _Client {
|
|||
* killed */
|
||||
SaveSetElt *saveSet;
|
||||
int numSaved;
|
||||
pointer screenPrivate[MAXSCREENS];
|
||||
void *unused_screenPrivate[16];
|
||||
int (**requestVector) (
|
||||
ClientPtr /* pClient */);
|
||||
CARD32 req_len; /* length of current request */
|
||||
|
@ -118,15 +119,9 @@ typedef struct _Client {
|
|||
unsigned short vMajor,vMinor;
|
||||
KeyCode minKC,maxKC;
|
||||
|
||||
#ifdef DEBUG
|
||||
unsigned char requestLog[MAX_REQUEST_LOG];
|
||||
int requestLogIndex;
|
||||
#endif
|
||||
unsigned long replyBytesRemaining;
|
||||
void *appgroup; /* Can't remove, ABI */
|
||||
struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
|
||||
ClientPtr /* pClient */,
|
||||
int * /* num */);
|
||||
void *unused_appgroup;
|
||||
void *unused_fontResFunc;
|
||||
int smart_priority;
|
||||
long smart_start_tick;
|
||||
long smart_stop_tick;
|
||||
|
|
|
@ -28,16 +28,11 @@ extern _X_EXPORT DDXPointRec dixScreenOrigins[MAXSCREENS];
|
|||
extern _X_EXPORT char *ConnectionInfo;
|
||||
|
||||
#ifdef DPMSExtension
|
||||
extern _X_EXPORT CARD32 defaultDPMSStandbyTime;
|
||||
extern _X_EXPORT CARD32 defaultDPMSSuspendTime;
|
||||
extern _X_EXPORT CARD32 defaultDPMSOffTime;
|
||||
extern _X_EXPORT CARD32 DPMSStandbyTime;
|
||||
extern _X_EXPORT CARD32 DPMSSuspendTime;
|
||||
extern _X_EXPORT CARD32 DPMSOffTime;
|
||||
extern _X_EXPORT CARD16 DPMSPowerLevel;
|
||||
extern _X_EXPORT Bool defaultDPMSEnabled;
|
||||
extern _X_EXPORT Bool DPMSEnabled;
|
||||
extern _X_EXPORT Bool DPMSEnabledSwitch;
|
||||
extern _X_EXPORT Bool DPMSDisabledSwitch;
|
||||
extern _X_EXPORT Bool DPMSCapableFlag;
|
||||
#endif
|
||||
|
|
16
include/os.h
16
include/os.h
|
@ -52,8 +52,6 @@ SOFTWARE.
|
|||
#include "misc.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#define NullFID ((FID) 0)
|
||||
|
||||
#define SCREEN_SAVER_ON 0
|
||||
#define SCREEN_SAVER_OFF 1
|
||||
#define SCREEN_SAVER_FORCER 2
|
||||
|
@ -66,7 +64,6 @@ SOFTWARE.
|
|||
#define MAX_BIG_REQUEST_SIZE 4194303
|
||||
#endif
|
||||
|
||||
typedef pointer FID;
|
||||
typedef struct _FontPathRec *FontPathPtr;
|
||||
typedef struct _NewClientRec *NewClientPtr;
|
||||
|
||||
|
@ -86,13 +83,6 @@ typedef struct _NewClientRec *NewClientPtr;
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
|
||||
#ifdef SIGNALRETURNSINT
|
||||
#define SIGVAL int
|
||||
#else
|
||||
#define SIGVAL void
|
||||
#endif
|
||||
|
||||
#ifdef DDXOSVERRORF
|
||||
extern _X_EXPORT void (*OsVendorVErrorFProc)(const char *, va_list args);
|
||||
#endif
|
||||
|
@ -205,9 +195,9 @@ extern _X_EXPORT void TimerFree(OsTimerPtr /* pTimer */);
|
|||
extern _X_EXPORT void SetScreenSaverTimer(void);
|
||||
extern _X_EXPORT void FreeScreenSaverTimer(void);
|
||||
|
||||
extern _X_EXPORT SIGVAL AutoResetServer(int /*sig*/);
|
||||
extern _X_EXPORT void AutoResetServer(int /*sig*/);
|
||||
|
||||
extern _X_EXPORT SIGVAL GiveUp(int /*sig*/);
|
||||
extern _X_EXPORT void GiveUp(int /*sig*/);
|
||||
|
||||
extern _X_EXPORT void UseMsg(void);
|
||||
|
||||
|
@ -237,7 +227,7 @@ extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va);
|
|||
extern _X_EXPORT char *XNFprintf(const char *fmt, ...);
|
||||
extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va);
|
||||
|
||||
typedef SIGVAL (*OsSigHandlerPtr)(int /* sig */);
|
||||
typedef void (*OsSigHandlerPtr)(int /* sig */);
|
||||
|
||||
extern _X_EXPORT OsSigHandlerPtr OsSignal(int /* sig */, OsSigHandlerPtr /* handler */);
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ libmi_la_SOURCES = \
|
|||
mispans.h \
|
||||
misprite.c \
|
||||
misprite.h \
|
||||
mispritest.h \
|
||||
mistruct.h \
|
||||
mivaltree.c \
|
||||
mivalidate.h \
|
||||
|
|
315
mi/misprite.c
315
mi/misprite.c
|
@ -33,29 +33,106 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
# include <X11/X.h>
|
||||
# include <X11/Xproto.h>
|
||||
# include "misc.h"
|
||||
# include "pixmapstr.h"
|
||||
# include "input.h"
|
||||
# include "mi.h"
|
||||
# include "cursorstr.h"
|
||||
# include <X11/fonts/font.h>
|
||||
# include "scrnintstr.h"
|
||||
# include "colormapst.h"
|
||||
# include "windowstr.h"
|
||||
# include "gcstruct.h"
|
||||
# include "mipointer.h"
|
||||
# include "mispritest.h"
|
||||
# include "dixfontstr.h"
|
||||
# include <X11/fonts/fontstruct.h>
|
||||
# include "inputstr.h"
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include "misc.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "input.h"
|
||||
#include "mi.h"
|
||||
#include "cursorstr.h"
|
||||
#include <X11/fonts/font.h>
|
||||
#include "scrnintstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "windowstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "mipointer.h"
|
||||
#include "misprite.h"
|
||||
#include "dixfontstr.h"
|
||||
#include <X11/fonts/fontstruct.h>
|
||||
#include "inputstr.h"
|
||||
#include "damage.h"
|
||||
|
||||
#ifdef RENDER
|
||||
# include "mipict.h"
|
||||
#endif
|
||||
# include "damage.h"
|
||||
typedef struct {
|
||||
CursorPtr pCursor;
|
||||
int x; /* cursor hotspot */
|
||||
int y;
|
||||
BoxRec saved; /* saved area from the screen */
|
||||
Bool isUp; /* cursor in frame buffer */
|
||||
Bool shouldBeUp; /* cursor should be displayed */
|
||||
WindowPtr pCacheWin; /* window the cursor last seen in */
|
||||
Bool isInCacheWin;
|
||||
Bool checkPixels; /* check colormap collision */
|
||||
ScreenPtr pScreen;
|
||||
} miCursorInfoRec, *miCursorInfoPtr;
|
||||
|
||||
/*
|
||||
* per screen information
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* screen procedures */
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
GetImageProcPtr GetImage;
|
||||
GetSpansProcPtr GetSpans;
|
||||
SourceValidateProcPtr SourceValidate;
|
||||
|
||||
/* window procedures */
|
||||
CopyWindowProcPtr CopyWindow;
|
||||
|
||||
/* colormap procedures */
|
||||
InstallColormapProcPtr InstallColormap;
|
||||
StoreColorsProcPtr StoreColors;
|
||||
|
||||
/* os layer procedures */
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
|
||||
/* device cursor procedures */
|
||||
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
|
||||
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
|
||||
|
||||
xColorItem colors[2];
|
||||
ColormapPtr pInstalledMap;
|
||||
ColormapPtr pColormap;
|
||||
VisualPtr pVisual;
|
||||
miSpriteCursorFuncPtr funcs;
|
||||
DamagePtr pDamage; /* damage tracking structure */
|
||||
Bool damageRegistered;
|
||||
} miSpriteScreenRec, *miSpriteScreenPtr;
|
||||
|
||||
#define SOURCE_COLOR 0
|
||||
#define MASK_COLOR 1
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr and Box elements
|
||||
*/
|
||||
#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
|
||||
(((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
|
||||
((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr, origins, and rectangle
|
||||
*/
|
||||
#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
|
||||
BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr, origins and RectPtr
|
||||
*/
|
||||
#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
|
||||
ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
|
||||
(int)((pRect)->width), (int)((pRect)->height))
|
||||
/*
|
||||
* Overlap BoxPtr and horizontal span
|
||||
*/
|
||||
#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
|
||||
|
||||
#define LINE_SORT(x1,y1,x2,y2) \
|
||||
{ int _t; \
|
||||
if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
|
||||
if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
|
||||
|
||||
#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
||||
BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
||||
|
||||
|
||||
#define SPRITE_DEBUG_ENABLE 0
|
||||
|
@ -65,29 +142,26 @@ in this Software without prior written authorization from The Open Group.
|
|||
#define SPRITE_DEBUG(x)
|
||||
#endif
|
||||
|
||||
|
||||
#define MISPRITE(dev) \
|
||||
((DevHasCursor(dev)) ? \
|
||||
(miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \
|
||||
(miCursorInfoPtr)dixLookupPrivate(&dev->u.master->devPrivates, miSpriteDevPrivatesKey))
|
||||
|
||||
static int damageRegister = 0;
|
||||
|
||||
static void
|
||||
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
|
||||
{
|
||||
if (damageRegister) {
|
||||
if (pScreenPriv->damageRegistered) {
|
||||
DamageUnregister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
|
||||
pScreenPriv->pDamage);
|
||||
damageRegister = 0;
|
||||
pScreenPriv->damageRegistered = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
|
||||
{
|
||||
if (!damageRegister) {
|
||||
damageRegister = 1;
|
||||
if (!pScreenPriv->damageRegistered) {
|
||||
pScreenPriv->damageRegistered = 1;
|
||||
DamageRegister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
|
||||
pScreenPriv->pDamage);
|
||||
}
|
||||
|
@ -111,8 +185,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
|
|||
|
||||
static int miSpriteScreenKeyIndex;
|
||||
static DevPrivateKey miSpriteScreenKey = &miSpriteScreenKeyIndex;
|
||||
static int mmiSpriteDevPrivatesKeyIndex;
|
||||
static DevPrivateKey miSpriteDevPrivatesKey = &mmiSpriteDevPrivatesKeyIndex;
|
||||
static int miSpriteDevPrivatesKeyIndex;
|
||||
static DevPrivateKey miSpriteDevPrivatesKey = &miSpriteDevPrivatesKeyIndex;
|
||||
|
||||
static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
|
||||
static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
|
||||
|
@ -188,8 +262,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
|||
miCursorInfoPtr pCursorInfo;
|
||||
DeviceIntPtr pDev;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
|
@ -199,8 +272,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
|||
|
||||
if (pCursorInfo->isUp &&
|
||||
pCursorInfo->pScreen == pScreen &&
|
||||
RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved)
|
||||
!= rgnOUT)
|
||||
miRectIn(pRegion, &pCursorInfo->saved) != rgnOUT)
|
||||
{
|
||||
SPRITE_DEBUG(("Damage remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
|
@ -231,15 +303,15 @@ miSpriteInitialize (ScreenPtr pScreen,
|
|||
return FALSE;
|
||||
|
||||
pScreenPriv->pDamage = DamageCreate (miSpriteReportDamage,
|
||||
(DamageDestroyFunc) 0,
|
||||
NULL,
|
||||
DamageReportRawRegion,
|
||||
TRUE,
|
||||
pScreen,
|
||||
(void *) pScreen);
|
||||
pScreen);
|
||||
|
||||
if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
|
||||
{
|
||||
xfree ((pointer) pScreenPriv);
|
||||
xfree (pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
for (pVisual = pScreen->visuals;
|
||||
|
@ -271,6 +343,8 @@ miSpriteInitialize (ScreenPtr pScreen,
|
|||
pScreenPriv->colors[MASK_COLOR].red = 0;
|
||||
pScreenPriv->colors[MASK_COLOR].green = 0;
|
||||
pScreenPriv->colors[MASK_COLOR].blue = 0;
|
||||
pScreenPriv->damageRegistered = 0;
|
||||
|
||||
dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv);
|
||||
|
||||
pScreen->CloseScreen = miSpriteCloseScreen;
|
||||
|
@ -284,8 +358,6 @@ miSpriteInitialize (ScreenPtr pScreen,
|
|||
|
||||
pScreen->BlockHandler = miSpriteBlockHandler;
|
||||
|
||||
damageRegister = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -303,8 +375,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
|
|||
{
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||
pScreen->GetImage = pScreenPriv->GetImage;
|
||||
pScreen->GetSpans = pScreenPriv->GetSpans;
|
||||
|
@ -315,7 +386,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
|
|||
|
||||
DamageDestroy (pScreenPriv->pDamage);
|
||||
|
||||
xfree ((pointer) pScreenPriv);
|
||||
xfree (pScreenPriv);
|
||||
|
||||
return (*pScreen->CloseScreen) (i, pScreen);
|
||||
}
|
||||
|
@ -332,22 +403,22 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
|
|||
|
||||
SCREEN_PROLOGUE (pScreen, GetImage);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
if (DevHasCursor(pDev))
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
if (pDrawable->type == DRAWABLE_WINDOW &&
|
||||
pCursorInfo->isUp &&
|
||||
pCursorInfo->pScreen == pScreen &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
|
||||
sx, sy, w, h))
|
||||
{
|
||||
SPRITE_DEBUG (("GetImage remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
if (DevHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
|
||||
sx, sy, w, h))
|
||||
{
|
||||
SPRITE_DEBUG (("GetImage remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -368,38 +439,38 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
|
|||
|
||||
SCREEN_PROLOGUE (pScreen, GetSpans);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
if (DevHasCursor(pDev))
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
|
||||
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
if (pDrawable->type == DRAWABLE_WINDOW &&
|
||||
pCursorInfo->isUp &&
|
||||
pCursorInfo->pScreen == pScreen)
|
||||
if (DevHasCursor(pDev))
|
||||
{
|
||||
DDXPointPtr pts;
|
||||
int *widths;
|
||||
int nPts;
|
||||
int xorg,
|
||||
yorg;
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
xorg = pDrawable->x;
|
||||
yorg = pDrawable->y;
|
||||
|
||||
for (pts = ppt, widths = pwidth, nPts = nspans;
|
||||
nPts--;
|
||||
pts++, widths++)
|
||||
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
|
||||
{
|
||||
if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
|
||||
pts->x+xorg,*widths))
|
||||
DDXPointPtr pts;
|
||||
int *widths;
|
||||
int nPts;
|
||||
int xorg,
|
||||
yorg;
|
||||
|
||||
xorg = pDrawable->x;
|
||||
yorg = pDrawable->y;
|
||||
|
||||
for (pts = ppt, widths = pwidth, nPts = nspans;
|
||||
nPts--;
|
||||
pts++, widths++)
|
||||
{
|
||||
SPRITE_DEBUG (("GetSpans remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
break;
|
||||
if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
|
||||
pts->x+xorg,*widths))
|
||||
{
|
||||
SPRITE_DEBUG (("GetSpans remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -422,23 +493,24 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
|
|||
|
||||
SCREEN_PROLOGUE (pScreen, SourceValidate);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
if (DevHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
|
||||
pCursorInfo->pScreen == pScreen &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
|
||||
x, y, width, height))
|
||||
{
|
||||
SPRITE_DEBUG (("SourceValidate remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
}
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
|
||||
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (DevHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
|
||||
x, y, width, height))
|
||||
{
|
||||
SPRITE_DEBUG (("SourceValidate remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pScreen->SourceValidate)
|
||||
|
@ -457,8 +529,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
|
||||
SCREEN_PROLOGUE (pScreen, CopyWindow);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
|
@ -469,7 +540,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
* Damage will take care of destination check
|
||||
*/
|
||||
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
||||
RECT_IN_REGION (pScreen, prgnSrc, &pCursorInfo->saved) != rgnOUT)
|
||||
miRectIn(prgnSrc, &pCursorInfo->saved) != rgnOUT)
|
||||
{
|
||||
SPRITE_DEBUG (("CopyWindow remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
|
@ -490,8 +561,7 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
|
|||
DeviceIntPtr pDev;
|
||||
miCursorInfoPtr pCursorInfo;
|
||||
|
||||
pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
SCREEN_PROLOGUE(pScreen, BlockHandler);
|
||||
|
||||
(*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
|
||||
|
@ -534,8 +604,7 @@ miSpriteInstallColormap (ColormapPtr pMap)
|
|||
ScreenPtr pScreen = pMap->pScreen;
|
||||
miSpriteScreenPtr pPriv;
|
||||
|
||||
pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
SCREEN_PROLOGUE(pScreen, InstallColormap);
|
||||
|
||||
(*pScreen->InstallColormap) (pMap);
|
||||
|
@ -573,8 +642,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
|
|||
DeviceIntPtr pDev;
|
||||
miCursorInfoPtr pCursorInfo;
|
||||
|
||||
pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
SCREEN_PROLOGUE(pScreen, StoreColors);
|
||||
|
||||
(*pScreen->StoreColors) (pMap, ndef, pdef);
|
||||
|
@ -649,7 +717,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
|
|||
static void
|
||||
miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
|
||||
{
|
||||
miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr)
|
||||
miSpriteScreenPtr pScreenPriv =
|
||||
dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
CursorPtr pCursor;
|
||||
xColorItem *sourceColor, *maskColor;
|
||||
|
@ -695,8 +763,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
miSpriteScreenPtr pScreenPriv;
|
||||
miCursorInfoPtr pCursorInfo;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
if (!pDev->isMaster && !pDev->u.master)
|
||||
{
|
||||
ErrorF("[mi] miSpriteRealizeCursor called for floating device.\n");
|
||||
|
@ -715,8 +782,7 @@ miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
{
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor);
|
||||
}
|
||||
|
||||
|
@ -727,8 +793,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
|
|||
miSpriteScreenPtr pScreenPriv;
|
||||
miCursorInfoPtr pPointer;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
|
||||
if (!pDev->isMaster && !pDev->u.master)
|
||||
{
|
||||
|
@ -846,8 +911,7 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
|||
miSpriteScreenPtr pScreenPriv;
|
||||
CursorPtr pCursor;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
if (!pDev->isMaster && !pDev->u.master)
|
||||
{
|
||||
ErrorF("[mi] miSpriteMoveCursor called for floating device.\n");
|
||||
|
@ -866,8 +930,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
miCursorInfoPtr pCursorInfo;
|
||||
int ret = FALSE;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
|
||||
pCursorInfo = xalloc(sizeof(miCursorInfoRec));
|
||||
if (!pCursorInfo)
|
||||
|
@ -899,8 +962,8 @@ miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
if (DevHasCursor(pDev))
|
||||
{
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
pScreenPriv = (miSpriteScreenPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
|
||||
(*pScreenPriv->funcs->DeviceCursorCleanup)(pDev, pScreen);
|
||||
}
|
||||
|
@ -923,8 +986,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
return;
|
||||
}
|
||||
DamageDrawInternal (pScreen, TRUE);
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
miSpriteIsDown(pCursorInfo);
|
||||
|
@ -964,8 +1026,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
return;
|
||||
}
|
||||
DamageDrawInternal (pScreen, TRUE);
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
miSpriteComputeSaved (pDev, pScreen);
|
||||
|
@ -1009,8 +1070,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
}
|
||||
|
||||
DamageDrawInternal (pScreen, TRUE);
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
miSpriteComputeSaved (pDev, pScreen);
|
||||
|
@ -1052,8 +1112,7 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
ErrorF("[mi] miSpriteComputeSaved called for floating device.\n");
|
||||
return;
|
||||
}
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
|
||||
pCursorInfo = MISPRITE(pDev);
|
||||
|
||||
pCursor = pCursorInfo->pCursor;
|
||||
|
|
127
mi/mispritest.h
127
mi/mispritest.h
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
* mispritest.h
|
||||
*
|
||||
* mi sprite structures
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _MISPRITEST_H_
|
||||
#define _MISPRITEST_H_
|
||||
|
||||
# include "misprite.h"
|
||||
#ifdef RENDER
|
||||
# include "picturestr.h"
|
||||
#endif
|
||||
# include "damage.h"
|
||||
|
||||
typedef struct {
|
||||
CursorPtr pCursor;
|
||||
int x; /* cursor hotspot */
|
||||
int y;
|
||||
BoxRec saved; /* saved area from the screen */
|
||||
Bool isUp; /* cursor in frame buffer */
|
||||
Bool shouldBeUp; /* cursor should be displayed */
|
||||
WindowPtr pCacheWin; /* window the cursor last seen in */
|
||||
Bool isInCacheWin;
|
||||
Bool checkPixels; /* check colormap collision */
|
||||
ScreenPtr pScreen;
|
||||
} miCursorInfoRec, *miCursorInfoPtr;
|
||||
|
||||
/*
|
||||
* per screen information
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* screen procedures */
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
GetImageProcPtr GetImage;
|
||||
GetSpansProcPtr GetSpans;
|
||||
SourceValidateProcPtr SourceValidate;
|
||||
|
||||
/* window procedures */
|
||||
CopyWindowProcPtr CopyWindow;
|
||||
|
||||
/* colormap procedures */
|
||||
InstallColormapProcPtr InstallColormap;
|
||||
StoreColorsProcPtr StoreColors;
|
||||
|
||||
/* os layer procedures */
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
|
||||
/* device cursor procedures */
|
||||
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
|
||||
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
|
||||
|
||||
xColorItem colors[2];
|
||||
ColormapPtr pInstalledMap;
|
||||
ColormapPtr pColormap;
|
||||
VisualPtr pVisual;
|
||||
miSpriteCursorFuncPtr funcs;
|
||||
DamagePtr pDamage; /* damage tracking structure */
|
||||
} miSpriteScreenRec, *miSpriteScreenPtr;
|
||||
|
||||
#define SOURCE_COLOR 0
|
||||
#define MASK_COLOR 1
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr and Box elements
|
||||
*/
|
||||
#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
|
||||
(((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
|
||||
((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr, origins, and rectangle
|
||||
*/
|
||||
#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
|
||||
BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
|
||||
|
||||
/*
|
||||
* Overlap BoxPtr, origins and RectPtr
|
||||
*/
|
||||
#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
|
||||
ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
|
||||
(int)((pRect)->width), (int)((pRect)->height))
|
||||
/*
|
||||
* Overlap BoxPtr and horizontal span
|
||||
*/
|
||||
#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
|
||||
|
||||
#define LINE_SORT(x1,y1,x2,y2) \
|
||||
{ int _t; \
|
||||
if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
|
||||
if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
|
||||
|
||||
#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
||||
BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
||||
|
||||
#endif /* _MISPRITEST_H_ */
|
|
@ -172,7 +172,6 @@ int *ConnectionTranslation = NULL;
|
|||
#define MAXSOCKS 500
|
||||
#undef MAXSELECT
|
||||
#define MAXSELECT 500
|
||||
#define MAXFD 500
|
||||
|
||||
struct _ct_node {
|
||||
struct _ct_node *next;
|
||||
|
@ -346,15 +345,6 @@ InitParentProcess(void)
|
|||
RunFromSmartParent = TRUE;
|
||||
OsSignal(SIGUSR1, handler);
|
||||
ParentProcess = getppid ();
|
||||
#ifdef __UNIXOS2__
|
||||
/*
|
||||
* fg030505: under OS/2, xinit is not the parent process but
|
||||
* the "grant parent" process of the server because execvpe()
|
||||
* presents us an additional process number;
|
||||
* GetPPID(pid) is part of libemxfix
|
||||
*/
|
||||
ParentProcess = GetPPID (ParentProcess);
|
||||
#endif /* __UNIXOS2__ */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
18
os/utils.c
18
os/utils.c
|
@ -400,8 +400,7 @@ UnlockServer(void)
|
|||
|
||||
/* Force connections to close on SIGHUP from init */
|
||||
|
||||
/*ARGSUSED*/
|
||||
SIGVAL
|
||||
void
|
||||
AutoResetServer (int sig)
|
||||
{
|
||||
int olderrno = errno;
|
||||
|
@ -413,8 +412,7 @@ AutoResetServer (int sig)
|
|||
|
||||
/* Force connections to close and then exit on SIGTERM, SIGINT */
|
||||
|
||||
/*ARGSUSED*/
|
||||
SIGVAL
|
||||
void
|
||||
GiveUp(int sig)
|
||||
{
|
||||
int olderrno = errno;
|
||||
|
@ -487,7 +485,6 @@ void UseMsg(void)
|
|||
ErrorF("-core generate core dump on fatal error\n");
|
||||
ErrorF("-dpi int screen resolution in dots per inch\n");
|
||||
#ifdef DPMSExtension
|
||||
ErrorF("dpms enables VESA DPMS monitor control\n");
|
||||
ErrorF("-dpms disables VESA DPMS monitor control\n");
|
||||
#endif
|
||||
ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
|
||||
|
@ -535,7 +532,6 @@ void UseMsg(void)
|
|||
ErrorF("-v screen-saver without video blanking\n");
|
||||
ErrorF("-wm WhenMapped default backing-store\n");
|
||||
ErrorF("-wr create root window with white background\n");
|
||||
ErrorF("-x string loads named extension at init time \n");
|
||||
ErrorF("-maxbigreqsize set maximal bigrequest size \n");
|
||||
#ifdef PANORAMIX
|
||||
ErrorF("+xinerama Enable XINERAMA extension\n");
|
||||
|
@ -673,7 +669,7 @@ ProcessCommandLine(int argc, char *argv[])
|
|||
}
|
||||
#ifdef DPMSExtension
|
||||
else if ( strcmp( argv[i], "dpms") == 0)
|
||||
DPMSEnabledSwitch = TRUE;
|
||||
/* ignored for compatibility */ ;
|
||||
else if ( strcmp( argv[i], "-dpms") == 0)
|
||||
DPMSDisabledSwitch = TRUE;
|
||||
#endif
|
||||
|
@ -884,14 +880,6 @@ ProcessCommandLine(int argc, char *argv[])
|
|||
PanoramiXExtensionDisabledHack = TRUE;
|
||||
}
|
||||
#endif
|
||||
else if ( strcmp( argv[i], "-x") == 0)
|
||||
{
|
||||
if(++i >= argc)
|
||||
UseMsg();
|
||||
/* For U**x, which doesn't support dynamic loading, there's nothing
|
||||
* to do when we see a -x. Either the extension is linked in or
|
||||
* it isn't */
|
||||
}
|
||||
else if ( strcmp( argv[i], "-I") == 0)
|
||||
{
|
||||
/* ignore all remaining arguments */
|
||||
|
|
|
@ -605,7 +605,7 @@ ProcXkbLatchLockState(ClientPtr client)
|
|||
|
||||
for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
|
||||
if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) {
|
||||
if (!tmpd->key->xkbInfo)
|
||||
if (!tmpd->key || !tmpd->key->xkbInfo)
|
||||
continue;
|
||||
|
||||
oldState = tmpd->key->xkbInfo->state;
|
||||
|
@ -744,6 +744,8 @@ ProcXkbSetControls(ClientPtr client)
|
|||
CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask);
|
||||
|
||||
for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
|
||||
if (!tmpd->key || !tmpd->key->xkbInfo)
|
||||
continue;
|
||||
if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) {
|
||||
xkbi = tmpd->key->xkbInfo;
|
||||
ctrl = xkbi->desc->ctrls;
|
||||
|
|
|
@ -643,7 +643,7 @@ XkbCopySrvLedInfo( DeviceIntPtr from,
|
|||
else
|
||||
sli_new->fb.lf = lf;
|
||||
|
||||
if (sli_new->flags & XkbSLI_IsDefault) {
|
||||
if (!(sli_new->flags & XkbSLI_IsDefault)) {
|
||||
sli_new->names= _XkbTypedCalloc(XkbNumIndicators,Atom);
|
||||
sli_new->maps= _XkbTypedCalloc(XkbNumIndicators,XkbIndicatorMapRec);
|
||||
} /* else sli_new->names/maps is pointing to
|
||||
|
|
Loading…
Reference in New Issue
Block a user