src/video/riscos/SDL_wimppoll.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/video/riscos/SDL_wimppoll.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/riscos/SDL_wimppoll.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -50,28 +50,28 @@
     1.4  #endif
     1.5  
     1.6  /* Local functions */
     1.7 -void WIMP_Poll (_THIS, int waitTime);
     1.8 -void WIMP_SetFocus (int win);
     1.9 +void WIMP_Poll(_THIS, int waitTime);
    1.10 +void WIMP_SetFocus(int win);
    1.11  
    1.12  /* SDL_riscossprite functions */
    1.13 -void WIMP_PlotSprite (_THIS, int x, int y);
    1.14 -void WIMP_ModeChanged (_THIS);
    1.15 -void WIMP_PaletteChanged (_THIS);
    1.16 +void WIMP_PlotSprite(_THIS, int x, int y);
    1.17 +void WIMP_ModeChanged(_THIS);
    1.18 +void WIMP_PaletteChanged(_THIS);
    1.19  
    1.20  
    1.21 -extern void WIMP_PollMouse (_THIS);
    1.22 -extern void RISCOS_PollKeyboard ();
    1.23 +extern void WIMP_PollMouse(_THIS);
    1.24 +extern void RISCOS_PollKeyboard();
    1.25  
    1.26  #if SDL_THREADS_DISABLED
    1.27  /* Timer running function */
    1.28 -extern void RISCOS_CheckTimer ();
    1.29 +extern void RISCOS_CheckTimer();
    1.30  #else
    1.31  extern int riscos_using_threads;
    1.32  #endif
    1.33  
    1.34  /* Mouse cursor handling */
    1.35 -extern void WIMP_ReshowCursor (_THIS);
    1.36 -extern void WIMP_RestoreWimpCursor ();
    1.37 +extern void WIMP_ReshowCursor(_THIS);
    1.38 +extern void WIMP_RestoreWimpCursor();
    1.39  
    1.40  int hasFocus = 0;
    1.41  int mouseInWindow = 0;
    1.42 @@ -80,22 +80,22 @@
    1.43  static int resizeOnOpen = 0;
    1.44  
    1.45  void
    1.46 -WIMP_PumpEvents (_THIS)
    1.47 +WIMP_PumpEvents(_THIS)
    1.48  {
    1.49 -    WIMP_Poll (this, 0);
    1.50 +    WIMP_Poll(this, 0);
    1.51      if (hasFocus)
    1.52 -        RISCOS_PollKeyboard ();
    1.53 +        RISCOS_PollKeyboard();
    1.54      if (mouseInWindow)
    1.55 -        WIMP_PollMouse (this);
    1.56 +        WIMP_PollMouse(this);
    1.57  #if SDL_THREADS_DISABLED
    1.58      if (SDL_timer_running)
    1.59 -        RISCOS_CheckTimer ();
    1.60 +        RISCOS_CheckTimer();
    1.61  #endif
    1.62  }
    1.63  
    1.64  
    1.65  void
    1.66 -WIMP_Poll (_THIS, int waitTime)
    1.67 +WIMP_Poll(_THIS, int waitTime)
    1.68  {
    1.69      _kernel_swi_regs regs;
    1.70      int message[64];
    1.71 @@ -109,7 +109,7 @@
    1.72          return;
    1.73  
    1.74      if (waitTime > 0) {
    1.75 -        _kernel_swi (OS_ReadMonotonicTime, &regs, &regs);
    1.76 +        _kernel_swi(OS_ReadMonotonicTime, &regs, &regs);
    1.77          waitTime += regs.r[0];
    1.78      }
    1.79  
    1.80 @@ -117,7 +117,7 @@
    1.81  #if !SDL_THREADS_DISABLED
    1.82          /* Stop thread callbacks while program is paged out */
    1.83          if (riscos_using_threads)
    1.84 -            __pthread_stop_ticker ();
    1.85 +            __pthread_stop_ticker();
    1.86  #endif
    1.87  
    1.88          if (waitTime <= 0) {
    1.89 @@ -126,12 +126,12 @@
    1.90              if (waitTime < 0)
    1.91                  regs.r[0] |= 1;
    1.92              regs.r[1] = (int) message;
    1.93 -            _kernel_swi (Wimp_Poll, &regs, &regs);
    1.94 +            _kernel_swi(Wimp_Poll, &regs, &regs);
    1.95          } else {
    1.96              regs.r[0] = pollMask;
    1.97              regs.r[1] = (int) message;
    1.98              regs.r[2] = waitTime;
    1.99 -            _kernel_swi (Wimp_PollIdle, &regs, &regs);
   1.100 +            _kernel_swi(Wimp_PollIdle, &regs, &regs);
   1.101          }
   1.102  
   1.103          /* Flag to specify if we post a SDL_SysWMEvent */
   1.104 @@ -145,16 +145,16 @@
   1.105              break;
   1.106  
   1.107          case 1:                /* Redraw window */
   1.108 -            _kernel_swi (Wimp_RedrawWindow, &regs, &regs);
   1.109 +            _kernel_swi(Wimp_RedrawWindow, &regs, &regs);
   1.110              if (message[0] == sdlWindow) {
   1.111                  while (regs.r[0]) {
   1.112 -                    WIMP_PlotSprite (this, message[1], message[2]);
   1.113 -                    _kernel_swi (Wimp_GetRectangle, &regs, &regs);
   1.114 +                    WIMP_PlotSprite(this, message[1], message[2]);
   1.115 +                    _kernel_swi(Wimp_GetRectangle, &regs, &regs);
   1.116                  }
   1.117              } else {
   1.118                  /* TODO: Currently we just eat them - we may need to pass them on */
   1.119                  while (regs.r[0]) {
   1.120 -                    _kernel_swi (Wimp_GetRectangle, &regs, &regs);
   1.121 +                    _kernel_swi(Wimp_GetRectangle, &regs, &regs);
   1.122                  }
   1.123              }
   1.124              break;
   1.125 @@ -168,7 +168,7 @@
   1.126                  message[4] =
   1.127                      message[2] + (this->screen->h << this->hidden->yeig);
   1.128              }
   1.129 -            _kernel_swi (Wimp_OpenWindow, &regs, &regs);
   1.130 +            _kernel_swi(Wimp_OpenWindow, &regs, &regs);
   1.131              break;
   1.132  
   1.133          case 3:                /* Close window */
   1.134 @@ -179,7 +179,7 @@
   1.135                   ** in the background so I just post the quit message and hope the application
   1.136                   ** does the correct thing.
   1.137                   */
   1.138 -                SDL_PrivateQuit ();
   1.139 +                SDL_PrivateQuit();
   1.140              } else
   1.141                  sysEvent = 1;
   1.142              doPoll = 0;
   1.143 @@ -190,8 +190,8 @@
   1.144                  mouseInWindow = 0;
   1.145                  //TODO: Lose buttons / dragging
   1.146                  /* Reset to default pointer */
   1.147 -                WIMP_RestoreWimpCursor ();
   1.148 -                SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
   1.149 +                WIMP_RestoreWimpCursor();
   1.150 +                SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
   1.151              } else
   1.152                  sysEvent = 1;
   1.153              break;
   1.154 @@ -199,8 +199,8 @@
   1.155          case 5:                /* Pointer_Entering_Window */
   1.156              if (message[0] == sdlWindow) {
   1.157                  mouseInWindow = 1;
   1.158 -                WIMP_ReshowCursor (this);
   1.159 -                SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
   1.160 +                WIMP_ReshowCursor(this);
   1.161 +                SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
   1.162              } else
   1.163                  sysEvent = 1;
   1.164              break;
   1.165 @@ -209,7 +209,7 @@
   1.166              if (hasFocus == 0) {
   1.167                  /* First click gives focus if it's not a menu */
   1.168                  /* we only count non-menu clicks on a window that has the focus */
   1.169 -                WIMP_SetFocus (message[3]);
   1.170 +                WIMP_SetFocus(message[3]);
   1.171              } else
   1.172                  doPoll = 0;     // So PollMouse gets a chance to pick it up
   1.173              break;
   1.174 @@ -234,7 +234,7 @@
   1.175          case 11:               /* Lose Caret */
   1.176              hasFocus = 0;
   1.177              if (message[0] == sdlWindow)
   1.178 -                SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
   1.179 +                SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
   1.180              else
   1.181                  sysEvent = 1;
   1.182              break;
   1.183 @@ -242,7 +242,7 @@
   1.184          case 12:               /* Gain Caret */
   1.185              hasFocus = 1;
   1.186              if (message[0] == sdlWindow)
   1.187 -                SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
   1.188 +                SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
   1.189              else
   1.190                  sysEvent = 1;
   1.191              break;
   1.192 @@ -254,21 +254,21 @@
   1.193              switch (message[4]) {
   1.194              case 0:            /* Quit Event */
   1.195                  /* No choice - have to quit */
   1.196 -                SDL_Quit ();
   1.197 -                exit (0);
   1.198 +                SDL_Quit();
   1.199 +                exit(0);
   1.200                  break;
   1.201  
   1.202              case 8:            /* Pre Quit */
   1.203 -                SDL_PrivateQuit ();
   1.204 +                SDL_PrivateQuit();
   1.205                  break;
   1.206  
   1.207              case 0x400c1:      /* Mode change */
   1.208 -                WIMP_ModeChanged (this);
   1.209 +                WIMP_ModeChanged(this);
   1.210                  resizeOnOpen = 1;
   1.211                  break;
   1.212  
   1.213              case 9:            /* Palette changed */
   1.214 -                WIMP_PaletteChanged (this);
   1.215 +                WIMP_PaletteChanged(this);
   1.216                  break;
   1.217              }
   1.218              break;
   1.219 @@ -282,12 +282,12 @@
   1.220          if (sysEvent) {
   1.221              SDL_SysWMmsg wmmsg;
   1.222  
   1.223 -            SDL_VERSION (&wmmsg.version);
   1.224 +            SDL_VERSION(&wmmsg.version);
   1.225              wmmsg.eventCode = code;
   1.226 -            SDL_memcpy (wmmsg.pollBlock, message, 64 * sizeof (int));
   1.227 +            SDL_memcpy(wmmsg.pollBlock, message, 64 * sizeof(int));
   1.228  
   1.229              /* Fall out of polling loop if message is successfully posted */
   1.230 -            if (SDL_PrivateSysWMEvent (&wmmsg))
   1.231 +            if (SDL_PrivateSysWMEvent(&wmmsg))
   1.232                  doPoll = 0;
   1.233          }
   1.234  #if !SDL_THREADS_DISABLED
   1.235 @@ -295,9 +295,9 @@
   1.236              /* Restart ticker here so other thread can not interfere
   1.237                 with the Redraw processing */
   1.238              if (riscos_using_threads)
   1.239 -                __pthread_start_ticker ();
   1.240 +                __pthread_start_ticker();
   1.241              /* Give other threads a better chance of running */
   1.242 -            pthread_yield ();
   1.243 +            pthread_yield();
   1.244          }
   1.245  #endif
   1.246      }
   1.247 @@ -305,7 +305,7 @@
   1.248  
   1.249  /* Set focus to specified window */
   1.250  void
   1.251 -WIMP_SetFocus (int win)
   1.252 +WIMP_SetFocus(int win)
   1.253  {
   1.254      _kernel_swi_regs regs;
   1.255  
   1.256 @@ -316,19 +316,19 @@
   1.257      regs.r[4] = 1 << 25;        /* Caret is invisible */
   1.258      regs.r[5] = 0;              /* index into string */
   1.259  
   1.260 -    _kernel_swi (Wimp_SetCaretPosition, &regs, &regs);
   1.261 +    _kernel_swi(Wimp_SetCaretPosition, &regs, &regs);
   1.262  }
   1.263  
   1.264  /** Run background task while in a sleep command */
   1.265  void
   1.266 -RISCOS_BackgroundTasks (void)
   1.267 +RISCOS_BackgroundTasks(void)
   1.268  {
   1.269      if (current_video && current_video->hidden->window_handle) {
   1.270 -        WIMP_Poll (current_video, 0);
   1.271 +        WIMP_Poll(current_video, 0);
   1.272      }
   1.273  #if SDL_THREADS_DISABLED
   1.274      if (SDL_timer_running)
   1.275 -        RISCOS_CheckTimer ();
   1.276 +        RISCOS_CheckTimer();
   1.277  #endif
   1.278  }
   1.279