comparison src/video/Xext/Xinerama/Xinerama.c @ 1575:3ba88cb7eb1b

Updated dynamic X11 code. See details in Bugzilla #170.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 22 Mar 2006 05:00:59 +0000
parents 6fd39b50dd91
children ecba4bbaf9c2
comparison
equal deleted inserted replaced
1574:0fd72308659e 1575:3ba88cb7eb1b
111 GetReq (PanoramiXQueryVersion, req); 111 GetReq (PanoramiXQueryVersion, req);
112 req->reqType = info->codes->major_opcode; 112 req->reqType = info->codes->major_opcode;
113 req->panoramiXReqType = X_PanoramiXQueryVersion; 113 req->panoramiXReqType = X_PanoramiXQueryVersion;
114 req->clientMajor = PANORAMIX_MAJOR_VERSION; 114 req->clientMajor = PANORAMIX_MAJOR_VERSION;
115 req->clientMinor = PANORAMIX_MINOR_VERSION; 115 req->clientMinor = PANORAMIX_MINOR_VERSION;
116 if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 116 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
117 UnlockDisplay (dpy); 117 UnlockDisplay (dpy);
118 SyncHandle (); 118 SyncHandle ();
119 return 0; 119 return 0;
120 } 120 }
121 *major_versionp = rep.majorVersion; 121 *major_versionp = rep.majorVersion;
145 LockDisplay (dpy); 145 LockDisplay (dpy);
146 GetReq (PanoramiXGetState, req); 146 GetReq (PanoramiXGetState, req);
147 req->reqType = info->codes->major_opcode; 147 req->reqType = info->codes->major_opcode;
148 req->panoramiXReqType = X_PanoramiXGetState; 148 req->panoramiXReqType = X_PanoramiXGetState;
149 req->window = drawable; 149 req->window = drawable;
150 if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 150 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
151 UnlockDisplay (dpy); 151 UnlockDisplay (dpy);
152 SyncHandle (); 152 SyncHandle ();
153 return 0; 153 return 0;
154 } 154 }
155 UnlockDisplay (dpy); 155 UnlockDisplay (dpy);
174 LockDisplay (dpy); 174 LockDisplay (dpy);
175 GetReq (PanoramiXGetScreenCount, req); 175 GetReq (PanoramiXGetScreenCount, req);
176 req->reqType = info->codes->major_opcode; 176 req->reqType = info->codes->major_opcode;
177 req->panoramiXReqType = X_PanoramiXGetScreenCount; 177 req->panoramiXReqType = X_PanoramiXGetScreenCount;
178 req->window = drawable; 178 req->window = drawable;
179 if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 179 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
180 UnlockDisplay (dpy); 180 UnlockDisplay (dpy);
181 SyncHandle (); 181 SyncHandle ();
182 return 0; 182 return 0;
183 } 183 }
184 UnlockDisplay (dpy); 184 UnlockDisplay (dpy);
205 GetReq (PanoramiXGetScreenSize, req); 205 GetReq (PanoramiXGetScreenSize, req);
206 req->reqType = info->codes->major_opcode; 206 req->reqType = info->codes->major_opcode;
207 req->panoramiXReqType = X_PanoramiXGetScreenSize; 207 req->panoramiXReqType = X_PanoramiXGetScreenSize;
208 req->window = drawable; 208 req->window = drawable;
209 req->screen = screen_num; /* need to define */ 209 req->screen = screen_num; /* need to define */
210 if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) { 210 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
211 UnlockDisplay (dpy); 211 UnlockDisplay (dpy);
212 SyncHandle (); 212 SyncHandle ();
213 return 0; 213 return 0;
214 } 214 }
215 UnlockDisplay (dpy); 215 UnlockDisplay (dpy);
285 285
286 LockDisplay (dpy); 286 LockDisplay (dpy);
287 GetReq (XineramaQueryScreens, req); 287 GetReq (XineramaQueryScreens, req);
288 req->reqType = info->codes->major_opcode; 288 req->reqType = info->codes->major_opcode;
289 req->panoramiXReqType = X_XineramaQueryScreens; 289 req->panoramiXReqType = X_XineramaQueryScreens;
290 if (!p_XReply (dpy, (xReply *) &rep, 0, xFalse)) { 290 if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
291 UnlockDisplay (dpy); 291 UnlockDisplay (dpy);
292 SyncHandle (); 292 SyncHandle ();
293 return NULL; 293 return NULL;
294 } 294 }
295 295
297 if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) { 297 if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) {
298 xXineramaScreenInfo scratch; 298 xXineramaScreenInfo scratch;
299 int i; 299 int i;
300 300
301 for(i = 0; i < rep.number; i++) { 301 for(i = 0; i < rep.number; i++) {
302 p_XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); 302 _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
303 scrnInfo[i].screen_number = i; 303 scrnInfo[i].screen_number = i;
304 scrnInfo[i].x_org = scratch.x_org; 304 scrnInfo[i].x_org = scratch.x_org;
305 scrnInfo[i].y_org = scratch.y_org; 305 scrnInfo[i].y_org = scratch.y_org;
306 scrnInfo[i].width = scratch.width; 306 scrnInfo[i].width = scratch.width;
307 scrnInfo[i].height = scratch.height; 307 scrnInfo[i].height = scratch.height;
308 } 308 }
309 309
310 *number = rep.number; 310 *number = rep.number;
311 } else 311 } else
312 p_XEatData(dpy, rep.length << 2); 312 _XEatData(dpy, rep.length << 2);
313 } 313 }
314 314
315 UnlockDisplay (dpy); 315 UnlockDisplay (dpy);
316 SyncHandle (); 316 SyncHandle ();
317 return scrnInfo; 317 return scrnInfo;