src/video/photon/SDL_ph_events.c
changeset 753 b14fdadd8311
parent 663 8bedd6d61642
child 769 b8d311d90021
     1.1 --- a/src/video/photon/SDL_ph_events.c	Wed Dec 10 12:32:38 2003 +0000
     1.2 +++ b/src/video/photon/SDL_ph_events.c	Wed Dec 10 12:35:56 2003 +0000
     1.3 @@ -217,12 +217,12 @@
     1.4                  set_motion_sensitivity(this, -1);
     1.5                  posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
     1.6              }
     1.7 -            /* request to quit */
     1.8 +            /* quit request */
     1.9              else if (winEvent->event_f==Ph_WM_CLOSE)
    1.10              {
    1.11                  posted = SDL_PrivateQuit();
    1.12              }
    1.13 -            /* request to hide/unhide */
    1.14 +            /* hide/unhide request */
    1.15              else if (winEvent->event_f==Ph_WM_HIDE)
    1.16              {
    1.17                  if (currently_hided)
    1.18 @@ -241,7 +241,7 @@
    1.19              /* request to resize */
    1.20              else if (winEvent->event_f==Ph_WM_RESIZE)
    1.21              {
    1.22 -                SDL_PrivateResize(winEvent->size.w, winEvent->size.h);
    1.23 +                SDL_PrivateResize(winEvent->size.w+1, winEvent->size.h+1);
    1.24              }
    1.25              /* request to move */
    1.26              else if (winEvent->event_f==Ph_WM_MOVE)
    1.27 @@ -250,6 +250,7 @@
    1.28                  {
    1.29                     int lockedstate=current_overlay->hwdata->locked;
    1.30                     int chromastate=current_overlay->hwdata->ischromakey;
    1.31 +                   int error;
    1.32                     SDL_Rect target;
    1.33  
    1.34                     current_overlay->hwdata->locked=1;
    1.35 @@ -258,20 +259,25 @@
    1.36                     target.w=current_overlay->hwdata->CurrentViewPort.size.w;
    1.37                     target.h=current_overlay->hwdata->CurrentViewPort.size.h;
    1.38                     current_overlay->hwdata->ischromakey=0;
    1.39 -                   ph_DisplayYUVOverlay(this, current_overlay, &target);
    1.40 -                   current_overlay->hwdata->ischromakey=chromastate;
    1.41 -                   current_overlay->hwdata->locked=lockedstate;
    1.42 +                   error=ph_DisplayYUVOverlay(this, current_overlay, &target);
    1.43 +                   if (!error)
    1.44 +                   {
    1.45 +                       current_overlay->hwdata->ischromakey=chromastate;
    1.46 +                       current_overlay->hwdata->locked=lockedstate;
    1.47 +                   }
    1.48                  }
    1.49              }
    1.50 -            /* request to maximize */
    1.51 +            /* maximize request */
    1.52              else if (winEvent->event_f==Ph_WM_MAX)
    1.53              {
    1.54                  /* window already moved and resized here */
    1.55 -                SDL_PrivateResize(winEvent->size.w-winEvent->pos.x, winEvent->size.h-winEvent->pos.y);
    1.56 +                currently_maximized=1;
    1.57              }
    1.58 -            /* request to restore */
    1.59 +            /* restore request */
    1.60              else if (winEvent->event_f==Ph_WM_RESTORE)
    1.61              {
    1.62 +                /* window already moved and resized here */
    1.63 +                currently_maximized=0;
    1.64              }
    1.65          }
    1.66          break;
    1.67 @@ -285,7 +291,7 @@
    1.68                  {
    1.69                      rect = PhGetRects(event);
    1.70  
    1.71 -                    for(i=0;i<event->num_rects;i++)
    1.72 +                    for(i=0; i<event->num_rects; i++)
    1.73                      {
    1.74                          sdlrects[i].x = rect[i].ul.x;
    1.75                          sdlrects[i].y = rect[i].ul.y;
    1.76 @@ -298,6 +304,7 @@
    1.77                      if (current_overlay!=NULL)
    1.78                      {
    1.79                          int lockedstate=current_overlay->hwdata->locked;
    1.80 +                        int error;
    1.81                          SDL_Rect target;
    1.82  
    1.83                          current_overlay->hwdata->locked=1;
    1.84 @@ -306,9 +313,12 @@
    1.85                          target.w=current_overlay->hwdata->CurrentViewPort.size.w;
    1.86                          target.h=current_overlay->hwdata->CurrentViewPort.size.h;
    1.87                          current_overlay->hwdata->forcedredraw=1;
    1.88 -                        ph_DisplayYUVOverlay(this, current_overlay, &target);
    1.89 -                        current_overlay->hwdata->forcedredraw=0;
    1.90 -                        current_overlay->hwdata->locked=lockedstate;
    1.91 +                        error=ph_DisplayYUVOverlay(this, current_overlay, &target);
    1.92 +                        if (!error)
    1.93 +                        {
    1.94 +                            current_overlay->hwdata->forcedredraw=0;
    1.95 +                            current_overlay->hwdata->locked=lockedstate;
    1.96 +                        }
    1.97                      }
    1.98                  }
    1.99              }
   1.100 @@ -355,6 +365,11 @@
   1.101              }
   1.102          }
   1.103          break;
   1.104 +        
   1.105 +        case Ph_EV_INFO:
   1.106 +        {
   1.107 +        }
   1.108 +        break;
   1.109      }
   1.110  
   1.111      return(posted);
   1.112 @@ -542,13 +557,20 @@
   1.113  
   1.114          switch (keysym->scancode)
   1.115          {
   1.116 +           /* Esc key */
   1.117             case 0x01: keysym->unicode = 27;
   1.118                        break;
   1.119 +           /* BackSpace key */
   1.120 +           case 0x0E: keysym->unicode = 127;
   1.121 +                      break;
   1.122 +           /* Enter key */
   1.123 +           case 0x1C: keysym->unicode = 10;
   1.124 +                      break;
   1.125             default:
   1.126                        utf8len = PhKeyToMb(utf8, key);
   1.127                        if (utf8len > 0)
   1.128                        {
   1.129 -                          utf8len = mbtowc(&unicode, utf8, utf8len);
   1.130 +                         utf8len = mbtowc(&unicode, utf8, utf8len);
   1.131                           if (utf8len > 0)
   1.132                           {
   1.133                               keysym->unicode = unicode;