[Xcb] randr for xcb

Jeremy Kolb jkolb@brandeis.edu
Sun Jan 23 20:25:20 PST 2005


Josh Triplett wrote:
> Jeremy Kolb wrote:
> 
>>Here's RANDR.  It seems to work, though I haven't tested all of it by
>>anymeans.  It should be pretty simple to port xrandr to xcb so that it
>>could be tested more thoroughly.
> 
> 
> Excellent work, thanks!  Two minor issues:
> 
> * For consistency and clarity, please s/num_of_size/sizes_len/ and
> s/len_rate/rates_len/ in the GetScreenInfo reply.
> 
> * Lists don't seem to be included.  For example, the GetScreenInfo reply
> should have a list of ScreenSize structures and a list of refresh rates.
>  See
> http://cvs.freedesktop.org/xlibs/Randr/protocol?rev=1.1.1.1&view=auto
> for details.
> 
> With those two changes, this looks like it is ready to commit to the XCB
> repository.
> 
> - Josh Triplett



Sorry, we lost power in my area of campus (just us and our neighbors, no 
one else) all day and we finally got it back so I just sat down and made 
these changes.  I am however a bit confused about these lists.

This is the reply:

rotations: SETofROTATION
	root: WINDOW
	timestamp: TIMESTAMP
	config-timestamp: TIMESTAMP
	nSizes: CARD16
	sizeID: SIZEID
	rotation: ROTATION
	rate: CARD16
	sizes: LISTofSCREENSIZE
	refresh: LISTofREFRESH

	where:

	SCREENSIZE {
		 widthInPixels, heightInPixels: CARD16
		  widthInMillimeters, heightInMillimeters: CARD16 }

	REFRESH {
		rates: LISTofCARD16
	}

However this is the actual encoding:

1	1			Reply
	1	CARD8			set of Rotations
	2	CARD16			sequence number
	4	0			reply length
	4	WINDOW			root window
	4	TIMESTAMP		timestamp
	4	TIMESTAMP		config timestamp
	2	CARD16			number of SIZE following
	2	SIZEID			sizeID
	2	ROTATION		current rotation and reflection
	2	CARD16			rate (1.1)
	2	CARD16			length of rate info (number of CARD16s)
	2	CARD16			pad

	SIZE
	2	CARD16			width in pixels
	2	CARD16			height in pixels
	2	CARD16			width in millimeters
	2	CARD16			height in millimeters

	REFRESH
	2	CARD16			number of rates (n)
	2n	CARD16			rates


So in the bottom one it seems like the REFRESH struct contains a number 
and then the rates, but the top one just has a list of them.  The 
encoding aalso seems to have the length of the rate info while above 
this isn't there.  So I'm not sure how to do this one.

Jeremy


More information about the xcb mailing list