[PATCH:xscope 24/24] Update RANDR support from 0.x to include 1.0 - 1.4
Alan Coopersmith
alan.coopersmith at oracle.com
Fri Aug 31 22:18:06 PDT 2012
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
decode_randr.c | 465 +++++++++++++++++-
decode_render.c | 33 +-
extensions.h | 3 +
print_randr.c | 1477 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
randrscope.h | 110 ++++-
x11.h | 15 +
6 files changed, 2074 insertions(+), 29 deletions(-)
diff --git a/decode_randr.c b/decode_randr.c
index 7bba005..59ebc7f 100644
--- a/decode_randr.c
+++ b/decode_randr.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -33,6 +34,8 @@
static unsigned char RANDRRequest, RANDRError, RANDREvent;
+#define RANDRNError 4 /* as of RandR 1.4 - 2012-07-03 */
+
static void
randr_decode_req(FD fd, const unsigned char *buf)
{
@@ -40,12 +43,13 @@ randr_decode_req(FD fd, const unsigned char *buf)
short Minor = IByte(&buf[1]);
switch (Minor) {
+/* RandR 0.x & 1.0 requests are intermixed in minor codes 0-5 */
case 0:
RandrQueryVersion(fd, buf);
ExtendedReplyExpected(fd, Major, Minor);
break;
case 1:
- RandrGetScreenInfo(fd, buf);
+ RandrOldGetScreenInfo(fd, buf);
ExtendedReplyExpected(fd, Major, Minor);
break;
case 2:
@@ -53,7 +57,151 @@ randr_decode_req(FD fd, const unsigned char *buf)
ExtendedReplyExpected(fd, Major, Minor);
break;
case 3:
- RandrScreenChangeSelectInput(fd, buf);
+ RandrOldScreenChangeSelectInput(fd, buf);
+ break;
+ case 4:
+ RandrSelectInput(fd, buf);
+ break;
+ case 5:
+ RandrGetScreenInfo(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+
+/* RandR 1.2 additions */
+ case 6:
+ RandrGetScreenSizeRange(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 7:
+ RandrSetScreenSize(fd, buf);
+ break;
+ case 8:
+ RandrGetScreenResources(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 9:
+ RandrGetOutputInfo(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 10:
+ RandrListOutputProperties(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 11:
+ RandrQueryOutputProperty(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 12:
+ RandrConfigureOutputProperty(fd, buf);
+ break;
+ case 13:
+ RandrChangeOutputProperty(fd, buf);
+ break;
+ case 14:
+ RandrDeleteOutputProperty(fd, buf);
+ break;
+ case 15:
+ RandrGetOutputProperty(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 16:
+ RandrCreateMode(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 17:
+ RandrDestroyMode(fd, buf);
+ break;
+ case 18:
+ RandrAddOutputMode(fd, buf);
+ break;
+ case 19:
+ RandrDeleteOutputMode(fd, buf);
+ break;
+ case 20:
+ RandrGetCrtcInfo(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 21:
+ RandrSetCrtcConfig(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 22:
+ RandrGetCrtcGammaSize(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 23:
+ RandrGetCrtcGamma(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 24:
+ RandrSetCrtcGamma(fd, buf);
+ break;
+
+/* RandR 1.3 additions */
+ case 25:
+ RandrGetScreenResourcesCurrent(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 26:
+ RandrSetCrtcTransform(fd, buf);
+ break;
+ case 27:
+ RandrGetCrtcTransform(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 28:
+ RandrGetPanning(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 29:
+ RandrSetPanning(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 30:
+ RandrSetOutputPrimary(fd, buf);
+ break;
+ case 31:
+ RandrGetOutputPrimary(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+
+/* RandR 1.4 additions */
+ case 32:
+ RandrGetProviders(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 33:
+ RandrGetProviderInfo(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 34:
+ RandrSetProviderOffloadSink(fd, buf);
+ break;
+ case 35:
+ RandrSetProviderOutputSource(fd, buf);
+ break;
+ case 36:
+ RandrListProviderProperties(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 37:
+ RandrQueryProviderProperty(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 38:
+ RandrConfigureProviderProperty(fd, buf);
+ break;
+ case 39:
+ RandrChangeProviderProperty(fd, buf);
+ break;
+ case 40:
+ RandrDeleteProviderProperty(fd, buf);
+ break;
+ case 41:
+ RandrGetProviderProperty(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+
default:
ExtendedRequest(fd, buf);
ExtendedReplyExpected(fd, Major, Minor);
@@ -65,15 +213,89 @@ static void
randr_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
+/* RandR 0.x & 1.0 requests are intermixed in minor codes 0-5 */
case 0:
RandrQueryVersionReply(fd, buf);
break;
case 1:
- RandrGetScreenInfoReply(fd, buf);
+ RandrOldGetScreenInfoReply(fd, buf);
break;
case 2:
RandrSetScreenConfigReply(fd, buf);
break;
+ case 5:
+ RandrGetScreenInfoReply(fd, buf);
+ break;
+
+/* RandR 1.2 additions */
+ case 6:
+ RandrGetScreenSizeRangeReply(fd, buf);
+ break;
+ case 8:
+ RandrGetScreenResourcesReply(fd, buf);
+ break;
+ case 9:
+ RandrGetOutputInfoReply(fd, buf);
+ break;
+ case 10:
+ RandrListOutputPropertiesReply(fd, buf);
+ break;
+ case 11:
+ RandrQueryOutputPropertyReply(fd, buf);
+ break;
+ case 15:
+ RandrGetOutputPropertyReply(fd, buf);
+ break;
+ case 16:
+ RandrCreateModeReply(fd, buf);
+ break;
+ case 20:
+ RandrGetCrtcInfoReply(fd, buf);
+ break;
+ case 21:
+ RandrSetCrtcConfigReply(fd, buf);
+ break;
+ case 22:
+ RandrGetCrtcGammaSizeReply(fd, buf);
+ break;
+ case 23:
+ RandrGetCrtcGammaReply(fd, buf);
+ break;
+
+/* RandR 1.3 additions */
+ case 25:
+ RandrGetScreenResourcesCurrentReply(fd, buf);
+ break;
+ case 27:
+ RandrGetCrtcTransformReply(fd, buf);
+ break;
+ case 28:
+ RandrGetPanningReply(fd, buf);
+ break;
+ case 29:
+ RandrSetPanningReply(fd, buf);
+ break;
+ case 31:
+ RandrGetOutputPrimaryReply(fd, buf);
+ break;
+
+/* RandR 1.4 additions */
+ case 32:
+ RandrGetProvidersReply(fd, buf);
+ break;
+ case 33:
+ RandrGetProviderInfoReply(fd, buf);
+ break;
+ case 36:
+ RandrListProviderPropertiesReply(fd, buf);
+ break;
+ case 37:
+ RandrQueryProviderPropertyReply(fd, buf);
+ break;
+ case 41:
+ RandrGetProviderPropertyReply(fd, buf);
+ break;
+
default:
UnknownReply(buf);
break;
@@ -83,7 +305,71 @@ randr_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
static void
randr_decode_event(FD fd, const unsigned char *buf)
{
- RandrScreenChangeNotifyEvent(buf);
+ short event = IByte(&buf[0]) - RANDREvent;
+
+ switch (event) {
+ case 0:
+ RandrScreenChangeNotifyEvent(buf);
+ break;
+/* RandR 1.2 and later additions share this event code and use sub-codes */
+ case 1:
+ {
+ short minor = IByte(&buf[1]);
+ switch (minor) {
+ case 0:
+ RandrCrtcChangeNotifyEvent(buf);
+ break;
+ case 1:
+ RandrOutputChangeNotifyEvent(buf);
+ break;
+ case 2:
+ RandrOutputPropertyNotifyEvent(buf);
+ break;
+ case 3:
+ RandrProviderChangeNotifyEvent(buf);
+ break;
+ case 4:
+ RandrProviderPropertyNotifyEvent(buf);
+ break;
+ case 5:
+ RandrResourceChangeNotifyEvent(buf);
+ break;
+ default:
+ UnknownEvent(buf);
+ break;
+ }
+ }
+ break;
+ default:
+ UnknownEvent(buf);
+ break;
+ }
+}
+
+static void
+randr_decode_error(FD fd, const unsigned char *buf)
+{
+ short error = IByte(&buf[1]) - RANDRError;
+
+ switch (error) {
+/* RandR 1.2 additions */
+ case 0:
+ RandrOutputError(fd, buf);
+ break;
+ case 1:
+ RandrCrtcError(fd, buf);
+ break;
+ case 2:
+ RandrModeError(fd, buf);
+ break;
+/* RandR 1.4 additions */
+ case 3:
+ RandrProviderError(fd, buf);
+ break;
+ default:
+ UnknownError(buf);
+ break;
+ }
}
void
@@ -99,24 +385,183 @@ InitializeRANDR(const unsigned char *buf)
DefineEValue(&TD[REPLY], (unsigned long) RANDRRequest, "RandrReply");
DefineEValue(&TD[EVENT], (unsigned long) RANDREvent,
"RRScreenChangeNotify");
+ DefineEValue(&TD[EVENT], (unsigned long) RANDREvent + 1, "RandrNotify");
+
+ DefineEValue(&TD[ERROR], (unsigned long) RANDRError + 0, "BadOutput");
+ DefineEValue(&TD[ERROR], (unsigned long) RANDRError + 1, "BadCrtc");
+ DefineEValue(&TD[ERROR], (unsigned long) RANDRError + 2, "BadMode");
+ DefineEValue(&TD[ERROR], (unsigned long) RANDRError + 3, "BadProvider");
+
p = DefineType(RANDRREQUEST, ENUMERATED, "RANDRREQUEST",
(PrintProcType) PrintENUMERATED);
DefineEValue(p, 0L, "RandrQueryVersion");
- DefineEValue(p, 1L, "RandrGetScreenInfo");
+ DefineEValue(p, 1L, "RandrOldGetScreenInfo");
DefineEValue(p, 2L, "RandrSetScreenConfig");
- DefineEValue(p, 3L, "RandrScreenChangeSelectInput");
+ DefineEValue(p, 3L, "RandrOldScreenChangeSelectInput");
+ DefineEValue(p, 4L, "RandrSelectInput");
+ DefineEValue(p, 5L, "RandrGetScreenInfo");
+ DefineEValue(p, 6L, "RandrGetScreenSizeRange");
+ DefineEValue(p, 7L, "RandrSetScreenSize");
+ DefineEValue(p, 8L, "RandrGetScreenResources");
+ DefineEValue(p, 9L, "RandrGetOutputInfo");
+ DefineEValue(p, 10L, "RandrListOutputProperties");
+ DefineEValue(p, 11L, "RandrQueryOutputProperty");
+ DefineEValue(p, 12L, "RandrConfigureOutputProperty");
+ DefineEValue(p, 13L, "RandrChangeOutputProperty");
+ DefineEValue(p, 14L, "RandrDeleteOutputProperty");
+ DefineEValue(p, 15L, "RandrGetOutputProperty");
+ DefineEValue(p, 16L, "RandrCreateMode");
+ DefineEValue(p, 17L, "RandrDestroyMode");
+ DefineEValue(p, 18L, "RandrAddOutputMode");
+ DefineEValue(p, 19L, "RandrDeleteOutputMode");
+ DefineEValue(p, 20L, "RandrGetCrtcInfo");
+ DefineEValue(p, 21L, "RandrSetCrtcConfig");
+ DefineEValue(p, 22L, "RandrGetCrtcGammaSize");
+ DefineEValue(p, 23L, "RandrGetCrtcGamma");
+ DefineEValue(p, 24L, "RandrSetCrtcGamma");
+ DefineEValue(p, 25L, "RandrGetScreenResourcesCurrent");
+ DefineEValue(p, 26L, "RandrSetCrtcTransform");
+ DefineEValue(p, 27L, "RandrGetCrtcTransform");
+ DefineEValue(p, 28L, "RandrGetPanning");
+ DefineEValue(p, 29L, "RandrSetPanning");
+ DefineEValue(p, 30L, "RandrSetOutputPrimary");
+ DefineEValue(p, 31L, "RandrGetOutputPrimary");
+ DefineEValue(p, 32L, "RandrGetProviders");
+ DefineEValue(p, 33L, "RandrGetProviderInfo");
+ DefineEValue(p, 34L, "RandrSetProviderOffloadSink");
+ DefineEValue(p, 35L, "RandrSetProviderOutputSource");
+ DefineEValue(p, 36L, "RandrListProviderProperties");
+ DefineEValue(p, 37L, "RandrQueryProviderProperty");
+ DefineEValue(p, 38L, "RandrConfigureProviderProperty");
+ DefineEValue(p, 39L, "RandrChangeProviderProperty");
+ DefineEValue(p, 40L, "RandrDeleteProviderProperty");
+ DefineEValue(p, 41L, "RandrGetProviderProperty");
p = DefineType(RANDRREPLY, ENUMERATED, "RANDRREPLY",
(PrintProcType) PrintENUMERATED);
DefineEValue(p, 0L, "QueryVersion");
- DefineEValue(p, 1L, "GetScreenInfo");
+ DefineEValue(p, 1L, "OldGetScreenInfo");
DefineEValue(p, 2L, "SetScreenConfig");
+ DefineEValue(p, 3L, "OldScreenChangeSelectInput");
+ DefineEValue(p, 4L, "SelectInput");
+ DefineEValue(p, 5L, "GetScreenInfo");
+ DefineEValue(p, 6L, "GetScreenSizeRange");
+ DefineEValue(p, 7L, "SetScreenSize");
+ DefineEValue(p, 8L, "GetScreenResources");
+ DefineEValue(p, 9L, "GetOutputInfo");
+ DefineEValue(p, 10L, "ListOutputProperties");
+ DefineEValue(p, 11L, "QueryOutputProperty");
+ DefineEValue(p, 12L, "ConfigureOutputProperty");
+ DefineEValue(p, 13L, "ChangeOutputProperty");
+ DefineEValue(p, 14L, "DeleteOutputProperty");
+ DefineEValue(p, 15L, "GetOutputProperty");
+ DefineEValue(p, 16L, "CreateMode");
+ DefineEValue(p, 17L, "DestroyMode");
+ DefineEValue(p, 18L, "AddOutputMode");
+ DefineEValue(p, 19L, "DeleteOutputMode");
+ DefineEValue(p, 20L, "GetCrtcInfo");
+ DefineEValue(p, 21L, "SetCrtcConfig");
+ DefineEValue(p, 22L, "GetCrtcGammaSize");
+ DefineEValue(p, 23L, "GetCrtcGamma");
+ DefineEValue(p, 24L, "SetCrtcGamma");
+ DefineEValue(p, 25L, "GetScreenResourcesCurrent");
+ DefineEValue(p, 26L, "SetCrtcTransform");
+ DefineEValue(p, 27L, "GetCrtcTransform");
+ DefineEValue(p, 28L, "GetPanning");
+ DefineEValue(p, 29L, "SetPanning");
+ DefineEValue(p, 30L, "SetOutputPrimary");
+ DefineEValue(p, 31L, "GetOutputPrimary");
+ DefineEValue(p, 32L, "GetProviders");
+ DefineEValue(p, 33L, "GetProviderInfo");
+ DefineEValue(p, 34L, "SetProviderOffloadSink");
+ DefineEValue(p, 35L, "SetProviderOutputSource");
+ DefineEValue(p, 36L, "ListProviderProperties");
+ DefineEValue(p, 37L, "QueryProviderProperty");
+ DefineEValue(p, 38L, "ConfigureProviderProperty");
+ DefineEValue(p, 39L, "ChangeProviderProperty");
+ DefineEValue(p, 40L, "DeleteProviderProperty");
+ DefineEValue(p, 41L, "GetProviderProperty");
+
+ p = DefineType(RANDREVENT, ENUMERATED, "RANDREVENT",
+ (PrintProcType) PrintENUMERATED);
+ /* V1.2 additions */
+ DefineEValue(p, 0L, "RRCrtcChangeNotify");
+ DefineEValue(p, 1L, "RROutputChangeNotify");
+ DefineEValue(p, 2L, "RROutputPropertyNotify");
+ /* V1.4 additions */
+ DefineEValue(p, 3L, "RRProviderChangeNotify");
+ DefineEValue(p, 4L, "RRProviderPropertyNotify");
+ DefineEValue(p, 5L, "RRResourceChangeNotify");
+
+ p = DefineType(SETofRREVENT, SET, "SETofRREVENT", (PrintProcType) PrintSET);
+ /* Event selection bits */
+ DefineEValue(p, (1L << 0), "ScreenChangeNotifyMask");
+ /* V1.2 additions */
+ DefineEValue(p, (1L << 1), "CrtcChangeNotifyMask");
+ DefineEValue(p, (1L << 2), "OutputChangeNotifyMask");
+ DefineEValue(p, (1L << 3), "OutputPropertyNotifyMask");
+ /* V1.4 additions */
+ DefineEValue(p, (1L << 4), "ProviderChangeNotifyMask");
+ DefineEValue(p, (1L << 5), "ProviderPropertyNotifyMask");
+ DefineEValue(p, (1L << 6), "ResourceChangeNotifyMask");
+
+ p = DefineType(SETofROTATION, SET, "ROTATION", (PrintProcType) PrintSET);
+ DefineEValue(p, 1L, "Rotate_0");
+ DefineEValue(p, 2L, "Rotate_90");
+ DefineEValue(p, 4L, "Rotate_180");
+ DefineEValue(p, 8L, "Rotate_270");
+ DefineEValue(p, 16L, "Reflect_X");
+ DefineEValue(p, 32L, "Reflect_Y");
+
+ DefineType(SCREENSIZE, RECORD, "SCREENSIZE", PrintSCREENSIZE);
+
+ /* RandR 1.2 additions */
+ p = DefineType(SETofMODEFLAG, SET, "MODEFLAG", (PrintProcType) PrintSET);
+ DefineEValue(p, 0x00000001, "HSyncPositive");
+ DefineEValue(p, 0x00000002, "HSyncNegative");
+ DefineEValue(p, 0x00000004, "VSyncPositive");
+ DefineEValue(p, 0x00000008, "VSyncNegative");
+ DefineEValue(p, 0x00000010, "Interlace");
+ DefineEValue(p, 0x00000020, "DoubleScan");
+ DefineEValue(p, 0x00000040, "CSync");
+ DefineEValue(p, 0x000100080, "CSyncPositive");
+ DefineEValue(p, 0x00000100, "CSyncNegative");
+ DefineEValue(p, 0x00000200, "HSkewPresent");
+ DefineEValue(p, 0x00000400, "BCast");
+ DefineEValue(p, 0x00000800, "PixelMultiplex");
+ DefineEValue(p, 0x00001000, "DoubleClock");
+ DefineEValue(p, 0x00002000, "ClockDivideBy2");
+
+ DefineType(MODEINFO, RECORD, "MODEINFO", PrintMODEINFO);
+ DefineType(MODE, BUILTIN, "MODE", PrintMODE);
+ DefineType(CRTC, BUILTIN, "CRTC", PrintCRTC);
+ DefineType(OUTPUT, BUILTIN, "OUTPUT", PrintOUTPUT);
+
+ p = DefineType(CONNECTION, ENUMERATED, "CONNECTION",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Connected");
+ DefineEValue(p, 1L, "Disconnected");
+ DefineEValue(p, 2L, "UnknownConnection");
+
+ /* RandR depends on Render's SUBPIXEL & TRANSFORM types */
+ InitializeCommonRenderTypes();
+
+ /* RandR 1.4 additions */
+ p = DefineType(SETofPROVIDER_CAPS, SET, "PROVIDER_CAPS",
+ (PrintProcType) PrintSET);
+ DefineEValue(p, 0x00000001, "SourceOutput");
+ DefineEValue(p, 0x00000002, "SinkOutput");
+ DefineEValue(p, 0x00000004, "SourceOffload");
+ DefineEValue(p, 0x00000008, "SinkOffload");
+
InitializeExtensionDecoder(RANDRRequest, randr_decode_req,
randr_decode_reply);
- /* Not yet implemented:
- InitializeExtensionErrorDecoder(RANDRError, randr_decode_error); */
InitializeExtensionEventDecoder(RANDREvent, randr_decode_event);
-
+ InitializeExtensionEventDecoder(RANDREvent + 1, randr_decode_event);
+ for (int errcode = RANDRError; errcode < (RANDRError + RANDRNError);
+ errcode++) {
+ InitializeExtensionErrorDecoder(errcode, randr_decode_error);
+ }
}
diff --git a/decode_render.c b/decode_render.c
index 12149e9..b02a092 100644
--- a/decode_render.c
+++ b/decode_render.c
@@ -538,8 +538,8 @@ InitializeRENDER(const unsigned char *buf)
DefineType(TRIANGLE, RECORD, "TRIANGLE", PrintTRIANGLE);
DefineType(TRAPEZOID, RECORD, "TRAPEZOID", PrintTRAPEZOID);
DefineType(FILTERALIAS, BUILTIN, "FILTERALIAS", PrintFILTERALIAS);
- DefineType(RENDERTRANSFORM, BUILTIN, "RENDERTRANSFORM",
- PrintRENDERTRANSFORM);
+
+ InitializeCommonRenderTypes();
InitializeExtensionDecoder(RENDERRequest, render_decode_req,
render_decode_reply);
@@ -548,3 +548,32 @@ InitializeRENDER(const unsigned char *buf)
InitializeExtensionErrorDecoder(errcode, render_decode_error);
}
}
+
+/*
+ Types originally defined by Render but now shared with other extensions
+ which may need to initialize the definitions even if the client hasn't
+ made any Render extension calls
+*/
+void
+InitializeCommonRenderTypes(void)
+{
+ static Boolean initialized;
+ TYPE p;
+
+ if (initialized)
+ return;
+ initialized = true;
+
+ DefineType(RENDERTRANSFORM, BUILTIN, "RENDERTRANSFORM",
+ PrintRENDERTRANSFORM);
+
+ /* Subpixel orders included in 0.6 */
+ p = DefineType(SUBPIXEL, ENUMERATED, "SUBPIXEL",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Unknown");
+ DefineEValue(p, 1L, "SubPixelHorizontalRGB");
+ DefineEValue(p, 2L, "SubPixelHorizontalBGR");
+ DefineEValue(p, 3L, "SubPixelVerticalRGB");
+ DefineEValue(p, 4L, "SubPixelVerticalBGR");
+ DefineEValue(p, 5L, "SubPixelNone");
+}
diff --git a/extensions.h b/extensions.h
index 87888ac..df2d5ec 100644
--- a/extensions.h
+++ b/extensions.h
@@ -54,6 +54,9 @@ extern void InitializeRANDR(const unsigned char *buf);
extern void InitializeRENDER(const unsigned char *buf);
extern void InitializeWCP(const unsigned char *buf);
+/* X11 Extension types shared across multiple extensions */
+extern void InitializeCommonRenderTypes(void);
+
/* Called from Initialize* to register the extension-specific decoders */
typedef void (*extension_decode_req_ptr) (FD fd, const unsigned char *buf);
typedef void (*extension_decode_reply_ptr) (FD fd, const unsigned char *buf,
diff --git a/print_randr.c b/print_randr.c
index 2682fdd..3182664 100644
--- a/print_randr.c
+++ b/print_randr.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -35,7 +36,15 @@ RandrQueryVersion(FD fd, const unsigned char *buf)
if (Verbose > 1)
PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, CARD32, "major-version");
+ PrintField(buf, 8, 4, CARD32, "minor-version");
+
+ /*
+ Todo, maybe: record major-version for distinguishing which version of
+ original set of requests/replies client is using, version 0.x or 1.x.
+ Alternatively: purge all support for version 0.x.
+ */
}
void
@@ -48,12 +57,14 @@ RandrQueryVersionReply(FD fd, const unsigned char *buf)
return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "major-version");
- PrintField(buf, 10, 2, CARD16, "minor-version");
+ PrintField(buf, 8, 4, CARD32, "major-version");
+ PrintField(buf, 12, 4, CARD32, "minor-version");
}
+/* RandrOld* interfaces are for RandR 0.x only - the protocol changed
+ incompatibily in RandR 1.0, and the RandR 1.0 versions come later. */
void
-RandrGetScreenInfo(FD fd, const unsigned char *buf)
+RandrOldGetScreenInfo(FD fd, const unsigned char *buf)
{
PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
@@ -67,13 +78,14 @@ RandrGetScreenInfo(FD fd, const unsigned char *buf)
}
void
-RandrGetScreenInfoReply(FD fd, const unsigned char *buf)
+RandrOldGetScreenInfoReply(FD fd, const unsigned char *buf)
{
unsigned short nsize;
unsigned short nvg;
unsigned short ngvg;
PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
if (Verbose < 1)
return;
PrintField(buf, 1, 1, CARD8, "set-of-rotations");
@@ -94,7 +106,7 @@ RandrGetScreenInfoReply(FD fd, const unsigned char *buf)
}
void
-RandrSetScreenConfig(FD fd, const unsigned char *buf)
+RandrOldSetScreenConfig(FD fd, const unsigned char *buf)
{
PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
@@ -113,9 +125,10 @@ RandrSetScreenConfig(FD fd, const unsigned char *buf)
}
void
-RandrSetScreenConfigReply(FD fd, const unsigned char *buf)
+RandrOldSetScreenConfigReply(FD fd, const unsigned char *buf)
{
PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
PrintField(buf, 1, 1, BOOL, "success"); /* RandrQueryVersion reply */
if (Verbose < 1)
return;
@@ -127,7 +140,7 @@ RandrSetScreenConfigReply(FD fd, const unsigned char *buf)
}
void
-RandrScreenChangeSelectInput(FD fd, const unsigned char *buf)
+RandrOldScreenChangeSelectInput(FD fd, const unsigned char *buf)
{
PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
@@ -141,8 +154,8 @@ RandrScreenChangeSelectInput(FD fd, const unsigned char *buf)
PrintField(buf, 8, 1, BOOL, "enable");
}
-void
-RandrScreenSizes(const unsigned char *buf)
+static void
+RandrOldScreenSizes(const unsigned char *buf)
{
PrintField(buf, 0, 2, CARD16, "width-in-pixels");
PrintField(buf, 2, 2, CARD16, "height-in-pixels");
@@ -152,9 +165,9 @@ RandrScreenSizes(const unsigned char *buf)
}
void
-RandrScreenChangeNotifyEvent(const unsigned char *buf)
+RandrOldScreenChangeNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRScreenChangeNotify */
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RROldScreenChangeNotify */
if (Verbose < 1)
return;
PrintField(buf, 1, 1, BOOL, "resident");
@@ -164,5 +177,1443 @@ RandrScreenChangeNotifyEvent(const unsigned char *buf)
PrintField(buf, 12, 4, WINDOW, "root");
PrintField(buf, 16, 2, CARD16, "size id");
PrintField(buf, 18, 2, CARD16, "rotation");
- RandrScreenSizes(buf + 20);
+ RandrOldScreenSizes(buf + 20);
+}
+
+/* RandR 1.0 starts here */
+int
+PrintSCREENSIZE(const unsigned char *buf)
+{
+ PrintField(buf, 0, 2, CARD16, "width-in-pixels");
+ PrintField(buf, 2, 2, CARD16, "height-in-pixels");
+ PrintField(buf, 4, 2, CARD16, "width-in-millimeters");
+ PrintField(buf, 6, 2, CARD16, "height-in-millimeters");
+ return 8;
+}
+
+void
+RandrSetScreenConfig(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetScreenConfig */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 16, 2, CARD16, "size-id");
+ PrintField(buf, 18, 2, CARD16, "rotation");
+ PrintField(buf, 20, 2, CARD16, "rate");
+}
+
+
+void
+RandrSetScreenConfigReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "new-timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "new-config-timestamp");
+ PrintField(buf, 16, 4, WINDOW, "root");
+ PrintField(buf, 20, 2, SUBPIXEL, "subpixel-order");
+}
+
+
+void
+RandrSelectInput(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSelectInput */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 2, SETofRREVENT, "select-mask");
+}
+
+
+void
+RandrGetScreenInfo(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetScreenInfo */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+void
+RandrGetScreenInfoReply(FD fd, const unsigned char *buf)
+{
+ uint16_t s, r;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, SETofROTATION, "rotations");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, TIMESTAMP, "new-timestamp");
+ PrintField(buf, 16, 4, TIMESTAMP, "new-config-timestamp");
+ PrintField(buf, 20, 2, CARD16, "num-sizes");
+ s = IShort(&buf[20]);
+ PrintField(buf, 22, 2, CARD16, "size-id");
+ PrintField(buf, 24, 2, SETofROTATION, "rotation");
+ PrintField(buf, 26, 2, CARD16, "rate");
+ printfield(buf, 28, 2, CARD16, "rates-length");
+
+ buf += 32; /* screen sizes start 32 bytes from head of reply */
+ PrintList(buf, s, SCREENSIZE, "sizes");
+ buf += s * 8;
+
+ r = IShort(buf);
+ PrintField(buf, 0, 2, CARD16, "num-rates");
+ buf += 2;
+ PrintList(buf, r, CARD16, "refresh-rates");
+}
+
+void
+RandrScreenChangeNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRScreenChangeNotify */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "rotation");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 12, 4, WINDOW, "root");
+ PrintField(buf, 16, 4, WINDOW, "window");
+ PrintField(buf, 20, 2, CARD16, "size id");
+ PrintField(buf, 22, 2, SUBPIXEL, "subpixel-order");
+ PrintSCREENSIZE(buf + 24);
+}
+
+/* Randr 1.2 additions */
+int
+PrintMODEINFO(const unsigned char *buf)
+{
+ PrintField(buf, 0, 4, CARD32, "id");
+ PrintField(buf, 4, 2, CARD16, "width-in-pixels");
+ PrintField(buf, 6, 2, CARD16, "height-in-pixels");
+ PrintField(buf, 8, 4, CARD32, "dot clock");
+ PrintField(buf, 12, 2, CARD16, "h sync start");
+ PrintField(buf, 14, 2, CARD16, "h sync end");
+ PrintField(buf, 16, 2, CARD16, "h total");
+ PrintField(buf, 18, 2, CARD16, "h skew");
+ PrintField(buf, 20, 2, CARD16, "v sync start");
+ PrintField(buf, 22, 2, CARD16, "v sync end");
+ PrintField(buf, 24, 2, CARD16, "v total");
+ PrintField(buf, 26, 2, CARD16, "name length");
+ PrintField(buf, 28, 4, SETofMODEFLAG, "mode flags");
+ return 32;
+}
+
+int PrintMODE(const unsigned char *buf)
+{
+ /* print a MODE -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "MODE %08lx", n);
+ return (4);
+}
+
+int
+PrintCRTC(const unsigned char *buf)
+{
+ /* print a CRTC -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "CRTC %08lx", n);
+ return (4);
+}
+
+int
+PrintOUTPUT(const unsigned char *buf)
+{
+ /* print an OUTPUT -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "OUTP %08lx", n);
+ return (4);
+}
+
+
+void
+RandrGetScreenSizeRange(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetScreenSizeRange */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+
+void
+RandrGetScreenSizeRangeReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "min-width");
+ PrintField(buf, 10, 2, CARD16, "min-height");
+ PrintField(buf, 12, 2, CARD16, "max-width");
+ PrintField(buf, 24, 2, CARD16, "max-height");
+}
+
+
+void
+RandrSetScreenSize(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetScreenSize */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(5));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintSCREENSIZE(buf + 8);
+}
+
+
+void
+RandrGetScreenResources(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetScreenResources */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+
+void
+RandrGetScreenResourcesReply(FD fd, const unsigned char *buf)
+{
+ uint16_t c, o, m, b;
+ const unsigned char *nl, *end;
+ int i;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(c+o+8m+(b+p)/4), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "config-timestamp");
+ printfield(buf, 16, 2, CARD16, "num-crtcs"); /* c */
+ printfield(buf, 18, 2, CARD16, "num-outputs"); /* o */
+ printfield(buf, 20, 2, CARD16, "num-modes"); /* m */
+ printfield(buf, 22, 2, CARD16, "num-bytes-names"); /* b */
+ /* 8 bytes unused */
+ c = IShort(&buf[16]);
+ o = IShort(&buf[18]);
+ m = IShort(&buf[20]);
+ b = IShort(&buf[22]);
+
+ buf += 32;
+ PrintList(buf, c, CRTC, "crtcs");
+ buf += c * 4;
+ PrintList(buf, o, OUTPUT, "outputs");
+ buf += o * 4;
+ nl = buf + 26; /* offset of name length field in first modeinfo */
+ PrintList(buf, m, MODEINFO, "modeinfos");
+ buf += m * 32;
+ end = buf + b;
+ for (i = 0 ; i < m; i++, nl += 32) {
+ uint16_t len = IShort(nl);
+ if ((buf + len) > end) {
+ fprintf(stdout, "**INVALID NAME LENGTH**");
+ break;
+ }
+ buf += PrintString8(buf, len, "mode name");
+ }
+}
+
+
+void
+RandrGetOutputInfo(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetOutputInfo */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+}
+
+
+void
+RandrGetOutputInfoReply(FD fd, const unsigned char *buf)
+{
+ uint16_t c, m, p, o, n;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(1+c+m+(n+p)/4), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, CRTC, "crtc");
+ PrintField(buf, 16, 4, CARD32, "width-in-millimeters");
+ PrintField(buf, 20, 4, CARD32, "height-in-millimeters");
+ PrintField(buf, 24, 1, CARD8, "connection");
+ PrintField(buf, 25, 1, SUBPIXEL, "subpixel-order");
+ printfield(buf, 26, 2, CARD16, "num-crtcs");
+ printfield(buf, 28, 2, CARD16, "num-modes");
+ printfield(buf, 30, 2, CARD16, "num-preferred");
+ printfield(buf, 32, 2, CARD16, "num-clones");
+ printfield(buf, 34, 2, CARD16, "name-length");
+ c = IShort(&buf[26]);
+ m = IShort(&buf[28]);
+ p = IShort(&buf[30]);
+ o = IShort(&buf[32]);
+ n = IShort(&buf[34]);
+
+ buf += 36;
+ PrintList(buf, c, CRTC, "crtcs");
+ buf += c * 4;
+ PrintList(buf, p, MODE, "preferred-modes");
+ buf += p * 4;
+ PrintList(buf, m - p, MODE, "other-modes");
+ buf += (m - p) * 4;
+ PrintList(buf, o, OUTPUT, "clones");
+ buf += o * 4;
+ PrintString8(buf, n, "name");
+}
+
+
+void
+RandrListOutputProperties(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrListOutputProperties */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+}
+
+
+void
+RandrListOutputPropertiesReply(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, ATOM, "atoms");
+}
+
+
+void
+RandrQueryOutputProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrQueryOutputProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, ATOM, "property");
+}
+
+
+void
+RandrQueryOutputPropertyReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ PrintField(buf, 8, 1, BOOL, "pending");
+ printfield(buf, 9, 1, BOOL, "range");
+ PrintField(buf, 10, 1, BOOL, "immutable");
+
+ if (IBool(&buf[9]) && (Verbose <= 1)) { /* range of min-max values */
+ PrintField(buf, 32, 4, INT32, "minimum value");
+ PrintField(buf, 36, 4, INT32, "maximum value");
+ } else { /* list of values */
+ uint32_t n = ILong(&buf[4]);
+ PrintList(&buf[32], n, INT32, "accepted values");
+ }
+}
+
+
+void
+RandrConfigureOutputProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrConfigureOutputProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(4 + n));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 1, BOOL, "pending");
+ printfield(buf, 13, 1, BOOL, "range");
+
+ if (IBool(&buf[12]) && (Verbose <= 1)) { /* range of min-max values */
+ PrintField(buf, 16, 4, INT32, "minimum value");
+ PrintField(buf, 20, 4, INT32, "maximum value");
+ } else { /* list of values */
+ uint32_t n = ILong(&buf[4]) - 4;
+ PrintList(&buf[16], n, INT32, "accepted values");
+ }
+}
+
+
+void
+RandrChangeOutputProperty(FD fd, const unsigned char *buf)
+{
+ uint32_t n;
+ short unit;
+ long type;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrChangeOutputProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOM, "type");
+ PrintField(buf, 16, 1, CARD8, "format");
+ PrintField(buf, 17, 1, CHANGEMODE, "mode");
+ /* 2 bytes unused */
+ printfield(buf, 20, 4, CARD32, "length of data");
+
+ type = ILong(&buf[12]);
+ unit = IByte(&buf[16]) / 8;
+ n = ILong(&buf[20]);
+ PrintPropertyValues(&buf[24], type, unit, n, "data");
+}
+
+
+void
+RandrDeleteOutputProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrDeleteOutputProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, ATOM, "property");
+}
+
+
+void
+RandrGetOutputProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetOutputProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(7));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOMT, "type");
+ PrintField(buf, 16, 4, CARD32, "long-offset");
+ printfield(buf, 20, 4, CARD32, "long-length");
+ PrintField(buf, 24, 1, BOOL, "delete");
+ PrintField(buf, 25, 1, BOOL, "pending");
+}
+
+
+void
+RandrGetOutputPropertyReply(FD fd, const unsigned char *buf)
+{
+ uint32_t n;
+ short unit;
+ long type;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "format");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ PrintField(buf, 8, 4, ATOM, "type");
+ PrintField(buf, 12, 4, CARD32, "bytes-after");
+ printfield(buf, 16, 4, CARD32, "length of value");
+
+ unit = IByte(&buf[1]) / 8;
+ type = ILong(&buf[8]);
+ n = ILong(&buf[16]);
+ PrintPropertyValues(&buf[32], type, unit, n, "value");
+}
+
+
+void
+RandrCreateMode(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrCreateMode */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(12 + (n + p) / 4));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 32, MODEINFO, "mode");
+ n = IShort(&buf[34]); /* name length field of MODEINFO */
+ PrintString8(&buf[40], n, "name");
+}
+
+
+void
+RandrCreateModeReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, MODE, "mode");
+}
+
+
+void
+RandrDestroyMode(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrDestroyMode */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, MODE, "mode");
+}
+
+
+void
+RandrAddOutputMode(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrAddOutputMode */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, MODE, "mode");
+}
+
+
+void
+RandrDeleteOutputMode(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrDeleteOutputMode */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, OUTPUT, "output");
+ PrintField(buf, 8, 4, MODE, "mode");
+}
+
+
+void
+RandrGetCrtcInfo(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetCrtcInfo */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+}
+
+
+void
+RandrGetCrtcInfoReply(FD fd, const unsigned char *buf)
+{
+ uint16_t o, p;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(o+p), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 4, MODE, "mode");
+ PrintField(buf, 24, 2, SETofROTATION, "current rotation and reflection");
+ PrintField(buf, 26, 2, SETofROTATION, "set of possible rotations");
+ PrintField(buf, 28, 2, CARD16, "number of outputs");
+ PrintField(buf, 30, 2, CARD16, "number of possible outputs");
+
+ o = IShort(&buf[28]);
+ p = IShort(&buf[30]);
+ PrintList(&buf[32], (long) o, OUTPUT, "outputs");
+ PrintList(&buf[32 + (4 * o)], (long) p, OUTPUT, "possible outputs");
+}
+
+
+void
+RandrSetCrtcConfig(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetCrtcConfig */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(7 + 2n));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "config timestamp");
+ PrintField(buf, 16, 2, INT16, "x");
+ PrintField(buf, 18, 2, INT16, "y");
+ PrintField(buf, 20, 4, MODE, "mode");
+ PrintField(buf, 24, 2, SETofROTATION, "rotation/reflection");
+ /* 26 = 2 bytes padding */
+ n = IShort(&buf[2]) - 7;
+ PrintList(&buf[28], (long) n, OUTPUT, "outputs");
+}
+
+
+void
+RandrSetCrtcConfigReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+}
+
+
+void
+RandrGetCrtcGammaSize(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetCrtcGammaSize */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+}
+
+
+void
+RandrGetCrtcGammaSizeReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "size");
+}
+
+
+void
+RandrGetCrtcGamma(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetCrtcGamma */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+}
+
+
+void
+RandrGetCrtcGammaReply(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(((6 * n) + p)/4), "reply length");
+ PrintField(buf, 8, 2, CARD16, "size");
+ n = IShort(&buf[8]);
+ PrintList(&buf[12], (long) n, CARD16, "red");
+ PrintList(&buf[12 + (2 * n)], (long) n, CARD16, "green");
+ PrintList(&buf[12 + (4 * n)], (long) n, CARD16, "blue");
+}
+
+
+void
+RandrSetCrtcGamma(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetCrtcGamma */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3+((6 * n) + p)/4));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+ PrintField(buf, 8, 2, CARD16, "size");
+ n = IShort(&buf[8]);
+ /* 10 = 2 bytes padding */
+ PrintList(&buf[12], (long) n, CARD16, "red");
+ PrintList(&buf[12 + (2 * n)], (long) n, CARD16, "green");
+ PrintList(&buf[12 + (4 * n)], (long) n, CARD16, "blue");
+}
+
+void
+RandrCrtcChangeNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RRCrtcChangeNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, CRTC, "crtc");
+ PrintField(buf, 16, 4, MODE, "mode");
+ PrintField(buf, 20, 2, SETofROTATION, "rotation");
+ /* 22 = 2 bytes padding */
+ PrintField(buf, 24, 2, INT16, "x");
+ PrintField(buf, 26, 2, INT16, "y");
+ PrintField(buf, 28, 2, CARD16, "width");
+ PrintField(buf, 30, 2, CARD16, "height");
+}
+
+void
+RandrOutputChangeNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RROutputChangeNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 12, 4, WINDOW, "window");
+ PrintField(buf, 16, 4, OUTPUT, "output");
+ PrintField(buf, 20, 4, CRTC, "crtc");
+ PrintField(buf, 24, 4, MODE, "mode");
+ PrintField(buf, 28, 2, SETofROTATION, "rotation");
+ PrintField(buf, 30, 1, CONNECTION, "connection");
+ PrintField(buf, 31, 1, SUBPIXEL, "subpixel-order");
+
+}
+
+void
+RandrOutputPropertyNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RROutputPropertyNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, OUTPUT, "output");
+ PrintField(buf, 12, 4, ATOM, "atom");
+ PrintField(buf, 16, 4, TIMESTAMP, "time");
+ PrintField(buf, 20, 1, PROPCHANGE, "state");
+ /* 11 bytes unused */
+}
+
+
+void
+RandrOutputError(FD fd, const unsigned char *buf)
+{
+ printErrorWithValue(buf, OUTPUT, "bad output");
+}
+
+void
+RandrCrtcError(FD fd, const unsigned char *buf)
+{
+ printErrorWithValue(buf, CRTC, "bad crtc");
+}
+
+void
+RandrModeError(FD fd, const unsigned char *buf)
+{
+ printErrorWithValue(buf, MODE, "bad mode");
+}
+
+
+
+/* Randr 1.3 additions */
+void
+RandrGetScreenResourcesCurrent(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetScreenResourcesCurrent */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+
+void
+RandrGetScreenResourcesCurrentReply(FD fd, const unsigned char *buf)
+{
+ /* Reply format is exact same as RandrGetScreenResources */
+ RandrGetScreenResourcesReply(fd, buf);
+}
+
+
+void
+RandrSetCrtcTransform(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+ uint32_t reqlen, p, v;
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetCrtcTransform */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ reqlen = getreqlen(fd, buf);
+ printreqlen(buf, fd, DVALUE2(12+(n+p)/4+v));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+ PrintField(buf, 8, 36, RENDERTRANSFORM, "transform");
+ printfield(buf, 44, 2, CARD16, "filter name length");
+ /* 2 bytes unused */
+ n = IShort(&buf[44]);
+ PrintString8(&buf[48], n, "filter name");
+ /* pad to p=pad(n) */
+ p = pad(n);
+ v = reqlen - (12 + (p/4));
+ PrintList(&buf[48 + p], (long) v, FIXED, "filter params");
+}
+
+
+void
+RandrGetCrtcTransform(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetCrtcTransform */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+}
+
+
+void
+RandrGetCrtcTransformReply(FD fd, const unsigned char *buf)
+{
+ uint16_t pn, pf, cn, cf;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(16+(pn+pnp)/4+(cn+cnp)/4+pf+cf), "reply length");
+ PrintField(buf, 8, 36, RENDERTRANSFORM, "pending transform");
+ PrintField(buf, 44, 1, BOOL, "has transforms");
+ /* 3 bytes unused */
+ PrintField(buf, 48, 36, RENDERTRANSFORM, "current transform");
+
+ printfield(buf, 84, 2, CARD16, "pending filter name length"); /* pn */
+ printfield(buf, 86, 2, CARD16, "pending filter num params"); /* pf */
+ printfield(buf, 88, 2, CARD16, "current filter name length"); /* cn */
+ printfield(buf, 90, 2, CARD16, "current filter num params"); /* cf */
+
+ pn = IShort(&buf[84]);
+ pf = IShort(&buf[86]);
+ cn = IShort(&buf[88]);
+ cf = IShort(&buf[90]);
+
+ buf += 92;
+
+ PrintString8(buf, pn, "pending filter name");
+ buf += pad(pn);
+ PrintList(buf, pf, FIXED, "pending filter params");
+ buf += 4 * pf;
+
+ PrintString8(buf, cn, "current filter name");
+ buf += pad(cn);
+ PrintList(buf, cf, FIXED, "current filter params");
+}
+
+
+void
+RandrGetPanning(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetPanning */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+}
+
+
+void
+RandrGetPanningReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(1), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 2, CARD16, "left");
+ PrintField(buf, 14, 2, CARD16, "top");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 2, CARD16, "track_left");
+ PrintField(buf, 22, 2, CARD16, "track_top");
+ PrintField(buf, 24, 2, CARD16, "track_width");
+ PrintField(buf, 26, 2, CARD16, "track_height");
+ PrintField(buf, 28, 2, INT16, "border_left");
+ PrintField(buf, 30, 2, INT16, "border_top");
+ PrintField(buf, 32, 2, INT16, "border_right");
+ PrintField(buf, 34, 2, INT16, "border_bottom");
+}
+
+
+void
+RandrSetPanning(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetPanning */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(9));
+ PrintField(buf, 4, 4, CRTC, "crtc");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 2, CARD16, "left");
+ PrintField(buf, 14, 2, CARD16, "top");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 2, CARD16, "track_left");
+ PrintField(buf, 22, 2, CARD16, "track_top");
+ PrintField(buf, 24, 2, CARD16, "track_width");
+ PrintField(buf, 26, 2, CARD16, "track_height");
+ PrintField(buf, 28, 2, INT16, "border_left");
+ PrintField(buf, 30, 2, INT16, "border_top");
+ PrintField(buf, 32, 2, INT16, "border_right");
+ PrintField(buf, 34, 2, INT16, "border_bottom");
+}
+
+
+void
+RandrSetPanningReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "new-timestamp");
+ /* 20 bytes unused */
+}
+
+
+void
+RandrSetOutputPrimary(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetOutputPrimary */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, OUTPUT, "output");
+}
+
+
+void
+RandrGetOutputPrimary(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetOutputPrimary */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+
+void
+RandrGetOutputPrimaryReply(FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, OUTPUT, "output");
+}
+
+
+
+/* Randr 1.4 additions */
+void
+RandrGetProviders(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetProviders */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+
+void
+RandrGetProvidersReply(FD fd, const unsigned char *buf)
+{
+ uint16_t p;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(p), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 2, CARD16, "number of providers");
+
+ p = IShort(&buf[12]);
+ PrintList(&buf[32], p, PROVIDER, "providers");
+}
+
+
+void
+RandrGetProviderInfo(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetProviderInfo */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+}
+
+
+void
+RandrGetProviderInfoReply(FD fd, const unsigned char *buf)
+{
+ uint16_t c, o, a, n;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "status");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(1+c+o+(a*2)+(n+p)/4), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, SETofPROVIDER_CAPS, "capabilities");
+ PrintField(buf, 16, 2, CARD16, "number of crtcs"); /* c */
+ PrintField(buf, 18, 2, CARD16, "number of outputs"); /* o */
+ PrintField(buf, 20, 2, CARD16, "number of associated providers"); /* a */
+ PrintField(buf, 22, 2, CARD16, "length of name"); /* n */
+ /* 8 bytes unused */
+ c = IShort(&buf[16]);
+ o = IShort(&buf[18]);
+ a = IShort(&buf[20]);
+ n = IShort(&buf[22]);
+
+ buf += 32;
+ PrintList(buf, c, CRTC, "crtcs");
+ buf += c * 4;
+ PrintList(buf, o, OUTPUT, "outputs");
+ buf += o * 4;
+ PrintList(buf, a, PROVIDER, "associated providers");
+ buf += a * 4;
+ PrintList(buf, a, SETofPROVIDER_CAPS, "associated provider capability");
+ buf += a * 4;
+ PrintString8(buf, n, "name");
+}
+
+
+void
+RandrSetProviderOffloadSink(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetProviderOffloadSink */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, PROVIDER, "offload sink provider");
+ PrintField(buf, 12, 4, TIMESTAMP, "timestamp");
+}
+
+
+void
+RandrSetProviderOutputSource(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSetProviderOutputSource */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, PROVIDER, "output source provider");
+ PrintField(buf, 12, 4, TIMESTAMP, "timestamp");
+}
+
+
+void
+RandrListProviderProperties(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrListProviderProperties */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+}
+
+
+void
+RandrListProviderPropertiesReply(FD fd, const unsigned char *buf)
+{
+ uint16_t n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
+ /* 22 bytes unused */
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, ATOM, "atoms");
+}
+
+
+void
+RandrQueryProviderProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrQueryProviderProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, ATOM, "property");
+}
+
+
+void
+RandrQueryProviderPropertyReply(FD fd, const unsigned char *buf)
+{
+ uint32_t n;
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ PrintField(buf, 8, 1, BOOL, "pending");
+ PrintField(buf, 9, 1, BOOL, "range");
+ PrintField(buf, 10, 1, BOOL, "immutable");
+ /* 21 bytes unused */
+ n = ILong(&buf[4]);
+ PrintList(&buf[32], n, INT32, "valid values");
+}
+
+
+void
+RandrConfigureProviderProperty(FD fd, const unsigned char *buf)
+{
+ uint32_t reqlen, n;
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrConfigureProviderProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ reqlen = getreqlen(fd, buf);
+ printreqlen(buf, fd, DVALUE2(4+n));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 1, BOOL, "pending");
+ PrintField(buf, 13, 1, BOOL, "range");
+ /* 2 bytes unused */
+ n = reqlen - 4;
+ PrintList(&buf[16], n, INT32, "valid-values");
+}
+
+
+void
+RandrChangeProviderProperty(FD fd, const unsigned char *buf)
+{
+ uint32_t n;
+ short unit;
+ long type;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrChangeProviderProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOM, "type");
+ PrintField(buf, 16, 1, CARD8, "format");
+ PrintField(buf, 17, 1, CHANGEMODE, "mode");
+ /* 2 bytes unused */
+ printfield(buf, 20, 4, CARD32, "length of data");
+
+ type = ILong(&buf[12]);
+ unit = IByte(&buf[16]) / 8;
+ n = ILong(&buf[20]);
+ PrintPropertyValues(&buf[24], type, unit, n, "data");
+}
+
+
+void
+RandrDeleteProviderProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrDeleteProviderProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, ATOM, "property");
+}
+
+
+void
+RandrGetProviderProperty(FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrGetProviderProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(7));
+ PrintField(buf, 4, 4, PROVIDER, "provider");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOMT, "type");
+ PrintField(buf, 16, 4, CARD32, "long-offset");
+ printfield(buf, 20, 4, CARD32, "long-length");
+ PrintField(buf, 24, 1, BOOL, "delete");
+ PrintField(buf, 25, 1, BOOL, "pending");
+}
+
+
+void
+RandrGetProviderPropertyReply(FD fd, const unsigned char *buf)
+{
+ uint32_t n;
+ short unit;
+ long type;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "format");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ PrintField(buf, 8, 4, ATOM, "type");
+ PrintField(buf, 12, 4, CARD32, "bytes-after");
+ printfield(buf, 16, 4, CARD32, "length of value");
+
+ unit = IByte(&buf[1]) / 8;
+ type = ILong(&buf[8]);
+ n = ILong(&buf[16]);
+ PrintPropertyValues(&buf[32], type, unit, n, "value");
+}
+
+
+void
+RandrProviderChangeNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RRProviderChangeNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, PROVIDER, "provider");
+ /* 16 bytes unused */
+}
+
+
+void
+RandrProviderPropertyNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RRProviderPropertyNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, PROVIDER, "provider");
+ PrintField(buf, 12, 4, ATOM, "atom");
+ PrintField(buf, 16, 4, TIMESTAMP, "time");
+ PrintField(buf, 20, 1, PROPCHANGE, "state");
+ /* 11 bytes unused */
+}
+
+
+void
+RandrResourceChangeNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRNotify */
+ PrintField(buf, 1, 1, RANDREVENT, "minor code"); /* RRResourceChangeNotify */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ /* 20 bytes unused */
+}
+
+
+void
+RandrProviderError(FD fd, const unsigned char *buf)
+{
+ printErrorWithValue(buf, PROVIDER, "bad provider");
}
diff --git a/randrscope.h b/randrscope.h
index 4cfdd4d..776eef8 100644
--- a/randrscope.h
+++ b/randrscope.h
@@ -3,6 +3,13 @@
#define RANDRREQUESTHEADER "RANDRREQUEST"
#define RANDRREPLYHEADER "RANDRREPLY"
+#define RANDREVENTHEADER "RANDREVENT"
+
+/*
+ Aliases for types for RandR to x11.h types - used for types we don't
+ have specialized printing routines for now, but may want to someday.
+*/
+#define PROVIDER CARD32 /* XID */
/*
To aid in making the choice between level 1 and level 2, we
@@ -14,12 +21,107 @@
extern void RandrQueryVersion(FD fd, const unsigned char *buf);
extern void RandrQueryVersionReply(FD fd, const unsigned char *buf);
-extern void RandrGetScreenInfo(FD fd, const unsigned char *buf);
-extern void RandrGetScreenInfoReply(FD fd, const unsigned char *buf);
+
+/* Randr 0.x - not used in Randr 1.x */
+extern void RandrOldGetScreenInfo(FD fd, const unsigned char *buf);
+extern void RandrOldGetScreenInfoReply(FD fd, const unsigned char *buf);
+extern void RandrOldScreenChangeSelectInput(FD fd, const unsigned char *buf);
+extern void RandrOldSetScreenConfig(FD fd, const unsigned char *buf);
+extern void RandrOldSetScreenConfigReply(FD fd, const unsigned char *buf);
+
+extern void RandrOldScreenChangeNotifyEvent(const unsigned char *buf);
+
+/* Randr 1.0 */
+extern int PrintSCREENSIZE(const unsigned char *buf);
+
extern void RandrSetScreenConfig(FD fd, const unsigned char *buf);
extern void RandrSetScreenConfigReply(FD fd, const unsigned char *buf);
-extern void RandrScreenChangeSelectInput(FD fd, const unsigned char *buf);
-extern void RandrScreenSizes(const unsigned char *buf);
+extern void RandrSelectInput(FD fd, const unsigned char *buf);
+extern void RandrGetScreenInfo(FD fd, const unsigned char *buf);
+extern void RandrGetScreenInfoReply(FD fd, const unsigned char *buf);
+
extern void RandrScreenChangeNotifyEvent(const unsigned char *buf);
+/* Randr 1.2 additions */
+extern int PrintMODE(const unsigned char *buf);
+extern int PrintMODEINFO(const unsigned char *buf);
+extern int PrintCRTC(const unsigned char *buf);
+extern int PrintOUTPUT(const unsigned char *buf);
+
+extern void RandrGetScreenSizeRange(FD fd, const unsigned char *buf);
+extern void RandrGetScreenSizeRangeReply(FD fd, const unsigned char *buf);
+extern void RandrSetScreenSize(FD fd, const unsigned char *buf);
+extern void RandrGetScreenResources(FD fd, const unsigned char *buf);
+extern void RandrGetScreenResourcesReply(FD fd, const unsigned char *buf);
+extern void RandrGetOutputInfo(FD fd, const unsigned char *buf);
+extern void RandrGetOutputInfoReply(FD fd, const unsigned char *buf);
+extern void RandrListOutputProperties(FD fd, const unsigned char *buf);
+extern void RandrListOutputPropertiesReply(FD fd, const unsigned char *buf);
+extern void RandrQueryOutputProperty(FD fd, const unsigned char *buf);
+extern void RandrQueryOutputPropertyReply(FD fd, const unsigned char *buf);
+extern void RandrConfigureOutputProperty(FD fd, const unsigned char *buf);
+extern void RandrChangeOutputProperty(FD fd, const unsigned char *buf);
+extern void RandrDeleteOutputProperty(FD fd, const unsigned char *buf);
+extern void RandrGetOutputProperty(FD fd, const unsigned char *buf);
+extern void RandrGetOutputPropertyReply(FD fd, const unsigned char *buf);
+extern void RandrCreateMode(FD fd, const unsigned char *buf);
+extern void RandrCreateModeReply(FD fd, const unsigned char *buf);
+extern void RandrDestroyMode(FD fd, const unsigned char *buf);
+extern void RandrAddOutputMode(FD fd, const unsigned char *buf);
+extern void RandrDeleteOutputMode(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcInfo(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcInfoReply(FD fd, const unsigned char *buf);
+extern void RandrSetCrtcConfig(FD fd, const unsigned char *buf);
+extern void RandrSetCrtcConfigReply(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcGammaSize(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcGammaSizeReply(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcGamma(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcGammaReply(FD fd, const unsigned char *buf);
+extern void RandrSetCrtcGamma(FD fd, const unsigned char *buf);
+
+extern void RandrCrtcChangeNotifyEvent(const unsigned char *buf);
+extern void RandrOutputChangeNotifyEvent(const unsigned char *buf);
+extern void RandrOutputPropertyNotifyEvent(const unsigned char *buf);
+
+extern void RandrOutputError(FD fd, const unsigned char *buf);
+extern void RandrCrtcError(FD fd, const unsigned char *buf);
+extern void RandrModeError(FD fd, const unsigned char *buf);
+
+/* Randr 1.3 additions */
+extern void RandrGetScreenResourcesCurrent(FD fd, const unsigned char *buf);
+extern void RandrGetScreenResourcesCurrentReply(FD fd, const unsigned char *buf);
+extern void RandrSetCrtcTransform(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcTransform(FD fd, const unsigned char *buf);
+extern void RandrGetCrtcTransformReply(FD fd, const unsigned char *buf);
+extern void RandrGetPanning(FD fd, const unsigned char *buf);
+extern void RandrGetPanningReply(FD fd, const unsigned char *buf);
+extern void RandrSetPanning(FD fd, const unsigned char *buf);
+extern void RandrSetPanningReply(FD fd, const unsigned char *buf);
+extern void RandrSetOutputPrimary(FD fd, const unsigned char *buf);
+extern void RandrGetOutputPrimary(FD fd, const unsigned char *buf);
+extern void RandrGetOutputPrimaryReply(FD fd, const unsigned char *buf);
+
+/* Randr 1.4 additions */
+extern void RandrGetProviders(FD fd, const unsigned char *buf);
+extern void RandrGetProvidersReply(FD fd, const unsigned char *buf);
+extern void RandrGetProviderInfo(FD fd, const unsigned char *buf);
+extern void RandrGetProviderInfoReply(FD fd, const unsigned char *buf);
+extern void RandrSetProviderOffloadSink(FD fd, const unsigned char *buf);
+extern void RandrSetProviderOutputSource(FD fd, const unsigned char *buf);
+extern void RandrListProviderProperties(FD fd, const unsigned char *buf);
+extern void RandrListProviderPropertiesReply(FD fd, const unsigned char *buf);
+extern void RandrQueryProviderProperty(FD fd, const unsigned char *buf);
+extern void RandrQueryProviderPropertyReply(FD fd, const unsigned char *buf);
+extern void RandrConfigureProviderProperty(FD fd, const unsigned char *buf);
+extern void RandrChangeProviderProperty(FD fd, const unsigned char *buf);
+extern void RandrDeleteProviderProperty(FD fd, const unsigned char *buf);
+extern void RandrGetProviderProperty(FD fd, const unsigned char *buf);
+extern void RandrGetProviderPropertyReply(FD fd, const unsigned char *buf);
+
+extern void RandrProviderChangeNotifyEvent(const unsigned char *buf);
+extern void RandrProviderPropertyNotifyEvent(const unsigned char *buf);
+extern void RandrResourceChangeNotifyEvent(const unsigned char *buf);
+
+extern void RandrProviderError(FD fd, const unsigned char *buf);
+
#endif
diff --git a/x11.h b/x11.h
index fa6cfef..b9ac221 100644
--- a/x11.h
+++ b/x11.h
@@ -244,6 +244,7 @@
#define FIXED 145
#define FILTERALIAS 146
#define RENDERTRANSFORM 147
+#define SUBPIXEL 148
#define RANDRREQUEST 150
#define RANDRREPLY 151
@@ -264,6 +265,20 @@
#define GLXEVENT 162
#define GLXERROR 163
+/* More RandR */
+#define SETofRREVENT 164
+#define SETofROTATION 165
+#define SCREENSIZE 166
+#define REFRESH 167
+#define SETofMODEFLAG 168
+#define MODEINFO 169
+#define MODE 170 /* XID/CARD32 plus 0 = None */
+#define CRTC 171 /* XID/CARD32 plus 0 = None */
+#define OUTPUT 172 /* XID/CARD32 plus 0 = None */
+#define RANDREVENT 173 /* minor event code for RandR event base+1 */
+#define CONNECTION 174
+#define SETofPROVIDER_CAPS 175
+
#define MaxTypes 256
/* ************************************************************ */
--
1.7.9.2
More information about the xorg-devel
mailing list