Commit 21915865 authored by Sam Lantinga's avatar Sam Lantinga

indent

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403404
parent 4bc10ea0
...@@ -617,10 +617,10 @@ SDL_AudioInit(const char *driver_name) ...@@ -617,10 +617,10 @@ SDL_AudioInit(const char *driver_name)
current_audio.name = backend->name; current_audio.name = backend->name;
current_audio.desc = backend->desc; current_audio.desc = backend->desc;
rc = backend->init(&current_audio.impl); rc = backend->init(&current_audio.impl);
if (rc == 2) { /* init'd, and devices available. Take it! */ if (rc == 2) { /* init'd, and devices available. Take it! */
initialized = 1; initialized = 1;
best_choice = i; best_choice = i;
} else if (rc == 1) { /* init'd, but can't see any devices. */ } else if (rc == 1) { /* init'd, but can't see any devices. */
current_audio.impl.Deinitialize(); current_audio.impl.Deinitialize();
if (best_choice == -1) { if (best_choice == -1) {
best_choice = i; best_choice = i;
......
...@@ -607,7 +607,7 @@ ALSA_Init(SDL_AudioDriverImpl * impl) ...@@ -607,7 +607,7 @@ ALSA_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = ALSA_Deinitialize; impl->Deinitialize = ALSA_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */ impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */
return 1; /* !!! FIXME: return 2 once device enum is implemented. */ return 1; /* !!! FIXME: return 2 once device enum is implemented. */
} }
......
...@@ -341,7 +341,7 @@ ESD_Init(SDL_AudioDriverImpl * impl) ...@@ -341,7 +341,7 @@ ESD_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = ESD_Deinitialize; impl->Deinitialize = ESD_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1; impl->OnlyHasDefaultOutputDevice = 1;
return 2; /* return 2 (definitely have a "device"). */ return 2; /* return 2 (definitely have a "device"). */
} }
......
...@@ -329,7 +329,7 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl) ...@@ -329,7 +329,7 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; impl->OnlyHasDefaultOutputDevice = 1;
impl->HasCaptureSupport = 0; /* still needs to be written */ impl->HasCaptureSupport = 0; /* still needs to be written */
return 2; /* defitely have an audio device. */ return 2; /* defitely have an audio device. */
} }
AudioBootStrap COREAUDIOIPHONE_bootstrap = { AudioBootStrap COREAUDIOIPHONE_bootstrap = {
......
...@@ -338,7 +338,7 @@ MINTDMA8_Init(SDL_AudioDriverImpl * impl) ...@@ -338,7 +338,7 @@ MINTDMA8_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1; impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1; impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap MINTAUDIO_DMA8_bootstrap = { AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
......
...@@ -433,7 +433,7 @@ MINTGSXB_Init(SDL_AudioDriverImpl * impl) ...@@ -433,7 +433,7 @@ MINTGSXB_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1; impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1; impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap MINTAUDIO_GSXB_bootstrap = { AudioBootStrap MINTAUDIO_GSXB_bootstrap = {
......
...@@ -390,7 +390,7 @@ MINTMCSN_Init(SDL_AudioDriverImpl * impl) ...@@ -390,7 +390,7 @@ MINTMCSN_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1; impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1; impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap MINTAUDIO_MCSN_bootstrap = { AudioBootStrap MINTAUDIO_MCSN_bootstrap = {
......
...@@ -297,7 +297,7 @@ MINTSTFA_Init(SDL_AudioDriverImpl * impl) ...@@ -297,7 +297,7 @@ MINTSTFA_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1; impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1; impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap MINTAUDIO_STFA_bootstrap = { AudioBootStrap MINTAUDIO_STFA_bootstrap = {
......
...@@ -490,7 +490,7 @@ MINTXBIOS_Init(SDL_AudioDriverImpl * impl) ...@@ -490,7 +490,7 @@ MINTXBIOS_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1; impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1; impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap MINTAUDIO_XBIOS_bootstrap = { AudioBootStrap MINTAUDIO_XBIOS_bootstrap = {
......
...@@ -398,7 +398,7 @@ NAS_Init(SDL_AudioDriverImpl * impl) ...@@ -398,7 +398,7 @@ NAS_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = NAS_Deinitialize; impl->Deinitialize = NAS_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */ impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap NAS_bootstrap = { AudioBootStrap NAS_bootstrap = {
......
...@@ -120,7 +120,7 @@ NDSAUD_Init(SDL_AudioDriverImpl * impl) ...@@ -120,7 +120,7 @@ NDSAUD_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; impl->OnlyHasDefaultOutputDevice = 1;
impl->OnlyHasDefaultInputDevice = 1; impl->OnlyHasDefaultInputDevice = 1;
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap NDSAUD_bootstrap = { AudioBootStrap NDSAUD_bootstrap = {
......
...@@ -457,7 +457,7 @@ NTO_Init(SDL_AudioDriverImpl * impl) ...@@ -457,7 +457,7 @@ NTO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */ impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */
/* !!! FIXME: device enum might make this 1. */ /* !!! FIXME: device enum might make this 1. */
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap QNXNTOAUDIO_bootstrap = { AudioBootStrap QNXNTOAUDIO_bootstrap = {
......
...@@ -545,7 +545,7 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl) ...@@ -545,7 +545,7 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */ impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */
/* !!! FIXME: device enum might make this 1. */ /* !!! FIXME: device enum might make this 1. */
return 2; /* 2 == definitely has an audio device. */ return 2; /* 2 == definitely has an audio device. */
} }
AudioBootStrap PAUDIO_bootstrap = { AudioBootStrap PAUDIO_bootstrap = {
......
...@@ -297,49 +297,55 @@ X11_DispatchEvent(_THIS) ...@@ -297,49 +297,55 @@ X11_DispatchEvent(_THIS)
default:{ default:{
#if SDL_VIDEO_DRIVER_X11_XINPUT #if SDL_VIDEO_DRIVER_X11_XINPUT
for (i = 0; i < SDL_GetNumMice(); ++i) { for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse; SDL_Mouse *mouse;
X11_MouseData *data; X11_MouseData *data;
mouse = SDL_GetMouse(i); mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata; data = (X11_MouseData *) mouse->driverdata;
if (!data) { if (!data) {
continue; continue;
} }
if (xevent.type == data->motion) { /* MotionNotify */ if (xevent.type == data->motion) { /* MotionNotify */
XDeviceMotionEvent *move = (XDeviceMotionEvent *) & xevent; XDeviceMotionEvent *move =
(XDeviceMotionEvent *) & xevent;
#ifdef DEBUG_MOTION #ifdef DEBUG_MOTION
printf("X11 motion: %d,%d\n", move->x, move->y); printf("X11 motion: %d,%d\n", move->x, move->y);
#endif #endif
SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y, move->axis_data[2]); SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y,
return; move->axis_data[2]);
} return;
if (xevent.type == data->button_pressed) { /* ButtonPress */ }
XDeviceButtonPressedEvent *pressed = if (xevent.type == data->button_pressed) { /* ButtonPress */
(XDeviceButtonPressedEvent *) & xevent; XDeviceButtonPressedEvent *pressed =
SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED, pressed->button); (XDeviceButtonPressedEvent *) & xevent;
return; SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED,
} pressed->button);
if (xevent.type == data->button_released) { /* ButtonRelease */ return;
XDeviceButtonReleasedEvent *released = }
(XDeviceButtonReleasedEvent *) & xevent; if (xevent.type == data->button_released) { /* ButtonRelease */
SDL_SendMouseButton(released->deviceid, SDL_RELEASED, released->button); XDeviceButtonReleasedEvent *released =
return; (XDeviceButtonReleasedEvent *) & xevent;
SDL_SendMouseButton(released->deviceid, SDL_RELEASED,
released->button);
return;
}
if (xevent.type == data->proximity_in) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x,
proximity->y, SDL_PROXIMITYIN);
return;
}
if (xevent.type == data->proximity_out) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x,
proximity->y, SDL_PROXIMITYOUT);
return;
}
} }
if (xevent.type == data->proximity_in) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYIN);
return;
}
if (xevent.type == data->proximity_out) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYOUT);
return;
}
}
#endif #endif
#ifdef DEBUG_XEVENTS #ifdef DEBUG_XEVENTS
printf("Unhandled event %d\n", xevent.type); printf("Unhandled event %d\n", xevent.type);
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#if SDL_VIDEO_DRIVER_X11_XINPUT #if SDL_VIDEO_DRIVER_X11_XINPUT
static void static void
X11_FreeMouse(SDL_Mouse *mouse) X11_FreeMouse(SDL_Mouse * mouse)
{ {
X11_MouseData *data = (X11_MouseData *)mouse->driverdata; X11_MouseData *data = (X11_MouseData *) mouse->driverdata;
if (data) { if (data) {
XCloseDevice(data->display, mouse->id); XCloseDevice(data->display, mouse->id);
...@@ -73,7 +73,7 @@ X11_InitMouse(_THIS) ...@@ -73,7 +73,7 @@ X11_InitMouse(_THIS)
if (deviceClass->class == ValuatorClass) { /* bingo ;) */ if (deviceClass->class == ValuatorClass) { /* bingo ;) */
XValuatorInfo *valInfo; XValuatorInfo *valInfo;
data = (X11_MouseData *)SDL_calloc(1, sizeof(*data)); data = (X11_MouseData *) SDL_calloc(1, sizeof(*data));
if (!data) { if (!data) {
continue; continue;
} }
...@@ -120,11 +120,11 @@ X11_InitMouse(_THIS) ...@@ -120,11 +120,11 @@ X11_InitMouse(_THIS)
valInfo = (XValuatorInfo *) deviceClass; valInfo = (XValuatorInfo *) deviceClass;
/* if the device reports pressure, lets check it parameteres */ /* if the device reports pressure, lets check it parameteres */
if (valInfo->num_axes > 2) { if (valInfo->num_axes > 2) {
SDL_AddMouse(&mouse, DevList[i].name, SDL_AddMouse(&mouse, DevList[i].name,
valInfo->axes[2].max_value, valInfo->axes[2].max_value,
valInfo->axes[2].min_value, 1); valInfo->axes[2].min_value, 1);
} else { } else {
SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1); SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
} }
break; break;
} }
......
...@@ -534,7 +534,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) ...@@ -534,7 +534,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
X11_MouseData *data; X11_MouseData *data;
mouse = SDL_GetMouse(i); mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata; data = (X11_MouseData *) mouse->driverdata;
if (!data) { if (!data) {
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment