diff options
author | Colin Hill <colin.james.hill@gmail.com> | 2011-02-23 13:43:07 -0800 |
---|---|---|
committer | Colin Hill <colin.james.hill@gmail.com> | 2011-02-23 13:43:07 -0800 |
commit | 7f1dd59b90edf8aff40fc6d1fd1a5399aceef11d (patch) | |
tree | 084191313f4f55a821583e32054bcb82955ac47f | |
parent | fee985d96626cfd77362c2085c305e28cfecbf94 (diff) |
Got rid of unsightly void pointers.
-rw-r--r-- | AUTHORS | 6 | ||||
-rw-r--r-- | src/client.h | 8 | ||||
-rw-r--r-- | src/driver.c | 21 | ||||
-rw-r--r-- | src/input.c | 36 | ||||
-rw-r--r-- | src/input.h | 33 | ||||
-rw-r--r-- | src/xcbclient.c | 4 | ||||
-rw-r--r-- | src/xlibclient.c | 53 |
7 files changed, 114 insertions, 47 deletions
@@ -1 +1,7 @@ +Tuan Bui <tuanbui918@gmail.com> +Colin Cornaby <> +Timothy Fleck <> +Colin Hill <colin.james.hill@gmail.com> +Weseung Hwang <> +Nathaniel Way <> Paulo Zanoni <pzanoni@mandriva.com> diff --git a/src/client.h b/src/client.h index a52bd35..7425390 100644 --- a/src/client.h +++ b/src/client.h @@ -18,7 +18,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * Author: Paulo Zanoni <pzanoni@mandriva.com> + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. */ #include <xorg/colormap.h> @@ -52,10 +54,10 @@ void NestedClientUpdateScreen(NestedClientPrivatePtr pPriv, int16_t x2, int16_t y2); -void NestedClientHideCursor(NestedClientPrivatePtr pPriv); /* Hide cursor function */ +void NestedClientHideCursor(NestedClientPrivatePtr pPriv); void NestedClientTimerCallback(NestedClientPrivatePtr pPriv); void NestedClientCloseScreen(NestedClientPrivatePtr pPriv); -void NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, void* dev); +void NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, DeviceIntPtr dev); diff --git a/src/driver.c b/src/driver.c index 0980297..3015e76 100644 --- a/src/driver.c +++ b/src/driver.c @@ -18,7 +18,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * Author: Paulo Zanoni <pzanoni@mandriva.com> + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. */ #include <stdlib.h> @@ -168,12 +170,6 @@ typedef struct NestedPrivate { /*static ScrnInfoPtr NESTEDScrn;*/ -static CARD32 -NestedMouseTimer(OsTimerPtr timer, CARD32 time, pointer arg) { - NestedInputLoadDriver(arg); - return 0; -} - static pointer NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -581,6 +577,14 @@ NestedAddMode(ScrnInfoPtr pScrn, int width, int height) { return TRUE; } +// Wrapper for timed call to NestedInputLoadDriver. Used with timer in order +// to force the initialization to wait until the input core is initialized. +static CARD32 +NestedMouseTimer(OsTimerPtr timer, CARD32 time, pointer arg) { + NestedInputLoadDriver(arg); + return 0; +} + /* Called at each server generation */ static Bool NestedScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { @@ -656,11 +660,12 @@ static Bool NestedScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, pNested->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = NestedCloseScreen; + // Schedule the NestedInputLoadDriver function to load once the + // input core is initialized. pNested->timer = TimerSet(NULL, 0, TIMER_CALLBACK_INTERVAL, NestedTimerCallback, (pointer)pScrn); return TRUE; - } static Bool diff --git a/src/input.c b/src/input.c index 3c6efef..6e7de4c 100644 --- a/src/input.c +++ b/src/input.c @@ -1,3 +1,28 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. + */ + #include <errno.h> #include <fcntl.h> #include <stdlib.h> @@ -176,8 +201,7 @@ _nested_input_init_axes(DeviceIntPtr device) { if (!InitValuatorClassDeviceStruct(device, NUM_MOUSE_AXES, - (Atom*)GetMotionHistory, - //(Atom*)NULL, + (Atom*)GetMotionHistory, // Not sure about this. GetMotionHistorySize(), (Atom)0)) { return BadAlloc; @@ -189,7 +213,7 @@ _nested_input_init_axes(DeviceIntPtr device) { int i; for (i = 0; i < NUM_MOUSE_AXES; i++) { - xf86InitValuatorAxisStruct(device, i, (Atom)NULL, -1, -1, 1, 1, 1); + xf86InitValuatorAxisStruct(device, i, (Atom)0, -1, -1, 1, 1, 1); xf86InitValuatorDefaults(device, i); } @@ -270,16 +294,16 @@ NestedInputLoadDriver(NestedClientPrivatePtr clientData) { } void -NestedInputPostMouseMotionEvent(void* dev, int x, int y) { +NestedInputPostMouseMotionEvent(DeviceIntPtr dev, int x, int y) { xf86PostMotionEvent(dev, TRUE, 0, 2, x, y); } void -NestedInputPostButtonEvent(void* dev, int button, int isDown) { +NestedInputPostButtonEvent(DeviceIntPtr dev, int button, int isDown) { xf86PostButtonEvent(dev, 0, button, isDown, 0, 0); } void -NestedInputPostKeyboardEvent(void* dev, unsigned int keycode, int isDown) { +NestedInputPostKeyboardEvent(DeviceIntPtr dev, unsigned int keycode, int isDown) { xf86PostKeyboardEvent(dev, keycode, isDown); } diff --git a/src/input.h b/src/input.h index df76637..b60a40a 100644 --- a/src/input.h +++ b/src/input.h @@ -1,3 +1,29 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. + */ + +#include <xorg/xf86.h> #include "xf86Xinput.h" // Loads the nested input driver. @@ -12,9 +38,8 @@ NestedInputUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); // Input event posting functions. void -NestedInputPostMouseMotionEvent(void* dev, int x, int y); +NestedInputPostMouseMotionEvent(DeviceIntPtr dev, int x, int y); void -NestedInputPostButtonEvent(void* dev, int button, int isDown); +NestedInputPostButtonEvent(DeviceIntPtr dev, int button, int isDown); void -NestedInputPostKeyboardEvent(void* dev, unsigned int keycode, int isDown); - +NestedInputPostKeyboardEvent(DeviceIntPtr dev, unsigned int keycode, int isDown); diff --git a/src/xcbclient.c b/src/xcbclient.c index fec53c9..053470f 100644 --- a/src/xcbclient.c +++ b/src/xcbclient.c @@ -18,7 +18,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * Author: Paulo Zanoni <pzanoni@mandriva.com> + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. */ #include <client.h> diff --git a/src/xlibclient.c b/src/xlibclient.c index bdb5d22..de4e0df 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -1,25 +1,27 @@ /* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -* Author: Paulo Zanoni <pzanoni@mandriva.com> -*/ + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: Paulo Zanoni <pzanoni@mandriva.com>, Timothy Fleck, + * Colin Cornaby, Weseung Hwang, Colin Hill, Nathaniel Way, + * Tuan Thong Bui. + */ #include <stdlib.h> @@ -33,6 +35,7 @@ #include <xorg/xf86.h> #include "client.h" + #include "input.h" struct NestedClientPrivate { @@ -49,8 +52,8 @@ struct NestedClientPrivate { Cursor mycursor; /* Test cursor */ Pixmap bitmapNoData; XColor color1; - - void* dev; + DeviceIntPtr dev; // The pointer to the input device. Passed back to the + // input driver when posting input events. }; /* Checks if a display is open */ @@ -218,7 +221,7 @@ xf86DrvMsg(scrnIndex, X_INFO, "blu_mask: 0x%lx\n", pPriv->img->blue_mask); } } - pPriv->dev = NULL; + pPriv->dev = (DeviceIntPtr)NULL; return pPriv; } @@ -319,6 +322,6 @@ NestedClientCloseScreen(NestedClientPrivatePtr pPriv) { } void -NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, void *dev) { +NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, DeviceIntPtr dev) { pPriv->dev = dev; } |