Mercurial > sdl-ios-xcode
comparison src/video/directfb/SDL_DirectFB_WM.c @ 3040:62d4992e5a92
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 14 Jan 2009 04:25:32 +0000 |
parents | d72a0dd80e8b |
children | 64ce267332c6 |
comparison
equal
deleted
inserted
replaced
3039:829043b363d1 | 3040:62d4992e5a92 |
---|---|
197 { | 197 { |
198 SDL_DFB_WINDOWDATA(window); | 198 SDL_DFB_WINDOWDATA(window); |
199 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); | 199 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); |
200 | 200 |
201 windata->window->GetPosition(windata->window, | 201 windata->window->GetPosition(windata->window, |
202 &windata->restore.x, | 202 &windata->restore.x, &windata->restore.y); |
203 &windata->restore.y); | |
204 windata->window->GetSize(windata->window, &windata->restore.w, | 203 windata->window->GetSize(windata->window, &windata->restore.w, |
205 &windata->restore.h); | 204 &windata->restore.h); |
206 | 205 |
207 /* Do this already here */ | 206 /* Do this already here */ |
208 window->flags |= SDL_WINDOW_MAXIMIZED; | 207 window->flags |= SDL_WINDOW_MAXIMIZED; |
209 DirectFB_WM_AdjustWindowLayout(window); | 208 DirectFB_WM_AdjustWindowLayout(window); |
210 | 209 |
211 windata->window->MoveTo(windata->window, 0, 0); | 210 windata->window->MoveTo(windata->window, 0, 0); |
212 windata->window->Resize(windata->window, | 211 windata->window->Resize(windata->window, |
213 display->current_mode.w, | 212 display->current_mode.w, display->current_mode.h); |
214 display->current_mode.h); | |
215 SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); | 213 SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); |
216 } | 214 } |
217 | 215 |
218 void | 216 void |
219 DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window) | 217 DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window) |
289 static int wm_grab; | 287 static int wm_grab; |
290 static int wm_lastx; | 288 static int wm_lastx; |
291 static int wm_lasty; | 289 static int wm_lasty; |
292 | 290 |
293 int | 291 int |
294 DirectFB_WM_ProcessEvent(_THIS, SDL_Window *window, DFBWindowEvent * evt) | 292 DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) |
295 { | 293 { |
296 SDL_DFB_WINDOWDATA(window); | 294 SDL_DFB_WINDOWDATA(window); |
297 | 295 |
298 if (!windata->is_managed) | 296 if (!windata->is_managed) |
299 return 0; | 297 return 0; |
304 int pos = WMPos(windata, evt->x, evt->y); | 302 int pos = WMPos(windata, evt->x, evt->y); |
305 switch (pos) { | 303 switch (pos) { |
306 case WM_POS_NONE: | 304 case WM_POS_NONE: |
307 return 0; | 305 return 0; |
308 case WM_POS_CLOSE: | 306 case WM_POS_CLOSE: |
309 SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0, 0); | 307 SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0, |
308 0); | |
310 return 1; | 309 return 1; |
311 case WM_POS_MAX: | 310 case WM_POS_MAX: |
312 if (window->flags & SDL_WINDOW_MAXIMIZED) { | 311 if (window->flags & SDL_WINDOW_MAXIMIZED) { |
313 DirectFB_WM_RestoreWindow(_this, window); | 312 DirectFB_WM_RestoreWindow(_this, window); |
314 } else { | 313 } else { |
315 DirectFB_WM_MaximizeWindow(_this, window); | 314 DirectFB_WM_MaximizeWindow(_this, window); |
316 } | 315 } |
317 return 1; | 316 return 1; |
318 default: | 317 default: |
319 wm_grab = pos; | 318 wm_grab = pos; |
320 windata->window->GrabPointer(windata->window); | 319 windata->window->GrabPointer(windata->window); |