Mercurial > sdl-ios-xcode
changeset 2876:3fcb0d447bcd
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 17 Dec 2008 07:19:55 +0000 |
parents | 91a7e08cd238 |
children | e2b1abe04641 |
files | src/video/SDL_video.c src/video/win32/SDL_win32window.c src/video/x11/SDL_x11window.c |
diffstat | 3 files changed, 39 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/SDL_video.c Wed Dec 17 07:17:54 2008 +0000 +++ b/src/video/SDL_video.c Wed Dec 17 07:19:55 2008 +0000 @@ -123,7 +123,7 @@ static SDL_VideoDevice *_this = NULL; /* Various local functions */ -static void SDL_UpdateWindowGrab(SDL_Window *window); +static void SDL_UpdateWindowGrab(SDL_Window * window); static int cmpmodes(const void *A, const void *B) @@ -1210,7 +1210,7 @@ } static void -SDL_UpdateWindowGrab(SDL_Window *window) +SDL_UpdateWindowGrab(SDL_Window * window) { if ((window->flags & SDL_WINDOW_INPUT_FOCUS) && _this->SetWindowGrab) { _this->SetWindowGrab(_this, window); @@ -1265,7 +1265,8 @@ if (display->gamma && _this->SetDisplayGammaRamp) { _this->SetDisplayGammaRamp(_this, display->gamma); } - if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && _this->SetWindowGrab) { + if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) + && _this->SetWindowGrab) { _this->SetWindowGrab(_this, window); } } @@ -1282,7 +1283,8 @@ if (display->gamma && _this->SetDisplayGammaRamp) { _this->SetDisplayGammaRamp(_this, display->saved_gamma); } - if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && _this->SetWindowGrab) { + if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) + && _this->SetWindowGrab) { _this->SetWindowGrab(_this, window); } }
--- a/src/video/win32/SDL_win32window.c Wed Dec 17 07:17:54 2008 +0000 +++ b/src/video/win32/SDL_win32window.c Wed Dec 17 07:19:55 2008 +0000 @@ -159,12 +159,13 @@ int x, y; int w, h; - if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) { + if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) { style |= WS_POPUP; } else { style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); } - if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) { + if ((window->flags & SDL_WINDOW_RESIZABLE) + && !(window->flags & SDL_WINDOW_FULLSCREEN)) { style |= (WS_THICKFRAME | WS_MAXIMIZEBOX); } @@ -182,14 +183,16 @@ w = (rect.right - rect.left); h = (rect.bottom - rect.top); - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->x == SDL_WINDOWPOS_CENTERED) { x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2; } else if (window->x == SDL_WINDOWPOS_UNDEFINED) { x = CW_USEDEFAULT; } else { x = window->x + rect.left; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->y == SDL_WINDOWPOS_CENTERED) { y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2; } else if (window->y == SDL_WINDOWPOS_UNDEFINED) { y = CW_USEDEFAULT; @@ -332,12 +335,14 @@ (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL), 0); - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->x == SDL_WINDOWPOS_CENTERED) { x = (GetSystemMetrics(SM_CXSCREEN) - window->w) / 2; } else { x = window->x + rect.left; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->y == SDL_WINDOWPOS_CENTERED) { y = (GetSystemMetrics(SM_CYSCREEN) - window->h) / 2; } else { y = window->y + rect.top; @@ -434,8 +439,8 @@ { HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && - (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) + && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { RECT rect; GetClientRect(hwnd, &rect); ClientToScreen(hwnd, (LPPOINT) & rect);
--- a/src/video/x11/SDL_x11window.c Wed Dec 17 07:17:54 2008 +0000 +++ b/src/video/x11/SDL_x11window.c Wed Dec 17 07:19:55 2008 +0000 @@ -287,7 +287,8 @@ visual, AllocNone); } - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->x == SDL_WINDOWPOS_CENTERED) { x = (DisplayWidth(data->display, displaydata->screen) - window->w) / 2; } else if (window->x == SDL_WINDOWPOS_UNDEFINED) { @@ -295,7 +296,8 @@ } else { x = window->x; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->y == SDL_WINDOWPOS_CENTERED) { y = (DisplayHeight(data->display, displaydata->screen) - window->h) / 2; } else if (window->y == SDL_WINDOWPOS_UNDEFINED) { @@ -321,7 +323,8 @@ sizehints = XAllocSizeHints(); if (sizehints) { - if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) { + if ((window->flags & SDL_WINDOW_RESIZABLE) + && !(window->flags & SDL_WINDOW_FULLSCREEN)) { sizehints->min_width = 32; sizehints->min_height = 32; sizehints->max_height = 4096; @@ -342,7 +345,7 @@ XFree(sizehints); } - if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) { + if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) { SDL_bool set; Atom WM_HINTS; @@ -603,12 +606,14 @@ Display *display = data->videodata->display; int x, y; - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->x == SDL_WINDOWPOS_CENTERED) { x = (DisplayWidth(display, displaydata->screen) - window->w) / 2; } else { x = window->x; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) + || window->y == SDL_WINDOWPOS_CENTERED) { y = (DisplayHeight(display, displaydata->screen) - window->h) / 2; } else { y = window->y; @@ -676,12 +681,14 @@ SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; - if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && - (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) + && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { /* Try to grab the mouse */ - for ( ; ; ) { - int result = XGrabPointer(display, data->window, True, 0, GrabModeAsync, GrabModeAsync, data->window, None, CurrentTime); - if ( result == GrabSuccess ) { + for (;;) { + int result = + XGrabPointer(display, data->window, True, 0, GrabModeAsync, + GrabModeAsync, data->window, None, CurrentTime); + if (result == GrabSuccess) { break; } SDL_Delay(100); @@ -691,7 +698,8 @@ XRaiseWindow(display, data->window); /* Now grab the keyboard */ - XGrabKeyboard(display, data->window, True, GrabModeAsync, GrabModeAsync, CurrentTime); + XGrabKeyboard(display, data->window, True, GrabModeAsync, + GrabModeAsync, CurrentTime); } else { XUngrabPointer(display, CurrentTime); XUngrabKeyboard(display, CurrentTime);