indent
authorSam Lantinga <slouken@libsdl.org>
Wed, 17 Dec 2008 07:19:55 +0000
changeset 28763fcb0d447bcd
parent 2875 91a7e08cd238
child 2877 e2b1abe04641
indent
src/video/SDL_video.c
src/video/win32/SDL_win32window.c
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/SDL_video.c	Wed Dec 17 07:17:54 2008 +0000
     1.2 +++ b/src/video/SDL_video.c	Wed Dec 17 07:19:55 2008 +0000
     1.3 @@ -123,7 +123,7 @@
     1.4  static SDL_VideoDevice *_this = NULL;
     1.5  
     1.6  /* Various local functions */
     1.7 -static void SDL_UpdateWindowGrab(SDL_Window *window);
     1.8 +static void SDL_UpdateWindowGrab(SDL_Window * window);
     1.9  
    1.10  static int
    1.11  cmpmodes(const void *A, const void *B)
    1.12 @@ -1210,7 +1210,7 @@
    1.13  }
    1.14  
    1.15  static void
    1.16 -SDL_UpdateWindowGrab(SDL_Window *window)
    1.17 +SDL_UpdateWindowGrab(SDL_Window * window)
    1.18  {
    1.19      if ((window->flags & SDL_WINDOW_INPUT_FOCUS) && _this->SetWindowGrab) {
    1.20          _this->SetWindowGrab(_this, window);
    1.21 @@ -1265,7 +1265,8 @@
    1.22      if (display->gamma && _this->SetDisplayGammaRamp) {
    1.23          _this->SetDisplayGammaRamp(_this, display->gamma);
    1.24      }
    1.25 -    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && _this->SetWindowGrab) {
    1.26 +    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
    1.27 +        && _this->SetWindowGrab) {
    1.28          _this->SetWindowGrab(_this, window);
    1.29      }
    1.30  }
    1.31 @@ -1282,7 +1283,8 @@
    1.32      if (display->gamma && _this->SetDisplayGammaRamp) {
    1.33          _this->SetDisplayGammaRamp(_this, display->saved_gamma);
    1.34      }
    1.35 -    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && _this->SetWindowGrab) {
    1.36 +    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
    1.37 +        && _this->SetWindowGrab) {
    1.38          _this->SetWindowGrab(_this, window);
    1.39      }
    1.40  }
     2.1 --- a/src/video/win32/SDL_win32window.c	Wed Dec 17 07:17:54 2008 +0000
     2.2 +++ b/src/video/win32/SDL_win32window.c	Wed Dec 17 07:19:55 2008 +0000
     2.3 @@ -159,12 +159,13 @@
     2.4      int x, y;
     2.5      int w, h;
     2.6  
     2.7 -    if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) {
     2.8 +    if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) {
     2.9          style |= WS_POPUP;
    2.10      } else {
    2.11          style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
    2.12      }
    2.13 -    if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    2.14 +    if ((window->flags & SDL_WINDOW_RESIZABLE)
    2.15 +        && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    2.16          style |= (WS_THICKFRAME | WS_MAXIMIZEBOX);
    2.17      }
    2.18  
    2.19 @@ -182,14 +183,16 @@
    2.20      w = (rect.right - rect.left);
    2.21      h = (rect.bottom - rect.top);
    2.22  
    2.23 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
    2.24 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    2.25 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    2.26          x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2;
    2.27      } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
    2.28          x = CW_USEDEFAULT;
    2.29      } else {
    2.30          x = window->x + rect.left;
    2.31      }
    2.32 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    2.33 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    2.34 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    2.35          y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2;
    2.36      } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
    2.37          y = CW_USEDEFAULT;
    2.38 @@ -332,12 +335,14 @@
    2.39                         (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) !=
    2.40                                                             NULL), 0);
    2.41  
    2.42 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
    2.43 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    2.44 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    2.45          x = (GetSystemMetrics(SM_CXSCREEN) - window->w) / 2;
    2.46      } else {
    2.47          x = window->x + rect.left;
    2.48      }
    2.49 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    2.50 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    2.51 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    2.52          y = (GetSystemMetrics(SM_CYSCREEN) - window->h) / 2;
    2.53      } else {
    2.54          y = window->y + rect.top;
    2.55 @@ -434,8 +439,8 @@
    2.56  {
    2.57      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
    2.58  
    2.59 -    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) &&
    2.60 -        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    2.61 +    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
    2.62 +        && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    2.63          RECT rect;
    2.64          GetClientRect(hwnd, &rect);
    2.65          ClientToScreen(hwnd, (LPPOINT) & rect);
     3.1 --- a/src/video/x11/SDL_x11window.c	Wed Dec 17 07:17:54 2008 +0000
     3.2 +++ b/src/video/x11/SDL_x11window.c	Wed Dec 17 07:19:55 2008 +0000
     3.3 @@ -287,7 +287,8 @@
     3.4                              visual, AllocNone);
     3.5      }
     3.6  
     3.7 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
     3.8 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
     3.9 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    3.10          x = (DisplayWidth(data->display, displaydata->screen) -
    3.11               window->w) / 2;
    3.12      } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
    3.13 @@ -295,7 +296,8 @@
    3.14      } else {
    3.15          x = window->x;
    3.16      }
    3.17 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    3.18 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    3.19 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    3.20          y = (DisplayHeight(data->display, displaydata->screen) -
    3.21               window->h) / 2;
    3.22      } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
    3.23 @@ -321,7 +323,8 @@
    3.24  
    3.25      sizehints = XAllocSizeHints();
    3.26      if (sizehints) {
    3.27 -        if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    3.28 +        if ((window->flags & SDL_WINDOW_RESIZABLE)
    3.29 +            && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    3.30              sizehints->min_width = 32;
    3.31              sizehints->min_height = 32;
    3.32              sizehints->max_height = 4096;
    3.33 @@ -342,7 +345,7 @@
    3.34          XFree(sizehints);
    3.35      }
    3.36  
    3.37 -    if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) {
    3.38 +    if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) {
    3.39          SDL_bool set;
    3.40          Atom WM_HINTS;
    3.41  
    3.42 @@ -603,12 +606,14 @@
    3.43      Display *display = data->videodata->display;
    3.44      int x, y;
    3.45  
    3.46 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
    3.47 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    3.48 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    3.49          x = (DisplayWidth(display, displaydata->screen) - window->w) / 2;
    3.50      } else {
    3.51          x = window->x;
    3.52      }
    3.53 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    3.54 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    3.55 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    3.56          y = (DisplayHeight(display, displaydata->screen) - window->h) / 2;
    3.57      } else {
    3.58          y = window->y;
    3.59 @@ -676,12 +681,14 @@
    3.60      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    3.61      Display *display = data->videodata->display;
    3.62  
    3.63 -    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) &&
    3.64 -        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    3.65 +    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
    3.66 +        && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    3.67          /* Try to grab the mouse */
    3.68 -        for ( ; ; ) {
    3.69 -            int result = XGrabPointer(display, data->window, True, 0, GrabModeAsync, GrabModeAsync, data->window, None, CurrentTime);
    3.70 -            if ( result == GrabSuccess ) {
    3.71 +        for (;;) {
    3.72 +            int result =
    3.73 +                XGrabPointer(display, data->window, True, 0, GrabModeAsync,
    3.74 +                             GrabModeAsync, data->window, None, CurrentTime);
    3.75 +            if (result == GrabSuccess) {
    3.76                  break;
    3.77              }
    3.78              SDL_Delay(100);
    3.79 @@ -691,7 +698,8 @@
    3.80          XRaiseWindow(display, data->window);
    3.81  
    3.82          /* Now grab the keyboard */
    3.83 -        XGrabKeyboard(display, data->window, True, GrabModeAsync, GrabModeAsync, CurrentTime);
    3.84 +        XGrabKeyboard(display, data->window, True, GrabModeAsync,
    3.85 +                      GrabModeAsync, CurrentTime);
    3.86      } else {
    3.87          XUngrabPointer(display, CurrentTime);
    3.88          XUngrabKeyboard(display, CurrentTime);