From e9a5a489acd591ff53823b406dca13c622439c14 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 14 Sep 2006 23:53:04 -0700 Subject: Update header files for new 1.2 spec. Fix missing bits in spec. Spec was missing a few things in the encoding section. --- randr.h | 35 +++-- randrproto.h | 437 ++++++++++++++++++++++++++++++++++++++++++++------------- randrproto.txt | 87 ++++++++---- 3 files changed, 426 insertions(+), 133 deletions(-) diff --git a/randr.h b/randr.h index 5975cdc..be00793 100644 --- a/randr.h +++ b/randr.h @@ -43,6 +43,7 @@ typedef unsigned short XRandrMonitor; #define RRNumberErrors 0 #define RRNumberEvents 2 +#define RRNumberRequests 12 #define X_RRQueryVersion 0 /* we skip 1 to make old clients fail pretty immediately */ @@ -56,24 +57,39 @@ typedef unsigned short XRandrMonitor; #define X_RRGetScreenInfo 5 /* V1.2 additions */ -#define X_RRGetScreenSizeRange 6 -#define X_RRSetScreenSize 7 -#define X_RRGetMonitorInfo 8 -#define X_RRAddMonitorMode 9 -#define X_RRDeleteMonitorMode 10 -#define X_RRSetMonitorConfig 11 +#define X_RRGetScreenSizeRange 6 +#define X_RRSetScreenSize 7 +#define X_RRGetScreenResources 8 +#define X_RRGetOutputInfo 9 +#define X_RRListOutputProperties 10 +#define X_RRChangeOutputProperty 11 +#define X_RRDeleteOutputProperty 12 +#define X_RRGetOutputProperty 13 +#define X_RRCreateMode 14 +#define X_RRDestroyMode 15 +#define X_RRAddOutputMode 16 +#define X_RRDeleteOutputMode 17 +#define X_RRGetCrtcInfo 18 +#define X_RRSetCrtcConfig 19 +#define X_RRGetCrtcGammaSize 20 +#define X_RRGetCrtcGamma 21 +#define X_RRSetCrtcGamma 22 /* Event selection bits */ #define RRScreenChangeNotifyMask (1L << 0) /* V1.2 additions */ -#define RRMonitorChangeNotifyMask (1L << 1) +#define RRCrtcChangeNotifyMask (1L << 1) +#define RROutputChangeNotifyMask (1L << 2) +#define RROutputPropertyNotifyMask (1L << 3) /* Event codes */ #define RRScreenChangeNotify 0 /* V1.2 additions */ -#define RRNotify 1 +#define RRNotify 1 /* RRNotify Subcodes */ -#define RRNotify_MonitorChange 0 +#define RRNotify_CrtcChange 0 +#define RRNotify_OutputChange 1 +#define RRNotify_OutputProperty 2 /* used in the rotation field; rotation and reflection in 0.1 proto. */ #define RR_Rotate_0 1 @@ -92,7 +108,6 @@ typedef unsigned short XRandrMonitor; #define RRSetConfigFailed 3 /* new in 1.2 protocol */ -#define RR_MonitorDisabled 0xffff #define RR_HSyncPositive 0x00000001 #define RR_HSyncNegative 0x00000002 diff --git a/randrproto.h b/randrproto.h index 015df9a..9249239 100644 --- a/randrproto.h +++ b/randrproto.h @@ -43,11 +43,14 @@ #define Time CARD32 #define KeyCode CARD8 #define KeySym CARD32 +#define RROutput CARD32 +#define RRMode CARD32 +#define RRCrtc CARD32 +#define RRModeFlags CARD32 #define Rotation CARD16 #define SizeID CARD16 #define SubpixelOrder CARD16 -#define ModeID CARD16 /* * data structures @@ -175,17 +178,35 @@ typedef struct { * Additions for version 1.2 */ +typedef struct _xRRModeInfo { + RRMode id B32; + CARD16 width B16; + CARD16 height B16; + CARD32 mmWidth B32; + CARD32 mmHeight B32; + CARD32 dotClock B32; + CARD16 hSyncStart B16; + CARD16 hSyncEnd B16; + CARD16 hTotal B16; + CARD16 hSkew B16; + CARD16 vSyncStart B16; + CARD16 vSyncEnd B16; + CARD16 vTotal B16; + CARD16 nameLength B32; + RRModeFlags modeFlags B32; +} xRRModeInfo; + typedef struct { CARD8 reqType; CARD8 randrReqType; CARD16 length B16; - Window window B32; + Window window B32; } xRRGetScreenSizeRangeReq; #define sz_xRRGetScreenSizeRangeReq 8 typedef struct { BYTE type; /* X_Reply */ - CARD8 status; + CARD8 pad; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 minWidth B16; @@ -216,108 +237,291 @@ typedef struct { CARD8 randrReqType; CARD16 length B16; Window window B32; -} xRRGetMonitorModesReq; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Window root B32; - CARD16 i B16; - CARD16 m B16; - CARD16 b B16; - CARD16 pad0 B16; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; -} xRRGetMonitorModesReply; -#define sz_xRRGetMonitorModesReply 32 +} xRRGetScreenResourcesReq; +#define sz_xRRGetScreenResourcesReq 8 typedef struct { + BYTE type; + CARD8 pad; + CARD16 sequenceNumber B16; + CARD32 length B32; Time timestamp B32; Time configTimestamp B32; - INT16 x B16; - INT16 y B16; - Rotation rotation B16; - ModeID mode B16; - ModeID defaultMode B16; - Rotation rotations B16; - CARD16 firstMode B16; - CARD16 numModes B16; -} xRRMonitorInfo; -#define sz_xRRMonitorInfo 24 + CARD16 nCrtcs B16; + CARD16 nOutputs B16; + CARD16 nModes B16; + CARD16 nbytesNames B16; + CARD16 pad1 B16; + CARD32 pad2 B32; + CARD32 pad3 B32; +} xRRGetScreenResourcesReply; +#define sz_xRRGetScreenResourcesReply 32 typedef struct { - CARD16 width B16; - CARD16 height B16; - CARD32 widthInMillimeters B32; - CARD32 heightInMillimeters B32; - CARD32 dotClock B32; - CARD16 hSyncStart B16; - CARD16 hSyncEnd B16; - CARD16 hTotal B16; - CARD16 hSkew B16; - CARD16 vSyncStart B16; - CARD16 vSyncEnd B16; - CARD16 vTotal B16; - CARD16 nameLength B16; - CARD32 modeFlags B32; -} xRRMonitorMode; -#define sz_xRRMonitorMode 36 + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + Time configTimestamp B32; +} xRRGetOutputInfoReq; +#define sz_xRRGetOutputInfoReq 12 typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; - CARD16 monitorIndex B16; - CARD16 pad B16; - xRRMonitorMode mode; -} xRRAddMonitorModeReq; -#define sz_xRRAddMonitorModeReq 48 + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + Time timestamp B32; + RRCrtc crtc B32; + CARD8 connection; + CARD8 subpixelOrder; + CARD16 nCrtcs B16; + CARD16 nModes B16; + CARD16 nClones B16; + CARD16 nameLength B16; + CARD16 pad1 B16; + CARD32 pad2 B32; +} xRRGetOutputInfoReply; +#define sz_xRRGetOutputInfoReply 32 typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; - CARD16 monitorIndex B16; - CARD16 nameLength B16; -} xRRDeleteMonitorModeReq; -#define sz_xRRDeleteMonitorModeReq 12 + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; +} xRRListOutputPropertiesReq; +#define sz_xRRListOutputPropertiesReq 8 typedef struct { - CARD8 reqType; + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 nAtoms B16; + CARD16 pad1 B16; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xRRListOutputPropertiesReply; +#define sz_xRRListOutputPropertiesReply 32 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + Atom property B32; + Atom type B32; + CARD8 format; + CARD8 mode; + CARD16 pad; + CARD32 nUnits B32; +} xRRChangeOutputPropertyReq; +#define sz_xRRChangeOutputPropertyReq 24 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + Atom property B32; +} xDeleteOutputPropertyReq; +#define sz_xDeleteOutputPropertyReq 12 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + Atom property B32; + Atom type B32; + CARD32 longOffset B32; + CARD32 longLength B32; + BOOL delete; + CARD8 pad1; + CARD16 pad2; +} xGetOutputPropertyReq; +#define sz_xGetOutputPropertyReq 28 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + Atom propertyType B32; + CARD32 bytesAfter B32; + CARD32 nItems B32; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; +} xGetOutputPropertyReply; +#define sz_xGetOutputPropertyReply 32 + +typedef struct { + CARD8 reqType; CARD8 randrReqType; CARD16 length B16; Window window B32; - Time timestamp B32; + xRRModeInfo modeInfo; +} xRRCreateModeReq; +#define sz_xRRCreateModeReq 48 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + RRMode mode B32; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; +} xRRCreateModeReply; +#define sz_xRRCreateModeReply 32 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRMode mode B32; +} xRRDestroyModeReq; +#define sz_xRRDestroyModeReq 8 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + RRMode mode B32; +} xRRAddOutputModeReq; +#define sz_xRRAddOutputModeReq 12 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RROutput output B32; + RRMode mode B32; +} xRRDeleteOutputModeReq; +#define sz_xRRDeleteOutputModeReq 12 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRCrtc crtc B32; Time configTimestamp B32; - CARD16 monitorIndex B16; +} xGetCrtcInfoReq; +#define sz_xGetCrtcInfoReq 12 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; INT16 x B16; INT16 y B16; - ModeID mode B16; + CARD16 width B16; + CARD16 height B16; + RRMode mode B32; Rotation rotation B16; - CARD16 pad B16; -} xRRSetMonitorConfigReq; -#define sz_xRRSetMonitorConfigReq 28 + Rotation rotations B16; + CARD16 nOutput B16; + CARD16 nPossibleOutput B16; + CARD32 pad1 B32; + CARD32 pad2 B32; +} xRRGetCrtcInfoReply; +#define sz_xRRGetCrtcInfoReply 32 typedef struct { - BYTE type; /* X_Reply */ - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time timestamp B32; - Time configTimestamp B32; - Window root B32; - SubpixelOrder subpixelOrder B16; - CARD16 monitor B16; - CARD32 pad1 B32; - CARD32 pad2 B32; -} xRRSetMonitorConfigReply; + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRCrtc crtc B32; + Time timestamp B32; + Time configTimestamp B32; + INT16 x B16; + INT16 y B16; + RRMode mode B32; + Rotation rotation B16; + CARD16 nOutputs B16; +} xRRSetCrtcConfigReq; +#define sz_xRRSetCrtcConfigReq 28 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + Time timestamp B32; + CARD8 subpixelOrder; + CARD8 pad1; + CARD16 pad2 B16; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xRRSetCrtcConfigReply; +#define sz_xRRSetCrtcConfigReply 32 -#define sz_xRRSetMonitorConfigReply +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRCrtc crtc B32; +} xGetCrtcGammaSizeReq; +#define sz_xGetCrtcGammaSizeReq 8 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 size B16; + CARD16 pad1 B16; + CARD16 pad2 B32; + CARD16 pad3 B32; + CARD16 pad4 B32; + CARD16 pad5 B32; + CARD16 pad6 B32; +} xGetCrtcGammaSizeReply; +#define sz_xGetCrtcGammaSizeReply 32 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRCrtc crtc B32; +} xGetCrtcGammaReq; +#define sz_xGetCrtcGammaReq 8 + +typedef struct { + BYTE type; + CARD8 status; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 size B16; + CARD16 pad1 B16; + CARD16 pad2 B32; + CARD16 pad3 B32; + CARD16 pad4 B32; + CARD16 pad5 B32; + CARD16 pad6 B32; +} xGetCrtcGammaReply; +#define sz_xGetCrtcGammaReply 32 + +typedef struct { + CARD8 reqType; + CARD8 randrReqType; + CARD16 length B16; + RRCrtc crtc B32; + CARD16 size B16; + CARD16 pad1 B16; +} xRRSetCrtcGammaReq; +#define sz_xRRSetCrtcGammaReq 12 /* * event @@ -326,8 +530,8 @@ typedef struct { CARD8 type; /* always evBase + ScreenChangeNotify */ CARD8 rotation; /* new rotation */ CARD16 sequenceNumber B16; - Time timestamp B32; /* time screen was changed */ - Time configTimestamp B32; /* time config data was changed */ + Time timestamp B32; B32; /* time screen was changed */ + Time configTimestamp B32; B32; /* time config data was changed */ Window root B32; /* root window */ Window window B32; /* window requesting notification */ SizeID sizeID B16; /* new size ID */ @@ -340,23 +544,58 @@ typedef struct { #define sz_xRRScreenChangeNotifyEvent 32 typedef struct { - CARD8 type; /* always evBase + RRNotify */ - CARD8 subCode; /* RRNotify_MonitorChange */ + CARD8 type; /* always evBase + RRNotify */ + CARD8 subCode; /* RRNotify_CrtcChange */ CARD16 sequenceNumber B16; - Time timestamp B32; /* time screen was changed */ - Time configTimestamp B32; /* time config data was changed */ - Window root B32; /* root window */ + Time timestamp B32; /* time crtc was changed */ Window window B32; /* window requesting notification */ - CARD16 monitor B16; /* monitor index */ - ModeID modeID B16; /* mode ID */ - Rotation rotation B16; /* rotation/reflection */ - SubpixelOrder subpixelOrder B16; /* new subpixel order */ - INT16 x B16; /* x */ - INT16 y B16; /* y */ -} xRRMonitorChangeNotifyEvent; -#define sz_xRRMonitorChangeNotifyEvent 32 + RRCrtc crtc B32; /* affected CRTC */ + RRMode mode B32; /* current mode */ + CARD16 rotation B16; /* rotation and reflection */ + CARD16 pad1 B16; /* unused */ + INT16 x B16; /* new location */ + INT16 y B16; + CARD16 width B16; /* new size */ + CARD16 height B16; +} xRRCrtcChangeNotifyEvent; +#define sz_xRRCrtcChangeNotifyEvent 32 -#undef Window +typedef struct { + CARD8 type; /* always evBase + RRNotify */ + CARD8 subCode; /* RRNotify_OutputChange */ + CARD16 sequenceNumber B16; + Time timestamp B32; /* time crtc was changed */ + Time configTimestamp B32; /* time crtc was changed */ + Window window B32; /* window requesting notification */ + RROutput output B32; /* affected output */ + RRCrtc crtc B32; /* current crtc */ + RRMode mode B32; /* current mode */ + CARD16 rotation B16; /* rotation and reflection */ + CARD8 connection; /* connection status */ + CARD8 subpixelOrder; /* subpixel order */ +} xRROutputChangeNotifyEvent; +#define sz_xRROUtputChangeNotifyEvent 32 + +typedef struct { + CARD8 type; /* always evBase + RRNotify */ + CARD8 subCode; /* RRNotify_OutputProperty */ + CARD16 sequenceNumber B16; + Window window B32; /* window requesting notification */ + RROutput output B32; /* affected output */ + Atom atom B32; /* property name */ + Time timestamp B32; /* time crtc was changed */ + CARD8 state; /* NewValue or Deleted */ + CARD8 pad1; + CARD16 pad2 B16; + CARD32 pad3 B32; + CARD32 pad4 B32; +} xRROutputPropertyNotifyEvent; +#define sz_xRROUtputPropertyNotifyEvent 32 + + +#undef RROutput +#undef RRMode +#undef RRCrtc #undef Window #undef Font #undef Pixmap diff --git a/randrproto.txt b/randrproto.txt index be6b5e2..a0fc39d 100644 --- a/randrproto.txt +++ b/randrproto.txt @@ -230,15 +230,20 @@ SUBPIXELORDER { SubPixelUnknown The subpixel order uses the Render SCREENSIZE { widthInPixels, heightInPixels: CARD16 widthInMillimeters, heightInMillimeters: CARD16 } -MODEFLAG { hsync_positive hsync_negative - vsync_positive vsync_negative - interlace double_scan - csync csync_positive csync_negative - hskew_present - bcast - pixel_multiplex - double_clock - clock_divide_by_2 } +MODEFLAG { HSyncPositive + HSyncNegative + VSyncPositive + VSyncNegative + Interlace + DoubleScan + CSync + CSyncPositive + CSyncNegative + HSkewPresent + BCast + PixelMultiplex + DoubleClock + ClockDivideBy2 } MODEINFO { id: MODE name: STRING @@ -1100,6 +1105,7 @@ A.1 Common Types 0x0001 ScreenChangeNotifyMask 0x0002 CrtcChangeNotifyMask Added in version 1.2 0x0004 OutputChangeNotifyMask Added in version 1.2 + 0x0008 OutputPropertyNotifyMask Added in version 1.2 └─── Event select mask for RRSelectInput @@ -1139,6 +1145,24 @@ A.1 Common Types indicates that the timings are unknown or otherwise unused. The name itself will be encoded separately in each usage. +┌─── + MODEFLAG + 0x00000001 HSyncPositive + 0x00000002 HSyncNegative + 0x00000004 VSyncPositive + 0x00000008 VSyncNegative + 0x00000010 Interlace + 0x00000020 DoubleScan + 0x00000040 CSync + 0x00000080 CSyncPositive + 0x00000100 CSyncNegative + 0x00000200 HSkewPresent + 0x00000400 BCast + 0x00000800 PixelMultiplex + 0x00001000 DoubleClock + 0x00002000 ClockDivideBy2 +└─── + A.2 Protocol Requests Opcodes 1 and 3 were used in the 0.0 protocols, and will return @@ -1301,8 +1325,9 @@ A.2.1 Protocol Requests added with version 1.2 1 SUBPIXELORDER subpixel-order 2 c number of CRTCs 2 m number of modes + 2 o number of clones 2 n length of name - 8 unused + 6 unused 4c LISTofCRTC crtcs 4m LISTofMODE modes n STRING8 name @@ -1541,11 +1566,27 @@ A.3 Protocol Events A.3.1 Protocol Events added with version 1.2 ┌─── - RROutputChangeNotify + RRCrtcChangeNotify 1 Base + 1 code 1 0 sub-code 2 CARD16 sequence number 4 TIMESTAMP timestamp + 4 WINDOW request window + 4 CRTC crtc affected + 4 MODE mode in use + 2 ROTATION new rotation and reflection + 2 unused + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height +└─── +┌─── + RROutputChangeNotify + 1 Base + 1 code + 1 1 sub-code + 2 CARD16 sequence number + 4 TIMESTAMP timestamp 4 TIMESTAMP configuration timestamp 4 WINDOW request window 4 OUTPUT output affected @@ -1556,20 +1597,18 @@ A.3.1 Protocol Events added with version 1.2 1 SUBPIXELORDER subpixel order └─── ┌─── - RRCrtcChangeNotify - 1 Base + 2 code - 1 1 sub-code + RROutputPropertyNotify + 1 Base + 1 code + 1 2 sub-code 2 CARD16 sequence number - 4 TIMESTAMP timestamp - 4 WINDOW request window - 4 CRTC crtc affected - 4 MODE mode in use - 2 ROTATION new rotation and reflection - 2 INT16 x - 2 INT16 y - 2 CARD16 width - 2 CARD16 height - 2 unused + 4 WINDOW window + 4 OUTPUT output + 4 ATOM atom + 4 TIMESTAMP time + 1 state + 0 NewValue + 1 Deleted + 11 unused └─── Bibliography -- cgit v1.2.1