comparison src/video/photon/SDL_ph_wm.c @ 571:8e3ce997621c

Date: Thu, 16 Jan 2003 13:48:31 +0200 From: "Mike Gorchak" Subject: All QNX patches whole patches concerning QNX. Almost all code has been rewritten by Julian and me. Added initial support for hw overlays in QNX and many many others fixes. P.S. This patches has been reviewed by Dave Rempel from QSSL and included in SDL 1.2.5 distribution, which coming on 3rd party CD for newest 6.2.1 version of QNX, which will be available soon.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 20 Jan 2003 01:38:37 +0000
parents 3333b6e68289
children 8bedd6d61642
comparison
equal deleted inserted replaced
570:04d6411da49d 571:8e3ce997621c
54 /* Set window caption */ 54 /* Set window caption */
55 void ph_SetCaption(_THIS, const char *title, const char *icon) 55 void ph_SetCaption(_THIS, const char *title, const char *icon)
56 { 56 {
57 SDL_Lock_EventThread(); 57 SDL_Lock_EventThread();
58 58
59 /* check for set caption call before window init */ 59 /* sanity check for set caption call before window init */
60 if (window!=NULL) 60 if (window!=NULL)
61 { 61 {
62 PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0); 62 PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
63 }
64 else
65 {
66 captionflag=1;
67 } 63 }
68 64
69 SDL_Unlock_EventThread(); 65 SDL_Unlock_EventThread();
70 } 66 }
71 67
86 return 0; 82 return 0;
87 } 83 }
88 84
89 SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode) 85 SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode)
90 { 86 {
87 short abs_x, abs_y;
88
89 if( mode == SDL_GRAB_OFF )
90 {
91 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
92 }
93 else
94 {
95 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
96
97 PtGetAbsPosition(window, &abs_x, &abs_y);
98 PhMoveCursorAbs(PhInputGroup(NULL), abs_x + SDL_VideoSurface->w/2, abs_y + SDL_VideoSurface->h/2);
99 }
100
101 SDL_Unlock_EventThread();
102
91 return(mode); 103 return(mode);
92 } 104 }
93 105
94 SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode) 106 SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode)
95 { 107 {
96 short abs_x, abs_y; 108 SDL_Lock_EventThread();
109 mode = ph_GrabInputNoLock(this, mode);
110 SDL_Unlock_EventThread();
97 111
98 SDL_Lock_EventThread(); 112 return(mode);
99 /* mode = ph_GrabInputNoLock(this, mode);*/ 113 }
100 114
101 if( mode == SDL_GRAB_OFF )
102 {
103 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE,
104 Ph_WM_STATE_ISALTKEY );
105 }
106 else
107 {
108 PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE,
109 Ph_WM_STATE_ISALTKEY );
110
111 PtGetAbsPosition( window, &abs_x, &abs_y );
112 PhMoveCursorAbs( PhInputGroup( NULL ),
113 abs_x + SDL_VideoSurface->w/2,
114 abs_y + SDL_VideoSurface->h/2 );
115 }
116
117 SDL_Unlock_EventThread();
118 return(mode);
119 }
120 115
121 int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info) 116 int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info)
122 { 117 {
123 if (info->version.major <= SDL_MAJOR_VERSION) 118 if (info->version.major <= SDL_MAJOR_VERSION)
124 { 119 {