Mercurial > sdl-ios-xcode
comparison src/video/photon/SDL_ph_wm.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
comparison
equal
deleted
inserted
replaced
1667:1fddae038bc8 | 1668:4da1ee79c9af |
---|---|
34 #include "../../events/SDL_events_c.h" | 34 #include "../../events/SDL_events_c.h" |
35 #include "SDL_ph_modes_c.h" | 35 #include "SDL_ph_modes_c.h" |
36 #include "SDL_ph_wm_c.h" | 36 #include "SDL_ph_wm_c.h" |
37 | 37 |
38 void | 38 void |
39 ph_SetIcon (_THIS, SDL_Surface * icon, Uint8 * mask) | 39 ph_SetIcon(_THIS, SDL_Surface * icon, Uint8 * mask) |
40 { | 40 { |
41 return; | 41 return; |
42 } | 42 } |
43 | 43 |
44 /* Set window caption */ | 44 /* Set window caption */ |
45 void | 45 void |
46 ph_SetCaption (_THIS, const char *title, const char *icon) | 46 ph_SetCaption(_THIS, const char *title, const char *icon) |
47 { | 47 { |
48 SDL_Lock_EventThread (); | 48 SDL_Lock_EventThread(); |
49 | 49 |
50 /* sanity check for set caption call before window init */ | 50 /* sanity check for set caption call before window init */ |
51 if (window != NULL) { | 51 if (window != NULL) { |
52 PtSetResource (window, Pt_ARG_WINDOW_TITLE, title, 0); | 52 PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0); |
53 } | 53 } |
54 | 54 |
55 SDL_Unlock_EventThread (); | 55 SDL_Unlock_EventThread(); |
56 } | 56 } |
57 | 57 |
58 /* Iconify current window */ | 58 /* Iconify current window */ |
59 int | 59 int |
60 ph_IconifyWindow (_THIS) | 60 ph_IconifyWindow(_THIS) |
61 { | 61 { |
62 PhWindowEvent_t windowevent; | 62 PhWindowEvent_t windowevent; |
63 | 63 |
64 SDL_Lock_EventThread (); | 64 SDL_Lock_EventThread(); |
65 | 65 |
66 SDL_memset (&windowevent, 0, sizeof (windowevent)); | 66 SDL_memset(&windowevent, 0, sizeof(windowevent)); |
67 windowevent.event_f = Ph_WM_HIDE; | 67 windowevent.event_f = Ph_WM_HIDE; |
68 windowevent.event_state = Ph_WM_EVSTATE_HIDE; | 68 windowevent.event_state = Ph_WM_EVSTATE_HIDE; |
69 windowevent.rid = PtWidgetRid (window); | 69 windowevent.rid = PtWidgetRid(window); |
70 PtForwardWindowEvent (&windowevent); | 70 PtForwardWindowEvent(&windowevent); |
71 | 71 |
72 SDL_Unlock_EventThread (); | 72 SDL_Unlock_EventThread(); |
73 | 73 |
74 return 0; | 74 return 0; |
75 } | 75 } |
76 | 76 |
77 SDL_GrabMode | 77 SDL_GrabMode |
78 ph_GrabInputNoLock (_THIS, SDL_GrabMode mode) | 78 ph_GrabInputNoLock(_THIS, SDL_GrabMode mode) |
79 { | 79 { |
80 short abs_x, abs_y; | 80 short abs_x, abs_y; |
81 | 81 |
82 if (mode == SDL_GRAB_OFF) { | 82 if (mode == SDL_GRAB_OFF) { |
83 PtSetResource (window, Pt_ARG_WINDOW_STATE, Pt_FALSE, | 83 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, |
84 Ph_WM_STATE_ISALTKEY); | 84 Ph_WM_STATE_ISALTKEY); |
85 } else { | 85 } else { |
86 PtSetResource (window, Pt_ARG_WINDOW_STATE, Pt_TRUE, | 86 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, |
87 Ph_WM_STATE_ISALTKEY); | 87 Ph_WM_STATE_ISALTKEY); |
88 | 88 |
89 PtGetAbsPosition (window, &abs_x, &abs_y); | 89 PtGetAbsPosition(window, &abs_x, &abs_y); |
90 PhMoveCursorAbs (PhInputGroup (NULL), | 90 PhMoveCursorAbs(PhInputGroup(NULL), |
91 abs_x + SDL_VideoSurface->w / 2, | 91 abs_x + SDL_VideoSurface->w / 2, |
92 abs_y + SDL_VideoSurface->h / 2); | 92 abs_y + SDL_VideoSurface->h / 2); |
93 } | 93 } |
94 | 94 |
95 SDL_Unlock_EventThread (); | 95 SDL_Unlock_EventThread(); |
96 | 96 |
97 return (mode); | 97 return (mode); |
98 } | 98 } |
99 | 99 |
100 SDL_GrabMode | 100 SDL_GrabMode |
101 ph_GrabInput (_THIS, SDL_GrabMode mode) | 101 ph_GrabInput(_THIS, SDL_GrabMode mode) |
102 { | 102 { |
103 SDL_Lock_EventThread (); | 103 SDL_Lock_EventThread(); |
104 mode = ph_GrabInputNoLock (this, mode); | 104 mode = ph_GrabInputNoLock(this, mode); |
105 SDL_Unlock_EventThread (); | 105 SDL_Unlock_EventThread(); |
106 | 106 |
107 return (mode); | 107 return (mode); |
108 } | 108 } |
109 | 109 |
110 | 110 |
111 int | 111 int |
112 ph_GetWMInfo (_THIS, SDL_SysWMinfo * info) | 112 ph_GetWMInfo(_THIS, SDL_SysWMinfo * info) |
113 { | 113 { |
114 if (info->version.major <= SDL_MAJOR_VERSION) { | 114 if (info->version.major <= SDL_MAJOR_VERSION) { |
115 return 1; | 115 return 1; |
116 } else { | 116 } else { |
117 SDL_SetError ("Application not compiled with SDL %d.%d\n", | 117 SDL_SetError("Application not compiled with SDL %d.%d\n", |
118 SDL_MAJOR_VERSION, SDL_MINOR_VERSION); | 118 SDL_MAJOR_VERSION, SDL_MINOR_VERSION); |
119 return -1; | 119 return -1; |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 /* vi: set ts=4 sw=4 expandtab: */ | 123 /* vi: set ts=4 sw=4 expandtab: */ |