Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

indent

  • Loading branch information
slouken committed Jan 1, 2009
1 parent 53a99f3 commit a1272037ba19c5dfb24466a3c0a103e7ef38997b
@@ -617,10 +617,10 @@ SDL_AudioInit(const char *driver_name)
current_audio.name = backend->name;
current_audio.desc = backend->desc;
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;
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();
if (best_choice == -1) {
best_choice = i;
@@ -607,7 +607,7 @@ ALSA_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = ALSA_Deinitialize;
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)
impl->Deinitialize = ESD_Deinitialize;
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)
impl->OnlyHasDefaultOutputDevice = 1;
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 = {
@@ -338,7 +338,7 @@ MINTDMA8_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
@@ -433,7 +433,7 @@ MINTGSXB_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_GSXB_bootstrap = {
@@ -390,7 +390,7 @@ MINTMCSN_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_MCSN_bootstrap = {
@@ -297,7 +297,7 @@ MINTSTFA_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_STFA_bootstrap = {
@@ -490,7 +490,7 @@ MINTXBIOS_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_XBIOS_bootstrap = {
@@ -398,7 +398,7 @@ NAS_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = NAS_Deinitialize;
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 = {
@@ -120,7 +120,7 @@ NDSAUD_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1;
impl->OnlyHasDefaultInputDevice = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap NDSAUD_bootstrap = {
@@ -457,7 +457,7 @@ NTO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */

/* !!! 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 = {
@@ -545,7 +545,7 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */

/* !!! 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 = {
@@ -297,49 +297,55 @@ X11_DispatchEvent(_THIS)

default:{
#if SDL_VIDEO_DRIVER_X11_XINPUT
for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse;
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata;
if (!data) {
continue;
}

if (xevent.type == data->motion) { /* MotionNotify */
XDeviceMotionEvent *move = (XDeviceMotionEvent *) & xevent;
for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse;
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *) mouse->driverdata;
if (!data) {
continue;
}

if (xevent.type == data->motion) { /* MotionNotify */
XDeviceMotionEvent *move =
(XDeviceMotionEvent *) & xevent;
#ifdef DEBUG_MOTION
printf("X11 motion: %d,%d\n", move->x, move->y);
printf("X11 motion: %d,%d\n", move->x, move->y);
#endif
SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y, move->axis_data[2]);
return;
}
if (xevent.type == data->button_pressed) { /* ButtonPress */
XDeviceButtonPressedEvent *pressed =
(XDeviceButtonPressedEvent *) & xevent;
SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED, pressed->button);
return;
}
if (xevent.type == data->button_released) { /* ButtonRelease */
XDeviceButtonReleasedEvent *released =
(XDeviceButtonReleasedEvent *) & xevent;
SDL_SendMouseButton(released->deviceid, SDL_RELEASED, released->button);
return;
SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y,
move->axis_data[2]);
return;
}
if (xevent.type == data->button_pressed) { /* ButtonPress */
XDeviceButtonPressedEvent *pressed =
(XDeviceButtonPressedEvent *) & xevent;
SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED,
pressed->button);
return;
}
if (xevent.type == data->button_released) { /* ButtonRelease */
XDeviceButtonReleasedEvent *released =
(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
#ifdef DEBUG_XEVENTS
printf("Unhandled event %d\n", xevent.type);
@@ -26,9 +26,9 @@

#if SDL_VIDEO_DRIVER_X11_XINPUT
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) {
XCloseDevice(data->display, mouse->id);
@@ -73,7 +73,7 @@ X11_InitMouse(_THIS)
if (deviceClass->class == ValuatorClass) { /* bingo ;) */
XValuatorInfo *valInfo;

data = (X11_MouseData *)SDL_calloc(1, sizeof(*data));
data = (X11_MouseData *) SDL_calloc(1, sizeof(*data));
if (!data) {
continue;
}
@@ -120,11 +120,11 @@ X11_InitMouse(_THIS)
valInfo = (XValuatorInfo *) deviceClass;
/* if the device reports pressure, lets check it parameteres */
if (valInfo->num_axes > 2) {
SDL_AddMouse(&mouse, DevList[i].name,
valInfo->axes[2].max_value,
valInfo->axes[2].min_value, 1);
SDL_AddMouse(&mouse, DevList[i].name,
valInfo->axes[2].max_value,
valInfo->axes[2].min_value, 1);
} else {
SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
}
break;
}
@@ -534,7 +534,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata;
data = (X11_MouseData *) mouse->driverdata;
if (!data) {
continue;
}

0 comments on commit a127203

Please sign in to comment.