Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11mouse.c @ 2942:1e431c2631ee
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 01 Jan 2009 08:21:19 +0000 |
parents | b93965a16fe0 |
children | 79dee7da6ba5 |
comparison
equal
deleted
inserted
replaced
2941:1d2bc7259f30 | 2942:1e431c2631ee |
---|---|
24 #include "SDL_x11mouse.h" | 24 #include "SDL_x11mouse.h" |
25 #include "../../events/SDL_mouse_c.h" | 25 #include "../../events/SDL_mouse_c.h" |
26 | 26 |
27 #if SDL_VIDEO_DRIVER_X11_XINPUT | 27 #if SDL_VIDEO_DRIVER_X11_XINPUT |
28 static void | 28 static void |
29 X11_FreeMouse(SDL_Mouse *mouse) | 29 X11_FreeMouse(SDL_Mouse * mouse) |
30 { | 30 { |
31 X11_MouseData *data = (X11_MouseData *)mouse->driverdata; | 31 X11_MouseData *data = (X11_MouseData *) mouse->driverdata; |
32 | 32 |
33 if (data) { | 33 if (data) { |
34 XCloseDevice(data->display, mouse->id); | 34 XCloseDevice(data->display, mouse->id); |
35 SDL_free(data); | 35 SDL_free(data); |
36 } | 36 } |
71 deviceClass = DevList[i].inputclassinfo; | 71 deviceClass = DevList[i].inputclassinfo; |
72 for (j = 0; j < DevList[i].num_classes; ++j) { | 72 for (j = 0; j < DevList[i].num_classes; ++j) { |
73 if (deviceClass->class == ValuatorClass) { /* bingo ;) */ | 73 if (deviceClass->class == ValuatorClass) { /* bingo ;) */ |
74 XValuatorInfo *valInfo; | 74 XValuatorInfo *valInfo; |
75 | 75 |
76 data = (X11_MouseData *)SDL_calloc(1, sizeof(*data)); | 76 data = (X11_MouseData *) SDL_calloc(1, sizeof(*data)); |
77 if (!data) { | 77 if (!data) { |
78 continue; | 78 continue; |
79 } | 79 } |
80 data->display = display; | 80 data->display = display; |
81 data->device = XOpenDevice(display, DevList[i].id); | 81 data->device = XOpenDevice(display, DevList[i].id); |
118 | 118 |
119 /* lets get the device parameters */ | 119 /* lets get the device parameters */ |
120 valInfo = (XValuatorInfo *) deviceClass; | 120 valInfo = (XValuatorInfo *) deviceClass; |
121 /* if the device reports pressure, lets check it parameteres */ | 121 /* if the device reports pressure, lets check it parameteres */ |
122 if (valInfo->num_axes > 2) { | 122 if (valInfo->num_axes > 2) { |
123 SDL_AddMouse(&mouse, DevList[i].name, | 123 SDL_AddMouse(&mouse, DevList[i].name, |
124 valInfo->axes[2].max_value, | 124 valInfo->axes[2].max_value, |
125 valInfo->axes[2].min_value, 1); | 125 valInfo->axes[2].min_value, 1); |
126 } else { | 126 } else { |
127 SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1); | 127 SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1); |
128 } | 128 } |
129 break; | 129 break; |
130 } | 130 } |
131 /* if it's not class we're interested in, lets go further */ | 131 /* if it's not class we're interested in, lets go further */ |
132 deviceClass = | 132 deviceClass = |