summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/compat-api.h42
-rw-r--r--src/driver.c38
-rw-r--r--src/nested_input.c44
4 files changed, 20 insertions, 106 deletions
diff --git a/configure.ac b/configure.ac
index 50b38af..f5be789 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@ AC_SUBST(moduledir)
#XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
# Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, xorg-server >= 1.18 xproto $REQUIRED_MODULES)
# Checks for libraries.
PKG_CHECK_MODULES(X11, x11)
diff --git a/src/compat-api.h b/src/compat-api.h
index b74a582..97f91b4 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -28,46 +28,6 @@
#ifndef COMPAT_API_H
#define COMPAT_API_H
-#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
-#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
-#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
-#endif
-
-#ifndef XF86_HAS_SCRN_CONV
-#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
-#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
-#endif
-
-#ifndef XF86_SCRN_INTERFACE
-
-#define SCRN_ARG_TYPE int
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
-
-#define SCREEN_ARG_TYPE int
-#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
-
-#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv
-
-#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
-#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
-
-#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
-#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
-
-#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
-#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
-
-#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
-#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
-
-#define FREE_SCREEN_ARGS_DECL int arg, int flags
-#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
-
-#define VT_FUNC_ARGS_DECL int arg, int flags
-#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
-
-#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
-#else
#define SCRN_ARG_TYPE ScrnInfoPtr
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
@@ -97,5 +57,3 @@
#define XF86_ENABLEDISABLEFB_ARG(x) (x)
#endif
-
-#endif
diff --git a/src/driver.c b/src/driver.c
index 67eab71..f30d76d 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -179,15 +179,15 @@ NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
if (!setupDone) {
setupDone = TRUE;
-
+
xf86AddDriver(&NESTED, module, HaveDriverFuncs);
xf86AddInputDriver(&NESTEDINPUT, module, 0);
-
+
return (pointer)1;
} else {
if (errmaj)
*errmaj = LDR_ONCEONLY;
-
+
return NULL;
}
}
@@ -280,7 +280,7 @@ static Bool NestedAllocatePrivate(ScrnInfoPtr pScrn) {
return FALSE;
}
- pScrn->driverPrivate = xnfcalloc(sizeof(NestedPrivate), 1);
+ pScrn->driverPrivate = XNFcallocarray(sizeof(NestedPrivate), 1);
if (pScrn->driverPrivate == NULL)
return FALSE;
return TRUE;
@@ -316,7 +316,7 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) {
if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb))
return FALSE;
-
+
xf86PrintDepthBpp(pScrn);
if (pScrn->depth > 8) {
@@ -372,12 +372,6 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) {
return FALSE;
}
- /*if (pScrn->depth > 1) {
- Gamma zeros = {0.0, 0.0, 0.0};
- if (!xf86SetGamma(pScrn, zeros))
- return FALSE;
- }*/
-
if (NestedValidateModes(pScrn) < 1) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes\n");
return FALSE;
@@ -401,7 +395,7 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) {
pScrn->memPhysBase = 0;
pScrn->fbOffset = 0;
-
+
return TRUE;
}
@@ -456,10 +450,10 @@ NestedValidateModes(ScrnInfoPtr pScrn) {
while (mode != NULL) {
if (mode->HDisplay > maxX)
maxX = mode->HDisplay;
-
+
if (mode->VDisplay > maxY)
maxY = mode->VDisplay;
-
+
mode = mode->next;
}
pScrn->virtualX = maxX;
@@ -493,7 +487,7 @@ NestedAddMode(ScrnInfoPtr pScrn, int width, int height) {
if (snprintf(nameBuf, 64, "%dx%d", width, height) >= 64)
return FALSE;
- mode = xnfcalloc(sizeof(DisplayModeRec), 1);
+ mode = XNFcallocarray(sizeof(DisplayModeRec), 1);
mode->status = MODE_OK;
mode->type = M_T_DRIVER;
mode->HDisplay = width;
@@ -559,15 +553,9 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NestedScreenInit\n");
pNested = PNESTED(pScrn);
- /*NESTEDScrn = pScrn;*/
NestedPrintPscreen(pScrn);
- /* Save state:
- * NestedSave(pScrn); */
-
- //Load_Nested_Mouse();
-
pNested->clientData = NestedClientCreateScreen(pScrn->scrnIndex,
pNested->displayName,
pScrn->virtualX,
@@ -577,12 +565,12 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL)
pScrn->depth,
pScrn->bitsPerPixel,
&redMask, &greenMask, &blueMask);
-
+
if (!pNested->clientData) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to create client screen\n");
return FALSE;
}
-
+
// Schedule the NestedInputLoadDriver function to load once the
// input core is initialized.
TimerSet(NULL, 0, 1, NestedMouseTimer, pNested->clientData);
@@ -593,7 +581,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL)
pScrn->rgbBits, pScrn->defaultVisual,
redMask, greenMask, blueMask))
return FALSE;
-
+
if (!miSetPixmapDepths())
return FALSE;
@@ -607,7 +595,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL)
xf86SetBlackWhitePixels(pScreen);
xf86SetBackingStore(pScreen);
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
-
+
if (!miCreateDefColormap(pScreen))
return FALSE;
diff --git a/src/nested_input.c b/src/nested_input.c
index b674c35..7d84cbd 100644
--- a/src/nested_input.c
+++ b/src/nested_input.c
@@ -199,7 +199,7 @@ _nested_input_init_buttons(DeviceIntPtr device) {
if (!InitButtonClassDeviceStruct(device, NUM_MOUSE_BUTTONS, buttonLabels, map)) {
xf86Msg(X_ERROR, "%s: Failed to register buttons.\n", pInfo->name);
-
+
free(map);
return BadAlloc;
}
@@ -271,12 +271,12 @@ NestedInputControl(DeviceIntPtr device, int what) {
break;
case DEVICE_OFF:
xf86Msg(X_INFO, "%s: Off.\n", pInfo->name);
-
+
if (!device->public.on)
break;
-
+
xf86RemoveEnabledDevice(pInfo);
-
+
pInfo->fd = -1;
device->public.on = FALSE;
break;
@@ -300,38 +300,6 @@ NestedInputReadInput(InputInfoPtr pInfo) {
TimerSet(NULL, 0, 1, nested_input_ready, pNestedInput->clientData);
}
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 14
-static InputOption*
-input_option_new(InputOption* list, char *key, char *value)
-{
- InputOption *tmp;
-
- tmp = calloc(1, sizeof(*tmp));
- tmp->key = key;
- tmp->value = value;
- tmp->next = list;
-
- return tmp;
-}
-
-static void
-input_option_free_list(InputOption **list)
-{
- InputOption *iopts = *list;
-
- while(iopts)
- {
- InputOption *tmp = iopts->next;
- free(iopts->key);
- free(iopts->value);
- free(iopts);
- iopts = tmp;
- }
-
- *list = NULL;
-}
-#endif
-
void
NestedInputLoadDriver(NestedClientPrivatePtr clientData) {
@@ -343,7 +311,7 @@ NestedInputLoadDriver(NestedClientPrivatePtr clientData) {
InputOption* options = NULL;
options = input_option_new(options, strdup("identifier"), strdup("nestedinput"));
options = input_option_new(options, strdup("driver"), strdup("nestedinput"));
-
+
// Invoke NewInputDeviceRequest to call the PreInit function of
// the driver.
int ret = NewInputDeviceRequest(options, NULL, &dev);
@@ -365,7 +333,7 @@ NestedInputLoadDriver(NestedClientPrivatePtr clientData) {
// device back to the input driver when events are being posted.
NestedClientSetDevicePtr(clientData, dev);
}
-
+
void
NestedInputPostMouseMotionEvent(DeviceIntPtr dev, int x, int y) {
xf86PostMotionEvent(dev, TRUE, 0, 2, x, y);