Converted tabs to spaces for SDL style
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 87d4e60..bb99f29 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -607,19 +607,19 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_UNICHAR:
- if ( wParam == UNICODE_NOCHAR ) {
- returnCode = 1;
- break;
- }
- /* otherwise fall through to below */
- case WM_CHAR:
- {
- char text[5];
- if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) {
- SDL_SendKeyboardText( text );
- }
- }
- returnCode = 0;
+ if ( wParam == UNICODE_NOCHAR ) {
+ returnCode = 1;
+ break;
+ }
+ /* otherwise fall through to below */
+ case WM_CHAR:
+ {
+ char text[5];
+ if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) {
+ SDL_SendKeyboardText( text );
+ }
+ }
+ returnCode = 0;
break;
#ifdef WM_INPUTLANGCHANGE
@@ -813,9 +813,9 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_SYSCOMMAND:
{
- if ((wParam & 0xFFF0) == SC_KEYMENU) {
- return (0);
- }
+ if ((wParam & 0xFFF0) == SC_KEYMENU) {
+ return (0);
+ }
#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER)
/* Don't start the screensaver or blank the monitor in fullscreen apps */
diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c
index 02f7b63..d56f404 100644
--- a/src/video/windows/SDL_windowskeyboard.c
+++ b/src/video/windows/SDL_windowskeyboard.c
@@ -124,7 +124,7 @@ WIN_UpdateKeymap()
/* If this key is one of the non-mappable keys, ignore it */
/* Not mapping numbers fixes the French layout, giving numeric keycodes for the number keys, which is the expected behavior */
if ((keymap[scancode] & SDLK_SCANCODE_MASK) ||
- /* scancode == SDL_SCANCODE_GRAVE || */ /* Uncomment this line to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */
+ /* scancode == SDL_SCANCODE_GRAVE || */ /* Uncomment this line to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */
(scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) ) {
continue;
}
@@ -402,7 +402,7 @@ IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd)
INT err = 0;
BOOL vertical = FALSE;
UINT maxuilen = 0;
- static OSVERSIONINFOA osversion;
+ static OSVERSIONINFOA osversion;
if (videodata->ime_uiless)
return;
diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c
index f5f2b8a..7cb4ea5 100644
--- a/src/video/windows/SDL_windowsmodes.c
+++ b/src/video/windows/SDL_windowsmodes.c
@@ -30,43 +30,43 @@
#endif
typedef struct _WIN_GetMonitorDPIData {
- SDL_VideoData *vid_data;
- SDL_DisplayMode *mode;
- SDL_DisplayModeData *mode_data;
+ SDL_VideoData *vid_data;
+ SDL_DisplayMode *mode;
+ SDL_DisplayModeData *mode_data;
} WIN_GetMonitorDPIData;
static BOOL CALLBACK
WIN_GetMonitorDPI(HMONITOR hMonitor,
- HDC hdcMonitor,
- LPRECT lprcMonitor,
- LPARAM dwData)
+ HDC hdcMonitor,
+ LPRECT lprcMonitor,
+ LPARAM dwData)
{
- WIN_GetMonitorDPIData *data = (WIN_GetMonitorDPIData*) dwData;
- UINT hdpi, vdpi;
-
- if (data->vid_data->GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &hdpi, &vdpi) == S_OK &&
- hdpi > 0 &&
- vdpi > 0) {
- float hsize, vsize;
-
- data->mode_data->HorzDPI = (float)hdpi;
- data->mode_data->VertDPI = (float)vdpi;
-
- // Figure out the monitor size and compute the diagonal DPI.
- hsize = data->mode->w / data->mode_data->HorzDPI;
- vsize = data->mode->h / data->mode_data->VertDPI;
-
- data->mode_data->DiagDPI = SDL_ComputeDiagonalDPI( data->mode->w,
- data->mode->h,
- hsize,
- vsize );
-
- // We can only handle one DPI per display mode so end the enumeration.
- return FALSE;
- }
-
- // We didn't get DPI information so keep going.
- return TRUE;
+ WIN_GetMonitorDPIData *data = (WIN_GetMonitorDPIData*) dwData;
+ UINT hdpi, vdpi;
+
+ if (data->vid_data->GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &hdpi, &vdpi) == S_OK &&
+ hdpi > 0 &&
+ vdpi > 0) {
+ float hsize, vsize;
+
+ data->mode_data->HorzDPI = (float)hdpi;
+ data->mode_data->VertDPI = (float)vdpi;
+
+ // Figure out the monitor size and compute the diagonal DPI.
+ hsize = data->mode->w / data->mode_data->HorzDPI;
+ vsize = data->mode->h / data->mode_data->VertDPI;
+
+ data->mode_data->DiagDPI = SDL_ComputeDiagonalDPI( data->mode->w,
+ data->mode->h,
+ hsize,
+ vsize );
+
+ // We can only handle one DPI per display mode so end the enumeration.
+ return FALSE;
+ }
+
+ // We didn't get DPI information so keep going.
+ return TRUE;
}
static SDL_bool
@@ -91,11 +91,11 @@ WIN_GetDisplayMode(_THIS, LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mod
data->DeviceMode.dmFields =
(DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY |
DM_DISPLAYFLAGS);
- data->ScaleX = 1.0f;
- data->ScaleY = 1.0f;
- data->DiagDPI = 0.0f;
- data->HorzDPI = 0.0f;
- data->VertDPI = 0.0f;
+ data->ScaleX = 1.0f;
+ data->ScaleY = 1.0f;
+ data->DiagDPI = 0.0f;
+ data->HorzDPI = 0.0f;
+ data->VertDPI = 0.0f;
/* Fill in the mode information */
mode->format = SDL_PIXELFORMAT_UNKNOWN;
@@ -109,43 +109,43 @@ WIN_GetDisplayMode(_THIS, LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mod
char bmi_data[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
LPBITMAPINFO bmi;
HBITMAP hbm;
- int logical_width = GetDeviceCaps( hdc, HORZRES );
- int logical_height = GetDeviceCaps( hdc, VERTRES );
-
- data->ScaleX = (float)logical_width / devmode.dmPelsWidth;
- data->ScaleY = (float)logical_height / devmode.dmPelsHeight;
- mode->w = logical_width;
- mode->h = logical_height;
-
- // WIN_GetMonitorDPI needs mode->w and mode->h
- // so only call after those are set.
- if (vid_data->GetDpiForMonitor) {
- WIN_GetMonitorDPIData dpi_data;
+ int logical_width = GetDeviceCaps( hdc, HORZRES );
+ int logical_height = GetDeviceCaps( hdc, VERTRES );
+
+ data->ScaleX = (float)logical_width / devmode.dmPelsWidth;
+ data->ScaleY = (float)logical_height / devmode.dmPelsHeight;
+ mode->w = logical_width;
+ mode->h = logical_height;
+
+ // WIN_GetMonitorDPI needs mode->w and mode->h
+ // so only call after those are set.
+ if (vid_data->GetDpiForMonitor) {
+ WIN_GetMonitorDPIData dpi_data;
RECT monitor_rect;
- dpi_data.vid_data = vid_data;
- dpi_data.mode = mode;
- dpi_data.mode_data = data;
+ dpi_data.vid_data = vid_data;
+ dpi_data.mode = mode;
+ dpi_data.mode_data = data;
monitor_rect.left = devmode.dmPosition.x;
monitor_rect.top = devmode.dmPosition.y;
monitor_rect.right = monitor_rect.left + 1;
monitor_rect.bottom = monitor_rect.top + 1;
- EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
- } else {
- // We don't have the Windows 8.1 routine so just
- // get system DPI.
- data->HorzDPI = (float)GetDeviceCaps( hdc, LOGPIXELSX );
- data->VertDPI = (float)GetDeviceCaps( hdc, LOGPIXELSY );
- if (data->HorzDPI == data->VertDPI) {
- data->DiagDPI = data->HorzDPI;
- } else {
- data->DiagDPI = SDL_ComputeDiagonalDPI( mode->w,
- mode->h,
- (float)GetDeviceCaps( hdc, HORZSIZE ) / 25.4f,
- (float)GetDeviceCaps( hdc, VERTSIZE ) / 25.4f );
- }
- }
-
+ EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
+ } else {
+ // We don't have the Windows 8.1 routine so just
+ // get system DPI.
+ data->HorzDPI = (float)GetDeviceCaps( hdc, LOGPIXELSX );
+ data->VertDPI = (float)GetDeviceCaps( hdc, LOGPIXELSY );
+ if (data->HorzDPI == data->VertDPI) {
+ data->DiagDPI = data->HorzDPI;
+ } else {
+ data->DiagDPI = SDL_ComputeDiagonalDPI( mode->w,
+ mode->h,
+ (float)GetDeviceCaps( hdc, HORZSIZE ) / 25.4f,
+ (float)GetDeviceCaps( hdc, VERTSIZE ) / 25.4f );
+ }
+ }
+
SDL_zero(bmi_data);
bmi = (LPBITMAPINFO) bmi_data;
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -175,7 +175,7 @@ WIN_GetDisplayMode(_THIS, LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mod
} else if (bmi->bmiHeader.biBitCount == 4) {
mode->format = SDL_PIXELFORMAT_INDEX4LSB;
}
- } else {
+ } else {
/* FIXME: Can we tell what this will be? */
if ((devmode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) {
switch (devmode.dmBitsPerPel) {
@@ -319,17 +319,17 @@ WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi,
{
SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->current_mode.driverdata;
- if (ddpi) {
- *ddpi = data->DiagDPI;
- }
- if (hdpi) {
- *hdpi = data->HorzDPI;
- }
- if (vdpi) {
- *vdpi = data->VertDPI;
- }
-
- return data->DiagDPI != 0.0f ? 0 : -1;
+ if (ddpi) {
+ *ddpi = data->DiagDPI;
+ }
+ if (hdpi) {
+ *hdpi = data->HorzDPI;
+ }
+ if (vdpi) {
+ *vdpi = data->VertDPI;
+ }
+
+ return data->DiagDPI != 0.0f ? 0 : -1;
}
void
diff --git a/src/video/windows/SDL_windowsmodes.h b/src/video/windows/SDL_windowsmodes.h
index ba0964a..2bf9f4c 100644
--- a/src/video/windows/SDL_windowsmodes.h
+++ b/src/video/windows/SDL_windowsmodes.h
@@ -31,11 +31,11 @@ typedef struct
typedef struct
{
DEVMODE DeviceMode;
- float ScaleX;
- float ScaleY;
+ float ScaleX;
+ float ScaleY;
float DiagDPI;
- float HorzDPI;
- float VertDPI;
+ float HorzDPI;
+ float VertDPI;
} SDL_DisplayModeData;
extern int WIN_InitModes(_THIS);
diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c
index 26db698..70e80a9 100644
--- a/src/video/windows/SDL_windowswindow.c
+++ b/src/video/windows/SDL_windowswindow.c
@@ -130,7 +130,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
data->created = created;
data->mouse_button_flags = 0;
data->videodata = videodata;
- data->initializing = SDL_TRUE;
+ data->initializing = SDL_TRUE;
window->driverdata = data;
@@ -256,7 +256,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
/* Enable dropping files */
DragAcceptFiles(hwnd, TRUE);
- data->initializing = SDL_FALSE;
+ data->initializing = SDL_FALSE;
/* All done! */
return 0;
diff --git a/src/video/windows/SDL_windowswindow.h b/src/video/windows/SDL_windowswindow.h
index ede1e1e..6b8b0c2 100644
--- a/src/video/windows/SDL_windowswindow.h
+++ b/src/video/windows/SDL_windowswindow.h
@@ -37,11 +37,11 @@ typedef struct
WNDPROC wndproc;
SDL_bool created;
WPARAM mouse_button_flags;
- SDL_bool initializing;
+ SDL_bool initializing;
SDL_bool expected_resize;
SDL_bool in_border_change;
SDL_bool in_title_click;
- SDL_bool focus_click_pending;
+ SDL_bool focus_click_pending;
struct SDL_VideoData *videodata;
#if SDL_VIDEO_OPENGL_EGL
EGLSurface egl_surface;