[Xorg-commit] xc/lib/Xinerama Xinerama.c,1.1.4.1,1.1.4.2

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Mon Dec 29 15:39:00 EET 2003


Committed by: kaleb

Update of /cvs/xorg/xc/lib/Xinerama
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/lib/Xinerama

Modified Files:
      Tag: XORG-CURRENT
	Xinerama.c 
Log Message:
Add BC (backwards compat) to the old (pre-Standard) Xinerama ABI/API.
I didn't go "all the way back" to the XPanoramiX API. Does anyone think
that's interesting?


Index: Xinerama.c
===================================================================
RCS file: /cvs/xorg/xc/lib/Xinerama/Xinerama.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- Xinerama.c	18 Dec 2003 19:29:12 -0000	1.1.4.1
+++ Xinerama.c	29 Dec 2003 13:38:58 -0000	1.1.4.2
@@ -152,6 +152,12 @@
     return active;
 }
 
+#ifndef XNOXINERAMABC
+Bool XineramaIsActive(Display *dpy)
+{
+    return XineramaActive(dpy, DefaultRootWindow(dpy));
+}
+#endif
 
 
 Status XineramaGetData(
@@ -208,6 +214,31 @@
     return result;
 }
 
+#ifndef XNOXINERAMABC
+XineramaScreenInfo *XineramaQueryScreens(Display *dpy, int *number)
+{
+    XRectangle *screens = NULL;
+    if (XineramaGetData(dpy, DefaultRootWindow(dpy), &screens, number)) {
+	if (*number) {
+	    XineramaScreenInfo *scrnInfo = NULL;
+	    if ((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * *number))) {
+		int i;
+		for (i = 0; i < *number; i++) {
+		    scrnInfo[i].screen_number = i;
+		    scrnInfo[i].x_org = screens[i].x;
+		    scrnInfo[i].y_org = screens[i].y;
+		    scrnInfo[i].width = screens[i].width;
+		    scrnInfo[i].height = screens[i].height;
+		}
+		XFree(screens);
+		return scrnInfo;
+	    }
+	}
+    }
+    return NULL;
+}
+#endif
+
 #define HINT_NAME "XINERAMA_CENTER_HINT"
 #define HINT_TYPE "INTEGER"
 





More information about the xorg-commit mailing list