Mercurial > sdl-ios-xcode
diff src/video/photon/SDL_ph_wm.c @ 1662:782fd950bd46 SDL-1.3
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 28 May 2006 13:04:16 +0000 |
parents | 141528317f4f |
children | 4da1ee79c9af |
line wrap: on
line diff
--- a/src/video/photon/SDL_ph_wm.c Sun May 21 17:27:13 2006 +0000 +++ b/src/video/photon/SDL_ph_wm.c Sun May 28 13:04:16 2006 +0000 @@ -35,84 +35,89 @@ #include "SDL_ph_modes_c.h" #include "SDL_ph_wm_c.h" -void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask) +void +ph_SetIcon (_THIS, SDL_Surface * icon, Uint8 * mask) { return; } /* Set window caption */ -void ph_SetCaption(_THIS, const char *title, const char *icon) +void +ph_SetCaption (_THIS, const char *title, const char *icon) { - SDL_Lock_EventThread(); + SDL_Lock_EventThread (); /* sanity check for set caption call before window init */ - if (window!=NULL) - { - PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0); + if (window != NULL) { + PtSetResource (window, Pt_ARG_WINDOW_TITLE, title, 0); } - SDL_Unlock_EventThread(); + SDL_Unlock_EventThread (); } /* Iconify current window */ -int ph_IconifyWindow(_THIS) +int +ph_IconifyWindow (_THIS) { PhWindowEvent_t windowevent; - SDL_Lock_EventThread(); + SDL_Lock_EventThread (); - SDL_memset(&windowevent, 0, sizeof(windowevent)); + SDL_memset (&windowevent, 0, sizeof (windowevent)); windowevent.event_f = Ph_WM_HIDE; windowevent.event_state = Ph_WM_EVSTATE_HIDE; - windowevent.rid = PtWidgetRid(window); - PtForwardWindowEvent(&windowevent); + windowevent.rid = PtWidgetRid (window); + PtForwardWindowEvent (&windowevent); - SDL_Unlock_EventThread(); + SDL_Unlock_EventThread (); return 0; } -SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode) +SDL_GrabMode +ph_GrabInputNoLock (_THIS, SDL_GrabMode mode) { short abs_x, abs_y; - if( mode == SDL_GRAB_OFF ) - { - PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY); - } - else - { - PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY); + if (mode == SDL_GRAB_OFF) { + PtSetResource (window, Pt_ARG_WINDOW_STATE, Pt_FALSE, + Ph_WM_STATE_ISALTKEY); + } else { + PtSetResource (window, Pt_ARG_WINDOW_STATE, Pt_TRUE, + Ph_WM_STATE_ISALTKEY); - PtGetAbsPosition(window, &abs_x, &abs_y); - PhMoveCursorAbs(PhInputGroup(NULL), abs_x + SDL_VideoSurface->w/2, abs_y + SDL_VideoSurface->h/2); + PtGetAbsPosition (window, &abs_x, &abs_y); + PhMoveCursorAbs (PhInputGroup (NULL), + abs_x + SDL_VideoSurface->w / 2, + abs_y + SDL_VideoSurface->h / 2); } - SDL_Unlock_EventThread(); + SDL_Unlock_EventThread (); - return(mode); + return (mode); } -SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode) +SDL_GrabMode +ph_GrabInput (_THIS, SDL_GrabMode mode) { - SDL_Lock_EventThread(); - mode = ph_GrabInputNoLock(this, mode); - SDL_Unlock_EventThread(); + SDL_Lock_EventThread (); + mode = ph_GrabInputNoLock (this, mode); + SDL_Unlock_EventThread (); - return(mode); + return (mode); } -int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info) +int +ph_GetWMInfo (_THIS, SDL_SysWMinfo * info) { - if (info->version.major <= SDL_MAJOR_VERSION) - { + if (info->version.major <= SDL_MAJOR_VERSION) { return 1; - } - else - { - SDL_SetError("Application not compiled with SDL %d.%d\n", + } else { + SDL_SetError ("Application not compiled with SDL %d.%d\n", SDL_MAJOR_VERSION, SDL_MINOR_VERSION); return -1; } } + +/* vi: set ts=4 sw=4 expandtab: */