src/video/directfb/SDL_DirectFB_window.c
changeset 3040 62d4992e5a92
parent 3039 829043b363d1
child 3685 64ce267332c6
equal deleted inserted replaced
3039:829043b363d1 3040:62d4992e5a92
    99         windata->window->SetStackingClass(windata->window, DWSC_UPPER);
    99         windata->window->SetStackingClass(windata->window, DWSC_UPPER);
   100     }
   100     }
   101     windata->window->SetOptions(windata->window, wopts);
   101     windata->window->SetOptions(windata->window, wopts);
   102 
   102 
   103     /* See what we got */
   103     /* See what we got */
   104     SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
   104     SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
       
   105                      (_this, window, &window->w, &window->h));
   105 
   106 
   106     /* Get the window's surface. */
   107     /* Get the window's surface. */
   107     SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
   108     SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
   108                                                  &windata->window_surface));
   109                                                  &windata->window_surface));
   109     /* And get a subsurface for rendering */
   110     /* And get a subsurface for rendering */
   113 
   114 
   114     windata->window->SetOpacity(windata->window, 0xFF);
   115     windata->window->SetOpacity(windata->window, 0xFF);
   115 
   116 
   116     /* Create Eventbuffer */
   117     /* Create Eventbuffer */
   117     SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
   118     SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
   118                                                         &windata->eventbuffer));
   119                                                         &windata->
   119     SDL_DFB_CHECKERR(windata->
   120                                                         eventbuffer));
   120                      window->EnableEvents(windata->window, DWET_ALL));
   121     SDL_DFB_CHECKERR(windata->window->
       
   122                      EnableEvents(windata->window, DWET_ALL));
   121 
   123 
   122     /* Create a font */
   124     /* Create a font */
   123     /* FIXME: once during Video_Init */
   125     /* FIXME: once during Video_Init */
   124     if (windata->is_managed) {
   126     if (windata->is_managed) {
   125         DFBFontDescription fdesc;
   127         DFBFontDescription fdesc;
   277         }
   279         }
   278 
   280 
   279         SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
   281         SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
   280                                                        DWET_ALL));
   282                                                        DWET_ALL));
   281 
   283 
   282         SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
   284         SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
       
   285                          (_this, window, &window->w, &window->h));
   283 
   286 
   284         SDL_OnWindowResized(window);
   287         SDL_OnWindowResized(window);
   285     }
   288     }
   286     return;
   289     return;
   287   error:
   290   error:
   320 DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
   323 DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
   321 {
   324 {
   322     SDL_DFB_WINDOWDATA(window);
   325     SDL_DFB_WINDOWDATA(window);
   323 
   326 
   324     if (windata->is_managed) {
   327     if (windata->is_managed) {
   325     	DirectFB_WM_MaximizeWindow(_this, window);
   328         DirectFB_WM_MaximizeWindow(_this, window);
   326     } else
   329     } else
   327         SDL_Unsupported();
   330         SDL_Unsupported();
   328 }
   331 }
   329 
   332 
   330 void
   333 void
   339 DirectFB_RestoreWindow(_THIS, SDL_Window * window)
   342 DirectFB_RestoreWindow(_THIS, SDL_Window * window)
   340 {
   343 {
   341     SDL_DFB_WINDOWDATA(window);
   344     SDL_DFB_WINDOWDATA(window);
   342 
   345 
   343     if (windata->is_managed) {
   346     if (windata->is_managed) {
   344     	DirectFB_WM_RestoreWindow(_this, window);
   347         DirectFB_WM_RestoreWindow(_this, window);
   345     } else
   348     } else
   346         SDL_Unsupported();
   349         SDL_Unsupported();
   347 }
   350 }
   348 
   351 
   349 void
   352 void
   419         adjust = 1;
   422         adjust = 1;
   420     }
   423     }
   421 
   424 
   422     if (adjust) {
   425     if (adjust) {
   423 #if DFB_VERSION_ATLEAST(1,2,1)
   426 #if DFB_VERSION_ATLEAST(1,2,1)
   424        SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   427         SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   425                                                         windata->size.w,
   428                                                         windata->size.w,
   426                                                         windata->size.h));
   429                                                         windata->size.h));
   427        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
   430         SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
   428                                                           windata->
   431                                                           windata->
   429                                                           window_surface,
   432                                                           window_surface,
   430                                                           &windata->client));
   433                                                           &windata->client));
   431 #else
   434 #else
   432  	   DFBWindowOptions opts;
   435         DFBWindowOptions opts;
   433 
   436 
   434 	   SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
   437         SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
   435        /* recreate subsurface */
   438         /* recreate subsurface */
   436        SDL_DFB_RELEASE(windata->surface);
   439         SDL_DFB_RELEASE(windata->surface);
   437        
   440 
   438        if (opts & DWOP_SCALE)
   441         if (opts & DWOP_SCALE)
   439           SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   442             SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   440                                                           windata->size.w,
   443                                                             windata->size.w,
   441                                                           windata->size.h));
   444                                                             windata->size.h));
   442        SDL_DFB_CHECKERR(windata->window_surface->
   445         SDL_DFB_CHECKERR(windata->window_surface->
   443                       GetSubSurface(windata->window_surface, &windata->client,
   446                          GetSubSurface(windata->window_surface,
   444                                   &windata->surface));
   447                                        &windata->client, &windata->surface));
   445 #endif
   448 #endif
   446        DirectFB_WM_RedrawLayout(window);
   449         DirectFB_WM_RedrawLayout(window);
   447     }
   450     }
   448   error:
   451   error:
   449     return;
   452     return;
   450 }
   453 }
   451