-Jim Gettys, Compaq and Hewlett-Packard, and Keith Packard,
+Jim Gettys, Compaq and Hewlett-Packard, and Keith Packard,
SuSE and Hewlett-Packard
-Copyright © 2000, Compaq Computer Corporation,
+Copyright © 2000, Compaq Computer Corporation,
Copyright © 2002, Hewlett Packard, Inc.
Permission to use, copy, modify, distribute, and sell this software and its
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Copyright © 2000 Compaq Computer Corporation, Inc.
-#
+#
# Copyright © 2003 Keith Packard, Noah Levitt
-#
+#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
-#
+#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-SUBDIRS = src man
+SUBDIRS = src man
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xrandr.pc
--- /dev/null
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+#$srcdir/configure --enable-maintainer-mode "$@"
# digit in the version number to track changes which don't affect the
# protocol, so Xrandr version l.n.m corresponds to protocol version l.n
#
-AC_INIT([libXrandr], [1.3.2],
+AC_INIT([libXrandr], [1.4.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXrandr])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize libtool
AC_PROG_LIBTOOL
-
+
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
typedef XID RROutput;
typedef XID RRCrtc;
typedef XID RRMode;
+typedef XID RRProvider;
typedef struct {
int width, height;
int state; /* NewValue, Deleted */
} XRROutputPropertyNotifyEvent;
+typedef struct {
+ int type; /* event base */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window which selected for this event */
+ int subtype; /* RRNotify_ProviderChange */
+ RRProvider provider; /* current provider (or None) */
+ Time timestamp; /* time of change */
+ unsigned int current_role;
+} XRRProviderChangeNotifyEvent;
+
+typedef struct {
+ int type; /* event base */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window which selected for this event */
+ int subtype; /* RRNotify_ProviderProperty */
+ RRProvider provider; /* related provider */
+ Atom property; /* changed property */
+ Time timestamp; /* time of change */
+ int state; /* NewValue, Deleted */
+} XRRProviderPropertyNotifyEvent;
+
+typedef struct {
+ int type; /* event base */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window which selected for this event */
+ int subtype; /* RRNotify_ResourceChange */
+ Time timestamp; /* time of change */
+} XRRResourceChangeNotifyEvent;
+
/* internal representation is private to the library */
-typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
+typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
Bool XRRQueryExtension (Display *dpy,
int *event_base_return,
XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
Window window);
-
+
void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config);
-/*
+/*
* Note that screen configuration changes are only permitted if the client can
* prove it has up to date configuration information. We are trying to
* insist that it become possible for screens to change dynamically, so
* we want to ensure the client knows what it is talking about when requesting
* changes.
*/
-Status XRRSetScreenConfig (Display *dpy,
+Status XRRSetScreenConfig (Display *dpy,
XRRScreenConfiguration *config,
Drawable draw,
int size_index,
Time timestamp);
/* added in v1.1, sorry for the lame name */
-Status XRRSetScreenConfigAndRate (Display *dpy,
+Status XRRSetScreenConfigAndRate (Display *dpy,
XRRScreenConfiguration *config,
Drawable draw,
int size_index,
short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates);
-SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
+SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
Rotation *rotation);
-
+
short XRRConfigCurrentRate (XRRScreenConfiguration *config);
int XRRRootToScreen(Display *dpy, Window root);
-/*
+/*
* returns the screen configuration for the specified screen; does a lazy
* evalution to delay getting the information, and caches the result.
* These routines should be used in preference to XRRGetScreenInfo
void XRRSelectInput(Display *dpy, Window window, int mask);
-/*
- * the following are always safe to call, even if RandR is not implemented
- * on a screen
+/*
+ * the following are always safe to call, even if RandR is not implemented
+ * on a screen
*/
int nmode;
XRRModeInfo *modes;
} XRRScreenResources;
-
+
XRRScreenResources *
XRRGetScreenResources (Display *dpy, Window window);
XRRConfigureOutputProperty (Display *dpy, RROutput output, Atom property,
Bool pending, Bool range, int num_values,
long *values);
-
+
void
XRRChangeOutputProperty (Display *dpy, RROutput output,
Atom property, Atom type,
void
XRRFreeModeInfo (XRRModeInfo *modeInfo);
-
+
typedef struct _XRRCrtcInfo {
Time timestamp;
int x, y;
void
XRRSetCrtcTransform (Display *dpy,
- RRCrtc crtc,
+ RRCrtc crtc,
XTransform *transform,
char *filter,
XFixed *params,
XRRCrtcTransformAttributes **attributes);
/*
- * intended to take RRScreenChangeNotify, or
+ * intended to take RRScreenChangeNotify, or
* ConfigureNotify (on the root window)
* returns 1 if it is an event type it understands, 0 if not
*/
XRRGetOutputPrimary(Display *dpy,
Window window);
+typedef struct _XRRProviderResources {
+ Time timestamp;
+ int nproviders;
+ RRProvider *providers;
+} XRRProviderResources;
+
+XRRProviderResources *
+XRRGetProviderResources(Display *dpy, Window window);
+
+void
+XRRFreeProviderResources(XRRProviderResources *resources);
+
+typedef struct _XRRProviderInfo {
+ unsigned int capabilities;
+ int ncrtcs;
+ RRCrtc *crtcs;
+ int noutputs;
+ RROutput *outputs;
+ char *name;
+ int nassociatedproviders;
+ RRProvider *associated_providers;
+ unsigned int *associated_capability;
+ int nameLen;
+} XRRProviderInfo;
+
+XRRProviderInfo *
+XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider);
+
+void
+XRRFreeProviderInfo(XRRProviderInfo *provider);
+
+int
+XRRSetProviderOutputSource(Display *dpy, XID provider, XID source_provider);
+
+int
+XRRSetProviderOffloadSink(Display *dpy, XID provider, XID sink_provider);
+
+Atom *
+XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop);
+
+XRRPropertyInfo *
+XRRQueryProviderProperty (Display *dpy, RRProvider provider, Atom property);
+
+void
+XRRConfigureProviderProperty (Display *dpy, RRProvider provider, Atom property,
+ Bool pending, Bool range, int num_values,
+ long *values);
+
+void
+XRRChangeProviderProperty (Display *dpy, RRProvider provider,
+ Atom property, Atom type,
+ int format, int mode,
+ _Xconst unsigned char *data, int nelements);
+
+void
+XRRDeleteProviderProperty (Display *dpy, RRProvider provider, Atom property);
+
+int
+XRRGetProviderProperty (Display *dpy, RRProvider provider,
+ Atom property, long offset, long length,
+ Bool _delete, Bool pending, Atom req_type,
+ Atom *actual_type, int *actual_format,
+ unsigned long *nitems, unsigned long *bytes_after,
+ unsigned char **prop);
+
_XFUNCPROTOEND
#endif /* _XRANDR_H_ */
Summary: X.Org X11 libXrandr runtime library
Name: libXrandr
-Version: 1.3.1
+Version: 1.4.0
Release: 3
License: MIT
Group: System Environment/Libraries
XrrMode.c \
XrrOutput.c \
XrrProperty.c \
- XrrScreen.c
+ XrrScreen.c \
+ XrrProvider.c \
+ XrrProviderProperty.c
libXrandr_la_LIBADD = @RANDR_LIBS@
libXrandr_la_LDFLAGS = -version-number 2:2:0 -no-undefined
libXrandrincludedir = $(includedir)/X11/extensions
-libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h
+libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Jim Gettys, HP Labs, HP.
aevent->state = awire->state;
return True;
}
-
+ case RRNotify_ProviderChange: {
+ XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event;
+ xRRProviderChangeNotifyEvent *awire = (xRRProviderChangeNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
+ aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
+ aevent->provider = awire->provider;
+ aevent->timestamp = awire->timestamp;
+ return True;
+ }
+ case RRNotify_ProviderProperty: {
+ XRRProviderPropertyNotifyEvent *aevent = (XRRProviderPropertyNotifyEvent *) event;
+ xRRProviderPropertyNotifyEvent *awire = (xRRProviderPropertyNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
+ aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
+ aevent->provider = awire->provider;
+ aevent->property = awire->atom;
+ aevent->timestamp = awire->timestamp;
+ aevent->state = awire->state;
+ return True;
+ }
+ case RRNotify_ResourceChange: {
+ XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event;
+ xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
+ aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
+ aevent->timestamp = awire->timestamp;
+ return True;
+ }
break;
}
}
awire->state = aevent->state;
return True;
}
+ case RRNotify_ProviderChange: {
+ xRRProviderChangeNotifyEvent *awire = (xRRProviderChangeNotifyEvent *) wire;
+ XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event;
+ awire->window = aevent->window;
+ awire->provider = aevent->provider;
+ return True;
+ }
+ case RRNotify_ProviderProperty: {
+ xRRProviderPropertyNotifyEvent *awire = (xRRProviderPropertyNotifyEvent *) wire;
+ XRRProviderPropertyNotifyEvent *aevent = (XRRProviderPropertyNotifyEvent *) event;
+ awire->window = aevent->window;
+ awire->provider = aevent->provider;
+ awire->atom = aevent->property;
+ awire->timestamp = aevent->timestamp;
+ awire->state = aevent->state;
+ return True;
+ }
+ case RRNotify_ResourceChange: {
+ xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire;
+ XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event;
+ awire->window = aevent->window;
+ awire->timestamp = aevent->timestamp;
+ return True;
+ }
}
}
}
dpyinfo = XextFindDisplay (&XRRExtensionInfo, dpy);
if (!dpyinfo) {
- dpyinfo = XextAddDisplay (&XRRExtensionInfo, dpy,
+ dpyinfo = XextAddDisplay (&XRRExtensionInfo, dpy,
XRRExtensionName,
&rr_extension_hooks,
RRNumberEvents, NULL);
numscreens = ScreenCount(dpy);
- xrri = Xmalloc (sizeof(XRandRInfo) +
+ xrri = Xmalloc (sizeof(XRandRInfo) +
sizeof(char *) * numscreens);
xrri->config = (XRRScreenConfiguration **)(xrri + 1);
- for(i = 0; i < numscreens; i++)
+ for(i = 0; i < numscreens; i++)
xrri->config[i] = NULL;
xrri->major_version = -1;
dpyinfo->data = (char *) xrri;
xrri = (XRandRInfo *) info->data;
- /*
+ /*
* only get the version information from the server if we don't have it already
*/
if (xrri->major_version == -1) {
return True;
}
-/*
+/*
* in protocol version 0.1, routine added to allow selecting for new events.
*/
switch (event->type - info->codes->first_event) {
case RRScreenChangeNotify:
scevent = (XRRScreenChangeNotifyEvent *) event;
- snum = XRRRootToScreen(dpy,
+ snum = XRRRootToScreen(dpy,
((XRRScreenChangeNotifyEvent *) event)->root);
if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
dpy->screens[snum].width = scevent->height;
return 0;
}
xrri = (XRandRInfo *) info->data;
- /*
- * so the next time someone wants some data, it will be fetched;
- * it might be better to force the round trip immediately, but
+ /*
+ * so the next time someone wants some data, it will be fetched;
+ * it might be better to force the round trip immediately, but
* I dislike pounding the server simultaneously when not necessary
*/
if (xrri->config[snum] != NULL) {
/*
- * Copyright © 2000, Compaq Computer Corporation,
+ * Copyright © 2000, Compaq Computer Corporation,
* Copyright © 2002, Hewlett Packard, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
XExtDisplayInfo *XRRFindDisplay (Display *dpy);
-/* deliberately opaque internal data structure; can be extended,
+/* deliberately opaque internal data structure; can be extended,
but not reordered */
struct _XRRScreenConfiguration {
Screen *screen; /* the root window in GetScreenInfo */
* when next used. Returns invalid status if not an event type
* the library routine understand.
*/
-
+
/* we cache one screen configuration/screen */
typedef struct _XRandRInfo {
}
-SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
+SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
Rotation *rotation)
{
*rotation = (Rotation) config->current_rotation;
return config->current_rate;
}
-/*
- * Go get the screen configuration data and salt it away for future use;
+/*
+ * Go get the screen configuration data and salt it away for future use;
* returns NULL if extension not supported
*/
-static XRRScreenConfiguration *_XRRValidateCache (Display *dpy,
+static XRRScreenConfiguration *_XRRValidateCache (Display *dpy,
XExtDisplayInfo *info,
int screen)
{
/* given a screen, return the information from the (possibly) cached data */
XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes)
{
- XRRScreenConfiguration *config;
+ XRRScreenConfiguration *config;
XExtDisplayInfo *info = XRRFindDisplay(dpy);
XRRScreenSize *sizes;
UnlockDisplay(dpy);
*nsizes = 0;
return NULL;
- }
+ }
}
short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates)
{
- XRRScreenConfiguration *config;
+ XRRScreenConfiguration *config;
XExtDisplayInfo *info = XRRFindDisplay(dpy);
short *rates;
UnlockDisplay(dpy);
*nrates = 0;
return NULL;
- }
+ }
}
/* given a screen, return the information from the (possibly) cached data */
Time XRRTimes (Display *dpy, int screen, Time *config_timestamp)
{
- XRRScreenConfiguration *config;
+ XRRScreenConfiguration *config;
XExtDisplayInfo *info = XRRFindDisplay(dpy);
Time ts;
vreq->randrReqType = X_RRQueryVersion;
vreq->majorVersion = RANDR_MAJOR;
vreq->minorVersion = RANDR_MINOR;
-
+
async_state.version_seq = dpy->request;
async_state.error = False;
async.next = dpy->async_handlers;
rep.rate = 0;
rep.nrateEnts = 0;
}
-
+
nbytes = (long) rep.length << 2;
nbytesRead = (long) (rep.nSizes * SIZEOF (xScreenSizes) +
((rep.nrateEnts + 1)& ~1) * 2 /* SIZEOF (CARD16) */);
-
- /*
- * first we must compute how much space to allocate for
+
+ /*
+ * first we must compute how much space to allocate for
* randr library's use; we'll allocate the structures in a single
* allocation, on cleanlyness grounds.
*/
rates = (short *) (ssp + rep.nSizes);
/* set up the screen configuration structure */
- scp->screen =
+ scp->screen =
ScreenOfDisplay (dpy, XRRRootToScreen(dpy, rep.root));
scp->sizes = ssp;
*/
for (i = 0; i < rep.nSizes; i++) {
_XReadPad (dpy, (char *) &size, SIZEOF (xScreenSizes));
-
+
ssp[i].width = size.widthInPixels;
ssp[i].height = size.heightInPixels;
ssp[i].mwidth = size.widthInMillimeters;
* And the rates
*/
_XRead16Pad (dpy, rates, 2 /* SIZEOF (CARD16) */ * rep.nrateEnts);
-
+
/*
* Skip any extra data
*/
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
-
+
return (XRRScreenConfiguration *)(scp);
}
return config;
}
-
+
void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config)
{
Xfree (config);
XRRScreenConfiguration *config,
Drawable draw,
int size_index,
- Rotation rotation,
+ Rotation rotation,
short rate,
Time timestamp)
{
/* Make sure has_rates is set */
if (!XRRQueryVersion (dpy, &major, &minor))
return 0;
-
+
LockDisplay (dpy);
xrri = (XRandRInfo *) info->data;
if (xrri->has_rates)
req->timestamp = timestamp;
req->configTimestamp = config->config_timestamp;
}
-
+
(void) _XReply (dpy, (xReply *) &rep, 0, xTrue);
/* actually .errorCode in struct xError */
nbytesRead = (long) (rep.nOutput * 4 +
rep.nPossibleOutput * 4);
- /*
- * first we must compute how much space to allocate for
+ /*
+ * first we must compute how much space to allocate for
* randr library's use; we'll allocate the structures in a single
* allocation, on cleanlyness grounds.
*/
_XRead32 (dpy, xci->outputs, rep.nOutput << 2);
_XRead32 (dpy, xci->possible, rep.nPossibleOutput << 2);
-
+
/*
* Skip any extra data
*/
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
-
+
UnlockDisplay (dpy);
SyncHandle ();
return (XRRCrtcInfo *) xci;
goto out;
nbytes = (long) rep.length << 2;
-
+
/* three channels of CARD16 data */
nbytesRead = (rep.size * 2 * 3);
crtc_gamma = XRRAllocGamma (rep.size);
-
+
if (!crtc_gamma)
{
_XEatData (dpy, (unsigned long) nbytes);
_XRead16 (dpy, crtc_gamma->red, rep.size * 2);
_XRead16 (dpy, crtc_gamma->green, rep.size * 2);
_XRead16 (dpy, crtc_gamma->blue, rep.size * 2);
-
+
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
* otherwise the channels might not be contiguous
*/
Data16 (dpy, crtc_gamma->red, crtc_gamma->size * 2 * 3);
-
+
UnlockDisplay (dpy);
SyncHandle ();
}
void
XRRSetCrtcTransform (Display *dpy,
- RRCrtc crtc,
+ RRCrtc crtc,
XTransform *transform,
char *filter,
XFixed *params,
}
#define CrtcTransformExtra (SIZEOF(xRRGetCrtcTransformReply) - 32)
-
+
static const xRenderTransform identity = {
0x10000, 0, 0,
0, 0x10000, 0,
RRCheckExtension (dpy, info, False);
- if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
+ if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
!_XRRHasTransform (major_version, minor_version))
{
/* For pre-1.3 servers, just report identity matrices everywhere */
req->reqType = info->codes->major_opcode;
req->randrReqType = X_RRGetCrtcTransform;
req->crtc = crtc;
-
+
if (!_XReply (dpy, (xReply *) &rep, CrtcTransformExtra >> 2, xFalse))
{
rep.pendingTransform = identity;
req->reqType = info->codes->major_opcode;
req->randrReqType = X_RRCreateMode;
req->length += (mode_info->nameLength + 3) >> 2;
-
+
req->window = window;
-
+
req->modeInfo.id = 0;
req->modeInfo.width = mode_info->width;
req->modeInfo.height = mode_info->height;
req->modeInfo.vTotal = mode_info->vTotal;
req->modeInfo.nameLength = mode_info->nameLength;
req->modeInfo.modeFlags = mode_info->modeFlags;
-
+
Data (dpy, mode_info->name, mode_info->nameLength);
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
{
SyncHandle ();
return None;
}
-
+
UnlockDisplay (dpy);
SyncHandle ();
return rep.mode;
#include "Xrandrint.h"
#define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32)
-
+
XRROutputInfo *
XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
{
rep.nClones * 4 +
((rep.nameLength + 3) & ~3));
- /*
- * first we must compute how much space to allocate for
+ /*
+ * first we must compute how much space to allocate for
* randr library's use; we'll allocate the structures in a single
* allocation, on cleanlyness grounds.
*/
_XRead32 (dpy, xoi->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, xoi->modes, rep.nModes << 2);
_XRead32 (dpy, xoi->clones, rep.nClones << 2);
-
+
/*
* Read name and '\0' terminate
*/
_XReadPad (dpy, xoi->name, rep.nameLength);
xoi->name[rep.nameLength] = '\0';
-
+ xoi->nameLen = rep.nameLength;
+
/*
* Skip any extra data
*/
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
-
+
UnlockDisplay (dpy);
SyncHandle ();
return (XRROutputInfo *) xoi;
RRSimpleCheckExtension (dpy, info);
- if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
+ if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
!_XRRHasOutputPrimary (major_version, minor_version))
return;
RRCheckExtension (dpy, info, 0);
- if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
+ if (!XRRQueryVersion (dpy, &major_version, &minor_version) ||
!_XRRHasOutputPrimary (major_version, minor_version))
return None;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
rep.output = None;
-
+
UnlockDisplay(dpy);
SyncHandle();
UnlockDisplay(dpy);
SyncHandle();
}
-
+
void
XRRChangeOutputProperty (Display *dpy, RROutput output,
Atom property, Atom type,
int
XRRGetOutputProperty (Display *dpy, RROutput output,
Atom property, long offset, long length,
- Bool delete, Bool pending, Atom req_type,
+ Bool delete, Bool pending, Atom req_type,
Atom *actual_type, int *actual_format,
unsigned long *nitems, unsigned long *bytes_after,
unsigned char **prop)
--- /dev/null
+/*
+ * Copyright © 2011 Dave Airlie
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+/* we need to be able to manipulate the Display structure on events */
+#include <X11/Xlibint.h>
+#include <X11/extensions/render.h>
+#include <X11/extensions/Xrender.h>
+#include "Xrandrint.h"
+
+XRRProviderResources *
+XRRGetProviderResources(Display *dpy, Window window)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRGetProvidersReply rep;
+ xRRGetProvidersReq *req;
+ XRRProviderResources *xrpr;
+ long nbytes, nbytesRead;
+ int rbytes;
+
+ RRCheckExtension (dpy, info, NULL);
+
+ LockDisplay (dpy);
+
+ GetReq(RRGetProviders, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRGetProviders;
+ req->window = window;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
+ {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ nbytes = (long) rep.length << 2;
+
+ nbytesRead = (long) (rep.nProviders * 4);
+
+ rbytes = (sizeof(XRRProviderResources) + rep.nProviders * sizeof(RRProvider));
+ xrpr = (XRRProviderResources *) Xmalloc(rbytes);
+
+ if (xrpr == NULL) {
+ _XEatData (dpy, (unsigned long) nbytes);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ xrpr->timestamp = rep.timestamp;
+ xrpr->nproviders = rep.nProviders;
+ xrpr->providers = (RRProvider *)(xrpr + 1);
+
+ _XRead32(dpy, xrpr->providers, rep.nProviders << 2);
+
+ if (nbytes > nbytesRead)
+ _XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
+
+
+ UnlockDisplay (dpy);
+ SyncHandle();
+
+ return (XRRProviderResources *) xrpr;
+}
+
+void
+XRRFreeProviderResources(XRRProviderResources *provider_resources)
+{
+ free(provider_resources);
+}
+
+#define ProviderInfoExtra (SIZEOF(xRRGetProviderInfoReply) - 32)
+XRRProviderInfo *
+XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRGetProviderInfoReply rep;
+ xRRGetProviderInfoReq *req;
+ int nbytes, nbytesRead, rbytes;
+ XRRProviderInfo *xpi;
+
+ RRCheckExtension (dpy, info, NULL);
+
+ LockDisplay (dpy);
+ GetReq (RRGetProviderInfo, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRGetProviderInfo;
+ req->provider = provider;
+ req->configTimestamp = resources->configTimestamp;
+
+ if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse))
+ {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ nbytes = ((long) rep.length << 2) - ProviderInfoExtra;
+
+ nbytesRead = (long)(rep.nCrtcs * 4 +
+ rep.nOutputs * 4 +
+ rep.nAssociatedProviders * 8 +
+ ((rep.nameLength + 3) & ~3));
+
+ rbytes = (sizeof(XRRProviderInfo) +
+ rep.nCrtcs * sizeof(RRCrtc) +
+ rep.nOutputs * sizeof(RROutput) +
+ rep.nAssociatedProviders * (sizeof(RRProvider) + sizeof(unsigned int))+
+ rep.nameLength + 1);
+
+ xpi = (XRRProviderInfo *)Xmalloc(rbytes);
+ if (xpi == NULL) {
+ _XEatData (dpy, (unsigned long) nbytes);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ xpi->capabilities = rep.capabilities;
+ xpi->ncrtcs = rep.nCrtcs;
+ xpi->noutputs = rep.nOutputs;
+ xpi->nassociatedproviders = rep.nAssociatedProviders;
+ xpi->crtcs = (RRCrtc *)(xpi + 1);
+ xpi->outputs = (RROutput *)(xpi->crtcs + rep.nCrtcs);
+ xpi->associated_providers = (RRProvider *)(xpi->outputs + rep.nOutputs);
+ xpi->associated_capability = (unsigned int *)(xpi->associated_providers + rep.nAssociatedProviders);
+ xpi->name = (char *)(xpi->associated_capability + rep.nAssociatedProviders);
+
+ _XRead32(dpy, xpi->crtcs, rep.nCrtcs << 2);
+ _XRead32(dpy, xpi->outputs, rep.nOutputs << 2);
+
+ _XRead32(dpy, xpi->associated_providers, rep.nAssociatedProviders << 2);
+ _XRead32(dpy, xpi->associated_capability, rep.nAssociatedProviders << 2);
+
+ _XReadPad(dpy, xpi->name, rep.nameLength);
+ xpi->name[rep.nameLength] = '\0';
+
+ /*
+ * Skip any extra data
+ */
+ if (nbytes > nbytesRead)
+ _XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return (XRRProviderInfo *) xpi;
+}
+
+void
+XRRFreeProviderInfo(XRRProviderInfo *provider)
+{
+ free(provider);
+}
+
+int
+XRRSetProviderOutputSource(Display *dpy, XID provider,
+ XID source_provider)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRSetProviderOutputSourceReq *req;
+
+ RRCheckExtension (dpy, info, 0);
+ LockDisplay (dpy);
+ GetReq (RRSetProviderOutputSource, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRSetProviderOutputSource;
+ req->provider = provider;
+ req->source_provider = source_provider;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+}
+
+int
+XRRSetProviderOffloadSink(Display *dpy, XID provider,
+ XID sink_provider)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRSetProviderOffloadSinkReq *req;
+
+ RRCheckExtension (dpy, info, 0);
+ LockDisplay (dpy);
+ GetReq (RRSetProviderOffloadSink, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRSetProviderOffloadSink;
+ req->provider = provider;
+ req->sink_provider = sink_provider;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+/* we need to be able to manipulate the Display structure on events */
+#include <X11/Xlibint.h>
+#include <X11/extensions/render.h>
+#include <X11/extensions/Xrender.h>
+#include "Xrandrint.h"
+
+Atom *
+XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRListProviderPropertiesReply rep;
+ xRRListProviderPropertiesReq *req;
+ int nbytes, rbytes;
+ Atom *props = NULL;
+
+ RRCheckExtension (dpy, info, NULL);
+
+ LockDisplay (dpy);
+ GetReq (RRListProviderProperties, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRListProviderProperties;
+ req->provider = provider;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ *nprop = 0;
+ return NULL;
+ }
+
+ if (rep.nAtoms) {
+ rbytes = rep.nAtoms * sizeof (Atom);
+ nbytes = rep.nAtoms << 2;
+
+ props = (Atom *) Xmalloc (rbytes);
+ if (props == NULL) {
+ _XEatData (dpy, nbytes);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ *nprop = 0;
+ return NULL;
+ }
+
+ _XRead32 (dpy, props, nbytes);
+ }
+
+ *nprop = rep.nAtoms;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return props;
+}
+
+XRRPropertyInfo *
+XRRQueryProviderProperty (Display *dpy, RRProvider provider, Atom property)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRQueryProviderPropertyReply rep;
+ xRRQueryProviderPropertyReq *req;
+ int rbytes, nbytes;
+ XRRPropertyInfo *prop_info;
+
+ RRCheckExtension (dpy, info, NULL);
+
+ LockDisplay (dpy);
+ GetReq (RRQueryProviderProperty, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRQueryProviderProperty;
+ req->provider = provider;
+ req->property = property;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long);
+ nbytes = rep.length << 2;
+
+ prop_info = (XRRPropertyInfo *) Xmalloc (rbytes);
+ if (prop_info == NULL) {
+ _XEatData (dpy, nbytes);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ prop_info->pending = rep.pending;
+ prop_info->range = rep.range;
+ prop_info->immutable = rep.immutable;
+ prop_info->num_values = rep.length;
+ if (rep.length != 0) {
+ prop_info->values = (long *) (prop_info + 1);
+ _XRead32 (dpy, prop_info->values, nbytes);
+ } else {
+ prop_info->values = NULL;
+ }
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return prop_info;
+}
+
+void
+XRRConfigureProviderProperty (Display *dpy, RRProvider provider, Atom property,
+ Bool pending, Bool range, int num_values,
+ long *values)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRConfigureProviderPropertyReq *req;
+ long len;
+
+ RRSimpleCheckExtension (dpy, info);
+
+ LockDisplay(dpy);
+ GetReq (RRConfigureProviderProperty, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRConfigureProviderProperty;
+ req->provider = provider;
+ req->property = property;
+ req->pending = pending;
+ req->range = range;
+
+ len = num_values;
+ if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
+ SetReqLen(req, len, len);
+ len = (long)num_values << 2;
+ Data32 (dpy, values, len);
+ } /* else force BadLength */
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void
+XRRChangeProviderProperty (Display *dpy, RRProvider provider,
+ Atom property, Atom type,
+ int format, int mode,
+ _Xconst unsigned char *data, int nelements)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRChangeProviderPropertyReq *req;
+ long len;
+
+ RRSimpleCheckExtension (dpy, info);
+
+ LockDisplay(dpy);
+ GetReq (RRChangeProviderProperty, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRChangeProviderProperty;
+ req->provider = provider;
+ req->property = property;
+ req->type = type;
+ req->mode = mode;
+ if (nelements < 0) {
+ req->nUnits = 0;
+ req->format = 0; /* ask for garbage, get garbage */
+ } else {
+ req->nUnits = nelements;
+ req->format = format;
+ }
+
+ switch (req->format) {
+ case 8:
+ len = ((long)nelements + 3) >> 2;
+ if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
+ SetReqLen(req, len, len);
+ Data (dpy, (char *)data, nelements);
+ } /* else force BadLength */
+ break;
+
+ case 16:
+ len = ((long)nelements + 1) >> 1;
+ if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
+ SetReqLen(req, len, len);
+ len = (long)nelements << 1;
+ Data16 (dpy, (short *) data, len);
+ } /* else force BadLength */
+ break;
+
+ case 32:
+ len = nelements;
+ if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) {
+ SetReqLen(req, len, len);
+ len = (long)nelements << 2;
+ Data32 (dpy, (long *) data, len);
+ } /* else force BadLength */
+ break;
+
+ default:
+ /* BadValue will be generated */ ;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void
+XRRDeleteProviderProperty (Display *dpy, RRProvider provider, Atom property)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRDeleteProviderPropertyReq *req;
+
+ RRSimpleCheckExtension (dpy, info);
+
+ LockDisplay(dpy);
+ GetReq(RRDeleteProviderProperty, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRDeleteProviderProperty;
+ req->provider = provider;
+ req->property = property;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+int
+XRRGetProviderProperty (Display *dpy, RRProvider provider,
+ Atom property, long offset, long length,
+ Bool delete, Bool pending, Atom req_type,
+ Atom *actual_type, int *actual_format,
+ unsigned long *nitems, unsigned long *bytes_after,
+ unsigned char **prop)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRGetProviderPropertyReply rep;
+ xRRGetProviderPropertyReq *req;
+ long nbytes, rbytes;
+
+ RRCheckExtension (dpy, info, 1);
+
+ LockDisplay (dpy);
+ GetReq (RRGetProviderProperty, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRGetProviderProperty;
+ req->provider = provider;
+ req->property = property;
+ req->type = req_type;
+ req->longOffset = offset;
+ req->longLength = length;
+ req->delete = delete;
+ req->pending = pending;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
+ {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return ((xError *)&rep)->errorCode;
+ }
+
+ *prop = (unsigned char *) NULL;
+ if (rep.propertyType != None) {
+ /*
+ * One extra byte is malloced than is needed to contain the property
+ * data, but this last byte is null terminated and convenient for
+ * returning string properties, so the client doesn't then have to
+ * recopy the string to make it null terminated.
+ */
+ switch (rep.format) {
+ case 8:
+ nbytes = rep.nItems;
+ rbytes = rep.nItems + 1;
+ if (rbytes > 0 &&
+ (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+ _XReadPad (dpy, (char *) *prop, nbytes);
+ break;
+
+ case 16:
+ nbytes = rep.nItems << 1;
+ rbytes = rep.nItems * sizeof (short) + 1;
+ if (rbytes > 0 &&
+ (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+ _XRead16Pad (dpy, (short *) *prop, nbytes);
+ break;
+
+ case 32:
+ nbytes = rep.nItems << 2;
+ rbytes = rep.nItems * sizeof (long) + 1;
+ if (rbytes > 0 &&
+ (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+ _XRead32 (dpy, (long *) *prop, nbytes);
+ break;
+
+ default:
+ /*
+ * This part of the code should never be reached. If it is,
+ * the server sent back a property with an invalid format.
+ */
+ nbytes = rep.length << 2;
+ _XEatData(dpy, (unsigned long) nbytes);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return(BadImplementation);
+ }
+ if (! *prop) {
+ _XEatData(dpy, (unsigned long) nbytes);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return(BadAlloc);
+ }
+ (*prop)[rbytes - 1] = '\0';
+ }
+
+ *actual_type = rep.propertyType;
+ *actual_format = rep.format;
+ *nitems = rep.nItems;
+ *bytes_after = rep.bytesAfter;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+ return Success;
+}
vreq->randrReqType = X_RRQueryVersion;
vreq->majorVersion = RANDR_MAJOR;
vreq->minorVersion = RANDR_MINOR;
-
+
async_state.version_seq = dpy->request;
async_state.error = False;
async.next = dpy->async_handlers;
rep.nModes * SIZEOF (xRRModeInfo) +
((rep.nbytesNames + 3) & ~3));
- /*
- * first we must compute how much space to allocate for
+ /*
+ * first we must compute how much space to allocate for
* randr library's use; we'll allocate the structures in a single
* allocation, on cleanlyness grounds.
*/
_XRead32 (dpy, xrsr->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, xrsr->outputs, rep.nOutputs << 2);
-
+
for (i = 0; i < rep.nModes; i++) {
xRRModeInfo modeInfo;
-
+
_XReadPad (dpy, (char *) &modeInfo, SIZEOF (xRRModeInfo));
xrsr->modes[i].id = modeInfo.id;
xrsr->modes[i].width = modeInfo.width;
wire_name += xrsr->modes[i].nameLength;
}
Xfree (wire_names);
-
+
/*
* Skip any extra data
*/
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
-
+
UnlockDisplay (dpy);
SyncHandle();
return (XRRScreenResources *) xrsr;