Mercurial > sdl-ios-xcode
comparison src/video/Xext/XME/xme.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 |
---|---|
234 int opcode, event, error; | 234 int opcode, event, error; |
235 xXiGMiscQueryVersionReq *req; | 235 xXiGMiscQueryVersionReq *req; |
236 xXiGMiscQueryVersionReply rep; | 236 xXiGMiscQueryVersionReply rep; |
237 XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); | 237 XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); |
238 | 238 |
239 if (!pXQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error)) | 239 if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error)) |
240 return xFalse; | 240 return xFalse; |
241 | 241 |
242 XiGMiscCheckExtension(dpy, info, xFalse); | 242 XiGMiscCheckExtension(dpy, info, xFalse); |
243 | 243 |
244 LockDisplay (dpy); | 244 LockDisplay (dpy); |
245 XiGMiscGetReq (XiGMiscQueryVersion, req, info); | 245 XiGMiscGetReq (XiGMiscQueryVersion, req, info); |
246 | 246 |
247 req->major = XIGMISC_MAJOR_VERSION; | 247 req->major = XIGMISC_MAJOR_VERSION; |
248 req->minor = XIGMISC_MINOR_VERSION; | 248 req->minor = XIGMISC_MINOR_VERSION; |
249 | 249 |
250 if (!p_XReply (dpy, (xReply *)&rep, 0, xTrue)) { | 250 if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { |
251 UnlockDisplay(dpy); | 251 UnlockDisplay(dpy); |
252 SyncHandle(); | 252 SyncHandle(); |
253 return xFalse; | 253 return xFalse; |
254 } | 254 } |
255 | 255 |
272 | 272 |
273 LockDisplay (dpy); | 273 LockDisplay (dpy); |
274 XiGMiscGetReq (XiGMiscQueryViews, req, info); | 274 XiGMiscGetReq (XiGMiscQueryViews, req, info); |
275 req->screen = screen; | 275 req->screen = screen; |
276 | 276 |
277 if (!p_XReply (dpy, (xReply *)&rep, 0, xFalse)) { | 277 if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { |
278 UnlockDisplay(dpy); | 278 UnlockDisplay(dpy); |
279 SyncHandle(); | 279 SyncHandle(); |
280 return 0; | 280 return 0; |
281 } | 281 } |
282 | 282 |
284 | 284 |
285 if (n > 0) { | 285 if (n > 0) { |
286 size = sizeof(XiGMiscViewInfo) * n; | 286 size = sizeof(XiGMiscViewInfo) * n; |
287 views = (XiGMiscViewInfo*)Xmalloc(size); | 287 views = (XiGMiscViewInfo*)Xmalloc(size); |
288 if (!views) { | 288 if (!views) { |
289 p_XEatData(dpy, (unsigned long)size); | 289 _XEatData(dpy, (unsigned long)size); |
290 UnlockDisplay(dpy); | 290 UnlockDisplay(dpy); |
291 SyncHandle(); | 291 SyncHandle(); |
292 return 0; | 292 return 0; |
293 } | 293 } |
294 | 294 |
295 p_XReadPad(dpy, (void*)views, size); | 295 _XReadPad(dpy, (void*)views, size); |
296 | 296 |
297 *pviews = views; | 297 *pviews = views; |
298 } | 298 } |
299 | 299 |
300 UnlockDisplay(dpy); | 300 UnlockDisplay(dpy); |
315 LockDisplay (dpy); | 315 LockDisplay (dpy); |
316 XiGMiscGetReq (XiGMiscQueryResolutions, req, info); | 316 XiGMiscGetReq (XiGMiscQueryResolutions, req, info); |
317 req->screen = screen; | 317 req->screen = screen; |
318 req->view = view; | 318 req->view = view; |
319 | 319 |
320 if (!p_XReply (dpy, (xReply *)&rep, 0, xFalse)) { | 320 if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { |
321 UnlockDisplay(dpy); | 321 UnlockDisplay(dpy); |
322 SyncHandle(); | 322 SyncHandle(); |
323 return 0; | 323 return 0; |
324 } | 324 } |
325 | 325 |
327 | 327 |
328 if (n > 0) { | 328 if (n > 0) { |
329 size = sizeof(XiGMiscResolutionInfo) * n; | 329 size = sizeof(XiGMiscResolutionInfo) * n; |
330 resolutions = (XiGMiscResolutionInfo*)Xmalloc(size); | 330 resolutions = (XiGMiscResolutionInfo*)Xmalloc(size); |
331 if (!resolutions) { | 331 if (!resolutions) { |
332 p_XEatData(dpy, (unsigned long)size); | 332 _XEatData(dpy, (unsigned long)size); |
333 UnlockDisplay(dpy); | 333 UnlockDisplay(dpy); |
334 SyncHandle(); | 334 SyncHandle(); |
335 return 0; | 335 return 0; |
336 } | 336 } |
337 | 337 |
338 p_XReadPad(dpy, (void*)resolutions, size); | 338 _XReadPad(dpy, (void*)resolutions, size); |
339 | 339 |
340 *presolutions = resolutions; | 340 *presolutions = resolutions; |
341 *pactive = rep.active; | 341 *pactive = rep.active; |
342 } | 342 } |
343 | 343 |
381 req->pad0 = 0; | 381 req->pad0 = 0; |
382 req->pad1 = 0; | 382 req->pad1 = 0; |
383 req->window = window; | 383 req->window = window; |
384 req->cmap = cmap; | 384 req->cmap = cmap; |
385 | 385 |
386 if (!p_XReply (dpy, (xReply *)&rep, 0, xTrue)) { | 386 if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { |
387 UnlockDisplay(dpy); | 387 UnlockDisplay(dpy); |
388 SyncHandle(); | 388 SyncHandle(); |
389 return xFalse; | 389 return xFalse; |
390 } | 390 } |
391 | 391 |