annotate 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
rev   line source
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /* $Xorg: XPanoramiX.c,v 1.4 2000/08/17 19:45:51 cpqbld Exp $ */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 /*****************************************************************
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
3 Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4 Permission is hereby granted, free of charge, to any person obtaining a copy
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 of this software and associated documentation files (the "Software"), to deal
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 in the Software without restriction, including without limitation the rights
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 copies of the Software.
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 The above copyright notice and this permission notice shall be included in
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 all copies or substantial portions of the Software.
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 Except as contained in this notice, the name of Digital Equipment Corporation
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 shall not be used in advertising or otherwise to promote the sale, use or other
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23 dealings in this Software without prior written authorization from Digital
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 Equipment Corporation.
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 ******************************************************************/
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 /* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.2 2001/07/23 17:20:28 dawes Exp $ */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 #define NEED_EVENTS
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 #define NEED_REPLIES
1384
6fd39b50dd91 build fixes for IRIX 6.5 - dynamic X11 loading works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
30
6fd39b50dd91 build fixes for IRIX 6.5 - dynamic X11 loading works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
31 #include "../../x11/SDL_x11dyn.h"
6fd39b50dd91 build fixes for IRIX 6.5 - dynamic X11 loading works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
32
6fd39b50dd91 build fixes for IRIX 6.5 - dynamic X11 loading works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
33 /*#include <X11/Xlibint.h>*/
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 #include <X11/Xutil.h>
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 #include <X11/extensions/Xext.h> /* in ../include */
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1226
diff changeset
36 #include "../extensions/extutil.h" /* in ../include */
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1226
diff changeset
37 #include "../extensions/panoramiXext.h"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1226
diff changeset
38 #include "../extensions/panoramiXproto.h" /* in ../include */
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1226
diff changeset
39 #include "../extensions/Xinerama.h"
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 static XExtensionInfo _panoramiX_ext_info_data;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 #define PanoramiXCheckExtension(dpy,i,val) \
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 XextCheckExtension (dpy, i, panoramiX_extension_name, val)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 #define PanoramiXSimpleCheckExtension(dpy,i) \
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 static int close_display();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 static /* const */ XExtensionHooks panoramiX_extension_hooks = {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 NULL, /* create_gc */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
53 NULL, /* copy_gc */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 NULL, /* flush_gc */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 NULL, /* free_gc */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56 NULL, /* create_font */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 NULL, /* free_font */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
58 close_display, /* close_display */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 NULL, /* wire_to_event */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 NULL, /* event_to_wire */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 NULL, /* error */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 NULL, /* error_string */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63 };
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 static XEXT_GENERATE_FIND_DISPLAY (find_display, panoramiX_ext_info,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 panoramiX_extension_name,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 &panoramiX_extension_hooks,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 0, NULL)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 /****************************************************************************
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 * *
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 * PanoramiX public interfaces *
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 * *
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 ****************************************************************************/
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 Bool SDL_NAME(XPanoramiXQueryExtension) (
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 int *event_basep,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 int *error_basep
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
88 if (XextHasExtension(info)) {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
89 *event_basep = info->codes->first_event;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
90 *error_basep = info->codes->first_error;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
91 return True;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
92 } else {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
93 return False;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
94 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
95 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
96
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
97
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
98 Status SDL_NAME(XPanoramiXQueryVersion)(
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
99 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
100 int *major_versionp,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
101 int *minor_versionp
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
102 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
103 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
104 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
105 xPanoramiXQueryVersionReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
106 register xPanoramiXQueryVersionReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
107
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
108 PanoramiXCheckExtension (dpy, info, 0);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
109
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
110 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
111 GetReq (PanoramiXQueryVersion, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
112 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
113 req->panoramiXReqType = X_PanoramiXQueryVersion;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
114 req->clientMajor = PANORAMIX_MAJOR_VERSION;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
115 req->clientMinor = PANORAMIX_MINOR_VERSION;
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
116 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
117 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
118 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
119 return 0;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
120 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
121 *major_versionp = rep.majorVersion;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
122 *minor_versionp = rep.minorVersion;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
123 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
124 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
125 return 1;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
126 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
127
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128 SDL_NAME(XPanoramiXInfo) *SDL_NAME(XPanoramiXAllocInfo)(void)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
129 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
130 return (SDL_NAME(XPanoramiXInfo) *) Xmalloc (sizeof (SDL_NAME(XPanoramiXInfo)));
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
131 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
132
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
133 Status SDL_NAME(XPanoramiXGetState) (
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
135 Drawable drawable,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136 SDL_NAME(XPanoramiXInfo) *panoramiX_info
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
140 xPanoramiXGetStateReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
141 register xPanoramiXGetStateReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
142
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
143 PanoramiXCheckExtension (dpy, info, 0);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
144
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
145 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
146 GetReq (PanoramiXGetState, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
147 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
148 req->panoramiXReqType = X_PanoramiXGetState;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
149 req->window = drawable;
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
150 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
151 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
152 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
153 return 0;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
154 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
155 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
156 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
157 panoramiX_info->window = rep.window;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
158 panoramiX_info->State = rep.state;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
159 return 1;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
160 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
161
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
162 Status SDL_NAME(XPanoramiXGetScreenCount) (
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
163 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
164 Drawable drawable,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
165 SDL_NAME(XPanoramiXInfo) *panoramiX_info
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
166 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
167 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
168 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
169 xPanoramiXGetScreenCountReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
170 register xPanoramiXGetScreenCountReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
171
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
172 PanoramiXCheckExtension (dpy, info, 0);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
173
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
174 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
175 GetReq (PanoramiXGetScreenCount, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
176 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
177 req->panoramiXReqType = X_PanoramiXGetScreenCount;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
178 req->window = drawable;
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
179 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
180 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
181 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
182 return 0;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
183 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
184 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
185 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
186 panoramiX_info->window = rep.window;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
187 panoramiX_info->ScreenCount = rep.ScreenCount;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
188 return 1;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
189 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
190
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
191 Status SDL_NAME(XPanoramiXGetScreenSize) (
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
192 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
193 Drawable drawable,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
194 int screen_num,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
195 SDL_NAME(XPanoramiXInfo) *panoramiX_info
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
196 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
197 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
198 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
199 xPanoramiXGetScreenSizeReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
200 register xPanoramiXGetScreenSizeReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
201
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
202 PanoramiXCheckExtension (dpy, info, 0);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
203
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
204 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
205 GetReq (PanoramiXGetScreenSize, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
206 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
207 req->panoramiXReqType = X_PanoramiXGetScreenSize;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
208 req->window = drawable;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
209 req->screen = screen_num; /* need to define */
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
210 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
211 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
212 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
213 return 0;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
214 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
215 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
216 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
217 panoramiX_info->window = rep.window;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
218 panoramiX_info->screen = rep.screen;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
219 panoramiX_info->width = rep.width;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
220 panoramiX_info->height = rep.height;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
221 return 1;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
222 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
223
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
224 /*******************************************************************\
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
225 Alternate interface to make up for shortcomings in the original,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
226 namely, the omission of the screen origin. The new interface is
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
227 in the "Xinerama" namespace instead of "PanoramiX".
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
228 \*******************************************************************/
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
229
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
230 Bool SDL_NAME(XineramaQueryExtension) (
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
231 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
232 int *event_base,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
233 int *error_base
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
234 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
235 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
236 return SDL_NAME(XPanoramiXQueryExtension)(dpy, event_base, error_base);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
237 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
238
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
239 Status SDL_NAME(XineramaQueryVersion)(
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
240 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
241 int *major,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
242 int *minor
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
243 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
244 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
245 return SDL_NAME(XPanoramiXQueryVersion)(dpy, major, minor);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
246 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
247
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
248 Bool SDL_NAME(XineramaIsActive)(Display *dpy)
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
249 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
250 xXineramaIsActiveReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
251 xXineramaIsActiveReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
252 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
253
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
254 if(!XextHasExtension(info))
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
255 return False; /* server doesn't even have the extension */
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
256
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
257 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
258 GetReq (XineramaIsActive, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
259 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
260 req->panoramiXReqType = X_XineramaIsActive;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
261 if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
262 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
263 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
264 return False;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
265 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
266 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
267 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
268 return rep.state;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
269 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
270
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
271 #include <stdio.h>
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
272
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
273 SDL_NAME(XineramaScreenInfo) *
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
274 SDL_NAME(XineramaQueryScreens)(
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
275 Display *dpy,
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
276 int *number
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
277 )
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
278 {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
279 XExtDisplayInfo *info = find_display (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
280 xXineramaQueryScreensReply rep;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
281 xXineramaQueryScreensReq *req;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
282 SDL_NAME(XineramaScreenInfo) *scrnInfo = NULL;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
283
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
284 PanoramiXCheckExtension (dpy, info, 0);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
285
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
286 LockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
287 GetReq (XineramaQueryScreens, req);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
288 req->reqType = info->codes->major_opcode;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
289 req->panoramiXReqType = X_XineramaQueryScreens;
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
290 if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
291 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
292 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
293 return NULL;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
294 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
295
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
296 if(rep.number) {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
297 if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) {
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
298 xXineramaScreenInfo scratch;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
299 int i;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
300
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
301 for(i = 0; i < rep.number; i++) {
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
302 _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
303 scrnInfo[i].screen_number = i;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
304 scrnInfo[i].x_org = scratch.x_org;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
305 scrnInfo[i].y_org = scratch.y_org;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
306 scrnInfo[i].width = scratch.width;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
307 scrnInfo[i].height = scratch.height;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
308 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
309
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
310 *number = rep.number;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
311 } else
1575
3ba88cb7eb1b Updated dynamic X11 code. See details in Bugzilla #170.
Ryan C. Gordon <icculus@icculus.org>
parents: 1384
diff changeset
312 _XEatData(dpy, rep.length << 2);
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
313 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
314
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
315 UnlockDisplay (dpy);
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
316 SyncHandle ();
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
317 return scrnInfo;
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
318 }
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
319
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
320
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
321